from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.RepeatedCapability import RepeatedCapability
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ViolationCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
Repeated Capability Setting:
.. code-block:: python
# Range: Nr1 .. Nr16 \n
driver.p3Phase.harmonics.result.violation.repcap_power3PhaseHarmonics_set(repcap.Power3PhaseHarmonics.Nr1)
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("violation", core, parent)
self._cmd_group.rep_cap = RepeatedCapability(self._cmd_group.group_name, 'repcap_power3PhaseHarmonics_get', 'repcap_power3PhaseHarmonics_set', repcap.Power3PhaseHarmonics.Nr1)
def repcap_power3PhaseHarmonics_set(self, power3PhaseHarmonics: repcap.Power3PhaseHarmonics) -> None:
"""
Repeated Capability default value numeric suffix.
This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to Power3PhaseHarmonics.Default.
Default value after init: Power3PhaseHarmonics.Nr1
"""
self._cmd_group.set_repcap_enum_value(power3PhaseHarmonics)
def repcap_power3PhaseHarmonics_get(self) -> repcap.Power3PhaseHarmonics:
"""
Returns the current default repeated capability for the child set/get methods.
"""
# noinspection PyTypeChecker
return self._cmd_group.get_repcap_enum_value()
[docs]
def get(self, power3PhaseMeas=repcap.Power3PhaseMeas.Default, result=repcap.Result.Default, power3PhaseHarmonics=repcap.Power3PhaseHarmonics.Default) -> int:
"""
``P3PHase<*>:HARMonics:RESult<*>:VIOLation<*>`` \n
Snippet: ``value: int = driver.p3Phase.harmonics.result.violation.get(power3PhaseMeas = repcap.Power3PhaseMeas.Default, result = repcap.Result.Default, power3PhaseHarmonics = repcap.Power3PhaseHarmonics.Default)`` \n
Queries if the value of o-th harmonic is within the defined limit for the current measurement for the individual phases.
:param power3PhaseMeas: optional repeated capability selector. Default value: Nr1 (settable in the interface 'P3Phase')
:param result: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Result')
:param power3PhaseHarmonics: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Violation')
"""
power3PhaseMeas_cmd_val = self._cmd_group.get_repcap_cmd_value(power3PhaseMeas, repcap.Power3PhaseMeas)
result_cmd_val = self._cmd_group.get_repcap_cmd_value(result, repcap.Result)
power3PhaseHarmonics_cmd_val = self._cmd_group.get_repcap_cmd_value(power3PhaseHarmonics, repcap.Power3PhaseHarmonics)
response = self._core.io.query_str(f'P3PHase{power3PhaseMeas_cmd_val}:HARMonics:RESult{result_cmd_val}:VIOLation{power3PhaseHarmonics_cmd_val}?')
return Conversions.str_to_int(response)
def clone(self) -> 'ViolationCls':
"""
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 = ViolationCls(self._core, self._cmd_group.parent)
self._cmd_group.synchronize_repcaps(new_group)
return new_group