Source code for rsrtx.Implementations.Wgenerator.Function.Pulse.Width

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


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

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

[docs] def set(self, pulse_width: float, wgenerator=repcap.Wgenerator.Default) -> None: """ ``WGENerator<*>:FUNCtion:PULSe[:WIDTh]`` \n Snippet: ``driver.wgenerator.function.pulse.width.set(pulse_width = 1.0, wgenerator = repcap.Wgenerator.Default)`` \n Sets the pulse duration for a pulse waveform. :param pulse_width: 16.5E-9 to 1000, actual range depends on the selected frequency :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') """ param = Conversions.decimal_value_to_str(pulse_width) wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) self._core.io.write(f'WGENerator{wgenerator_cmd_val}:FUNCtion:PULSe:WIDTh {param}')
[docs] def get(self, wgenerator=repcap.Wgenerator.Default) -> float: """ ``WGENerator<*>:FUNCtion:PULSe[:WIDTh]`` \n Snippet: ``value: float = driver.wgenerator.function.pulse.width.get(wgenerator = repcap.Wgenerator.Default)`` \n Sets the pulse duration for a pulse waveform. :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') :return: pulse_width: 16.5E-9 to 1000, actual range depends on the selected frequency """ wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) response = self._core.io.query_str(f'WGENerator{wgenerator_cmd_val}:FUNCtion:PULSe:WIDTh?') return Conversions.str_to_float(response)