Source code for RsFsw.Implementations.Instrument.Create.Replace

from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal.Types import DataType
from ....Internal.ArgSingleList import ArgSingleList
from ....Internal.ArgSingle import ArgSingle
from .... import enums


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

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

[docs] def set(self, current_channel_name: str, channel_type: enums.ChannelType, new_channel_name: str) -> None: """ ``INSTrument:CREate:REPLace`` \n Snippet: ``driver.instrument.create.replace.set(current_channel_name = 'abc', channel_type = enums.ChannelType.IqAnalyzer=IQ, new_channel_name = 'abc')`` \n Replaces a channel with another one. :param current_channel_name: String containing the name of the channel you want to replace. :param channel_type: Channel type of the new channel. For a list of available channel types, see method ``RsFsw.instrument.listPy.get()`` . :param new_channel_name: String containing the name of the new channel. Note: If the specified name for a new channel already exists, the default name, extended by a sequential number, is used for the new channel (see method ``RsFsw.instrument.listPy.get()`` ) . Channel names can have a maximum of 31 characters, and must be compatible with the Windows conventions for file names. In particular, they must not contain special characters such as ':', '*', '?'. """ param = ArgSingleList().compose_cmd_string(ArgSingle('current_channel_name', current_channel_name, DataType.String), ArgSingle('channel_type', channel_type, DataType.Enum, enums.ChannelType), ArgSingle('new_channel_name', new_channel_name, DataType.String)) self._core.io.write_with_opc(f'INSTrument:CREate:REPLace {param}'.rstrip()) self._core.io.write('INIT:CONT OFF')