Source code for rsmxo.Implementations.Synchronize.Device.Name

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from ....Internal.Utilities import trim_str_response
from .... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class NameCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, name: str, device=repcap.Device.Default) -> None: """ ``SYNChronize:DEVice<*>:NAME`` \n Snippet: ``driver.synchronize.device.name.set(name = 'abc', device = repcap.Device.Default)`` \n Defines a name for the specified oscilloscope. :param name: String with the name of the connected oscilloscope. :param device: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Device') """ param = Conversions.value_to_quoted_str(name) device_cmd_val = self._cmd_group.get_repcap_cmd_value(device, repcap.Device) self._core.io.write(f'SYNChronize:DEVice{device_cmd_val}:NAME {param}')
[docs] def get(self, device=repcap.Device.Default) -> str: """ ``SYNChronize:DEVice<*>:NAME`` \n Snippet: ``value: str = driver.synchronize.device.name.get(device = repcap.Device.Default)`` \n Defines a name for the specified oscilloscope. :param device: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Device') :return: name: String with the name of the connected oscilloscope. """ device_cmd_val = self._cmd_group.get_repcap_cmd_value(device, repcap.Device) response = self._core.io.query_str(f'SYNChronize:DEVice{device_cmd_val}:NAME?') return trim_str_response(response)