Skip to content

Commit

Permalink
Added device run state cycling to parameter set methods where needed
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanielloNTIA committed Jun 24, 2022
1 parent 9c74d1c commit 5ac7ebb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = tekrsa-api-wrap
version = 1.0.0
version = 1.1.0
author = The Institute for Telecommunication Sciences
description = NTIA Python wrapper for Tektronix RSA API for Linux
long_description = file: README.md
Expand Down
16 changes: 16 additions & 0 deletions src/rsa_api/rsa_api_wrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,13 +530,17 @@ def CONFIG_SetAutoAttenuationEnable(self, enable: bool) -> None:
"""
Set the signal path auto-attenuation enable state.
The device Run state is cycled in order to apply the setting.
Parameters
----------
enable : bool
True enables auto-attenuation operation. False disables it.
"""
enable = RSA.check_bool(enable)
self.rsa.DEVICE_Stop()
self.err_check(self.rsa.CONFIG_SetAutoAttenuationEnable(c_bool(enable)))
self.rsa.DEVICE_Run()

def CONFIG_GetRFPreampEnable(self) -> bool:
"""
Expand All @@ -556,13 +560,17 @@ def CONFIG_SetRFPreampEnable(self, enable: bool) -> None:
"""
Set the RF Preamplifier enable state.
The device Run state is cycled in order to apply the setting.
Parameters
----------
enable : bool
True enables the RF Preamplifier. False disables it.
"""
enable = RSA.check_bool(enable)
self.rsa.DEVICE_Stop()
self.err_check(self.rsa.CONFIG_SetRFPreampEnable(c_bool(enable)))
self.rsa.DEVICE_Run()

def CONFIG_GetRFAttenuator(self) -> float:
"""
Expand All @@ -581,6 +589,8 @@ def CONFIG_SetRFAttenuator(self, value: Union[float, int]) -> None:
"""
Set the RF Input Attenuator value manually.
The device Run state is cycled in order to apply the setting.
Parameters
----------
value : float
Expand All @@ -589,7 +599,9 @@ def CONFIG_SetRFAttenuator(self, value: Union[float, int]) -> None:
"""
value = RSA.check_num(value)
value = RSA.check_range(value, -51, 0)
self.rsa.DEVICE_Stop()
self.err_check(self.rsa.CONFIG_SetRFAttenuator(c_double(value)))
self.rsa.DEVICE_Run()

""" DEVICE METHODS """

Expand Down Expand Up @@ -1241,6 +1253,8 @@ def IQSTREAM_SetAcqBandwidth(self, bw_hz_req: Union[float, int]) -> None:
"""
Request the acquisition bandwidth of the output IQ stream samples.
The device Run state is cycled in order to apply the setting.
Parameters
----------
bw_hz_req : float or int
Expand All @@ -1249,7 +1263,9 @@ def IQSTREAM_SetAcqBandwidth(self, bw_hz_req: Union[float, int]) -> None:
bw_hz_req = RSA.check_num(bw_hz_req)
bw_hz_req = RSA.check_range(bw_hz_req, self.IQSTREAM_GetMinAcqBandwidth(),
self.IQSTREAM_GetMaxAcqBandwidth())
self.rsa.DEVICE_Stop()
self.err_check(self.rsa.IQSTREAM_SetAcqBandwidth(c_double(bw_hz_req)))
self.rsa.DEVICE_Run()

def IQSTREAM_SetDiskFileLength(self, msec: int) -> None:
"""
Expand Down

0 comments on commit 5ac7ebb

Please sign in to comment.