Source code for RsFsw.Implementations.Diagnostic.Service.Sfunction.Results.Save

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

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

[docs] def set(self, filename: str=None) -> None: """ ``DIAGnostic:SERVice:SFUNction:RESults:SAVE`` \n Snippet: ``driver.diagnostic.service.sfunction.results.save.set(filename = 'abc')`` \n This command saves the results in the output buffer for service functions you have used to a file. If no <FileName> parameter is provided, the results are stored to C:/R_S/INSTR/results/Servicelog.txt. Note that if the buffer is empty, the function returns an error. :param filename: String containing the path and file name. """ param = '' if filename: param = Conversions.value_to_quoted_str(filename) self._core.io.write(f'DIAGnostic:SERVice:SFUNction:RESults:SAVE {param}'.strip())
[docs] def get(self) -> str: """ ``DIAGnostic:SERVice:SFUNction:RESults:SAVE`` \n Snippet: ``value: str = driver.diagnostic.service.sfunction.results.save.get()`` \n This command saves the results in the output buffer for service functions you have used to a file. If no <FileName> parameter is provided, the results are stored to C:/R_S/INSTR/results/Servicelog.txt. Note that if the buffer is empty, the function returns an error. :return: filename: String containing the path and file name. """ response = self._core.io.query_str(f'DIAGnostic:SERVice:SFUNction:RESults:SAVE?') return trim_str_response(response)