from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ......Internal.Types import DataType
from ......Internal.ArgSingleList import ArgSingleList
from ......Internal.ArgSingle import ArgSingle
from ...... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AvgCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("avg", core, parent)
[docs]
def get(self, voltage_meas_type: enums.PowerRippleMeasType=None) -> float:
"""
``POWer:RIPPle:RESult:PDEL:AVG`` \n
Snippet: ``value: float = driver.power.ripple.result.pdel.avg.get(voltage_meas_type = enums.PowerRippleMeasType.CURRENT)`` \n
Return the specified statistic result for the peak to peak measurement.
The command affects the content of export files as well as data retrieved with: \n
- [:ACTual]: current measurement result
- AVG: average of the long-term measurement results
- EVTCount: number of measurement results in the long-term measurement
- NPEak: negative peak value of the long-term measurement results
- PPEak: positive peak value of the long-term measurement results
- RMS: RMS value of the long-term measurement results
- STDDev: standard deviation of the long-term measurement results
:param voltage_meas_type: VOLTage | CURRent
:return: value: Statistic result
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('voltage_meas_type', voltage_meas_type, DataType.Enum, enums.PowerRippleMeasType, is_optional=True))
response = self._core.io.query_str(f'POWer:RIPPle:RESult:PDEL:AVG? {param}'.rstrip())
return Conversions.str_to_float(response)