from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class CouplingCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("coupling", core, parent)
[docs]
def set(self, scale_coupling: bool, differential=repcap.Differential.Default) -> None:
"""
``DIFFerential<*>:COUPling`` \n
Snippet: ``driver.differential.coupling.set(scale_coupling = False, differential = repcap.Differential.Default)`` \n
If enabled for a differential signal, the vertical scales of P, N, differential and common mode waveforms are coupled.
The scales are related as follows: VertScaleP = VertScaleN = VertScaleCM = VertScaleDiff/2 You can disable the scale
coupling and set an individual scale for each waveform.
:param scale_coupling: OFF | ON
:param differential: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Differential')
"""
param = Conversions.bool_to_str(scale_coupling)
differential_cmd_val = self._cmd_group.get_repcap_cmd_value(differential, repcap.Differential)
self._core.io.write_with_opc(f'DIFFerential{differential_cmd_val}:COUPling {param}')
[docs]
def get(self, differential=repcap.Differential.Default) -> bool:
"""
``DIFFerential<*>:COUPling`` \n
Snippet: ``value: bool = driver.differential.coupling.get(differential = repcap.Differential.Default)`` \n
If enabled for a differential signal, the vertical scales of P, N, differential and common mode waveforms are coupled.
The scales are related as follows: VertScaleP = VertScaleN = VertScaleCM = VertScaleDiff/2 You can disable the scale
coupling and set an individual scale for each waveform.
:param differential: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Differential')
:return: scale_coupling: OFF | ON
"""
differential_cmd_val = self._cmd_group.get_repcap_cmd_value(differential, repcap.Differential)
response = self._core.io.query_str_with_opc(f'DIFFerential{differential_cmd_val}:COUPling?')
return Conversions.str_to_bool(response)