Source code for rsrtx.Implementations.Layout.Histogram

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 HistogramCls:
	"""
	| Commands in total: 16
	| Subgroups: 5
	| Direct child commands: 3
	"""

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

	@property
	def mode(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_mode'):
			from .Mode import ModeCls
			self._mode = ModeCls(self._core, self._cmd_group)
		return self._mode

	@property
	def source(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_source'):
			from .Source import SourceCls
			self._source = SourceCls(self._core, self._cmd_group)
		return self._source

	@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 horz(self):
		"""
		| Commands in total: 5
		| Subgroups: 3
		| Direct child commands: 0
		"""
		if not hasattr(self, '_horz'):
			from .Horz import HorzCls
			self._horz = HorzCls(self._core, self._cmd_group)
		return self._horz

	@property
	def vertical(self):
		"""
		| Commands in total: 5
		| Subgroups: 3
		| 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 - Histogram_Name: str: String defining the histogram name which is used to refer to the histogram by other functions. - Source: enums.SignalSource: Data source of the histogram, see 'Waveform parameter' - Xstart: int: Defines the start value of the x-value range. - Xstop: int: Defines the stop value of the x-value range. - Ystart: int: Defines the start value of the y-value range. - Ystop: int: Defines the stop value of the y-value range. - Relative: bool: Defines whether relative or absolute values are used for the value range definition. - Orientation: enums.HistogramLayoutMode: VERTical | HORizontal """ __meta_args_list = [ ArgStruct.scalar_str('Histogram_Name'), ArgStruct.scalar_enum('Source', enums.SignalSource), ArgStruct.scalar_int('Xstart'), ArgStruct.scalar_int('Xstop'), ArgStruct.scalar_int('Ystart'), ArgStruct.scalar_int('Ystop'), ArgStruct.scalar_bool('Relative'), ArgStruct.scalar_enum('Orientation', enums.HistogramLayoutMode)] def __init__(self): StructBase.__init__(self, self) self.Histogram_Name: str=None self.Source: enums.SignalSource=None self.Xstart: int=None self.Xstop: int=None self.Ystart: int=None self.Ystop: int=None self.Relative: bool=None self.Orientation: enums.HistogramLayoutMode=None
[docs] def set_add(self, value: AddStruct) -> None: """ ``LAYout:HISTogram:ADD`` \n Snippet with structure: \n structure = driver.layout.histogram.AddStruct() \n structure.Histogram_Name: str = 'abc' \n structure.Source: enums.SignalSource = enums.SignalSource.AJ1 \n structure.Xstart: int = 1 \n structure.Xstop: int = 1 \n structure.Ystart: int = 1 \n structure.Ystop: int = 1 \n structure.Relative: bool = False \n structure.Orientation: enums.HistogramLayoutMode = enums.HistogramLayoutMode.HORizontal \n driver.layout.histogram.set_add(value = structure) \n Defines and displays a new histogram for the specified source. Note: To define the mode of the histogram (vertical or horizontal) , use the method ``RsRtx.layout.histogram.mode.set()`` command. For numerical values, the input of a unit is not supported for this command. :param value: see the help for AddStruct structure arguments. """ self._core.io.write_struct_with_opc('LAYout:HISTogram:ADD', value)
[docs] def set_remove(self, name: str) -> None: """ ``LAYout:HISTogram:REMove`` \n Snippet: ``driver.layout.histogram.set_remove(name = 'abc')`` \n Removes the specified histogram. """ param = Conversions.value_to_quoted_str(name) self._core.io.write_with_opc(f'LAYout:HISTogram:REMove {param}')
[docs] def reset(self, histogram: str) -> None: """ ``LAYout:HISTogram:RESet`` \n Snippet: ``driver.layout.histogram.reset(histogram = 'abc')`` \n Resets the values to begin a new histogram. """ param = Conversions.value_to_quoted_str(histogram) self._core.io.write_with_opc(f'LAYout:HISTogram:RESet {param}')
def clone(self) -> 'HistogramCls': """ 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 = HistogramCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group