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