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


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

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

	def set(self, non_zero_psf_offs: int, channel=repcap.Channel.Default, stream=repcap.Stream.Default) -> None:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:DRS:CELL<CH>:CSIRs<ST>:NZSFoffset \n
		Snippet: driver.source.bb.eutra.dl.drs.cell.csirs.nzsfOffset.set(non_zero_psf_offs = 1, channel = repcap.Channel.Default, stream = repcap.Stream.Default) \n
		Queries the subframe offset between the SSS and the CSI-RS in a DRS. \n
			:param non_zero_psf_offs: integer Range: 0 to 4
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cell')
			:param stream: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Csirs')"""
		param = Conversions.decimal_value_to_str(non_zero_psf_offs)
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		stream_cmd_val = self._base.get_repcap_cmd_value(stream, repcap.Stream)
		self._core.io.write(f'SOURce<HwInstance>:BB:EUTRa:DL:DRS:CELL{channel_cmd_val}:CSIRs{stream_cmd_val}:NZSFoffset {param}')

	def get(self, channel=repcap.Channel.Default, stream=repcap.Stream.Default) -> int:
		"""SCPI: [SOURce<HW>]:BB:EUTRa:DL:DRS:CELL<CH>:CSIRs<ST>:NZSFoffset \n
		Snippet: value: int = driver.source.bb.eutra.dl.drs.cell.csirs.nzsfOffset.get(channel = repcap.Channel.Default, stream = repcap.Stream.Default) \n
		Queries the subframe offset between the SSS and the CSI-RS in a DRS. \n
			:param channel: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Cell')
			:param stream: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Csirs')
			:return: non_zero_psf_offs: integer Range: 0 to 4"""
		channel_cmd_val = self._base.get_repcap_cmd_value(channel, repcap.Channel)
		stream_cmd_val = self._base.get_repcap_cmd_value(stream, repcap.Stream)
		response = self._core.io.query_str(f'SOURce<HwInstance>:BB:EUTRa:DL:DRS:CELL{channel_cmd_val}:CSIRs{stream_cmd_val}:NZSFoffset?')
		return Conversions.str_to_int(response)
