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 WpidCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("wpid", core, parent)
[docs]
def set(self, search: str, with_pid_check: bool) -> None:
"""
``SEARch:TRIGger:USB:WPID`` \n
Snippet: ``driver.search.trigger.usb.wpid.set(search = 'abc', with_pid_check = False)`` \n
Defines, whether a search for any packet ID error shall be activated or not.
:param with_pid_check: OFF | ON
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('with_pid_check', with_pid_check, DataType.Boolean))
self._core.io.write(f'SEARch:TRIGger:USB:WPID {param}'.rstrip())
[docs]
def get(self, search: str) -> bool:
"""
``SEARch:TRIGger:USB:WPID`` \n
Snippet: ``value: bool = driver.search.trigger.usb.wpid.get(search = 'abc')`` \n
Defines, whether a search for any packet ID error shall be activated or not.
:return: with_pid_check: OFF | ON
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:USB:WPID? {param}')
return Conversions.str_to_bool(response)