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:
"""
``REPort:FILE:NAME`` \n
Snippet: ``value: str = driver.report.file.get_name()`` \n
Sets the file name and path to save the report to.
:return: report_file: String with path and file name. The file extension defines the file format: PDF, HTML, or DOC.
"""
response = self._core.io.query_str_with_opc('REPort:FILE:NAME?')
return trim_str_response(response)
[docs]
def set_name(self, report_file: str) -> None:
"""
``REPort:FILE:NAME`` \n
Snippet: ``driver.report.file.set_name(report_file = 'abc')`` \n
Sets the file name and path to save the report to.
:param report_file: String with path and file name. The file extension defines the file format: PDF, HTML, or DOC.
"""
param = Conversions.value_to_quoted_str(report_file)
self._core.io.write_with_opc(f'REPort:FILE:NAME {param}')
[docs]
def save(self, opc_timeout_ms: int = -1) -> None:
"""
``REPort:FILE:SAVE`` \n
Snippet: ``driver.report.file.save()`` \n
Saves the report to the specified file.
:param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call.
"""
self._core.io.write_with_opc(f'REPort:FILE:SAVE', opc_timeout_ms)