Source code for rsrtx.Implementations.Report

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class ReportCls:
	"""
	| Commands in total: 8
	| Subgroups: 1
	| Direct child commands: 6
	"""

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

	@property
	def file(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_file'):
			from .File import FileCls
			self._file = FileCls(self._core, self._cmd_group)
		return self._file

	# noinspection PyTypeChecker
[docs] def get_paper_size(self) -> enums.PaperSize: """ ``REPort:PAPersize`` \n Snippet: ``value: enums.PaperSize = driver.report.get_paper_size()`` \n Selects the paper size: A4 or US Letter. :return: paper_size: A4 | USL """ response = self._core.io.query_str_with_opc('REPort:PAPersize?') return Conversions.str_to_scalar_enum(response, enums.PaperSize)
[docs] def set_paper_size(self, paper_size: enums.PaperSize) -> None: """ ``REPort:PAPersize`` \n Snippet: ``driver.report.set_paper_size(paper_size = enums.PaperSize.A4)`` \n Selects the paper size: A4 or US Letter. :param paper_size: A4 | USL """ param = Conversions.enum_scalar_to_str(paper_size, enums.PaperSize) self._core.io.write_with_opc(f'REPort:PAPersize {param}')
# noinspection PyTypeChecker
[docs] def get_log_type(self) -> enums.Logo: """ ``REPort:LOGType`` \n Snippet: ``value: enums.Logo = driver.report.get_log_type()`` \n By default, the Rohde & Schwarz logo is shown in the header of the report pages. You can switch the logo off, or select your logo to be shown. :return: logo: RS | CUST | NONE \n - CUST: Select the logo file using REPort:LOGO. """ response = self._core.io.query_str_with_opc('REPort:LOGType?') return Conversions.str_to_scalar_enum(response, enums.Logo)
[docs] def set_log_type(self, logo: enums.Logo) -> None: """ ``REPort:LOGType`` \n Snippet: ``driver.report.set_log_type(logo = enums.Logo.CUST)`` \n By default, the Rohde & Schwarz logo is shown in the header of the report pages. You can switch the logo off, or select your logo to be shown. :param logo: RS | CUST | NONE \n - CUST: Select the logo file using REPort:LOGO. """ param = Conversions.enum_scalar_to_str(logo, enums.Logo) self._core.io.write_with_opc(f'REPort:LOGType {param}')
[docs] def get_user(self) -> str: """ ``REPort:USER`` \n Snippet: ``value: str = driver.report.get_user()`` \n Enter the user name that appears in the general information section at the beginning of the report. :return: user: String parameter """ response = self._core.io.query_str_with_opc('REPort:USER?') return trim_str_response(response)
[docs] def set_user(self, user: str) -> None: """ ``REPort:USER`` \n Snippet: ``driver.report.set_user(user = 'abc')`` \n Enter the user name that appears in the general information section at the beginning of the report. :param user: String parameter """ param = Conversions.value_to_quoted_str(user) self._core.io.write_with_opc(f'REPort:USER {param}')
[docs] def get_comment(self) -> str: """ ``REPort:COMMent`` \n Snippet: ``value: str = driver.report.get_comment()`` \n Enter a comment that appears in the general information section at the beginning of the report. :return: comment: String parameter """ response = self._core.io.query_str_with_opc('REPort:COMMent?') return trim_str_response(response)
[docs] def set_comment(self, comment: str) -> None: """ ``REPort:COMMent`` \n Snippet: ``driver.report.set_comment(comment = 'abc')`` \n Enter a comment that appears in the general information section at the beginning of the report. :param comment: String parameter """ param = Conversions.value_to_quoted_str(comment) self._core.io.write_with_opc(f'REPort:COMMent {param}')
[docs] def get_language(self) -> str: """ ``REPort:LANGuage`` \n Snippet: ``value: str = driver.report.get_language()`` \n Sets the language to be used in the report. Available languages are listed in the specifications document. :return: language: String with the english language name, upper case. """ response = self._core.io.query_str('REPort:LANGuage?') return trim_str_response(response)
[docs] def set_language(self, language: str) -> None: """ ``REPort:LANGuage`` \n Snippet: ``driver.report.set_language(language = 'abc')`` \n Sets the language to be used in the report. Available languages are listed in the specifications document. :param language: String with the english language name, upper case. """ param = Conversions.value_to_quoted_str(language) self._core.io.write(f'REPort:LANGuage {param}')
def clone(self) -> 'ReportCls': """ 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 = ReportCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group