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


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

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

	def set(self, num_zero_pwr_conf: int, channel=repcap.Channel.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:DRS:CELL<CH>:ZPNum \n
		Snippet: driver.source.bb.eutra.dl.drs.cell.zpNum.set(num_zero_pwr_conf = 1, channel = repcap.Channel.Default) \n
		Enables up to 5 ZeroTxPower CSI-RS within the DRS period. \n
			:param num_zero_pwr_conf: integer Range: 0 to 5
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cell')"""
		param = Conversions.decimal_value_to_str(num_zero_pwr_conf)
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		self._core.io.write(f'SOURce<HwInstance>:BB:EUTRa:DL:DRS:CELL{channel_cmd_val}:ZPNum {param}')

	def get(self, channel=repcap.Channel.Default) -> int:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:DRS:CELL<CH>:ZPNum \n
		Snippet: value: int = driver.source.bb.eutra.dl.drs.cell.zpNum.get(channel = repcap.Channel.Default) \n
		Enables up to 5 ZeroTxPower CSI-RS within the DRS period. \n
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cell')
			:return: num_zero_pwr_conf: integer Range: 0 to 5"""
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		response = self._core.io.query_str(f'SOURce<HwInstance>:BB:EUTRa:DL:DRS:CELL{channel_cmd_val}:ZPNum?')
		return Conversions.str_to_int(response)
