from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ThdCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("thd", core, parent)
[docs]
def set(self, mode: enums.UnitMode) -> None:
"""
``UNIT:THD`` \n
Snippet: ``driver.unit.thd.set(mode = enums.UnitMode.DB)`` \n
Selects the unit for THD measurements (<n> is irrelevant) . Is identical to CALC:UNIT:THD
:param mode: DB | PCT
"""
param = Conversions.enum_scalar_to_str(mode, enums.UnitMode)
self._core.io.write(f'UNIT:THD {param}')
# noinspection PyTypeChecker
[docs]
def get(self) -> enums.UnitMode:
"""
``UNIT:THD`` \n
Snippet: ``value: enums.UnitMode = driver.unit.thd.get()`` \n
Selects the unit for THD measurements (<n> is irrelevant) . Is identical to CALC:UNIT:THD
:return: mode: DB | PCT
"""
response = self._core.io.query_str(f'UNIT:THD?')
return Conversions.str_to_scalar_enum(response, enums.UnitMode)