Source code for rsrtx.Implementations.Measurement.AmpTime.PtCount

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


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

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

[docs] def set(self, pulse_count: int, measurement=repcap.Measurement.Default) -> None: """ ``MEASurement<*>:AMPTime:PTCount`` \n Snippet: ``driver.measurement.ampTime.ptCount.set(pulse_count = 1, measurement = repcap.Measurement.Default)`` \n Sets the number of positive pulses for the pulse train measurement. It measures the duration of N positive pulses from the rising edge of the first pulse to the falling edge of the N-th pulse. :param pulse_count: 1 to 2.14748E+9 :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') """ param = Conversions.decimal_value_to_str(pulse_count) measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement) self._core.io.write_with_opc(f'MEASurement{measurement_cmd_val}:AMPTime:PTCount {param}')
[docs] def get(self, measurement=repcap.Measurement.Default) -> int: """ ``MEASurement<*>:AMPTime:PTCount`` \n Snippet: ``value: int = driver.measurement.ampTime.ptCount.get(measurement = repcap.Measurement.Default)`` \n Sets the number of positive pulses for the pulse train measurement. It measures the duration of N positive pulses from the rising edge of the first pulse to the falling edge of the N-th pulse. :param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement') :return: pulse_count: 1 to 2.14748E+9 """ 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}:AMPTime:PTCount?') return Conversions.str_to_int(response)