Source code for rsrtx.Implementations.MassMemory

from typing import List

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ...Internal.Types import DataType
from ...Internal.Utilities import trim_str_response
from ...Internal.ArgSingleList import ArgSingleList
from ...Internal.ArgSingle import ArgSingle


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class MassMemoryCls:
	"""
	| Commands in total: 24
	| Subgroups: 5
	| Direct child commands: 11
	"""

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

	@property
	def catalog(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_catalog'):
			from .Catalog import CatalogCls
			self._catalog = CatalogCls(self._core, self._cmd_group)
		return self._catalog

	@property
	def dcatalog(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_dcatalog'):
			from .Dcatalog import DcatalogCls
			self._dcatalog = DcatalogCls(self._core, self._cmd_group)
		return self._dcatalog

	@property
	def load(self):
		"""
		| Commands in total: 1
		| Subgroups: 1
		| Direct child commands: 0
		"""
		if not hasattr(self, '_load'):
			from .Load import LoadCls
			self._load = LoadCls(self._core, self._cmd_group)
		return self._load

	@property
	def store(self):
		"""
		| Commands in total: 1
		| Subgroups: 1
		| Direct child commands: 0
		"""
		if not hasattr(self, '_store'):
			from .Store import StoreCls
			self._store = StoreCls(self._core, self._cmd_group)
		return self._store

	@property
	def autoNaming(self):
		"""
		| Commands in total: 9
		| Subgroups: 2
		| Direct child commands: 7
		"""
		if not hasattr(self, '_autoNaming'):
			from .AutoNaming import AutoNamingCls
			self._autoNaming = AutoNamingCls(self._core, self._cmd_group)
		return self._autoNaming

[docs] def get_current_directory(self) -> str: """ ``MMEMory:CDIRectory`` \n Snippet: ``value: str = driver.massMemory.get_current_directory()`` \n Changes the default directory for file access. """ response = self._core.io.query_str('MMEMory:CDIRectory?') return trim_str_response(response)
[docs] def set_current_directory(self, directory: str) -> None: """ ``MMEMory:CDIRectory`` \n Snippet: ``driver.massMemory.set_current_directory(directory = 'abc')`` \n Changes the default directory for file access. :param directory: String parameter to specify the directory. If the string also contains a drive letter or network server name, the command method ``RsRtx.massMemory.msis()`` is executed implicitly. """ param = Conversions.value_to_quoted_str(directory) self._core.io.write(f'MMEMory:CDIRectory {param}')
[docs] def delete(self, file_path: str) -> None: """ ``MMEMory:DELete`` \n Snippet: ``driver.massMemory.delete(file_path = 'abc')`` \n Removes the specified file/files. To delete directories, use method ``RsRtx.massMemory.delete_directory()`` . :param file_path: String parameter to specify the name and directory of the file to be removed. Wildcards (* and ?) are allowed. If no path is defined, the current directory is used, specified with method ``RsRtx.massMemory.current_directory()``. """ param = Conversions.value_to_quoted_str(file_path) self._core.io.write_with_opc(f'MMEMory:DELete {param}')
[docs] def delete_directory(self, directory_path: str) -> None: """ ``MMEMory:RDIRectory`` \n Snippet: ``driver.massMemory.delete_directory(directory_path = 'abc')`` \n Deletes the specified directory. :param directory_path: String parameter to specify the directory to be deleted. This directory must be empty, otherwise it is not deleted. """ param = Conversions.value_to_quoted_str(directory_path) self._core.io.write_with_opc(f'MMEMory:RDIRectory {param}')
[docs] def copy(self, source: str, target: str) -> None: """ ``MMEMory:COPY`` \n Snippet: ``driver.massMemory.copy(source = 'abc', target = 'abc')`` \n Copies an existing file to a new file. :param source: String parameter. Contains name and path of the file to be copied. Wildcards (* and ?) are allowed. :param target: String parameter. Contains name and path of the new file. If the file already exists, it is overwritten without notice. If no file destination is specified, the source file is written to the current directory specified with method ``RsRtx.massMemory.current_directory()``. """ param = ArgSingleList().compose_cmd_string(ArgSingle('source', source, DataType.String), ArgSingle('target', target, DataType.String)) self._core.io.write_with_opc(f'MMEMory:COPY {param}'.rstrip())
[docs] def move(self, source: str, target: str) -> None: """ ``MMEMory:MOVE`` \n Snippet: ``driver.massMemory.move(source = 'abc', target = 'abc')`` \n Moves the specified file to a new location on the same drive and renames it. :param source: String parameter, contains name and path of the file to be copied. Wildcards (* and ?) are allowed. Therefore, specify a directory for FileDestination. Renaming is not possible. :param target: String parameter. Contains name and path of the new file. If no path is specified, the FileSource directory is used - the file is renamed. """ param = ArgSingleList().compose_cmd_string(ArgSingle('source', source, DataType.String), ArgSingle('target', target, DataType.String)) self._core.io.write_with_opc(f'MMEMory:MOVE {param}'.rstrip())
[docs] def make_directory(self, directory_name: str) -> None: """ ``MMEMory:MDIRectory`` \n Snippet: ``driver.massMemory.make_directory(directory_name = 'abc')`` \n Creates a new directory with the specified name. :param directory_name: String parameter to specify the new directory. If the path consists of several subdirectories, the complete tree is created if necessary. If no drive letter or server name is indicated, the directory is created on the default storage device specified with method ``RsRtx.massMemory.msis()``. """ param = Conversions.value_to_quoted_str(directory_name) self._core.io.write_with_opc(f'MMEMory:MDIRectory {param}')
[docs] def save(self, file_destination: str) -> None: """ ``MMEMory:SAV`` \n Snippet: ``driver.massMemory.save(file_destination = 'abc')`` \n Stores the current instrument settings to the specified file. This command has the same effect as the combination of ``*SAV`` and method ``RsRtx.massMemory.store.state.set()`` . :param file_destination: String parameter specifying path and filename of the target file. Wildcards are not allowed. """ param = Conversions.value_to_quoted_str(file_destination) self._core.io.write_with_opc(f'MMEMory:SAV {param}')
[docs] def recall(self, file_source: str) -> None: """ ``MMEMory:RCL`` \n Snippet: ``driver.massMemory.recall(file_source = 'abc')`` \n Restores the instrument settings from the specified file. This command has the same effect as the combination of method ``RsRtx.massMemory.load.state.set()`` and ``*RCL``. """ param = Conversions.value_to_quoted_str(file_source) self._core.io.write_with_opc(f'MMEMory:RCL {param}')
[docs] def set_msis(self, drive: str) -> None: """ ``MMEMory:MSIS`` \n Snippet: ``driver.massMemory.set_msis(drive = 'abc')`` \n Changes the default storage device to the indicated drive or network server. :param drive: String parameter. Drives are indicated with their drive letter, network servers require the UNC format. """ param = Conversions.value_to_quoted_str(drive) self._core.io.write_with_opc(f'MMEMory:MSIS {param}')
[docs] def set_drives(self, drives: List[str]) -> None: """ ``MMEMory:DRIVes`` \n Snippet: ``driver.massMemory.set_drives(drives = ['abc1', 'abc2', 'abc3'])`` \n Returns a list of the logical drives of the instrument as configured in the operating system. """ param = Conversions.list_to_csv_quoted_str(drives) self._core.io.write_with_opc(f'MMEMory:DRIVes {param}')
[docs] def set_name(self, rem_print_file_nme: str) -> None: """ ``MMEMory:NAME`` \n Snippet: ``driver.massMemory.set_name(rem_print_file_nme = 'abc')`` \n Defines the file name when an image of the display is stored to a file. :param rem_print_file_nme: String parameter specifiying path and file name of the screenshot. """ param = Conversions.value_to_quoted_str(rem_print_file_nme) self._core.io.write_with_opc(f'MMEMory:NAME {param}')
def clone(self) -> 'MassMemoryCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = MassMemoryCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group