Source code for rsrtx.Implementations.Cdr.Software.Sync

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 SyncCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("sync", core, parent)

[docs] def set(self, initial_sync: enums.CdrInitialSync, software=repcap.Software.Default) -> None: """ ``CDR:SOFTware<*>:SYNC`` \n Snippet: ``driver.cdr.software.sync.set(initial_sync = enums.CdrInitialSync.DATaedge, software = repcap.Software.Default)`` \n Defines the phase reference for the first clock edge. :param initial_sync: SAMPle | DATaedge \n - SAMPle: The first clock edge matches the first sample of the waveform at the left border of the display. - DATaedge: The first clock edge matches the first edge of the data signal. :param software: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Software') """ param = Conversions.enum_scalar_to_str(initial_sync, enums.CdrInitialSync) software_cmd_val = self._cmd_group.get_repcap_cmd_value(software, repcap.Software) self._core.io.write_with_opc(f'CDR:SOFTware{software_cmd_val}:SYNC {param}')
# noinspection PyTypeChecker
[docs] def get(self, software=repcap.Software.Default) -> enums.CdrInitialSync: """ ``CDR:SOFTware<*>:SYNC`` \n Snippet: ``value: enums.CdrInitialSync = driver.cdr.software.sync.get(software = repcap.Software.Default)`` \n Defines the phase reference for the first clock edge. :param software: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Software') :return: initial_sync: SAMPle | DATaedge \n - SAMPle: The first clock edge matches the first sample of the waveform at the left border of the display. - DATaedge: The first clock edge matches the first edge of the data signal. """ software_cmd_val = self._cmd_group.get_repcap_cmd_value(software, repcap.Software) response = self._core.io.query_str_with_opc(f'CDR:SOFTware{software_cmd_val}:SYNC?') return Conversions.str_to_scalar_enum(response, enums.CdrInitialSync)