from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class HbInsCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("hbIns", core, parent)
[docs]
def set(self, histogram_bins: int, measurement=repcap.Measurement.Default) -> None:
"""
``MEASurement<*>:STATistics:HBINs`` \n
Snippet: ``driver.measurement.statistics.hbIns.set(histogram_bins = 1, measurement = repcap.Measurement.Default)`` \n
Sets the number of bins - the number of vertical bars that build the histogram. If method
``RsRtx.measurement.vertical.cont.set()`` is ON, the instrument determines the number of bins automatically based on the
time base, the current measurements, and other settings.
:param histogram_bins: 2 to 1000
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
"""
param = Conversions.decimal_value_to_str(histogram_bins)
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:HBINs {param}')
[docs]
def get(self, measurement=repcap.Measurement.Default) -> int:
"""
``MEASurement<*>:STATistics:HBINs`` \n
Snippet: ``value: int = driver.measurement.statistics.hbIns.get(measurement = repcap.Measurement.Default)`` \n
Sets the number of bins - the number of vertical bars that build the histogram. If method
``RsRtx.measurement.vertical.cont.set()`` is ON, the instrument determines the number of bins automatically based on the
time base, the current measurements, and other settings.
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: histogram_bins: 2 to 1000
"""
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:HBINs?')
return Conversions.str_to_int(response)