Commit 153cf1a4 authored by Tammo Jan Dijkema's avatar Tammo Jan Dijkema
Browse files

Fix check to work with units

parent cac4019b
......@@ -15,7 +15,6 @@ class CamrasHpibDevice(HpibDevice):
with CamrasHpibDevice._CamrasHpibDevice__port_lock:
_port = hpib.PrologixGpibUsb()
super(CamrasHpibDevice, self).__init__(address, _port)
self.__frequency = 0
@property
def frequency(self):
......@@ -33,7 +32,7 @@ class CamrasHpibDevice(HpibDevice):
freq = freq.to(u.Hz).value
self.command("freq {:d} Hz".format(int(freq)))
new_freq = self.frequency
if int(new_freq) != int(freq):
if int(new_freq.to(u.Hz).value) != freq:
raise RuntimeError("Setting frequency failed: tried to set to {}, it is now {}".format(
freq, new_freq))
......
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