Source code for rsrtx.Implementations.Pgenerator.File

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

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

[docs] def get_name(self) -> str: """ ``PGENerator:FILE[:NAME]`` \n Snippet: ``value: str = driver.pgenerator.file.get_name()`` \n Specifies a file path to open a pattern generator file. :return: file_path: String with the name of the file. """ response = self._core.io.query_str('PGENerator:FILE:NAME?') return trim_str_response(response)
[docs] def set_name(self, file_path: str) -> None: """ ``PGENerator:FILE[:NAME]`` \n Snippet: ``driver.pgenerator.file.set_name(file_path = 'abc')`` \n Specifies a file path to open a pattern generator file. :param file_path: String with the name of the file. """ param = Conversions.value_to_quoted_str(file_path) self._core.io.write(f'PGENerator:FILE:NAME {param}')
[docs] def open(self) -> None: """ ``PGENerator:FILE:OPEN`` \n Snippet: ``driver.pgenerator.file.open()`` \n Loads the specified pattern file to the instrument. """ self._core.io.write(f'PGENerator:FILE:OPEN')
[docs] def open_and_wait(self, opc_timeout_ms: int = -1) -> None: """ ``PGENerator:FILE:OPEN`` \n Snippet: ``driver.pgenerator.file.open_and_wait()`` \n Loads the specified pattern file to the instrument. Same as open, but waits for the operation to complete before continuing further. Use the RsRtx.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'PGENerator:FILE:OPEN', opc_timeout_ms)