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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Wlist:
	"""Wlist commands group definition. 5 total commands, 3 Sub-groups, 1 group commands"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._base = CommandsGroup("wlist", core, parent)

	@property
	def dasr(self):
		"""dasr commands group. 0 Sub-classes, 1 commands."""
		if not hasattr(self, '_dasr'):
			from .Dasr import Dasr
			self._dasr = Dasr(self._core, self._base)
		return self._dasr

	@property
	def file(self):
		"""file commands group. 0 Sub-classes, 1 commands."""
		if not hasattr(self, '_file'):
			from .File import File
			self._file = File(self._core, self._base)
		return self._file

	@property
	def segment(self):
		"""segment commands group. 1 Sub-classes, 1 commands."""
		if not hasattr(self, '_segment'):
			from .Segment import Segment
			self._segment = Segment(self._core, self._base)
		return self._segment

	def save(self, sequencer=repcap.Sequencer.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:ESEQuencer:RTCI:[SEQuencer<ST>]:WLISt:SAVE \n
		Snippet: driver.source.bb.esequencer.rtci.sequencer.wlist.save(sequencer = repcap.Sequencer.Default) \n
		Save and load the waveform list to the coder board, the file extension *.inf_mswv is automatically assigned. \n
			:param sequencer: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sequencer')"""
		sequencer_cmd_val = self._base.get_repcap_cmd_value(sequencer, repcap.Sequencer)
		self._core.io.write(f'SOURce<HwInstance>:BB:ESEQuencer:RTCI:SEQuencer{sequencer_cmd_val}:WLISt:SAVE')

	def save_with_opc(self, sequencer=repcap.Sequencer.Default) -> None:
		sequencer_cmd_val = self._base.get_repcap_cmd_value(sequencer, repcap.Sequencer)
		"""SCPI: [SOURce<HW>]:BB:ESEQuencer:RTCI:[SEQuencer<ST>]:WLISt:SAVE \n
		Snippet: driver.source.bb.esequencer.rtci.sequencer.wlist.save_with_opc(sequencer = repcap.Sequencer.Default) \n
		Save and load the waveform list to the coder board, the file extension *.inf_mswv is automatically assigned. \n
		Same as save, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value. \n
			:param sequencer: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sequencer')"""
		self._core.io.write_with_opc(f'SOURce<HwInstance>:BB:ESEQuencer:RTCI:SEQuencer{sequencer_cmd_val}:WLISt:SAVE')

	def clone(self) -> 'Wlist':
		"""Clones the group by creating new object from it and its whole existing sub-groups
		Also copies all the existing default Repeated Capabilities setting,
		which you can change independently without affecting the original group"""
		new_group = Wlist(self._core, self._base.parent)
		self._base.synchronize_repcaps(new_group)
		return new_group
