Commit ffce98a7 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Make checking of frequency optional

parent e6bcc19f
......@@ -10,8 +10,9 @@ class CamrasHpibDevice(object):
command_thread = None
def __init__(self, address):
def __init__(self, address, check_frequency=True):
self.hpib_address = address
self._check_frequency = check_frequency
if not CamrasHpibDevice.command_thread:
serial_port = serial.Serial("/dev/ttyUSB0")
......@@ -54,7 +55,7 @@ class CamrasHpibDevice(object):
CamrasHpibDevice.command_thread.protocol.command("freq {:d} Hz".format(int(freq)),
new_freq = self.frequency
if != int(freq):
if self._check_frequency and != int(freq):
raise RuntimeError("Setting frequency failed: tried to set to {}, it is now {}".format(
freq, new_freq))
Supports Markdown
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