diff --git a/datalogger-gui.py b/datalogger-gui.py index 3f4c96e..1109909 100644 --- a/datalogger-gui.py +++ b/datalogger-gui.py @@ -10,8 +10,8 @@ from PyQt4.QtCore import pyqtSlot #============================================================================== class acq_routine(): - def __init__(self, instrument, channels, vtypes, adress, path = os.getcwd(), samplingtime = 1, fileduration = 24*3600): - exec('self.instrument = instruments.%s.%s(%s, %s, "%s")'%(instrument, instrument, channels, vtypes, adress)) + def __init__(self, instrument, channels, vtypes, address, path = os.getcwd(), samplingtime = 1, fileduration = 24*3600): + exec('self.instrument = instruments.%s.%s(%s, %s, "%s")'%(instrument, instrument, channels, vtypes, address)) self.path = path self.samplingtime = samplingtime self.fileduration = fileduration @@ -97,9 +97,9 @@ class mainGui(): self.comboInst = QtGui.QComboBox() self.layout.addWidget(self.comboInst, 0, 0) - self.adress = QtGui.QLineEdit() - self.adress.setMaximumWidth(120) - self.layout.addWidget(self.adress, 99, 0) + self.address = QtGui.QLineEdit() + self.address.setMaximumWidth(120) + self.layout.addWidget(self.address, 99, 0) self.startButton = QtGui.QPushButton() self.startButton.setText('Start log') @@ -137,15 +137,15 @@ class mainGui(): for i in reversed(range(5, self.layout.count())): self.layout.itemAt(i).widget().setParent(None) - defaultAdress = '' + defaultAddress = '' channelsAviables = [] vtypesAviables = [] exec('channelsAviables = instruments.%s.ALL_CHANNELS'%self.comboInst.currentText()) exec('vtypesAviables = instruments.%s.ALL_VAL_TYPE'%self.comboInst.currentText()) - exec('defaultAdress = instruments.%s.ADRESS'%self.comboInst.currentText()) + exec('defaultAddress = instruments.%s.ADDRESS'%self.comboInst.currentText()) - self.adress.setText(defaultAdress) + self.address.setText(defaultAddress) self.checkBoxChannels = [None]*len(channelsAviables) self.chListVtypes = [None]*len(self.checkBoxChannels) @@ -163,14 +163,14 @@ class mainGui(): self.checkBoxChannels[i].stateChanged.connect(self.infoSignal) self.chListVtypes[i].currentItemChanged.connect(self.infoSignal) - self.adress.textChanged.connect(self.infoSignal) + self.address.textChanged.connect(self.infoSignal) self.infoSignal() @pyqtSlot() def infoSignal(self): self.instToLog = self.comboInst.currentText() - self.adressToLog = self.adress.text() + self.addressToLog = self.address.text() self.chToLog = [] self.vTypeToLog = [] @@ -190,15 +190,15 @@ class mainGui(): else: self.startButton.setEnabled(True) - self.textDisplay.setText('>> %s@%s - %s - %s'%(self.instToLog, self.adressToLog, self.chToLog, self.vTypeToLog)) + self.textDisplay.setText('>> %s@%s - %s - %s'%(self.instToLog, self.addressToLog, self.chToLog, self.vTypeToLog)) - self.myLog = acq_routine(self.instToLog, self.chToLog, self.vTypeToLog, self.adressToLog) + self.myLog = acq_routine(self.instToLog, self.chToLog, self.vTypeToLog, self.addressToLog) @pyqtSlot() def startLog(self): self.startButton.setEnabled(False) self.stopButton.setEnabled(True) - self.adress.setEnabled(False) + self.address.setEnabled(False) self.comboInst.setEnabled(False) for i in self.checkBoxChannels: i.setEnabled(False) @@ -211,7 +211,7 @@ class mainGui(): def stopLog(self): self.startButton.setEnabled(True) self.stopButton.setEnabled(False) - self.adress.setEnabled(True) + self.address.setEnabled(True) self.comboInst.setEnabled(True) for i in range(len(self.checkBoxChannels)): if self.checkBoxChannels[i].isChecked(): diff --git a/instruments/AG34461A.py b/instruments/AG34461A.py index 6598805..727e7f8 100644 --- a/instruments/AG34461A.py +++ b/instruments/AG34461A.py @@ -6,14 +6,14 @@ import socket ALL_VAL_TYPE = ['DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ'] ALL_CHANNELS = ['1'] -ADRESS = "192.168.0.61" +ADDRESS = "192.168.0.61" CONF_VAL_TYPE = ['CONF:VOLT:DC', 'CONF:VOLT:AC', 'CONF:CURR:DC', 'CONF:CURR:AC', 'CONF:RES', 'CONF:FRES', 'CONF:FREQ'] #============================================================================== class AG34461A(abstract_instrument): - def __init__(self, channels, vtypes, adress=ADRESS): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.port = 5025 self.channels = channels self.vtypes = vtypes @@ -24,12 +24,12 @@ class AG34461A(abstract_instrument): return "AG34461A" def connect(self): - print('Connecting to device @%s:%s...' %(self.adress, self.port)) + print('Connecting to device @%s:%s...' %(self.address, self.port)) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.sock.settimeout(10.0) # Don't hang around forever - self.sock.connect((self.adress, self.port)) + self.sock.connect((self.address, self.port)) self.send("SYST:BEEP") print(' --> Ok') print(self.model()) diff --git a/instruments/AG34972A.py b/instruments/AG34972A.py index 2506b5c..a5e9f0b 100644 --- a/instruments/AG34972A.py +++ b/instruments/AG34972A.py @@ -6,14 +6,14 @@ import socket ALL_VAL_TYPE = ['DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ'] ALL_CHANNELS = ['101', '102', '103', '104', '105'] -ADRESS = "192.168.0.72" +ADDRESS = "192.168.0.72" CONF_VAL_TYPE = ['CONF:VOLT:DC', 'CONF:VOLT:AC', 'CONF:CURR:DC', 'CONF:CURR:AC', 'CONF:RES', 'CONF:FRES', 'CONF:FREQ'] #============================================================================== class AG34972A(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.port = 5025 self.channels = channels self.vtypes = vtypes @@ -24,12 +24,12 @@ class AG34972A(abstract_instrument): return "AG34972A" def connect(self): - print('Connecting to device @%s:%s...' %(self.adress, self.port)) + print('Connecting to device @%s:%s...' %(self.address, self.port)) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.sock.settimeout(2.0) # Don't hang around forever - self.sock.connect((self.adress, self.port)) + self.sock.connect((self.address, self.port)) self.send("SYST:BEEP") print(' --> Ok') print(self.model()) diff --git a/instruments/HP53132A.py b/instruments/HP53132A.py index 706cbe5..54fe137 100644 --- a/instruments/HP53132A.py +++ b/instruments/HP53132A.py @@ -6,14 +6,14 @@ import socket ALL_VAL_TYPE = ['FREQ'] #, 'PERIOD'] ALL_CHANNELS = ['1'] #, '2'] -ADRESS = "192.168.0.52" +ADDRESS = "192.168.0.52" CONF_VAL_TYPE = ['CONF:FREQ'] #, 'CONF:PERIOD'] #============================================================================== class HP53132A(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.port = 1234 self.gpib_addr = 12 self.channels = channels @@ -25,12 +25,12 @@ class HP53132A(abstract_instrument): return "HP53132A" def connect(self): - print('Connecting to device @%s:%s...' %(self.adress, self.port)) + print('Connecting to device @%s:%s...' %(self.address, self.port)) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.sock.settimeout(10.0) # Don't hang around forever - self.sock.connect((self.adress, self.port)) + self.sock.connect((self.address, self.port)) self.init_prologix() print(' --> Ok') print(self.model()) diff --git a/instruments/LS350.py b/instruments/LS350.py index b8cdc29..4e4f8c1 100644 --- a/instruments/LS350.py +++ b/instruments/LS350.py @@ -6,14 +6,14 @@ import socket ALL_VAL_TYPE = ['TEMP', 'RES'] ALL_CHANNELS = ['a', 'b', 'c', 'd'] -ADRESS = "192.168.0.12" +ADDRESS = "192.168.0.12" CONF_VAL_TYPE = ['krdg?', 'srdg?'] #============================================================================== class LS350(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.port = 7777 self.channels = channels self.vtypes = vtypes @@ -24,12 +24,12 @@ class LS350(abstract_instrument): return "LS350" def connect(self): - print('Connecting to device @%s:%s...' %(self.adress, self.port)) + print('Connecting to device @%s:%s...' %(self.address, self.port)) self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP) self.sock.settimeout(10.0) # Don't hang around forever - self.sock.connect((self.adress, self.port)) + self.sock.connect((self.address, self.port)) print(' --> Ok') print(self.model()) self.configure() diff --git a/instruments/PM100D.py b/instruments/PM100D.py index 6c3a40d..d30dc71 100644 --- a/instruments/PM100D.py +++ b/instruments/PM100D.py @@ -6,14 +6,14 @@ import os ALL_VAL_TYPE = ['PWR'] ALL_CHANNELS = ['1'] -ADRESS = "/dev/usbtmc0" +ADDRESS = "/dev/usbtmc0" CONF_VAL_TYPE = ['PWR'] #============================================================================== class PM100D(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.channels = channels self.vtypes = vtypes @@ -23,8 +23,8 @@ class PM100D(abstract_instrument): return "PM100D" def connect(self): - print('Connecting to device @%s...' %(self.adress)) - self.FILE = os.open(self.adress, os.O_RDWR) + print('Connecting to device @%s...' %(self.address)) + self.FILE = os.open(self.address, os.O_RDWR) print(' --> Ok') print(self.model()) self.configure() diff --git a/instruments/T7Pro.py b/instruments/T7Pro.py index 706f00a..3e28416 100644 --- a/instruments/T7Pro.py +++ b/instruments/T7Pro.py @@ -7,15 +7,15 @@ import numpy ALL_VAL_TYPE = ['RES', 'TEMP PT100 K', 'TEMP PT100 C'] ALL_CHANNELS = ['1', '2', '3', '4'] -ADRESS = "192.168.0.25" +ADDRESS = "192.168.0.25" CONF_CHANNELS = [["AIN0", "AIN10"], ["AIN2", "AIN11"], ["AIN4", "AIN12"], ["AIN6", "AIN13"]] VISHAY_CHANNELS = [1000., 1000., 1079., 10000.] #============================================================================== class T7Pro(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.channels = channels self.vtypes = vtypes @@ -23,8 +23,8 @@ class T7Pro(abstract_instrument): return 'T7Pro' def connect(self): - print('Connecting to device @%s...' %(self.adress)) - self.handle = ljm.openS("T7", "ETHERNET", self.adress) + print('Connecting to device @%s...' %(self.address)) + self.handle = ljm.openS("T7", "ETHERNET", self.address) print(' --> Ok') print(self.model()) self.configure() diff --git a/instruments/TPG261.py b/instruments/TPG261.py index 3abc65a..75368b8 100644 --- a/instruments/TPG261.py +++ b/instruments/TPG261.py @@ -5,13 +5,13 @@ import serial ALL_VAL_TYPE = ['PRE'] ALL_CHANNELS = ['1'] -ADRESS = "/dev/ttyS0" +ADDRESS = "/dev/ttyS0" #============================================================================== class TPG261(abstract_instrument): - def __init__(self, channels, vtypes, adress): - self.adress = adress + def __init__(self, channels, vtypes, address): + self.address = address self.channels = channels self.vtypes = vtypes @@ -19,8 +19,8 @@ class TPG261(abstract_instrument): return "PfeifferTPG261" def connect(self): - print('Connecting to device @%s...' %(self.adress)) - self.TPG = MaxiGauge(self.adress) + print('Connecting to device @%s...' %(self.address)) + self.TPG = MaxiGauge(self.address) print(' --> Ok') print(self.model()) self.configure() diff --git a/instruments/abstract_instrument.py b/instruments/abstract_instrument.py index 25f819b..47bafb6 100644 --- a/instruments/abstract_instrument.py +++ b/instruments/abstract_instrument.py @@ -4,7 +4,7 @@ class abstract_instrument(object): __metaclass__ = abc.ABCMeta @abc.abstractmethod - def __init__(self, adress, vtype, channel): + def __init__(self, address, vtype, channel): """Build the class""" return diff --git a/instruments/testDevice.py b/instruments/testDevice.py index f91180d..3e4cbc2 100644 --- a/instruments/testDevice.py +++ b/instruments/testDevice.py @@ -5,12 +5,12 @@ import numpy, time ALL_VAL_TYPE = ['vtype', 'DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ'] ALL_CHANNELS = ['0', '1'] -address = "123.456.789.123" +ADDRESS = "123.456.789.123" #============================================================================== class testDevice(abstract_instrument): - def __init__(self, channels, vtype, address = address): + def __init__(self, channels, vtype, address): self.address = address self.port = 9999 self.channels = channels