from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from ..... import enums
from ..... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DpoperatorCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("dpoperator", core, parent)
[docs]
def set(self, dat_posi_optor: enums.DataIndexOperator, trigger=repcap.Trigger.Default) -> None:
"""
``TRIGger<*>:CAN:FDATa:DPOPerator`` \n
Snippet: ``driver.trigger.can.fdata.dpoperator.set(dat_posi_optor = enums.DataIndexOperator.ANY, trigger = repcap.Trigger.Default)`` \n
Sets the operator to define an exact position or a data range where the instrument looks for the specified data pattern.
The setting is available in CAN FD option R&S RTP-K9. The position can be defined if the data field of the frame is
longer than 8 bytes - if method ``RsRtx.trigger.can.dlc.set()`` ≥9.
:param dat_posi_optor: ANY | OFF | EQUal | GETHan | INRange | RANGe \n
- ANY = OFF: The data position is not relevant for the trigger condition.
- EQUal | GETHan: Equal, Greater or equal than. These conditions require one data position to be set with TRIGgert:CAN:FDATa:DPOSition.
- INRange = RANGe: In range: Set the minimum and maximum value of the range with TRIGgert:CAN:FDATa:DPOSition and TRIGgert:CAN:FDATa:DPTO.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
"""
param = Conversions.enum_scalar_to_str(dat_posi_optor, enums.DataIndexOperator)
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
self._core.io.write(f'TRIGger{trigger_cmd_val}:CAN:FDATa:DPOPerator {param}')
# noinspection PyTypeChecker
[docs]
def get(self, trigger=repcap.Trigger.Default) -> enums.DataIndexOperator:
"""
``TRIGger<*>:CAN:FDATa:DPOPerator`` \n
Snippet: ``value: enums.DataIndexOperator = driver.trigger.can.fdata.dpoperator.get(trigger = repcap.Trigger.Default)`` \n
Sets the operator to define an exact position or a data range where the instrument looks for the specified data pattern.
The setting is available in CAN FD option R&S RTP-K9. The position can be defined if the data field of the frame is
longer than 8 bytes - if method ``RsRtx.trigger.can.dlc.set()`` ≥9.
:param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger')
"""
trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger)
response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:CAN:FDATa:DPOPerator?')
return Conversions.str_to_scalar_enum(response, enums.DataIndexOperator)