from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ScanCls:
"""
| Commands in total: 2
| Subgroups: 0
| Direct child commands: 2
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("scan", core, parent)
[docs]
def set(self) -> None:
"""
``SCONfiguration:EXTernal:REMote:SCAN`` \n
Snippet: ``driver.sconfiguration.external.remote.scan.set()`` \n
Scans the network for connected instruments.
"""
self._core.io.write(f'SCONfiguration:EXTernal:REMote:SCAN')
[docs]
def set_with_opc(self, opc_timeout_ms: int = -1) -> None:
"""
``SCONfiguration:EXTernal:REMote:SCAN`` \n
Snippet: ``driver.sconfiguration.external.remote.scan.set_with_opc()`` \n
Scans the network for connected instruments.
Same as set, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value.
:param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call.
"""
self._core.io.write_with_opc(f'SCONfiguration:EXTernal:REMote:SCAN', opc_timeout_ms)
[docs]
def get_state(self) -> bool:
"""
``SCONfiguration:EXTernal:REMote:SCAN:STATe`` \n
Snippet: ``value: bool = driver.sconfiguration.external.remote.scan.get_state()`` \n
Queries if scanning is performed or not. To start the scanning process, use the command method
``RsSmw.sconfiguration.external.remote.scan.set()`` .
:return: scan_state: 1 | ON | 0| OFF 1 Scanning process running 0 Not scanning
"""
response = self._core.io.query_str('SCONfiguration:EXTernal:REMote:SCAN:STATe?')
return Conversions.str_to_bool(response)