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
from ..... import enums
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class StcoCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("stco", core, parent)
[docs]
def set(self, search: str, sc: enums.BusBitCondition) -> None:
"""
``SEARch:TRIGger:USB:STCO`` \n
Snippet: ``driver.search.trigger.usb.stco.set(search = 'abc', sc = enums.BusBitCondition.DC)`` \n
Defines, which Start- / Complete- (SC) split transaction type is searched for: SSPLIT or CSPLIT.
:param sc: ONE | ZERO | DC \n
- ONE: SC = 1 represents a complete-split (CSPLIT) transaction
- ZERO: SC = 0 represents a start-split (SSPLIT) transaction
- DC: SC = X represents 'don't care' (DC)
"""
param = ArgSingleList().compose_cmd_string(ArgSingle('search', search, DataType.String), ArgSingle('sc', sc, DataType.Enum, enums.BusBitCondition))
self._core.io.write(f'SEARch:TRIGger:USB:STCO {param}'.rstrip())
# noinspection PyTypeChecker
[docs]
def get(self, search: str) -> enums.BusBitCondition:
"""
``SEARch:TRIGger:USB:STCO`` \n
Snippet: ``value: enums.BusBitCondition = driver.search.trigger.usb.stco.get(search = 'abc')`` \n
Defines, which Start- / Complete- (SC) split transaction type is searched for: SSPLIT or CSPLIT.
:return: sc: ONE | ZERO | DC \n
- ONE: SC = 1 represents a complete-split (CSPLIT) transaction
- ZERO: SC = 0 represents a start-split (SSPLIT) transaction
- DC: SC = X represents 'don't care' (DC)
"""
param = Conversions.value_to_quoted_str(search)
response = self._core.io.query_str(f'SEARch:TRIGger:USB:STCO? {param}')
return Conversions.str_to_scalar_enum(response, enums.BusBitCondition)