Source code for RsSmw.Implementations.HardCopy.File.Name.Auto.Directory

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


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

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

[docs] def clear(self) -> None: """ ``HCOPy:FILE:[NAME]:AUTO:DIRectory:CLEar`` \n Snippet: ``driver.hardCopy.file.name.auto.directory.clear()`` \n Deletes all files with extensions bmp, jpg, png and xpm in the directory set for automatic naming. """ self._core.io.write(f'HCOPy:FILE:NAME:AUTO:DIRectory:CLEar')
[docs] def clear_with_opc(self, opc_timeout_ms: int = -1) -> None: """ ``HCOPy:FILE:[NAME]:AUTO:DIRectory:CLEar`` \n Snippet: ``driver.hardCopy.file.name.auto.directory.clear_with_opc()`` \n Deletes all files with extensions bmp, jpg, png and xpm in the directory set for automatic naming. Same as clear, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value. :param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call. """ self._core.io.write_with_opc(f'HCOPy:FILE:NAME:AUTO:DIRectory:CLEar', opc_timeout_ms)
[docs] def get_value(self) -> str: """ ``HCOPy:FILE:[NAME]:AUTO:DIRectory`` \n Snippet: ``value: str = driver.hardCopy.file.name.auto.directory.get_value()`` \n Determines the path to save the hard copy, if you have enabled Automatic Naming. If the directory does not yet exist, the instrument automatically creates a new directory, using the instrument name and /var/user/ by default. :return: directory: string """ response = self._core.io.query_str('HCOPy:FILE:NAME:AUTO:DIRectory?') return trim_str_response(response)
[docs] def set_value(self, directory: str) -> None: """ ``HCOPy:FILE:[NAME]:AUTO:DIRectory`` \n Snippet: ``driver.hardCopy.file.name.auto.directory.set_value(directory = 'abc')`` \n Determines the path to save the hard copy, if you have enabled Automatic Naming. If the directory does not yet exist, the instrument automatically creates a new directory, using the instrument name and /var/user/ by default. :param directory: string """ param = Conversions.value_to_quoted_str(directory) self._core.io.write(f'HCOPy:FILE:NAME:AUTO:DIRectory {param}')