Source code for rsmxo.Implementations.Histogram

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal.RepeatedCapability import RepeatedCapability
from ... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class HistogramCls:
	"""
	| Commands in total: 26
	| Subgroups: 7
	| Direct child commands: 1

	Repeated Capability Setting:
	
	.. code-block:: python
	
			# Range: Nr1 .. Nr8 \n
			driver.histogram.repcap_histogram_set(repcap.Histogram.Nr1)
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("histogram", core, parent)
		self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_histogram_get', 'repcap_histogram_set', repcap.Histogram.Nr1)

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

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

	@property
	def add(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_add'):
			from .Add import AddCls
			self._add = AddCls(self._core, self._cmd_group)
		return self._add

	@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 count(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_count'):
			from .Count import CountCls
			self._count = CountCls(self._core, self._cmd_group)
		return self._count

	@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 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 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 window(self):
		"""
		| Commands in total: 19
		| Subgroups: 3
		| Direct child commands: 0
		"""
		if not hasattr(self, '_window'):
			from .Window import WindowCls
			self._window = WindowCls(self._core, self._cmd_group)
		return self._window

[docs] def reset(self, histogram=repcap.Histogram.Default) -> None: """ ``HISTogram<*>:RESet`` \n Snippet: ``driver.histogram.reset(histogram = repcap.Histogram.Default)`` \n Restarts the calculation of the selected histogram. To reset all histograms and measurements, use method ``RsMxo.display.clr.set()`` . :param histogram: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Histogram') """ histogram_cmd_val = self._cmd_group.get_repcap_cmd_value(histogram, repcap.Histogram) self._core.io.write(f'HISTogram{histogram_cmd_val}:RESet')
[docs] def reset_and_wait(self, histogram=repcap.Histogram.Default, opc_timeout_ms: int = -1) -> None: histogram_cmd_val = self._cmd_group.get_repcap_cmd_value(histogram, repcap.Histogram) """ ``HISTogram<*>:RESet`` \n Snippet: ``driver.histogram.reset_and_wait(histogram = repcap.Histogram.Default)`` \n Restarts the calculation of the selected histogram. To reset all histograms and measurements, use method ``RsMxo.display.clr.set()`` . Same as reset, but waits for the operation to complete before continuing further. Use the RsMxo.utilities.opc_timeout_set() to set the timeout value. :param histogram: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Histogram') :param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call. """ self._core.io.write_with_opc(f'HISTogram{histogram_cmd_val}:RESet', opc_timeout_ms)
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