Source code for rsrtx.Implementations.Wgenerator.Modulation.Fsk.Rate

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


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

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

[docs] def set(self, rate: float, wgenerator=repcap.Wgenerator.Default) -> None: """ ``WGENerator<*>:MODulation:FSK[:RATE]`` \n Snippet: ``driver.wgenerator.modulation.fsk.rate.set(rate = 1.0, wgenerator = repcap.Wgenerator.Default)`` \n Sets the hop rate, the time before a switch from the carrier frequency set with method ``RsRtx.wgenerator.modulation.fsk.fone.set()`` and the modulation frequency set with method ``RsRtx.wgenerator.modulation.fsk.ftwo.set()`` . :param rate: 1E-3 to 1E+6 :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') """ param = Conversions.decimal_value_to_str(rate) wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) self._core.io.write(f'WGENerator{wgenerator_cmd_val}:MODulation:FSK:RATE {param}')
[docs] def get(self, wgenerator=repcap.Wgenerator.Default) -> float: """ ``WGENerator<*>:MODulation:FSK[:RATE]`` \n Snippet: ``value: float = driver.wgenerator.modulation.fsk.rate.get(wgenerator = repcap.Wgenerator.Default)`` \n Sets the hop rate, the time before a switch from the carrier frequency set with method ``RsRtx.wgenerator.modulation.fsk.fone.set()`` and the modulation frequency set with method ``RsRtx.wgenerator.modulation.fsk.ftwo.set()`` . :param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator') :return: rate: 1E-3 to 1E+6 """ wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator) response = self._core.io.query_str(f'WGENerator{wgenerator_cmd_val}:MODulation:FSK:RATE?') return Conversions.str_to_float(response)