from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class QualityCls:
"""
| Commands in total: 18
| Subgroups: 3
| Direct child commands: 3
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("quality", core, parent)
@property
def execute(self):
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
if not hasattr(self, '_execute'):
from .Execute import ExecuteCls
self._execute = ExecuteCls(self._core, self._cmd_group)
return self._execute
@property
def report(self):
"""
| Commands in total: 1
| Subgroups: 1
| Direct child commands: 0
"""
if not hasattr(self, '_report'):
from .Report import ReportCls
self._report = ReportCls(self._core, self._cmd_group)
return self._report
@property
def result(self):
"""
| Commands in total: 13
| Subgroups: 3
| Direct child commands: 0
"""
if not hasattr(self, '_result'):
from .Result import ResultCls
self._result = ResultCls(self._core, self._cmd_group)
return self._result
# noinspection PyTypeChecker
[docs]
def get_freq(self) -> enums.PwrQualFrequency:
"""
``POWer:QUALity:FREQ`` \n
Snippet: ``value: enums.PwrQualFrequency = driver.power.quality.get_freq()`` \n
Sets the input frequency of the source signal in Hz.
:return: frequency: NFF650: 360 to 650 Hz WFF800: 360 to 800 Hz FCUS: user-defined frequency to be set using method ``RsRtx.power.quality.fcus()``.
"""
response = self._core.io.query_str('POWer:QUALity:FREQ?')
return Conversions.str_to_scalar_enum(response, enums.PwrQualFrequency)
[docs]
def set_freq(self, frequency: enums.PwrQualFrequency) -> None:
"""
``POWer:QUALity:FREQ`` \n
Snippet: ``driver.power.quality.set_freq(frequency = enums.PwrQualFrequency.F360)`` \n
Sets the input frequency of the source signal in Hz.
:param frequency: NFF650: 360 to 650 Hz WFF800: 360 to 800 Hz FCUS: user-defined frequency to be set using method ``RsRtx.power.quality.fcus()``.
"""
param = Conversions.enum_scalar_to_str(frequency, enums.PwrQualFrequency)
self._core.io.write(f'POWer:QUALity:FREQ {param}')
[docs]
def get_fcus(self) -> float:
"""
``POWer:QUALity:FCUS`` \n
Snippet: ``value: float = driver.power.quality.get_fcus()`` \n
Sets the user-defined frequency if method ``RsRtx.power.quality.freq()`` is set to FCUS.
:return: custom_freq: 1 to 5000
"""
response = self._core.io.query_str('POWer:QUALity:FCUS?')
return Conversions.str_to_float(response)
[docs]
def set_fcus(self, custom_freq: float) -> None:
"""
``POWer:QUALity:FCUS`` \n
Snippet: ``driver.power.quality.set_fcus(custom_freq = 1.0)`` \n
Sets the user-defined frequency if method ``RsRtx.power.quality.freq()`` is set to FCUS.
:param custom_freq: 1 to 5000
"""
param = Conversions.decimal_value_to_str(custom_freq)
self._core.io.write(f'POWer:QUALity:FCUS {param}')
# noinspection PyTypeChecker
[docs]
def get_auto(self) -> enums.AutoScale:
"""
``POWer:QUALity:AUTO`` \n
Snippet: ``value: enums.AutoScale = driver.power.quality.get_auto()`` \n
Selects the scaling for the display of the results.
:return: auto_scale: AUTO | MANUAL
"""
response = self._core.io.query_str('POWer:QUALity:AUTO?')
return Conversions.str_to_scalar_enum(response, enums.AutoScale)
[docs]
def set_auto(self, auto_scale: enums.AutoScale) -> None:
"""
``POWer:QUALity:AUTO`` \n
Snippet: ``driver.power.quality.set_auto(auto_scale = enums.AutoScale.AUTO)`` \n
Selects the scaling for the display of the results.
:param auto_scale: AUTO | MANUAL
"""
param = Conversions.enum_scalar_to_str(auto_scale, enums.AutoScale)
self._core.io.write(f'POWer:QUALity:AUTO {param}')
def clone(self) -> 'QualityCls':
"""
Clones the group by creating new object from it and its whole existing subgroups.
Also copies all the existing default Repeated Capabilities setting,
which you can change independently without affecting the original group.
"""
new_group = QualityCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group