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
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ActualCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("actual", core, parent)
[docs]
def get(self, meas_type: enums.MeasurementType=None, base_level: float=None, target_level: float=None, measurement=repcap.Measurement.Default) -> float:
"""
``MEASurement<*>:RESult[:ACTual]`` \n
Snippet: ``value: float = driver.measurement.result.actual.get(meas_type = enums.MeasurementType.ACPower, base_level = 1.0, target_level = 1.0, measurement = repcap.Measurement.Default)`` \n
Return the statistic results of the specified measurement. If no parameter is specified, the result of the main
measurement is returned. The main measurement is defined using method ``RsRtx.measurement.main.set()`` .
Use the following commands to set up the application: \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
- RELiability: reliability of the measurement result
- RMS: RMS value of the long-term measurement results
- STDDev: standard deviation of the long-term measurement results
For a detailed description of the results, see 'Selection of the measurement group: MEASurement<m>'.
:param meas_type: See method ``RsRtx.measurement.main.set()``.
:param base_level: Sets the base level for signals with PAM order 2
:param target_level: Sets the target level for signals with PAM order 2
:param measurement: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Measurement')
:return: actual: Measurement result
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('meas_type', meas_type, DataType.Enum, enums.MeasurementType, is_optional=True), ArgSingle('base_level', base_level, DataType.Float, None, is_optional=True), ArgSingle('target_level', target_level, DataType.Float, None, is_optional=True))
measurement_cmd_val = self._cmd_group.get_repcap_cmd_value(measurement, repcap.Measurement)
response = self._core.io.query_str(f'MEASurement{measurement_cmd_val}:RESult:ACTual? {param}'.rstrip())
return Conversions.str_to_float(response)