Commit 59f1d598 authored by Christian Schneider's avatar Christian Schneider
Browse files

Bugfixes

parent d9ca6ca7
......@@ -10,7 +10,7 @@ v2.0.1 - OSC:
import numpy as np
import visa
import struct
from Instruments.Drivers import dummy
from Instruments.Drivers.dummy import dummy
class FSV30(object):
......@@ -25,7 +25,7 @@ class FSV30(object):
"""
# Use dummy driver if testing
if test:
self._inst = dummy
self._inst = dummy(ip)
else:
rm = visa.ResourceManager()
self._inst = rm.open_resource('TCPIP::{}::INSTR'.format(ip) )
......
......@@ -12,7 +12,7 @@ import struct
import time
import numpy as np
import visa
from Instruments.Drivers import dummy
from Instruments.Drivers.dummy import dummy
class RSA5115B(object):
"""Instrument Driver for Tektronix RSA5115B Spectum analyzer"""
......@@ -25,7 +25,7 @@ class RSA5115B(object):
IP of spectrum analyzer
"""
if test:
self._inst = dummy
self._inst = dummy(ip)
else:
rm = visa.ResourceManager()
self._inst = rm.open_resource('TCPIP::{}::INSTR'.format(ip) )
......@@ -54,7 +54,8 @@ class RSA5115B(object):
return resp.strip('\n')
else:
self._inst.write("{} {}".format(command, arg))
arg = "{} {}".format(command, arg)
self._inst.write(arg)
return 0
def clear(self):
......
......@@ -11,14 +11,14 @@ class dummy(object):
"""Dummy instrument for testing
"""
def __init__(self, ip, reset=False):
def __init__(self, ip):
self.version = VERSION
self.ip = ip
def close(self):
return 0
def write(self):
def write(self, c):
"""Dummy write: Does nothing"""
return 0
......
......@@ -56,19 +56,20 @@ class SA(object):
# Device parameters ####################################################
self.test = False # Running in test mode?
try:
if id_string in IPList:
# Try to find device in IPList
self.ip = IPList[id_string]
except KeyError:
else:
# If it is a test, give IP with zeros and set test mode to true
if id_string[-4:-1].lower() == 'tes':
self.ip = '0.0.0.0'
self.test = True
# If SA is not specified by valid IPList entry. Try directly ip
if driver is not None:
elif driver is not None:
self.ip = id_string
else:
raise Exception('SA not in IPList. Please specify driver')
self.CryoID = cryostat
self.ch = 1
self.id = id_string
......
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