Commit 9058343c5602e7323ae51461c67dbb88c54de3a8

Authored by bmarechal
1 parent d803624996
Exists in master

some minor fixes

Showing 10 changed files with 52 additions and 52 deletions Side-by-side Diff

... ... @@ -10,8 +10,8 @@
10 10 #==============================================================================
11 11  
12 12 class acq_routine():
13   - def __init__(self, instrument, channels, vtypes, adress, path = os.getcwd(), samplingtime = 1, fileduration = 24*3600):
14   - exec('self.instrument = instruments.%s.%s(%s, %s, "%s")'%(instrument, instrument, channels, vtypes, adress))
  13 + def __init__(self, instrument, channels, vtypes, address, path = os.getcwd(), samplingtime = 1, fileduration = 24*3600):
  14 + exec('self.instrument = instruments.%s.%s(%s, %s, "%s")'%(instrument, instrument, channels, vtypes, address))
15 15 self.path = path
16 16 self.samplingtime = samplingtime
17 17 self.fileduration = fileduration
... ... @@ -97,9 +97,9 @@
97 97 self.comboInst = QtGui.QComboBox()
98 98 self.layout.addWidget(self.comboInst, 0, 0)
99 99  
100   - self.adress = QtGui.QLineEdit()
101   - self.adress.setMaximumWidth(120)
102   - self.layout.addWidget(self.adress, 99, 0)
  100 + self.address = QtGui.QLineEdit()
  101 + self.address.setMaximumWidth(120)
  102 + self.layout.addWidget(self.address, 99, 0)
103 103  
104 104 self.startButton = QtGui.QPushButton()
105 105 self.startButton.setText('Start log')
106 106  
107 107  
... ... @@ -137,15 +137,15 @@
137 137 for i in reversed(range(5, self.layout.count())):
138 138 self.layout.itemAt(i).widget().setParent(None)
139 139  
140   - defaultAdress = ''
  140 + defaultAddress = ''
141 141 channelsAviables = []
142 142 vtypesAviables = []
143 143  
144 144 exec('channelsAviables = instruments.%s.ALL_CHANNELS'%self.comboInst.currentText())
145 145 exec('vtypesAviables = instruments.%s.ALL_VAL_TYPE'%self.comboInst.currentText())
146   - exec('defaultAdress = instruments.%s.ADRESS'%self.comboInst.currentText())
  146 + exec('defaultAddress = instruments.%s.ADDRESS'%self.comboInst.currentText())
147 147  
148   - self.adress.setText(defaultAdress)
  148 + self.address.setText(defaultAddress)
149 149  
150 150 self.checkBoxChannels = [None]*len(channelsAviables)
151 151 self.chListVtypes = [None]*len(self.checkBoxChannels)
152 152  
... ... @@ -163,14 +163,14 @@
163 163 self.checkBoxChannels[i].stateChanged.connect(self.infoSignal)
164 164 self.chListVtypes[i].currentItemChanged.connect(self.infoSignal)
165 165  
166   - self.adress.textChanged.connect(self.infoSignal)
  166 + self.address.textChanged.connect(self.infoSignal)
167 167  
168 168 self.infoSignal()
169 169  
170 170 @pyqtSlot()
171 171 def infoSignal(self):
172 172 self.instToLog = self.comboInst.currentText()
173   - self.adressToLog = self.adress.text()
  173 + self.addressToLog = self.address.text()
174 174 self.chToLog = []
175 175 self.vTypeToLog = []
176 176  
177 177  
178 178  
... ... @@ -190,15 +190,15 @@
190 190 else:
191 191 self.startButton.setEnabled(True)
192 192  
193   - self.textDisplay.setText('>> %s@%s - %s - %s'%(self.instToLog, self.adressToLog, self.chToLog, self.vTypeToLog))
  193 + self.textDisplay.setText('>> %s@%s - %s - %s'%(self.instToLog, self.addressToLog, self.chToLog, self.vTypeToLog))
194 194  
195   - self.myLog = acq_routine(self.instToLog, self.chToLog, self.vTypeToLog, self.adressToLog)
  195 + self.myLog = acq_routine(self.instToLog, self.chToLog, self.vTypeToLog, self.addressToLog)
196 196  
197 197 @pyqtSlot()
198 198 def startLog(self):
199 199 self.startButton.setEnabled(False)
200 200 self.stopButton.setEnabled(True)
201   - self.adress.setEnabled(False)
  201 + self.address.setEnabled(False)
202 202 self.comboInst.setEnabled(False)
203 203 for i in self.checkBoxChannels:
204 204 i.setEnabled(False)
... ... @@ -211,7 +211,7 @@
211 211 def stopLog(self):
212 212 self.startButton.setEnabled(True)
213 213 self.stopButton.setEnabled(False)
214   - self.adress.setEnabled(True)
  214 + self.address.setEnabled(True)
215 215 self.comboInst.setEnabled(True)
216 216 for i in range(len(self.checkBoxChannels)):
217 217 if self.checkBoxChannels[i].isChecked():
instruments/AG34461A.py
... ... @@ -6,14 +6,14 @@
6 6 ALL_VAL_TYPE = ['DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ']
7 7 ALL_CHANNELS = ['1']
8 8  
9   -ADRESS = "192.168.0.61"
  9 +ADDRESS = "192.168.0.61"
10 10 CONF_VAL_TYPE = ['CONF:VOLT:DC', 'CONF:VOLT:AC', 'CONF:CURR:DC', 'CONF:CURR:AC', 'CONF:RES', 'CONF:FRES', 'CONF:FREQ']
11 11  
12 12 #==============================================================================
13 13  
14 14 class AG34461A(abstract_instrument):
15   - def __init__(self, channels, vtypes, adress=ADRESS):
16   - self.adress = adress
  15 + def __init__(self, channels, vtypes, address):
  16 + self.address = address
17 17 self.port = 5025
18 18 self.channels = channels
19 19 self.vtypes = vtypes
20 20  
... ... @@ -24,12 +24,12 @@
24 24 return "AG34461A"
25 25  
26 26 def connect(self):
27   - print('Connecting to device @%s:%s...' %(self.adress, self.port))
  27 + print('Connecting to device @%s:%s...' %(self.address, self.port))
28 28 self.sock = socket.socket(socket.AF_INET,
29 29 socket.SOCK_STREAM,
30 30 socket.IPPROTO_TCP)
31 31 self.sock.settimeout(10.0) # Don't hang around forever
32   - self.sock.connect((self.adress, self.port))
  32 + self.sock.connect((self.address, self.port))
33 33 self.send("SYST:BEEP")
34 34 print(' --> Ok')
35 35 print(self.model())
instruments/AG34972A.py
... ... @@ -6,14 +6,14 @@
6 6 ALL_VAL_TYPE = ['DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ']
7 7 ALL_CHANNELS = ['101', '102', '103', '104', '105']
8 8  
9   -ADRESS = "192.168.0.72"
  9 +ADDRESS = "192.168.0.72"
10 10 CONF_VAL_TYPE = ['CONF:VOLT:DC', 'CONF:VOLT:AC', 'CONF:CURR:DC', 'CONF:CURR:AC', 'CONF:RES', 'CONF:FRES', 'CONF:FREQ']
11 11  
12 12 #==============================================================================
13 13  
14 14 class AG34972A(abstract_instrument):
15   - def __init__(self, channels, vtypes, adress):
16   - self.adress = adress
  15 + def __init__(self, channels, vtypes, address):
  16 + self.address = address
17 17 self.port = 5025
18 18 self.channels = channels
19 19 self.vtypes = vtypes
20 20  
... ... @@ -24,12 +24,12 @@
24 24 return "AG34972A"
25 25  
26 26 def connect(self):
27   - print('Connecting to device @%s:%s...' %(self.adress, self.port))
  27 + print('Connecting to device @%s:%s...' %(self.address, self.port))
28 28 self.sock = socket.socket(socket.AF_INET,
29 29 socket.SOCK_STREAM,
30 30 socket.IPPROTO_TCP)
31 31 self.sock.settimeout(2.0) # Don't hang around forever
32   - self.sock.connect((self.adress, self.port))
  32 + self.sock.connect((self.address, self.port))
33 33 self.send("SYST:BEEP")
34 34 print(' --> Ok')
35 35 print(self.model())
instruments/HP53132A.py
... ... @@ -6,14 +6,14 @@
6 6 ALL_VAL_TYPE = ['FREQ'] #, 'PERIOD']
7 7 ALL_CHANNELS = ['1'] #, '2']
8 8  
9   -ADRESS = "192.168.0.52"
  9 +ADDRESS = "192.168.0.52"
10 10 CONF_VAL_TYPE = ['CONF:FREQ'] #, 'CONF:PERIOD']
11 11  
12 12 #==============================================================================
13 13  
14 14 class HP53132A(abstract_instrument):
15   - def __init__(self, channels, vtypes, adress):
16   - self.adress = adress
  15 + def __init__(self, channels, vtypes, address):
  16 + self.address = address
17 17 self.port = 1234
18 18 self.gpib_addr = 12
19 19 self.channels = channels
20 20  
... ... @@ -25,12 +25,12 @@
25 25 return "HP53132A"
26 26  
27 27 def connect(self):
28   - print('Connecting to device @%s:%s...' %(self.adress, self.port))
  28 + print('Connecting to device @%s:%s...' %(self.address, self.port))
29 29 self.sock = socket.socket(socket.AF_INET,
30 30 socket.SOCK_STREAM,
31 31 socket.IPPROTO_TCP)
32 32 self.sock.settimeout(10.0) # Don't hang around forever
33   - self.sock.connect((self.adress, self.port))
  33 + self.sock.connect((self.address, self.port))
34 34 self.init_prologix()
35 35 print(' --> Ok')
36 36 print(self.model())
instruments/LS350.py
... ... @@ -6,14 +6,14 @@
6 6 ALL_VAL_TYPE = ['TEMP', 'RES']
7 7 ALL_CHANNELS = ['a', 'b', 'c', 'd']
8 8  
9   -ADRESS = "192.168.0.12"
  9 +ADDRESS = "192.168.0.12"
10 10 CONF_VAL_TYPE = ['krdg?', 'srdg?']
11 11  
12 12 #==============================================================================
13 13  
14 14 class LS350(abstract_instrument):
15   - def __init__(self, channels, vtypes, adress):
16   - self.adress = adress
  15 + def __init__(self, channels, vtypes, address):
  16 + self.address = address
17 17 self.port = 7777
18 18 self.channels = channels
19 19 self.vtypes = vtypes
20 20  
... ... @@ -24,12 +24,12 @@
24 24 return "LS350"
25 25  
26 26 def connect(self):
27   - print('Connecting to device @%s:%s...' %(self.adress, self.port))
  27 + print('Connecting to device @%s:%s...' %(self.address, self.port))
28 28 self.sock = socket.socket(socket.AF_INET,
29 29 socket.SOCK_STREAM,
30 30 socket.IPPROTO_TCP)
31 31 self.sock.settimeout(10.0) # Don't hang around forever
32   - self.sock.connect((self.adress, self.port))
  32 + self.sock.connect((self.address, self.port))
33 33 print(' --> Ok')
34 34 print(self.model())
35 35 self.configure()
instruments/PM100D.py
... ... @@ -6,14 +6,14 @@
6 6 ALL_VAL_TYPE = ['PWR']
7 7 ALL_CHANNELS = ['1']
8 8  
9   -ADRESS = "/dev/usbtmc0"
  9 +ADDRESS = "/dev/usbtmc0"
10 10 CONF_VAL_TYPE = ['PWR']
11 11  
12 12 #==============================================================================
13 13  
14 14 class PM100D(abstract_instrument):
15   - def __init__(self, channels, vtypes, adress):
16   - self.adress = adress
  15 + def __init__(self, channels, vtypes, address):
  16 + self.address = address
17 17 self.channels = channels
18 18 self.vtypes = vtypes
19 19  
... ... @@ -23,8 +23,8 @@
23 23 return "PM100D"
24 24  
25 25 def connect(self):
26   - print('Connecting to device @%s...' %(self.adress))
27   - self.FILE = os.open(self.adress, os.O_RDWR)
  26 + print('Connecting to device @%s...' %(self.address))
  27 + self.FILE = os.open(self.address, os.O_RDWR)
28 28 print(' --> Ok')
29 29 print(self.model())
30 30 self.configure()
instruments/T7Pro.py
... ... @@ -7,15 +7,15 @@
7 7 ALL_VAL_TYPE = ['RES', 'TEMP PT100 K', 'TEMP PT100 C']
8 8 ALL_CHANNELS = ['1', '2', '3', '4']
9 9  
10   -ADRESS = "192.168.0.25"
  10 +ADDRESS = "192.168.0.25"
11 11 CONF_CHANNELS = [["AIN0", "AIN10"], ["AIN2", "AIN11"], ["AIN4", "AIN12"], ["AIN6", "AIN13"]]
12 12 VISHAY_CHANNELS = [1000., 1000., 1079., 10000.]
13 13  
14 14 #==============================================================================
15 15  
16 16 class T7Pro(abstract_instrument):
17   - def __init__(self, channels, vtypes, adress):
18   - self.adress = adress
  17 + def __init__(self, channels, vtypes, address):
  18 + self.address = address
19 19 self.channels = channels
20 20 self.vtypes = vtypes
21 21  
... ... @@ -23,8 +23,8 @@
23 23 return 'T7Pro'
24 24  
25 25 def connect(self):
26   - print('Connecting to device @%s...' %(self.adress))
27   - self.handle = ljm.openS("T7", "ETHERNET", self.adress)
  26 + print('Connecting to device @%s...' %(self.address))
  27 + self.handle = ljm.openS("T7", "ETHERNET", self.address)
28 28 print(' --> Ok')
29 29 print(self.model())
30 30 self.configure()
instruments/TPG261.py
... ... @@ -5,13 +5,13 @@
5 5  
6 6 ALL_VAL_TYPE = ['PRE']
7 7 ALL_CHANNELS = ['1']
8   -ADRESS = "/dev/ttyS0"
  8 +ADDRESS = "/dev/ttyS0"
9 9  
10 10 #==============================================================================
11 11  
12 12 class TPG261(abstract_instrument):
13   - def __init__(self, channels, vtypes, adress):
14   - self.adress = adress
  13 + def __init__(self, channels, vtypes, address):
  14 + self.address = address
15 15 self.channels = channels
16 16 self.vtypes = vtypes
17 17  
... ... @@ -19,8 +19,8 @@
19 19 return "PfeifferTPG261"
20 20  
21 21 def connect(self):
22   - print('Connecting to device @%s...' %(self.adress))
23   - self.TPG = MaxiGauge(self.adress)
  22 + print('Connecting to device @%s...' %(self.address))
  23 + self.TPG = MaxiGauge(self.address)
24 24 print(' --> Ok')
25 25 print(self.model())
26 26 self.configure()
instruments/abstract_instrument.py
... ... @@ -4,7 +4,7 @@
4 4 __metaclass__ = abc.ABCMeta
5 5  
6 6 @abc.abstractmethod
7   - def __init__(self, adress, vtype, channel):
  7 + def __init__(self, address, vtype, channel):
8 8 """Build the class"""
9 9 return
10 10  
instruments/testDevice.py
... ... @@ -5,12 +5,12 @@
5 5  
6 6 ALL_VAL_TYPE = ['vtype', 'DCV', 'ACV', 'DCI', 'ACI', 'RES2W', 'RES4W', 'FREQ']
7 7 ALL_CHANNELS = ['0', '1']
8   -address = "123.456.789.123"
  8 +ADDRESS = "123.456.789.123"
9 9  
10 10 #==============================================================================
11 11  
12 12 class testDevice(abstract_instrument):
13   - def __init__(self, channels, vtype, address = address):
  13 + def __init__(self, channels, vtype, address):
14 14 self.address = address
15 15 self.port = 9999
16 16 self.channels = channels