Source code for rsrtx.Implementations.Measurement.Statistics.Histogram

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap


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

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

[docs] def set(self, show_histogram: bool, measurement=repcap.Measurement.Default) -> None: """ ``MEASurement<*>:STATistics:HISTogram`` \n Snippet: ``driver.measurement.statistics.histogram.set(show_histogram = False, measurement = repcap.Measurement.Default)`` \n Displays a histogram of the statistical results. Enabling the histogram enables also the calculation and display of statistics for the measurement results if statistics were disabled. the histogram shows the cumulative occurence distribution of mean measurement results in a graphic. :param show_histogram: OFF | ON :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') """ param = Conversions.bool_to_str(show_histogram) measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:STATistics:HISTogram {param}')
[docs] def get(self, measurement=repcap.Measurement.Default) -> bool: """ ``MEASurement<*>:STATistics:HISTogram`` \n Snippet: ``value: bool = driver.measurement.statistics.histogram.get(measurement = repcap.Measurement.Default)`` \n Displays a histogram of the statistical results. Enabling the histogram enables also the calculation and display of statistics for the measurement results if statistics were disabled. the histogram shows the cumulative occurence distribution of mean measurement results in a graphic. :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') :return: show_histogram: OFF | ON """ measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) response = self._core.io.query_str_with_opc(f'MEASurement{measurement_cmd_val}:STATistics:HISTogram?') return Conversions.str_to_bool(response)