Source code for rsrtx.Implementations.Measurement.DetThreshold

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


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

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

[docs] def set(self, sign_detect_thres: float, measurement=repcap.Measurement.Default) -> None: """ ``MEASurement<*>:DETThreshold`` \n Snippet: ``driver.measurement.detThreshold.set(sign_detect_thres = 1.0, measurement = repcap.Measurement.Default)`` \n The measured signal value must reach a certain voltage or bit to be included in the measurement algorithm. This minimum value is defined in percent of the signal amplitude (difference of high and low signal levels) . Values below this value are considered to be noise and they are ignored. The setting is relevant for area, time, and counting measurements. :param sign_detect_thres: 0 to 50 :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') """ param = Conversions.decimal_value_to_str(sign_detect_thres) measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:DETThreshold {param}')
[docs] def get(self, measurement=repcap.Measurement.Default) -> float: """ ``MEASurement<*>:DETThreshold`` \n Snippet: ``value: float = driver.measurement.detThreshold.get(measurement = repcap.Measurement.Default)`` \n The measured signal value must reach a certain voltage or bit to be included in the measurement algorithm. This minimum value is defined in percent of the signal amplitude (difference of high and low signal levels) . Values below this value are considered to be noise and they are ignored. The setting is relevant for area, time, and counting measurements. :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') :return: sign_detect_thres: 0 to 50 """ 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}:DETThreshold?') return Conversions.str_to_float(response)