Source code for RsSmbv.Implementations.Source.Bb.Ofdm

from .....Internal.Core import Core
from .....Internal.CommandsGroup import CommandsGroup
from .....Internal import Conversions
from .....Internal.Utilities import trim_str_response
from ..... import enums


# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class OfdmCls:
	"""
	| Commands in total: 114
	| Subgroups: 16
	| Direct child commands: 18
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("ofdm", core, parent)

	@property
	def alloc(self):
		"""
		| Commands in total: 33
		| Subgroups: 19
		| Direct child commands: 0
		"""
		if not hasattr(self, '_alloc'):
			from .Alloc import AllocCls
			self._alloc = AllocCls(self._core, self._cmd_group)
		return self._alloc

	@property
	def clock(self):
		"""
		| Commands in total: 3
		| Subgroups: 0
		| Direct child commands: 3
		"""
		if not hasattr(self, '_clock'):
			from .Clock import ClockCls
			self._clock = ClockCls(self._core, self._cmd_group)
		return self._clock

	@property
	def cpLength(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_cpLength'):
			from .CpLength import CpLengthCls
			self._cpLength = CpLengthCls(self._core, self._cmd_group)
		return self._cpLength

	@property
	def csLength(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_csLength'):
			from .CsLength import CsLengthCls
			self._csLength = CsLengthCls(self._core, self._cmd_group)
		return self._csLength

	@property
	def dfts(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_dfts'):
			from .Dfts import DftsCls
			self._dfts = DftsCls(self._core, self._cmd_group)
		return self._dfts

	@property
	def filterPy(self):
		"""
		| Commands in total: 9
		| Subgroups: 0
		| Direct child commands: 9
		"""
		if not hasattr(self, '_filterPy'):
			from .FilterPy import FilterPyCls
			self._filterPy = FilterPyCls(self._core, self._cmd_group)
		return self._filterPy

	@property
	def fofdm(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_fofdm'):
			from .Fofdm import FofdmCls
			self._fofdm = FofdmCls(self._core, self._cmd_group)
		return self._fofdm

	@property
	def gfdm(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_gfdm'):
			from .Gfdm import GfdmCls
			self._gfdm = GfdmCls(self._core, self._cmd_group)
		return self._gfdm

	@property
	def modPreset(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_modPreset'):
			from .ModPreset import ModPresetCls
			self._modPreset = ModPresetCls(self._core, self._cmd_group)
		return self._modPreset

	@property
	def notch(self):
		"""
		| Commands in total: 8
		| Subgroups: 4
		| Direct child commands: 3
		"""
		if not hasattr(self, '_notch'):
			from .Notch import NotchCls
			self._notch = NotchCls(self._core, self._cmd_group)
		return self._notch

	@property
	def setting(self):
		"""
		| Commands in total: 4
		| Subgroups: 0
		| Direct child commands: 4
		"""
		if not hasattr(self, '_setting'):
			from .Setting import SettingCls
			self._setting = SettingCls(self._core, self._cmd_group)
		return self._setting

	@property
	def symbolRate(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_symbolRate'):
			from .SymbolRate import SymbolRateCls
			self._symbolRate = SymbolRateCls(self._core, self._cmd_group)
		return self._symbolRate

	@property
	def trigger(self):
		"""
		| Commands in total: 23
		| Subgroups: 6
		| Direct child commands: 5
		"""
		if not hasattr(self, '_trigger'):
			from .Trigger import TriggerCls
			self._trigger = TriggerCls(self._core, self._cmd_group)
		return self._trigger

	@property
	def ufmc(self):
		"""
		| Commands in total: 2
		| Subgroups: 0
		| Direct child commands: 2
		"""
		if not hasattr(self, '_ufmc'):
			from .Ufmc import UfmcCls
			self._ufmc = UfmcCls(self._core, self._cmd_group)
		return self._ufmc

	@property
	def user(self):
		"""
		| Commands in total: 5
		| Subgroups: 5
		| Direct child commands: 0
		"""
		if not hasattr(self, '_user'):
			from .User import UserCls
			self._user = UserCls(self._core, self._cmd_group)
		return self._user

	@property
	def waveform(self):
		"""
		| Commands in total: 1
		| Subgroups: 0
		| Direct child commands: 1
		"""
		if not hasattr(self, '_waveform'):
			from .Waveform import WaveformCls
			self._waveform = WaveformCls(self._core, self._cmd_group)
		return self._waveform

[docs] def get_acp_length(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:ACPLength`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_acp_length()`` \n For f-OFDM/OFDM, enables additional alternative CP. :return: cp_length: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:ACPLength?') return Conversions.str_to_int(response)
[docs] def set_acp_length(self, cp_length: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:ACPLength`` \n Snippet: ``driver.source.bb.ofdm.set_acp_length(cp_length = 1)`` \n For f-OFDM/OFDM, enables additional alternative CP. :param cp_length: integer Range: 0 to 8192 """ param = Conversions.decimal_value_to_str(cp_length) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:ACPLength {param}')
[docs] def get_acp_symbols(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:ACPSymbols`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_acp_symbols()`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :return: cp_symbols: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:ACPSymbols?') return Conversions.str_to_int(response)
[docs] def set_acp_symbols(self, cp_symbols: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:ACPSymbols`` \n Snippet: ``driver.source.bb.ofdm.set_acp_symbols(cp_symbols = 1)`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :param cp_symbols: integer Range: 0 to 8192 """ param = Conversions.decimal_value_to_str(cp_symbols) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:ACPSymbols {param}')
[docs] def get_bw_occupied(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:BWOCcupied`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_bw_occupied()`` \n Queries the occupied bandwidth. :return: occ_bw: float Range: 0.001 to 1000, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:BWOCcupied?') return Conversions.str_to_float(response)
[docs] def get_cp_symbols(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:CPSYmbols`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_cp_symbols()`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :return: cp_symbols: integer Range: 0 to 8192 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:CPSYmbols?') return Conversions.str_to_int(response)
[docs] def set_cp_symbols(self, cp_symbols: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:CPSYmbols`` \n Snippet: ``driver.source.bb.ofdm.set_cp_symbols(cp_symbols = 1)`` \n For f-OFDM/OFDM, defines number of symbols on that the cyclic prefix/the alternative cyclic prefix is applied. :param cp_symbols: integer Range: 0 to 8192 """ param = Conversions.decimal_value_to_str(cp_symbols) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:CPSYmbols {param}')
# noinspection PyTypeChecker
[docs] def get_dc_mode(self) -> enums.C5GdcMode: """ ``[SOURce<HW>]:BB:OFDM:DCMode`` \n Snippet: ``value: enums.C5GdcMode = driver.source.bb.ofdm.get_dc_mode()`` \n Sets the DC subcarrier mode. :return: dc_mode: UTIL | PUNC | SKIP UTIL Uses the DC subcarrier for all allocations. PUNC Replaces the DC subcarrier by zeroes for all allocations. SKIP Skips the DC subcarrier in the discrete Fourier transformation (DFT) . """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:DCMode?') return Conversions.str_to_scalar_enum(response, enums.C5GdcMode)
[docs] def set_dc_mode(self, dc_mode: enums.C5GdcMode) -> None: """ ``[SOURce<HW>]:BB:OFDM:DCMode`` \n Snippet: ``driver.source.bb.ofdm.set_dc_mode(dc_mode = enums.C5GdcMode.PUNC)`` \n Sets the DC subcarrier mode. :param dc_mode: UTIL | PUNC | SKIP UTIL Uses the DC subcarrier for all allocations. PUNC Replaces the DC subcarrier by zeroes for all allocations. SKIP Skips the DC subcarrier in the discrete Fourier transformation (DFT) . """ param = Conversions.enum_scalar_to_str(dc_mode, enums.C5GdcMode) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:DCMode {param}')
[docs] def get_lguard(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:LGUard`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_lguard()`` \n Queries the number of left guard subcarriers. :return: left_guard_sc: integer Range: 0 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:LGUard?') return Conversions.str_to_int(response)
# noinspection PyTypeChecker
[docs] def get_modulation(self) -> enums.C5Gmod: """ ``[SOURce<HW>]:BB:OFDM:MODulation`` \n Snippet: ``value: enums.C5Gmod = driver.source.bb.ofdm.get_modulation()`` \n Selects the modulation type. :return: mod_type: UFMC | FBMC | GFDM | FOFDm | OFDM """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:MODulation?') return Conversions.str_to_scalar_enum(response, enums.C5Gmod)
[docs] def set_modulation(self, mod_type: enums.C5Gmod) -> None: """ ``[SOURce<HW>]:BB:OFDM:MODulation`` \n Snippet: ``driver.source.bb.ofdm.set_modulation(mod_type = enums.C5Gmod.FBMC)`` \n Selects the modulation type. :param mod_type: UFMC | FBMC | GFDM | FOFDm | OFDM """ param = Conversions.enum_scalar_to_str(mod_type, enums.C5Gmod) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:MODulation {param}')
[docs] def get_nalloc(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NALLoc`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_nalloc()`` \n Sets the number of scheduled allocations. :return: no_of_alloc: integer Range: 0 to 500 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NALLoc?') return Conversions.str_to_int(response)
[docs] def set_nalloc(self, no_of_alloc: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:NALLoc`` \n Snippet: ``driver.source.bb.ofdm.set_nalloc(no_of_alloc = 1)`` \n Sets the number of scheduled allocations. :param no_of_alloc: integer Range: 0 to 500 """ param = Conversions.decimal_value_to_str(no_of_alloc) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:NALLoc {param}')
[docs] def get_noccupied(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NOCCupied`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_noccupied()`` \n Sets the number of occupied subcarriers. :return: num_occ_sc: integer Range: 1 to 13107 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NOCCupied?') return Conversions.str_to_int(response)
[docs] def set_noccupied(self, num_occ_sc: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:NOCCupied`` \n Snippet: ``driver.source.bb.ofdm.set_noccupied(num_occ_sc = 1)`` \n Sets the number of occupied subcarriers. :param num_occ_sc: integer Range: 1 to 13107 """ param = Conversions.decimal_value_to_str(num_occ_sc) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:NOCCupied {param}')
[docs] def get_nsubcarriers(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:NSUBcarriers`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_nsubcarriers()`` \n Sets the number of available subcarriers. :return: no_of_sub_carr: integer Range: 64 to 16384 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:NSUBcarriers?') return Conversions.str_to_int(response)
[docs] def set_nsubcarriers(self, no_of_sub_carr: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:NSUBcarriers`` \n Snippet: ``driver.source.bb.ofdm.set_nsubcarriers(no_of_sub_carr = 1)`` \n Sets the number of available subcarriers. :param no_of_sub_carr: integer Range: 64 to 16384 """ param = Conversions.decimal_value_to_str(no_of_sub_carr) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:NSUBcarriers {param}')
[docs] def get_out_path(self) -> str: """ ``[SOURce<HW>]:BB:OFDM:OUTPath`` \n Snippet: ``value: str = driver.source.bb.ofdm.get_out_path()`` \n Specifies the output path and output file of the exported OFDM signal generation settings. By default, the output path is /var/user/K114-Export and the output file is Exported_K114_settings_K96.xml. See also Example 'Default 'Exported_K114_settings_K96.xml' file'. :return: k_114_output_path: string """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:OUTPath?') return trim_str_response(response)
[docs] def set_out_path(self, k_114_output_path: str) -> None: """ ``[SOURce<HW>]:BB:OFDM:OUTPath`` \n Snippet: ``driver.source.bb.ofdm.set_out_path(k_114_output_path = 'abc')`` \n Specifies the output path and output file of the exported OFDM signal generation settings. By default, the output path is /var/user/K114-Export and the output file is Exported_K114_settings_K96.xml. See also Example 'Default 'Exported_K114_settings_K96.xml' file'. :param k_114_output_path: string """ param = Conversions.value_to_quoted_str(k_114_output_path) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:OUTPath {param}')
[docs] def preset(self) -> None: """ ``[SOURce<HW>]:BB:OFDM:PRESet`` \n Snippet: ``driver.source.bb.ofdm.preset()`` \n Sets the parameters of the digital standard to their default values (``*RST`` values specified for the commands) . Not affected is the state set with the command SOURce<hw>:BB:OFDM:STATe. """ self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:PRESet')
[docs] def preset_with_opc(self, opc_timeout_ms: int = -1) -> None: """ ``[SOURce<HW>]:BB:OFDM:PRESet`` \n Snippet: ``driver.source.bb.ofdm.preset_with_opc()`` \n Sets the parameters of the digital standard to their default values (``*RST`` values specified for the commands) . Not affected is the state set with the command SOURce<hw>:BB:OFDM:STATe. Same as preset, but waits for the operation to complete before continuing further. Use the RsSmbv.utilities.opc_timeout_set() to set the timeout value. :param opc_timeout_ms: Maximum time to wait in milliseconds, valid only for this call. """ self._core.io.write_with_opc(f'SOURce<HwInstance>:BB:OFDM:PRESet', opc_timeout_ms)
[docs] def get_rguard(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:RGUard`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_rguard()`` \n Queries the number of right guard subcarriers. :return: right_guard_sc: integer Range: 0 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:RGUard?') return Conversions.str_to_int(response)
[docs] def get_sampling(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:SAMPling`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_sampling()`` \n Queries the sampling rate. :return: samp_rate: float Range: 0.001 to 1000, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SAMPling?') return Conversions.str_to_float(response)
[docs] def get_sc_space(self) -> float: """ ``[SOURce<HW>]:BB:OFDM:SCSPace`` \n Snippet: ``value: float = driver.source.bb.ofdm.get_sc_space()`` \n Sets the frequency distance between the carrier frequencies of the subcarriers. :return: sub_car_sp: float Range: 0.001 to 2, Unit: MHz """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SCSPace?') return Conversions.str_to_float(response)
[docs] def set_sc_space(self, sub_car_sp: float) -> None: """ ``[SOURce<HW>]:BB:OFDM:SCSPace`` \n Snippet: ``driver.source.bb.ofdm.set_sc_space(sub_car_sp = 1.0)`` \n Sets the frequency distance between the carrier frequencies of the subcarriers. :param sub_car_sp: float Range: 0.001 to 2, Unit: MHz """ param = Conversions.decimal_value_to_str(sub_car_sp) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:SCSPace {param}')
[docs] def get_seq_length(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:SEQLength`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_seq_length()`` \n Sets the sequence length of the signal in number of symbols. :return: seq_len: integer Range: 1 to 1000 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SEQLength?') return Conversions.str_to_int(response)
[docs] def set_seq_length(self, seq_len: int) -> None: """ ``[SOURce<HW>]:BB:OFDM:SEQLength`` \n Snippet: ``driver.source.bb.ofdm.set_seq_length(seq_len = 1)`` \n Sets the sequence length of the signal in number of symbols. :param seq_len: integer Range: 1 to 1000 """ param = Conversions.decimal_value_to_str(seq_len) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:SEQLength {param}')
[docs] def get_state(self) -> bool: """ ``[SOURce<HW>]:BB:OFDM:STATe`` \n Snippet: ``value: bool = driver.source.bb.ofdm.get_state()`` \n Activates the standard. :return: state: 1 | ON | 0| OFF """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:STATe?') return Conversions.str_to_bool(response)
[docs] def set_state(self, state: bool) -> None: """ ``[SOURce<HW>]:BB:OFDM:STATe`` \n Snippet: ``driver.source.bb.ofdm.set_state(state = False)`` \n Activates the standard. :param state: 1 | ON | 0| OFF """ param = Conversions.bool_to_str(state) self._core.io.write(f'SOURce<HwInstance>:BB:OFDM:STATe {param}')
[docs] def get_subcarriers(self) -> int: """ ``[SOURce<HW>]:BB:OFDM:SUBCarriers`` \n Snippet: ``value: int = driver.source.bb.ofdm.get_subcarriers()`` \n Queries the number of subcarriers per subband. :return: subc_per_subband: integer Range: 1 to 16384 """ response = self._core.io.query_str('SOURce<HwInstance>:BB:OFDM:SUBCarriers?') return Conversions.str_to_int(response)
def clone(self) -> 'OfdmCls': """ Clones the group by creating new object from it and its whole existing subgroups. Also copies all the existing default Repeated Capabilities setting, which you can change independently without affecting the original group. """ new_group = OfdmCls(self._core, self._cmd_group.parent) self._cmd_group.synchronize_repcaps(new_group) return new_group