from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class OnlineCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("online", core, parent)
[docs]
def set(self, search: str, online_state: bool) -> None:
"""
``SEARch:ONLine`` \n
Snippet: ``driver.search.online.set(search = 'abc', online_state = False)`` \n
If enabled, a search is performed repeatedly for each new data acquisition.
:param search: Search definition
:param online_state: OFF | ON
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('online_state', online_state, DataType.Boolean))
self._core.io.write_with_opc(f'SEARch:ONLine {param}'.rstrip())
[docs]
def get(self, search: str) -> bool:
"""
``SEARch:ONLine`` \n
Snippet: ``value: bool = driver.search.online.get(search = 'abc')`` \n
If enabled, a search is performed repeatedly for each new data acquisition.
:param search: Search definition
:return: online_state: OFF | ON
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str_with_opc(f'SEARch:ONLine? {param}')
return Conversions.str_to_bool(response)