Source code for rsmxo.Implementations.Synchronize.Device.Communicate.Net.Hostname

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

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

[docs] def set(self, hostname: str, device=repcap.Device.Default) -> None: """ ``SYNChronize:DEVice<*>:COMMunicate:NET[:HOSTname]`` \n Snippet: ``driver.synchronize.device.communicate.net.hostname.set(hostname = 'abc', device = repcap.Device.Default)`` \n Sets the IP address or the host name for the specified oscilloscope. :param hostname: String with the IP address or host name :param device: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Device') """ param = Conversions.value_to_quoted_str(hostname) device_cmd_val = self._cmd_group.get_repcap_cmd_value(device, repcap.Device) self._core.io.write(f'SYNChronize:DEVice{device_cmd_val}:COMMunicate:NET:HOSTname {param}')
[docs] def get(self, device=repcap.Device.Default) -> str: """ ``SYNChronize:DEVice<*>:COMMunicate:NET[:HOSTname]`` \n Snippet: ``value: str = driver.synchronize.device.communicate.net.hostname.get(device = repcap.Device.Default)`` \n Sets the IP address or the host name for the specified oscilloscope. :param device: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Device') :return: hostname: String with the IP address or host name """ 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}:COMMunicate:NET:HOSTname?') return trim_str_response(response)