from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class StateCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("state", core, parent)
[docs]
def set(self, state: bool, differential=repcap.Differential.Default) -> None:
"""
``DIFFerential<*>:STATe`` \n
Snippet: ``driver.differential.state.set(state = False, differential = repcap.Differential.Default)`` \n
Activates the differential signal. Two differential signals are available.
:param state: OFF | ON
:param differential: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Differential')
"""
param = Conversions.bool_to_str(state)
differential_cmd_val = self._cmd_group.get_repcap_cmd_value(differential, repcap.Differential)
self._core.io.write_with_opc(f'DIFFerential{differential_cmd_val}:STATe {param}')
[docs]
def get(self, differential=repcap.Differential.Default) -> bool:
"""
``DIFFerential<*>:STATe`` \n
Snippet: ``value: bool = driver.differential.state.get(differential = repcap.Differential.Default)`` \n
Activates the differential signal. Two differential signals are available.
:param differential: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Differential')
:return: state: 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}:STATe?')
return Conversions.str_to_bool(response)