Commit 28c322a9 authored by auke.klazema's avatar auke.klazema

Fixed pep8 line sep between methods

parent 433bb897
......@@ -59,6 +59,7 @@ class PROLOGIX_GPIB_USB():
else:
self._devices = "Not scanned."
self._hpib_address = -1
def command(self, hpib_address, commandStr):
if hpib_address != self._hpib_address:
self._commandStr = "++addr " + str(hpib_address)+chr(10)
......@@ -67,6 +68,7 @@ class PROLOGIX_GPIB_USB():
self._commandStr = ""
self._commandStr += commandStr+chr(10)
self._commandCount = self._serialPort.write(self._commandStr)
def query(self, hpib_address, queryStr, count=80):
if hpib_address != self._hpib_address:
self._commandStr = "++addr " + str(hpib_address)+chr(10)
......@@ -77,10 +79,12 @@ class PROLOGIX_GPIB_USB():
self._commandCount = self._serialPort.write(self._commandStr)
self._returnStr = self._serialPort.readline()
return self._returnStr[:-1]
def setLocal(self, hpib_address):
#self._commandStr = "++addr "+str(hpib_address)+chr(10)+"loc "+str(hpib_address)+chr(10)
#self._commandCount = self._serialPort.write(self._commandStr)
return
def getDevices(self):
return self._devices
......@@ -93,9 +97,11 @@ class GPIB_232_485CT_A():
interCharTimeout, timeout)
self._serialPort.flushInput()
self._pause = pause
def command(self, hpib_address, commandStr):
self._commandStr = "wr "+str(hpib_address)+chr(10)+commandStr+chr(13)
self._commandCount = self._serialPort.write(self._commandStr)
def query(self, hpib_address, queryStr, count=80):
# flushInput should not be necessary
# self._serialPort.flushInput()
......@@ -106,6 +112,7 @@ class GPIB_232_485CT_A():
self._returnStr = self._serialPort.read(count)
self._returnCnt = int(self._serialPort.readline())
return self._returnStr[:self._returnCnt-1]
def setLocal(self, hpib_address):
self._commandStr = "loc "+str(hpib_address)+chr(13)
self._commandCount = self._serialPort.write(self._commandStr)
......@@ -117,19 +124,23 @@ class hpib_device():
self._port = port
self._keepLocal = keepLocal
self._pause = pause
def keepRemote(self, keepRemote=False):
self._keepLocal = not keepRemote
def setLocal(self, set2Local=True):
if set2Local:
self._port.setLocal(self._hpib_address)
def command(self, commandStr):
self._port.command(self._hpib_address, commandStr)
self.setLocal(self._keepLocal)
time.sleep(self._pause)
def query(self, queryStr):
self._answerStr = self._port.query(self._hpib_address, queryStr)
self.setLocal(self._keepLocal)
return self._answerStr
def getDevices(self):
return ["Not implemented"]
def getDevices(self):
return ["Not implemented"]
\ No newline at end of file
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