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

Fixed pep8 line sep between methods

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