from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class TimeCls:
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("time", core, parent)
# noinspection PyTypeChecker
[docs]
def get_mode(self) -> enums.ArbMultCarrSigDurMod:
"""
``[SOURce<HW>]:BB:ARBitrary:MCARrier:TIME:MODE`` \n
Snippet: ``value: enums.ArbMultCarrSigDurMod = driver.source.bb.arbitrary.mcarrier.time.get_mode()`` \n
Selects the mode for calculating the resulting signal period of the multi-carrier waveform. The resulting period is
always calculated for all carriers in the carrier table irrespective of their state (ON/OFF) .
:return: mode: USER | LONG | SHORt | LCM
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:ARBitrary:MCARrier:TIME:MODE?')
return Conversions.str_to_scalar_enum(response, enums.ArbMultCarrSigDurMod)
[docs]
def set_mode(self, mode: enums.ArbMultCarrSigDurMod) -> None:
"""
``[SOURce<HW>]:BB:ARBitrary:MCARrier:TIME:MODE`` \n
Snippet: ``driver.source.bb.arbitrary.mcarrier.time.set_mode(mode = enums.ArbMultCarrSigDurMod.LCM)`` \n
Selects the mode for calculating the resulting signal period of the multi-carrier waveform. The resulting period is
always calculated for all carriers in the carrier table irrespective of their state (ON/OFF) .
:param mode: USER | LONG | SHORt | LCM
"""
param = Conversions.enum_scalar_to_str(mode, enums.ArbMultCarrSigDurMod)
self._core.io.write(f'SOURce<HwInstance>:BB:ARBitrary:MCARrier:TIME:MODE {param}')
[docs]
def get_value(self) -> float:
"""
``[SOURce<HW>]:BB:ARBitrary:MCARrier:TIME`` \n
Snippet: ``value: float = driver.source.bb.arbitrary.mcarrier.time.get_value()`` \n
Sets the user-defined signal period.
:return: time: float Range: 0 to 1E9, Unit: s
"""
response = self._core.io.query_str('SOURce<HwInstance>:BB:ARBitrary:MCARrier:TIME?')
return Conversions.str_to_float(response)
[docs]
def set_value(self, time: float) -> None:
"""
``[SOURce<HW>]:BB:ARBitrary:MCARrier:TIME`` \n
Snippet: ``driver.source.bb.arbitrary.mcarrier.time.set_value(time = 1.0)`` \n
Sets the user-defined signal period.
:param time: float Range: 0 to 1E9, Unit: s
"""
param = Conversions.decimal_value_to_str(time)
self._core.io.write(f'SOURce<HwInstance>:BB:ARBitrary:MCARrier:TIME {param}')