from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import enums
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class AlgorithmCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("algorithm", core, parent)
[docs]
def set(self, meas_lev_algorithm: enums.EyeMeasLevAlgorithm, settings=repcap.Settings.Default) -> None:
"""
``MDEFaults:SETTings<*>:EYE:ALGorithm`` \n
Snippet: ``driver.mdefaults.settings.eye.algorithm.set(meas_lev_algorithm = enums.EyeMeasLevAlgorithm.INNPeak, settings = repcap.Settings.Default)`` \n
Selects the algorithm, which defines how to compute the top and base levels and the corresponding sigma values.
:param meas_lev_algorithm: MEAN | PEAK | INNPeak | OUTPeak \n
- MEAN: Mean value of the histogram. The Sigma value is the standard deviation of the histogram.
- PEAK: Maximum peak of the histogram. Only values corresponding to this peak are used to compute sigma.
- INNPeak: Inner peak of the histogram. Only values corresponding to this peak are used to compute sigma.
- OUTPeak: Outer peak of the histogram. Only values corresponding to this peak are used to compute sigma.
:param settings: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Settings')
"""
param = Conversions.enum_scalar_to_str(meas_lev_algorithm, enums.EyeMeasLevAlgorithm)
settings_cmd_val = self._cmd_group.get_repcap_cmd_value(settings, repcap.Settings)
self._core.io.write(f'MDEFaults:SETTings{settings_cmd_val}:EYE:ALGorithm {param}')
# noinspection PyTypeChecker
[docs]
def get(self, settings=repcap.Settings.Default) -> enums.EyeMeasLevAlgorithm:
"""
``MDEFaults:SETTings<*>:EYE:ALGorithm`` \n
Snippet: ``value: enums.EyeMeasLevAlgorithm = driver.mdefaults.settings.eye.algorithm.get(settings = repcap.Settings.Default)`` \n
Selects the algorithm, which defines how to compute the top and base levels and the corresponding sigma values.
:param settings: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Settings')
:return: meas_lev_algorithm: MEAN | PEAK | INNPeak | OUTPeak \n
- MEAN: Mean value of the histogram. The Sigma value is the standard deviation of the histogram.
- PEAK: Maximum peak of the histogram. Only values corresponding to this peak are used to compute sigma.
- INNPeak: Inner peak of the histogram. Only values corresponding to this peak are used to compute sigma.
- OUTPeak: Outer peak of the histogram. Only values corresponding to this peak are used to compute sigma.
"""
settings_cmd_val = self._cmd_group.get_repcap_cmd_value(settings, repcap.Settings)
response = self._core.io.query_str(f'MDEFaults:SETTings{settings_cmd_val}:EYE:ALGorithm?')
return Conversions.str_to_scalar_enum(response, enums.EyeMeasLevAlgorithm)