Commit 63fe7b16 authored by auke.klazema's avatar auke.klazema

extracted device finding to a method

parent 5cc34ee9
......@@ -35,6 +35,12 @@ class PrologixGpibUsb(PortDevice):
self._initialize_prologix_gpi()
if findDevices:
self._find_devices()
else:
self._devices = "Not scanned."
self._hpib_address = -1
def _find_devices(self):
self._devices = []
for self._hpib_address in range(0, 31):
commandStr = "++addr " + str(self._hpib_address) + chr(10) + \
......@@ -44,9 +50,6 @@ class PrologixGpibUsb(PortDevice):
returnStr = self._serialPort.readline()
if returnStr != "":
self._devices += [self._hpib_address, returnStr]
else:
self._devices = "Not scanned."
self._hpib_address = -1
def _initialize_prologix_gpi(self):
self._serialPort.write("++savecfg 0" + chr(10))
......
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