Source code for RsSmw.Implementations.Sconfiguration.MultiInstrument

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


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

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

	@property
	def connector(self):
		"""
		| Commands in total: 2
		| Subgroups: 2
		| Direct child commands: 0
		"""
		if not hasattr(self, '_connector'):
			from .Connector import ConnectorCls
			self._connector = ConnectorCls(self._core, self._cmd_group)
		return self._connector

	@property
	def trigger(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_trigger'):
			from .Trigger import TriggerCls
			self._trigger = TriggerCls(self._core, self._cmd_group)
		return self._trigger

	# noinspection PyTypeChecker
[docs] def get_mode(self) -> enums.MultiInstrMsMode: """ ``SCONfiguration:MULTiinstrument:MODE`` \n Snippet: ``value: enums.MultiInstrMsMode = driver.sconfiguration.multiInstrument.get_mode()`` \n Sets if the instrument works as a primary or as a secondary instrument. :return: ms_mode: PRIMary | SECondary """ response = self._core.io.query_str('SCONfiguration:MULTiinstrument:MODE?') return Conversions.str_to_scalar_enum(response, enums.MultiInstrMsMode)
[docs] def set_mode(self, ms_mode: enums.MultiInstrMsMode) -> None: """ ``SCONfiguration:MULTiinstrument:MODE`` \n Snippet: ``driver.sconfiguration.multiInstrument.set_mode(ms_mode = enums.MultiInstrMsMode.PRIMary)`` \n Sets if the instrument works as a primary or as a secondary instrument. :param ms_mode: PRIMary | SECondary """ param = Conversions.enum_scalar_to_str(ms_mode, enums.MultiInstrMsMode) self._core.io.write(f'SCONfiguration:MULTiinstrument:MODE {param}')
[docs] def get_state(self) -> bool: """ ``SCONfiguration:MULTiinstrument:STATe`` \n Snippet: ``value: bool = driver.sconfiguration.multiInstrument.get_state()`` \n Activates the selected mode. :return: trigger_state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SCONfiguration:MULTiinstrument:STATe?') return Conversions.str_to_bool(response)
[docs] def set_state(self, trigger_state: bool) -> None: """ ``SCONfiguration:MULTiinstrument:STATe`` \n Snippet: ``driver.sconfiguration.multiInstrument.set_state(trigger_state = False)`` \n Activates the selected mode. :param trigger_state: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(trigger_state) self._core.io.write(f'SCONfiguration:MULTiinstrument:STATe {param}')
def clone(self) -> 'MultiInstrumentCls': """ 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 = MultiInstrumentCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group