Source code for rsmxo.Implementations.HardCopy

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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class HardCopyCls:
	"""
	| Commands in total: 9
	| Subgroups: 2
	| Direct child commands: 5
	"""

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

	@property
	def immediate(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_immediate'):
			from .Immediate import ImmediateCls
			self._immediate = ImmediateCls(self._core, self._cmd_group)
		return self._immediate

	@property
	def device(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_device'):
			from .Device import DeviceCls
			self._device = DeviceCls(self._core, self._cmd_group)
		return self._device

[docs] def get_data(self) -> bytes: """ ``HCOPy:DATA`` \n Snippet: ``value: bytes = driver.hardCopy.get_data()`` \n Creates a PNG screenshot and returns the data of the image file in a binary data stream. When receiving the data, write them into a PNG file which you can open later. """ response = self._core.io.query_bin_block('HCOPy:DATA?') return response
[docs] def get_wbkg(self) -> bool: """ ``HCOPy:WBKG`` \n Snippet: ``value: bool = driver.hardCopy.get_wbkg()`` \n Inverts the background color, so you can picture waveforms with normal waveform colors on white background. If both method ``RsMxo.hardCopy.wbkg()`` and method ``RsMxo.hardCopy.device.inverse()`` are ON, the instrument inverts the background twice, and it appears black. """ response = self._core.io.query_str('HCOPy:WBKG?') return Conversions.str_to_bool(response)
[docs] def set_wbkg(self, white_background_scpi: bool) -> None: """ ``HCOPy:WBKG`` \n Snippet: ``driver.hardCopy.set_wbkg(white_background_scpi = False)`` \n Inverts the background color, so you can picture waveforms with normal waveform colors on white background. If both method ``RsMxo.hardCopy.wbkg()`` and method ``RsMxo.hardCopy.device.inverse()`` are ON, the instrument inverts the background twice, and it appears black. :param white_background_scpi: OFF | ON """ param = Conversions.bool_to_str(white_background_scpi) self._core.io.write(f'HCOPy:WBKG {param}')
[docs] def get_ssd(self) -> bool: """ ``HCOPy:SSD`` \n Snippet: ``value: bool = driver.hardCopy.get_ssd()`` \n If enabled, the currently open dialog box is included in the screenshot. """ response = self._core.io.query_str('HCOPy:SSD?') return Conversions.str_to_bool(response)
[docs] def set_ssd(self, shw_set_dialog_scpi: bool) -> None: """ ``HCOPy:SSD`` \n Snippet: ``driver.hardCopy.set_ssd(shw_set_dialog_scpi = False)`` \n If enabled, the currently open dialog box is included in the screenshot. :param shw_set_dialog_scpi: OFF | ON """ param = Conversions.bool_to_str(shw_set_dialog_scpi) self._core.io.write(f'HCOPy:SSD {param}')
[docs] def get_isba(self) -> bool: """ ``HCOPy:ISBA`` \n Snippet: ``value: bool = driver.hardCopy.get_isba()`` \n If enabled, the screenshot shows the signal bar below the diagram area. :return: include_sign_bar_scpi: OFF | ON """ response = self._core.io.query_str('HCOPy:ISBA?') return Conversions.str_to_bool(response)
[docs] def set_isba(self, include_sign_bar_scpi: bool) -> None: """ ``HCOPy:ISBA`` \n Snippet: ``driver.hardCopy.set_isba(include_sign_bar_scpi = False)`` \n If enabled, the screenshot shows the signal bar below the diagram area. :param include_sign_bar_scpi: OFF | ON """ param = Conversions.bool_to_str(include_sign_bar_scpi) self._core.io.write(f'HCOPy:ISBA {param}')
# noinspection PyTypeChecker
[docs] def get_destination(self) -> enums.PrintTarget: """ ``HCOPy:DESTination`` \n Snippet: ``value: enums.PrintTarget = driver.hardCopy.get_destination()`` \n Selects the output medium: file or clipboard. :return: medium: MMEM: saves image to a file. CLIPBOARD: directs the image to the clipboard. """ response = self._core.io.query_str('HCOPy:DESTination?') return Conversions.str_to_scalar_enum(response, enums.PrintTarget)
[docs] def set_destination(self, medium: enums.PrintTarget) -> None: """ ``HCOPy:DESTination`` \n Snippet: ``driver.hardCopy.set_destination(medium = enums.PrintTarget.CLIPBOARD)`` \n Selects the output medium: file or clipboard. :param medium: MMEM: saves image to a file. CLIPBOARD: directs the image to the clipboard. """ param = Conversions.enum_scalar_to_str(medium, enums.PrintTarget) self._core.io.write(f'HCOPy:DESTination {param}')
def clone(self) -> 'HardCopyCls': """ 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 = HardCopyCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group