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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Cell:
	"""Cell commands group definition. 26 total commands, 13 Sub-groups, 2 group commands
	Repeated Capability: CellNull, default value after init: CellNull.Nr0"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._base = CommandsGroup("cell", core, parent)
		self._base.rep_cap = RepeatedCapability(self._base.group_name, 'repcap_cellNull_get', 'repcap_cellNull_set', repcap.CellNull.Nr0)

	def repcap_cellNull_set(self, enum_value: repcap.CellNull) -> None:
		"""Repeated Capability default value numeric suffix.
		This value is used, if you do not explicitely set it in the child set/get methods, or if you leave it to CellNull.Default
		Default value after init: CellNull.Nr0"""
		self._base.set_repcap_enum_value(enum_value)

	def repcap_cellNull_get(self) -> repcap.CellNull:
		"""Returns the current default repeated capability for the child set/get methods"""
		# noinspection PyTypeChecker
		return self._base.get_repcap_enum_value()

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

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

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

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

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

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

	@property
	def seqElem(self):
		"""seqElem commands group. 6 Sub-classes, 0 commands."""
		if not hasattr(self, '_seqElem'):
			from .SeqElem import SeqElem
			self._seqElem = SeqElem(self._core, self._base)
		return self._seqElem

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

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

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

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

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

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

	def delete(self, userIx=repcap.UserIx.Default, cellNull=repcap.CellNull.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:ONEWeb:DL:USER<CH>:AS:DL:CELL<ST0>:DELete \n
		Snippet: driver.source.bb.oneweb.downlink.user.asPy.downlink.cell.delete(userIx = repcap.UserIx.Default, cellNull = repcap.CellNull.Default) \n
		No command help available \n
			:param userIx: optional repeated capability selector. Default value: Nr1 (settable in the interface 'User')
			:param cellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell')"""
		userIx_cmd_val = self._base.get_repcap_cmd_value(userIx, repcap.UserIx)
		cellNull_cmd_val = self._base.get_repcap_cmd_value(cellNull, repcap.CellNull)
		self._core.io.write(f'SOURce<HwInstance>:BB:ONEWeb:DL:USER{userIx_cmd_val}:AS:DL:CELL{cellNull_cmd_val}:DELete')

	def delete_with_opc(self, userIx=repcap.UserIx.Default, cellNull=repcap.CellNull.Default) -> None:
		userIx_cmd_val = self._base.get_repcap_cmd_value(userIx, repcap.UserIx)
		cellNull_cmd_val = self._base.get_repcap_cmd_value(cellNull, repcap.CellNull)
		"""SCPI: [SOURce<HW>]:BB:ONEWeb:DL:USER<CH>:AS:DL:CELL<ST0>:DELete \n
		Snippet: driver.source.bb.oneweb.downlink.user.asPy.downlink.cell.delete_with_opc(userIx = repcap.UserIx.Default, cellNull = repcap.CellNull.Default) \n
		No command help available \n
		Same as delete, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value. \n
			:param userIx: optional repeated capability selector. Default value: Nr1 (settable in the interface 'User')
			:param cellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell')"""
		self._core.io.write_with_opc(f'SOURce<HwInstance>:BB:ONEWeb:DL:USER{userIx_cmd_val}:AS:DL:CELL{cellNull_cmd_val}:DELete')

	def reset(self, userIx=repcap.UserIx.Default, cellNull=repcap.CellNull.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:ONEWeb:DL:USER<CH>:AS:DL:CELL<ST0>:RESet \n
		Snippet: driver.source.bb.oneweb.downlink.user.asPy.downlink.cell.reset(userIx = repcap.UserIx.Default, cellNull = repcap.CellNull.Default) \n
		No command help available \n
			:param userIx: optional repeated capability selector. Default value: Nr1 (settable in the interface 'User')
			:param cellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell')"""
		userIx_cmd_val = self._base.get_repcap_cmd_value(userIx, repcap.UserIx)
		cellNull_cmd_val = self._base.get_repcap_cmd_value(cellNull, repcap.CellNull)
		self._core.io.write(f'SOURce<HwInstance>:BB:ONEWeb:DL:USER{userIx_cmd_val}:AS:DL:CELL{cellNull_cmd_val}:RESet')

	def reset_with_opc(self, userIx=repcap.UserIx.Default, cellNull=repcap.CellNull.Default) -> None:
		userIx_cmd_val = self._base.get_repcap_cmd_value(userIx, repcap.UserIx)
		cellNull_cmd_val = self._base.get_repcap_cmd_value(cellNull, repcap.CellNull)
		"""SCPI: [SOURce<HW>]:BB:ONEWeb:DL:USER<CH>:AS:DL:CELL<ST0>:RESet \n
		Snippet: driver.source.bb.oneweb.downlink.user.asPy.downlink.cell.reset_with_opc(userIx = repcap.UserIx.Default, cellNull = repcap.CellNull.Default) \n
		No command help available \n
		Same as reset, but waits for the operation to complete before continuing further. Use the RsSmw.utilities.opc_timeout_set() to set the timeout value. \n
			:param userIx: optional repeated capability selector. Default value: Nr1 (settable in the interface 'User')
			:param cellNull: optional repeated capability selector. Default value: Nr0 (settable in the interface 'Cell')"""
		self._core.io.write_with_opc(f'SOURce<HwInstance>:BB:ONEWeb:DL:USER{userIx_cmd_val}:AS:DL:CELL{cellNull_cmd_val}:RESet')

	def clone(self) -> 'Cell':
		"""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 = Cell(self._core, self._base.parent)
		self._base.synchronize_repcaps(new_group)
		return new_group
