Source code for rsrtx.Implementations.Digital.Display

from ...Internal.Core import Core
from ...Internal.CommandsGroup import CommandsGroup
from ...Internal import Conversions
from ... import repcap


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DisplayCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

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

[docs] def set(self, display: bool, digitalNull=repcap.DigitalNull.Default) -> None: """ ``DIGital<*>:DISPlay`` \n Snippet: ``driver.digital.display.set(display = False, digitalNull = repcap.DigitalNull.Default)`` \n Enables or disables the indicated digital channel, displays it, and enables the parallel Bus1 if the bus was disabled. That is, method ``RsRtx.bus.parallel.display.shdi.set()`` and method ``RsRtx.bus.parallel.state.set()`` are set to ON automatically. If another active bus already uses the selected digital channel, the instrument disables the other bus to avoid conflicts. For Bus1, the method ``RsRtx.digital.display.set()`` command has the same effect as method ``RsRtx.bus.parallel.bit.state.set()`` . To enable digital channels for buses 2, 3 and 4, use the method ``RsRtx.bus.parallel.bit.state.set()`` command. :param display: ON | OFF :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') """ param = Conversions.bool_to_str(display) digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) self._core.io.write(f'DIGital{digitalNull_cmd_val}:DISPlay {param}')
[docs] def get(self, digitalNull=repcap.DigitalNull.Default) -> bool: """ ``DIGital<*>:DISPlay`` \n Snippet: ``value: bool = driver.digital.display.get(digitalNull = repcap.DigitalNull.Default)`` \n Enables or disables the indicated digital channel, displays it, and enables the parallel Bus1 if the bus was disabled. That is, method ``RsRtx.bus.parallel.display.shdi.set()`` and method ``RsRtx.bus.parallel.state.set()`` are set to ON automatically. If another active bus already uses the selected digital channel, the instrument disables the other bus to avoid conflicts. For Bus1, the method ``RsRtx.digital.display.set()`` command has the same effect as method ``RsRtx.bus.parallel.bit.state.set()`` . To enable digital channels for buses 2, 3 and 4, use the method ``RsRtx.bus.parallel.bit.state.set()`` command. :param digitalNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Digital') :return: display: ON | OFF """ digitalNull_cmd_val = self._cmd_group.get_repcap_cmd_value(digitalNull, repcap.DigitalNull) response = self._core.io.query_str(f'DIGital{digitalNull_cmd_val}:DISPlay?') return Conversions.str_to_bool(response)