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


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class Mpdcchset:
	"""Mpdcchset commands group definition. 1 total commands, 0 Sub-groups, 1 group commands"""

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

	def set(self, dci_mpdcch_set: enums.EutraPdcchTypeEmtc, channel=repcap.Channel.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:EMTC:DCI:ALLoc<CH>:MPDCchset \n
		Snippet: driver.source.bb.eutra.dl.emtc.dci.alloc.mpdcchset.set(dci_mpdcch_set = enums.EutraPdcchTypeEmtc.MPD1, channel = repcap.Channel.Default) \n
		Selects the MPDCCH set by which the DCI is carried. \n
			:param dci_mpdcch_set: MPD1| MPD2
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Alloc')"""
		param = Conversions.enum_scalar_to_str(dci_mpdcch_set, enums.EutraPdcchTypeEmtc)
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		self._core.io.write(f'SOURce<HwInstance>:BB:EUTRa:DL:EMTC:DCI:ALLoc{channel_cmd_val}:MPDCchset {param}')

	# noinspection PyTypeChecker
	def get(self, channel=repcap.Channel.Default) -> enums.EutraPdcchTypeEmtc:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:EMTC:DCI:ALLoc<CH>:MPDCchset \n
		Snippet: value: enums.EutraPdcchTypeEmtc = driver.source.bb.eutra.dl.emtc.dci.alloc.mpdcchset.get(channel = repcap.Channel.Default) \n
		Selects the MPDCCH set by which the DCI is carried. \n
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Alloc')
			:return: dci_mpdcch_set: MPD1| MPD2"""
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		response = self._core.io.query_str(f'SOURce<HwInstance>:BB:EUTRa:DL:EMTC:DCI:ALLoc{channel_cmd_val}:MPDCchset?')
		return Conversions.str_to_scalar_enum(response, enums.EutraPdcchTypeEmtc)
