aboutsummaryrefslogtreecommitdiffstats
path: root/dpd/src/Adapt.py
diff options
context:
space:
mode:
authorandreas128 <Andreas>2017-09-08 10:05:56 +0200
committerandreas128 <Andreas>2017-09-08 10:05:56 +0200
commit988e0b9472489657f86838362b176863ec42d0fd (patch)
tree9a782277c75c8477119716f24e4064879ac0c56c /dpd/src/Adapt.py
parent1b6c5dd58658bbc1b423b50baa15ca3fae6a1065 (diff)
downloaddabmod-988e0b9472489657f86838362b176863ec42d0fd.tar.gz
dabmod-988e0b9472489657f86838362b176863ec42d0fd.tar.bz2
dabmod-988e0b9472489657f86838362b176863ec42d0fd.zip
Cleanup and change logging plots to svg
Diffstat (limited to 'dpd/src/Adapt.py')
-rw-r--r--dpd/src/Adapt.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/dpd/src/Adapt.py b/dpd/src/Adapt.py
index 5e05112..b4042d6 100644
--- a/dpd/src/Adapt.py
+++ b/dpd/src/Adapt.py
@@ -85,7 +85,7 @@ class Adapt:
# TODO this is specific to the B200
if gain < 0 or gain > 89:
raise ValueError("Gain has to be in [0,89]")
- return self.send_receive("set uhd txgain %d" % gain)
+ return self.send_receive("set uhd txgain %.4f" % float(gain))
def get_txgain(self):
"""Get the txgain value in dB for the ODR-DabMod."""
@@ -103,12 +103,12 @@ class Adapt:
# TODO this is specific to the B200
if gain < 0 or gain > 89:
raise ValueError("Gain has to be in [0,89]")
- return self.send_receive("set uhd rxgain %d" % gain)
+ return self.send_receive("set uhd rxgain %.4f" % float(gain))
def get_rxgain(self):
"""Get the rxgain value in dB for the ODR-DabMod."""
# TODO handle failure
- return int(self.send_receive("get uhd rxgain")[0])
+ return float(self.send_receive("get uhd rxgain")[0])
def set_digital_gain(self, gain):
"""Set a new rxgain for the ODR-DabMod.
@@ -118,7 +118,8 @@ class Adapt:
gain : int
new RX gain, in the same format as ODR-DabMod's config file
"""
- return self.send_receive("set gain digital %.5f" % gain)
+ msg = "set gain digital %.5f" % gain
+ return self.send_receive(msg)
def get_digital_gain(self):
"""Get the rxgain value in dB for the ODR-DabMod."""