from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DcycleCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dcycle", core, parent)
[docs]
def set(self, square_duty_cycle: float, wgenerator=repcap.Wgenerator.Default) -> None:
"""
``WGENerator<*>:MODulation:FM:DCYCle`` \n
Snippet: ``driver.wgenerator.modulation.fm.dcycle.set(square_duty_cycle = 1.0, wgenerator = repcap.Wgenerator.Default)`` \n
Sets the duty cycle of a square waveform for frequency modulation, if method ``RsRtx.wgenerator.modulation.typePy.set()``
is set to FM.
:param square_duty_cycle: 10 to 90
:param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator')
"""
param = Conversions.decimal_value_to_str(square_duty_cycle)
wgenerator_cmd_val = self._cmd_group.get_repcap_cmd_value(wgenerator, repcap.Wgenerator)
self._core.io.write(f'WGENerator{wgenerator_cmd_val}:MODulation:FM:DCYCle {param}')
[docs]
def get(self, wgenerator=repcap.Wgenerator.Default) -> float:
"""
``WGENerator<*>:MODulation:FM:DCYCle`` \n
Snippet: ``value: float = driver.wgenerator.modulation.fm.dcycle.get(wgenerator = repcap.Wgenerator.Default)`` \n
Sets the duty cycle of a square waveform for frequency modulation, if method ``RsRtx.wgenerator.modulation.typePy.set()``
is set to FM.
:param wgenerator: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Wgenerator')
:return: square_duty_cycle: 10 to 90
"""
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:FM:DCYCle?')
return Conversions.str_to_float(response)