Commit 9a1484eb authored by Christian Schneider's avatar Christian Schneider
Browse files

Fixed bugs and tested

parent 06702a41
...@@ -148,8 +148,8 @@ class DA(object): ...@@ -148,8 +148,8 @@ class DA(object):
# Database functions ####################################################### # Database functions #######################################################
def get_parameters(self): def get_parameters(self):
d = {'Attenuation': '{:.0f} dB'.format(self.attenuation()), d = {'Attenuation': '{:.1f} dB'.format(self.attenuation()),
'Deviation': '{:.2f} dB'.format(self.deviation()), 'Deviation': '{} dB'.format(self.deviation()),
'Maximum Attenuation': ('{:.0f} dB' 'Maximum Attenuation': ('{:.0f} dB'
.format(self.instr.max_attenuation)), .format(self.instr.max_attenuation)),
'Maximum Frequency': ('{:.0f} GHz' 'Maximum Frequency': ('{:.0f} GHz'
......
...@@ -36,7 +36,8 @@ class RCDAT(object): ...@@ -36,7 +36,8 @@ class RCDAT(object):
self._inst = rm.open_resource('TCPIP0::{}::SOCKET'.format(ip)) self._inst = rm.open_resource('TCPIP0::{}::SOCKET'.format(ip))
# Correct for bug in minicircuits communication implementation # Correct for bug in minicircuits communication implementation
self._inst.read_termination = '\n\r' self._inst.read_termination = '\r'
self._inst.read()
def com(self, command, arg="?"): def com(self, command, arg="?"):
"""Function to communicate with the device. Gives the current status """Function to communicate with the device. Gives the current status
...@@ -44,7 +45,7 @@ class RCDAT(object): ...@@ -44,7 +45,7 @@ class RCDAT(object):
if arg == "?": if arg == "?":
resp = self._inst.query("{}?".format(command)) resp = self._inst.query("{}?".format(command))
try: try:
return float(resp) return float(resp.strip('\n'))
except: except:
return resp.strip('\n') return resp.strip('\n')
...@@ -106,7 +107,7 @@ class RCDAT(object): ...@@ -106,7 +107,7 @@ class RCDAT(object):
# Query current value # Query current value
else: else:
return self.com('ATT') return self.com(':ATT')
def set_offset(self, offset='?'): def set_offset(self, offset='?'):
pass pass
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment