from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DconnectCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dconnect", core, parent)
[docs]
def set(self, ndrive=repcap.Ndrive.Default) -> None:
"""
``MMEMory:NDRive<*>:DCONnect`` \n
Snippet: ``driver.massMemory.ndrive.dconnect.set(ndrive = repcap.Ndrive.Default)`` \n
Disconnects the remote network folder from the local folder.
:param ndrive: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Ndrive')
"""
ndrive_cmd_val = self._cmd_group.get_repcap_cmd_value(ndrive, repcap.Ndrive)
self._core.io.write(f'MMEMory:NDRive{ndrive_cmd_val}:DCONnect')
[docs]
def set_and_wait(self, ndrive=repcap.Ndrive.Default, opc_timeout_ms: int = -1) -> None:
ndrive_cmd_val = self._cmd_group.get_repcap_cmd_value(ndrive, repcap.Ndrive)
"""
``MMEMory:NDRive<*>:DCONnect`` \n
Snippet: ``driver.massMemory.ndrive.dconnect.set_and_wait(ndrive = repcap.Ndrive.Default)`` \n
Disconnects the remote network folder from the local folder.
Same as set, but waits for the operation to complete before continuing further. Use the RsMxo.utilities.opc_timeout_set() to set the timeout value.
:param ndrive: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Ndrive')
:param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call.
"""
self._core.io.write_with_opc(f'MMEMory:NDRive{ndrive_cmd_val}:DCONnect', opc_timeout_ms)
[docs]
def get(self, ndrive=repcap.Ndrive.Default) -> bool:
"""
``MMEMory:NDRive<*>:DCONnect`` \n
Snippet: ``value: bool = driver.massMemory.ndrive.dconnect.get(ndrive = repcap.Ndrive.Default)`` \n
Disconnects the remote network folder from the local folder.
:param ndrive: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Ndrive')
"""
ndrive_cmd_val = self._cmd_group.get_repcap_cmd_value(ndrive, repcap.Ndrive)
response = self._core.io.query_str(f'MMEMory:NDRive{ndrive_cmd_val}:DCONnect?')
return Conversions.str_to_bool(response)