@@ -1,1194 +1,1209 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on September , 2012 |
|
2 | Created on September , 2012 | |
3 | @author: |
|
3 | @author: | |
4 | ''' |
|
4 | ''' | |
5 | from xml.etree.ElementTree import Element, SubElement |
|
5 | from xml.etree.ElementTree import Element, SubElement | |
6 | from xml.etree import ElementTree as ET |
|
6 | from xml.etree import ElementTree as ET | |
7 | from xml.dom import minidom |
|
7 | from xml.dom import minidom | |
8 |
|
8 | |||
9 | #import datetime |
|
9 | #import datetime | |
10 | from model import * |
|
10 | from model import * | |
11 |
|
11 | |||
12 | try: |
|
12 | try: | |
13 | from gevent import sleep |
|
13 | from gevent import sleep | |
14 | except: |
|
14 | except: | |
15 | from time import sleep |
|
15 | from time import sleep | |
16 |
|
16 | |||
17 | import ast |
|
17 | import ast | |
18 |
|
18 | |||
19 | def prettify(elem): |
|
19 | def prettify(elem): | |
20 | """Return a pretty-printed XML string for the Element. |
|
20 | """Return a pretty-printed XML string for the Element. | |
21 | """ |
|
21 | """ | |
22 | rough_string = ET.tostring(elem, 'utf-8') |
|
22 | rough_string = ET.tostring(elem, 'utf-8') | |
23 | reparsed = minidom.parseString(rough_string) |
|
23 | reparsed = minidom.parseString(rough_string) | |
24 | return reparsed.toprettyxml(indent=" ") |
|
24 | return reparsed.toprettyxml(indent=" ") | |
25 |
|
25 | |||
26 | class ParameterConf(): |
|
26 | class ParameterConf(): | |
27 |
|
27 | |||
28 | id = None |
|
28 | id = None | |
29 | name = None |
|
29 | name = None | |
30 | value = None |
|
30 | value = None | |
31 | format = None |
|
31 | format = None | |
32 |
|
32 | |||
33 | __formated_value = None |
|
33 | __formated_value = None | |
34 |
|
34 | |||
35 | ELEMENTNAME = 'Parameter' |
|
35 | ELEMENTNAME = 'Parameter' | |
36 |
|
36 | |||
37 | def __init__(self): |
|
37 | def __init__(self): | |
38 |
|
38 | |||
39 | self.format = 'str' |
|
39 | self.format = 'str' | |
40 |
|
40 | |||
41 | def getElementName(self): |
|
41 | def getElementName(self): | |
42 |
|
42 | |||
43 | return self.ELEMENTNAME |
|
43 | return self.ELEMENTNAME | |
44 |
|
44 | |||
45 | def getValue(self): |
|
45 | def getValue(self): | |
46 |
|
46 | |||
47 | value = self.value |
|
47 | value = self.value | |
48 | format = self.format |
|
48 | format = self.format | |
49 |
|
49 | |||
50 | if self.__formated_value != None: |
|
50 | if self.__formated_value != None: | |
51 |
|
51 | |||
52 | return self.__formated_value |
|
52 | return self.__formated_value | |
53 |
|
53 | |||
54 | if format == 'str': |
|
54 | if format == 'str': | |
55 | self.__formated_value = str(value) |
|
55 | self.__formated_value = str(value) | |
56 | return self.__formated_value |
|
56 | return self.__formated_value | |
57 |
|
57 | |||
58 | if value == '': |
|
58 | if value == '': | |
59 | raise ValueError, "%s: This parameter value is empty" %self.name |
|
59 | raise ValueError, "%s: This parameter value is empty" %self.name | |
60 |
|
60 | |||
61 | if format == 'bool': |
|
61 | if format == 'bool': | |
62 | value = int(value) |
|
62 | value = int(value) | |
63 |
|
63 | |||
64 | if format == 'list': |
|
64 | if format == 'list': | |
65 | strList = value.split(',') |
|
65 | strList = value.split(',') | |
66 |
|
66 | |||
67 | self.__formated_value = strList |
|
67 | self.__formated_value = strList | |
68 |
|
68 | |||
69 | return self.__formated_value |
|
69 | return self.__formated_value | |
70 |
|
70 | |||
71 | if format == 'intlist': |
|
71 | if format == 'intlist': | |
72 | """ |
|
72 | """ | |
73 | Example: |
|
73 | Example: | |
74 | value = (0,1,2) |
|
74 | value = (0,1,2) | |
75 | """ |
|
75 | """ | |
76 | value = value.replace('(', '') |
|
76 | value = value.replace('(', '') | |
77 | value = value.replace(')', '') |
|
77 | value = value.replace(')', '') | |
78 |
|
78 | |||
79 | value = value.replace('[', '') |
|
79 | value = value.replace('[', '') | |
80 | value = value.replace(']', '') |
|
80 | value = value.replace(']', '') | |
81 |
|
81 | |||
82 | strList = value.split(',') |
|
82 | strList = value.split(',') | |
83 | intList = [int(x) for x in strList] |
|
83 | intList = [int(x) for x in strList] | |
84 |
|
84 | |||
85 | self.__formated_value = intList |
|
85 | self.__formated_value = intList | |
86 |
|
86 | |||
87 | return self.__formated_value |
|
87 | return self.__formated_value | |
88 |
|
88 | |||
89 | if format == 'floatlist': |
|
89 | if format == 'floatlist': | |
90 | """ |
|
90 | """ | |
91 | Example: |
|
91 | Example: | |
92 | value = (0.5, 1.4, 2.7) |
|
92 | value = (0.5, 1.4, 2.7) | |
93 | """ |
|
93 | """ | |
94 |
|
94 | |||
95 | value = value.replace('(', '') |
|
95 | value = value.replace('(', '') | |
96 | value = value.replace(')', '') |
|
96 | value = value.replace(')', '') | |
97 |
|
97 | |||
98 | value = value.replace('[', '') |
|
98 | value = value.replace('[', '') | |
99 | value = value.replace(']', '') |
|
99 | value = value.replace(']', '') | |
100 |
|
100 | |||
101 | strList = value.split(',') |
|
101 | strList = value.split(',') | |
102 | floatList = [float(x) for x in strList] |
|
102 | floatList = [float(x) for x in strList] | |
103 |
|
103 | |||
104 | self.__formated_value = floatList |
|
104 | self.__formated_value = floatList | |
105 |
|
105 | |||
106 | return self.__formated_value |
|
106 | return self.__formated_value | |
107 |
|
107 | |||
108 | if format == 'date': |
|
108 | if format == 'date': | |
109 | strList = value.split('/') |
|
109 | strList = value.split('/') | |
110 | intList = [int(x) for x in strList] |
|
110 | intList = [int(x) for x in strList] | |
111 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
111 | date = datetime.date(intList[0], intList[1], intList[2]) | |
112 |
|
112 | |||
113 | self.__formated_value = date |
|
113 | self.__formated_value = date | |
114 |
|
114 | |||
115 | return self.__formated_value |
|
115 | return self.__formated_value | |
116 |
|
116 | |||
117 | if format == 'time': |
|
117 | if format == 'time': | |
118 | strList = value.split(':') |
|
118 | strList = value.split(':') | |
119 | intList = [int(x) for x in strList] |
|
119 | intList = [int(x) for x in strList] | |
120 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
120 | time = datetime.time(intList[0], intList[1], intList[2]) | |
121 |
|
121 | |||
122 | self.__formated_value = time |
|
122 | self.__formated_value = time | |
123 |
|
123 | |||
124 | return self.__formated_value |
|
124 | return self.__formated_value | |
125 |
|
125 | |||
126 | if format == 'pairslist': |
|
126 | if format == 'pairslist': | |
127 | """ |
|
127 | """ | |
128 | Example: |
|
128 | Example: | |
129 | value = (0,1),(1,2) |
|
129 | value = (0,1),(1,2) | |
130 | """ |
|
130 | """ | |
131 |
|
131 | |||
132 | value = value.replace('(', '') |
|
132 | value = value.replace('(', '') | |
133 | value = value.replace(')', '') |
|
133 | value = value.replace(')', '') | |
134 |
|
134 | |||
135 | value = value.replace('[', '') |
|
135 | value = value.replace('[', '') | |
136 | value = value.replace(']', '') |
|
136 | value = value.replace(']', '') | |
137 |
|
137 | |||
138 | strList = value.split(',') |
|
138 | strList = value.split(',') | |
139 | intList = [int(item) for item in strList] |
|
139 | intList = [int(item) for item in strList] | |
140 | pairList = [] |
|
140 | pairList = [] | |
141 | for i in range(len(intList)/2): |
|
141 | for i in range(len(intList)/2): | |
142 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
142 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
143 |
|
143 | |||
144 | self.__formated_value = pairList |
|
144 | self.__formated_value = pairList | |
145 |
|
145 | |||
146 | return self.__formated_value |
|
146 | return self.__formated_value | |
147 |
|
147 | |||
148 | if format == 'multilist': |
|
148 | if format == 'multilist': | |
149 | """ |
|
149 | """ | |
150 | Example: |
|
150 | Example: | |
151 | value = (0,1,2),(3,4,5) |
|
151 | value = (0,1,2),(3,4,5) | |
152 | """ |
|
152 | """ | |
153 | multiList = ast.literal_eval(value) |
|
153 | multiList = ast.literal_eval(value) | |
154 |
|
154 | |||
155 | if type(multiList[0]) == int: |
|
155 | if type(multiList[0]) == int: | |
156 | multiList = ast.literal_eval("(" + value + ")") |
|
156 | multiList = ast.literal_eval("(" + value + ")") | |
157 |
|
157 | |||
158 | self.__formated_value = multiList |
|
158 | self.__formated_value = multiList | |
159 |
|
159 | |||
160 | return self.__formated_value |
|
160 | return self.__formated_value | |
161 |
|
161 | |||
162 | format_func = eval(format) |
|
162 | format_func = eval(format) | |
163 |
|
163 | |||
164 | self.__formated_value = format_func(value) |
|
164 | self.__formated_value = format_func(value) | |
165 |
|
165 | |||
166 | return self.__formated_value |
|
166 | return self.__formated_value | |
167 |
|
167 | |||
168 | def updateId(self, new_id): |
|
168 | def updateId(self, new_id): | |
169 |
|
169 | |||
170 | self.id = str(new_id) |
|
170 | self.id = str(new_id) | |
171 |
|
171 | |||
172 | def setup(self, id, name, value, format='str'): |
|
172 | def setup(self, id, name, value, format='str'): | |
173 |
|
173 | |||
174 | self.id = str(id) |
|
174 | self.id = str(id) | |
175 | self.name = name |
|
175 | self.name = name | |
176 | self.value = str(value) |
|
176 | self.value = str(value) | |
177 | self.format = str.lower(format) |
|
177 | self.format = str.lower(format) | |
178 |
|
178 | |||
179 | def update(self, name, value, format='str'): |
|
179 | def update(self, name, value, format='str'): | |
180 |
|
180 | |||
181 | self.name = name |
|
181 | self.name = name | |
182 | self.value = str(value) |
|
182 | self.value = str(value) | |
183 | self.format = format |
|
183 | self.format = format | |
184 |
|
184 | |||
185 | def makeXml(self, opElement): |
|
185 | def makeXml(self, opElement): | |
186 |
|
186 | |||
187 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
187 | parmElement = SubElement(opElement, self.ELEMENTNAME) | |
188 | parmElement.set('id', str(self.id)) |
|
188 | parmElement.set('id', str(self.id)) | |
189 | parmElement.set('name', self.name) |
|
189 | parmElement.set('name', self.name) | |
190 | parmElement.set('value', self.value) |
|
190 | parmElement.set('value', self.value) | |
191 | parmElement.set('format', self.format) |
|
191 | parmElement.set('format', self.format) | |
192 |
|
192 | |||
193 | def readXml(self, parmElement): |
|
193 | def readXml(self, parmElement): | |
194 |
|
194 | |||
195 | self.id = parmElement.get('id') |
|
195 | self.id = parmElement.get('id') | |
196 | self.name = parmElement.get('name') |
|
196 | self.name = parmElement.get('name') | |
197 | self.value = parmElement.get('value') |
|
197 | self.value = parmElement.get('value') | |
198 | self.format = str.lower(parmElement.get('format')) |
|
198 | self.format = str.lower(parmElement.get('format')) | |
199 |
|
199 | |||
200 | #Compatible with old signal chain version |
|
200 | #Compatible with old signal chain version | |
201 | if self.format == 'int' and self.name == 'idfigure': |
|
201 | if self.format == 'int' and self.name == 'idfigure': | |
202 | self.name = 'id' |
|
202 | self.name = 'id' | |
203 |
|
203 | |||
204 | def printattr(self): |
|
204 | def printattr(self): | |
205 |
|
205 | |||
206 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
206 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) | |
207 |
|
207 | |||
208 | class OperationConf(): |
|
208 | class OperationConf(): | |
209 |
|
209 | |||
210 | id = None |
|
210 | id = None | |
211 | name = None |
|
211 | name = None | |
212 | priority = None |
|
212 | priority = None | |
213 | type = None |
|
213 | type = None | |
214 |
|
214 | |||
215 | parmConfObjList = [] |
|
215 | parmConfObjList = [] | |
216 |
|
216 | |||
217 | ELEMENTNAME = 'Operation' |
|
217 | ELEMENTNAME = 'Operation' | |
218 |
|
218 | |||
219 | def __init__(self): |
|
219 | def __init__(self): | |
220 |
|
220 | |||
221 | self.id = '0' |
|
221 | self.id = '0' | |
222 | self.name = None |
|
222 | self.name = None | |
223 | self.priority = None |
|
223 | self.priority = None | |
224 | self.type = 'self' |
|
224 | self.type = 'self' | |
225 |
|
225 | |||
226 |
|
226 | |||
227 | def __getNewId(self): |
|
227 | def __getNewId(self): | |
228 |
|
228 | |||
229 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
229 | return int(self.id)*10 + len(self.parmConfObjList) + 1 | |
230 |
|
230 | |||
231 | def updateId(self, new_id): |
|
231 | def updateId(self, new_id): | |
232 |
|
232 | |||
233 | self.id = str(new_id) |
|
233 | self.id = str(new_id) | |
234 |
|
234 | |||
235 | n = 1 |
|
235 | n = 1 | |
236 | for parmObj in self.parmConfObjList: |
|
236 | for parmObj in self.parmConfObjList: | |
237 |
|
237 | |||
238 | idParm = str(int(new_id)*10 + n) |
|
238 | idParm = str(int(new_id)*10 + n) | |
239 | parmObj.updateId(idParm) |
|
239 | parmObj.updateId(idParm) | |
240 |
|
240 | |||
241 | n += 1 |
|
241 | n += 1 | |
242 |
|
242 | |||
243 | def getElementName(self): |
|
243 | def getElementName(self): | |
244 |
|
244 | |||
245 | return self.ELEMENTNAME |
|
245 | return self.ELEMENTNAME | |
246 |
|
246 | |||
247 | def getParameterObjList(self): |
|
247 | def getParameterObjList(self): | |
248 |
|
248 | |||
249 | return self.parmConfObjList |
|
249 | return self.parmConfObjList | |
250 |
|
250 | |||
251 | def getParameterObj(self, parameterName): |
|
251 | def getParameterObj(self, parameterName): | |
252 |
|
252 | |||
253 | for parmConfObj in self.parmConfObjList: |
|
253 | for parmConfObj in self.parmConfObjList: | |
254 |
|
254 | |||
255 | if parmConfObj.name != parameterName: |
|
255 | if parmConfObj.name != parameterName: | |
256 | continue |
|
256 | continue | |
257 |
|
257 | |||
258 | return parmConfObj |
|
258 | return parmConfObj | |
259 |
|
259 | |||
260 | return None |
|
260 | return None | |
261 |
|
261 | |||
262 | def getParameterObjfromValue(self,parameterValue): |
|
262 | def getParameterObjfromValue(self, parameterValue): | |
|
263 | ||||
263 | for parmConfObj in self.parmConfObjList: |
|
264 | for parmConfObj in self.parmConfObjList: | |
264 |
|
265 | |||
265 | if parmConfObj.getValue() != parameterValue: |
|
266 | if parmConfObj.getValue() != parameterValue: | |
266 | continue |
|
267 | continue | |
267 |
|
268 | |||
268 | return parmConfObj.getValue() |
|
269 | return parmConfObj.getValue() | |
269 |
|
270 | |||
270 | return None |
|
271 | return None | |
271 |
|
272 | |||
272 | def getParameterValue(self, parameterName): |
|
273 | def getParameterValue(self, parameterName): | |
273 |
|
274 | |||
274 | parameterObj = self.getParameterObj(parameterName) |
|
275 | parameterObj = self.getParameterObj(parameterName) | |
|
276 | ||||
|
277 | if not parameterObj: | |||
|
278 | return None | |||
|
279 | ||||
275 | value = parameterObj.getValue() |
|
280 | value = parameterObj.getValue() | |
276 |
|
281 | |||
277 | return value |
|
282 | return value | |
278 |
|
283 | |||
279 | def setup(self, id, name, priority, type): |
|
284 | def setup(self, id, name, priority, type): | |
280 |
|
285 | |||
281 | self.id = str(id) |
|
286 | self.id = str(id) | |
282 | self.name = name |
|
287 | self.name = name | |
283 | self.type = type |
|
288 | self.type = type | |
284 | self.priority = priority |
|
289 | self.priority = priority | |
285 |
|
290 | |||
286 | self.parmConfObjList = [] |
|
291 | self.parmConfObjList = [] | |
287 |
|
292 | |||
288 | def removeParameters(self): |
|
293 | def removeParameters(self): | |
289 |
|
294 | |||
290 | for obj in self.parmConfObjList: |
|
295 | for obj in self.parmConfObjList: | |
291 | del obj |
|
296 | del obj | |
292 |
|
297 | |||
293 | self.parmConfObjList = [] |
|
298 | self.parmConfObjList = [] | |
294 |
|
299 | |||
295 | def addParameter(self, name, value, format='str'): |
|
300 | def addParameter(self, name, value, format='str'): | |
296 |
|
301 | |||
297 | id = self.__getNewId() |
|
302 | id = self.__getNewId() | |
298 |
|
303 | |||
299 | parmConfObj = ParameterConf() |
|
304 | parmConfObj = ParameterConf() | |
300 | parmConfObj.setup(id, name, value, format) |
|
305 | parmConfObj.setup(id, name, value, format) | |
301 |
|
306 | |||
302 | self.parmConfObjList.append(parmConfObj) |
|
307 | self.parmConfObjList.append(parmConfObj) | |
303 |
|
308 | |||
304 | return parmConfObj |
|
309 | return parmConfObj | |
305 |
|
310 | |||
306 | def changeParameter(self, name, value, format='str'): |
|
311 | def changeParameter(self, name, value, format='str'): | |
307 |
|
312 | |||
308 | parmConfObj = self.getParameterObj(name) |
|
313 | parmConfObj = self.getParameterObj(name) | |
309 | parmConfObj.update(name, value, format) |
|
314 | parmConfObj.update(name, value, format) | |
310 |
|
315 | |||
311 | return parmConfObj |
|
316 | return parmConfObj | |
312 |
|
317 | |||
313 | def makeXml(self, upElement): |
|
318 | def makeXml(self, upElement): | |
314 |
|
319 | |||
315 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
320 | opElement = SubElement(upElement, self.ELEMENTNAME) | |
316 | opElement.set('id', str(self.id)) |
|
321 | opElement.set('id', str(self.id)) | |
317 | opElement.set('name', self.name) |
|
322 | opElement.set('name', self.name) | |
318 | opElement.set('type', self.type) |
|
323 | opElement.set('type', self.type) | |
319 | opElement.set('priority', str(self.priority)) |
|
324 | opElement.set('priority', str(self.priority)) | |
320 |
|
325 | |||
321 | for parmConfObj in self.parmConfObjList: |
|
326 | for parmConfObj in self.parmConfObjList: | |
322 | parmConfObj.makeXml(opElement) |
|
327 | parmConfObj.makeXml(opElement) | |
323 |
|
328 | |||
324 | def readXml(self, opElement): |
|
329 | def readXml(self, opElement): | |
325 |
|
330 | |||
326 | self.id = opElement.get('id') |
|
331 | self.id = opElement.get('id') | |
327 | self.name = opElement.get('name') |
|
332 | self.name = opElement.get('name') | |
328 | self.type = opElement.get('type') |
|
333 | self.type = opElement.get('type') | |
329 | self.priority = opElement.get('priority') |
|
334 | self.priority = opElement.get('priority') | |
330 |
|
335 | |||
331 | #Compatible with old signal chain version |
|
336 | #Compatible with old signal chain version | |
332 | #Use of 'run' method instead 'init' |
|
337 | #Use of 'run' method instead 'init' | |
333 | if self.type == 'self' and self.name == 'init': |
|
338 | if self.type == 'self' and self.name == 'init': | |
334 | self.name = 'run' |
|
339 | self.name = 'run' | |
335 |
|
340 | |||
336 | self.parmConfObjList = [] |
|
341 | self.parmConfObjList = [] | |
337 |
|
342 | |||
338 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
343 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) | |
339 |
|
344 | |||
340 | for parmElement in parmElementList: |
|
345 | for parmElement in parmElementList: | |
341 | parmConfObj = ParameterConf() |
|
346 | parmConfObj = ParameterConf() | |
342 | parmConfObj.readXml(parmElement) |
|
347 | parmConfObj.readXml(parmElement) | |
343 |
|
348 | |||
344 | #Compatible with old signal chain version |
|
349 | #Compatible with old signal chain version | |
345 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
350 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER | |
346 | if self.type != 'self' and self.name == 'Plot': |
|
351 | if self.type != 'self' and self.name == 'Plot': | |
347 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
352 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': | |
348 | self.name = parmConfObj.value |
|
353 | self.name = parmConfObj.value | |
349 | continue |
|
354 | continue | |
350 |
|
355 | |||
351 | self.parmConfObjList.append(parmConfObj) |
|
356 | self.parmConfObjList.append(parmConfObj) | |
352 |
|
357 | |||
353 | def printattr(self): |
|
358 | def printattr(self): | |
354 |
|
359 | |||
355 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
360 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, | |
356 | self.id, |
|
361 | self.id, | |
357 | self.name, |
|
362 | self.name, | |
358 | self.type, |
|
363 | self.type, | |
359 | self.priority) |
|
364 | self.priority) | |
360 |
|
365 | |||
361 | for parmConfObj in self.parmConfObjList: |
|
366 | for parmConfObj in self.parmConfObjList: | |
362 | parmConfObj.printattr() |
|
367 | parmConfObj.printattr() | |
363 |
|
368 | |||
364 | def createObject(self): |
|
369 | def createObject(self): | |
365 |
|
370 | |||
366 | if self.type == 'self': |
|
371 | if self.type == 'self': | |
367 | raise ValueError, "This operation type cannot be created" |
|
372 | raise ValueError, "This operation type cannot be created" | |
368 |
|
373 | |||
369 | if self.type == 'external' or self.type == 'other': |
|
374 | if self.type == 'external' or self.type == 'other': | |
370 | className = eval(self.name) |
|
375 | className = eval(self.name) | |
371 | opObj = className() |
|
376 | opObj = className() | |
372 |
|
377 | |||
373 | return opObj |
|
378 | return opObj | |
374 |
|
379 | |||
375 | class ProcUnitConf(): |
|
380 | class ProcUnitConf(): | |
376 |
|
381 | |||
377 | id = None |
|
382 | id = None | |
378 | name = None |
|
383 | name = None | |
379 | datatype = None |
|
384 | datatype = None | |
380 | inputId = None |
|
385 | inputId = None | |
381 | parentId = None |
|
386 | parentId = None | |
382 |
|
387 | |||
383 | opConfObjList = [] |
|
388 | opConfObjList = [] | |
384 |
|
389 | |||
385 | procUnitObj = None |
|
390 | procUnitObj = None | |
386 | opObjList = [] |
|
391 | opObjList = [] | |
387 |
|
392 | |||
388 | ELEMENTNAME = 'ProcUnit' |
|
393 | ELEMENTNAME = 'ProcUnit' | |
389 |
|
394 | |||
390 | def __init__(self): |
|
395 | def __init__(self): | |
391 |
|
396 | |||
392 | self.id = None |
|
397 | self.id = None | |
393 | self.datatype = None |
|
398 | self.datatype = None | |
394 | self.name = None |
|
399 | self.name = None | |
395 | self.inputId = None |
|
400 | self.inputId = None | |
396 |
|
401 | |||
397 | self.opConfObjList = [] |
|
402 | self.opConfObjList = [] | |
398 |
|
403 | |||
399 | self.procUnitObj = None |
|
404 | self.procUnitObj = None | |
400 | self.opObjDict = {} |
|
405 | self.opObjDict = {} | |
401 |
|
406 | |||
402 | def __getPriority(self): |
|
407 | def __getPriority(self): | |
403 |
|
408 | |||
404 | return len(self.opConfObjList)+1 |
|
409 | return len(self.opConfObjList)+1 | |
405 |
|
410 | |||
406 | def __getNewId(self): |
|
411 | def __getNewId(self): | |
407 |
|
412 | |||
408 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
413 | return int(self.id)*10 + len(self.opConfObjList) + 1 | |
409 |
|
414 | |||
410 | def getElementName(self): |
|
415 | def getElementName(self): | |
411 |
|
416 | |||
412 | return self.ELEMENTNAME |
|
417 | return self.ELEMENTNAME | |
413 |
|
418 | |||
414 | def getId(self): |
|
419 | def getId(self): | |
415 |
|
420 | |||
416 | return self.id |
|
421 | return self.id | |
417 |
|
422 | |||
418 | def updateId(self, new_id, parentId=parentId): |
|
423 | def updateId(self, new_id, parentId=parentId): | |
419 |
|
424 | |||
420 |
|
425 | |||
421 | new_id = int(parentId)*10 + (int(self.id) % 10) |
|
426 | new_id = int(parentId)*10 + (int(self.id) % 10) | |
422 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) |
|
427 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) | |
423 |
|
428 | |||
424 | #If this proc unit has not inputs |
|
429 | #If this proc unit has not inputs | |
425 | if self.inputId == '0': |
|
430 | if self.inputId == '0': | |
426 | new_inputId = 0 |
|
431 | new_inputId = 0 | |
427 |
|
432 | |||
428 | n = 1 |
|
433 | n = 1 | |
429 | for opConfObj in self.opConfObjList: |
|
434 | for opConfObj in self.opConfObjList: | |
430 |
|
435 | |||
431 | idOp = str(int(new_id)*10 + n) |
|
436 | idOp = str(int(new_id)*10 + n) | |
432 | opConfObj.updateId(idOp) |
|
437 | opConfObj.updateId(idOp) | |
433 |
|
438 | |||
434 | n += 1 |
|
439 | n += 1 | |
435 |
|
440 | |||
436 | self.parentId = str(parentId) |
|
441 | self.parentId = str(parentId) | |
437 | self.id = str(new_id) |
|
442 | self.id = str(new_id) | |
438 | self.inputId = str(new_inputId) |
|
443 | self.inputId = str(new_inputId) | |
439 |
|
444 | |||
440 |
|
445 | |||
441 | def getInputId(self): |
|
446 | def getInputId(self): | |
442 |
|
447 | |||
443 | return self.inputId |
|
448 | return self.inputId | |
444 |
|
449 | |||
445 | def getOperationObjList(self): |
|
450 | def getOperationObjList(self): | |
446 |
|
451 | |||
447 | return self.opConfObjList |
|
452 | return self.opConfObjList | |
448 |
|
453 | |||
449 | def getOperationObj(self, name=None): |
|
454 | def getOperationObj(self, name=None): | |
450 |
|
455 | |||
451 | for opConfObj in self.opConfObjList: |
|
456 | for opConfObj in self.opConfObjList: | |
452 |
|
457 | |||
453 | if opConfObj.name != name: |
|
458 | if opConfObj.name != name: | |
454 | continue |
|
459 | continue | |
455 |
|
460 | |||
456 | return opConfObj |
|
461 | return opConfObj | |
457 |
|
462 | |||
458 | return None |
|
463 | return None | |
459 |
|
464 | |||
460 | def getOpObjfromParamValue(self,value=None): |
|
465 | def getOpObjfromParamValue(self, value=None): | |
461 |
|
466 | |||
462 | for opConfObj in self.opConfObjList: |
|
467 | for opConfObj in self.opConfObjList: | |
463 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
468 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: | |
464 | continue |
|
469 | continue | |
465 | return opConfObj |
|
470 | return opConfObj | |
466 | return None |
|
471 | return None | |
467 |
|
472 | |||
468 | def getProcUnitObj(self): |
|
473 | def getProcUnitObj(self): | |
469 |
|
474 | |||
470 | return self.procUnitObj |
|
475 | return self.procUnitObj | |
471 |
|
476 | |||
472 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
477 | def setup(self, id, name, datatype, inputId, parentId=None): | |
473 |
|
478 | |||
474 | #Compatible with old signal chain version |
|
479 | #Compatible with old signal chain version | |
475 | if datatype==None and name==None: |
|
480 | if datatype==None and name==None: | |
476 | raise ValueError, "datatype or name should be defined" |
|
481 | raise ValueError, "datatype or name should be defined" | |
477 |
|
482 | |||
478 | if name==None: |
|
483 | if name==None: | |
479 | if 'Proc' in datatype: |
|
484 | if 'Proc' in datatype: | |
480 | name = datatype |
|
485 | name = datatype | |
481 | else: |
|
486 | else: | |
482 | name = '%sProc' %(datatype) |
|
487 | name = '%sProc' %(datatype) | |
483 |
|
488 | |||
484 | if datatype==None: |
|
489 | if datatype==None: | |
485 | datatype = name.replace('Proc','') |
|
490 | datatype = name.replace('Proc','') | |
486 |
|
491 | |||
487 | self.id = str(id) |
|
492 | self.id = str(id) | |
488 | self.name = name |
|
493 | self.name = name | |
489 | self.datatype = datatype |
|
494 | self.datatype = datatype | |
490 | self.inputId = inputId |
|
495 | self.inputId = inputId | |
491 | self.parentId = parentId |
|
496 | self.parentId = parentId | |
492 |
|
497 | |||
493 | self.opConfObjList = [] |
|
498 | self.opConfObjList = [] | |
494 |
|
499 | |||
495 | self.addOperation(name='run', optype='self') |
|
500 | self.addOperation(name='run', optype='self') | |
496 |
|
501 | |||
497 | def removeOperations(self): |
|
502 | def removeOperations(self): | |
498 |
|
503 | |||
499 | for obj in self.opConfObjList: |
|
504 | for obj in self.opConfObjList: | |
500 | del obj |
|
505 | del obj | |
501 |
|
506 | |||
502 | self.opConfObjList = [] |
|
507 | self.opConfObjList = [] | |
503 | self.addOperation(name='run') |
|
508 | self.addOperation(name='run') | |
504 |
|
509 | |||
505 | def addParameter(self, **kwargs): |
|
510 | def addParameter(self, **kwargs): | |
506 | ''' |
|
511 | ''' | |
507 | Add parameters to "run" operation |
|
512 | Add parameters to "run" operation | |
508 | ''' |
|
513 | ''' | |
509 | opObj = self.opConfObjList[0] |
|
514 | opObj = self.opConfObjList[0] | |
510 |
|
515 | |||
511 | opObj.addParameter(**kwargs) |
|
516 | opObj.addParameter(**kwargs) | |
512 |
|
517 | |||
513 | return opObj |
|
518 | return opObj | |
514 |
|
519 | |||
515 | def addOperation(self, name, optype='self'): |
|
520 | def addOperation(self, name, optype='self'): | |
516 |
|
521 | |||
517 | id = self.__getNewId() |
|
522 | id = self.__getNewId() | |
518 | priority = self.__getPriority() |
|
523 | priority = self.__getPriority() | |
519 |
|
524 | |||
520 | opConfObj = OperationConf() |
|
525 | opConfObj = OperationConf() | |
521 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
526 | opConfObj.setup(id, name=name, priority=priority, type=optype) | |
522 |
|
527 | |||
523 | self.opConfObjList.append(opConfObj) |
|
528 | self.opConfObjList.append(opConfObj) | |
524 |
|
529 | |||
525 | return opConfObj |
|
530 | return opConfObj | |
526 |
|
531 | |||
527 | def makeXml(self, procUnitElement): |
|
532 | def makeXml(self, procUnitElement): | |
528 |
|
533 | |||
529 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
534 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) | |
530 | upElement.set('id', str(self.id)) |
|
535 | upElement.set('id', str(self.id)) | |
531 | upElement.set('name', self.name) |
|
536 | upElement.set('name', self.name) | |
532 | upElement.set('datatype', self.datatype) |
|
537 | upElement.set('datatype', self.datatype) | |
533 | upElement.set('inputId', str(self.inputId)) |
|
538 | upElement.set('inputId', str(self.inputId)) | |
534 |
|
539 | |||
535 | for opConfObj in self.opConfObjList: |
|
540 | for opConfObj in self.opConfObjList: | |
536 | opConfObj.makeXml(upElement) |
|
541 | opConfObj.makeXml(upElement) | |
537 |
|
542 | |||
538 | def readXml(self, upElement): |
|
543 | def readXml(self, upElement): | |
539 |
|
544 | |||
540 | self.id = upElement.get('id') |
|
545 | self.id = upElement.get('id') | |
541 | self.name = upElement.get('name') |
|
546 | self.name = upElement.get('name') | |
542 | self.datatype = upElement.get('datatype') |
|
547 | self.datatype = upElement.get('datatype') | |
543 | self.inputId = upElement.get('inputId') |
|
548 | self.inputId = upElement.get('inputId') | |
544 |
|
549 | |||
545 | if self.ELEMENTNAME == "ReadUnit": |
|
550 | if self.ELEMENTNAME == "ReadUnit": | |
546 | self.datatype = self.datatype.replace("Reader", "") |
|
551 | self.datatype = self.datatype.replace("Reader", "") | |
547 |
|
552 | |||
548 | if self.ELEMENTNAME == "ProcUnit": |
|
553 | if self.ELEMENTNAME == "ProcUnit": | |
549 | self.datatype = self.datatype.replace("Proc", "") |
|
554 | self.datatype = self.datatype.replace("Proc", "") | |
550 |
|
555 | |||
551 | if self.inputId == 'None': |
|
556 | if self.inputId == 'None': | |
552 | self.inputId = '0' |
|
557 | self.inputId = '0' | |
553 |
|
558 | |||
554 | self.opConfObjList = [] |
|
559 | self.opConfObjList = [] | |
555 |
|
560 | |||
556 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
561 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
557 |
|
562 | |||
558 | for opElement in opElementList: |
|
563 | for opElement in opElementList: | |
559 | opConfObj = OperationConf() |
|
564 | opConfObj = OperationConf() | |
560 | opConfObj.readXml(opElement) |
|
565 | opConfObj.readXml(opElement) | |
561 | self.opConfObjList.append(opConfObj) |
|
566 | self.opConfObjList.append(opConfObj) | |
562 |
|
567 | |||
563 | def printattr(self): |
|
568 | def printattr(self): | |
564 |
|
569 | |||
565 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
570 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, | |
566 | self.id, |
|
571 | self.id, | |
567 | self.name, |
|
572 | self.name, | |
568 | self.datatype, |
|
573 | self.datatype, | |
569 | self.inputId) |
|
574 | self.inputId) | |
570 |
|
575 | |||
571 | for opConfObj in self.opConfObjList: |
|
576 | for opConfObj in self.opConfObjList: | |
572 | opConfObj.printattr() |
|
577 | opConfObj.printattr() | |
573 |
|
578 | |||
574 | def createObjects(self): |
|
579 | def createObjects(self): | |
575 |
|
580 | |||
576 | className = eval(self.name) |
|
581 | className = eval(self.name) | |
577 | procUnitObj = className() |
|
582 | procUnitObj = className() | |
578 |
|
583 | |||
579 | for opConfObj in self.opConfObjList: |
|
584 | for opConfObj in self.opConfObjList: | |
580 |
|
585 | |||
581 | if opConfObj.type == 'self': |
|
586 | if opConfObj.type == 'self': | |
582 | continue |
|
587 | continue | |
583 |
|
588 | |||
584 | opObj = opConfObj.createObject() |
|
589 | opObj = opConfObj.createObject() | |
585 |
|
590 | |||
586 | self.opObjDict[opConfObj.id] = opObj |
|
591 | self.opObjDict[opConfObj.id] = opObj | |
587 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
592 | procUnitObj.addOperation(opObj, opConfObj.id) | |
588 |
|
593 | |||
589 | self.procUnitObj = procUnitObj |
|
594 | self.procUnitObj = procUnitObj | |
590 |
|
595 | |||
591 | return procUnitObj |
|
596 | return procUnitObj | |
592 |
|
597 | |||
593 | def run(self): |
|
598 | def run(self): | |
594 |
|
599 | |||
595 | finalSts = False |
|
600 | finalSts = False | |
596 |
|
601 | |||
597 | for opConfObj in self.opConfObjList: |
|
602 | for opConfObj in self.opConfObjList: | |
598 |
|
603 | |||
599 | kwargs = {} |
|
604 | kwargs = {} | |
600 | for parmConfObj in opConfObj.getParameterObjList(): |
|
605 | for parmConfObj in opConfObj.getParameterObjList(): | |
601 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
606 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': | |
602 | continue |
|
607 | continue | |
603 |
|
608 | |||
604 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
609 | kwargs[parmConfObj.name] = parmConfObj.getValue() | |
605 |
|
610 | |||
606 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
611 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) | |
607 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
612 | sts = self.procUnitObj.call(opType = opConfObj.type, | |
608 | opName = opConfObj.name, |
|
613 | opName = opConfObj.name, | |
609 | opId = opConfObj.id, |
|
614 | opId = opConfObj.id, | |
610 | **kwargs) |
|
615 | **kwargs) | |
611 | finalSts = finalSts or sts |
|
616 | finalSts = finalSts or sts | |
612 |
|
617 | |||
613 | return finalSts |
|
618 | return finalSts | |
614 |
|
619 | |||
615 | def close(self): |
|
620 | def close(self): | |
616 |
|
621 | |||
617 | for opConfObj in self.opConfObjList: |
|
622 | for opConfObj in self.opConfObjList: | |
618 | if opConfObj.type == 'self': |
|
623 | if opConfObj.type == 'self': | |
619 | continue |
|
624 | continue | |
620 |
|
625 | |||
621 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
626 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) | |
622 | opObj.close() |
|
627 | opObj.close() | |
623 |
|
628 | |||
624 | self.procUnitObj.close() |
|
629 | self.procUnitObj.close() | |
625 |
|
630 | |||
626 | return |
|
631 | return | |
627 |
|
632 | |||
628 | class ReadUnitConf(ProcUnitConf): |
|
633 | class ReadUnitConf(ProcUnitConf): | |
629 |
|
634 | |||
630 | path = None |
|
635 | path = None | |
631 | startDate = None |
|
636 | startDate = None | |
632 | endDate = None |
|
637 | endDate = None | |
633 | startTime = None |
|
638 | startTime = None | |
634 | endTime = None |
|
639 | endTime = None | |
635 |
|
640 | |||
636 | ELEMENTNAME = 'ReadUnit' |
|
641 | ELEMENTNAME = 'ReadUnit' | |
637 |
|
642 | |||
638 | def __init__(self): |
|
643 | def __init__(self): | |
639 |
|
644 | |||
640 | self.id = None |
|
645 | self.id = None | |
641 | self.datatype = None |
|
646 | self.datatype = None | |
642 | self.name = None |
|
647 | self.name = None | |
643 | self.inputId = None |
|
648 | self.inputId = None | |
644 |
|
649 | |||
645 | self.parentId = None |
|
650 | self.parentId = None | |
646 |
|
651 | |||
647 | self.opConfObjList = [] |
|
652 | self.opConfObjList = [] | |
648 | self.opObjList = [] |
|
653 | self.opObjList = [] | |
649 |
|
654 | |||
650 | def getElementName(self): |
|
655 | def getElementName(self): | |
651 |
|
656 | |||
652 | return self.ELEMENTNAME |
|
657 | return self.ELEMENTNAME | |
653 |
|
658 | |||
654 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
659 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): | |
655 |
|
660 | |||
656 | #Compatible with old signal chain version |
|
661 | #Compatible with old signal chain version | |
657 | if datatype==None and name==None: |
|
662 | if datatype==None and name==None: | |
658 | raise ValueError, "datatype or name should be defined" |
|
663 | raise ValueError, "datatype or name should be defined" | |
659 |
|
664 | |||
660 | if name==None: |
|
665 | if name==None: | |
661 | if 'Reader' in datatype: |
|
666 | if 'Reader' in datatype: | |
662 | name = datatype |
|
667 | name = datatype | |
663 | else: |
|
668 | else: | |
664 | name = '%sReader' %(datatype) |
|
669 | name = '%sReader' %(datatype) | |
665 |
|
670 | |||
666 | if datatype==None: |
|
671 | if datatype==None: | |
667 | datatype = name.replace('Reader','') |
|
672 | datatype = name.replace('Reader','') | |
668 |
|
673 | |||
669 | self.id = id |
|
674 | self.id = id | |
670 | self.name = name |
|
675 | self.name = name | |
671 | self.datatype = datatype |
|
676 | self.datatype = datatype | |
672 |
|
677 | |||
673 | self.path = path |
|
678 | self.path = path | |
674 | self.startDate = startDate |
|
679 | self.startDate = startDate | |
675 | self.endDate = endDate |
|
680 | self.endDate = endDate | |
676 | self.startTime = startTime |
|
681 | self.startTime = startTime | |
677 | self.endTime = endTime |
|
682 | self.endTime = endTime | |
678 |
|
683 | |||
679 | self.inputId = '0' |
|
684 | self.inputId = '0' | |
680 | self.parentId = parentId |
|
685 | self.parentId = parentId | |
681 |
|
686 | |||
682 | self.addRunOperation(**kwargs) |
|
687 | self.addRunOperation(**kwargs) | |
683 |
|
688 | |||
684 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): |
|
689 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): | |
685 |
|
690 | |||
686 | #Compatible with old signal chain version |
|
691 | #Compatible with old signal chain version | |
687 | if datatype==None and name==None: |
|
692 | if datatype==None and name==None: | |
688 | raise ValueError, "datatype or name should be defined" |
|
693 | raise ValueError, "datatype or name should be defined" | |
689 |
|
694 | |||
690 | if name==None: |
|
695 | if name==None: | |
691 | if 'Reader' in datatype: |
|
696 | if 'Reader' in datatype: | |
692 | name = datatype |
|
697 | name = datatype | |
693 | else: |
|
698 | else: | |
694 | name = '%sReader' %(datatype) |
|
699 | name = '%sReader' %(datatype) | |
695 |
|
700 | |||
696 | if datatype==None: |
|
701 | if datatype==None: | |
697 | datatype = name.replace('Reader','') |
|
702 | datatype = name.replace('Reader','') | |
698 |
|
703 | |||
699 | self.datatype = datatype |
|
704 | self.datatype = datatype | |
700 | self.name = name |
|
705 | self.name = name | |
701 | self.path = path |
|
706 | self.path = path | |
702 | self.startDate = startDate |
|
707 | self.startDate = startDate | |
703 | self.endDate = endDate |
|
708 | self.endDate = endDate | |
704 | self.startTime = startTime |
|
709 | self.startTime = startTime | |
705 | self.endTime = endTime |
|
710 | self.endTime = endTime | |
706 |
|
711 | |||
707 | self.inputId = '0' |
|
712 | self.inputId = '0' | |
708 | self.parentId = parentId |
|
713 | self.parentId = parentId | |
709 |
|
714 | |||
710 | self.updateRunOperation(**kwargs) |
|
715 | self.updateRunOperation(**kwargs) | |
711 |
|
716 | |||
712 | def addRunOperation(self, **kwargs): |
|
717 | def addRunOperation(self, **kwargs): | |
713 |
|
718 | |||
714 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
719 | opObj = self.addOperation(name = 'run', optype = 'self') | |
715 |
|
720 | |||
716 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
721 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
717 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
722 | opObj.addParameter(name='path' , value=self.path, format='str') | |
718 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
723 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
719 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
724 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
720 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
725 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
721 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
726 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
722 |
|
727 | |||
723 | for key, value in kwargs.items(): |
|
728 | for key, value in kwargs.items(): | |
724 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
729 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
725 |
|
730 | |||
726 | return opObj |
|
731 | return opObj | |
727 |
|
732 | |||
728 | def updateRunOperation(self, **kwargs): |
|
733 | def updateRunOperation(self, **kwargs): | |
729 |
|
734 | |||
730 | opObj = self.getOperationObj(name = 'run') |
|
735 | opObj = self.getOperationObj(name = 'run') | |
731 | opObj.removeParameters() |
|
736 | opObj.removeParameters() | |
732 |
|
737 | |||
733 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
738 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
734 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
739 | opObj.addParameter(name='path' , value=self.path, format='str') | |
735 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
740 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
736 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
741 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
737 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
742 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
738 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
743 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
739 |
|
744 | |||
740 | for key, value in kwargs.items(): |
|
745 | for key, value in kwargs.items(): | |
741 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
746 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
742 |
|
747 | |||
743 | return opObj |
|
748 | return opObj | |
744 |
|
749 | |||
745 | class Project(): |
|
750 | class Project(): | |
746 |
|
751 | |||
747 | id = None |
|
752 | id = None | |
748 | name = None |
|
753 | name = None | |
749 | description = None |
|
754 | description = None | |
750 | # readUnitConfObjList = None |
|
755 | # readUnitConfObjList = None | |
751 | procUnitConfObjDict = None |
|
756 | procUnitConfObjDict = None | |
752 |
|
757 | |||
753 | ELEMENTNAME = 'Project' |
|
758 | ELEMENTNAME = 'Project' | |
754 |
|
759 | |||
755 | def __init__(self, control=None, dataq=None): |
|
760 | def __init__(self, control=None, dataq=None): | |
756 |
|
761 | |||
757 | self.id = None |
|
762 | self.id = None | |
758 | self.name = None |
|
763 | self.name = None | |
759 | self.description = None |
|
764 | self.description = None | |
760 |
|
765 | |||
761 | self.procUnitConfObjDict = {} |
|
766 | self.procUnitConfObjDict = {} | |
762 |
|
767 | |||
763 | #global data_q |
|
768 | #global data_q | |
764 | #data_q = dataq |
|
769 | #data_q = dataq | |
765 |
|
770 | |||
766 | if control==None: |
|
771 | if control==None: | |
767 | control = {'stop':False,'pause':False} |
|
772 | control = {'stop':False,'pause':False} | |
768 |
|
773 | |||
769 | self.control = control |
|
774 | self.control = control | |
770 |
|
775 | |||
771 | def __getNewId(self): |
|
776 | def __getNewId(self): | |
772 |
|
777 | |||
773 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
778 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 | |
774 |
|
779 | |||
775 | return str(id) |
|
780 | return str(id) | |
776 |
|
781 | |||
777 | def getElementName(self): |
|
782 | def getElementName(self): | |
778 |
|
783 | |||
779 | return self.ELEMENTNAME |
|
784 | return self.ELEMENTNAME | |
780 |
|
785 | |||
781 | def getId(self): |
|
786 | def getId(self): | |
782 |
|
787 | |||
783 | return self.id |
|
788 | return self.id | |
784 |
|
789 | |||
785 | def updateId(self, new_id): |
|
790 | def updateId(self, new_id): | |
786 |
|
791 | |||
787 | self.id = str(new_id) |
|
792 | self.id = str(new_id) | |
788 |
|
793 | |||
789 | keyList = self.procUnitConfObjDict.keys() |
|
794 | keyList = self.procUnitConfObjDict.keys() | |
790 | keyList.sort() |
|
795 | keyList.sort() | |
791 |
|
796 | |||
792 | n = 1 |
|
797 | n = 1 | |
793 | newProcUnitConfObjDict = {} |
|
798 | newProcUnitConfObjDict = {} | |
794 |
|
799 | |||
795 | for procKey in keyList: |
|
800 | for procKey in keyList: | |
796 |
|
801 | |||
797 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
802 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
798 | idProcUnit = str(int(self.id)*10 + n) |
|
803 | idProcUnit = str(int(self.id)*10 + n) | |
799 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) |
|
804 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) | |
800 |
|
805 | |||
801 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj |
|
806 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj | |
802 | n += 1 |
|
807 | n += 1 | |
803 |
|
808 | |||
804 | self.procUnitConfObjDict = newProcUnitConfObjDict |
|
809 | self.procUnitConfObjDict = newProcUnitConfObjDict | |
805 |
|
810 | |||
806 | def setup(self, id, name, description): |
|
811 | def setup(self, id, name, description): | |
807 |
|
812 | |||
808 | self.id = str(id) |
|
813 | self.id = str(id) | |
809 | self.name = name |
|
814 | self.name = name | |
810 | self.description = description |
|
815 | self.description = description | |
811 |
|
816 | |||
812 | def update(self, name, description): |
|
817 | def update(self, name, description): | |
813 |
|
818 | |||
814 | self.name = name |
|
819 | self.name = name | |
815 | self.description = description |
|
820 | self.description = description | |
816 |
|
821 | |||
817 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
822 | def addReadUnit(self, datatype=None, name=None, **kwargs): | |
818 |
|
823 | |||
819 | idReadUnit = self.__getNewId() |
|
824 | idReadUnit = self.__getNewId() | |
820 |
|
825 | |||
821 | readUnitConfObj = ReadUnitConf() |
|
826 | readUnitConfObj = ReadUnitConf() | |
822 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) |
|
827 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) | |
823 |
|
828 | |||
824 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
829 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
825 |
|
830 | |||
826 | return readUnitConfObj |
|
831 | return readUnitConfObj | |
827 |
|
832 | |||
828 | def addProcUnit(self, inputId='0', datatype=None, name=None): |
|
833 | def addProcUnit(self, inputId='0', datatype=None, name=None): | |
829 |
|
834 | |||
830 | idProcUnit = self.__getNewId() |
|
835 | idProcUnit = self.__getNewId() | |
831 |
|
836 | |||
832 | procUnitConfObj = ProcUnitConf() |
|
837 | procUnitConfObj = ProcUnitConf() | |
833 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) |
|
838 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) | |
834 |
|
839 | |||
835 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
840 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
836 |
|
841 | |||
837 | return procUnitConfObj |
|
842 | return procUnitConfObj | |
838 |
|
843 | |||
839 | def removeProcUnit(self, id): |
|
844 | def removeProcUnit(self, id): | |
840 |
|
845 | |||
841 | if id in self.procUnitConfObjDict.keys(): |
|
846 | if id in self.procUnitConfObjDict.keys(): | |
842 | self.procUnitConfObjDict.pop(id) |
|
847 | self.procUnitConfObjDict.pop(id) | |
843 |
|
848 | |||
844 | def getReadUnitId(self): |
|
849 | def getReadUnitId(self): | |
845 |
|
850 | |||
846 | readUnitConfObj = self.getReadUnitObj() |
|
851 | readUnitConfObj = self.getReadUnitObj() | |
847 |
|
852 | |||
848 | return readUnitConfObj.id |
|
853 | return readUnitConfObj.id | |
849 |
|
854 | |||
850 | def getReadUnitObj(self): |
|
855 | def getReadUnitObj(self): | |
851 |
|
856 | |||
852 | for obj in self.procUnitConfObjDict.values(): |
|
857 | for obj in self.procUnitConfObjDict.values(): | |
853 | if obj.getElementName() == "ReadUnit": |
|
858 | if obj.getElementName() == "ReadUnit": | |
854 | return obj |
|
859 | return obj | |
855 |
|
860 | |||
856 | return None |
|
861 | return None | |
857 |
|
862 | |||
858 | def getProcUnitObj(self, id): |
|
863 | def getProcUnitObj(self, id=None, name=None): | |
859 |
|
864 | |||
|
865 | if id != None: | |||
860 | return self.procUnitConfObjDict[id] |
|
866 | return self.procUnitConfObjDict[id] | |
861 |
|
867 | |||
|
868 | if name != None: | |||
|
869 | return self.getProcUnitObjByName(name) | |||
|
870 | ||||
|
871 | return None | |||
|
872 | ||||
862 | def getProcUnitObjByName(self, name): |
|
873 | def getProcUnitObjByName(self, name): | |
863 |
|
874 | |||
864 | for obj in self.procUnitConfObjDict.values(): |
|
875 | for obj in self.procUnitConfObjDict.values(): | |
865 | if obj.name == name: |
|
876 | if obj.name == name: | |
866 | return obj |
|
877 | return obj | |
867 |
|
878 | |||
868 | return None |
|
879 | return None | |
869 |
|
|
880 | ||
|
881 | def procUnitItems(self): | |||
|
882 | ||||
|
883 | return self.procUnitConfObjDict.items() | |||
|
884 | ||||
870 | def makeXml(self): |
|
885 | def makeXml(self): | |
871 |
|
886 | |||
872 | projectElement = Element('Project') |
|
887 | projectElement = Element('Project') | |
873 | projectElement.set('id', str(self.id)) |
|
888 | projectElement.set('id', str(self.id)) | |
874 | projectElement.set('name', self.name) |
|
889 | projectElement.set('name', self.name) | |
875 | projectElement.set('description', self.description) |
|
890 | projectElement.set('description', self.description) | |
876 |
|
891 | |||
877 | # for readUnitConfObj in self.readUnitConfObjList: |
|
892 | # for readUnitConfObj in self.readUnitConfObjList: | |
878 | # readUnitConfObj.makeXml(projectElement) |
|
893 | # readUnitConfObj.makeXml(projectElement) | |
879 |
|
894 | |||
880 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
895 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
881 | procUnitConfObj.makeXml(projectElement) |
|
896 | procUnitConfObj.makeXml(projectElement) | |
882 |
|
897 | |||
883 | self.projectElement = projectElement |
|
898 | self.projectElement = projectElement | |
884 |
|
899 | |||
885 | def writeXml(self, filename): |
|
900 | def writeXml(self, filename): | |
886 |
|
901 | |||
887 | self.makeXml() |
|
902 | self.makeXml() | |
888 |
|
903 | |||
889 | #print prettify(self.projectElement) |
|
904 | #print prettify(self.projectElement) | |
890 |
|
905 | |||
891 | ElementTree(self.projectElement).write(filename, method='xml') |
|
906 | ElementTree(self.projectElement).write(filename, method='xml') | |
892 |
|
907 | |||
893 | def readXml(self, filename): |
|
908 | def readXml(self, filename): | |
894 |
|
909 | |||
895 | #tree = ET.parse(filename) |
|
910 | #tree = ET.parse(filename) | |
896 | self.projectElement = None |
|
911 | self.projectElement = None | |
897 | # self.readUnitConfObjList = [] |
|
912 | # self.readUnitConfObjList = [] | |
898 | self.procUnitConfObjDict = {} |
|
913 | self.procUnitConfObjDict = {} | |
899 |
|
914 | |||
900 | self.projectElement = ElementTree().parse(filename) |
|
915 | self.projectElement = ElementTree().parse(filename) | |
901 |
|
916 | |||
902 | self.project = self.projectElement.tag |
|
917 | self.project = self.projectElement.tag | |
903 |
|
918 | |||
904 | self.id = self.projectElement.get('id') |
|
919 | self.id = self.projectElement.get('id') | |
905 | self.name = self.projectElement.get('name') |
|
920 | self.name = self.projectElement.get('name') | |
906 | self.description = self.projectElement.get('description') |
|
921 | self.description = self.projectElement.get('description') | |
907 |
|
922 | |||
908 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
923 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) | |
909 |
|
924 | |||
910 | for readUnitElement in readUnitElementList: |
|
925 | for readUnitElement in readUnitElementList: | |
911 | readUnitConfObj = ReadUnitConf() |
|
926 | readUnitConfObj = ReadUnitConf() | |
912 | readUnitConfObj.readXml(readUnitElement) |
|
927 | readUnitConfObj.readXml(readUnitElement) | |
913 |
|
928 | |||
914 | if readUnitConfObj.parentId == None: |
|
929 | if readUnitConfObj.parentId == None: | |
915 | readUnitConfObj.parentId = self.id |
|
930 | readUnitConfObj.parentId = self.id | |
916 |
|
931 | |||
917 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
932 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
918 |
|
933 | |||
919 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
934 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) | |
920 |
|
935 | |||
921 | for procUnitElement in procUnitElementList: |
|
936 | for procUnitElement in procUnitElementList: | |
922 | procUnitConfObj = ProcUnitConf() |
|
937 | procUnitConfObj = ProcUnitConf() | |
923 | procUnitConfObj.readXml(procUnitElement) |
|
938 | procUnitConfObj.readXml(procUnitElement) | |
924 |
|
939 | |||
925 | if procUnitConfObj.parentId == None: |
|
940 | if procUnitConfObj.parentId == None: | |
926 | procUnitConfObj.parentId = self.id |
|
941 | procUnitConfObj.parentId = self.id | |
927 |
|
942 | |||
928 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
943 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
929 |
|
944 | |||
930 | def printattr(self): |
|
945 | def printattr(self): | |
931 |
|
946 | |||
932 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
947 | print "Project[%s]: name = %s, description = %s" %(self.id, | |
933 | self.name, |
|
948 | self.name, | |
934 | self.description) |
|
949 | self.description) | |
935 |
|
950 | |||
936 | # for readUnitConfObj in self.readUnitConfObjList: |
|
951 | # for readUnitConfObj in self.readUnitConfObjList: | |
937 | # readUnitConfObj.printattr() |
|
952 | # readUnitConfObj.printattr() | |
938 |
|
953 | |||
939 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
954 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
940 | procUnitConfObj.printattr() |
|
955 | procUnitConfObj.printattr() | |
941 |
|
956 | |||
942 | def createObjects(self): |
|
957 | def createObjects(self): | |
943 |
|
958 | |||
944 | # for readUnitConfObj in self.readUnitConfObjList: |
|
959 | # for readUnitConfObj in self.readUnitConfObjList: | |
945 | # readUnitConfObj.createObjects() |
|
960 | # readUnitConfObj.createObjects() | |
946 |
|
961 | |||
947 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
962 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
948 | procUnitConfObj.createObjects() |
|
963 | procUnitConfObj.createObjects() | |
949 |
|
964 | |||
950 | def __connect(self, objIN, thisObj): |
|
965 | def __connect(self, objIN, thisObj): | |
951 |
|
966 | |||
952 | thisObj.setInput(objIN.getOutputObj()) |
|
967 | thisObj.setInput(objIN.getOutputObj()) | |
953 |
|
968 | |||
954 | def connectObjects(self): |
|
969 | def connectObjects(self): | |
955 |
|
970 | |||
956 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
971 | for thisPUConfObj in self.procUnitConfObjDict.values(): | |
957 |
|
972 | |||
958 | inputId = thisPUConfObj.getInputId() |
|
973 | inputId = thisPUConfObj.getInputId() | |
959 |
|
974 | |||
960 | if int(inputId) == 0: |
|
975 | if int(inputId) == 0: | |
961 | continue |
|
976 | continue | |
962 |
|
977 | |||
963 | #Get input object |
|
978 | #Get input object | |
964 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
979 | puConfINObj = self.procUnitConfObjDict[inputId] | |
965 | puObjIN = puConfINObj.getProcUnitObj() |
|
980 | puObjIN = puConfINObj.getProcUnitObj() | |
966 |
|
981 | |||
967 | #Get current object |
|
982 | #Get current object | |
968 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
983 | thisPUObj = thisPUConfObj.getProcUnitObj() | |
969 |
|
984 | |||
970 | self.__connect(puObjIN, thisPUObj) |
|
985 | self.__connect(puObjIN, thisPUObj) | |
971 |
|
986 | |||
972 | def run(self): |
|
987 | def run(self): | |
973 |
|
988 | |||
974 | # for readUnitConfObj in self.readUnitConfObjList: |
|
989 | # for readUnitConfObj in self.readUnitConfObjList: | |
975 | # readUnitConfObj.run() |
|
990 | # readUnitConfObj.run() | |
976 |
|
991 | |||
977 | print "*"*40 |
|
992 | print "*"*40 | |
978 | print " Starting SIGNAL CHAIN PROCESSING " |
|
993 | print " Starting SIGNAL CHAIN PROCESSING " | |
979 | print "*"*40 |
|
994 | print "*"*40 | |
980 |
|
995 | |||
981 |
|
996 | |||
982 | keyList = self.procUnitConfObjDict.keys() |
|
997 | keyList = self.procUnitConfObjDict.keys() | |
983 | keyList.sort() |
|
998 | keyList.sort() | |
984 |
|
999 | |||
985 | while(True): |
|
1000 | while(True): | |
986 |
|
1001 | |||
987 | finalSts = False |
|
1002 | finalSts = False | |
988 |
|
1003 | |||
989 | for procKey in keyList: |
|
1004 | for procKey in keyList: | |
990 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
1005 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) | |
991 |
|
1006 | |||
992 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1007 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
993 | sts = procUnitConfObj.run() |
|
1008 | sts = procUnitConfObj.run() | |
994 | finalSts = finalSts or sts |
|
1009 | finalSts = finalSts or sts | |
995 |
|
1010 | |||
996 | #If every process unit finished so end process |
|
1011 | #If every process unit finished so end process | |
997 | if not(finalSts): |
|
1012 | if not(finalSts): | |
998 | print "Every process unit have finished" |
|
1013 | print "Every process unit have finished" | |
999 | break |
|
1014 | break | |
1000 |
|
1015 | |||
1001 | if self.control['pause']: |
|
1016 | if self.control['pause']: | |
1002 | print "Process suspended" |
|
1017 | print "Process suspended" | |
1003 |
|
1018 | |||
1004 | while True: |
|
1019 | while True: | |
1005 | sleep(0.1) |
|
1020 | sleep(0.1) | |
1006 |
|
1021 | |||
1007 | if not self.control['pause']: |
|
1022 | if not self.control['pause']: | |
1008 | break |
|
1023 | break | |
1009 |
|
1024 | |||
1010 | if self.control['stop']: |
|
1025 | if self.control['stop']: | |
1011 | break |
|
1026 | break | |
1012 | print "Process reinitialized" |
|
1027 | print "Process reinitialized" | |
1013 |
|
1028 | |||
1014 | if self.control['stop']: |
|
1029 | if self.control['stop']: | |
1015 | print "Process stopped" |
|
1030 | print "Process stopped" | |
1016 | break |
|
1031 | break | |
1017 |
|
1032 | |||
1018 | #Closing every process |
|
1033 | #Closing every process | |
1019 | for procKey in keyList: |
|
1034 | for procKey in keyList: | |
1020 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1035 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1021 | procUnitConfObj.close() |
|
1036 | procUnitConfObj.close() | |
1022 |
|
1037 | |||
1023 | print "Process finished" |
|
1038 | print "Process finished" | |
1024 |
|
1039 | |||
1025 | def start(self, filename): |
|
1040 | def start(self, filename): | |
1026 |
|
1041 | |||
1027 | self.writeXml(filename) |
|
1042 | self.writeXml(filename) | |
1028 | self.readXml(filename) |
|
1043 | self.readXml(filename) | |
1029 |
|
1044 | |||
1030 | self.createObjects() |
|
1045 | self.createObjects() | |
1031 | self.connectObjects() |
|
1046 | self.connectObjects() | |
1032 | self.run() |
|
1047 | self.run() | |
1033 |
|
1048 | |||
1034 | class ControllerThread(threading.Thread, Project): |
|
1049 | class ControllerThread(threading.Thread, Project): | |
1035 |
|
1050 | |||
1036 | def __init__(self, filename): |
|
1051 | def __init__(self, filename): | |
1037 |
|
1052 | |||
1038 | threading.Thread.__init__(self) |
|
1053 | threading.Thread.__init__(self) | |
1039 | Project.__init__(self) |
|
1054 | Project.__init__(self) | |
1040 |
|
1055 | |||
1041 | self.setDaemon(True) |
|
1056 | self.setDaemon(True) | |
1042 |
|
1057 | |||
1043 | self.filename = filename |
|
1058 | self.filename = filename | |
1044 | self.control = {'stop':False, 'pause':False} |
|
1059 | self.control = {'stop':False, 'pause':False} | |
1045 |
|
1060 | |||
1046 | def stop(self): |
|
1061 | def stop(self): | |
1047 | self.control['stop'] = True |
|
1062 | self.control['stop'] = True | |
1048 |
|
1063 | |||
1049 | def pause(self): |
|
1064 | def pause(self): | |
1050 | self.control['pause'] = not(self.control['pause']) |
|
1065 | self.control['pause'] = not(self.control['pause']) | |
1051 |
|
1066 | |||
1052 | def run(self): |
|
1067 | def run(self): | |
1053 | self.control['stop'] = False |
|
1068 | self.control['stop'] = False | |
1054 | self.control['pause'] = False |
|
1069 | self.control['pause'] = False | |
1055 |
|
1070 | |||
1056 | self.readXml(self.filename) |
|
1071 | self.readXml(self.filename) | |
1057 | self.createObjects() |
|
1072 | self.createObjects() | |
1058 | self.connectObjects() |
|
1073 | self.connectObjects() | |
1059 | Project.run(self) |
|
1074 | Project.run(self) | |
1060 |
|
1075 | |||
1061 | if __name__ == '__main__': |
|
1076 | if __name__ == '__main__': | |
1062 |
|
1077 | |||
1063 | desc = "Segundo Test" |
|
1078 | desc = "Segundo Test" | |
1064 | filename = "schain.xml" |
|
1079 | filename = "schain.xml" | |
1065 |
|
1080 | |||
1066 | controllerObj = Project() |
|
1081 | controllerObj = Project() | |
1067 |
|
1082 | |||
1068 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
1083 | controllerObj.setup(id = '191', name='test01', description=desc) | |
1069 |
|
1084 | |||
1070 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
1085 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
1071 | path='data/rawdata/', |
|
1086 | path='data/rawdata/', | |
1072 | startDate='2011/01/01', |
|
1087 | startDate='2011/01/01', | |
1073 | endDate='2012/12/31', |
|
1088 | endDate='2012/12/31', | |
1074 | startTime='00:00:00', |
|
1089 | startTime='00:00:00', | |
1075 | endTime='23:59:59', |
|
1090 | endTime='23:59:59', | |
1076 | online=1, |
|
1091 | online=1, | |
1077 | walk=1) |
|
1092 | walk=1) | |
1078 |
|
1093 | |||
1079 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') |
|
1094 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') | |
1080 |
|
1095 | |||
1081 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
1096 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
1082 |
|
1097 | |||
1083 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
1098 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') | |
1084 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
1099 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') | |
1085 |
|
1100 | |||
1086 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
1101 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') | |
1087 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
1102 | opObj10.addParameter(name='minHei', value='90', format='float') | |
1088 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
1103 | opObj10.addParameter(name='maxHei', value='180', format='float') | |
1089 |
|
1104 | |||
1090 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
1105 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |
1091 | opObj12.addParameter(name='n', value='10', format='int') |
|
1106 | opObj12.addParameter(name='n', value='10', format='int') | |
1092 |
|
1107 | |||
1093 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
1108 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
1094 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
1109 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') | |
1095 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
1110 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') | |
1096 |
|
1111 | |||
1097 |
|
1112 | |||
1098 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1113 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1099 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
1114 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
1100 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
1115 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
1101 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
1116 | opObj11.addParameter(name='zmin', value='40', format='int') | |
1102 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
1117 | opObj11.addParameter(name='zmax', value='90', format='int') | |
1103 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1118 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
1104 |
|
1119 | |||
1105 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') |
|
1120 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') | |
1106 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
1121 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
1107 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
1122 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
1108 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
1123 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
1109 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1124 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1110 |
|
1125 | |||
1111 |
|
1126 | |||
1112 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) |
|
1127 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) | |
1113 | # |
|
1128 | # | |
1114 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') |
|
1129 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') | |
1115 | # opObj12.addParameter(name='n', value='2', format='int') |
|
1130 | # opObj12.addParameter(name='n', value='2', format='int') | |
1116 | # opObj12.addParameter(name='overlapping', value='1', format='int') |
|
1131 | # opObj12.addParameter(name='overlapping', value='1', format='int') | |
1117 | # |
|
1132 | # | |
1118 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) |
|
1133 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) | |
1119 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') |
|
1134 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') | |
1120 | # |
|
1135 | # | |
1121 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') |
|
1136 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') | |
1122 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
1137 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
1123 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') |
|
1138 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') | |
1124 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
1139 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
1125 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1140 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1126 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1141 | # opObj11.addParameter(name='showprofile', value='1', format='int') | |
1127 |
|
1142 | |||
1128 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') |
|
1143 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') | |
1129 | # opObj11.addParameter(name='idfigure', value='10', format='int') |
|
1144 | # opObj11.addParameter(name='idfigure', value='10', format='int') | |
1130 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') |
|
1145 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') | |
1131 | ## opObj11.addParameter(name='xmin', value='21', format='float') |
|
1146 | ## opObj11.addParameter(name='xmin', value='21', format='float') | |
1132 | ## opObj11.addParameter(name='xmax', value='22', format='float') |
|
1147 | ## opObj11.addParameter(name='xmax', value='22', format='float') | |
1133 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
1148 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
1134 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1149 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1135 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1150 | # opObj11.addParameter(name='showprofile', value='1', format='int') | |
1136 | # opObj11.addParameter(name='timerange', value=str(60), format='int') |
|
1151 | # opObj11.addParameter(name='timerange', value=str(60), format='int') | |
1137 |
|
1152 | |||
1138 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
1153 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') | |
1139 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') |
|
1154 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') | |
1140 | # |
|
1155 | # | |
1141 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
1156 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') | |
1142 | # opObj12.addParameter(name='n', value='2', format='int') |
|
1157 | # opObj12.addParameter(name='n', value='2', format='int') | |
1143 | # |
|
1158 | # | |
1144 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1159 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1145 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
1160 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
1146 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
1161 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') | |
1147 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1162 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
1148 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1163 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1149 | # |
|
1164 | # | |
1150 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
1165 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') | |
1151 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') |
|
1166 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') | |
1152 | # |
|
1167 | # | |
1153 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
1168 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') | |
1154 | # opObj12.addParameter(name='n', value='2', format='int') |
|
1169 | # opObj12.addParameter(name='n', value='2', format='int') | |
1155 | # |
|
1170 | # | |
1156 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1171 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1157 | # opObj11.addParameter(name='idfigure', value='3', format='int') |
|
1172 | # opObj11.addParameter(name='idfigure', value='3', format='int') | |
1158 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
1173 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') | |
1159 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1174 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
1160 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1175 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1161 |
|
1176 | |||
1162 |
|
1177 | |||
1163 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') |
|
1178 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') | |
1164 | # opObj12.addParameter(name='ncode', value='2', format='int') |
|
1179 | # opObj12.addParameter(name='ncode', value='2', format='int') | |
1165 | # opObj12.addParameter(name='nbauds', value='8', format='int') |
|
1180 | # opObj12.addParameter(name='nbauds', value='8', format='int') | |
1166 | # opObj12.addParameter(name='code0', value='001110011', format='int') |
|
1181 | # opObj12.addParameter(name='code0', value='001110011', format='int') | |
1167 | # opObj12.addParameter(name='code1', value='001110011', format='int') |
|
1182 | # opObj12.addParameter(name='code1', value='001110011', format='int') | |
1168 |
|
1183 | |||
1169 |
|
1184 | |||
1170 |
|
1185 | |||
1171 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) |
|
1186 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) | |
1172 | # |
|
1187 | # | |
1173 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') |
|
1188 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') | |
1174 | # opObj21.addParameter(name='n', value='2', format='int') |
|
1189 | # opObj21.addParameter(name='n', value='2', format='int') | |
1175 | # |
|
1190 | # | |
1176 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') |
|
1191 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') | |
1177 | # opObj11.addParameter(name='idfigure', value='4', format='int') |
|
1192 | # opObj11.addParameter(name='idfigure', value='4', format='int') | |
1178 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') |
|
1193 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') | |
1179 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1194 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
1180 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1195 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1181 |
|
1196 | |||
1182 | print "Escribiendo el archivo XML" |
|
1197 | print "Escribiendo el archivo XML" | |
1183 |
|
1198 | |||
1184 | controllerObj.writeXml(filename) |
|
1199 | controllerObj.writeXml(filename) | |
1185 |
|
1200 | |||
1186 | print "Leyendo el archivo XML" |
|
1201 | print "Leyendo el archivo XML" | |
1187 | controllerObj.readXml(filename) |
|
1202 | controllerObj.readXml(filename) | |
1188 | #controllerObj.printattr() |
|
1203 | #controllerObj.printattr() | |
1189 |
|
1204 | |||
1190 | controllerObj.createObjects() |
|
1205 | controllerObj.createObjects() | |
1191 | controllerObj.connectObjects() |
|
1206 | controllerObj.connectObjects() | |
1192 | controllerObj.run() |
|
1207 | controllerObj.run() | |
1193 |
|
1208 | |||
1194 | No newline at end of file |
|
1209 |
This diff has been collapsed as it changes many lines, (786 lines changed) Show them Hide them | |||||
@@ -1,5588 +1,5840 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | Module implementing MainWindow. |
|
3 | Module implementing MainWindow. | |
4 | #+++++++++++++GUI V1++++++++++++++# |
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± |
|
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± | |
6 | """ |
|
6 | """ | |
7 | import os, sys, time |
|
7 | import os, sys, time | |
8 | import datetime |
|
8 | import datetime | |
9 | import numpy |
|
9 | import numpy | |
10 | import Queue |
|
10 | import Queue | |
11 |
|
11 | |||
12 | from collections import OrderedDict |
|
12 | from collections import OrderedDict | |
13 | from os.path import expanduser |
|
13 | from os.path import expanduser | |
14 | from time import sleep |
|
14 | from time import sleep | |
15 | import ast |
|
15 | import ast | |
16 |
|
16 | |||
17 | from PyQt4.QtGui import QMainWindow |
|
17 | from PyQt4.QtGui import QMainWindow | |
18 | from PyQt4.QtCore import pyqtSignature |
|
18 | from PyQt4.QtCore import pyqtSignature | |
19 | from PyQt4.QtCore import pyqtSignal |
|
19 | from PyQt4.QtCore import pyqtSignal | |
20 | from PyQt4 import QtCore |
|
20 | from PyQt4 import QtCore | |
21 | from PyQt4 import QtGui |
|
21 | from PyQt4 import QtGui | |
22 |
|
22 | |||
23 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
23 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess | |
24 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
24 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp | |
25 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
25 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow | |
26 | from schainpy.controller import Project, ControllerThread |
|
26 | from schainpy.controller import Project, ControllerThread | |
27 |
|
27 | |||
28 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
28 | from propertiesViewModel import TreeModel, PropertyBuffer | |
29 | from parametersModel import ProjectParms |
|
29 | from parametersModel import ProjectParms | |
30 |
|
30 | |||
31 | from schainpy.gui.figures import tools |
|
31 | from schainpy.gui.figures import tools | |
32 | # from schainpy.gui.viewcontroller.comm import ControllerThread |
|
|||
33 |
|
32 | |||
34 | FIGURES_PATH = tools.get_path() |
|
33 | FIGURES_PATH = tools.get_path() | |
35 | TEMPORAL_FILE = ".temp.xml" |
|
34 | TEMPORAL_FILE = ".temp.xml" | |
36 |
|
35 | |||
37 | def isRadarFile(file): |
|
36 | def isRadarFile(file): | |
38 | try: |
|
37 | try: | |
39 | year = int(file[1:5]) |
|
38 | year = int(file[1:5]) | |
40 | doy = int(file[5:8]) |
|
39 | doy = int(file[5:8]) | |
41 | set = int(file[8:11]) |
|
40 | set = int(file[8:11]) | |
42 | except: |
|
41 | except: | |
43 | return 0 |
|
42 | return 0 | |
44 |
|
43 | |||
45 | return 1 |
|
44 | return 1 | |
46 |
|
45 | |||
47 | def isRadarPath(path): |
|
46 | def isRadarPath(path): | |
48 | try: |
|
47 | try: | |
49 | year = int(path[1:5]) |
|
48 | year = int(path[1:5]) | |
50 | doy = int(path[5:8]) |
|
49 | doy = int(path[5:8]) | |
51 | except: |
|
50 | except: | |
52 | return 0 |
|
51 | return 0 | |
53 |
|
52 | |||
54 | return 1 |
|
53 | return 1 | |
55 |
|
54 | |||
56 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
55 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
57 | """ |
|
56 | """ | |
58 | """ |
|
57 | """ | |
59 | def __init__(self, parent=None): |
|
58 | def __init__(self, parent=None): | |
60 | """ |
|
59 | """ | |
61 |
|
60 | |||
62 | """ |
|
61 | """ | |
63 | QMainWindow.__init__(self, parent) |
|
62 | QMainWindow.__init__(self, parent) | |
64 | self.setupUi(self) |
|
63 | self.setupUi(self) | |
65 | self.__puObjDict = {} |
|
64 | self.__puObjDict = {} | |
66 | self.__itemTreeDict = {} |
|
65 | self.__itemTreeDict = {} | |
67 | self.readUnitConfObjList = [] |
|
66 | self.readUnitConfObjList = [] | |
68 | self.operObjList = [] |
|
67 | self.operObjList = [] | |
69 | self.projecObjView = None |
|
68 | self.projecObjView = None | |
70 | self.idProject = 0 |
|
69 | self.idProject = 0 | |
71 | # self.idImag = 0 |
|
70 | # self.idImag = 0 | |
72 |
|
71 | |||
73 | self.idImagscope = 0 |
|
72 | self.idImagscope = 0 | |
74 | self.idImagspectra = 0 |
|
73 | self.idImagspectra = 0 | |
75 | self.idImagcross = 0 |
|
74 | self.idImagcross = 0 | |
76 | self.idImagrti = 0 |
|
75 | self.idImagrti = 0 | |
77 | self.idImagcoherence = 0 |
|
76 | self.idImagcoherence = 0 | |
78 | self.idImagpower = 0 |
|
77 | self.idImagpower = 0 | |
79 | self.idImagrtinoise = 0 |
|
78 | self.idImagrtinoise = 0 | |
80 | self.idImagspectraHeis = 0 |
|
79 | self.idImagspectraHeis = 0 | |
81 | self.idImagrtiHeis = 0 |
|
80 | self.idImagrtiHeis = 0 | |
82 |
|
81 | |||
83 | self.dataPath = None |
|
82 | self.dataPath = None | |
84 | self.online = 0 |
|
83 | self.online = 0 | |
85 | self.walk = 0 |
|
84 | self.walk = 0 | |
86 | self.create = False |
|
85 | self.create = False | |
87 | self.selectedItemTree = None |
|
86 | self.selectedItemTree = None | |
88 | self.controllerObj = None |
|
87 | self.controllerObj = None | |
89 | # self.commCtrlPThread = None |
|
88 | # self.commCtrlPThread = None | |
90 | # self.create_figure() |
|
89 | # self.create_figure() | |
91 | self.temporalFTP = ftpBuffer() |
|
90 | self.temporalFTP = ftpBuffer() | |
92 | self.projectProperCaracteristica = [] |
|
91 | self.projectProperCaracteristica = [] | |
93 | self.projectProperPrincipal = [] |
|
92 | self.projectProperPrincipal = [] | |
94 | self.projectProperDescripcion = [] |
|
93 | self.projectProperDescripcion = [] | |
95 | self.volProperCaracteristica = [] |
|
94 | self.volProperCaracteristica = [] | |
96 | self.volProperPrincipal = [] |
|
95 | self.volProperPrincipal = [] | |
97 | self.volProperDescripcion = [] |
|
96 | self.volProperDescripcion = [] | |
98 | self.specProperCaracteristica = [] |
|
97 | self.specProperCaracteristica = [] | |
99 | self.specProperPrincipal = [] |
|
98 | self.specProperPrincipal = [] | |
100 | self.specProperDescripcion = [] |
|
99 | self.specProperDescripcion = [] | |
101 |
|
100 | |||
102 | self.specHeisProperCaracteristica = [] |
|
101 | self.specHeisProperCaracteristica = [] | |
103 | self.specHeisProperPrincipal = [] |
|
102 | self.specHeisProperPrincipal = [] | |
104 | self.specHeisProperDescripcion = [] |
|
103 | self.specHeisProperDescripcion = [] | |
105 |
|
104 | |||
106 | # self.pathWorkSpace = './' |
|
105 | # self.pathWorkSpace = './' | |
107 |
|
106 | |||
108 | self.__projectObjDict = {} |
|
107 | self.__projectObjDict = {} | |
109 | self.__operationObjDict = {} |
|
108 | self.__operationObjDict = {} | |
110 |
|
109 | |||
111 |
self.__ |
|
110 | self.__puLocalFolder2FTP = {} | |
112 | self.__ftpProcUnitId = None |
|
|||
113 | self.__initialized = False |
|
111 | self.__initialized = False | |
114 |
|
112 | |||
115 | # self.create_comm() |
|
113 | # self.create_comm() | |
116 | self.create_updating_timer() |
|
114 | self.create_updating_timer() | |
117 | self.setParameter() |
|
115 | self.setParameter() | |
118 |
|
116 | |||
119 | @pyqtSignature("") |
|
117 | @pyqtSignature("") | |
120 | def on_actionOpen_triggered(self): |
|
118 | def on_actionOpen_triggered(self): | |
121 | """ |
|
119 | """ | |
122 | Slot documentation goes here. |
|
120 | Slot documentation goes here. | |
123 | """ |
|
121 | """ | |
124 | self.openProject() |
|
122 | self.openProject() | |
125 |
|
123 | |||
126 | @pyqtSignature("") |
|
124 | @pyqtSignature("") | |
127 | def on_actionCreate_triggered(self): |
|
125 | def on_actionCreate_triggered(self): | |
128 | """ |
|
126 | """ | |
129 | Slot documentation goes here. |
|
127 | Slot documentation goes here. | |
130 | """ |
|
128 | """ | |
131 | self.setInputsProject_View() |
|
129 | self.setInputsProject_View() | |
132 | self.create = True |
|
130 | self.create = True | |
133 |
|
131 | |||
134 | @pyqtSignature("") |
|
132 | @pyqtSignature("") | |
135 | def on_actionSave_triggered(self): |
|
133 | def on_actionSave_triggered(self): | |
136 | """ |
|
134 | """ | |
137 | Slot documentation goes here. |
|
135 | Slot documentation goes here. | |
138 | """ |
|
136 | """ | |
139 | self.saveProject() |
|
137 | self.saveProject() | |
140 |
|
138 | |||
141 | @pyqtSignature("") |
|
139 | @pyqtSignature("") | |
142 | def on_actionClose_triggered(self): |
|
140 | def on_actionClose_triggered(self): | |
143 | """ |
|
141 | """ | |
144 | Slot documentation goes here. |
|
142 | Slot documentation goes here. | |
145 | """ |
|
143 | """ | |
146 | self.close() |
|
144 | self.close() | |
147 |
|
145 | |||
148 | @pyqtSignature("") |
|
146 | @pyqtSignature("") | |
149 | def on_actionStart_triggered(self): |
|
147 | def on_actionStart_triggered(self): | |
150 | """ |
|
148 | """ | |
151 | """ |
|
149 | """ | |
152 | self.playProject() |
|
150 | self.playProject() | |
153 |
|
151 | |||
154 | @pyqtSignature("") |
|
152 | @pyqtSignature("") | |
155 | def on_actionPause_triggered(self): |
|
153 | def on_actionPause_triggered(self): | |
156 | """ |
|
154 | """ | |
157 | """ |
|
155 | """ | |
158 | self.pauseProject() |
|
156 | self.pauseProject() | |
159 |
|
157 | |||
160 | @pyqtSignature("") |
|
158 | @pyqtSignature("") | |
161 | def on_actionStop_triggered(self): |
|
159 | def on_actionStop_triggered(self): | |
162 | """ |
|
160 | """ | |
163 | """ |
|
161 | """ | |
164 | self.stopProject() |
|
162 | self.stopProject() | |
165 |
|
163 | |||
166 | @pyqtSignature("") |
|
164 | @pyqtSignature("") | |
167 | def on_actionFTP_triggered(self): |
|
165 | def on_actionFTP_triggered(self): | |
168 | """ |
|
166 | """ | |
169 | """ |
|
167 | """ | |
170 | self.configFTPWindowObj = Ftp(self) |
|
168 | self.configFTPWindowObj = Ftp(self) | |
171 | # if self.temporalFTP.create: |
|
169 | ||
172 |
if self.temporalFTP.create |
|
170 | if not self.temporalFTP.create: | |
173 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
171 | self.temporalFTP.setwithoutconfiguration() | |
174 | self.configFTPWindowObj.setParmsfromTemporal(server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos) |
|
172 | ||
|
173 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |||
|
174 | self.temporalFTP.remotefolder, | |||
|
175 | self.temporalFTP.username, | |||
|
176 | self.temporalFTP.password, | |||
|
177 | self.temporalFTP.ftp_wei, | |||
|
178 | self.temporalFTP.exp_code, | |||
|
179 | self.temporalFTP.sub_exp_code, | |||
|
180 | self.temporalFTP.plot_pos) | |||
|
181 | ||||
175 | self.configFTPWindowObj.show() |
|
182 | self.configFTPWindowObj.show() | |
176 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
183 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
177 |
|
184 | |||
178 | def createFTPConfig(self): |
|
185 | def createFTPConfig(self): | |
179 |
|
186 | |||
180 | if not self.configFTPWindowObj.create: |
|
187 | if not self.configFTPWindowObj.create: | |
181 | self.console.clear() |
|
188 | self.console.clear() | |
182 | self.console.append("There is no FTP configuration") |
|
189 | self.console.append("There is no FTP configuration") | |
183 | return |
|
190 | return | |
|
191 | ||||
184 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
192 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
185 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
193 | ||
186 |
|
|
194 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
|
195 | self.temporalFTP.save(server=server, | |||
|
196 | remotefolder=remotefolder, | |||
|
197 | username=username, | |||
|
198 | password=password, | |||
|
199 | ftp_wei=ftp_wei, | |||
|
200 | exp_code=exp_code, | |||
|
201 | sub_exp_code=sub_exp_code, | |||
|
202 | plot_pos=plot_pos) | |||
187 |
|
203 | |||
188 | @pyqtSignature("") |
|
204 | @pyqtSignature("") | |
189 | def on_actionOpenToolbar_triggered(self): |
|
205 | def on_actionOpenToolbar_triggered(self): | |
190 | """ |
|
206 | """ | |
191 | Slot documentation goes here. |
|
207 | Slot documentation goes here. | |
192 | """ |
|
208 | """ | |
193 | self.openProject() |
|
209 | self.openProject() | |
194 |
|
210 | |||
195 | @pyqtSignature("") |
|
211 | @pyqtSignature("") | |
196 | def on_actionCreateToolbar_triggered(self): |
|
212 | def on_actionCreateToolbar_triggered(self): | |
197 | """ |
|
213 | """ | |
198 | Slot documentation goes here. |
|
214 | Slot documentation goes here. | |
199 | """ |
|
215 | """ | |
200 | self.setInputsProject_View() |
|
216 | self.setInputsProject_View() | |
201 | self.create = True |
|
217 | self.create = True | |
202 |
|
218 | |||
203 | @pyqtSignature("") |
|
219 | @pyqtSignature("") | |
204 | def on_actionAddPU_triggered(self): |
|
220 | def on_actionAddPU_triggered(self): | |
205 | if len(self.__projectObjDict) == 0: |
|
221 | if len(self.__projectObjDict) == 0: | |
206 | outputstr = "First Create a Project then add Processing Unit" |
|
222 | outputstr = "First Create a Project then add Processing Unit" | |
207 | self.console.clear() |
|
223 | self.console.clear() | |
208 | self.console.append(outputstr) |
|
224 | self.console.append(outputstr) | |
209 | return 0 |
|
225 | return 0 | |
210 | else: |
|
226 | else: | |
211 | self.addPUWindow() |
|
227 | self.addPUWindow() | |
212 | self.console.clear() |
|
228 | self.console.clear() | |
213 | self.console.append("Please, Choose the type of Processing Unit") |
|
229 | self.console.append("Please, Choose the type of Processing Unit") | |
214 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
230 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
215 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
231 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
216 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
232 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
217 |
|
233 | |||
218 |
|
234 | |||
219 | @pyqtSignature("") |
|
235 | @pyqtSignature("") | |
220 | def on_actionSaveToolbar_triggered(self): |
|
236 | def on_actionSaveToolbar_triggered(self): | |
221 | """ |
|
237 | """ | |
222 | Slot documentation goes here. |
|
238 | Slot documentation goes here. | |
223 | """ |
|
239 | """ | |
224 | self.saveProject() |
|
240 | self.saveProject() | |
225 |
|
241 | |||
226 | @pyqtSignature("") |
|
242 | @pyqtSignature("") | |
227 | def on_actionStarToolbar_triggered(self): |
|
243 | def on_actionStarToolbar_triggered(self): | |
228 | """ |
|
244 | """ | |
229 | Slot documentation goes here. |
|
245 | Slot documentation goes here. | |
230 | """ |
|
246 | """ | |
231 | self.playProject() |
|
247 | self.playProject() | |
232 |
|
248 | |||
233 | @pyqtSignature("") |
|
249 | @pyqtSignature("") | |
234 | def on_actionPauseToolbar_triggered(self): |
|
250 | def on_actionPauseToolbar_triggered(self): | |
235 |
|
251 | |||
236 | self.pauseProject() |
|
252 | self.pauseProject() | |
237 |
|
253 | |||
238 | @pyqtSignature("") |
|
254 | @pyqtSignature("") | |
239 | def on_actionStopToolbar_triggered(self): |
|
255 | def on_actionStopToolbar_triggered(self): | |
240 | """ |
|
256 | """ | |
241 | Slot documentation goes here. |
|
257 | Slot documentation goes here. | |
242 | """ |
|
258 | """ | |
243 | self.stopProject() |
|
259 | self.stopProject() | |
244 |
|
260 | |||
245 | @pyqtSignature("int") |
|
261 | @pyqtSignature("int") | |
246 | def on_proComReadMode_activated(self, index): |
|
262 | def on_proComReadMode_activated(self, index): | |
247 | """ |
|
263 | """ | |
248 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
264 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
249 | """ |
|
265 | """ | |
250 | if index == 0: |
|
266 | if index == 0: | |
251 | self.online = 0 |
|
267 | self.online = 0 | |
252 | self.proDelay.setText("0") |
|
268 | self.proDelay.setText("0") | |
253 | self.proSet.setText("") |
|
269 | self.proSet.setText("") | |
254 | self.proSet.setEnabled(False) |
|
270 | self.proSet.setEnabled(False) | |
255 | self.proDelay.setEnabled(False) |
|
271 | self.proDelay.setEnabled(False) | |
256 | elif index == 1: |
|
272 | elif index == 1: | |
257 | self.online = 1 |
|
273 | self.online = 1 | |
258 | self.proSet.setText(" ") |
|
274 | self.proSet.setText(" ") | |
259 | self.proDelay.setText("5") |
|
275 | self.proDelay.setText("5") | |
260 | self.proSet.setEnabled(True) |
|
276 | self.proSet.setEnabled(True) | |
261 | self.proDelay.setEnabled(True) |
|
277 | self.proDelay.setEnabled(True) | |
262 |
|
278 | |||
263 | @pyqtSignature("int") |
|
279 | @pyqtSignature("int") | |
264 | def on_proComDataType_activated(self, index): |
|
280 | def on_proComDataType_activated(self, index): | |
265 | """ |
|
281 | """ | |
266 | Voltage or Spectra |
|
282 | Voltage or Spectra | |
267 | """ |
|
283 | """ | |
268 | self.labelSet.show() |
|
284 | self.labelSet.show() | |
269 | self.proSet.show() |
|
285 | self.proSet.show() | |
270 |
|
286 | |||
271 | self.labelIPPKm.hide() |
|
287 | self.labelIPPKm.hide() | |
272 | self.proIPPKm.hide() |
|
288 | self.proIPPKm.hide() | |
273 |
|
289 | |||
274 | if index == 0: |
|
290 | if index == 0: | |
275 | extension = '.r' |
|
291 | extension = '.r' | |
276 | elif index == 1: |
|
292 | elif index == 1: | |
277 | extension = '.pdata' |
|
293 | extension = '.pdata' | |
278 | elif index == 2: |
|
294 | elif index == 2: | |
279 | extension = '.fits' |
|
295 | extension = '.fits' | |
280 | elif index == 3: |
|
296 | elif index == 3: | |
281 | extension = '.hdf5' |
|
297 | extension = '.hdf5' | |
282 |
|
298 | |||
283 | self.labelSet.hide() |
|
299 | self.labelSet.hide() | |
284 | self.proSet.hide() |
|
300 | self.proSet.hide() | |
285 | self.labelIPPKm.show() |
|
301 | self.labelIPPKm.show() | |
286 | self.proIPPKm.show() |
|
302 | self.proIPPKm.show() | |
287 |
|
303 | |||
288 | self.proDataType.setText(extension) |
|
304 | self.proDataType.setText(extension) | |
289 |
|
305 | |||
290 | @pyqtSignature("int") |
|
306 | @pyqtSignature("int") | |
291 | def on_proComWalk_activated(self, index): |
|
307 | def on_proComWalk_activated(self, index): | |
292 | """ |
|
308 | """ | |
293 |
|
309 | |||
294 | """ |
|
310 | """ | |
295 | if index == 0: |
|
311 | if index == 0: | |
296 | self.walk = 0 |
|
312 | self.walk = 0 | |
297 | elif index == 1: |
|
313 | elif index == 1: | |
298 | self.walk = 1 |
|
314 | self.walk = 1 | |
299 |
|
315 | |||
300 | @pyqtSignature("") |
|
316 | @pyqtSignature("") | |
301 | def on_proToolPath_clicked(self): |
|
317 | def on_proToolPath_clicked(self): | |
302 | """ |
|
318 | """ | |
303 | Choose your path |
|
319 | Choose your path | |
304 | """ |
|
320 | """ | |
305 |
|
321 | |||
306 | current_dpath = './' |
|
322 | current_dpath = './' | |
307 | if self.dataPath: |
|
323 | if self.dataPath: | |
308 | current_dpath = self.dataPath |
|
324 | current_dpath = self.dataPath | |
309 |
|
325 | |||
310 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
326 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
311 |
|
327 | |||
312 | #If it was canceled |
|
328 | #If it was canceled | |
313 | if not datapath: |
|
329 | if not datapath: | |
314 | return |
|
330 | return | |
315 |
|
331 | |||
316 | #If any change was done |
|
332 | #If any change was done | |
317 | if datapath == self.dataPath: |
|
333 | if datapath == self.dataPath: | |
318 | return |
|
334 | return | |
319 |
|
335 | |||
320 | self.proDataPath.setText(datapath) |
|
336 | self.proDataPath.setText(datapath) | |
321 |
|
337 | |||
322 | self.actionStart.setEnabled(False) |
|
338 | self.actionStart.setEnabled(False) | |
323 | self.actionStarToolbar.setEnabled(False) |
|
339 | self.actionStarToolbar.setEnabled(False) | |
324 | self.proOk.setEnabled(False) |
|
340 | self.proOk.setEnabled(False) | |
325 |
|
341 | |||
326 | self.proComStartDate.clear() |
|
342 | self.proComStartDate.clear() | |
327 | self.proComEndDate.clear() |
|
343 | self.proComEndDate.clear() | |
328 |
|
344 | |||
329 | if not os.path.exists(datapath): |
|
345 | if not os.path.exists(datapath): | |
330 |
|
346 | |||
331 | self.console.clear() |
|
347 | self.console.clear() | |
332 | self.console.append("Write a correct a path") |
|
348 | self.console.append("Write a correct a path") | |
333 | return |
|
349 | return | |
334 |
|
350 | |||
335 | self.dataPath = datapath |
|
351 | self.dataPath = datapath | |
336 |
|
352 | |||
337 | self.console.clear() |
|
353 | self.console.clear() | |
338 | self.console.append("Select the read mode and press 'load button'") |
|
354 | self.console.append("Select the read mode and press 'load button'") | |
339 |
|
355 | |||
340 |
|
356 | |||
341 | @pyqtSignature("") |
|
357 | @pyqtSignature("") | |
342 | def on_proLoadButton_clicked(self): |
|
358 | def on_proLoadButton_clicked(self): | |
343 |
|
359 | |||
344 | self.console.clear() |
|
360 | self.console.clear() | |
345 |
|
361 | |||
346 | parameter_list = self.checkInputsProject() |
|
362 | parameter_list = self.checkInputsProject() | |
347 |
|
363 | |||
348 | if not parameter_list[0]: |
|
364 | if not parameter_list[0]: | |
349 | return |
|
365 | return | |
350 |
|
366 | |||
351 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set = parameter_list |
|
367 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set = parameter_list | |
352 |
|
368 | |||
353 | if read_mode == "Offline": |
|
369 | if read_mode == "Offline": | |
354 | self.proComStartDate.clear() |
|
370 | self.proComStartDate.clear() | |
355 | self.proComEndDate.clear() |
|
371 | self.proComEndDate.clear() | |
356 | self.proComStartDate.setEnabled(True) |
|
372 | self.proComStartDate.setEnabled(True) | |
357 | self.proComEndDate.setEnabled(True) |
|
373 | self.proComEndDate.setEnabled(True) | |
358 | self.proStartTime.setEnabled(True) |
|
374 | self.proStartTime.setEnabled(True) | |
359 | self.proEndTime.setEnabled(True) |
|
375 | self.proEndTime.setEnabled(True) | |
360 | self.frame_2.setEnabled(True) |
|
376 | self.frame_2.setEnabled(True) | |
361 |
|
377 | |||
362 | if read_mode == "Online": |
|
378 | if read_mode == "Online": | |
363 | self.proComStartDate.addItem("2000/01/30") |
|
379 | self.proComStartDate.addItem("2000/01/30") | |
364 | self.proComEndDate.addItem("2016/12/31") |
|
380 | self.proComEndDate.addItem("2016/12/31") | |
365 | self.proComStartDate.setEnabled(False) |
|
381 | self.proComStartDate.setEnabled(False) | |
366 | self.proComEndDate.setEnabled(False) |
|
382 | self.proComEndDate.setEnabled(False) | |
367 | self.proStartTime.setEnabled(False) |
|
383 | self.proStartTime.setEnabled(False) | |
368 | self.proEndTime.setEnabled(False) |
|
384 | self.proEndTime.setEnabled(False) | |
369 | self.frame_2.setEnabled(True) |
|
385 | self.frame_2.setEnabled(True) | |
370 |
|
386 | |||
371 | self.loadDays(data_path, ext, walk) |
|
387 | self.loadDays(data_path, ext, walk) | |
372 |
|
388 | |||
373 | @pyqtSignature("int") |
|
389 | @pyqtSignature("int") | |
374 | def on_proComStartDate_activated(self, index): |
|
390 | def on_proComStartDate_activated(self, index): | |
375 | """ |
|
391 | """ | |
376 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
392 | SELECCION DEL RANGO DE FECHAS -START DATE | |
377 | """ |
|
393 | """ | |
378 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() |
|
394 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() | |
379 | self.proComEndDate.clear() |
|
395 | self.proComEndDate.clear() | |
380 | for i in self.dateList[index:]: |
|
396 | for i in self.dateList[index:]: | |
381 | self.proComEndDate.addItem(i) |
|
397 | self.proComEndDate.addItem(i) | |
382 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) |
|
398 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) | |
383 |
|
399 | |||
384 | @pyqtSignature("int") |
|
400 | @pyqtSignature("int") | |
385 | def on_proComEndDate_activated(self, index): |
|
401 | def on_proComEndDate_activated(self, index): | |
386 | """ |
|
402 | """ | |
387 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
403 | SELECCION DEL RANGO DE FECHAS-END DATE | |
388 | """ |
|
404 | """ | |
389 | startIndex = self.proComStartDate.currentIndex() |
|
405 | startIndex = self.proComStartDate.currentIndex() | |
390 | stopIndex = self.proComEndDate.count() - index |
|
406 | stopIndex = self.proComEndDate.count() - index | |
391 | self.proComStartDate.clear() |
|
407 | self.proComStartDate.clear() | |
392 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: |
|
408 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: | |
393 | self.proComStartDate.addItem(i) |
|
409 | self.proComStartDate.addItem(i) | |
394 | self.proComStartDate.setCurrentIndex(startIndex) |
|
410 | self.proComStartDate.setCurrentIndex(startIndex) | |
395 |
|
411 | |||
396 | @pyqtSignature("") |
|
412 | @pyqtSignature("") | |
397 | def on_proOk_clicked(self): |
|
413 | def on_proOk_clicked(self): | |
398 | """ |
|
414 | """ | |
399 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
415 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
400 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
416 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
401 | """ |
|
417 | """ | |
402 |
|
418 | |||
403 | self.actionStart.setEnabled(False) |
|
419 | self.actionStart.setEnabled(False) | |
404 | self.actionStarToolbar.setEnabled(False) |
|
420 | self.actionStarToolbar.setEnabled(False) | |
405 |
|
421 | |||
406 | if self.create: |
|
422 | if self.create: | |
407 |
|
423 | |||
408 | projectId = self.__getNewProjectId() |
|
424 | projectId = self.__getNewProjectId() | |
409 |
|
425 | |||
410 | if not projectId: |
|
426 | if not projectId: | |
411 | return 0 |
|
427 | return 0 | |
412 |
|
428 | |||
413 | projectObjView = self.createProjectView(projectId) |
|
429 | projectObjView = self.createProjectView(projectId) | |
414 |
|
430 | |||
415 | if not projectObjView: |
|
431 | if not projectObjView: | |
416 | return 0 |
|
432 | return 0 | |
417 |
|
433 | |||
418 | readUnitObj = self.createReadUnitView(projectObjView) |
|
434 | readUnitObj = self.createReadUnitView(projectObjView) | |
419 |
|
435 | |||
420 | if not readUnitObj: |
|
436 | if not readUnitObj: | |
421 | return 0 |
|
437 | return 0 | |
422 |
|
438 | |||
423 | else: |
|
439 | else: | |
424 | projectObjView = self.updateProjectView() |
|
440 | projectObjView = self.updateProjectView() | |
425 |
|
441 | |||
426 | if not projectObjView: |
|
442 | if not projectObjView: | |
427 | return 0 |
|
443 | return 0 | |
428 |
|
444 | |||
429 | projectId = projectObjView.getId() |
|
445 | projectId = projectObjView.getId() | |
430 | idReadUnit = projectObjView.getReadUnitId() |
|
446 | idReadUnit = projectObjView.getReadUnitId() | |
431 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
447 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
432 |
|
448 | |||
433 | if not readUnitObj: |
|
449 | if not readUnitObj: | |
434 | return 0 |
|
450 | return 0 | |
435 |
|
451 | |||
436 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
452 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
437 | # Project Properties |
|
453 | # Project Properties | |
438 | self.refreshProjectProperties(projectObjView) |
|
454 | self.refreshProjectProperties(projectObjView) | |
439 | # Disable tabProject after finish the creation |
|
455 | # Disable tabProject after finish the creation | |
440 |
|
456 | |||
441 | self.actionStart.setEnabled(True) |
|
457 | self.actionStart.setEnabled(True) | |
442 | self.actionStarToolbar.setEnabled(True) |
|
458 | self.actionStarToolbar.setEnabled(True) | |
443 | self.console.clear() |
|
459 | self.console.clear() | |
444 | self.console.append("The project parameters were validated") |
|
460 | self.console.append("The project parameters were validated") | |
445 |
|
461 | |||
446 | return 1 |
|
462 | return 1 | |
447 |
|
463 | |||
448 | @pyqtSignature("") |
|
464 | @pyqtSignature("") | |
449 | def on_proClear_clicked(self): |
|
465 | def on_proClear_clicked(self): | |
450 |
|
466 | |||
451 | self.console.clear() |
|
467 | self.console.clear() | |
452 |
|
468 | |||
453 | @pyqtSignature("int") |
|
469 | @pyqtSignature("int") | |
454 | def on_volOpCebChannels_stateChanged(self, p0): |
|
470 | def on_volOpCebChannels_stateChanged(self, p0): | |
455 | """ |
|
471 | """ | |
456 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
472 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
457 | """ |
|
473 | """ | |
458 | if p0 == 2: |
|
474 | if p0 == 2: | |
459 | self.volOpComChannels.setEnabled(True) |
|
475 | self.volOpComChannels.setEnabled(True) | |
460 | self.volOpChannel.setEnabled(True) |
|
476 | self.volOpChannel.setEnabled(True) | |
461 |
|
477 | |||
462 | if p0 == 0: |
|
478 | if p0 == 0: | |
463 | self.volOpComChannels.setEnabled(False) |
|
479 | self.volOpComChannels.setEnabled(False) | |
464 | self.volOpChannel.setEnabled(False) |
|
480 | self.volOpChannel.setEnabled(False) | |
465 | self.volOpChannel.clear() |
|
481 | self.volOpChannel.clear() | |
466 |
|
482 | |||
467 | @pyqtSignature("int") |
|
483 | @pyqtSignature("int") | |
468 | def on_volOpCebHeights_stateChanged(self, p0): |
|
484 | def on_volOpCebHeights_stateChanged(self, p0): | |
469 | """ |
|
485 | """ | |
470 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
486 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
471 | """ |
|
487 | """ | |
472 | if p0 == 2: |
|
488 | if p0 == 2: | |
473 | self.volOpHeights.setEnabled(True) |
|
489 | self.volOpHeights.setEnabled(True) | |
474 | self.volOpComHeights.setEnabled(True) |
|
490 | self.volOpComHeights.setEnabled(True) | |
475 |
|
491 | |||
476 | if p0 == 0: |
|
492 | if p0 == 0: | |
477 | self.volOpHeights.setEnabled(False) |
|
493 | self.volOpHeights.setEnabled(False) | |
478 | self.volOpHeights.clear() |
|
494 | self.volOpHeights.clear() | |
479 | self.volOpComHeights.setEnabled(False) |
|
495 | self.volOpComHeights.setEnabled(False) | |
480 |
|
496 | |||
481 | @pyqtSignature("int") |
|
497 | @pyqtSignature("int") | |
482 | def on_volOpCebFilter_stateChanged(self, p0): |
|
498 | def on_volOpCebFilter_stateChanged(self, p0): | |
483 | """ |
|
499 | """ | |
484 | Name='Decoder', optype='other' |
|
500 | Name='Decoder', optype='other' | |
485 | """ |
|
501 | """ | |
486 | if p0 == 2: |
|
502 | if p0 == 2: | |
487 | self.volOpFilter.setEnabled(True) |
|
503 | self.volOpFilter.setEnabled(True) | |
488 |
|
504 | |||
489 | if p0 == 0: |
|
505 | if p0 == 0: | |
490 | self.volOpFilter.setEnabled(False) |
|
506 | self.volOpFilter.setEnabled(False) | |
491 | self.volOpFilter.clear() |
|
507 | self.volOpFilter.clear() | |
492 |
|
508 | |||
493 | @pyqtSignature("int") |
|
509 | @pyqtSignature("int") | |
494 | def on_volOpCebProfile_stateChanged(self, p0): |
|
510 | def on_volOpCebProfile_stateChanged(self, p0): | |
495 | """ |
|
511 | """ | |
496 | Check Box habilita ingreso del rango de Perfiles |
|
512 | Check Box habilita ingreso del rango de Perfiles | |
497 | """ |
|
513 | """ | |
498 | if p0 == 2: |
|
514 | if p0 == 2: | |
499 | self.volOpComProfile.setEnabled(True) |
|
515 | self.volOpComProfile.setEnabled(True) | |
500 | self.volOpProfile.setEnabled(True) |
|
516 | self.volOpProfile.setEnabled(True) | |
501 |
|
517 | |||
502 | if p0 == 0: |
|
518 | if p0 == 0: | |
503 | self.volOpComProfile.setEnabled(False) |
|
519 | self.volOpComProfile.setEnabled(False) | |
504 | self.volOpProfile.setEnabled(False) |
|
520 | self.volOpProfile.setEnabled(False) | |
505 | self.volOpProfile.clear() |
|
521 | self.volOpProfile.clear() | |
506 |
|
522 | |||
507 | @pyqtSignature("int") |
|
523 | @pyqtSignature("int") | |
508 | def on_volOpComProfile_activated(self, index): |
|
524 | def on_volOpComProfile_activated(self, index): | |
509 | """ |
|
525 | """ | |
510 | Check Box habilita ingreso del rango de Perfiles |
|
526 | Check Box habilita ingreso del rango de Perfiles | |
511 | """ |
|
527 | """ | |
512 | #Profile List |
|
528 | #Profile List | |
513 | if index == 0: |
|
529 | if index == 0: | |
514 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
530 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
515 |
|
531 | |||
516 | #Profile Range |
|
532 | #Profile Range | |
517 | if index == 1: |
|
533 | if index == 1: | |
518 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
534 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
519 |
|
535 | |||
520 | #Profile Range List |
|
536 | #Profile Range List | |
521 | if index == 2: |
|
537 | if index == 2: | |
522 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
538 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
523 |
|
539 | |||
524 | @pyqtSignature("int") |
|
540 | @pyqtSignature("int") | |
525 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
541 | def on_volOpCebDecodification_stateChanged(self, p0): | |
526 | """ |
|
542 | """ | |
527 | Check Box habilita |
|
543 | Check Box habilita | |
528 | """ |
|
544 | """ | |
529 | if p0 == 2: |
|
545 | if p0 == 2: | |
530 | self.volOpComCode.setEnabled(True) |
|
546 | self.volOpComCode.setEnabled(True) | |
531 | self.volOpComMode.setEnabled(True) |
|
547 | self.volOpComMode.setEnabled(True) | |
532 | if p0 == 0: |
|
548 | if p0 == 0: | |
533 | self.volOpComCode.setEnabled(False) |
|
549 | self.volOpComCode.setEnabled(False) | |
534 | self.volOpComMode.setEnabled(False) |
|
550 | self.volOpComMode.setEnabled(False) | |
535 |
|
551 | |||
536 | @pyqtSignature("int") |
|
552 | @pyqtSignature("int") | |
537 | def on_volOpComCode_activated(self, index): |
|
553 | def on_volOpComCode_activated(self, index): | |
538 | """ |
|
554 | """ | |
539 | Check Box habilita ingreso |
|
555 | Check Box habilita ingreso | |
540 | """ |
|
556 | """ | |
541 | if index == 13: |
|
557 | if index == 13: | |
542 | self.volOpCode.setEnabled(True) |
|
558 | self.volOpCode.setEnabled(True) | |
543 | else: |
|
559 | else: | |
544 | self.volOpCode.setEnabled(False) |
|
560 | self.volOpCode.setEnabled(False) | |
545 |
|
561 | |||
546 | if index == 0: |
|
562 | if index == 0: | |
547 | code = '' |
|
563 | code = '' | |
548 | self.volOpCode.setText(str(code)) |
|
564 | self.volOpCode.setText(str(code)) | |
549 | return |
|
565 | return | |
550 |
|
566 | |||
551 | if index == 1: |
|
567 | if index == 1: | |
552 | code = '(1,1,-1)' |
|
568 | code = '(1,1,-1)' | |
553 | nCode = '1' |
|
569 | nCode = '1' | |
554 | nBaud = '3' |
|
570 | nBaud = '3' | |
555 | if index == 2: |
|
571 | if index == 2: | |
556 | code = '(1,1,-1,1)' |
|
572 | code = '(1,1,-1,1)' | |
557 | nCode = '1' |
|
573 | nCode = '1' | |
558 | nBaud = '4' |
|
574 | nBaud = '4' | |
559 | if index == 3: |
|
575 | if index == 3: | |
560 | code = '(1,1,1,-1,1)' |
|
576 | code = '(1,1,1,-1,1)' | |
561 | nCode = '1' |
|
577 | nCode = '1' | |
562 | nBaud = '5' |
|
578 | nBaud = '5' | |
563 | if index == 4: |
|
579 | if index == 4: | |
564 | code = '(1,1,1,-1,-1,1,-1)' |
|
580 | code = '(1,1,1,-1,-1,1,-1)' | |
565 | nCode = '1' |
|
581 | nCode = '1' | |
566 | nBaud = '7' |
|
582 | nBaud = '7' | |
567 | if index == 5: |
|
583 | if index == 5: | |
568 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
584 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
569 | nCode = '1' |
|
585 | nCode = '1' | |
570 | nBaud = '11' |
|
586 | nBaud = '11' | |
571 | if index == 6: |
|
587 | if index == 6: | |
572 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
588 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
573 | nCode = '1' |
|
589 | nCode = '1' | |
574 | nBaud = '13' |
|
590 | nBaud = '13' | |
575 | if index == 7: |
|
591 | if index == 7: | |
576 | code = '(1,1,-1,-1,-1,1)' |
|
592 | code = '(1,1,-1,-1,-1,1)' | |
577 | nCode = '2' |
|
593 | nCode = '2' | |
578 | nBaud = '3' |
|
594 | nBaud = '3' | |
579 | if index == 8: |
|
595 | if index == 8: | |
580 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
596 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
581 | nCode = '2' |
|
597 | nCode = '2' | |
582 | nBaud = '4' |
|
598 | nBaud = '4' | |
583 | if index == 9: |
|
599 | if index == 9: | |
584 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
600 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
585 | nCode = '2' |
|
601 | nCode = '2' | |
586 | nBaud = '5' |
|
602 | nBaud = '5' | |
587 | if index == 10: |
|
603 | if index == 10: | |
588 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
604 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
589 | nCode = '2' |
|
605 | nCode = '2' | |
590 | nBaud = '7' |
|
606 | nBaud = '7' | |
591 | if index == 11: |
|
607 | if index == 11: | |
592 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' |
|
608 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
593 | nCode = '2' |
|
609 | nCode = '2' | |
594 | nBaud = '11' |
|
610 | nBaud = '11' | |
595 | if index == 12: |
|
611 | if index == 12: | |
596 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1)' |
|
612 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1)' | |
597 | nCode = '2' |
|
613 | nCode = '2' | |
598 | nBaud = '13' |
|
614 | nBaud = '13' | |
599 |
|
615 | |||
600 | code = ast.literal_eval(code) |
|
616 | code = ast.literal_eval(code) | |
601 | nCode = int(nCode) |
|
617 | nCode = int(nCode) | |
602 | nBaud = int(nBaud) |
|
618 | nBaud = int(nBaud) | |
603 |
|
619 | |||
604 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
620 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
605 |
|
621 | |||
606 | self.volOpCode.setText(str(code)) |
|
622 | self.volOpCode.setText(str(code)) | |
607 |
|
623 | |||
608 | @pyqtSignature("int") |
|
624 | @pyqtSignature("int") | |
609 | def on_volOpCebFlip_stateChanged(self, p0): |
|
625 | def on_volOpCebFlip_stateChanged(self, p0): | |
610 | """ |
|
626 | """ | |
611 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
627 | Check Box habilita ingresode del numero de Integraciones a realizar | |
612 | """ |
|
628 | """ | |
613 | if p0 == 2: |
|
629 | if p0 == 2: | |
614 | self.volOpFlip.setEnabled(True) |
|
630 | self.volOpFlip.setEnabled(True) | |
615 | if p0 == 0: |
|
631 | if p0 == 0: | |
616 | self.volOpFlip.setEnabled(False) |
|
632 | self.volOpFlip.setEnabled(False) | |
617 | self.volOpFlip.clear() |
|
633 | self.volOpFlip.clear() | |
618 |
|
634 | |||
619 | @pyqtSignature("int") |
|
635 | @pyqtSignature("int") | |
620 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
636 | def on_volOpCebCohInt_stateChanged(self, p0): | |
621 | """ |
|
637 | """ | |
622 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
638 | Check Box habilita ingresode del numero de Integraciones a realizar | |
623 | """ |
|
639 | """ | |
624 | if p0 == 2: |
|
640 | if p0 == 2: | |
625 | self.volOpCohInt.setEnabled(True) |
|
641 | self.volOpCohInt.setEnabled(True) | |
626 | if p0 == 0: |
|
642 | if p0 == 0: | |
627 | self.volOpCohInt.setEnabled(False) |
|
643 | self.volOpCohInt.setEnabled(False) | |
628 | self.volOpCohInt.clear() |
|
644 | self.volOpCohInt.clear() | |
629 |
|
645 | |||
630 | @pyqtSignature("int") |
|
646 | @pyqtSignature("int") | |
631 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
647 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
632 | """ |
|
648 | """ | |
633 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
649 | Check Box habilita ingresode del numero de Integraciones a realizar | |
634 | """ |
|
650 | """ | |
635 | if p0 == 2: |
|
651 | if p0 == 2: | |
636 | self.volOpRadarfrequency.setEnabled(True) |
|
652 | self.volOpRadarfrequency.setEnabled(True) | |
637 | if p0 == 0: |
|
653 | if p0 == 0: | |
638 | self.volOpRadarfrequency.clear() |
|
654 | self.volOpRadarfrequency.clear() | |
639 | self.volOpRadarfrequency.setEnabled(False) |
|
655 | self.volOpRadarfrequency.setEnabled(False) | |
640 |
|
656 | |||
641 | @pyqtSignature("") |
|
657 | @pyqtSignature("") | |
642 | def on_volOutputToolPath_clicked(self): |
|
658 | def on_volOutputToolPath_clicked(self): | |
643 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
659 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
644 | self.volOutputPath.setText(dirOutPath) |
|
660 | self.volOutputPath.setText(dirOutPath) | |
645 |
|
661 | |||
646 | @pyqtSignature("") |
|
662 | @pyqtSignature("") | |
647 | def on_specOutputToolPath_clicked(self): |
|
663 | def on_specOutputToolPath_clicked(self): | |
648 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
664 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
649 | self.specOutputPath.setText(dirOutPath) |
|
665 | self.specOutputPath.setText(dirOutPath) | |
650 |
|
666 | |||
651 | @pyqtSignature("") |
|
667 | @pyqtSignature("") | |
652 | def on_specHeisOutputToolPath_clicked(self): |
|
668 | def on_specHeisOutputToolPath_clicked(self): | |
653 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
669 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
654 | self.specHeisOutputPath.setText(dirOutPath) |
|
670 | self.specHeisOutputPath.setText(dirOutPath) | |
655 |
|
671 | |||
656 | @pyqtSignature("") |
|
672 | @pyqtSignature("") | |
657 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
673 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
658 |
|
674 | |||
659 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
675 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
660 | self.specHeisOutputMetada.setText(filename) |
|
676 | self.specHeisOutputMetada.setText(filename) | |
661 |
|
677 | |||
662 | @pyqtSignature("") |
|
678 | @pyqtSignature("") | |
663 | def on_volOpOk_clicked(self): |
|
679 | def on_volOpOk_clicked(self): | |
664 | """ |
|
680 | """ | |
665 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
681 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
666 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
682 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
667 | """ |
|
683 | """ | |
668 |
|
684 | |||
669 | checkPath = False |
|
685 | checkPath = False | |
670 |
|
686 | |||
671 | self.actionSaveToolbar.setEnabled(False) |
|
687 | self.actionSaveToolbar.setEnabled(False) | |
672 | self.actionStarToolbar.setEnabled(False) |
|
688 | self.actionStarToolbar.setEnabled(False) | |
673 |
|
689 | |||
674 | puObj = self.getSelectedItemObj() |
|
690 | puObj = self.getSelectedItemObj() | |
675 | puObj.removeOperations() |
|
691 | puObj.removeOperations() | |
676 |
|
692 | |||
677 | if self.volOpCebRadarfrequency.isChecked(): |
|
693 | if self.volOpCebRadarfrequency.isChecked(): | |
678 | value = str(self.volOpRadarfrequency.text()) |
|
694 | value = str(self.volOpRadarfrequency.text()) | |
679 | format = 'float' |
|
695 | format = 'float' | |
680 | name_operation = 'setRadarFrequency' |
|
696 | name_operation = 'setRadarFrequency' | |
681 | name_parameter = 'frequency' |
|
697 | name_parameter = 'frequency' | |
682 | if not value == "": |
|
698 | if not value == "": | |
683 | try: |
|
699 | try: | |
684 | radarfreq = float(self.volOpRadarfrequency.text()) |
|
700 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
685 | except: |
|
701 | except: | |
686 | self.console.clear() |
|
702 | self.console.clear() | |
687 | self.console.append("Write the parameter Radar Frequency type float") |
|
703 | self.console.append("Write the parameter Radar Frequency type float") | |
688 | return 0 |
|
704 | return 0 | |
689 | opObj = puObj.addOperation(name=name_operation) |
|
705 | opObj = puObj.addOperation(name=name_operation) | |
690 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
706 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
691 |
|
707 | |||
692 | if self.volOpCebChannels.isChecked(): |
|
708 | if self.volOpCebChannels.isChecked(): | |
693 | value = str(self.volOpChannel.text()) |
|
709 | value = str(self.volOpChannel.text()) | |
694 |
|
710 | |||
695 | if value == "": |
|
711 | if value == "": | |
696 | print "Please fill channel list" |
|
712 | print "Please fill channel list" | |
697 | return 0 |
|
713 | return 0 | |
698 |
|
714 | |||
699 | format = 'intlist' |
|
715 | format = 'intlist' | |
700 | if self.volOpComChannels.currentIndex() == 0: |
|
716 | if self.volOpComChannels.currentIndex() == 0: | |
701 | name_operation = "selectChannels" |
|
717 | name_operation = "selectChannels" | |
702 | name_parameter = 'channelList' |
|
718 | name_parameter = 'channelList' | |
703 | else: |
|
719 | else: | |
704 | name_operation = "selectChannelsByIndex" |
|
720 | name_operation = "selectChannelsByIndex" | |
705 | name_parameter = 'channelIndexList' |
|
721 | name_parameter = 'channelIndexList' | |
706 |
|
722 | |||
707 | opObj = puObj.addOperation(name=name_operation) |
|
723 | opObj = puObj.addOperation(name=name_operation) | |
708 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
724 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
709 |
|
725 | |||
710 | if self.volOpCebHeights.isChecked(): |
|
726 | if self.volOpCebHeights.isChecked(): | |
711 | value = str(self.volOpHeights.text()) |
|
727 | value = str(self.volOpHeights.text()) | |
712 |
|
728 | |||
713 | if value == "": |
|
729 | if value == "": | |
714 | print "Please fill height range" |
|
730 | print "Please fill height range" | |
715 | return 0 |
|
731 | return 0 | |
716 |
|
732 | |||
717 | valueList = value.split(',') |
|
733 | valueList = value.split(',') | |
718 | format = 'float' |
|
734 | format = 'float' | |
719 | if self.volOpComHeights.currentIndex() == 0: |
|
735 | if self.volOpComHeights.currentIndex() == 0: | |
720 | name_operation = 'selectHeights' |
|
736 | name_operation = 'selectHeights' | |
721 | name_parameter1 = 'minHei' |
|
737 | name_parameter1 = 'minHei' | |
722 | name_parameter2 = 'maxHei' |
|
738 | name_parameter2 = 'maxHei' | |
723 | else: |
|
739 | else: | |
724 | name_operation = 'selectHeightsByIndex' |
|
740 | name_operation = 'selectHeightsByIndex' | |
725 | name_parameter1 = 'minIndex' |
|
741 | name_parameter1 = 'minIndex' | |
726 | name_parameter2 = 'maxIndex' |
|
742 | name_parameter2 = 'maxIndex' | |
727 |
|
743 | |||
728 | opObj = puObj.addOperation(name=name_operation) |
|
744 | opObj = puObj.addOperation(name=name_operation) | |
729 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
745 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
730 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
746 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
731 |
|
747 | |||
732 | if self.volOpCebFilter.isChecked(): |
|
748 | if self.volOpCebFilter.isChecked(): | |
733 | value = str(self.volOpFilter.text()) |
|
749 | value = str(self.volOpFilter.text()) | |
734 | if value == "": |
|
750 | if value == "": | |
735 | print "Please fill filter value" |
|
751 | print "Please fill filter value" | |
736 | return 0 |
|
752 | return 0 | |
737 |
|
753 | |||
738 | format = 'int' |
|
754 | format = 'int' | |
739 | name_operation = 'filterByHeights' |
|
755 | name_operation = 'filterByHeights' | |
740 | name_parameter = 'window' |
|
756 | name_parameter = 'window' | |
741 | opObj = puObj.addOperation(name=name_operation) |
|
757 | opObj = puObj.addOperation(name=name_operation) | |
742 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
758 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
743 |
|
759 | |||
744 | if self.volOpCebProfile.isChecked(): |
|
760 | if self.volOpCebProfile.isChecked(): | |
745 | value = str(self.volOpProfile.text()) |
|
761 | value = str(self.volOpProfile.text()) | |
746 |
|
762 | |||
747 | if value == "": |
|
763 | if value == "": | |
748 | print "Please fill profile value" |
|
764 | print "Please fill profile value" | |
749 | return 0 |
|
765 | return 0 | |
750 |
|
766 | |||
751 | format = 'intlist' |
|
767 | format = 'intlist' | |
752 | optype = 'other' |
|
768 | optype = 'other' | |
753 | name_operation = 'ProfileSelector' |
|
769 | name_operation = 'ProfileSelector' | |
754 | if self.volOpComProfile.currentIndex() == 0: |
|
770 | if self.volOpComProfile.currentIndex() == 0: | |
755 | name_parameter = 'profileList' |
|
771 | name_parameter = 'profileList' | |
756 | if self.volOpComProfile.currentIndex() == 1: |
|
772 | if self.volOpComProfile.currentIndex() == 1: | |
757 | name_parameter = 'profileRangeList' |
|
773 | name_parameter = 'profileRangeList' | |
758 | if self.volOpComProfile.currentIndex() == 2: |
|
774 | if self.volOpComProfile.currentIndex() == 2: | |
759 | name_parameter = 'rangeList' |
|
775 | name_parameter = 'rangeList' | |
760 |
|
776 | |||
761 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
777 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
762 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
778 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
763 |
|
779 | |||
764 | if self.volOpCebDecodification.isChecked(): |
|
780 | if self.volOpCebDecodification.isChecked(): | |
765 |
|
781 | |||
766 | if self.volOpComMode.currentIndex() == 0: |
|
782 | if self.volOpComMode.currentIndex() == 0: | |
767 | mode = '0' |
|
783 | mode = '0' | |
768 | if self.volOpComMode.currentIndex() == 1: |
|
784 | if self.volOpComMode.currentIndex() == 1: | |
769 | mode = '1' |
|
785 | mode = '1' | |
770 | if self.volOpComMode.currentIndex() == 2: |
|
786 | if self.volOpComMode.currentIndex() == 2: | |
771 | mode = '2' |
|
787 | mode = '2' | |
772 |
|
788 | |||
773 | if self.volOpComCode.currentIndex() == 0: |
|
789 | if self.volOpComCode.currentIndex() == 0: | |
774 | opObj = puObj.addOperation(name='Decoder', optype='other') |
|
790 | opObj = puObj.addOperation(name='Decoder', optype='other') | |
775 | opObj.addParameter(name='mode', value=mode, format='int') |
|
791 | opObj.addParameter(name='mode', value=mode, format='int') | |
776 | else: |
|
792 | else: | |
777 | #User defined |
|
793 | #User defined | |
778 | code = str(self.volOpCode.text()) |
|
794 | code = str(self.volOpCode.text()) | |
779 | try: |
|
795 | try: | |
780 | code_tmp = ast.literal_eval(code) |
|
796 | code_tmp = ast.literal_eval(code) | |
781 | except: |
|
797 | except: | |
782 | code_tmp = [] |
|
798 | code_tmp = [] | |
783 |
|
799 | |||
784 | if len(code_tmp) < 1: |
|
800 | if len(code_tmp) < 1: | |
785 | self.console.append("Please fill the code value") |
|
801 | self.console.append("Please fill the code value") | |
786 | return 0 |
|
802 | return 0 | |
787 |
|
803 | |||
788 | if len(code_tmp) == 1 or type(code_tmp[0]) != int: |
|
804 | if len(code_tmp) == 1 or type(code_tmp[0]) != int: | |
789 | nBaud = len(code_tmp[0]) |
|
805 | nBaud = len(code_tmp[0]) | |
790 | nCode = len(code_tmp) |
|
806 | nCode = len(code_tmp) | |
791 | else: |
|
807 | else: | |
792 | nBaud = len(code_tmp) |
|
808 | nBaud = len(code_tmp) | |
793 | nCode = 1 |
|
809 | nCode = 1 | |
794 |
|
810 | |||
795 | opObj = puObj.addOperation(name='Decoder', optype='other') |
|
811 | opObj = puObj.addOperation(name='Decoder', optype='other') | |
796 |
|
812 | |||
797 | code = code.replace("(", "") |
|
813 | code = code.replace("(", "") | |
798 | code = code.replace(")", "") |
|
814 | code = code.replace(")", "") | |
799 | code = code.replace("[", "") |
|
815 | code = code.replace("[", "") | |
800 | code = code.replace("]", "") |
|
816 | code = code.replace("]", "") | |
801 | opObj.addParameter(name='code', value=code, format='intlist') |
|
817 | opObj.addParameter(name='code', value=code, format='intlist') | |
802 | opObj.addParameter(name='nCode', value=nCode, format='int') |
|
818 | opObj.addParameter(name='nCode', value=nCode, format='int') | |
803 | opObj.addParameter(name='nBaud', value=nBaud, format='int') |
|
819 | opObj.addParameter(name='nBaud', value=nBaud, format='int') | |
804 | opObj.addParameter(name='mode', value=mode, format='int') |
|
820 | opObj.addParameter(name='mode', value=mode, format='int') | |
805 |
|
821 | |||
806 | if self.volOpCebFlip.isChecked(): |
|
822 | if self.volOpCebFlip.isChecked(): | |
807 | name_operation = 'deFlip' |
|
823 | name_operation = 'deFlip' | |
808 | optype = 'self' |
|
824 | optype = 'self' | |
809 | value = str(self.volOpFlip.text()) |
|
825 | value = str(self.volOpFlip.text()) | |
810 | name_parameter = 'channelList' |
|
826 | name_parameter = 'channelList' | |
811 | format = 'intlist' |
|
827 | format = 'intlist' | |
812 |
|
828 | |||
813 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
829 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
814 | if value: |
|
830 | if value: | |
815 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
831 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
816 |
|
832 | |||
817 | if self.volOpCebCohInt.isChecked(): |
|
833 | if self.volOpCebCohInt.isChecked(): | |
818 | name_operation = 'CohInt' |
|
834 | name_operation = 'CohInt' | |
819 | optype = 'other' |
|
835 | optype = 'other' | |
820 | value = str(self.volOpCohInt.text()) |
|
836 | value = str(self.volOpCohInt.text()) | |
821 |
|
837 | |||
822 | if value == "": |
|
838 | if value == "": | |
823 | print "Please fill number of coherent integrations" |
|
839 | print "Please fill number of coherent integrations" | |
824 | return 0 |
|
840 | return 0 | |
825 |
|
841 | |||
826 | name_parameter = 'n' |
|
842 | name_parameter = 'n' | |
827 | format = 'float' |
|
843 | format = 'float' | |
828 |
|
844 | |||
829 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
845 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
830 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
846 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
831 |
|
847 | |||
832 | if self.volGraphCebshow.isChecked(): |
|
848 | if self.volGraphCebshow.isChecked(): | |
833 | name_operation = 'Scope' |
|
849 | name_operation = 'Scope' | |
834 | optype = 'other' |
|
850 | optype = 'other' | |
835 | name_parameter = 'type' |
|
851 | name_parameter = 'type' | |
836 | value = 'Scope' |
|
852 | value = 'Scope' | |
837 | if self.idImagscope == 0: |
|
853 | if self.idImagscope == 0: | |
838 | self.idImagscope = 100 |
|
854 | self.idImagscope = 100 | |
839 | else: |
|
855 | else: | |
840 | self.idImagscope = self.idImagscope + 1 |
|
856 | self.idImagscope = self.idImagscope + 1 | |
841 |
|
857 | |||
842 | name_parameter1 = 'id' |
|
858 | name_parameter1 = 'id' | |
843 | value1 = int(self.idImagscope) |
|
859 | value1 = int(self.idImagscope) | |
844 | format1 = 'int' |
|
860 | format1 = 'int' | |
845 | format = 'str' |
|
861 | format = 'str' | |
846 |
|
862 | |||
847 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
863 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
848 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
864 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
849 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
865 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
850 |
|
866 | |||
851 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
867 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
852 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
868 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
853 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
869 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
854 |
|
870 | |||
855 | if channelList: |
|
871 | if channelList: | |
856 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
872 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
857 |
|
873 | |||
858 | if xvalue: |
|
874 | if xvalue: | |
859 | xvalueList = xvalue.split(',') |
|
875 | xvalueList = xvalue.split(',') | |
860 | try: |
|
876 | try: | |
861 | value0 = float(xvalueList[0]) |
|
877 | value0 = float(xvalueList[0]) | |
862 | value1 = float(xvalueList[1]) |
|
878 | value1 = float(xvalueList[1]) | |
863 | except: |
|
879 | except: | |
864 | return 0 |
|
880 | return 0 | |
865 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
881 | opObj.addParameter(name='xmin', value=value0, format='float') | |
866 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
882 | opObj.addParameter(name='xmax', value=value1, format='float') | |
867 |
|
883 | |||
868 |
|
884 | |||
869 | if not yvalue == "": |
|
885 | if not yvalue == "": | |
870 | yvalueList = yvalue.split(",") |
|
886 | yvalueList = yvalue.split(",") | |
871 | try: |
|
887 | try: | |
872 | value0 = int(yvalueList[0]) |
|
888 | value0 = int(yvalueList[0]) | |
873 | value1 = int(yvalueList[1]) |
|
889 | value1 = int(yvalueList[1]) | |
874 | except: |
|
890 | except: | |
875 | return 0 |
|
891 | return 0 | |
876 |
|
892 | |||
877 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
893 | opObj.addParameter(name='ymin', value=value0, format='int') | |
878 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
894 | opObj.addParameter(name='ymax', value=value1, format='int') | |
879 |
|
895 | |||
880 | if self.volGraphCebSave.isChecked(): |
|
896 | if self.volGraphCebSave.isChecked(): | |
881 | checkPath = True |
|
897 | checkPath = True | |
882 | opObj.addParameter(name='save', value='1', format='int') |
|
898 | opObj.addParameter(name='save', value='1', format='int') | |
883 | opObj.addParameter(name='figpath', value=self.volGraphPath.text(), format='str') |
|
899 | opObj.addParameter(name='figpath', value=self.volGraphPath.text(), format='str') | |
884 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
900 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
885 | if value: |
|
901 | if value: | |
886 | opObj.addParameter(name='figfile', value=value, format='str') |
|
902 | opObj.addParameter(name='figfile', value=value, format='str') | |
887 |
|
903 | |||
888 | localfolder = None |
|
904 | localfolder = None | |
889 | if checkPath: |
|
905 | if checkPath: | |
890 | localfolder = str(self.volGraphPath.text()) |
|
906 | localfolder = str(self.volGraphPath.text()) | |
891 | if localfolder == '': |
|
907 | if localfolder == '': | |
892 | self.console.clear() |
|
908 | self.console.clear() | |
893 | self.console.append("Graphic path should be defined") |
|
909 | self.console.append("Graphic path should be defined") | |
894 | return 0 |
|
910 | return 0 | |
895 |
|
911 | |||
896 | # if something happend |
|
912 | # if something happend | |
897 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
913 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
898 | if parms_ok: |
|
914 | if parms_ok: | |
899 | name_operation = 'VoltageWriter' |
|
915 | name_operation = 'VoltageWriter' | |
900 | optype = 'other' |
|
916 | optype = 'other' | |
901 | name_parameter1 = 'path' |
|
917 | name_parameter1 = 'path' | |
902 | name_parameter2 = 'blocksPerFile' |
|
918 | name_parameter2 = 'blocksPerFile' | |
903 | name_parameter3 = 'profilesPerBlock' |
|
919 | name_parameter3 = 'profilesPerBlock' | |
904 | value1 = output_path |
|
920 | value1 = output_path | |
905 | value2 = blocksperfile |
|
921 | value2 = blocksperfile | |
906 | value3 = profilesperblock |
|
922 | value3 = profilesperblock | |
907 | format = "int" |
|
923 | format = "int" | |
908 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
924 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
909 | opObj.addParameter(name=name_parameter1, value=value1) |
|
925 | opObj.addParameter(name=name_parameter1, value=value1) | |
910 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
926 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
911 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
927 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
912 |
|
928 | |||
913 | self.console.clear() |
|
929 | self.console.clear() | |
914 | try: |
|
930 | try: | |
915 | self.refreshPUProperties(puObj) |
|
931 | self.refreshPUProperties(puObj) | |
916 | except: |
|
932 | except: | |
917 | self.console.append("Check input parameters") |
|
933 | self.console.append("Check input parameters") | |
918 | return 0 |
|
934 | return 0 | |
919 |
|
935 | |||
920 | self.console.append("If you want to save your project") |
|
936 | self.console.append("If you want to save your project") | |
921 | self.console.append("click on your project name in the Tree Project Explorer") |
|
937 | self.console.append("click on your project name in the Tree Project Explorer") | |
922 |
|
938 | |||
923 | self.actionSaveToolbar.setEnabled(True) |
|
939 | self.actionSaveToolbar.setEnabled(True) | |
924 | self.actionStarToolbar.setEnabled(True) |
|
940 | self.actionStarToolbar.setEnabled(True) | |
925 |
|
941 | |||
926 | return 1 |
|
942 | return 1 | |
927 |
|
943 | |||
928 | """ |
|
944 | """ | |
929 | Voltage Graph |
|
945 | Voltage Graph | |
930 | """ |
|
946 | """ | |
931 | @pyqtSignature("int") |
|
947 | @pyqtSignature("int") | |
932 | def on_volGraphCebSave_stateChanged(self, p0): |
|
948 | def on_volGraphCebSave_stateChanged(self, p0): | |
933 | """ |
|
949 | """ | |
934 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
950 | Check Box habilita ingresode del numero de Integraciones a realizar | |
935 | """ |
|
951 | """ | |
936 | if p0 == 2: |
|
952 | if p0 == 2: | |
937 | self.volGraphPath.setEnabled(True) |
|
953 | self.volGraphPath.setEnabled(True) | |
938 | self.volGraphPrefix.setEnabled(True) |
|
954 | self.volGraphPrefix.setEnabled(True) | |
939 | self.volGraphToolPath.setEnabled(True) |
|
955 | self.volGraphToolPath.setEnabled(True) | |
940 |
|
956 | |||
941 | if p0 == 0: |
|
957 | if p0 == 0: | |
942 | self.volGraphPath.setEnabled(False) |
|
958 | self.volGraphPath.setEnabled(False) | |
943 | self.volGraphPrefix.setEnabled(False) |
|
959 | self.volGraphPrefix.setEnabled(False) | |
944 | self.volGraphToolPath.setEnabled(False) |
|
960 | self.volGraphToolPath.setEnabled(False) | |
945 |
|
961 | |||
946 | @pyqtSignature("") |
|
962 | @pyqtSignature("") | |
947 | def on_volGraphToolPath_clicked(self): |
|
963 | def on_volGraphToolPath_clicked(self): | |
948 | """ |
|
964 | """ | |
949 | Donde se guardan los DATOS |
|
965 | Donde se guardan los DATOS | |
950 | """ |
|
966 | """ | |
951 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
967 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
952 | self.volGraphPath.setText(self.dataPath) |
|
968 | self.volGraphPath.setText(self.dataPath) | |
953 |
|
969 | |||
954 | # if not os.path.exists(self.dataPath): |
|
970 | # if not os.path.exists(self.dataPath): | |
955 | # self.volGraphOk.setEnabled(False) |
|
971 | # self.volGraphOk.setEnabled(False) | |
956 | # return |
|
972 | # return | |
957 |
|
973 | |||
958 | @pyqtSignature("int") |
|
974 | @pyqtSignature("int") | |
959 | def on_volGraphCebshow_stateChanged(self, p0): |
|
975 | def on_volGraphCebshow_stateChanged(self, p0): | |
960 | """ |
|
976 | """ | |
961 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
977 | Check Box habilita ingresode del numero de Integraciones a realizar | |
962 | """ |
|
978 | """ | |
963 | if p0 == 0: |
|
979 | if p0 == 0: | |
964 |
|
980 | |||
965 | self.volGraphChannelList.setEnabled(False) |
|
981 | self.volGraphChannelList.setEnabled(False) | |
966 | self.volGraphfreqrange.setEnabled(False) |
|
982 | self.volGraphfreqrange.setEnabled(False) | |
967 | self.volGraphHeightrange.setEnabled(False) |
|
983 | self.volGraphHeightrange.setEnabled(False) | |
968 | if p0 == 2: |
|
984 | if p0 == 2: | |
969 |
|
985 | |||
970 | self.volGraphChannelList.setEnabled(True) |
|
986 | self.volGraphChannelList.setEnabled(True) | |
971 | self.volGraphfreqrange.setEnabled(True) |
|
987 | self.volGraphfreqrange.setEnabled(True) | |
972 | self.volGraphHeightrange.setEnabled(True) |
|
988 | self.volGraphHeightrange.setEnabled(True) | |
973 |
|
989 | |||
974 | """ |
|
990 | """ | |
975 | Spectra operation |
|
991 | Spectra operation | |
976 | """ |
|
992 | """ | |
977 | @pyqtSignature("int") |
|
993 | @pyqtSignature("int") | |
978 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
994 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
979 | """ |
|
995 | """ | |
980 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
996 | Check Box habilita ingresode del numero de Integraciones a realizar | |
981 | """ |
|
997 | """ | |
982 | if p0 == 2: |
|
998 | if p0 == 2: | |
983 | self.specOpRadarfrequency.setEnabled(True) |
|
999 | self.specOpRadarfrequency.setEnabled(True) | |
984 | if p0 == 0: |
|
1000 | if p0 == 0: | |
985 | self.specOpRadarfrequency.clear() |
|
1001 | self.specOpRadarfrequency.clear() | |
986 | self.specOpRadarfrequency.setEnabled(False) |
|
1002 | self.specOpRadarfrequency.setEnabled(False) | |
987 |
|
1003 | |||
988 |
|
1004 | |||
989 | @pyqtSignature("int") |
|
1005 | @pyqtSignature("int") | |
990 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1006 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
991 | """ |
|
1007 | """ | |
992 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1008 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
993 | """ |
|
1009 | """ | |
994 | if p0 == 2: |
|
1010 | if p0 == 2: | |
995 | # self.specOpnFFTpoints.setEnabled(True) |
|
1011 | # self.specOpnFFTpoints.setEnabled(True) | |
996 | self.specOppairsList.setEnabled(True) |
|
1012 | self.specOppairsList.setEnabled(True) | |
997 | if p0 == 0: |
|
1013 | if p0 == 0: | |
998 | # self.specOpnFFTpoints.setEnabled(False) |
|
1014 | # self.specOpnFFTpoints.setEnabled(False) | |
999 | self.specOppairsList.setEnabled(False) |
|
1015 | self.specOppairsList.setEnabled(False) | |
1000 |
|
1016 | |||
1001 | @pyqtSignature("int") |
|
1017 | @pyqtSignature("int") | |
1002 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1018 | def on_specOpCebChannel_stateChanged(self, p0): | |
1003 | """ |
|
1019 | """ | |
1004 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1020 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1005 | """ |
|
1021 | """ | |
1006 | if p0 == 2: |
|
1022 | if p0 == 2: | |
1007 | self.specOpChannel.setEnabled(True) |
|
1023 | self.specOpChannel.setEnabled(True) | |
1008 | self.specOpComChannel.setEnabled(True) |
|
1024 | self.specOpComChannel.setEnabled(True) | |
1009 | if p0 == 0: |
|
1025 | if p0 == 0: | |
1010 | self.specOpChannel.setEnabled(False) |
|
1026 | self.specOpChannel.setEnabled(False) | |
1011 | self.specOpComChannel.setEnabled(False) |
|
1027 | self.specOpComChannel.setEnabled(False) | |
1012 |
|
1028 | |||
1013 | @pyqtSignature("int") |
|
1029 | @pyqtSignature("int") | |
1014 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1030 | def on_specOpCebHeights_stateChanged(self, p0): | |
1015 | """ |
|
1031 | """ | |
1016 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1032 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1017 | """ |
|
1033 | """ | |
1018 | if p0 == 2: |
|
1034 | if p0 == 2: | |
1019 | self.specOpComHeights.setEnabled(True) |
|
1035 | self.specOpComHeights.setEnabled(True) | |
1020 | self.specOpHeights.setEnabled(True) |
|
1036 | self.specOpHeights.setEnabled(True) | |
1021 | if p0 == 0: |
|
1037 | if p0 == 0: | |
1022 | self.specOpComHeights.setEnabled(False) |
|
1038 | self.specOpComHeights.setEnabled(False) | |
1023 | self.specOpHeights.setEnabled(False) |
|
1039 | self.specOpHeights.setEnabled(False) | |
1024 |
|
1040 | |||
1025 |
|
1041 | |||
1026 | @pyqtSignature("int") |
|
1042 | @pyqtSignature("int") | |
1027 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1043 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1028 | """ |
|
1044 | """ | |
1029 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1045 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1030 | """ |
|
1046 | """ | |
1031 | if p0 == 2: |
|
1047 | if p0 == 2: | |
1032 | self.specOpIncoherent.setEnabled(True) |
|
1048 | self.specOpIncoherent.setEnabled(True) | |
1033 | if p0 == 0: |
|
1049 | if p0 == 0: | |
1034 | self.specOpIncoherent.setEnabled(False) |
|
1050 | self.specOpIncoherent.setEnabled(False) | |
1035 |
|
1051 | |||
1036 | @pyqtSignature("int") |
|
1052 | @pyqtSignature("int") | |
1037 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1053 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1038 | """ |
|
1054 | """ | |
1039 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1055 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1040 | """ |
|
1056 | """ | |
1041 | if p0 == 2: |
|
1057 | if p0 == 2: | |
1042 | self.specOpComRemoveDC.setEnabled(True) |
|
1058 | self.specOpComRemoveDC.setEnabled(True) | |
1043 | if p0 == 0: |
|
1059 | if p0 == 0: | |
1044 | self.specOpComRemoveDC.setEnabled(False) |
|
1060 | self.specOpComRemoveDC.setEnabled(False) | |
1045 |
|
1061 | |||
1046 | @pyqtSignature("int") |
|
1062 | @pyqtSignature("int") | |
1047 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1063 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1048 | """ |
|
1064 | """ | |
1049 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1065 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1050 | """ |
|
1066 | """ | |
1051 | if p0 == 2: |
|
1067 | if p0 == 2: | |
1052 | self.specOpgetNoise.setEnabled(True) |
|
1068 | self.specOpgetNoise.setEnabled(True) | |
1053 |
|
1069 | |||
1054 | if p0 == 0: |
|
1070 | if p0 == 0: | |
1055 | self.specOpgetNoise.setEnabled(False) |
|
1071 | self.specOpgetNoise.setEnabled(False) | |
1056 |
|
1072 | |||
1057 | @pyqtSignature("") |
|
1073 | @pyqtSignature("") | |
1058 | def on_specOpOk_clicked(self): |
|
1074 | def on_specOpOk_clicked(self): | |
1059 | """ |
|
1075 | """ | |
1060 | AΓADE OPERACION SPECTRA |
|
1076 | AΓADE OPERACION SPECTRA | |
1061 | """ |
|
1077 | """ | |
1062 |
|
1078 | |||
1063 | addFTP = False |
|
1079 | addFTP = False | |
1064 | checkPath = False |
|
1080 | checkPath = False | |
1065 |
|
1081 | |||
1066 | self.actionSaveToolbar.setEnabled(False) |
|
1082 | self.actionSaveToolbar.setEnabled(False) | |
1067 | self.actionStarToolbar.setEnabled(False) |
|
1083 | self.actionStarToolbar.setEnabled(False) | |
1068 |
|
1084 | |||
1069 | projectObj = self.getSelectedProjectObj() |
|
1085 | projectObj = self.getSelectedProjectObj() | |
1070 | puObj = self.getSelectedItemObj() |
|
1086 | puObj = self.getSelectedItemObj() | |
1071 |
|
1087 | |||
1072 | puObj.removeOperations() |
|
1088 | puObj.removeOperations() | |
1073 |
|
1089 | |||
1074 | if self.specOpCebRadarfrequency.isChecked(): |
|
1090 | if self.specOpCebRadarfrequency.isChecked(): | |
1075 | value = self.specOpRadarfrequency.text() |
|
1091 | value = self.specOpRadarfrequency.text() | |
1076 | format = 'float' |
|
1092 | format = 'float' | |
1077 | name_operation = 'setRadarFrequency' |
|
1093 | name_operation = 'setRadarFrequency' | |
1078 | name_parameter = 'frequency' |
|
1094 | name_parameter = 'frequency' | |
1079 | if not value == "": |
|
1095 | if not value == "": | |
1080 | try: |
|
1096 | try: | |
1081 | radarfreq = float(self.specOpRadarfrequency.text()) |
|
1097 | radarfreq = float(self.specOpRadarfrequency.text())*1e6 | |
1082 | except: |
|
1098 | except: | |
1083 | self.console.clear() |
|
1099 | self.console.clear() | |
1084 | self.console.append("Write the parameter Radar Frequency type float") |
|
1100 | self.console.append("Write the parameter Radar Frequency type float") | |
1085 | return 0 |
|
1101 | return 0 | |
1086 | opObj = puObj.addOperation(name=name_operation) |
|
1102 | opObj = puObj.addOperation(name=name_operation) | |
1087 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1103 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1088 |
|
1104 | |||
1089 | inputId = puObj.getInputId() |
|
1105 | inputId = puObj.getInputId() | |
1090 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1106 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1091 |
|
1107 | |||
1092 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1108 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1093 |
|
1109 | |||
1094 | try: |
|
1110 | try: | |
1095 | value = int(self.specOpnFFTpoints.text()) |
|
1111 | value = int(self.specOpnFFTpoints.text()) | |
1096 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1112 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1097 | except: |
|
1113 | except: | |
1098 | self.console.clear() |
|
1114 | self.console.clear() | |
1099 | self.console.append("Please write the number of FFT") |
|
1115 | self.console.append("Please write the number of FFT") | |
1100 | return 0 |
|
1116 | return 0 | |
1101 |
|
1117 | |||
1102 | try: |
|
1118 | try: | |
1103 | value1 = int(self.specOpProfiles.text()) |
|
1119 | value1 = int(self.specOpProfiles.text()) | |
1104 | puObj.addParameter(name='nProfiles', value=value1, format='int') |
|
1120 | puObj.addParameter(name='nProfiles', value=value1, format='int') | |
1105 | except: |
|
1121 | except: | |
1106 | self.console.append("Please Write the number of Profiles") |
|
1122 | self.console.append("Please Write the number of Profiles") | |
1107 |
|
1123 | |||
1108 | try: |
|
1124 | try: | |
1109 | value2 = int(self.specOpippFactor.text()) |
|
1125 | value2 = int(self.specOpippFactor.text()) | |
1110 | puObj.addParameter(name='ippFactor' , value=value2 , format='int') |
|
1126 | puObj.addParameter(name='ippFactor' , value=value2 , format='int') | |
1111 | except: |
|
1127 | except: | |
1112 | self.console.append("Please Write the Number of IppFactor") |
|
1128 | self.console.append("Please Write the Number of IppFactor") | |
1113 |
|
1129 | |||
1114 |
|
1130 | |||
1115 | if self.specOpCebCrossSpectra.isChecked(): |
|
1131 | if self.specOpCebCrossSpectra.isChecked(): | |
1116 | name_parameter = 'pairsList' |
|
1132 | name_parameter = 'pairsList' | |
1117 | format = 'pairslist' |
|
1133 | format = 'pairslist' | |
1118 | value2 = self.specOppairsList.text() |
|
1134 | value2 = self.specOppairsList.text() | |
1119 |
|
1135 | |||
1120 | if value2 == "": |
|
1136 | if value2 == "": | |
1121 | print "Please fill the pairs list field" |
|
1137 | print "Please fill the pairs list field" | |
1122 | return 0 |
|
1138 | return 0 | |
1123 |
|
1139 | |||
1124 | puObj.addParameter(name=name_parameter, value=value2, format=format) |
|
1140 | puObj.addParameter(name=name_parameter, value=value2, format=format) | |
1125 |
|
1141 | |||
1126 | if self.specOpCebHeights.isChecked(): |
|
1142 | if self.specOpCebHeights.isChecked(): | |
1127 | value = str(self.specOpHeights.text()) |
|
1143 | value = str(self.specOpHeights.text()) | |
1128 |
|
1144 | |||
1129 | if value == "": |
|
1145 | if value == "": | |
1130 | print "Please fill height range" |
|
1146 | print "Please fill height range" | |
1131 | return 0 |
|
1147 | return 0 | |
1132 |
|
1148 | |||
1133 | valueList = value.split(',') |
|
1149 | valueList = value.split(',') | |
1134 | format = 'float' |
|
1150 | format = 'float' | |
1135 | value0 = valueList[0] |
|
1151 | value0 = valueList[0] | |
1136 | value1 = valueList[1] |
|
1152 | value1 = valueList[1] | |
1137 |
|
1153 | |||
1138 | if self.specOpComHeights.currentIndex() == 0: |
|
1154 | if self.specOpComHeights.currentIndex() == 0: | |
1139 | name_operation = 'selectHeights' |
|
1155 | name_operation = 'selectHeights' | |
1140 | name_parameter1 = 'minHei' |
|
1156 | name_parameter1 = 'minHei' | |
1141 | name_parameter2 = 'maxHei' |
|
1157 | name_parameter2 = 'maxHei' | |
1142 | else: |
|
1158 | else: | |
1143 | name_operation = 'selectHeightsByIndex' |
|
1159 | name_operation = 'selectHeightsByIndex' | |
1144 | name_parameter1 = 'minIndex' |
|
1160 | name_parameter1 = 'minIndex' | |
1145 | name_parameter2 = 'maxIndex' |
|
1161 | name_parameter2 = 'maxIndex' | |
1146 | opObj = puObj.addOperation(name=name_operation) |
|
1162 | opObj = puObj.addOperation(name=name_operation) | |
1147 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1163 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1148 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1164 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1149 |
|
1165 | |||
1150 | if self.specOpCebChannel.isChecked(): |
|
1166 | if self.specOpCebChannel.isChecked(): | |
1151 | value = str(self.specOpChannel.text()) |
|
1167 | value = str(self.specOpChannel.text()) | |
1152 |
|
1168 | |||
1153 | if value == "": |
|
1169 | if value == "": | |
1154 | print "Please fill channel list" |
|
1170 | print "Please fill channel list" | |
1155 | return 0 |
|
1171 | return 0 | |
1156 |
|
1172 | |||
1157 | format = 'intlist' |
|
1173 | format = 'intlist' | |
1158 | if self.specOpComChannel.currentIndex() == 0: |
|
1174 | if self.specOpComChannel.currentIndex() == 0: | |
1159 | name_operation = "selectChannels" |
|
1175 | name_operation = "selectChannels" | |
1160 | name_parameter = 'channelList' |
|
1176 | name_parameter = 'channelList' | |
1161 | else: |
|
1177 | else: | |
1162 | name_operation = "selectChannelsByIndex" |
|
1178 | name_operation = "selectChannelsByIndex" | |
1163 | name_parameter = 'channelIndexList' |
|
1179 | name_parameter = 'channelIndexList' | |
1164 |
|
1180 | |||
1165 | opObj = puObj.addOperation(name=name_operation) |
|
1181 | opObj = puObj.addOperation(name=name_operation) | |
1166 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1182 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1167 |
|
1183 | |||
1168 | if self.specOpCebIncoherent.isChecked(): |
|
1184 | if self.specOpCebIncoherent.isChecked(): | |
1169 | value = str(self.specOpIncoherent.text()) |
|
1185 | value = str(self.specOpIncoherent.text()) | |
1170 |
|
1186 | |||
1171 | if value == "": |
|
1187 | if value == "": | |
1172 | print "Please fill Incoherent integration value" |
|
1188 | print "Please fill Incoherent integration value" | |
1173 | return 0 |
|
1189 | return 0 | |
1174 |
|
1190 | |||
1175 | name_operation = 'IncohInt' |
|
1191 | name_operation = 'IncohInt' | |
1176 | optype = 'other' |
|
1192 | optype = 'other' | |
1177 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1193 | if self.specOpCobIncInt.currentIndex() == 0: | |
1178 | name_parameter = 'timeInterval' |
|
1194 | name_parameter = 'timeInterval' | |
1179 | format = 'float' |
|
1195 | format = 'float' | |
1180 | else: |
|
1196 | else: | |
1181 | name_parameter = 'n' |
|
1197 | name_parameter = 'n' | |
1182 | format = 'float' |
|
1198 | format = 'float' | |
1183 |
|
1199 | |||
1184 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1200 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1185 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1201 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1186 |
|
1202 | |||
1187 | if self.specOpCebRemoveDC.isChecked(): |
|
1203 | if self.specOpCebRemoveDC.isChecked(): | |
1188 | name_operation = 'removeDC' |
|
1204 | name_operation = 'removeDC' | |
1189 | name_parameter = 'mode' |
|
1205 | name_parameter = 'mode' | |
1190 | format = 'int' |
|
1206 | format = 'int' | |
1191 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1207 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1192 | value = 1 |
|
1208 | value = 1 | |
1193 | else: |
|
1209 | else: | |
1194 | value = 2 |
|
1210 | value = 2 | |
1195 | opObj = puObj.addOperation(name=name_operation) |
|
1211 | opObj = puObj.addOperation(name=name_operation) | |
1196 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1212 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1197 |
|
1213 | |||
1198 | if self.specOpCebRemoveInt.isChecked(): |
|
1214 | if self.specOpCebRemoveInt.isChecked(): | |
1199 | name_operation = 'removeInterference' |
|
1215 | name_operation = 'removeInterference' | |
1200 | opObj = puObj.addOperation(name=name_operation) |
|
1216 | opObj = puObj.addOperation(name=name_operation) | |
1201 |
|
1217 | |||
1202 |
|
1218 | |||
1203 | if self.specOpCebgetNoise.isChecked(): |
|
1219 | if self.specOpCebgetNoise.isChecked(): | |
1204 | value = self.specOpgetNoise.text() |
|
1220 | value = self.specOpgetNoise.text() | |
1205 | valueList = value.split(',') |
|
1221 | valueList = value.split(',') | |
1206 | format = 'float' |
|
1222 | format = 'float' | |
1207 | name_operation = "getNoise" |
|
1223 | name_operation = "getNoise" | |
1208 | opObj = puObj.addOperation(name=name_operation) |
|
1224 | opObj = puObj.addOperation(name=name_operation) | |
1209 |
|
1225 | |||
1210 | if not value == '': |
|
1226 | if not value == '': | |
1211 | valueList = value.split(',') |
|
1227 | valueList = value.split(',') | |
1212 | length = len(valueList) |
|
1228 | length = len(valueList) | |
1213 | if length == 1: |
|
1229 | if length == 1: | |
1214 | try: |
|
1230 | try: | |
1215 | value1 = float(valueList[0]) |
|
1231 | value1 = float(valueList[0]) | |
1216 | except: |
|
1232 | except: | |
1217 | self.console.clear() |
|
1233 | self.console.clear() | |
1218 | self.console.append("Please Write correct parameter Get Noise") |
|
1234 | self.console.append("Please Write correct parameter Get Noise") | |
1219 | return 0 |
|
1235 | return 0 | |
1220 | name1 = 'minHei' |
|
1236 | name1 = 'minHei' | |
1221 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1237 | opObj.addParameter(name=name1, value=value1, format=format) | |
1222 | elif length == 2: |
|
1238 | elif length == 2: | |
1223 | try: |
|
1239 | try: | |
1224 | value1 = float(valueList[0]) |
|
1240 | value1 = float(valueList[0]) | |
1225 | value2 = float(valueList[1]) |
|
1241 | value2 = float(valueList[1]) | |
1226 | except: |
|
1242 | except: | |
1227 | self.console.clear() |
|
1243 | self.console.clear() | |
1228 | self.console.append("Please Write corrects parameter Get Noise") |
|
1244 | self.console.append("Please Write corrects parameter Get Noise") | |
1229 | return 0 |
|
1245 | return 0 | |
1230 | name1 = 'minHei' |
|
1246 | name1 = 'minHei' | |
1231 | name2 = 'maxHei' |
|
1247 | name2 = 'maxHei' | |
1232 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1248 | opObj.addParameter(name=name1, value=value1, format=format) | |
1233 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1249 | opObj.addParameter(name=name2, value=value2, format=format) | |
1234 |
|
1250 | |||
1235 | elif length == 3: |
|
1251 | elif length == 3: | |
1236 | try: |
|
1252 | try: | |
1237 | value1 = float(valueList[0]) |
|
1253 | value1 = float(valueList[0]) | |
1238 | value2 = float(valueList[1]) |
|
1254 | value2 = float(valueList[1]) | |
1239 | value3 = float(valueList[2]) |
|
1255 | value3 = float(valueList[2]) | |
1240 | except: |
|
1256 | except: | |
1241 | self.console.clear() |
|
1257 | self.console.clear() | |
1242 | self.console.append("Please Write corrects parameter Get Noise") |
|
1258 | self.console.append("Please Write corrects parameter Get Noise") | |
1243 | return 0 |
|
1259 | return 0 | |
1244 | name1 = 'minHei' |
|
1260 | name1 = 'minHei' | |
1245 | name2 = 'maxHei' |
|
1261 | name2 = 'maxHei' | |
1246 | name3 = 'minVel' |
|
1262 | name3 = 'minVel' | |
1247 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1263 | opObj.addParameter(name=name1, value=value1, format=format) | |
1248 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1264 | opObj.addParameter(name=name2, value=value2, format=format) | |
1249 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1265 | opObj.addParameter(name=name3, value=value3, format=format) | |
1250 |
|
1266 | |||
1251 | elif length == 4: |
|
1267 | elif length == 4: | |
1252 | try: |
|
1268 | try: | |
1253 | value1 = float(valueList[0]) |
|
1269 | value1 = float(valueList[0]) | |
1254 | value2 = float(valueList[1]) |
|
1270 | value2 = float(valueList[1]) | |
1255 | value3 = float(valueList[2]) |
|
1271 | value3 = float(valueList[2]) | |
1256 | value4 = float(valueList[3]) |
|
1272 | value4 = float(valueList[3]) | |
1257 | except: |
|
1273 | except: | |
1258 | self.console.clear() |
|
1274 | self.console.clear() | |
1259 | self.console.append("Please Write corrects parameter Get Noise") |
|
1275 | self.console.append("Please Write corrects parameter Get Noise") | |
1260 | return 0 |
|
1276 | return 0 | |
1261 | name1 = 'minHei' |
|
1277 | name1 = 'minHei' | |
1262 | name2 = 'maxHei' |
|
1278 | name2 = 'maxHei' | |
1263 | name3 = 'minVel' |
|
1279 | name3 = 'minVel' | |
1264 | name4 = 'maxVel' |
|
1280 | name4 = 'maxVel' | |
1265 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1281 | opObj.addParameter(name=name1, value=value1, format=format) | |
1266 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1282 | opObj.addParameter(name=name2, value=value2, format=format) | |
1267 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1283 | opObj.addParameter(name=name3, value=value3, format=format) | |
1268 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1284 | opObj.addParameter(name=name4, value=value4, format=format) | |
1269 |
|
1285 | |||
1270 | elif length > 4: |
|
1286 | elif length > 4: | |
1271 | self.console.clear() |
|
1287 | self.console.clear() | |
1272 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1288 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1273 | return 0 |
|
1289 | return 0 | |
1274 |
|
1290 | |||
1275 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1291 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1276 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1292 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1277 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1293 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1278 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1294 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1279 |
|
1295 | |||
1280 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1296 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1281 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1297 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1282 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1298 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1283 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1299 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1284 |
|
1300 | |||
1285 | figpath = str(self.specGraphPath.text()) |
|
1301 | figpath = str(self.specGraphPath.text()) | |
1286 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1302 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1287 | try: |
|
1303 | try: | |
1288 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1304 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1289 | except: |
|
1305 | except: | |
1290 | wrperiod = None |
|
1306 | wrperiod = None | |
1291 |
|
1307 | |||
1292 | #-----Spectra Plot----- |
|
1308 | #-----Spectra Plot----- | |
1293 | if self.specGraphCebSpectraplot.isChecked(): |
|
1309 | if self.specGraphCebSpectraplot.isChecked(): | |
1294 |
|
1310 | |||
1295 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1311 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1296 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1312 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1297 |
|
1313 | |||
1298 | if not channelList == '': |
|
1314 | if not channelList == '': | |
1299 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1315 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1300 |
|
1316 | |||
1301 | if not vel_range == '': |
|
1317 | if not vel_range == '': | |
1302 | xvalueList = vel_range.split(',') |
|
1318 | xvalueList = vel_range.split(',') | |
1303 | try: |
|
1319 | try: | |
1304 | value1 = float(xvalueList[0]) |
|
1320 | value1 = float(xvalueList[0]) | |
1305 | value2 = float(xvalueList[1]) |
|
1321 | value2 = float(xvalueList[1]) | |
1306 | except: |
|
1322 | except: | |
1307 | self.console.clear() |
|
1323 | self.console.clear() | |
1308 | self.console.append("Invalid velocity/frequency range") |
|
1324 | self.console.append("Invalid velocity/frequency range") | |
1309 | return 0 |
|
1325 | return 0 | |
1310 |
|
1326 | |||
1311 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1327 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1312 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1328 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1313 |
|
1329 | |||
1314 | if not hei_range == '': |
|
1330 | if not hei_range == '': | |
1315 | yvalueList = hei_range.split(",") |
|
1331 | yvalueList = hei_range.split(",") | |
1316 | try: |
|
1332 | try: | |
1317 | value1 = float(yvalueList[0]) |
|
1333 | value1 = float(yvalueList[0]) | |
1318 | value2 = float(yvalueList[1]) |
|
1334 | value2 = float(yvalueList[1]) | |
1319 | except: |
|
1335 | except: | |
1320 | self.console.clear() |
|
1336 | self.console.clear() | |
1321 | self.console.append("Invalid height range") |
|
1337 | self.console.append("Invalid height range") | |
1322 | return 0 |
|
1338 | return 0 | |
1323 |
|
1339 | |||
1324 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1340 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1325 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1341 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1326 |
|
1342 | |||
1327 | if not db_range == '': |
|
1343 | if not db_range == '': | |
1328 | zvalueList = db_range.split(",") |
|
1344 | zvalueList = db_range.split(",") | |
1329 | try: |
|
1345 | try: | |
1330 | value1 = float(zvalueList[0]) |
|
1346 | value1 = float(zvalueList[0]) | |
1331 | value2 = float(zvalueList[1]) |
|
1347 | value2 = float(zvalueList[1]) | |
1332 | except: |
|
1348 | except: | |
1333 | self.console.clear() |
|
1349 | self.console.clear() | |
1334 | self.console.append("Invalid db range") |
|
1350 | self.console.append("Invalid db range") | |
1335 | return 0 |
|
1351 | return 0 | |
1336 |
|
1352 | |||
1337 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1353 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1338 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1354 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1339 |
|
1355 | |||
1340 | if self.specGraphSaveSpectra.isChecked(): |
|
1356 | if self.specGraphSaveSpectra.isChecked(): | |
1341 | checkPath = True |
|
1357 | checkPath = True | |
1342 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1358 | opObj.addParameter(name='save', value=1 , format='bool') | |
1343 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1359 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1344 | if figfile: |
|
1360 | if figfile: | |
1345 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1361 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1346 | if wrperiod: |
|
1362 | if wrperiod: | |
1347 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1363 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1348 |
|
1364 | |||
1349 | if self.specGraphftpSpectra.isChecked(): |
|
1365 | if self.specGraphftpSpectra.isChecked(): | |
1350 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1366 | opObj.addParameter(name='ftp', value='1', format='int') | |
1351 | self.addFTPConf2Operation(puObj, opObj) |
|
1367 | self.addFTPConf2Operation(puObj, opObj) | |
1352 | addFTP = True |
|
1368 | addFTP = True | |
1353 |
|
1369 | |||
1354 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1370 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1355 |
|
1371 | |||
1356 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1372 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1357 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1373 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1358 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1374 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1359 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1375 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1360 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1376 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1361 |
|
1377 | |||
1362 | if not vel_range == '': |
|
1378 | if not vel_range == '': | |
1363 | xvalueList = vel_range.split(',') |
|
1379 | xvalueList = vel_range.split(',') | |
1364 | try: |
|
1380 | try: | |
1365 | value1 = float(xvalueList[0]) |
|
1381 | value1 = float(xvalueList[0]) | |
1366 | value2 = float(xvalueList[1]) |
|
1382 | value2 = float(xvalueList[1]) | |
1367 | except: |
|
1383 | except: | |
1368 | self.console.clear() |
|
1384 | self.console.clear() | |
1369 | self.console.append("Invalid velocity/frequency range") |
|
1385 | self.console.append("Invalid velocity/frequency range") | |
1370 | return 0 |
|
1386 | return 0 | |
1371 |
|
1387 | |||
1372 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1388 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1373 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1389 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1374 |
|
1390 | |||
1375 | if not hei_range == '': |
|
1391 | if not hei_range == '': | |
1376 | yvalueList = hei_range.split(",") |
|
1392 | yvalueList = hei_range.split(",") | |
1377 | try: |
|
1393 | try: | |
1378 | value1 = float(yvalueList[0]) |
|
1394 | value1 = float(yvalueList[0]) | |
1379 | value2 = float(yvalueList[1]) |
|
1395 | value2 = float(yvalueList[1]) | |
1380 | except: |
|
1396 | except: | |
1381 | self.console.clear() |
|
1397 | self.console.clear() | |
1382 | self.console.append("Invalid height range") |
|
1398 | self.console.append("Invalid height range") | |
1383 | return 0 |
|
1399 | return 0 | |
1384 |
|
1400 | |||
1385 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1401 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1386 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1402 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1387 |
|
1403 | |||
1388 | if not db_range == '': |
|
1404 | if not db_range == '': | |
1389 | zvalueList = db_range.split(",") |
|
1405 | zvalueList = db_range.split(",") | |
1390 | try: |
|
1406 | try: | |
1391 | value1 = float(zvalueList[0]) |
|
1407 | value1 = float(zvalueList[0]) | |
1392 | value2 = float(zvalueList[1]) |
|
1408 | value2 = float(zvalueList[1]) | |
1393 | except: |
|
1409 | except: | |
1394 | self.console.clear() |
|
1410 | self.console.clear() | |
1395 | self.console.append("Invalid db range") |
|
1411 | self.console.append("Invalid db range") | |
1396 | return 0 |
|
1412 | return 0 | |
1397 |
|
1413 | |||
1398 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1414 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1399 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1415 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1400 |
|
1416 | |||
1401 | if not magrange == '': |
|
1417 | if not magrange == '': | |
1402 | zvalueList = magrange.split(",") |
|
1418 | zvalueList = magrange.split(",") | |
1403 | try: |
|
1419 | try: | |
1404 | value1 = float(zvalueList[0]) |
|
1420 | value1 = float(zvalueList[0]) | |
1405 | value2 = float(zvalueList[1]) |
|
1421 | value2 = float(zvalueList[1]) | |
1406 | except: |
|
1422 | except: | |
1407 | self.console.clear() |
|
1423 | self.console.clear() | |
1408 | self.console.append("Invalid magnitude range") |
|
1424 | self.console.append("Invalid magnitude range") | |
1409 | return 0 |
|
1425 | return 0 | |
1410 |
|
1426 | |||
1411 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1427 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1412 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1428 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1413 |
|
1429 | |||
1414 | if not phaserange == '': |
|
1430 | if not phaserange == '': | |
1415 | zvalueList = phaserange.split(",") |
|
1431 | zvalueList = phaserange.split(",") | |
1416 | try: |
|
1432 | try: | |
1417 | value1 = float(zvalueList[0]) |
|
1433 | value1 = float(zvalueList[0]) | |
1418 | value2 = float(zvalueList[1]) |
|
1434 | value2 = float(zvalueList[1]) | |
1419 | except: |
|
1435 | except: | |
1420 | self.console.clear() |
|
1436 | self.console.clear() | |
1421 | self.console.append("Invalid phase range") |
|
1437 | self.console.append("Invalid phase range") | |
1422 | return 0 |
|
1438 | return 0 | |
1423 |
|
1439 | |||
1424 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1440 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1425 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1441 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1426 |
|
1442 | |||
1427 | if self.specGraphSaveCross.isChecked(): |
|
1443 | if self.specGraphSaveCross.isChecked(): | |
1428 | checkPath = True |
|
1444 | checkPath = True | |
1429 | opObj.addParameter(name='save', value='1', format='bool') |
|
1445 | opObj.addParameter(name='save', value='1', format='bool') | |
1430 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1446 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1431 | if figfile: |
|
1447 | if figfile: | |
1432 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1448 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1433 | if wrperiod: |
|
1449 | if wrperiod: | |
1434 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1450 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1435 |
|
1451 | |||
1436 | if self.specGraphftpCross.isChecked(): |
|
1452 | if self.specGraphftpCross.isChecked(): | |
1437 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1453 | opObj.addParameter(name='ftp', value='1', format='int') | |
1438 | self.addFTPConf2Operation(puObj, opObj) |
|
1454 | self.addFTPConf2Operation(puObj, opObj) | |
1439 | addFTP = True |
|
1455 | addFTP = True | |
1440 |
|
1456 | |||
1441 | if self.specGraphCebRTIplot.isChecked(): |
|
1457 | if self.specGraphCebRTIplot.isChecked(): | |
1442 |
|
1458 | |||
1443 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1459 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1444 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1460 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1445 |
|
1461 | |||
1446 | if not channelList == '': |
|
1462 | if not channelList == '': | |
1447 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1463 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1448 |
|
1464 | |||
1449 | if not trange == '': |
|
1465 | if not trange == '': | |
1450 | xvalueList = trange.split(',') |
|
1466 | xvalueList = trange.split(',') | |
1451 | try: |
|
1467 | try: | |
1452 | value1 = float(xvalueList[0]) |
|
1468 | value1 = float(xvalueList[0]) | |
1453 | value2 = float(xvalueList[1]) |
|
1469 | value2 = float(xvalueList[1]) | |
1454 | except: |
|
1470 | except: | |
1455 | self.console.clear() |
|
1471 | self.console.clear() | |
1456 | self.console.append("Invalid time range") |
|
1472 | self.console.append("Invalid time range") | |
1457 | return 0 |
|
1473 | return 0 | |
1458 |
|
1474 | |||
1459 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1475 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1460 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1476 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1461 |
|
1477 | |||
1462 | # if not timerange == '': |
|
1478 | # if not timerange == '': | |
1463 | # try: |
|
1479 | # try: | |
1464 | # timerange = float(timerange) |
|
1480 | # timerange = float(timerange) | |
1465 | # except: |
|
1481 | # except: | |
1466 | # self.console.clear() |
|
1482 | # self.console.clear() | |
1467 | # self.console.append("Invalid time range") |
|
1483 | # self.console.append("Invalid time range") | |
1468 | # return 0 |
|
1484 | # return 0 | |
1469 | # |
|
1485 | # | |
1470 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1486 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1471 |
|
1487 | |||
1472 | if not hei_range == '': |
|
1488 | if not hei_range == '': | |
1473 | yvalueList = hei_range.split(",") |
|
1489 | yvalueList = hei_range.split(",") | |
1474 | try: |
|
1490 | try: | |
1475 | value1 = float(yvalueList[0]) |
|
1491 | value1 = float(yvalueList[0]) | |
1476 | value2 = float(yvalueList[1]) |
|
1492 | value2 = float(yvalueList[1]) | |
1477 | except: |
|
1493 | except: | |
1478 | self.console.clear() |
|
1494 | self.console.clear() | |
1479 | self.console.append("Invalid height range") |
|
1495 | self.console.append("Invalid height range") | |
1480 | return 0 |
|
1496 | return 0 | |
1481 |
|
1497 | |||
1482 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1498 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1483 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1499 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1484 |
|
1500 | |||
1485 | if not db_range == '': |
|
1501 | if not db_range == '': | |
1486 | zvalueList = db_range.split(",") |
|
1502 | zvalueList = db_range.split(",") | |
1487 | try: |
|
1503 | try: | |
1488 | value1 = float(zvalueList[0]) |
|
1504 | value1 = float(zvalueList[0]) | |
1489 | value2 = float(zvalueList[1]) |
|
1505 | value2 = float(zvalueList[1]) | |
1490 | except: |
|
1506 | except: | |
1491 | self.console.clear() |
|
1507 | self.console.clear() | |
1492 | self.console.append("Invalid db range") |
|
1508 | self.console.append("Invalid db range") | |
1493 | return 0 |
|
1509 | return 0 | |
1494 |
|
1510 | |||
1495 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1511 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1496 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1512 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1497 |
|
1513 | |||
1498 | if self.specGraphSaveRTIplot.isChecked(): |
|
1514 | if self.specGraphSaveRTIplot.isChecked(): | |
1499 | checkPath = True |
|
1515 | checkPath = True | |
1500 | opObj.addParameter(name='save', value='1', format='bool') |
|
1516 | opObj.addParameter(name='save', value='1', format='bool') | |
1501 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1517 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1502 | if figfile: |
|
1518 | if figfile: | |
1503 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1519 | opObj.addParameter(name='figfile', value=value, format='str') | |
1504 | if wrperiod: |
|
1520 | if wrperiod: | |
1505 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1521 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1506 |
|
1522 | |||
1507 | if self.specGraphftpRTIplot.isChecked(): |
|
1523 | if self.specGraphftpRTIplot.isChecked(): | |
1508 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1524 | opObj.addParameter(name='ftp', value='1', format='int') | |
1509 | self.addFTPConf2Operation(puObj, opObj) |
|
1525 | self.addFTPConf2Operation(puObj, opObj) | |
1510 | addFTP = True |
|
1526 | addFTP = True | |
1511 |
|
1527 | |||
1512 | if self.specGraphCebCoherencmap.isChecked(): |
|
1528 | if self.specGraphCebCoherencmap.isChecked(): | |
1513 |
|
1529 | |||
1514 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1530 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1515 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1531 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1516 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1532 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1517 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1533 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1518 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1534 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1519 |
|
1535 | |||
1520 | # if not timerange == '': |
|
1536 | # if not timerange == '': | |
1521 | # try: |
|
1537 | # try: | |
1522 | # timerange = int(timerange) |
|
1538 | # timerange = int(timerange) | |
1523 | # except: |
|
1539 | # except: | |
1524 | # self.console.clear() |
|
1540 | # self.console.clear() | |
1525 | # self.console.append("Invalid time range") |
|
1541 | # self.console.append("Invalid time range") | |
1526 | # return 0 |
|
1542 | # return 0 | |
1527 | # |
|
1543 | # | |
1528 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1544 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1529 |
|
1545 | |||
1530 | if not trange == '': |
|
1546 | if not trange == '': | |
1531 | xvalueList = trange.split(',') |
|
1547 | xvalueList = trange.split(',') | |
1532 | try: |
|
1548 | try: | |
1533 | value1 = float(xvalueList[0]) |
|
1549 | value1 = float(xvalueList[0]) | |
1534 | value2 = float(xvalueList[1]) |
|
1550 | value2 = float(xvalueList[1]) | |
1535 | except: |
|
1551 | except: | |
1536 | self.console.clear() |
|
1552 | self.console.clear() | |
1537 | self.console.append("Invalid time range") |
|
1553 | self.console.append("Invalid time range") | |
1538 | return 0 |
|
1554 | return 0 | |
1539 |
|
1555 | |||
1540 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1556 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1541 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1557 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1542 |
|
1558 | |||
1543 | if not hei_range == '': |
|
1559 | if not hei_range == '': | |
1544 | yvalueList = hei_range.split(",") |
|
1560 | yvalueList = hei_range.split(",") | |
1545 | try: |
|
1561 | try: | |
1546 | value1 = float(yvalueList[0]) |
|
1562 | value1 = float(yvalueList[0]) | |
1547 | value2 = float(yvalueList[1]) |
|
1563 | value2 = float(yvalueList[1]) | |
1548 | except: |
|
1564 | except: | |
1549 | self.console.clear() |
|
1565 | self.console.clear() | |
1550 | self.console.append("Invalid height range") |
|
1566 | self.console.append("Invalid height range") | |
1551 | return 0 |
|
1567 | return 0 | |
1552 |
|
1568 | |||
1553 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1569 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1554 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1570 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1555 |
|
1571 | |||
1556 | if not magrange == '': |
|
1572 | if not magrange == '': | |
1557 | zvalueList = magrange.split(",") |
|
1573 | zvalueList = magrange.split(",") | |
1558 | try: |
|
1574 | try: | |
1559 | value1 = float(zvalueList[0]) |
|
1575 | value1 = float(zvalueList[0]) | |
1560 | value2 = float(zvalueList[1]) |
|
1576 | value2 = float(zvalueList[1]) | |
1561 | except: |
|
1577 | except: | |
1562 | self.console.clear() |
|
1578 | self.console.clear() | |
1563 | self.console.append("Invalid magnitude range") |
|
1579 | self.console.append("Invalid magnitude range") | |
1564 | return 0 |
|
1580 | return 0 | |
1565 |
|
1581 | |||
1566 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1582 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1567 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1583 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1568 |
|
1584 | |||
1569 | if not phaserange == '': |
|
1585 | if not phaserange == '': | |
1570 | zvalueList = phaserange.split(",") |
|
1586 | zvalueList = phaserange.split(",") | |
1571 | try: |
|
1587 | try: | |
1572 | value1 = float(zvalueList[0]) |
|
1588 | value1 = float(zvalueList[0]) | |
1573 | value2 = float(zvalueList[1]) |
|
1589 | value2 = float(zvalueList[1]) | |
1574 | except: |
|
1590 | except: | |
1575 | self.console.clear() |
|
1591 | self.console.clear() | |
1576 | self.console.append("Invalid phase range") |
|
1592 | self.console.append("Invalid phase range") | |
1577 | return 0 |
|
1593 | return 0 | |
1578 |
|
1594 | |||
1579 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1595 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1580 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1596 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1581 |
|
1597 | |||
1582 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1598 | if self.specGraphSaveCoherencemap.isChecked(): | |
1583 | checkPath = True |
|
1599 | checkPath = True | |
1584 | opObj.addParameter(name='save', value='1', format='bool') |
|
1600 | opObj.addParameter(name='save', value='1', format='bool') | |
1585 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1601 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1586 | if figfile: |
|
1602 | if figfile: | |
1587 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1603 | opObj.addParameter(name='figfile', value=value, format='str') | |
1588 | if wrperiod: |
|
1604 | if wrperiod: | |
1589 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1605 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1590 |
|
1606 | |||
1591 | if self.specGraphftpCoherencemap.isChecked(): |
|
1607 | if self.specGraphftpCoherencemap.isChecked(): | |
1592 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1608 | opObj.addParameter(name='ftp', value='1', format='int') | |
1593 | self.addFTPConf2Operation(puObj, opObj) |
|
1609 | self.addFTPConf2Operation(puObj, opObj) | |
1594 | addFTP = True |
|
1610 | addFTP = True | |
1595 |
|
1611 | |||
1596 | if self.specGraphPowerprofile.isChecked(): |
|
1612 | if self.specGraphPowerprofile.isChecked(): | |
1597 |
|
1613 | |||
1598 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1614 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1599 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1615 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1600 |
|
1616 | |||
1601 | if not channelList == '': |
|
1617 | if not channelList == '': | |
1602 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1618 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1603 |
|
1619 | |||
1604 | if not db_range == '': |
|
1620 | if not db_range == '': | |
1605 | xvalueList = db_range.split(',') |
|
1621 | xvalueList = db_range.split(',') | |
1606 | try: |
|
1622 | try: | |
1607 | value1 = float(xvalueList[0]) |
|
1623 | value1 = float(xvalueList[0]) | |
1608 | value2 = float(xvalueList[1]) |
|
1624 | value2 = float(xvalueList[1]) | |
1609 | except: |
|
1625 | except: | |
1610 | self.console.clear() |
|
1626 | self.console.clear() | |
1611 | self.console.append("Invalid db range") |
|
1627 | self.console.append("Invalid db range") | |
1612 | return 0 |
|
1628 | return 0 | |
1613 |
|
1629 | |||
1614 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1630 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1615 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1631 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1616 |
|
1632 | |||
1617 | if not hei_range == '': |
|
1633 | if not hei_range == '': | |
1618 | yvalueList = hei_range.split(",") |
|
1634 | yvalueList = hei_range.split(",") | |
1619 | try: |
|
1635 | try: | |
1620 | value1 = float(yvalueList[0]) |
|
1636 | value1 = float(yvalueList[0]) | |
1621 | value2 = float(yvalueList[1]) |
|
1637 | value2 = float(yvalueList[1]) | |
1622 | except: |
|
1638 | except: | |
1623 | self.console.clear() |
|
1639 | self.console.clear() | |
1624 | self.console.append("Invalid height range") |
|
1640 | self.console.append("Invalid height range") | |
1625 | return 0 |
|
1641 | return 0 | |
1626 |
|
1642 | |||
1627 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1643 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1628 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1644 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1629 |
|
1645 | |||
1630 | if self.specGraphSavePowerprofile.isChecked(): |
|
1646 | if self.specGraphSavePowerprofile.isChecked(): | |
1631 | checkPath = True |
|
1647 | checkPath = True | |
1632 | opObj.addParameter(name='save', value='1', format='bool') |
|
1648 | opObj.addParameter(name='save', value='1', format='bool') | |
1633 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1649 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1634 | if figfile: |
|
1650 | if figfile: | |
1635 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1651 | opObj.addParameter(name='figfile', value=value, format='str') | |
1636 | if wrperiod: |
|
1652 | if wrperiod: | |
1637 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1653 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1638 |
|
1654 | |||
1639 | if self.specGraphftpPowerprofile.isChecked(): |
|
1655 | if self.specGraphftpPowerprofile.isChecked(): | |
1640 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1656 | opObj.addParameter(name='ftp', value='1', format='int') | |
1641 | self.addFTPConf2Operation(puObj, opObj) |
|
1657 | self.addFTPConf2Operation(puObj, opObj) | |
1642 | addFTP = True |
|
1658 | addFTP = True | |
1643 | # rti noise |
|
1659 | # rti noise | |
1644 |
|
1660 | |||
1645 | if self.specGraphCebRTInoise.isChecked(): |
|
1661 | if self.specGraphCebRTInoise.isChecked(): | |
1646 |
|
1662 | |||
1647 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1663 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1648 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1664 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1649 |
|
1665 | |||
1650 | if not channelList == '': |
|
1666 | if not channelList == '': | |
1651 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1667 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1652 |
|
1668 | |||
1653 | # if not timerange == '': |
|
1669 | # if not timerange == '': | |
1654 | # try: |
|
1670 | # try: | |
1655 | # timerange = float(timerange) |
|
1671 | # timerange = float(timerange) | |
1656 | # except: |
|
1672 | # except: | |
1657 | # self.console.clear() |
|
1673 | # self.console.clear() | |
1658 | # self.console.append("Invalid time range") |
|
1674 | # self.console.append("Invalid time range") | |
1659 | # return 0 |
|
1675 | # return 0 | |
1660 | # |
|
1676 | # | |
1661 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1677 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1662 |
|
1678 | |||
1663 | if not trange == '': |
|
1679 | if not trange == '': | |
1664 | xvalueList = trange.split(',') |
|
1680 | xvalueList = trange.split(',') | |
1665 | try: |
|
1681 | try: | |
1666 | value1 = float(xvalueList[0]) |
|
1682 | value1 = float(xvalueList[0]) | |
1667 | value2 = float(xvalueList[1]) |
|
1683 | value2 = float(xvalueList[1]) | |
1668 | except: |
|
1684 | except: | |
1669 | self.console.clear() |
|
1685 | self.console.clear() | |
1670 | self.console.append("Invalid time range") |
|
1686 | self.console.append("Invalid time range") | |
1671 | return 0 |
|
1687 | return 0 | |
1672 |
|
1688 | |||
1673 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1689 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1674 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1690 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1675 |
|
1691 | |||
1676 | if not db_range == '': |
|
1692 | if not db_range == '': | |
1677 | yvalueList = db_range.split(",") |
|
1693 | yvalueList = db_range.split(",") | |
1678 | try: |
|
1694 | try: | |
1679 | value1 = float(yvalueList[0]) |
|
1695 | value1 = float(yvalueList[0]) | |
1680 | value2 = float(yvalueList[1]) |
|
1696 | value2 = float(yvalueList[1]) | |
1681 | except: |
|
1697 | except: | |
1682 | self.console.clear() |
|
1698 | self.console.clear() | |
1683 | self.console.append("Invalid db range") |
|
1699 | self.console.append("Invalid db range") | |
1684 | return 0 |
|
1700 | return 0 | |
1685 |
|
1701 | |||
1686 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1702 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1687 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1703 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1688 |
|
1704 | |||
1689 | if self.specGraphSaveRTInoise.isChecked(): |
|
1705 | if self.specGraphSaveRTInoise.isChecked(): | |
1690 | checkPath = True |
|
1706 | checkPath = True | |
1691 | opObj.addParameter(name='save', value='1', format='bool') |
|
1707 | opObj.addParameter(name='save', value='1', format='bool') | |
1692 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1708 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1693 | if figfile: |
|
1709 | if figfile: | |
1694 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1710 | opObj.addParameter(name='figfile', value=value, format='str') | |
1695 | if wrperiod: |
|
1711 | if wrperiod: | |
1696 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1712 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1697 |
|
1713 | |||
1698 | # test_ftp |
|
1714 | # test_ftp | |
1699 | if self.specGraphftpRTInoise.isChecked(): |
|
1715 | if self.specGraphftpRTInoise.isChecked(): | |
1700 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1716 | opObj.addParameter(name='ftp', value='1', format='int') | |
1701 | self.addFTPConf2Operation(puObj, opObj) |
|
1717 | self.addFTPConf2Operation(puObj, opObj) | |
1702 | addFTP = True |
|
1718 | addFTP = True | |
1703 |
|
1719 | |||
1704 | if checkPath: |
|
1720 | if checkPath: | |
1705 | if not figpath: |
|
1721 | if not figpath: | |
1706 | self.console.clear() |
|
1722 | self.console.clear() | |
1707 | self.console.append("Graphic path should be defined") |
|
1723 | self.console.append("Graphic path should be defined") | |
1708 | return 0 |
|
1724 | return 0 | |
1709 |
|
1725 | |||
1710 | if addFTP: |
|
1726 | if addFTP and not figpath: | |
1711 | if not figpath: |
|
|||
1712 | self.console.clear() |
|
1727 | self.console.clear() | |
1713 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1728 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1714 | return 0 |
|
1729 | return 0 | |
1715 |
|
1730 | |||
1716 | if not self.temporalFTP.create: |
|
|||
1717 | self.temporalFTP.setwithoutconfiguration() |
|
|||
1718 |
|
||||
1719 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
|||
1720 | self.addFTPProcUnitView(server, username, password, remotefolder, |
|
|||
1721 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
|||
1722 | localfolder=figpath) |
|
|||
1723 | else: |
|
|||
1724 | self.removeFTPProcUnitView() |
|
|||
1725 |
|
||||
1726 | # if something happend |
|
1731 | # if something happend | |
1727 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1732 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1728 | if parms_ok: |
|
1733 | if parms_ok: | |
1729 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1734 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1730 | opObj.addParameter(name='path', value=output_path) |
|
1735 | opObj.addParameter(name='path', value=output_path) | |
1731 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1736 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1732 | opObj.addParameter(name='profilesPerBlock', value=profilesperblock, format='int') |
|
1737 | opObj.addParameter(name='profilesPerBlock', value=profilesperblock, format='int') | |
1733 |
|
1738 | |||
1734 | self.console.clear() |
|
1739 | self.console.clear() | |
1735 | try: |
|
1740 | try: | |
1736 | self.refreshPUProperties(puObj) |
|
1741 | self.refreshPUProperties(puObj) | |
1737 | except: |
|
1742 | except: | |
1738 | self.console.append("Check input parameters") |
|
1743 | self.console.append("Check input parameters") | |
1739 | return 0 |
|
1744 | return 0 | |
1740 |
|
1745 | |||
1741 | self.console.append("If you want to save your project") |
|
1746 | self.console.append("If you want to save your project") | |
1742 | self.console.append("click on your project name in the Tree Project Explorer") |
|
1747 | self.console.append("click on your project name in the Tree Project Explorer") | |
1743 |
|
1748 | |||
1744 | self.actionSaveToolbar.setEnabled(True) |
|
1749 | self.actionSaveToolbar.setEnabled(True) | |
1745 | self.actionStarToolbar.setEnabled(True) |
|
1750 | self.actionStarToolbar.setEnabled(True) | |
1746 |
|
1751 | |||
1747 | return 1 |
|
1752 | return 1 | |
1748 |
|
1753 | |||
1749 | """ |
|
1754 | """ | |
1750 | Spectra Graph |
|
1755 | Spectra Graph | |
1751 | """ |
|
1756 | """ | |
1752 | @pyqtSignature("int") |
|
1757 | @pyqtSignature("int") | |
1753 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1758 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1754 |
|
1759 | |||
1755 | self.__checkSpecGraphFilters() |
|
1760 | self.__checkSpecGraphFilters() | |
1756 |
|
1761 | |||
1757 |
|
1762 | |||
1758 | @pyqtSignature("int") |
|
1763 | @pyqtSignature("int") | |
1759 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1764 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1760 |
|
1765 | |||
1761 | self.__checkSpecGraphFilters() |
|
1766 | self.__checkSpecGraphFilters() | |
1762 |
|
1767 | |||
1763 | @pyqtSignature("int") |
|
1768 | @pyqtSignature("int") | |
1764 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1769 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1765 |
|
1770 | |||
1766 | self.__checkSpecGraphFilters() |
|
1771 | self.__checkSpecGraphFilters() | |
1767 |
|
1772 | |||
1768 |
|
1773 | |||
1769 | @pyqtSignature("int") |
|
1774 | @pyqtSignature("int") | |
1770 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1775 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1771 |
|
1776 | |||
1772 | self.__checkSpecGraphFilters() |
|
1777 | self.__checkSpecGraphFilters() | |
1773 |
|
1778 | |||
1774 |
|
1779 | |||
1775 | @pyqtSignature("int") |
|
1780 | @pyqtSignature("int") | |
1776 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1781 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1777 |
|
1782 | |||
1778 | self.__checkSpecGraphFilters() |
|
1783 | self.__checkSpecGraphFilters() | |
1779 |
|
1784 | |||
1780 | @pyqtSignature("int") |
|
1785 | @pyqtSignature("int") | |
1781 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1786 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1782 |
|
1787 | |||
1783 | self.__checkSpecGraphFilters() |
|
1788 | self.__checkSpecGraphFilters() | |
1784 |
|
1789 | |||
1785 | @pyqtSignature("int") |
|
1790 | @pyqtSignature("int") | |
1786 | def on_specGraphPhase_stateChanged(self, p0): |
|
1791 | def on_specGraphPhase_stateChanged(self, p0): | |
1787 |
|
1792 | |||
1788 | self.__checkSpecGraphFilters() |
|
1793 | self.__checkSpecGraphFilters() | |
1789 |
|
1794 | |||
1790 | @pyqtSignature("int") |
|
1795 | @pyqtSignature("int") | |
1791 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1796 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1792 | """ |
|
1797 | """ | |
1793 | """ |
|
1798 | """ | |
1794 | self.__checkSpecGraphSaving() |
|
1799 | self.__checkSpecGraphSaving() | |
1795 |
|
1800 | |||
1796 | @pyqtSignature("int") |
|
1801 | @pyqtSignature("int") | |
1797 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1802 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1798 |
|
1803 | |||
1799 | self.__checkSpecGraphSaving() |
|
1804 | self.__checkSpecGraphSaving() | |
1800 |
|
1805 | |||
1801 | @pyqtSignature("int") |
|
1806 | @pyqtSignature("int") | |
1802 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1807 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1803 |
|
1808 | |||
1804 | self.__checkSpecGraphSaving() |
|
1809 | self.__checkSpecGraphSaving() | |
1805 |
|
1810 | |||
1806 | @pyqtSignature("int") |
|
1811 | @pyqtSignature("int") | |
1807 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1812 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1808 |
|
1813 | |||
1809 | self.__checkSpecGraphSaving() |
|
1814 | self.__checkSpecGraphSaving() | |
1810 |
|
1815 | |||
1811 | @pyqtSignature("int") |
|
1816 | @pyqtSignature("int") | |
1812 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1817 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1813 |
|
1818 | |||
1814 | self.__checkSpecGraphSaving() |
|
1819 | self.__checkSpecGraphSaving() | |
1815 |
|
1820 | |||
1816 | @pyqtSignature("int") |
|
1821 | @pyqtSignature("int") | |
1817 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1822 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1818 |
|
1823 | |||
1819 | self.__checkSpecGraphSaving() |
|
1824 | self.__checkSpecGraphSaving() | |
1820 |
|
1825 | |||
1821 | @pyqtSignature("int") |
|
1826 | @pyqtSignature("int") | |
1822 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1827 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1823 | """ |
|
1828 | """ | |
1824 | """ |
|
1829 | """ | |
1825 | self.__checkSpecGraphFTP() |
|
1830 | self.__checkSpecGraphFTP() | |
1826 |
|
1831 | |||
1827 |
|
1832 | |||
1828 | @pyqtSignature("int") |
|
1833 | @pyqtSignature("int") | |
1829 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1834 | def on_specGraphftpCross_stateChanged(self, p0): | |
1830 |
|
1835 | |||
1831 | self.__checkSpecGraphFTP() |
|
1836 | self.__checkSpecGraphFTP() | |
1832 |
|
1837 | |||
1833 | @pyqtSignature("int") |
|
1838 | @pyqtSignature("int") | |
1834 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1839 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1835 |
|
1840 | |||
1836 | self.__checkSpecGraphFTP() |
|
1841 | self.__checkSpecGraphFTP() | |
1837 |
|
1842 | |||
1838 | @pyqtSignature("int") |
|
1843 | @pyqtSignature("int") | |
1839 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1844 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1840 |
|
1845 | |||
1841 | self.__checkSpecGraphFTP() |
|
1846 | self.__checkSpecGraphFTP() | |
1842 |
|
1847 | |||
1843 | @pyqtSignature("int") |
|
1848 | @pyqtSignature("int") | |
1844 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1849 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1845 |
|
1850 | |||
1846 | self.__checkSpecGraphFTP() |
|
1851 | self.__checkSpecGraphFTP() | |
1847 |
|
1852 | |||
1848 | @pyqtSignature("int") |
|
1853 | @pyqtSignature("int") | |
1849 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1854 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1850 |
|
1855 | |||
1851 | self.__checkSpecGraphFTP() |
|
1856 | self.__checkSpecGraphFTP() | |
1852 |
|
1857 | |||
1853 | @pyqtSignature("") |
|
1858 | @pyqtSignature("") | |
1854 | def on_specGraphToolPath_clicked(self): |
|
1859 | def on_specGraphToolPath_clicked(self): | |
1855 | """ |
|
1860 | """ | |
1856 | """ |
|
1861 | """ | |
1857 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1862 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1858 | self.specGraphPath.setText(self.savePath) |
|
1863 | self.specGraphPath.setText(self.savePath) | |
1859 | if not os.path.exists(self.savePath): |
|
1864 | if not os.path.exists(self.savePath): | |
1860 | self.console.clear() |
|
1865 | self.console.clear() | |
1861 | self.console.append("Write a correct a path") |
|
1866 | self.console.append("Write a correct a path") | |
1862 | return |
|
1867 | return | |
1863 |
|
1868 | |||
1864 | @pyqtSignature("") |
|
1869 | @pyqtSignature("") | |
1865 | def on_specGraphClear_clicked(self): |
|
1870 | def on_specGraphClear_clicked(self): | |
1866 | return |
|
1871 | return | |
1867 |
|
1872 | |||
1868 | @pyqtSignature("") |
|
1873 | @pyqtSignature("") | |
1869 | def on_specHeisGraphToolPath_clicked(self): |
|
1874 | def on_specHeisGraphToolPath_clicked(self): | |
1870 | """ |
|
1875 | """ | |
1871 | """ |
|
1876 | """ | |
1872 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1877 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1873 | self.specHeisGraphPath.setText(self.savePath) |
|
1878 | self.specHeisGraphPath.setText(self.savePath) | |
1874 | if not os.path.exists(self.savePath): |
|
1879 | if not os.path.exists(self.savePath): | |
1875 | self.console.clear() |
|
1880 | self.console.clear() | |
1876 | self.console.append("Write a correct a path") |
|
1881 | self.console.append("Write a correct a path") | |
1877 | return |
|
1882 | return | |
1878 |
|
1883 | |||
1879 | @pyqtSignature("int") |
|
1884 | @pyqtSignature("int") | |
1880 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
1885 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
1881 | """ |
|
1886 | """ | |
1882 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1887 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1883 | """ |
|
1888 | """ | |
1884 | if p0 == 2: |
|
1889 | if p0 == 2: | |
1885 | self.specHeisOpIncoherent.setEnabled(True) |
|
1890 | self.specHeisOpIncoherent.setEnabled(True) | |
1886 | self.specHeisOpCobIncInt.setEnabled(True) |
|
1891 | self.specHeisOpCobIncInt.setEnabled(True) | |
1887 | if p0 == 0: |
|
1892 | if p0 == 0: | |
1888 | self.specHeisOpIncoherent.setEnabled(False) |
|
1893 | self.specHeisOpIncoherent.setEnabled(False) | |
1889 | self.specHeisOpCobIncInt.setEnabled(False) |
|
1894 | self.specHeisOpCobIncInt.setEnabled(False) | |
1890 |
|
1895 | |||
1891 | @pyqtSignature("") |
|
1896 | @pyqtSignature("") | |
1892 | def on_specHeisOpOk_clicked(self): |
|
1897 | def on_specHeisOpOk_clicked(self): | |
1893 | """ |
|
1898 | """ | |
1894 | AΓADE OPERACION SPECTRAHEIS |
|
1899 | AΓADE OPERACION SPECTRAHEIS | |
1895 | """ |
|
1900 | """ | |
1896 | addFTP = False |
|
1901 | addFTP = False | |
1897 | checkPath = False |
|
1902 | checkPath = False | |
1898 |
|
1903 | |||
1899 | self.actionSaveToolbar.setEnabled(False) |
|
1904 | self.actionSaveToolbar.setEnabled(False) | |
1900 | self.actionStarToolbar.setEnabled(False) |
|
1905 | self.actionStarToolbar.setEnabled(False) | |
1901 |
|
1906 | |||
1902 | puObj = self.getSelectedItemObj() |
|
1907 | puObj = self.getSelectedItemObj() | |
1903 | puObj.removeOperations() |
|
1908 | puObj.removeOperations() | |
1904 |
|
1909 | |||
1905 | if self.specHeisOpCebIncoherent.isChecked(): |
|
1910 | if self.specHeisOpCebIncoherent.isChecked(): | |
1906 | value = self.specHeisOpIncoherent.text() |
|
1911 | value = self.specHeisOpIncoherent.text() | |
1907 | name_operation = 'IncohInt4SpectraHeis' |
|
1912 | name_operation = 'IncohInt4SpectraHeis' | |
1908 | optype = 'other' |
|
1913 | optype = 'other' | |
1909 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1914 | if self.specOpCobIncInt.currentIndex() == 0: | |
1910 | name_parameter = 'timeInterval' |
|
1915 | name_parameter = 'timeInterval' | |
1911 | format = 'float' |
|
1916 | format = 'float' | |
1912 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1917 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1913 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1918 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1914 |
|
1919 | |||
1915 | # ---- Spectra Plot----- |
|
1920 | # ---- Spectra Plot----- | |
1916 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
1921 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
1917 | name_operation = 'SpectraHeisScope' |
|
1922 | name_operation = 'SpectraHeisScope' | |
1918 | optype = 'other' |
|
1923 | optype = 'other' | |
1919 | name_parameter = 'type' |
|
1924 | name_parameter = 'type' | |
1920 | value = 'SpectraHeisScope' |
|
1925 | value = 'SpectraHeisScope' | |
1921 | format = 'str' |
|
1926 | format = 'str' | |
1922 | if self.idImagspectraHeis == 0: |
|
1927 | if self.idImagspectraHeis == 0: | |
1923 | self.idImagspectraHeis = 800 |
|
1928 | self.idImagspectraHeis = 800 | |
1924 | else: |
|
1929 | else: | |
1925 | self.idImagspectraHeis = self.idImagspectraHeis + 1 |
|
1930 | self.idImagspectraHeis = self.idImagspectraHeis + 1 | |
1926 | name_parameter1 = 'id' |
|
1931 | name_parameter1 = 'id' | |
1927 | value1 = int(self.idImagspectraHeis) |
|
1932 | value1 = int(self.idImagspectraHeis) | |
1928 | format1 = 'int' |
|
1933 | format1 = 'int' | |
1929 |
|
1934 | |||
1930 | format = 'str' |
|
1935 | format = 'str' | |
1931 |
|
1936 | |||
1932 | channelList = self.specHeisGgraphChannelList.text() |
|
1937 | channelList = self.specHeisGgraphChannelList.text() | |
1933 | xvalue = self.specHeisGgraphXminXmax.text() |
|
1938 | xvalue = self.specHeisGgraphXminXmax.text() | |
1934 | yvalue = self.specHeisGgraphYminYmax.text() |
|
1939 | yvalue = self.specHeisGgraphYminYmax.text() | |
1935 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1940 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1936 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1941 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1937 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
1942 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) | |
1938 |
|
1943 | |||
1939 | if not channelList == '': |
|
1944 | if not channelList == '': | |
1940 | name_parameter = 'channelList' |
|
1945 | name_parameter = 'channelList' | |
1941 | format = 'intlist' |
|
1946 | format = 'intlist' | |
1942 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
1947 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
1943 |
|
1948 | |||
1944 | if not xvalue == '': |
|
1949 | if not xvalue == '': | |
1945 | xvalueList = xvalue.split(',') |
|
1950 | xvalueList = xvalue.split(',') | |
1946 | try: |
|
1951 | try: | |
1947 | value1 = float(xvalueList[0]) |
|
1952 | value1 = float(xvalueList[0]) | |
1948 | value2 = float(xvalueList[1]) |
|
1953 | value2 = float(xvalueList[1]) | |
1949 | except: |
|
1954 | except: | |
1950 | self.console.clear() |
|
1955 | self.console.clear() | |
1951 | self.console.append("Please Write corrects parameter xmin-xmax") |
|
1956 | self.console.append("Please Write corrects parameter xmin-xmax") | |
1952 | return 0 |
|
1957 | return 0 | |
1953 | name1 = 'xmin' |
|
1958 | name1 = 'xmin' | |
1954 | name2 = 'xmax' |
|
1959 | name2 = 'xmax' | |
1955 | format = 'float' |
|
1960 | format = 'float' | |
1956 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1961 | opObj.addParameter(name=name1, value=value1, format=format) | |
1957 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1962 | opObj.addParameter(name=name2, value=value2, format=format) | |
1958 | #------specHeisGgraphYmin-Ymax--- |
|
1963 | #------specHeisGgraphYmin-Ymax--- | |
1959 | if not yvalue == '': |
|
1964 | if not yvalue == '': | |
1960 | yvalueList = yvalue.split(",") |
|
1965 | yvalueList = yvalue.split(",") | |
1961 | try: |
|
1966 | try: | |
1962 | value1 = float(yvalueList[0]) |
|
1967 | value1 = float(yvalueList[0]) | |
1963 | value2 = float(yvalueList[1]) |
|
1968 | value2 = float(yvalueList[1]) | |
1964 | except: |
|
1969 | except: | |
1965 | self.console.clear() |
|
1970 | self.console.clear() | |
1966 | self.console.append("Please Write corrects parameter Ymix-Ymax") |
|
1971 | self.console.append("Please Write corrects parameter Ymix-Ymax") | |
1967 | return 0 |
|
1972 | return 0 | |
1968 | name1 = 'ymin' |
|
1973 | name1 = 'ymin' | |
1969 | name2 = 'ymax' |
|
1974 | name2 = 'ymax' | |
1970 | format = 'float' |
|
1975 | format = 'float' | |
1971 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1976 | opObj.addParameter(name=name1, value=value1, format=format) | |
1972 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1977 | opObj.addParameter(name=name2, value=value2, format=format) | |
1973 |
|
1978 | |||
1974 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
1979 | if self.specHeisGraphSaveSpectra.isChecked(): | |
1975 | checkPath = True |
|
1980 | checkPath = True | |
1976 | name_parameter1 = 'save' |
|
1981 | name_parameter1 = 'save' | |
1977 | name_parameter2 = 'figpath' |
|
1982 | name_parameter2 = 'figpath' | |
1978 | name_parameter3 = 'figfile' |
|
1983 | name_parameter3 = 'figfile' | |
1979 | value1 = '1' |
|
1984 | value1 = '1' | |
1980 | value2 = self.specHeisGraphPath.text() |
|
1985 | value2 = self.specHeisGraphPath.text() | |
1981 | value3 = self.specHeisGraphPrefix.text() |
|
1986 | value3 = self.specHeisGraphPrefix.text() | |
1982 | format1 = 'bool' |
|
1987 | format1 = 'bool' | |
1983 | format2 = 'str' |
|
1988 | format2 = 'str' | |
1984 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
1989 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
1985 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
1990 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
1986 | if not value3 == "": |
|
1991 | if not value3 == "": | |
1987 | try: |
|
1992 | try: | |
1988 | value3 = str(self.specHeisGraphPrefix.text()) |
|
1993 | value3 = str(self.specHeisGraphPrefix.text()) | |
1989 | except: |
|
1994 | except: | |
1990 | self.console.clear() |
|
1995 | self.console.clear() | |
1991 | self.console.append("Please Write prefix") |
|
1996 | self.console.append("Please Write prefix") | |
1992 | return 0 |
|
1997 | return 0 | |
1993 | opObj.addParameter(name='figfile', value=self.specHeisGraphPrefix.text(), format='str') |
|
1998 | opObj.addParameter(name='figfile', value=self.specHeisGraphPrefix.text(), format='str') | |
1994 |
|
1999 | |||
1995 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2000 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
1996 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2001 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
1997 |
|
2002 | |||
1998 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2003 | if self.specHeisGraphftpSpectra.isChecked(): | |
1999 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2004 | opObj.addParameter(name='ftp', value='1', format='int') | |
2000 | self.addFTPConf2Operation(puObj, opObj) |
|
2005 | self.addFTPConf2Operation(puObj, opObj) | |
2001 | addFTP = True |
|
2006 | addFTP = True | |
2002 |
|
2007 | |||
2003 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2008 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2004 | name_operation = 'RTIfromSpectraHeis' |
|
2009 | name_operation = 'RTIfromSpectraHeis' | |
2005 | optype = 'other' |
|
2010 | optype = 'other' | |
2006 | name_parameter = 'type' |
|
2011 | name_parameter = 'type' | |
2007 | value = 'RTIfromSpectraHeis' |
|
2012 | value = 'RTIfromSpectraHeis' | |
2008 | format = 'str' |
|
2013 | format = 'str' | |
2009 |
|
2014 | |||
2010 | if self.idImagrtiHeis == 0: |
|
2015 | if self.idImagrtiHeis == 0: | |
2011 | self.idImagrtiHeis = 900 |
|
2016 | self.idImagrtiHeis = 900 | |
2012 | else: |
|
2017 | else: | |
2013 | self.idImagrtiHeis = self.idImagrtiHeis + 1 |
|
2018 | self.idImagrtiHeis = self.idImagrtiHeis + 1 | |
2014 |
|
2019 | |||
2015 | name_parameter1 = 'id' |
|
2020 | name_parameter1 = 'id' | |
2016 | value1 = int(self.idImagrtiHeis) |
|
2021 | value1 = int(self.idImagrtiHeis) | |
2017 | format1 = 'int' |
|
2022 | format1 = 'int' | |
2018 |
|
2023 | |||
2019 | format = 'str' |
|
2024 | format = 'str' | |
2020 |
|
2025 | |||
2021 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2026 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2022 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2027 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
2023 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
2028 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) | |
2024 |
|
2029 | |||
2025 | channelList = self.specHeisGgraphChannelList.text() |
|
2030 | channelList = self.specHeisGgraphChannelList.text() | |
2026 | xvalue = self.specHeisGgraphTminTmax.text() |
|
2031 | xvalue = self.specHeisGgraphTminTmax.text() | |
2027 | yvalue = self.specHeisGgraphYminYmax.text() |
|
2032 | yvalue = self.specHeisGgraphYminYmax.text() | |
2028 | timerange = self.specHeisGgraphTimeRange.text() |
|
2033 | timerange = self.specHeisGgraphTimeRange.text() | |
2029 |
|
2034 | |||
2030 | if not channelList == '': |
|
2035 | if not channelList == '': | |
2031 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2036 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2032 |
|
2037 | |||
2033 | if not xvalue == '': |
|
2038 | if not xvalue == '': | |
2034 | xvalueList = xvalue.split(',') |
|
2039 | xvalueList = xvalue.split(',') | |
2035 | try: |
|
2040 | try: | |
2036 | value = float(xvalueList[0]) |
|
2041 | value = float(xvalueList[0]) | |
2037 | value = float(xvalueList[1]) |
|
2042 | value = float(xvalueList[1]) | |
2038 | except: |
|
2043 | except: | |
2039 | return 0 |
|
2044 | return 0 | |
2040 | format = 'float' |
|
2045 | format = 'float' | |
2041 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2046 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2042 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2047 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2043 |
|
2048 | |||
2044 | if not timerange == '': |
|
2049 | if not timerange == '': | |
2045 | format = 'int' |
|
2050 | format = 'int' | |
2046 | try: |
|
2051 | try: | |
2047 | timerange = int(timerange) |
|
2052 | timerange = int(timerange) | |
2048 | except: |
|
2053 | except: | |
2049 | return 0 |
|
2054 | return 0 | |
2050 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2055 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2051 |
|
2056 | |||
2052 |
|
2057 | |||
2053 | if not yvalue == '': |
|
2058 | if not yvalue == '': | |
2054 | yvalueList = yvalue.split(",") |
|
2059 | yvalueList = yvalue.split(",") | |
2055 | try: |
|
2060 | try: | |
2056 | value = float(yvalueList[0]) |
|
2061 | value = float(yvalueList[0]) | |
2057 | value = float(yvalueList[1]) |
|
2062 | value = float(yvalueList[1]) | |
2058 | except: |
|
2063 | except: | |
2059 | return 0 |
|
2064 | return 0 | |
2060 | format = 'float' |
|
2065 | format = 'float' | |
2061 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2066 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2062 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2067 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2063 |
|
2068 | |||
2064 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2069 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2065 | checkPath = True |
|
2070 | checkPath = True | |
2066 | opObj.addParameter(name='save', value='1', format='bool') |
|
2071 | opObj.addParameter(name='save', value='1', format='bool') | |
2067 | opObj.addParameter(name='figpath', value=self.specHeisGraphPath.text(), format='str') |
|
2072 | opObj.addParameter(name='figpath', value=self.specHeisGraphPath.text(), format='str') | |
2068 | value = self.specHeisGraphPrefix.text() |
|
2073 | value = self.specHeisGraphPrefix.text() | |
2069 | if not value == "": |
|
2074 | if not value == "": | |
2070 | try: |
|
2075 | try: | |
2071 | value = str(self.specHeisGraphPrefix.text()) |
|
2076 | value = str(self.specHeisGraphPrefix.text()) | |
2072 | except: |
|
2077 | except: | |
2073 | self.console.clear() |
|
2078 | self.console.clear() | |
2074 | self.console.append("Please Write prefix") |
|
2079 | self.console.append("Please Write prefix") | |
2075 | return 0 |
|
2080 | return 0 | |
2076 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2081 | opObj.addParameter(name='figfile', value=value, format='str') | |
2077 |
|
2082 | |||
2078 | # test_ftp |
|
2083 | # test_ftp | |
2079 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2084 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2080 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2085 | opObj.addParameter(name='ftp', value='1', format='int') | |
2081 | self.addFTPConf2Operation(puObj, opObj) |
|
2086 | self.addFTPConf2Operation(puObj, opObj) | |
2082 | addFTP = True |
|
2087 | addFTP = True | |
2083 |
|
2088 | |||
2084 | localfolder = None |
|
2089 | localfolder = None | |
2085 | if checkPath: |
|
2090 | if checkPath: | |
2086 | localfolder = str(self.specGraphPath.text()) |
|
2091 | localfolder = str(self.specGraphPath.text()) | |
2087 | if localfolder == '': |
|
2092 | if localfolder == '': | |
2088 | self.console.clear() |
|
2093 | self.console.clear() | |
2089 | self.console.append("Graphic path should be defined") |
|
2094 | self.console.append("Graphic path should be defined") | |
2090 | return 0 |
|
2095 | return 0 | |
2091 |
|
2096 | |||
2092 | if addFTP: |
|
2097 | if addFTP and not localfolder: | |
2093 | if not localfolder: |
|
|||
2094 | self.console.clear() |
|
2098 | self.console.clear() | |
2095 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
2099 | self.console.append("You have to save the plots before sending them to FTP Server") | |
2096 | return 0 |
|
2100 | return 0 | |
2097 |
|
2101 | |||
2098 | if not self.temporalFTP.create: |
|
|||
2099 | self.temporalFTP.setwithoutconfiguration() |
|
|||
2100 |
|
||||
2101 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
|||
2102 | self.addFTPProcUnitView(server, username, password, remotefolder, |
|
|||
2103 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
|||
2104 | localfolder=localfolder) |
|
|||
2105 | else: |
|
|||
2106 | self.removeFTPProcUnitView() |
|
|||
2107 |
|
||||
2108 | # if something happened |
|
2102 | # if something happened | |
2109 | parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2103 | parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') | |
2110 | if parms_ok: |
|
2104 | if parms_ok: | |
2111 | name_operation = 'FitsWriter' |
|
2105 | name_operation = 'FitsWriter' | |
2112 | optype = 'other' |
|
2106 | optype = 'other' | |
2113 | name_parameter1 = 'path' |
|
2107 | name_parameter1 = 'path' | |
2114 | name_parameter2 = 'dataBlocksPerFile' |
|
2108 | name_parameter2 = 'dataBlocksPerFile' | |
2115 | name_parameter3 = 'metadatafile' |
|
2109 | name_parameter3 = 'metadatafile' | |
2116 | value1 = output_path |
|
2110 | value1 = output_path | |
2117 | value2 = blocksperfile |
|
2111 | value2 = blocksperfile | |
2118 | value3 = metada |
|
2112 | value3 = metada | |
2119 | format2 = "int" |
|
2113 | format2 = "int" | |
2120 | format3 = "str" |
|
2114 | format3 = "str" | |
2121 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2115 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2122 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2116 | opObj.addParameter(name=name_parameter1, value=value1) | |
2123 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2117 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2124 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2118 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2125 |
|
2119 | |||
2126 | self.console.clear() |
|
2120 | self.console.clear() | |
2127 | try: |
|
2121 | try: | |
2128 | self.refreshPUProperties(puObj) |
|
2122 | self.refreshPUProperties(puObj) | |
2129 | except: |
|
2123 | except: | |
2130 | self.console.append("Check input parameters") |
|
2124 | self.console.append("Check input parameters") | |
2131 | return 0 |
|
2125 | return 0 | |
2132 |
|
2126 | |||
2133 | self.console.append("Click on save icon ff you want to save your project") |
|
2127 | self.console.append("Click on save icon ff you want to save your project") | |
2134 |
|
2128 | |||
2135 | self.actionSaveToolbar.setEnabled(True) |
|
2129 | self.actionSaveToolbar.setEnabled(True) | |
2136 | self.actionStarToolbar.setEnabled(True) |
|
2130 | self.actionStarToolbar.setEnabled(True) | |
2137 |
|
2131 | |||
2138 | return 1 |
|
2132 | return 1 | |
2139 | @pyqtSignature("int") |
|
2133 | @pyqtSignature("int") | |
2140 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2134 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2141 |
|
2135 | |||
2142 | if p0 == 2: |
|
2136 | if p0 == 2: | |
2143 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2137 | self.specHeisGgraphChannelList.setEnabled(True) | |
2144 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2138 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2145 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2139 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2146 | if p0 == 0: |
|
2140 | if p0 == 0: | |
2147 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2141 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2148 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2142 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2149 |
|
2143 | |||
2150 | @pyqtSignature("int") |
|
2144 | @pyqtSignature("int") | |
2151 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2145 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2152 |
|
2146 | |||
2153 | if p0 == 2: |
|
2147 | if p0 == 2: | |
2154 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2148 | self.specHeisGgraphChannelList.setEnabled(True) | |
2155 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2149 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2156 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2150 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2157 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2151 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2158 |
|
2152 | |||
2159 | if p0 == 0: |
|
2153 | if p0 == 0: | |
2160 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2154 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2161 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2155 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2162 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2156 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2163 |
|
2157 | |||
2164 | @pyqtSignature("int") |
|
2158 | @pyqtSignature("int") | |
2165 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2159 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2166 | """ |
|
2160 | """ | |
2167 | """ |
|
2161 | """ | |
2168 | if p0 == 2: |
|
2162 | if p0 == 2: | |
2169 | self.specHeisGraphPath.setEnabled(True) |
|
2163 | self.specHeisGraphPath.setEnabled(True) | |
2170 | self.specHeisGraphPrefix.setEnabled(True) |
|
2164 | self.specHeisGraphPrefix.setEnabled(True) | |
2171 | self.specHeisGraphToolPath.setEnabled(True) |
|
2165 | self.specHeisGraphToolPath.setEnabled(True) | |
2172 | if p0 == 0: |
|
2166 | if p0 == 0: | |
2173 | self.specHeisGraphPath.setEnabled(False) |
|
2167 | self.specHeisGraphPath.setEnabled(False) | |
2174 | self.specHeisGraphPrefix.setEnabled(False) |
|
2168 | self.specHeisGraphPrefix.setEnabled(False) | |
2175 | self.specHeisGraphToolPath.setEnabled(False) |
|
2169 | self.specHeisGraphToolPath.setEnabled(False) | |
2176 |
|
2170 | |||
2177 | @pyqtSignature("int") |
|
2171 | @pyqtSignature("int") | |
2178 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2172 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2179 | if p0 == 2: |
|
2173 | if p0 == 2: | |
2180 | self.specHeisGraphPath.setEnabled(True) |
|
2174 | self.specHeisGraphPath.setEnabled(True) | |
2181 | self.specHeisGraphPrefix.setEnabled(True) |
|
2175 | self.specHeisGraphPrefix.setEnabled(True) | |
2182 | self.specHeisGraphToolPath.setEnabled(True) |
|
2176 | self.specHeisGraphToolPath.setEnabled(True) | |
2183 |
|
2177 | |||
2184 | @pyqtSignature("int") |
|
2178 | @pyqtSignature("int") | |
2185 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2179 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2186 | """ |
|
2180 | """ | |
2187 | """ |
|
2181 | """ | |
2188 | if p0 == 2: |
|
2182 | if p0 == 2: | |
2189 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2183 | self.specHeisGgraphftpratio.setEnabled(True) | |
2190 |
|
2184 | |||
2191 | if p0 == 0: |
|
2185 | if p0 == 0: | |
2192 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2186 | self.specHeisGgraphftpratio.setEnabled(False) | |
2193 |
|
2187 | |||
2194 | @pyqtSignature("int") |
|
2188 | @pyqtSignature("int") | |
2195 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2189 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2196 | if p0 == 2: |
|
2190 | if p0 == 2: | |
2197 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2191 | self.specHeisGgraphftpratio.setEnabled(True) | |
2198 |
|
2192 | |||
2199 | @pyqtSignature("") |
|
2193 | @pyqtSignature("") | |
2200 | def on_specHeisGraphClear_clicked(self): |
|
2194 | def on_specHeisGraphClear_clicked(self): | |
2201 | pass |
|
2195 | pass | |
2202 |
|
2196 | |||
2203 | def __checkSpecGraphSaving(self): |
|
2197 | def __checkSpecGraphSaving(self): | |
2204 |
|
2198 | |||
2205 | enable = False |
|
2199 | enable = False | |
2206 |
|
2200 | |||
2207 | if self.specGraphSaveSpectra.checkState(): |
|
2201 | if self.specGraphSaveSpectra.checkState(): | |
2208 | enable = True |
|
2202 | enable = True | |
2209 |
|
2203 | |||
2210 | if self.specGraphSaveCross.checkState(): |
|
2204 | if self.specGraphSaveCross.checkState(): | |
2211 | enable = True |
|
2205 | enable = True | |
2212 |
|
2206 | |||
2213 | if self.specGraphSaveRTIplot.checkState(): |
|
2207 | if self.specGraphSaveRTIplot.checkState(): | |
2214 | enable = True |
|
2208 | enable = True | |
2215 |
|
2209 | |||
2216 | if self.specGraphSaveCoherencemap.checkState(): |
|
2210 | if self.specGraphSaveCoherencemap.checkState(): | |
2217 | enable = True |
|
2211 | enable = True | |
2218 |
|
2212 | |||
2219 | if self.specGraphSavePowerprofile.checkState(): |
|
2213 | if self.specGraphSavePowerprofile.checkState(): | |
2220 | enable = True |
|
2214 | enable = True | |
2221 |
|
2215 | |||
2222 | if self.specGraphSaveRTInoise.checkState(): |
|
2216 | if self.specGraphSaveRTInoise.checkState(): | |
2223 | enable = True |
|
2217 | enable = True | |
2224 |
|
2218 | |||
2225 | self.specGraphPath.setEnabled(enable) |
|
2219 | self.specGraphPath.setEnabled(enable) | |
2226 | self.specGraphPrefix.setEnabled(enable) |
|
2220 | self.specGraphPrefix.setEnabled(enable) | |
2227 | self.specGraphToolPath.setEnabled(enable) |
|
2221 | self.specGraphToolPath.setEnabled(enable) | |
2228 |
|
2222 | |||
2229 | self.specGgraphftpratio.setEnabled(enable) |
|
2223 | self.specGgraphftpratio.setEnabled(enable) | |
2230 |
|
2224 | |||
2231 | def __checkSpecGraphFTP(self): |
|
2225 | def __checkSpecGraphFTP(self): | |
2232 |
|
2226 | |||
2233 | enable = False |
|
2227 | enable = False | |
2234 |
|
2228 | |||
2235 | if self.specGraphftpSpectra.checkState(): |
|
2229 | if self.specGraphftpSpectra.checkState(): | |
2236 | enable = True |
|
2230 | enable = True | |
2237 |
|
2231 | |||
2238 | if self.specGraphftpCross.checkState(): |
|
2232 | if self.specGraphftpCross.checkState(): | |
2239 | enable = True |
|
2233 | enable = True | |
2240 |
|
2234 | |||
2241 | if self.specGraphftpRTIplot.checkState(): |
|
2235 | if self.specGraphftpRTIplot.checkState(): | |
2242 | enable = True |
|
2236 | enable = True | |
2243 |
|
2237 | |||
2244 | if self.specGraphftpCoherencemap.checkState(): |
|
2238 | if self.specGraphftpCoherencemap.checkState(): | |
2245 | enable = True |
|
2239 | enable = True | |
2246 |
|
2240 | |||
2247 | if self.specGraphftpPowerprofile.checkState(): |
|
2241 | if self.specGraphftpPowerprofile.checkState(): | |
2248 | enable = True |
|
2242 | enable = True | |
2249 |
|
2243 | |||
2250 | if self.specGraphftpRTInoise.checkState(): |
|
2244 | if self.specGraphftpRTInoise.checkState(): | |
2251 | enable = True |
|
2245 | enable = True | |
2252 |
|
2246 | |||
2253 | # self.specGgraphftpratio.setEnabled(enable) |
|
2247 | # self.specGgraphftpratio.setEnabled(enable) | |
2254 |
|
2248 | |||
2255 | def __checkSpecGraphFilters(self): |
|
2249 | def __checkSpecGraphFilters(self): | |
2256 |
|
2250 | |||
2257 | freq = False |
|
2251 | freq = False | |
2258 | height = False |
|
2252 | height = False | |
2259 | db = False |
|
2253 | db = False | |
2260 | time = False |
|
2254 | time = False | |
2261 | magnitud = False |
|
2255 | magnitud = False | |
2262 | phase = False |
|
2256 | phase = False | |
2263 | channelList = False |
|
2257 | channelList = False | |
2264 |
|
2258 | |||
2265 | if self.specGraphCebSpectraplot.checkState(): |
|
2259 | if self.specGraphCebSpectraplot.checkState(): | |
2266 | freq = True |
|
2260 | freq = True | |
2267 | height = True |
|
2261 | height = True | |
2268 | db = True |
|
2262 | db = True | |
2269 | channelList = True |
|
2263 | channelList = True | |
2270 |
|
2264 | |||
2271 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2265 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2272 | freq = True |
|
2266 | freq = True | |
2273 | height = True |
|
2267 | height = True | |
2274 | db = True |
|
2268 | db = True | |
2275 | magnitud = True |
|
2269 | magnitud = True | |
2276 | phase = True |
|
2270 | phase = True | |
2277 |
|
2271 | |||
2278 | if self.specGraphCebRTIplot.checkState(): |
|
2272 | if self.specGraphCebRTIplot.checkState(): | |
2279 | height = True |
|
2273 | height = True | |
2280 | db = True |
|
2274 | db = True | |
2281 | time = True |
|
2275 | time = True | |
2282 | channelList = True |
|
2276 | channelList = True | |
2283 |
|
2277 | |||
2284 | if self.specGraphCebCoherencmap.checkState(): |
|
2278 | if self.specGraphCebCoherencmap.checkState(): | |
2285 | height = True |
|
2279 | height = True | |
2286 | time = True |
|
2280 | time = True | |
2287 | magnitud = True |
|
2281 | magnitud = True | |
2288 | phase = True |
|
2282 | phase = True | |
2289 |
|
2283 | |||
2290 | if self.specGraphPowerprofile.checkState(): |
|
2284 | if self.specGraphPowerprofile.checkState(): | |
2291 | height = True |
|
2285 | height = True | |
2292 | db = True |
|
2286 | db = True | |
2293 | channelList = True |
|
2287 | channelList = True | |
2294 |
|
2288 | |||
2295 | if self.specGraphCebRTInoise.checkState(): |
|
2289 | if self.specGraphCebRTInoise.checkState(): | |
2296 | db = True |
|
2290 | db = True | |
2297 | time = True |
|
2291 | time = True | |
2298 | channelList = True |
|
2292 | channelList = True | |
2299 |
|
2293 | |||
2300 |
|
2294 | |||
2301 | self.specGgraphFreq.setEnabled(freq) |
|
2295 | self.specGgraphFreq.setEnabled(freq) | |
2302 | self.specGgraphHeight.setEnabled(height) |
|
2296 | self.specGgraphHeight.setEnabled(height) | |
2303 | self.specGgraphDbsrange.setEnabled(db) |
|
2297 | self.specGgraphDbsrange.setEnabled(db) | |
2304 | self.specGgraphTminTmax.setEnabled(time) |
|
2298 | self.specGgraphTminTmax.setEnabled(time) | |
2305 |
|
2299 | |||
2306 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2300 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2307 | self.specGgraphPhase.setEnabled(phase) |
|
2301 | self.specGgraphPhase.setEnabled(phase) | |
2308 | self.specGgraphChannelList.setEnabled(channelList) |
|
2302 | self.specGgraphChannelList.setEnabled(channelList) | |
2309 |
|
2303 | |||
2310 | def __getParmsFromProjectWindow(self): |
|
2304 | def __getParmsFromProjectWindow(self): | |
2311 | """ |
|
2305 | """ | |
2312 | Check Inputs Project: |
|
2306 | Check Inputs Project: | |
2313 | - project_name |
|
2307 | - project_name | |
2314 | - datatype |
|
2308 | - datatype | |
2315 | - ext |
|
2309 | - ext | |
2316 | - data_path |
|
2310 | - data_path | |
2317 | - readmode |
|
2311 | - readmode | |
2318 | - delay |
|
2312 | - delay | |
2319 | - set |
|
2313 | - set | |
2320 | - walk |
|
2314 | - walk | |
2321 | """ |
|
2315 | """ | |
2322 | parms_ok = True |
|
2316 | parms_ok = True | |
2323 |
|
2317 | |||
2324 | project_name = str(self.proName.text()) |
|
2318 | project_name = str(self.proName.text()) | |
2325 |
|
2319 | |||
2326 | if project_name == '' or project_name == None: |
|
2320 | if project_name == '' or project_name == None: | |
2327 | outputstr = "Enter a project Name" |
|
2321 | outputstr = "Enter a project Name" | |
2328 | self.console.append(outputstr) |
|
2322 | self.console.append(outputstr) | |
2329 | parms_ok = False |
|
2323 | parms_ok = False | |
2330 | project_name = None |
|
2324 | project_name = None | |
2331 |
|
2325 | |||
2332 | description = str(self.proDescription.toPlainText()) |
|
2326 | description = str(self.proDescription.toPlainText()) | |
2333 |
|
2327 | |||
2334 | datatype = str(self.proComDataType.currentText()) |
|
2328 | datatype = str(self.proComDataType.currentText()) | |
2335 |
|
2329 | |||
2336 | ext = str(self.proDataType.text()) |
|
2330 | ext = str(self.proDataType.text()) | |
2337 |
|
2331 | |||
2338 | dpath = str(self.proDataPath.text()) |
|
2332 | dpath = str(self.proDataPath.text()) | |
2339 |
|
2333 | |||
2340 | if dpath == '': |
|
2334 | if dpath == '': | |
2341 | outputstr = 'Datapath is empty' |
|
2335 | outputstr = 'Datapath is empty' | |
2342 | self.console.append(outputstr) |
|
2336 | self.console.append(outputstr) | |
2343 | parms_ok = False |
|
2337 | parms_ok = False | |
2344 | dpath = None |
|
2338 | dpath = None | |
2345 |
|
2339 | |||
2346 | if dpath != None: |
|
2340 | if dpath != None: | |
2347 | if not os.path.isdir(dpath): |
|
2341 | if not os.path.isdir(dpath): | |
2348 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2342 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2349 | self.console.append(outputstr) |
|
2343 | self.console.append(outputstr) | |
2350 | parms_ok = False |
|
2344 | parms_ok = False | |
2351 | dpath = None |
|
2345 | dpath = None | |
2352 |
|
2346 | |||
2353 | online = int(self.proComReadMode.currentIndex()) |
|
2347 | online = int(self.proComReadMode.currentIndex()) | |
2354 |
|
2348 | |||
2355 | delay = None |
|
2349 | delay = None | |
2356 | if online==1: |
|
2350 | if online==1: | |
2357 | try: |
|
2351 | try: | |
2358 | delay = int(str(self.proDelay.text())) |
|
2352 | delay = int(str(self.proDelay.text())) | |
2359 | except: |
|
2353 | except: | |
2360 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2354 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2361 | self.console.append(outputstr) |
|
2355 | self.console.append(outputstr) | |
2362 | parms_ok = False |
|
2356 | parms_ok = False | |
2363 |
|
2357 | |||
2364 |
|
2358 | |||
2365 | set = None |
|
2359 | set = None | |
2366 | value = str(self.proSet.text()) |
|
2360 | value = str(self.proSet.text()) | |
2367 | try: |
|
2361 | try: | |
2368 | set = int(value) |
|
2362 | set = int(value) | |
2369 | except: |
|
2363 | except: | |
2370 | pass |
|
2364 | pass | |
2371 |
|
2365 | |||
2372 | ippKm = None |
|
2366 | ippKm = None | |
2373 |
|
2367 | |||
2374 | value = str(self.proIPPKm.text()) |
|
2368 | value = str(self.proIPPKm.text()) | |
2375 |
|
2369 | |||
2376 | try: |
|
2370 | try: | |
2377 | ippKm = float(value) |
|
2371 | ippKm = float(value) | |
2378 | except: |
|
2372 | except: | |
2379 | if datatype=="USRP": |
|
2373 | if datatype=="USRP": | |
2380 | outputstr = 'IPP value (%s) must be a float number' % str(self.proIPPKm.text()) |
|
2374 | outputstr = 'IPP value (%s) must be a float number' % str(self.proIPPKm.text()) | |
2381 | self.console.append(outputstr) |
|
2375 | self.console.append(outputstr) | |
2382 | parms_ok = False |
|
2376 | parms_ok = False | |
2383 |
|
2377 | |||
2384 | walk = int(self.proComWalk.currentIndex()) |
|
2378 | walk = int(self.proComWalk.currentIndex()) | |
2385 |
|
2379 | |||
2386 | startDate = str(self.proComStartDate.currentText()) |
|
2380 | startDate = str(self.proComStartDate.currentText()) | |
2387 | endDate = str(self.proComEndDate.currentText()) |
|
2381 | endDate = str(self.proComEndDate.currentText()) | |
2388 |
|
2382 | |||
2389 | # startDateList = startDate.split("/") |
|
2383 | # startDateList = startDate.split("/") | |
2390 | # endDateList = endDate.split("/") |
|
2384 | # endDateList = endDate.split("/") | |
2391 | # |
|
2385 | # | |
2392 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2386 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2393 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2387 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2394 |
|
2388 | |||
2395 | startTime = self.proStartTime.time() |
|
2389 | startTime = self.proStartTime.time() | |
2396 | endTime = self.proEndTime.time() |
|
2390 | endTime = self.proEndTime.time() | |
2397 |
|
2391 | |||
2398 | startTime = str(startTime.toString("H:m:s")) |
|
2392 | startTime = str(startTime.toString("H:m:s")) | |
2399 | endTime = str(endTime.toString("H:m:s")) |
|
2393 | endTime = str(endTime.toString("H:m:s")) | |
2400 |
|
2394 | |||
2401 | projectParms = ProjectParms() |
|
2395 | projectParms = ProjectParms() | |
2402 |
|
2396 | |||
2403 | projectParms.name = project_name |
|
2397 | projectParms.name = project_name | |
2404 | projectParms.description = description |
|
2398 | projectParms.description = description | |
2405 | projectParms.datatype = datatype |
|
2399 | projectParms.datatype = datatype | |
2406 | projectParms.ext = ext |
|
2400 | projectParms.ext = ext | |
2407 | projectParms.dpath = dpath |
|
2401 | projectParms.dpath = dpath | |
2408 | projectParms.online = online |
|
2402 | projectParms.online = online | |
2409 | projectParms.startDate = startDate |
|
2403 | projectParms.startDate = startDate | |
2410 | projectParms.endDate = endDate |
|
2404 | projectParms.endDate = endDate | |
2411 | projectParms.startTime = startTime |
|
2405 | projectParms.startTime = startTime | |
2412 | projectParms.endTime = endTime |
|
2406 | projectParms.endTime = endTime | |
2413 | projectParms.delay=delay |
|
2407 | projectParms.delay=delay | |
2414 | projectParms.walk=walk |
|
2408 | projectParms.walk=walk | |
2415 | projectParms.set=set |
|
2409 | projectParms.set=set | |
2416 | projectParms.ippKm=ippKm |
|
2410 | projectParms.ippKm=ippKm | |
2417 | projectParms.parmsOk=parms_ok |
|
2411 | projectParms.parmsOk=parms_ok | |
2418 |
|
2412 | |||
2419 | return projectParms |
|
2413 | return projectParms | |
2420 |
|
2414 | |||
2421 |
|
2415 | |||
2422 | def __getParmsFromProjectObj(self, projectObjView): |
|
2416 | def __getParmsFromProjectObj(self, projectObjView): | |
2423 |
|
2417 | |||
2424 | parms_ok = True |
|
2418 | parms_ok = True | |
2425 |
|
2419 | |||
2426 | project_name, description = projectObjView.name, projectObjView.description |
|
2420 | project_name, description = projectObjView.name, projectObjView.description | |
2427 |
|
2421 | |||
2428 | readUnitObj = projectObjView.getReadUnitObj() |
|
2422 | readUnitObj = projectObjView.getReadUnitObj() | |
2429 | datatype = readUnitObj.datatype |
|
2423 | datatype = readUnitObj.datatype | |
2430 |
|
2424 | |||
2431 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2425 | operationObj = readUnitObj.getOperationObj(name='run') | |
2432 |
|
2426 | |||
2433 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2427 | dpath = operationObj.getParameterValue(parameterName='path') | |
2434 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2428 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2435 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2429 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2436 |
|
2430 | |||
2437 | startDate = startDate.strftime("%Y/%m/%d") |
|
2431 | startDate = startDate.strftime("%Y/%m/%d") | |
2438 | endDate = endDate.strftime("%Y/%m/%d") |
|
2432 | endDate = endDate.strftime("%Y/%m/%d") | |
2439 |
|
2433 | |||
2440 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2434 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2441 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2435 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2442 |
|
2436 | |||
2443 | startTime = startTime.strftime("%H:%M:%S") |
|
2437 | startTime = startTime.strftime("%H:%M:%S") | |
2444 | endTime = endTime.strftime("%H:%M:%S") |
|
2438 | endTime = endTime.strftime("%H:%M:%S") | |
2445 |
|
2439 | |||
2446 | online = 0 |
|
2440 | online = 0 | |
2447 | try: |
|
2441 | try: | |
2448 | online = operationObj.getParameterValue(parameterName='online') |
|
2442 | online = operationObj.getParameterValue(parameterName='online') | |
2449 | except: |
|
2443 | except: | |
2450 | pass |
|
2444 | pass | |
2451 |
|
2445 | |||
2452 | delay = '' |
|
2446 | delay = '' | |
2453 | try: |
|
2447 | try: | |
2454 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2448 | delay = operationObj.getParameterValue(parameterName='delay') | |
2455 | except: |
|
2449 | except: | |
2456 | pass |
|
2450 | pass | |
2457 |
|
2451 | |||
2458 | walk = 0 |
|
2452 | walk = 0 | |
2459 | try: |
|
2453 | try: | |
2460 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2454 | walk = operationObj.getParameterValue(parameterName='walk') | |
2461 | except: |
|
2455 | except: | |
2462 | pass |
|
2456 | pass | |
2463 |
|
2457 | |||
2464 | set = '' |
|
2458 | set = '' | |
2465 | try: |
|
2459 | try: | |
2466 | set = operationObj.getParameterValue(parameterName='set') |
|
2460 | set = operationObj.getParameterValue(parameterName='set') | |
2467 | except: |
|
2461 | except: | |
2468 | pass |
|
2462 | pass | |
2469 |
|
2463 | |||
2470 | ippKm = '' |
|
2464 | ippKm = '' | |
2471 | if datatype.lower() == 'usrp': |
|
2465 | if datatype.lower() == 'usrp': | |
2472 | try: |
|
2466 | try: | |
2473 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2467 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2474 | except: |
|
2468 | except: | |
2475 | pass |
|
2469 | pass | |
2476 |
|
2470 | |||
2477 | projectParms = ProjectParms() |
|
2471 | projectParms = ProjectParms() | |
2478 |
|
2472 | |||
2479 | projectParms.name = project_name |
|
2473 | projectParms.name = project_name | |
2480 | projectParms.description = description |
|
2474 | projectParms.description = description | |
2481 | projectParms.datatype = datatype |
|
2475 | projectParms.datatype = datatype | |
2482 | projectParms.ext = None |
|
2476 | projectParms.ext = None | |
2483 | projectParms.dpath = dpath |
|
2477 | projectParms.dpath = dpath | |
2484 | projectParms.online = online |
|
2478 | projectParms.online = online | |
2485 | projectParms.startDate = startDate |
|
2479 | projectParms.startDate = startDate | |
2486 | projectParms.endDate = endDate |
|
2480 | projectParms.endDate = endDate | |
2487 | projectParms.startTime = startTime |
|
2481 | projectParms.startTime = startTime | |
2488 | projectParms.endTime = endTime |
|
2482 | projectParms.endTime = endTime | |
2489 | projectParms.delay=delay |
|
2483 | projectParms.delay=delay | |
2490 | projectParms.walk=walk |
|
2484 | projectParms.walk=walk | |
2491 | projectParms.set=set |
|
2485 | projectParms.set=set | |
2492 | projectParms.ippKm=ippKm |
|
2486 | projectParms.ippKm=ippKm | |
2493 | projectParms.parmsOk=parms_ok |
|
2487 | projectParms.parmsOk=parms_ok | |
2494 |
|
2488 | |||
2495 | return projectParms |
|
2489 | return projectParms | |
2496 |
|
2490 | |||
2497 | def refreshProjectWindow2(self, projectObjView): |
|
2491 | def refreshProjectWindow2(self, projectObjView): | |
2498 |
|
2492 | |||
2499 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2493 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2500 |
|
2494 | |||
2501 | index = projectParms.getDatatypeIndex() |
|
2495 | index = projectParms.getDatatypeIndex() | |
2502 |
|
2496 | |||
2503 | self.proName.setText(projectParms.name) |
|
2497 | self.proName.setText(projectParms.name) | |
2504 | self.proDescription.clear() |
|
2498 | self.proDescription.clear() | |
2505 | self.proDescription.append(projectParms.description) |
|
2499 | self.proDescription.append(projectParms.description) | |
2506 |
|
2500 | |||
2507 | self.on_proComDataType_activated(index=index) |
|
2501 | self.on_proComDataType_activated(index=index) | |
2508 | self.proDataPath.setText(projectParms.dpath) |
|
2502 | self.proDataPath.setText(projectParms.dpath) | |
2509 | self.proComDataType.setCurrentIndex(index) |
|
2503 | self.proComDataType.setCurrentIndex(index) | |
2510 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2504 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2511 | self.proDelay.setText(str(projectParms.delay)) |
|
2505 | self.proDelay.setText(str(projectParms.delay)) | |
2512 | self.proSet.setText(str(projectParms.set)) |
|
2506 | self.proSet.setText(str(projectParms.set)) | |
2513 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2507 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2514 |
|
2508 | |||
2515 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2509 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2516 | ext = projectParms.getExt(), |
|
2510 | ext = projectParms.getExt(), | |
2517 | walk = projectParms.walk, |
|
2511 | walk = projectParms.walk, | |
2518 | expLabel = projectParms.expLabel) |
|
2512 | expLabel = projectParms.expLabel) | |
2519 |
|
2513 | |||
2520 | try: |
|
2514 | try: | |
2521 | startDateIndex = dateList.index(projectParms.startDate) |
|
2515 | startDateIndex = dateList.index(projectParms.startDate) | |
2522 | except: |
|
2516 | except: | |
2523 | startDateIndex = 0 |
|
2517 | startDateIndex = 0 | |
2524 |
|
2518 | |||
2525 | try: |
|
2519 | try: | |
2526 | endDateIndex = dateList.index(projectParms.endDate) |
|
2520 | endDateIndex = dateList.index(projectParms.endDate) | |
2527 | except: |
|
2521 | except: | |
2528 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2522 | endDateIndex = int(self.proComEndDate.count()-1) | |
2529 |
|
2523 | |||
2530 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2524 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2531 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2525 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2532 |
|
2526 | |||
2533 | startlist = projectParms.startTime.split(":") |
|
2527 | startlist = projectParms.startTime.split(":") | |
2534 | endlist = projectParms.endTime.split(":") |
|
2528 | endlist = projectParms.endTime.split(":") | |
2535 |
|
2529 | |||
2536 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2530 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2537 | self.proStartTime.setTime(self.time) |
|
2531 | self.proStartTime.setTime(self.time) | |
2538 |
|
2532 | |||
2539 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2533 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2540 | self.proEndTime.setTime(self.time) |
|
2534 | self.proEndTime.setTime(self.time) | |
2541 |
|
2535 | |||
2542 |
|
2536 | |||
2543 | def __refreshVoltageWindow(self, puObj): |
|
2537 | def __refreshVoltageWindow(self, puObj): | |
2544 |
|
2538 | |||
2545 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2539 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2546 | if opObj == None: |
|
2540 | if opObj == None: | |
2547 | self.volOpRadarfrequency.clear() |
|
2541 | self.volOpRadarfrequency.clear() | |
2548 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2542 | self.volOpCebRadarfrequency.setCheckState(0) | |
2549 | else: |
|
2543 | else: | |
2550 | value = opObj.getParameterValue(parameterName='frequency') |
|
2544 | value = opObj.getParameterValue(parameterName='frequency') | |
2551 | value = str(value) |
|
2545 | value = str(float(value)/1e6) | |
2552 | self.volOpRadarfrequency.setText(value) |
|
2546 | self.volOpRadarfrequency.setText(value) | |
2553 | self.volOpRadarfrequency.setEnabled(True) |
|
2547 | self.volOpRadarfrequency.setEnabled(True) | |
2554 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2548 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2555 |
|
2549 | |||
2556 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2550 | opObj = puObj.getOperationObj(name="selectChannels") | |
2557 |
|
2551 | |||
2558 | if opObj == None: |
|
2552 | if opObj == None: | |
2559 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2553 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2560 |
|
2554 | |||
2561 | if opObj == None: |
|
2555 | if opObj == None: | |
2562 | self.volOpChannel.clear() |
|
2556 | self.volOpChannel.clear() | |
2563 | self.volOpCebChannels.setCheckState(0) |
|
2557 | self.volOpCebChannels.setCheckState(0) | |
2564 | else: |
|
2558 | else: | |
2565 | channelEnabled = False |
|
2559 | channelEnabled = False | |
2566 | try: |
|
2560 | try: | |
2567 | value = opObj.getParameterValue(parameterName='channelList') |
|
2561 | value = opObj.getParameterValue(parameterName='channelList') | |
2568 | value = str(value)[1:-1] |
|
2562 | value = str(value)[1:-1] | |
2569 | channelEnabled = True |
|
2563 | channelEnabled = True | |
2570 | channelMode = 0 |
|
2564 | channelMode = 0 | |
2571 | except: |
|
2565 | except: | |
2572 | pass |
|
2566 | pass | |
2573 | try: |
|
2567 | try: | |
2574 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2568 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2575 | value = str(value)[1:-1] |
|
2569 | value = str(value)[1:-1] | |
2576 | channelEnabled = True |
|
2570 | channelEnabled = True | |
2577 | channelMode = 1 |
|
2571 | channelMode = 1 | |
2578 | except: |
|
2572 | except: | |
2579 | pass |
|
2573 | pass | |
2580 |
|
2574 | |||
2581 | if channelEnabled: |
|
2575 | if channelEnabled: | |
2582 | self.volOpChannel.setText(value) |
|
2576 | self.volOpChannel.setText(value) | |
2583 | self.volOpChannel.setEnabled(True) |
|
2577 | self.volOpChannel.setEnabled(True) | |
2584 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2578 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2585 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2579 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2586 |
|
2580 | |||
2587 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2581 | opObj = puObj.getOperationObj(name="selectHeights") | |
2588 | if opObj == None: |
|
2582 | if opObj == None: | |
2589 | self.volOpHeights.clear() |
|
2583 | self.volOpHeights.clear() | |
2590 | self.volOpCebHeights.setCheckState(0) |
|
2584 | self.volOpCebHeights.setCheckState(0) | |
2591 | else: |
|
2585 | else: | |
2592 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
2586 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
2593 | value1 = str(value1) |
|
2587 | value1 = str(value1) | |
2594 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
2588 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
2595 | value2 = str(value2) |
|
2589 | value2 = str(value2) | |
2596 | value = value1 + "," + value2 |
|
2590 | value = value1 + "," + value2 | |
2597 | self.volOpHeights.setText(value) |
|
2591 | self.volOpHeights.setText(value) | |
2598 | self.volOpHeights.setEnabled(True) |
|
2592 | self.volOpHeights.setEnabled(True) | |
2599 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2593 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2600 |
|
2594 | |||
2601 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2595 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2602 | if opObj == None: |
|
2596 | if opObj == None: | |
2603 | self.volOpFilter.clear() |
|
2597 | self.volOpFilter.clear() | |
2604 | self.volOpCebFilter.setCheckState(0) |
|
2598 | self.volOpCebFilter.setCheckState(0) | |
2605 | else: |
|
2599 | else: | |
2606 | value = opObj.getParameterValue(parameterName='window') |
|
2600 | value = opObj.getParameterValue(parameterName='window') | |
2607 | value = str(value) |
|
2601 | value = str(value) | |
2608 | self.volOpFilter.setText(value) |
|
2602 | self.volOpFilter.setText(value) | |
2609 | self.volOpFilter.setEnabled(True) |
|
2603 | self.volOpFilter.setEnabled(True) | |
2610 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2604 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2611 |
|
2605 | |||
2612 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2606 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2613 | if opObj == None: |
|
2607 | if opObj == None: | |
2614 | self.volOpProfile.clear() |
|
2608 | self.volOpProfile.clear() | |
2615 | self.volOpCebProfile.setCheckState(0) |
|
2609 | self.volOpCebProfile.setCheckState(0) | |
2616 | else: |
|
2610 | else: | |
2617 | for parmObj in opObj.getParameterObjList(): |
|
2611 | for parmObj in opObj.getParameterObjList(): | |
2618 |
|
2612 | |||
2619 | if parmObj.name == "profileList": |
|
2613 | if parmObj.name == "profileList": | |
2620 | value = parmObj.getValue() |
|
2614 | value = parmObj.getValue() | |
2621 | value = str(value)[1:-1] |
|
2615 | value = str(value)[1:-1] | |
2622 | self.volOpProfile.setText(value) |
|
2616 | self.volOpProfile.setText(value) | |
2623 | self.volOpProfile.setEnabled(True) |
|
2617 | self.volOpProfile.setEnabled(True) | |
2624 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2618 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2625 | self.volOpComProfile.setCurrentIndex(0) |
|
2619 | self.volOpComProfile.setCurrentIndex(0) | |
2626 |
|
2620 | |||
2627 | if parmObj.name == "profileRangeList": |
|
2621 | if parmObj.name == "profileRangeList": | |
2628 | value = parmObj.getValue() |
|
2622 | value = parmObj.getValue() | |
2629 | value = str(value)[1:-1] |
|
2623 | value = str(value)[1:-1] | |
2630 | self.volOpProfile.setText(value) |
|
2624 | self.volOpProfile.setText(value) | |
2631 | self.volOpProfile.setEnabled(True) |
|
2625 | self.volOpProfile.setEnabled(True) | |
2632 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2626 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2633 | self.volOpComProfile.setCurrentIndex(1) |
|
2627 | self.volOpComProfile.setCurrentIndex(1) | |
2634 |
|
2628 | |||
2635 | if parmObj.name == "rangeList": |
|
2629 | if parmObj.name == "rangeList": | |
2636 | value = parmObj.getValue() |
|
2630 | value = parmObj.getValue() | |
2637 | value = str(value)[1:-1] |
|
2631 | value = str(value)[1:-1] | |
2638 | self.volOpProfile.setText(value) |
|
2632 | self.volOpProfile.setText(value) | |
2639 | self.volOpProfile.setEnabled(True) |
|
2633 | self.volOpProfile.setEnabled(True) | |
2640 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2634 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2641 | self.volOpComProfile.setCurrentIndex(2) |
|
2635 | self.volOpComProfile.setCurrentIndex(2) | |
2642 |
|
2636 | |||
2643 | opObj = puObj.getOperationObj(name="Decoder") |
|
2637 | opObj = puObj.getOperationObj(name="Decoder") | |
2644 | self.volOpCode.setText("") |
|
2638 | self.volOpCode.setText("") | |
2645 | if opObj == None: |
|
2639 | if opObj == None: | |
2646 | self.volOpCebDecodification.setCheckState(0) |
|
2640 | self.volOpCebDecodification.setCheckState(0) | |
2647 | else: |
|
2641 | else: | |
2648 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2642 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2649 |
|
2643 | |||
2650 | parmObj = opObj.getParameterObj('code') |
|
2644 | parmObj = opObj.getParameterObj('code') | |
2651 |
|
2645 | |||
2652 | if parmObj == None: |
|
2646 | if parmObj == None: | |
2653 | self.volOpComCode.setCurrentIndex(0) |
|
2647 | self.volOpComCode.setCurrentIndex(0) | |
2654 | else: |
|
2648 | else: | |
2655 |
|
2649 | |||
2656 | parmObj1 = opObj.getParameterObj('nCode') |
|
2650 | parmObj1 = opObj.getParameterObj('nCode') | |
2657 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2651 | parmObj2 = opObj.getParameterObj('nBaud') | |
2658 |
|
2652 | |||
2659 | if parmObj1 == None or parmObj2 == None: |
|
2653 | if parmObj1 == None or parmObj2 == None: | |
2660 | self.volOpComCode.setCurrentIndex(0) |
|
2654 | self.volOpComCode.setCurrentIndex(0) | |
2661 | else: |
|
2655 | else: | |
2662 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2656 | code = ast.literal_eval(str(parmObj.getValue())) | |
2663 | nCode = parmObj1.getValue() |
|
2657 | nCode = parmObj1.getValue() | |
2664 | nBaud = parmObj2.getValue() |
|
2658 | nBaud = parmObj2.getValue() | |
2665 |
|
2659 | |||
2666 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2660 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2667 |
|
2661 | |||
2668 | #User defined by default |
|
2662 | #User defined by default | |
2669 | self.volOpComCode.setCurrentIndex(13) |
|
2663 | self.volOpComCode.setCurrentIndex(13) | |
2670 | self.volOpCode.setText(str(code)) |
|
2664 | self.volOpCode.setText(str(code)) | |
2671 |
|
2665 | |||
2672 | if nCode == 1: |
|
2666 | if nCode == 1: | |
2673 | if nBaud == 3: |
|
2667 | if nBaud == 3: | |
2674 | self.volOpComCode.setCurrentIndex(1) |
|
2668 | self.volOpComCode.setCurrentIndex(1) | |
2675 | if nBaud == 4: |
|
2669 | if nBaud == 4: | |
2676 | self.volOpComCode.setCurrentIndex(2) |
|
2670 | self.volOpComCode.setCurrentIndex(2) | |
2677 | if nBaud == 5: |
|
2671 | if nBaud == 5: | |
2678 | self.volOpComCode.setCurrentIndex(3) |
|
2672 | self.volOpComCode.setCurrentIndex(3) | |
2679 | if nBaud == 7: |
|
2673 | if nBaud == 7: | |
2680 | self.volOpComCode.setCurrentIndex(4) |
|
2674 | self.volOpComCode.setCurrentIndex(4) | |
2681 | if nBaud == 11: |
|
2675 | if nBaud == 11: | |
2682 | self.volOpComCode.setCurrentIndex(5) |
|
2676 | self.volOpComCode.setCurrentIndex(5) | |
2683 | if nBaud == 13: |
|
2677 | if nBaud == 13: | |
2684 | self.volOpComCode.setCurrentIndex(6) |
|
2678 | self.volOpComCode.setCurrentIndex(6) | |
2685 |
|
2679 | |||
2686 | if nCode == 2: |
|
2680 | if nCode == 2: | |
2687 | if nBaud == 3: |
|
2681 | if nBaud == 3: | |
2688 | self.volOpComCode.setCurrentIndex(7) |
|
2682 | self.volOpComCode.setCurrentIndex(7) | |
2689 | if nBaud == 4: |
|
2683 | if nBaud == 4: | |
2690 | self.volOpComCode.setCurrentIndex(8) |
|
2684 | self.volOpComCode.setCurrentIndex(8) | |
2691 | if nBaud == 5: |
|
2685 | if nBaud == 5: | |
2692 | self.volOpComCode.setCurrentIndex(9) |
|
2686 | self.volOpComCode.setCurrentIndex(9) | |
2693 | if nBaud == 7: |
|
2687 | if nBaud == 7: | |
2694 | self.volOpComCode.setCurrentIndex(10) |
|
2688 | self.volOpComCode.setCurrentIndex(10) | |
2695 | if nBaud == 11: |
|
2689 | if nBaud == 11: | |
2696 | self.volOpComCode.setCurrentIndex(11) |
|
2690 | self.volOpComCode.setCurrentIndex(11) | |
2697 | if nBaud == 13: |
|
2691 | if nBaud == 13: | |
2698 | self.volOpComCode.setCurrentIndex(12) |
|
2692 | self.volOpComCode.setCurrentIndex(12) | |
2699 |
|
2693 | |||
2700 |
|
2694 | |||
2701 | opObj = puObj.getOperationObj(name="deFlip") |
|
2695 | opObj = puObj.getOperationObj(name="deFlip") | |
2702 | if opObj == None: |
|
2696 | if opObj == None: | |
2703 | self.volOpFlip.clear() |
|
2697 | self.volOpFlip.clear() | |
2704 | self.volOpFlip.setEnabled(False) |
|
2698 | self.volOpFlip.setEnabled(False) | |
2705 | self.volOpCebFlip.setCheckState(0) |
|
2699 | self.volOpCebFlip.setCheckState(0) | |
2706 | else: |
|
2700 | else: | |
2707 | try: |
|
2701 | try: | |
2708 | value = opObj.getParameterValue(parameterName='channelList') |
|
2702 | value = opObj.getParameterValue(parameterName='channelList') | |
2709 | value = str(value)[1:-1] |
|
2703 | value = str(value)[1:-1] | |
2710 | except: |
|
2704 | except: | |
2711 | value = "" |
|
2705 | value = "" | |
2712 |
|
2706 | |||
2713 | self.volOpFlip.setText(value) |
|
2707 | self.volOpFlip.setText(value) | |
2714 | self.volOpFlip.setEnabled(True) |
|
2708 | self.volOpFlip.setEnabled(True) | |
2715 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2709 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2716 |
|
2710 | |||
2717 | opObj = puObj.getOperationObj(name="CohInt") |
|
2711 | opObj = puObj.getOperationObj(name="CohInt") | |
2718 | if opObj == None: |
|
2712 | if opObj == None: | |
2719 | self.volOpCohInt.clear() |
|
2713 | self.volOpCohInt.clear() | |
2720 | self.volOpCebCohInt.setCheckState(0) |
|
2714 | self.volOpCebCohInt.setCheckState(0) | |
2721 | else: |
|
2715 | else: | |
2722 | value = opObj.getParameterValue(parameterName='n') |
|
2716 | value = opObj.getParameterValue(parameterName='n') | |
2723 | self.volOpCohInt.setText(str(value)) |
|
2717 | self.volOpCohInt.setText(str(value)) | |
2724 | self.volOpCohInt.setEnabled(True) |
|
2718 | self.volOpCohInt.setEnabled(True) | |
2725 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2719 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2726 |
|
2720 | |||
2727 | opObj = puObj.getOperationObj(name='Scope') |
|
2721 | opObj = puObj.getOperationObj(name='Scope') | |
2728 | if opObj == None: |
|
2722 | if opObj == None: | |
2729 | self.volGraphCebshow.setCheckState(0) |
|
2723 | self.volGraphCebshow.setCheckState(0) | |
2730 | else: |
|
2724 | else: | |
2731 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2725 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2732 |
|
2726 | |||
2733 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2727 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2734 |
|
2728 | |||
2735 | if parmObj == None: |
|
2729 | if parmObj == None: | |
2736 | self.volGraphChannelList.clear() |
|
2730 | self.volGraphChannelList.clear() | |
2737 | else: |
|
2731 | else: | |
2738 | value = parmObj.getValue() |
|
2732 | value = parmObj.getValue() | |
2739 | value = str(value) |
|
2733 | value = str(value) | |
2740 | self.volGraphChannelList.setText(value) |
|
2734 | self.volGraphChannelList.setText(value) | |
2741 | self.volOpProfile.setEnabled(True) |
|
2735 | self.volOpProfile.setEnabled(True) | |
2742 |
|
2736 | |||
2743 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2737 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2744 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2738 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2745 |
|
2739 | |||
2746 | if parmObj1 == None or parmObj2 ==None: |
|
2740 | if parmObj1 == None or parmObj2 ==None: | |
2747 | self.volGraphfreqrange.clear() |
|
2741 | self.volGraphfreqrange.clear() | |
2748 | else: |
|
2742 | else: | |
2749 | value1 = parmObj1.getValue() |
|
2743 | value1 = parmObj1.getValue() | |
2750 | value1 = str(value1) |
|
2744 | value1 = str(value1) | |
2751 | value2 = parmObj2.getValue() |
|
2745 | value2 = parmObj2.getValue() | |
2752 | value2 = str(value2) |
|
2746 | value2 = str(value2) | |
2753 | value = value1 + "," + value2 |
|
2747 | value = value1 + "," + value2 | |
2754 | self.volGraphfreqrange.setText(value) |
|
2748 | self.volGraphfreqrange.setText(value) | |
2755 |
|
2749 | |||
2756 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2750 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2757 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2751 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2758 |
|
2752 | |||
2759 | if parmObj1 == None or parmObj2 ==None: |
|
2753 | if parmObj1 == None or parmObj2 ==None: | |
2760 | self.volGraphHeightrange.clear() |
|
2754 | self.volGraphHeightrange.clear() | |
2761 | else: |
|
2755 | else: | |
2762 | value1 = parmObj1.getValue() |
|
2756 | value1 = parmObj1.getValue() | |
2763 | value1 = str(value1) |
|
2757 | value1 = str(value1) | |
2764 | value2 = parmObj2.getValue() |
|
2758 | value2 = parmObj2.getValue() | |
2765 | value2 = str(value2) |
|
2759 | value2 = str(value2) | |
2766 | value = value1 + "," + value2 |
|
2760 | value = value1 + "," + value2 | |
2767 | value2 = str(value2) |
|
2761 | value2 = str(value2) | |
2768 | self.volGraphHeightrange.setText(value) |
|
2762 | self.volGraphHeightrange.setText(value) | |
2769 |
|
2763 | |||
2770 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2764 | parmObj = opObj.getParameterObj(parameterName='save') | |
2771 |
|
2765 | |||
2772 | if parmObj == None: |
|
2766 | if parmObj == None: | |
2773 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2767 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2774 | else: |
|
2768 | else: | |
2775 | value = parmObj.getValue() |
|
2769 | value = parmObj.getValue() | |
2776 | if int(value): |
|
2770 | if int(value): | |
2777 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2771 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2778 | else: |
|
2772 | else: | |
2779 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2773 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2780 |
|
2774 | |||
2781 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2775 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2782 | if parmObj == None: |
|
2776 | if parmObj == None: | |
2783 | self.volGraphPath.clear() |
|
2777 | self.volGraphPath.clear() | |
2784 | else: |
|
2778 | else: | |
2785 | value = parmObj.getValue() |
|
2779 | value = parmObj.getValue() | |
2786 | path = str(value) |
|
2780 | path = str(value) | |
2787 | self.volGraphPath.setText(path) |
|
2781 | self.volGraphPath.setText(path) | |
2788 |
|
2782 | |||
2789 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2783 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2790 | if parmObj == None: |
|
2784 | if parmObj == None: | |
2791 | self.volGraphPrefix.clear() |
|
2785 | self.volGraphPrefix.clear() | |
2792 | else: |
|
2786 | else: | |
2793 | value = parmObj.getValue() |
|
2787 | value = parmObj.getValue() | |
2794 | figfile = str(value) |
|
2788 | figfile = str(value) | |
2795 | self.volGraphPrefix.setText(figfile) |
|
2789 | self.volGraphPrefix.setText(figfile) | |
2796 |
|
2790 | |||
2797 | # outputVoltageWrite |
|
2791 | # outputVoltageWrite | |
2798 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2792 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2799 |
|
2793 | |||
2800 | if opObj == None: |
|
2794 | if opObj == None: | |
2801 | self.volOutputPath.clear() |
|
2795 | self.volOutputPath.clear() | |
2802 | self.volOutputblocksperfile.clear() |
|
2796 | self.volOutputblocksperfile.clear() | |
2803 | self.volOutputprofilesperblock.clear() |
|
2797 | self.volOutputprofilesperblock.clear() | |
2804 | else: |
|
2798 | else: | |
2805 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2799 | parmObj = opObj.getParameterObj(parameterName='path') | |
2806 | if parmObj == None: |
|
2800 | if parmObj == None: | |
2807 | self.volOutputPath.clear() |
|
2801 | self.volOutputPath.clear() | |
2808 | else: |
|
2802 | else: | |
2809 | value = parmObj.getValue() |
|
2803 | value = parmObj.getValue() | |
2810 | path = str(value) |
|
2804 | path = str(value) | |
2811 | self.volOutputPath.setText(path) |
|
2805 | self.volOutputPath.setText(path) | |
2812 |
|
2806 | |||
2813 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2807 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2814 | if parmObj == None: |
|
2808 | if parmObj == None: | |
2815 | self.volOutputblocksperfile.clear() |
|
2809 | self.volOutputblocksperfile.clear() | |
2816 | else: |
|
2810 | else: | |
2817 | value = parmObj.getValue() |
|
2811 | value = parmObj.getValue() | |
2818 | blocksperfile = str(value) |
|
2812 | blocksperfile = str(value) | |
2819 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2813 | self.volOutputblocksperfile.setText(blocksperfile) | |
2820 |
|
2814 | |||
2821 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2815 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2822 | if parmObj == None: |
|
2816 | if parmObj == None: | |
2823 | self.volOutputprofilesperblock.clear() |
|
2817 | self.volOutputprofilesperblock.clear() | |
2824 | else: |
|
2818 | else: | |
2825 | value = parmObj.getValue() |
|
2819 | value = parmObj.getValue() | |
2826 | profilesPerBlock = str(value) |
|
2820 | profilesPerBlock = str(value) | |
2827 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2821 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2828 |
|
2822 | |||
2829 | return |
|
2823 | return | |
2830 |
|
2824 | |||
2831 | def __refreshSpectraWindow(self, puObj): |
|
2825 | def __refreshSpectraWindow(self, puObj): | |
2832 |
|
2826 | |||
2833 | inputId = puObj.getInputId() |
|
2827 | inputId = puObj.getInputId() | |
2834 | inputPUObj = self.__puObjDict[inputId] |
|
2828 | inputPUObj = self.__puObjDict[inputId] | |
2835 |
|
2829 | |||
2836 | if inputPUObj.datatype == 'Voltage': |
|
2830 | if inputPUObj.datatype == 'Voltage': | |
2837 | self.specOpnFFTpoints.setEnabled(True) |
|
2831 | self.specOpnFFTpoints.setEnabled(True) | |
2838 | self.specOpProfiles.setEnabled(True) |
|
2832 | self.specOpProfiles.setEnabled(True) | |
2839 | self.specOpippFactor.setEnabled(True) |
|
2833 | self.specOpippFactor.setEnabled(True) | |
2840 | else: |
|
2834 | else: | |
2841 | self.specOpnFFTpoints.setEnabled(False) |
|
2835 | self.specOpnFFTpoints.setEnabled(False) | |
2842 | self.specOpProfiles.setEnabled(False) |
|
2836 | self.specOpProfiles.setEnabled(False) | |
2843 | self.specOpippFactor.setEnabled(False) |
|
2837 | self.specOpippFactor.setEnabled(False) | |
2844 |
|
2838 | |||
2845 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2839 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2846 | if opObj == None: |
|
2840 | if opObj == None: | |
2847 | self.specOpRadarfrequency.clear() |
|
2841 | self.specOpRadarfrequency.clear() | |
2848 | self.specOpCebRadarfrequency.setCheckState(0) |
|
2842 | self.specOpCebRadarfrequency.setCheckState(0) | |
2849 | else: |
|
2843 | else: | |
2850 | value = opObj.getParameterValue(parameterName='frequency') |
|
2844 | value = opObj.getParameterValue(parameterName='frequency') | |
2851 | value = str(value) |
|
2845 | value = str(float(value)/1e6) | |
2852 | self.specOpRadarfrequency.setText(value) |
|
2846 | self.specOpRadarfrequency.setText(value) | |
2853 | self.specOpRadarfrequency.setEnabled(True) |
|
2847 | self.specOpRadarfrequency.setEnabled(True) | |
2854 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2848 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2855 |
|
2849 | |||
2856 | opObj = puObj.getOperationObj(name="run") |
|
2850 | opObj = puObj.getOperationObj(name="run") | |
2857 | if opObj == None: |
|
2851 | if opObj == None: | |
2858 | self.specOpnFFTpoints.clear() |
|
2852 | self.specOpnFFTpoints.clear() | |
2859 | self.specOpProfiles.clear() |
|
2853 | self.specOpProfiles.clear() | |
2860 | self.specOpippFactor.clear() |
|
2854 | self.specOpippFactor.clear() | |
2861 | else: |
|
2855 | else: | |
2862 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
2856 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
2863 | if parmObj == None: |
|
2857 | if parmObj == None: | |
2864 | self.specOpnFFTpoints.clear() |
|
2858 | self.specOpnFFTpoints.clear() | |
2865 | else: |
|
2859 | else: | |
2866 | self.specOpnFFTpoints.setEnabled(True) |
|
2860 | self.specOpnFFTpoints.setEnabled(True) | |
2867 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
2861 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
2868 | self.specOpnFFTpoints.setText(str(value)) |
|
2862 | self.specOpnFFTpoints.setText(str(value)) | |
2869 |
|
2863 | |||
2870 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
2864 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
2871 | if parmObj == None: |
|
2865 | if parmObj == None: | |
2872 | self.specOpProfiles.clear() |
|
2866 | self.specOpProfiles.clear() | |
2873 | else: |
|
2867 | else: | |
2874 | self.specOpProfiles.setEnabled(True) |
|
2868 | self.specOpProfiles.setEnabled(True) | |
2875 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
2869 | value = opObj.getParameterValue(parameterName='nProfiles') | |
2876 | self.specOpProfiles.setText(str(value)) |
|
2870 | self.specOpProfiles.setText(str(value)) | |
2877 |
|
2871 | |||
2878 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
2872 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
2879 | if parmObj == None: |
|
2873 | if parmObj == None: | |
2880 | self.specOpippFactor.clear() |
|
2874 | self.specOpippFactor.clear() | |
2881 | else: |
|
2875 | else: | |
2882 | self.specOpippFactor.setEnabled(True) |
|
2876 | self.specOpippFactor.setEnabled(True) | |
2883 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
2877 | value = opObj.getParameterValue(parameterName='ippFactor') | |
2884 | self.specOpippFactor.setText(str(value)) |
|
2878 | self.specOpippFactor.setText(str(value)) | |
2885 |
|
2879 | |||
2886 | opObj = puObj.getOperationObj(name="run") |
|
2880 | opObj = puObj.getOperationObj(name="run") | |
2887 | if opObj == None: |
|
2881 | if opObj == None: | |
2888 | self.specOppairsList.clear() |
|
2882 | self.specOppairsList.clear() | |
2889 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2883 | self.specOpCebCrossSpectra.setCheckState(0) | |
2890 | else: |
|
2884 | else: | |
2891 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
2885 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
2892 | if parmObj == None: |
|
2886 | if parmObj == None: | |
2893 | self.specOppairsList.clear() |
|
2887 | self.specOppairsList.clear() | |
2894 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2888 | self.specOpCebCrossSpectra.setCheckState(0) | |
2895 | else: |
|
2889 | else: | |
2896 | value = opObj.getParameterValue(parameterName='pairsList') |
|
2890 | value = opObj.getParameterValue(parameterName='pairsList') | |
2897 | value = str(value)[1:-1] |
|
2891 | value = str(value)[1:-1] | |
2898 | self.specOppairsList.setText(str(value)) |
|
2892 | self.specOppairsList.setText(str(value)) | |
2899 | self.specOppairsList.setEnabled(True) |
|
2893 | self.specOppairsList.setEnabled(True) | |
2900 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
2894 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
2901 |
|
2895 | |||
2902 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2896 | opObj = puObj.getOperationObj(name="selectChannels") | |
2903 |
|
2897 | |||
2904 | if opObj == None: |
|
2898 | if opObj == None: | |
2905 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2899 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2906 |
|
2900 | |||
2907 | if opObj == None: |
|
2901 | if opObj == None: | |
2908 | self.specOpChannel.clear() |
|
2902 | self.specOpChannel.clear() | |
2909 | self.specOpCebChannel.setCheckState(0) |
|
2903 | self.specOpCebChannel.setCheckState(0) | |
2910 | else: |
|
2904 | else: | |
2911 | channelEnabled = False |
|
2905 | channelEnabled = False | |
2912 | try: |
|
2906 | try: | |
2913 | value = opObj.getParameterValue(parameterName='channelList') |
|
2907 | value = opObj.getParameterValue(parameterName='channelList') | |
2914 | value = str(value)[1:-1] |
|
2908 | value = str(value)[1:-1] | |
2915 | channelEnabled = True |
|
2909 | channelEnabled = True | |
2916 | channelMode = 0 |
|
2910 | channelMode = 0 | |
2917 | except: |
|
2911 | except: | |
2918 | pass |
|
2912 | pass | |
2919 | try: |
|
2913 | try: | |
2920 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2914 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2921 | value = str(value)[1:-1] |
|
2915 | value = str(value)[1:-1] | |
2922 | channelEnabled = True |
|
2916 | channelEnabled = True | |
2923 | channelMode = 1 |
|
2917 | channelMode = 1 | |
2924 | except: |
|
2918 | except: | |
2925 | pass |
|
2919 | pass | |
2926 |
|
2920 | |||
2927 | if channelEnabled: |
|
2921 | if channelEnabled: | |
2928 | self.specOpChannel.setText(value) |
|
2922 | self.specOpChannel.setText(value) | |
2929 | self.specOpChannel.setEnabled(True) |
|
2923 | self.specOpChannel.setEnabled(True) | |
2930 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
2924 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
2931 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
2925 | self.specOpComChannel.setCurrentIndex(channelMode) | |
2932 |
|
2926 | |||
2933 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2927 | opObj = puObj.getOperationObj(name="selectHeights") | |
2934 | if opObj == None: |
|
2928 | if opObj == None: | |
2935 | self.specOpHeights.clear() |
|
2929 | self.specOpHeights.clear() | |
2936 | self.specOpCebHeights.setCheckState(0) |
|
2930 | self.specOpCebHeights.setCheckState(0) | |
2937 | else: |
|
2931 | else: | |
2938 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
2932 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
2939 | value1 = str(value1) |
|
2933 | value1 = str(value1) | |
2940 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
2934 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
2941 | value2 = str(value2) |
|
2935 | value2 = str(value2) | |
2942 | value = value1 + "," + value2 |
|
2936 | value = value1 + "," + value2 | |
2943 | self.specOpHeights.setText(value) |
|
2937 | self.specOpHeights.setText(value) | |
2944 | self.specOpHeights.setEnabled(True) |
|
2938 | self.specOpHeights.setEnabled(True) | |
2945 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2939 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2946 |
|
2940 | |||
2947 | opObj = puObj.getOperationObj(name="IncohInt") |
|
2941 | opObj = puObj.getOperationObj(name="IncohInt") | |
2948 | if opObj == None: |
|
2942 | if opObj == None: | |
2949 | self.specOpIncoherent.clear() |
|
2943 | self.specOpIncoherent.clear() | |
2950 | self.specOpCebIncoherent.setCheckState(0) |
|
2944 | self.specOpCebIncoherent.setCheckState(0) | |
2951 | else: |
|
2945 | else: | |
2952 | for parmObj in opObj.getParameterObjList(): |
|
2946 | for parmObj in opObj.getParameterObjList(): | |
2953 | if parmObj.name == 'timeInterval': |
|
2947 | if parmObj.name == 'timeInterval': | |
2954 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
2948 | value = opObj.getParameterValue(parameterName='timeInterval') | |
2955 | value = float(value) |
|
2949 | value = float(value) | |
2956 | self.specOpIncoherent.setText(str(value)) |
|
2950 | self.specOpIncoherent.setText(str(value)) | |
2957 | self.specOpIncoherent.setEnabled(True) |
|
2951 | self.specOpIncoherent.setEnabled(True) | |
2958 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
2952 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
2959 | self.specOpCobIncInt.setCurrentIndex(0) |
|
2953 | self.specOpCobIncInt.setCurrentIndex(0) | |
2960 |
|
2954 | |||
2961 | if parmObj.name == 'n': |
|
2955 | if parmObj.name == 'n': | |
2962 | value = opObj.getParameterValue(parameterName='n') |
|
2956 | value = opObj.getParameterValue(parameterName='n') | |
2963 | value = float(value) |
|
2957 | value = float(value) | |
2964 | self.specOpIncoherent.setText(str(value)) |
|
2958 | self.specOpIncoherent.setText(str(value)) | |
2965 | self.specOpIncoherent.setEnabled(True) |
|
2959 | self.specOpIncoherent.setEnabled(True) | |
2966 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
2960 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
2967 | self.specOpCobIncInt.setCurrentIndex(1) |
|
2961 | self.specOpCobIncInt.setCurrentIndex(1) | |
2968 |
|
2962 | |||
2969 | opObj = puObj.getOperationObj(name="removeDC") |
|
2963 | opObj = puObj.getOperationObj(name="removeDC") | |
2970 | if opObj == None: |
|
2964 | if opObj == None: | |
2971 | self.specOpCebRemoveDC.setCheckState(0) |
|
2965 | self.specOpCebRemoveDC.setCheckState(0) | |
2972 | else: |
|
2966 | else: | |
2973 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
2967 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
2974 | value = opObj.getParameterValue(parameterName='mode') |
|
2968 | value = opObj.getParameterValue(parameterName='mode') | |
2975 | if value == 1: |
|
2969 | if value == 1: | |
2976 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
2970 | self.specOpComRemoveDC.setCurrentIndex(0) | |
2977 | elif value == 2: |
|
2971 | elif value == 2: | |
2978 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
2972 | self.specOpComRemoveDC.setCurrentIndex(1) | |
2979 |
|
2973 | |||
2980 | opObj = puObj.getOperationObj(name="removeInterference") |
|
2974 | opObj = puObj.getOperationObj(name="removeInterference") | |
2981 | if opObj == None: |
|
2975 | if opObj == None: | |
2982 | self.specOpCebRemoveInt.setCheckState(0) |
|
2976 | self.specOpCebRemoveInt.setCheckState(0) | |
2983 | else: |
|
2977 | else: | |
2984 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
2978 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
2985 |
|
2979 | |||
2986 | opObj = puObj.getOperationObj(name='getNoise') |
|
2980 | opObj = puObj.getOperationObj(name='getNoise') | |
2987 | if opObj == None: |
|
2981 | if opObj == None: | |
2988 | self.specOpCebgetNoise.setCheckState(0) |
|
2982 | self.specOpCebgetNoise.setCheckState(0) | |
2989 | self.specOpgetNoise.clear() |
|
2983 | self.specOpgetNoise.clear() | |
2990 | else: |
|
2984 | else: | |
2991 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
2985 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
2992 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
2986 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
2993 | if parmObj == None: |
|
2987 | if parmObj == None: | |
2994 | self.specOpgetNoise.clear() |
|
2988 | self.specOpgetNoise.clear() | |
2995 | value1 = None |
|
2989 | value1 = None | |
2996 | else: |
|
2990 | else: | |
2997 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
2991 | value1 = opObj.getParameterValue(parameterName='minHei') | |
2998 | value1 = str(value1) |
|
2992 | value1 = str(value1) | |
2999 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
2993 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3000 | if parmObj == None: |
|
2994 | if parmObj == None: | |
3001 | value2 = None |
|
2995 | value2 = None | |
3002 | value = value1 |
|
2996 | value = value1 | |
3003 | self.specOpgetNoise.setText(value) |
|
2997 | self.specOpgetNoise.setText(value) | |
3004 | self.specOpgetNoise.setEnabled(True) |
|
2998 | self.specOpgetNoise.setEnabled(True) | |
3005 | else: |
|
2999 | else: | |
3006 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3000 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3007 | value2 = str(value2) |
|
3001 | value2 = str(value2) | |
3008 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3002 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3009 | if parmObj == None: |
|
3003 | if parmObj == None: | |
3010 | value3 = None |
|
3004 | value3 = None | |
3011 | value = value1 + "," + value2 |
|
3005 | value = value1 + "," + value2 | |
3012 | self.specOpgetNoise.setText(value) |
|
3006 | self.specOpgetNoise.setText(value) | |
3013 | self.specOpgetNoise.setEnabled(True) |
|
3007 | self.specOpgetNoise.setEnabled(True) | |
3014 | else: |
|
3008 | else: | |
3015 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3009 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3016 | value3 = str(value3) |
|
3010 | value3 = str(value3) | |
3017 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3011 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3018 | if parmObj == None: |
|
3012 | if parmObj == None: | |
3019 | value4 = None |
|
3013 | value4 = None | |
3020 | value = value1 + "," + value2 + "," + value3 |
|
3014 | value = value1 + "," + value2 + "," + value3 | |
3021 | self.specOpgetNoise.setText(value) |
|
3015 | self.specOpgetNoise.setText(value) | |
3022 | self.specOpgetNoise.setEnabled(True) |
|
3016 | self.specOpgetNoise.setEnabled(True) | |
3023 | else: |
|
3017 | else: | |
3024 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3018 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3025 | value4 = str(value4) |
|
3019 | value4 = str(value4) | |
3026 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3020 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3027 | self.specOpgetNoise.setText(value) |
|
3021 | self.specOpgetNoise.setText(value) | |
3028 | self.specOpgetNoise.setEnabled(True) |
|
3022 | self.specOpgetNoise.setEnabled(True) | |
3029 |
|
3023 | |||
|
3024 | self.specGraphPath.clear() | |||
|
3025 | self.specGraphPrefix.clear() | |||
|
3026 | self.specGgraphFreq.clear() | |||
|
3027 | self.specGgraphHeight.clear() | |||
|
3028 | self.specGgraphDbsrange.clear() | |||
|
3029 | self.specGgraphmagnitud.clear() | |||
|
3030 | self.specGgraphPhase.clear() | |||
|
3031 | self.specGgraphChannelList.clear() | |||
|
3032 | self.specGgraphTminTmax.clear() | |||
|
3033 | self.specGgraphTimeRange.clear() | |||
|
3034 | self.specGgraphftpratio.clear() | |||
|
3035 | ||||
3030 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3036 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3031 |
|
3037 | |||
3032 | if opObj == None: |
|
3038 | if opObj == None: | |
3033 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3039 | self.specGraphCebSpectraplot.setCheckState(0) | |
3034 | self.specGraphSaveSpectra.setCheckState(0) |
|
3040 | self.specGraphSaveSpectra.setCheckState(0) | |
3035 | self.specGraphftpSpectra.setCheckState(0) |
|
3041 | self.specGraphftpSpectra.setCheckState(0) | |
3036 | else: |
|
3042 | else: | |
3037 | operationSpectraPlot = "Enable" |
|
3043 | operationSpectraPlot = "Enable" | |
3038 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3044 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3039 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3045 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3040 | if parmObj == None: |
|
3046 | if parmObj == None: | |
3041 | self.specGgraphChannelList.clear() |
|
3047 | self.specGgraphChannelList.clear() | |
3042 | else: |
|
3048 | else: | |
3043 | value = opObj.getParameterValue(parameterName='channelList') |
|
3049 | value = opObj.getParameterValue(parameterName='channelList') | |
3044 | channelListSpectraPlot = str(value)[1:-1] |
|
3050 | channelListSpectraPlot = str(value)[1:-1] | |
3045 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3051 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3046 | self.specGgraphChannelList.setEnabled(True) |
|
3052 | self.specGgraphChannelList.setEnabled(True) | |
3047 |
|
3053 | |||
3048 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3054 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3049 | if parmObj == None: |
|
3055 | if parmObj == None: | |
3050 | self.specGgraphFreq.clear() |
|
3056 | self.specGgraphFreq.clear() | |
3051 | else: |
|
3057 | else: | |
3052 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3058 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3053 | value1 = str(value1) |
|
3059 | value1 = str(value1) | |
3054 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3060 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3055 | value2 = str(value2) |
|
3061 | value2 = str(value2) | |
3056 | value = value1 + "," + value2 |
|
3062 | value = value1 + "," + value2 | |
3057 | self.specGgraphFreq.setText(value) |
|
3063 | self.specGgraphFreq.setText(value) | |
3058 | self.specGgraphFreq.setEnabled(True) |
|
3064 | self.specGgraphFreq.setEnabled(True) | |
3059 |
|
3065 | |||
3060 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3066 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3061 | if parmObj == None: |
|
3067 | if parmObj == None: | |
3062 | self.specGgraphHeight.clear() |
|
3068 | self.specGgraphHeight.clear() | |
3063 | else: |
|
3069 | else: | |
3064 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3070 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3065 | value1 = str(value1) |
|
3071 | value1 = str(value1) | |
3066 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3072 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3067 | value2 = str(value2) |
|
3073 | value2 = str(value2) | |
3068 | value = value1 + "," + value2 |
|
3074 | value = value1 + "," + value2 | |
3069 | self.specGgraphHeight.setText(value) |
|
3075 | self.specGgraphHeight.setText(value) | |
3070 | self.specGgraphHeight.setEnabled(True) |
|
3076 | self.specGgraphHeight.setEnabled(True) | |
3071 |
|
3077 | |||
3072 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3078 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3073 | if parmObj == None: |
|
3079 | if parmObj == None: | |
3074 | self.specGgraphDbsrange.clear() |
|
3080 | self.specGgraphDbsrange.clear() | |
3075 | else: |
|
3081 | else: | |
3076 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3082 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3077 | value1 = str(value1) |
|
3083 | value1 = str(value1) | |
3078 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3084 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3079 | value2 = str(value2) |
|
3085 | value2 = str(value2) | |
3080 | value = value1 + "," + value2 |
|
3086 | value = value1 + "," + value2 | |
3081 | self.specGgraphDbsrange.setText(value) |
|
3087 | self.specGgraphDbsrange.setText(value) | |
3082 | self.specGgraphDbsrange.setEnabled(True) |
|
3088 | self.specGgraphDbsrange.setEnabled(True) | |
3083 |
|
3089 | |||
3084 |
|
3090 | parmObj = opObj.getParameterObj(parameterName="save") | ||
3085 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
|||
3086 | if parmObj == None: |
|
3091 | if parmObj == None: | |
3087 | self.specGraphSaveSpectra.setCheckState(0) |
|
3092 | self.specGraphSaveSpectra.setCheckState(0) | |
3088 | else: |
|
3093 | else: | |
3089 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3094 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3090 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3091 | self.specGraphPath.setText(value) |
|
|||
3092 |
|
3095 | |||
3093 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3096 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3094 | if parmObj == None: |
|
3097 | if parmObj == None: | |
3095 | self.specGraphftpSpectra.setCheckState(0) |
|
3098 | self.specGraphftpSpectra.setCheckState(0) | |
3096 | else: |
|
3099 | else: | |
3097 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3100 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3098 |
|
|
3101 | ||
3099 |
|
|
3102 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3100 |
|
|
3103 | if parmObj: | |
3101 |
|
|
3104 | value = parmObj.getValue() | |
|
3105 | self.specGraphPath.setText(value) | |||
|
3106 | ||||
|
3107 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3108 | if parmObj: | |||
|
3109 | value = parmObj.getValue() | |||
3102 | self.specGgraphftpratio.setText(str(value)) |
|
3110 | self.specGgraphftpratio.setText(str(value)) | |
3103 |
|
3111 | |||
|
3112 | ######################################################## | |||
|
3113 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3114 | if parmObj: | |||
|
3115 | value = parmObj.getValue() | |||
|
3116 | self.temporalFTP.ftp_wei = str(value) | |||
|
3117 | ||||
|
3118 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3119 | if parmObj: | |||
|
3120 | value = parmObj.getValue() | |||
|
3121 | self.temporalFTP.exp_code = str(value) | |||
|
3122 | ||||
|
3123 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3124 | if parmObj: | |||
|
3125 | value = parmObj.getValue() | |||
|
3126 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3127 | ||||
|
3128 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3129 | if parmObj: | |||
|
3130 | value = parmObj.getValue() | |||
|
3131 | self.temporalFTP.plot_pos = str(value) | |||
|
3132 | ||||
3104 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3133 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3105 |
|
3134 | |||
3106 | if opObj == None: |
|
3135 | if opObj == None: | |
3107 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3136 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3108 | self.specGraphSaveCross.setCheckState(0) |
|
3137 | self.specGraphSaveCross.setCheckState(0) | |
3109 | self.specGraphftpCross.setCheckState(0) |
|
3138 | self.specGraphftpCross.setCheckState(0) | |
3110 | else: |
|
3139 | else: | |
3111 | operationCrossSpectraPlot = "Enable" |
|
3140 | operationCrossSpectraPlot = "Enable" | |
3112 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3141 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3113 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3142 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3114 | if parmObj == None: |
|
3143 | if parmObj == None: | |
3115 | self.specGgraphFreq.clear() |
|
3144 | self.specGgraphFreq.clear() | |
3116 | else: |
|
3145 | else: | |
3117 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3146 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3118 | value1 = str(value1) |
|
3147 | value1 = str(value1) | |
3119 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3148 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3120 | value2 = str(value2) |
|
3149 | value2 = str(value2) | |
3121 | value = value1 + "," + value2 |
|
3150 | value = value1 + "," + value2 | |
3122 | self.specGgraphFreq.setText(value) |
|
3151 | self.specGgraphFreq.setText(value) | |
3123 | self.specGgraphFreq.setEnabled(True) |
|
3152 | self.specGgraphFreq.setEnabled(True) | |
3124 |
|
3153 | |||
3125 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3154 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3126 | if parmObj == None: |
|
3155 | if parmObj == None: | |
3127 | self.specGgraphHeight.clear() |
|
3156 | self.specGgraphHeight.clear() | |
3128 | else: |
|
3157 | else: | |
3129 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3158 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3130 | value1 = str(value1) |
|
3159 | value1 = str(value1) | |
3131 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3160 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3132 | value2 = str(value2) |
|
3161 | value2 = str(value2) | |
3133 | value = value1 + "," + value2 |
|
3162 | value = value1 + "," + value2 | |
3134 | self.specGgraphHeight.setText(value) |
|
3163 | self.specGgraphHeight.setText(value) | |
3135 | self.specGgraphHeight.setEnabled(True) |
|
3164 | self.specGgraphHeight.setEnabled(True) | |
3136 |
|
3165 | |||
3137 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3166 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3138 | if parmObj == None: |
|
3167 | if parmObj == None: | |
3139 | self.specGgraphDbsrange.clear() |
|
3168 | self.specGgraphDbsrange.clear() | |
3140 | else: |
|
3169 | else: | |
3141 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3170 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3142 | value1 = str(value1) |
|
3171 | value1 = str(value1) | |
3143 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3172 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3144 | value2 = str(value2) |
|
3173 | value2 = str(value2) | |
3145 | value = value1 + "," + value2 |
|
3174 | value = value1 + "," + value2 | |
3146 | self.specGgraphDbsrange.setText(value) |
|
3175 | self.specGgraphDbsrange.setText(value) | |
3147 | self.specGgraphDbsrange.setEnabled(True) |
|
3176 | self.specGgraphDbsrange.setEnabled(True) | |
3148 |
|
3177 | |||
3149 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3178 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3150 | if parmObj == None: |
|
3179 | if parmObj == None: | |
3151 | self.specGgraphmagnitud.clear() |
|
3180 | self.specGgraphmagnitud.clear() | |
3152 | else: |
|
3181 | else: | |
3153 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3182 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3154 | value1 = str(value1) |
|
3183 | value1 = str(value1) | |
3155 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3184 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3156 | value2 = str(value2) |
|
3185 | value2 = str(value2) | |
3157 | value = value1 + "," + value2 |
|
3186 | value = value1 + "," + value2 | |
3158 | self.specGgraphmagnitud.setText(value) |
|
3187 | self.specGgraphmagnitud.setText(value) | |
3159 | self.specGgraphmagnitud.setEnabled(True) |
|
3188 | self.specGgraphmagnitud.setEnabled(True) | |
3160 |
|
3189 | |||
3161 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3190 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3162 | if parmObj == None: |
|
3191 | if parmObj == None: | |
3163 | self.specGgraphPhase.clear() |
|
3192 | self.specGgraphPhase.clear() | |
3164 | else: |
|
3193 | else: | |
3165 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3194 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3166 | value1 = str(value1) |
|
3195 | value1 = str(value1) | |
3167 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3196 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3168 | value2 = str(value2) |
|
3197 | value2 = str(value2) | |
3169 | value = value1 + "," + value2 |
|
3198 | value = value1 + "," + value2 | |
3170 | self.specGgraphPhase.setText(value) |
|
3199 | self.specGgraphPhase.setText(value) | |
3171 | self.specGgraphPhase.setEnabled(True) |
|
3200 | self.specGgraphPhase.setEnabled(True) | |
3172 |
|
3201 | |||
3173 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3202 | parmObj = opObj.getParameterObj(parameterName="save") | |
3174 | if parmObj == None: |
|
3203 | if parmObj == None: | |
3175 | self.specGraphSaveCross.setCheckState(0) |
|
3204 | self.specGraphSaveCross.setCheckState(0) | |
3176 |
|
||||
3177 | else: |
|
3205 | else: | |
3178 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3206 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3179 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3180 | self.specGraphPath.setText(value) |
|
|||
3181 |
|
3207 | |||
3182 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3208 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3183 | if parmObj == None: |
|
3209 | if parmObj == None: | |
3184 | self.specGraphftpCross.setCheckState(0) |
|
3210 | self.specGraphftpCross.setCheckState(0) | |
3185 | else: |
|
3211 | else: | |
3186 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3212 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3187 | try: |
|
3213 | ||
3188 |
|
|
3214 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3189 |
|
|
3215 | if parmObj: | |
3190 |
|
|
3216 | value = parmObj.getValue() | |
|
3217 | self.specGraphPath.setText(value) | |||
|
3218 | ||||
|
3219 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3220 | if parmObj: | |||
|
3221 | value = parmObj.getValue() | |||
3191 | self.specGgraphftpratio.setText(str(value)) |
|
3222 | self.specGgraphftpratio.setText(str(value)) | |
3192 |
|
3223 | |||
|
3224 | ######################################################## | |||
|
3225 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3226 | if parmObj: | |||
|
3227 | value = parmObj.getValue() | |||
|
3228 | self.temporalFTP.ftp_wei = str(value) | |||
|
3229 | ||||
|
3230 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3231 | if parmObj: | |||
|
3232 | value = parmObj.getValue() | |||
|
3233 | self.temporalFTP.exp_code = str(value) | |||
|
3234 | ||||
|
3235 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3236 | if parmObj: | |||
|
3237 | value = parmObj.getValue() | |||
|
3238 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3239 | ||||
|
3240 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3241 | if parmObj: | |||
|
3242 | value = parmObj.getValue() | |||
|
3243 | self.temporalFTP.plot_pos = str(value) | |||
|
3244 | ||||
3193 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3245 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3194 | # opObj = puObj.getOpObjfromParamValue(value="RTIPlot") |
|
3246 | ||
3195 | if opObj == None: |
|
3247 | if opObj == None: | |
3196 | self.specGraphCebRTIplot.setCheckState(0) |
|
3248 | self.specGraphCebRTIplot.setCheckState(0) | |
3197 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3249 | self.specGraphSaveRTIplot.setCheckState(0) | |
3198 | self.specGraphftpRTIplot.setCheckState(0) |
|
3250 | self.specGraphftpRTIplot.setCheckState(0) | |
3199 | else: |
|
3251 | else: | |
3200 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3252 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3201 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3253 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3202 | if parmObj == None: |
|
3254 | if parmObj == None: | |
3203 | self.specGgraphChannelList.clear() |
|
3255 | self.specGgraphChannelList.clear() | |
3204 | else: |
|
3256 | else: | |
3205 | value = opObj.getParameterValue(parameterName='channelList') |
|
3257 | value = opObj.getParameterValue(parameterName='channelList') | |
3206 | channelListRTIPlot = str(value)[1:-1] |
|
3258 | channelListRTIPlot = str(value)[1:-1] | |
3207 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3259 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3208 | self.specGgraphChannelList.setEnabled(True) |
|
3260 | self.specGgraphChannelList.setEnabled(True) | |
3209 |
|
3261 | |||
3210 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3262 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3211 | if parmObj == None: |
|
3263 | if parmObj == None: | |
3212 | self.specGgraphTminTmax.clear() |
|
3264 | self.specGgraphTminTmax.clear() | |
3213 | else: |
|
3265 | else: | |
3214 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3266 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3215 | value1 = str(value1) |
|
3267 | value1 = str(value1) | |
3216 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3268 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3217 | value2 = str(value2) |
|
3269 | value2 = str(value2) | |
3218 | value = value1 + "," + value2 |
|
3270 | value = value1 + "," + value2 | |
3219 | self.specGgraphTminTmax.setText(value) |
|
3271 | self.specGgraphTminTmax.setText(value) | |
3220 | self.specGgraphTminTmax.setEnabled(True) |
|
3272 | self.specGgraphTminTmax.setEnabled(True) | |
3221 |
|
3273 | |||
3222 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3274 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3223 | if parmObj == None: |
|
3275 | if parmObj == None: | |
3224 | self.specGgraphTimeRange.clear() |
|
3276 | self.specGgraphTimeRange.clear() | |
3225 | else: |
|
3277 | else: | |
3226 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3278 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3227 | value1 = str(value1) |
|
3279 | value1 = str(value1) | |
3228 | self.specGgraphTimeRange.setText(value1) |
|
3280 | self.specGgraphTimeRange.setText(value1) | |
3229 | self.specGgraphTimeRange.setEnabled(True) |
|
3281 | self.specGgraphTimeRange.setEnabled(True) | |
3230 |
|
3282 | |||
3231 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3283 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3232 | if parmObj == None: |
|
3284 | if parmObj == None: | |
3233 | self.specGgraphHeight.clear() |
|
3285 | self.specGgraphHeight.clear() | |
3234 | else: |
|
3286 | else: | |
3235 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3287 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3236 | value1 = str(value1) |
|
3288 | value1 = str(value1) | |
3237 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3289 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3238 | value2 = str(value2) |
|
3290 | value2 = str(value2) | |
3239 | value = value1 + "," + value2 |
|
3291 | value = value1 + "," + value2 | |
3240 | self.specGgraphHeight.setText(value) |
|
3292 | self.specGgraphHeight.setText(value) | |
3241 | self.specGgraphHeight.setEnabled(True) |
|
3293 | self.specGgraphHeight.setEnabled(True) | |
3242 |
|
3294 | |||
3243 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3295 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3244 | if parmObj == None: |
|
3296 | if parmObj == None: | |
3245 | self.specGgraphDbsrange.clear() |
|
3297 | self.specGgraphDbsrange.clear() | |
3246 | else: |
|
3298 | else: | |
3247 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3299 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3248 | value1 = str(value1) |
|
3300 | value1 = str(value1) | |
3249 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3301 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3250 | value2 = str(value2) |
|
3302 | value2 = str(value2) | |
3251 | value = value1 + "," + value2 |
|
3303 | value = value1 + "," + value2 | |
3252 | self.specGgraphDbsrange.setText(value) |
|
3304 | self.specGgraphDbsrange.setText(value) | |
3253 | self.specGgraphDbsrange.setEnabled(True) |
|
3305 | self.specGgraphDbsrange.setEnabled(True) | |
3254 |
|
3306 | |||
3255 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3307 | parmObj = opObj.getParameterObj(parameterName="save") | |
3256 | if parmObj == None: |
|
3308 | if parmObj == None: | |
3257 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3309 | self.specGraphSaveRTIplot.setCheckState(0) | |
3258 | else: |
|
3310 | else: | |
3259 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3311 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3260 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3261 | self.specGraphPath.setText(value) |
|
|||
3262 |
|
3312 | |||
3263 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3313 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3264 | if parmObj == None: |
|
3314 | if parmObj == None: | |
3265 | self.specGraphftpRTIplot.setCheckState(0) |
|
3315 | self.specGraphftpRTIplot.setCheckState(0) | |
3266 | else: |
|
3316 | else: | |
3267 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3317 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3268 | try: |
|
3318 | ||
3269 |
|
|
3319 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3270 |
|
|
3320 | if parmObj: | |
3271 |
|
|
3321 | value = parmObj.getValue() | |
|
3322 | self.specGraphPath.setText(value) | |||
|
3323 | ||||
|
3324 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3325 | if parmObj: | |||
|
3326 | value = parmObj.getValue() | |||
3272 | self.specGgraphftpratio.setText(str(value)) |
|
3327 | self.specGgraphftpratio.setText(str(value)) | |
3273 |
|
3328 | |||
|
3329 | ######################################################## | |||
|
3330 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3331 | if parmObj: | |||
|
3332 | value = parmObj.getValue() | |||
|
3333 | self.temporalFTP.ftp_wei = str(value) | |||
|
3334 | ||||
|
3335 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3336 | if parmObj: | |||
|
3337 | value = parmObj.getValue() | |||
|
3338 | self.temporalFTP.exp_code = str(value) | |||
|
3339 | ||||
|
3340 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3341 | if parmObj: | |||
|
3342 | value = parmObj.getValue() | |||
|
3343 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3344 | ||||
|
3345 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3346 | if parmObj: | |||
|
3347 | value = parmObj.getValue() | |||
|
3348 | self.temporalFTP.plot_pos = str(value) | |||
|
3349 | ||||
3274 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3350 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3275 | # opObj = puObj.getOpObjfromParamValue(value="CoherenceMap") |
|
3351 | ||
3276 | if opObj == None: |
|
3352 | if opObj == None: | |
3277 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3353 | self.specGraphCebCoherencmap.setCheckState(0) | |
3278 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3354 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3279 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3355 | self.specGraphftpCoherencemap.setCheckState(0) | |
3280 | else: |
|
3356 | else: | |
3281 | operationCoherenceMap = "Enable" |
|
3357 | operationCoherenceMap = "Enable" | |
3282 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3358 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3283 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3359 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3284 | if parmObj == None: |
|
3360 | if parmObj == None: | |
3285 | self.specGgraphTminTmax.clear() |
|
3361 | self.specGgraphTminTmax.clear() | |
3286 | else: |
|
3362 | else: | |
3287 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3363 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3288 | value1 = str(value1) |
|
3364 | value1 = str(value1) | |
3289 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3365 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3290 | value2 = str(value2) |
|
3366 | value2 = str(value2) | |
3291 | value = value1 + "," + value2 |
|
3367 | value = value1 + "," + value2 | |
3292 | self.specGgraphTminTmax.setText(value) |
|
3368 | self.specGgraphTminTmax.setText(value) | |
3293 | self.specGgraphTminTmax.setEnabled(True) |
|
3369 | self.specGgraphTminTmax.setEnabled(True) | |
3294 |
|
3370 | |||
3295 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3371 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3296 | if parmObj == None: |
|
3372 | if parmObj == None: | |
3297 | self.specGgraphTimeRange.clear() |
|
3373 | self.specGgraphTimeRange.clear() | |
3298 | else: |
|
3374 | else: | |
3299 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3375 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3300 | value1 = str(value1) |
|
3376 | value1 = str(value1) | |
3301 | self.specGgraphTimeRange.setText(value1) |
|
3377 | self.specGgraphTimeRange.setText(value1) | |
3302 | self.specGgraphTimeRange.setEnabled(True) |
|
3378 | self.specGgraphTimeRange.setEnabled(True) | |
3303 |
|
3379 | |||
3304 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3380 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3305 | if parmObj == None: |
|
3381 | if parmObj == None: | |
3306 | self.specGgraphHeight.clear() |
|
3382 | self.specGgraphHeight.clear() | |
3307 | else: |
|
3383 | else: | |
3308 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3384 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3309 | value1 = str(value1) |
|
3385 | value1 = str(value1) | |
3310 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3386 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3311 | value2 = str(value2) |
|
3387 | value2 = str(value2) | |
3312 | value = value1 + "," + value2 |
|
3388 | value = value1 + "," + value2 | |
3313 | self.specGgraphHeight.setText(value) |
|
3389 | self.specGgraphHeight.setText(value) | |
3314 | self.specGgraphHeight.setEnabled(True) |
|
3390 | self.specGgraphHeight.setEnabled(True) | |
3315 |
|
3391 | |||
3316 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3392 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3317 | if parmObj == None: |
|
3393 | if parmObj == None: | |
3318 | self.specGgraphmagnitud.clear() |
|
3394 | self.specGgraphmagnitud.clear() | |
3319 | else: |
|
3395 | else: | |
3320 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3396 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3321 | value1 = str(value1) |
|
3397 | value1 = str(value1) | |
3322 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3398 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3323 | value2 = str(value2) |
|
3399 | value2 = str(value2) | |
3324 | value = value1 + "," + value2 |
|
3400 | value = value1 + "," + value2 | |
3325 | self.specGgraphmagnitud.setText(value) |
|
3401 | self.specGgraphmagnitud.setText(value) | |
3326 | self.specGgraphmagnitud.setEnabled(True) |
|
3402 | self.specGgraphmagnitud.setEnabled(True) | |
3327 |
|
3403 | |||
3328 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3404 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3329 | if parmObj == None: |
|
3405 | if parmObj == None: | |
3330 | self.specGgraphmagnitud.clear() |
|
3406 | self.specGgraphmagnitud.clear() | |
3331 | else: |
|
3407 | else: | |
3332 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3408 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3333 | value1 = str(value1) |
|
3409 | value1 = str(value1) | |
3334 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3410 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3335 | value2 = str(value2) |
|
3411 | value2 = str(value2) | |
3336 | value = value1 + "," + value2 |
|
3412 | value = value1 + "," + value2 | |
3337 | self.specGgraphmagnitud.setText(value) |
|
3413 | self.specGgraphmagnitud.setText(value) | |
3338 | self.specGgraphmagnitud.setEnabled(True) |
|
3414 | self.specGgraphmagnitud.setEnabled(True) | |
3339 |
|
3415 | |||
3340 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3416 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3341 | if parmObj == None: |
|
3417 | if parmObj == None: | |
3342 | self.specGgraphPhase.clear() |
|
3418 | self.specGgraphPhase.clear() | |
3343 | else: |
|
3419 | else: | |
3344 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3420 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3345 | value1 = str(value1) |
|
3421 | value1 = str(value1) | |
3346 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3422 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3347 | value2 = str(value2) |
|
3423 | value2 = str(value2) | |
3348 | value = value1 + "," + value2 |
|
3424 | value = value1 + "," + value2 | |
3349 | self.specGgraphPhase.setText(value) |
|
3425 | self.specGgraphPhase.setText(value) | |
3350 | self.specGgraphPhase.setEnabled(True) |
|
3426 | self.specGgraphPhase.setEnabled(True) | |
3351 |
|
3427 | |||
3352 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3428 | parmObj = opObj.getParameterObj(parameterName="save") | |
3353 | if parmObj == None: |
|
3429 | if parmObj == None: | |
3354 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3430 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3355 | else: |
|
3431 | else: | |
3356 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3432 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3357 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3358 | self.specGraphPath.setText(value) |
|
|||
3359 |
|
3433 | |||
3360 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3434 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3361 | if parmObj == None: |
|
3435 | if parmObj == None: | |
3362 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3436 | self.specGraphftpCoherencemap.setCheckState(0) | |
3363 | else: |
|
3437 | else: | |
3364 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3438 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3365 | try: |
|
3439 | ||
3366 |
|
|
3440 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3367 |
|
|
3441 | if parmObj: | |
3368 |
|
|
3442 | value = parmObj.getValue() | |
|
3443 | self.specGraphPath.setText(value) | |||
|
3444 | ||||
|
3445 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3446 | if parmObj: | |||
|
3447 | value = parmObj.getValue() | |||
3369 | self.specGgraphftpratio.setText(str(value)) |
|
3448 | self.specGgraphftpratio.setText(str(value)) | |
3370 |
|
3449 | |||
|
3450 | ######################################################## | |||
|
3451 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3452 | if parmObj: | |||
|
3453 | value = parmObj.getValue() | |||
|
3454 | self.temporalFTP.ftp_wei = str(value) | |||
|
3455 | ||||
|
3456 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3457 | if parmObj: | |||
|
3458 | value = parmObj.getValue() | |||
|
3459 | self.temporalFTP.exp_code = str(value) | |||
|
3460 | ||||
|
3461 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3462 | if parmObj: | |||
|
3463 | value = parmObj.getValue() | |||
|
3464 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3465 | ||||
|
3466 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3467 | if parmObj: | |||
|
3468 | value = parmObj.getValue() | |||
|
3469 | self.temporalFTP.plot_pos = str(value) | |||
|
3470 | ||||
3371 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3471 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3372 | # opObj = puObj.getOpObjfromParamValue(value="PowerProfilePlot") |
|
3472 | ||
3373 | if opObj == None: |
|
3473 | if opObj == None: | |
3374 | self.specGraphPowerprofile.setCheckState(0) |
|
3474 | self.specGraphPowerprofile.setCheckState(0) | |
3375 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3475 | self.specGraphSavePowerprofile.setCheckState(0) | |
3376 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3476 | self.specGraphftpPowerprofile.setCheckState(0) | |
3377 | operationPowerProfilePlot = "Disabled" |
|
3477 | operationPowerProfilePlot = "Disabled" | |
3378 | channelList = None |
|
3478 | channelList = None | |
3379 | freq_vel = None |
|
3479 | freq_vel = None | |
3380 | heightsrange = None |
|
3480 | heightsrange = None | |
3381 | else: |
|
3481 | else: | |
3382 | operationPowerProfilePlot = "Enable" |
|
3482 | operationPowerProfilePlot = "Enable" | |
3383 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3483 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3384 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3484 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3385 | if parmObj == None: |
|
3485 | if parmObj == None: | |
3386 | self.specGgraphDbsrange.clear() |
|
3486 | self.specGgraphDbsrange.clear() | |
3387 | else: |
|
3487 | else: | |
3388 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3488 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3389 | value1 = str(value1) |
|
3489 | value1 = str(value1) | |
3390 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3490 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3391 | value2 = str(value2) |
|
3491 | value2 = str(value2) | |
3392 | value = value1 + "," + value2 |
|
3492 | value = value1 + "," + value2 | |
3393 | self.specGgraphDbsrange.setText(value) |
|
3493 | self.specGgraphDbsrange.setText(value) | |
3394 | self.specGgraphDbsrange.setEnabled(True) |
|
3494 | self.specGgraphDbsrange.setEnabled(True) | |
3395 |
|
3495 | |||
3396 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3496 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3397 | if parmObj == None: |
|
3497 | if parmObj == None: | |
3398 | self.specGgraphHeight.clear() |
|
3498 | self.specGgraphHeight.clear() | |
3399 | else: |
|
3499 | else: | |
3400 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3500 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3401 | value1 = str(value1) |
|
3501 | value1 = str(value1) | |
3402 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3502 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3403 | value2 = str(value2) |
|
3503 | value2 = str(value2) | |
3404 | value = value1 + "," + value2 |
|
3504 | value = value1 + "," + value2 | |
3405 | self.specGgraphHeight.setText(value) |
|
3505 | self.specGgraphHeight.setText(value) | |
3406 | self.specGgraphHeight.setEnabled(True) |
|
3506 | self.specGgraphHeight.setEnabled(True) | |
3407 |
|
3507 | |||
3408 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3508 | parmObj = opObj.getParameterObj(parameterName="save") | |
3409 | if parmObj == None: |
|
3509 | if parmObj == None: | |
3410 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3510 | self.specGraphSavePowerprofile.setCheckState(0) | |
3411 | else: |
|
3511 | else: | |
3412 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3512 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3413 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3414 | self.specGraphPath.setText(value) |
|
|||
3415 |
|
3513 | |||
3416 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3514 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3417 | if parmObj == None: |
|
3515 | if parmObj == None: | |
3418 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3516 | self.specGraphftpPowerprofile.setCheckState(0) | |
3419 | else: |
|
3517 | else: | |
3420 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3518 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3421 | try: |
|
3519 | ||
3422 |
|
|
3520 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3423 |
|
|
3521 | if parmObj: | |
3424 |
|
|
3522 | value = parmObj.getValue() | |
|
3523 | self.specGraphPath.setText(value) | |||
|
3524 | ||||
|
3525 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3526 | if parmObj: | |||
|
3527 | value = parmObj.getValue() | |||
3425 | self.specGgraphftpratio.setText(str(value)) |
|
3528 | self.specGgraphftpratio.setText(str(value)) | |
3426 |
|
|
3529 | ||
|
3530 | ######################################################## | |||
|
3531 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3532 | if parmObj: | |||
|
3533 | value = parmObj.getValue() | |||
|
3534 | self.temporalFTP.ftp_wei = str(value) | |||
|
3535 | ||||
|
3536 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3537 | if parmObj: | |||
|
3538 | value = parmObj.getValue() | |||
|
3539 | self.temporalFTP.exp_code = str(value) | |||
|
3540 | ||||
|
3541 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3542 | if parmObj: | |||
|
3543 | value = parmObj.getValue() | |||
|
3544 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3545 | ||||
|
3546 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3547 | if parmObj: | |||
|
3548 | value = parmObj.getValue() | |||
|
3549 | self.temporalFTP.plot_pos = str(value) | |||
|
3550 | ||||
3427 | opObj = puObj.getOperationObj(name='Noise') |
|
3551 | opObj = puObj.getOperationObj(name='Noise') | |
3428 | # opObj = puObj.getOpObjfromParamValue(value="Noise") |
|
3552 | ||
3429 | if opObj == None: |
|
3553 | if opObj == None: | |
3430 | self.specGraphCebRTInoise.setCheckState(0) |
|
3554 | self.specGraphCebRTInoise.setCheckState(0) | |
3431 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3555 | self.specGraphSaveRTInoise.setCheckState(0) | |
3432 | self.specGraphftpRTInoise.setCheckState(0) |
|
3556 | self.specGraphftpRTInoise.setCheckState(0) | |
3433 | else: |
|
3557 | else: | |
3434 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3558 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3435 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3559 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3436 | if parmObj == None: |
|
3560 | if parmObj == None: | |
3437 | self.specGgraphChannelList.clear() |
|
3561 | self.specGgraphChannelList.clear() | |
3438 | else: |
|
3562 | else: | |
3439 | value = opObj.getParameterValue(parameterName='channelList') |
|
3563 | value = opObj.getParameterValue(parameterName='channelList') | |
3440 | channelListRTINoise = str(value)[1:-1] |
|
3564 | channelListRTINoise = str(value)[1:-1] | |
3441 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3565 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3442 | self.specGgraphChannelList.setEnabled(True) |
|
3566 | self.specGgraphChannelList.setEnabled(True) | |
3443 |
|
3567 | |||
3444 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3568 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3445 | if parmObj == None: |
|
3569 | if parmObj == None: | |
3446 | self.specGgraphTminTmax.clear() |
|
3570 | self.specGgraphTminTmax.clear() | |
3447 | else: |
|
3571 | else: | |
3448 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3572 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3449 | value1 = str(value1) |
|
3573 | value1 = str(value1) | |
3450 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3574 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3451 | value2 = str(value2) |
|
3575 | value2 = str(value2) | |
3452 | value = value1 + "," + value2 |
|
3576 | value = value1 + "," + value2 | |
3453 | self.specGgraphTminTmax.setText(value) |
|
3577 | self.specGgraphTminTmax.setText(value) | |
3454 | self.specGgraphTminTmax.setEnabled(True) |
|
3578 | self.specGgraphTminTmax.setEnabled(True) | |
3455 |
|
3579 | |||
3456 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3580 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3457 | if parmObj == None: |
|
3581 | if parmObj == None: | |
3458 | self.specGgraphTimeRange.clear() |
|
3582 | self.specGgraphTimeRange.clear() | |
3459 | else: |
|
3583 | else: | |
3460 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3584 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3461 | value1 = str(value1) |
|
3585 | value1 = str(value1) | |
3462 | self.specGgraphTimeRange.setText(value1) |
|
3586 | self.specGgraphTimeRange.setText(value1) | |
3463 | self.specGgraphTimeRange.setEnabled(True) |
|
3587 | self.specGgraphTimeRange.setEnabled(True) | |
3464 |
|
3588 | |||
3465 |
|
3589 | |||
3466 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3590 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3467 | if parmObj == None: |
|
3591 | if parmObj == None: | |
3468 | self.specGgraphDbsrange.clear() |
|
3592 | self.specGgraphDbsrange.clear() | |
3469 | else: |
|
3593 | else: | |
3470 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3594 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3471 | value1 = str(value1) |
|
3595 | value1 = str(value1) | |
3472 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3596 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3473 | value2 = str(value2) |
|
3597 | value2 = str(value2) | |
3474 | value = value1 + "," + value2 |
|
3598 | value = value1 + "," + value2 | |
3475 | self.specGgraphDbsrange.setText(value) |
|
3599 | self.specGgraphDbsrange.setText(value) | |
3476 | self.specGgraphDbsrange.setEnabled(True) |
|
3600 | self.specGgraphDbsrange.setEnabled(True) | |
3477 |
|
3601 | |||
3478 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3602 | parmObj = opObj.getParameterObj(parameterName="save") | |
3479 | if parmObj == None: |
|
3603 | if parmObj == None: | |
3480 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3604 | self.specGraphSaveRTInoise.setCheckState(0) | |
3481 | else: |
|
3605 | else: | |
3482 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3606 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3483 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3484 | self.specGraphPath.setText(value) |
|
|||
3485 |
|
3607 | |||
3486 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3608 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3487 | if parmObj == None: |
|
3609 | if parmObj == None: | |
3488 | self.specGraphftpRTInoise.setCheckState(0) |
|
3610 | self.specGraphftpRTInoise.setCheckState(0) | |
3489 | else: |
|
3611 | else: | |
3490 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3612 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3491 | try: |
|
3613 | ||
3492 |
|
|
3614 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3493 |
|
|
3615 | if parmObj: | |
3494 |
|
|
3616 | value = parmObj.getValue() | |
|
3617 | self.specGraphPath.setText(value) | |||
|
3618 | ||||
|
3619 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3620 | if parmObj: | |||
|
3621 | value = parmObj.getValue() | |||
3495 | self.specGgraphftpratio.setText(str(value)) |
|
3622 | self.specGgraphftpratio.setText(str(value)) | |
3496 |
|
3623 | |||
3497 | # outputSpectraWrite |
|
3624 | ######################################################## | |
|
3625 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3626 | if parmObj: | |||
|
3627 | value = parmObj.getValue() | |||
|
3628 | self.temporalFTP.ftp_wei = str(value) | |||
|
3629 | ||||
|
3630 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3631 | if parmObj: | |||
|
3632 | value = parmObj.getValue() | |||
|
3633 | self.temporalFTP.exp_code = str(value) | |||
|
3634 | ||||
|
3635 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3636 | if parmObj: | |||
|
3637 | value = parmObj.getValue() | |||
|
3638 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3639 | ||||
|
3640 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3641 | if parmObj: | |||
|
3642 | value = parmObj.getValue() | |||
|
3643 | self.temporalFTP.plot_pos = str(value) | |||
|
3644 | ||||
3498 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3645 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3499 | if opObj == None: |
|
3646 | if opObj == None: | |
3500 | self.specOutputPath.clear() |
|
3647 | self.specOutputPath.clear() | |
3501 | self.specOutputblocksperfile.clear() |
|
3648 | self.specOutputblocksperfile.clear() | |
3502 | self.specOutputprofileperblock.clear() |
|
3649 | self.specOutputprofileperblock.clear() | |
3503 | else: |
|
3650 | else: | |
3504 | value = opObj.getParameterObj(parameterName='path') |
|
3651 | value = opObj.getParameterObj(parameterName='path') | |
3505 | if value == None: |
|
3652 | if value == None: | |
3506 | self.specOutputPath.clear() |
|
3653 | self.specOutputPath.clear() | |
3507 | else: |
|
3654 | else: | |
3508 | value = opObj.getParameterValue(parameterName='path') |
|
3655 | value = opObj.getParameterValue(parameterName='path') | |
3509 | path = str(value) |
|
3656 | path = str(value) | |
3510 | self.specOutputPath.setText(path) |
|
3657 | self.specOutputPath.setText(path) | |
3511 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3658 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3512 | if value == None: |
|
3659 | if value == None: | |
3513 | self.specOutputblocksperfile.clear() |
|
3660 | self.specOutputblocksperfile.clear() | |
3514 | else: |
|
3661 | else: | |
3515 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3662 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3516 | blocksperfile = str(value) |
|
3663 | blocksperfile = str(value) | |
3517 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3664 | self.specOutputblocksperfile.setText(blocksperfile) | |
3518 | value = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
3665 | value = opObj.getParameterObj(parameterName='profilesPerBlock') | |
3519 | if value == None: |
|
3666 | if value == None: | |
3520 | self.specOutputprofileperblock.clear() |
|
3667 | self.specOutputprofileperblock.clear() | |
3521 | else: |
|
3668 | else: | |
3522 | value = opObj.getParameterValue(parameterName='profilesPerBlock') |
|
3669 | value = opObj.getParameterValue(parameterName='profilesPerBlock') | |
3523 | profilesPerBlock = str(value) |
|
3670 | profilesPerBlock = str(value) | |
3524 | self.specOutputprofileperblock.setText(profilesPerBlock) |
|
3671 | self.specOutputprofileperblock.setText(profilesPerBlock) | |
3525 |
|
3672 | |||
3526 | return |
|
3673 | return | |
3527 |
|
3674 | |||
3528 | def __refreshSpectraHeisWindow(self, puObj): |
|
3675 | def __refreshSpectraHeisWindow(self, puObj): | |
3529 |
|
3676 | |||
3530 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3677 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3531 | if opObj == None: |
|
3678 | if opObj == None: | |
3532 | self.specHeisOpIncoherent.clear() |
|
3679 | self.specHeisOpIncoherent.clear() | |
3533 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3680 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3534 | else: |
|
3681 | else: | |
3535 | for parmObj in opObj.getParameterObjList(): |
|
3682 | for parmObj in opObj.getParameterObjList(): | |
3536 | if parmObj.name == 'timeInterval': |
|
3683 | if parmObj.name == 'timeInterval': | |
3537 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3684 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3538 | value = float(value) |
|
3685 | value = float(value) | |
3539 | self.specHeisOpIncoherent.setText(str(value)) |
|
3686 | self.specHeisOpIncoherent.setText(str(value)) | |
3540 | self.specHeisOpIncoherent.setEnabled(True) |
|
3687 | self.specHeisOpIncoherent.setEnabled(True) | |
3541 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3688 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3542 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3689 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3543 |
|
3690 | |||
3544 | # SpectraHeis Graph |
|
3691 | # SpectraHeis Graph | |
|
3692 | ||||
|
3693 | self.specHeisGgraphXminXmax.clear() | |||
|
3694 | self.specHeisGgraphYminYmax.clear() | |||
|
3695 | ||||
|
3696 | self.specHeisGgraphChannelList.clear() | |||
|
3697 | self.specHeisGgraphTminTmax.clear() | |||
|
3698 | self.specHeisGgraphTimeRange.clear() | |||
|
3699 | self.specHeisGgraphftpratio.clear() | |||
|
3700 | ||||
3545 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3701 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3546 | # opObj = puObj.getOpObjfromParamValue(value="SpectraHeisScope") |
|
|||
3547 | if opObj == None: |
|
3702 | if opObj == None: | |
3548 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3703 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3549 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3704 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3550 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3705 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3551 |
|
||||
3552 | else: |
|
3706 | else: | |
3553 | operationSpectraHeisScope = "Enable" |
|
3707 | operationSpectraHeisScope = "Enable" | |
3554 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3708 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
|
3709 | ||||
3555 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3710 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3556 | if parmObj == None: |
|
3711 | if parmObj == None: | |
3557 | self.specHeisGgraphChannelList.clear() |
|
3712 | self.specHeisGgraphChannelList.clear() | |
3558 | else: |
|
3713 | else: | |
3559 | value = opObj.getParameterValue(parameterName='channelList') |
|
3714 | value = opObj.getParameterValue(parameterName='channelList') | |
3560 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3715 | channelListSpectraHeisScope = str(value)[1:-1] | |
3561 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3716 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3562 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3717 | self.specHeisGgraphChannelList.setEnabled(True) | |
3563 |
|
3718 | |||
3564 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3719 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3565 | if parmObj == None: |
|
3720 | if parmObj == None: | |
3566 | self.specHeisGgraphXminXmax.clear() |
|
3721 | self.specHeisGgraphXminXmax.clear() | |
3567 | else: |
|
3722 | else: | |
3568 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3723 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3569 | value1 = str(value1) |
|
3724 | value1 = str(value1) | |
3570 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3725 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3571 | value2 = str(value2) |
|
3726 | value2 = str(value2) | |
3572 | value = value1 + "," + value2 |
|
3727 | value = value1 + "," + value2 | |
3573 | self.specHeisGgraphXminXmax.setText(value) |
|
3728 | self.specHeisGgraphXminXmax.setText(value) | |
3574 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3729 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3575 |
|
3730 | |||
3576 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3731 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3577 | if parmObj == None: |
|
3732 | if parmObj == None: | |
3578 | self.specHeisGgraphYminYmax.clear() |
|
3733 | self.specHeisGgraphYminYmax.clear() | |
3579 | else: |
|
3734 | else: | |
3580 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3735 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3581 | value1 = str(value1) |
|
3736 | value1 = str(value1) | |
3582 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3737 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3583 | value2 = str(value2) |
|
3738 | value2 = str(value2) | |
3584 | value = value1 + "," + value2 |
|
3739 | value = value1 + "," + value2 | |
3585 | self.specHeisGgraphYminYmax.setText(value) |
|
3740 | self.specHeisGgraphYminYmax.setText(value) | |
3586 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3741 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3587 |
|
3742 | |||
3588 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3743 | parmObj = opObj.getParameterObj(parameterName="save") | |
3589 | if parmObj == None: |
|
3744 | if parmObj == None: | |
3590 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3745 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3591 | else: |
|
3746 | else: | |
3592 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3747 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3593 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3594 | self.specHeisGraphPath.setText(value) |
|
|||
3595 |
|
3748 | |||
3596 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3749 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3597 | if parmObj == None: |
|
3750 | if parmObj == None: | |
3598 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3751 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3599 | else: |
|
3752 | else: | |
3600 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3753 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3601 | try: |
|
3754 | ||
3602 |
|
|
3755 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3603 |
|
|
3756 | if parmObj: | |
3604 |
|
|
3757 | value = parmObj.getValue() | |
|
3758 | self.specHeisGraphPath.setText(value) | |||
|
3759 | ||||
|
3760 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3761 | if parmObj: | |||
|
3762 | value = parmObj.getValue() | |||
3605 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3763 | self.specHeisGgraphftpratio.setText(str(value)) | |
3606 |
|
3764 | |||
|
3765 | ######################################################## | |||
|
3766 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3767 | if parmObj: | |||
|
3768 | value = parmObj.getValue() | |||
|
3769 | self.temporalFTP.ftp_wei = str(value) | |||
|
3770 | ||||
|
3771 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3772 | if parmObj: | |||
|
3773 | value = parmObj.getValue() | |||
|
3774 | self.temporalFTP.exp_code = str(value) | |||
|
3775 | ||||
|
3776 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3777 | if parmObj: | |||
|
3778 | value = parmObj.getValue() | |||
|
3779 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3780 | ||||
|
3781 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3782 | if parmObj: | |||
|
3783 | value = parmObj.getValue() | |||
|
3784 | self.temporalFTP.plot_pos = str(value) | |||
|
3785 | ||||
3607 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3786 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3608 | # opObj = puObj.getOpObjfromParamValue(value="RTIfromSpectraHeis") |
|
3787 | ||
3609 | if opObj == None: |
|
3788 | if opObj == None: | |
3610 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3789 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3611 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3790 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3612 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3791 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3613 | else: |
|
3792 | else: | |
3614 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3793 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3615 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3794 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3616 | if parmObj == None: |
|
3795 | if parmObj == None: | |
3617 | self.specHeisGgraphChannelList.clear() |
|
3796 | self.specHeisGgraphChannelList.clear() | |
3618 | else: |
|
3797 | else: | |
3619 | value = opObj.getParameterValue(parameterName='channelList') |
|
3798 | value = opObj.getParameterValue(parameterName='channelList') | |
3620 | channelListRTIPlot = str(value)[1:-1] |
|
3799 | channelListRTIPlot = str(value)[1:-1] | |
3621 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3800 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3622 | self.specGgraphChannelList.setEnabled(True) |
|
3801 | self.specGgraphChannelList.setEnabled(True) | |
3623 |
|
3802 | |||
3624 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3803 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3625 | if parmObj == None: |
|
3804 | if parmObj == None: | |
3626 | self.specHeisGgraphTminTmax.clear() |
|
3805 | self.specHeisGgraphTminTmax.clear() | |
3627 | else: |
|
3806 | else: | |
3628 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3807 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3629 | value1 = str(value1) |
|
3808 | value1 = str(value1) | |
3630 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3809 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3631 | value2 = str(value2) |
|
3810 | value2 = str(value2) | |
3632 | value = value1 + "," + value2 |
|
3811 | value = value1 + "," + value2 | |
3633 | self.specHeisGgraphTminTmax.setText(value) |
|
3812 | self.specHeisGgraphTminTmax.setText(value) | |
3634 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3813 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3635 |
|
3814 | |||
3636 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3815 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3637 | if parmObj == None: |
|
3816 | if parmObj == None: | |
3638 | self.specGgraphTimeRange.clear() |
|
3817 | self.specGgraphTimeRange.clear() | |
3639 | else: |
|
3818 | else: | |
3640 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3819 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3641 | value1 = str(value1) |
|
3820 | value1 = str(value1) | |
3642 | self.specHeisGgraphTimeRange.setText(value1) |
|
3821 | self.specHeisGgraphTimeRange.setText(value1) | |
3643 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3822 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3644 |
|
3823 | |||
3645 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3824 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3646 | if parmObj == None: |
|
3825 | if parmObj == None: | |
3647 | self.specHeisGgraphYminYmax.clear() |
|
3826 | self.specHeisGgraphYminYmax.clear() | |
3648 | else: |
|
3827 | else: | |
3649 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3828 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3650 | value1 = str(value1) |
|
3829 | value1 = str(value1) | |
3651 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3830 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3652 | value2 = str(value2) |
|
3831 | value2 = str(value2) | |
3653 | value = value1 + "," + value2 |
|
3832 | value = value1 + "," + value2 | |
3654 | self.specHeisGgraphYminYmax.setText(value) |
|
3833 | self.specHeisGgraphYminYmax.setText(value) | |
3655 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3834 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3656 |
|
3835 | |||
3657 |
parmObj = opObj.getParameterObj(parameterName=" |
|
3836 | parmObj = opObj.getParameterObj(parameterName="save") | |
3658 | if parmObj == None: |
|
3837 | if parmObj == None: | |
3659 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3838 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3660 | else: |
|
3839 | else: | |
3661 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3840 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3662 | value = opObj.getParameterValue(parameterName='figpath') |
|
|||
3663 | self.specHeisGraphPath.setText(value) |
|
|||
3664 |
|
3841 | |||
3665 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3842 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3666 | if parmObj == None: |
|
3843 | if parmObj == None: | |
3667 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3844 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3668 | else: |
|
3845 | else: | |
3669 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3846 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3670 | try: |
|
3847 | ||
3671 |
|
|
3848 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3672 |
|
|
3849 | if parmObj: | |
3673 |
|
|
3850 | value = parmObj.getValue() | |
|
3851 | self.specHeisGraphPath.setText(value) | |||
|
3852 | ||||
|
3853 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |||
|
3854 | if parmObj: | |||
|
3855 | value = parmObj.getValue() | |||
3674 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3856 | self.specHeisGgraphftpratio.setText(str(value)) | |
3675 |
|
3857 | |||
|
3858 | ######################################################## | |||
|
3859 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |||
|
3860 | if parmObj: | |||
|
3861 | value = parmObj.getValue() | |||
|
3862 | self.temporalFTP.ftp_wei = str(value) | |||
|
3863 | ||||
|
3864 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |||
|
3865 | if parmObj: | |||
|
3866 | value = parmObj.getValue() | |||
|
3867 | self.temporalFTP.exp_code = str(value) | |||
|
3868 | ||||
|
3869 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |||
|
3870 | if parmObj: | |||
|
3871 | value = parmObj.getValue() | |||
|
3872 | self.temporalFTP.sub_exp_code = str(value) | |||
|
3873 | ||||
|
3874 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |||
|
3875 | if parmObj: | |||
|
3876 | value = parmObj.getValue() | |||
|
3877 | self.temporalFTP.plot_pos = str(value) | |||
|
3878 | ||||
3676 | # outputSpectraHeisWrite |
|
3879 | # outputSpectraHeisWrite | |
3677 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3880 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3678 | if opObj == None: |
|
3881 | if opObj == None: | |
3679 | self.specHeisOutputPath.clear() |
|
3882 | self.specHeisOutputPath.clear() | |
3680 | self.specHeisOutputblocksperfile.clear() |
|
3883 | self.specHeisOutputblocksperfile.clear() | |
3681 | self.specHeisOutputMetada.clear() |
|
3884 | self.specHeisOutputMetada.clear() | |
3682 | else: |
|
3885 | else: | |
3683 | value = opObj.getParameterObj(parameterName='path') |
|
3886 | value = opObj.getParameterObj(parameterName='path') | |
3684 | if value == None: |
|
3887 | if value == None: | |
3685 | self.specHeisOutputPath.clear() |
|
3888 | self.specHeisOutputPath.clear() | |
3686 | else: |
|
3889 | else: | |
3687 | value = opObj.getParameterValue(parameterName='path') |
|
3890 | value = opObj.getParameterValue(parameterName='path') | |
3688 | path = str(value) |
|
3891 | path = str(value) | |
3689 | self.specHeisOutputPath.setText(path) |
|
3892 | self.specHeisOutputPath.setText(path) | |
3690 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3893 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3691 | if value == None: |
|
3894 | if value == None: | |
3692 | self.specHeisOutputblocksperfile.clear() |
|
3895 | self.specHeisOutputblocksperfile.clear() | |
3693 | else: |
|
3896 | else: | |
3694 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3897 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3695 | blocksperfile = str(value) |
|
3898 | blocksperfile = str(value) | |
3696 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3899 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3697 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3900 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3698 | if value == None: |
|
3901 | if value == None: | |
3699 | self.specHeisOutputMetada.clear() |
|
3902 | self.specHeisOutputMetada.clear() | |
3700 | else: |
|
3903 | else: | |
3701 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3904 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3702 | metada = str(value) |
|
3905 | metada = str(value) | |
3703 | self.specHeisOutputMetada.setText(metada) |
|
3906 | self.specHeisOutputMetada.setText(metada) | |
3704 |
|
3907 | |||
3705 | return |
|
3908 | return | |
3706 |
|
3909 | |||
3707 | def __refreshCorrelationWindow(self, puObj): |
|
3910 | def __refreshCorrelationWindow(self, puObj): | |
3708 | pass |
|
3911 | pass | |
3709 |
|
3912 | |||
3710 | def refreshPUWindow(self, puObj): |
|
3913 | def refreshPUWindow(self, puObj): | |
3711 |
|
3914 | |||
3712 | if puObj.datatype == 'Voltage': |
|
3915 | if puObj.datatype == 'Voltage': | |
3713 | self.__refreshVoltageWindow(puObj) |
|
3916 | self.__refreshVoltageWindow(puObj) | |
3714 |
|
3917 | |||
3715 | if puObj.datatype == 'Spectra': |
|
3918 | if puObj.datatype == 'Spectra': | |
3716 | self.__refreshSpectraWindow(puObj) |
|
3919 | self.__refreshSpectraWindow(puObj) | |
3717 |
|
3920 | |||
3718 | if puObj.datatype == 'SpectraHeis': |
|
3921 | if puObj.datatype == 'SpectraHeis': | |
3719 | self.__refreshSpectraHeisWindow(puObj) |
|
3922 | self.__refreshSpectraHeisWindow(puObj) | |
3720 |
|
3923 | |||
3721 | def refreshProjectProperties(self, projectObjView): |
|
3924 | def refreshProjectProperties(self, projectObjView): | |
3722 |
|
3925 | |||
3723 | propertyBuffObj = PropertyBuffer() |
|
3926 | propertyBuffObj = PropertyBuffer() | |
3724 | name = projectObjView.name |
|
3927 | name = projectObjView.name | |
3725 |
|
3928 | |||
3726 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3929 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3727 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3930 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3728 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3931 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3729 |
|
3932 | |||
3730 | readUnitObj = projectObjView.getReadUnitObj() |
|
3933 | readUnitObj = projectObjView.getReadUnitObj() | |
3731 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3934 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3732 |
|
3935 | |||
3733 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3936 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3734 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3937 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3735 |
|
3938 | |||
3736 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3939 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3737 |
|
3940 | |||
3738 | self.treeProjectProperties.setModel(propertiesModel) |
|
3941 | self.treeProjectProperties.setModel(propertiesModel) | |
3739 | self.treeProjectProperties.expandAll() |
|
3942 | self.treeProjectProperties.expandAll() | |
3740 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3943 | self.treeProjectProperties.resizeColumnToContents(0) | |
3741 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3944 | self.treeProjectProperties.resizeColumnToContents(1) | |
3742 |
|
3945 | |||
3743 | def refreshPUProperties(self, puObjView): |
|
3946 | def refreshPUProperties(self, puObjView): | |
3744 |
|
3947 | |||
|
3948 | ############ FTP CONFIG ################################ | |||
|
3949 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |||
|
3950 | self.__puLocalFolder2FTP.pop(puObjView.id) | |||
|
3951 | ######################################################## | |||
|
3952 | ||||
3745 | propertyBuffObj = PropertyBuffer() |
|
3953 | propertyBuffObj = PropertyBuffer() | |
3746 |
|
3954 | |||
3747 | for thisOp in puObjView.getOperationObjList(): |
|
3955 | for thisOp in puObjView.getOperationObjList(): | |
3748 |
|
3956 | |||
3749 | operationName = thisOp.name |
|
3957 | operationName = thisOp.name | |
|
3958 | ||||
3750 | if operationName == 'run': |
|
3959 | if operationName == 'run': | |
3751 | operationName = 'Properties' |
|
3960 | operationName = 'Properties' | |
3752 |
|
|
3961 | ||
3753 | if not thisOp.getParameterObjList(): |
|
3962 | if not thisOp.getParameterObjList(): | |
3754 | propertyBuffObj.append(operationName, '--', '--') |
|
3963 | propertyBuffObj.append(operationName, '--', '--') | |
|
3964 | continue | |||
3755 |
|
3965 | |||
3756 | for thisParmObj in thisOp.getParameterObjList(): |
|
3966 | for thisParmObj in thisOp.getParameterObjList(): | |
3757 |
|
||||
3758 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3967 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3759 |
|
3968 | |||
|
3969 | ############ FTP CONFIG ################################ | |||
|
3970 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |||
|
3971 | figpath = thisOp.getParameterValue('figpath') | |||
|
3972 | if not figpath: | |||
|
3973 | continue | |||
|
3974 | self.__puLocalFolder2FTP[puObjView.id] = figpath | |||
|
3975 | ######################################################## | |||
|
3976 | ||||
3760 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3977 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3761 |
|
3978 | |||
3762 | self.treeProjectProperties.setModel(propertiesModel) |
|
3979 | self.treeProjectProperties.setModel(propertiesModel) | |
3763 | self.treeProjectProperties.expandAll() |
|
3980 | self.treeProjectProperties.expandAll() | |
3764 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3981 | self.treeProjectProperties.resizeColumnToContents(0) | |
3765 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3982 | self.treeProjectProperties.resizeColumnToContents(1) | |
3766 |
|
3983 | |||
3767 | def refreshGraphicsId(self): |
|
3984 | def refreshGraphicsId(self): | |
3768 |
|
3985 | |||
3769 | projectObj = self.getSelectedProjectObj() |
|
3986 | projectObj = self.getSelectedProjectObj() | |
3770 |
|
3987 | |||
3771 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
3988 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
3772 |
|
3989 | |||
3773 | for opObj in puObj.getOperationObjList(): |
|
3990 | for opObj in puObj.getOperationObjList(): | |
3774 |
|
3991 | |||
3775 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
3992 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
3776 | continue |
|
3993 | continue | |
3777 |
|
3994 | |||
3778 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
3995 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
3779 |
|
3996 | |||
3780 | def on_click(self, index): |
|
3997 | def on_click(self, index): | |
3781 |
|
3998 | |||
3782 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
3999 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
3783 |
|
4000 | |||
3784 | projectObjView = self.getSelectedProjectObj() |
|
4001 | projectObjView = self.getSelectedProjectObj() | |
3785 |
|
4002 | |||
3786 | if not projectObjView: |
|
4003 | if not projectObjView: | |
3787 | return |
|
4004 | return | |
3788 |
|
4005 | |||
3789 | self.create = False |
|
4006 | self.create = False | |
3790 | selectedObjView = self.getSelectedItemObj() |
|
4007 | selectedObjView = self.getSelectedItemObj() | |
3791 |
|
4008 | |||
3792 | #A project has been selected |
|
4009 | #A project has been selected | |
3793 | if projectObjView == selectedObjView: |
|
4010 | if projectObjView == selectedObjView: | |
3794 |
|
4011 | |||
3795 | self.refreshProjectWindow2(projectObjView) |
|
4012 | self.refreshProjectWindow2(projectObjView) | |
3796 | self.refreshProjectProperties(projectObjView) |
|
4013 | self.refreshProjectProperties(projectObjView) | |
3797 |
|
4014 | |||
3798 | self.tabProject.setEnabled(True) |
|
4015 | self.tabProject.setEnabled(True) | |
3799 | self.tabVoltage.setEnabled(False) |
|
4016 | self.tabVoltage.setEnabled(False) | |
3800 | self.tabSpectra.setEnabled(False) |
|
4017 | self.tabSpectra.setEnabled(False) | |
3801 | self.tabCorrelation.setEnabled(False) |
|
4018 | self.tabCorrelation.setEnabled(False) | |
3802 | self.tabSpectraHeis.setEnabled(False) |
|
4019 | self.tabSpectraHeis.setEnabled(False) | |
3803 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4020 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
3804 |
|
4021 | |||
3805 | return |
|
4022 | return | |
3806 |
|
4023 | |||
3807 | #A processing unit has been selected |
|
4024 | #A processing unit has been selected | |
3808 | voltEnable = False |
|
4025 | voltEnable = False | |
3809 | specEnable = False |
|
4026 | specEnable = False | |
3810 | corrEnable = False |
|
4027 | corrEnable = False | |
3811 | specHeisEnable = False |
|
4028 | specHeisEnable = False | |
3812 | tabSelected = self.tabProject |
|
4029 | tabSelected = self.tabProject | |
3813 |
|
4030 | |||
3814 | puObj = selectedObjView |
|
4031 | puObj = selectedObjView | |
3815 |
|
4032 | |||
3816 | if self.selectedItemTree.text() == 'Voltage': |
|
4033 | self.refreshPUWindow(puObj) | |
3817 | voltEnable = True |
|
|||
3818 | tabSelected = self.tabVoltage |
|
|||
3819 |
|
||||
3820 | if self.selectedItemTree.text() == 'Spectra': |
|
|||
3821 | specEnable = True |
|
|||
3822 | tabSelected = self.tabSpectra |
|
|||
3823 |
|
||||
3824 | if self.selectedItemTree.text() == 'Correlation': |
|
|||
3825 | corrEnable = True |
|
|||
3826 | tabSelected = self.tabCorrelation |
|
|||
3827 |
|
||||
3828 | if self.selectedItemTree.text() == 'SpectraHeis': |
|
|||
3829 | specHeisEnable = True |
|
|||
3830 | tabSelected = self.tabSpectraHeis |
|
|||
3831 |
|
||||
3832 | self.refreshPUWindow(puObj=puObj) |
|
|||
3833 | self.refreshPUProperties(puObj) |
|
4034 | self.refreshPUProperties(puObj) | |
3834 |
|
4035 | self.showtabPUCreated(puObj.datatype) | ||
3835 | self.tabProject.setEnabled(False) |
|
|||
3836 | self.tabVoltage.setEnabled(voltEnable) |
|
|||
3837 | self.tabSpectra.setEnabled(specEnable) |
|
|||
3838 | self.tabCorrelation.setEnabled(corrEnable) |
|
|||
3839 | self.tabSpectraHeis.setEnabled(specHeisEnable) |
|
|||
3840 | self.tabWidgetProject.setCurrentWidget(tabSelected) |
|
|||
3841 |
|
4036 | |||
3842 | def on_right_click(self, pos): |
|
4037 | def on_right_click(self, pos): | |
3843 |
|
4038 | |||
3844 | self.menu = QtGui.QMenu() |
|
4039 | self.menu = QtGui.QMenu() | |
3845 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4040 | quitAction0 = self.menu.addAction("Create a New Project") | |
3846 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4041 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
3847 | quitAction2 = self.menu.addAction("Delete Item") |
|
4042 | quitAction2 = self.menu.addAction("Delete Item") | |
3848 | quitAction3 = self.menu.addAction("Quit") |
|
4043 | quitAction3 = self.menu.addAction("Quit") | |
3849 |
|
4044 | |||
3850 | if len(self.__itemTreeDict) == 0: |
|
4045 | if len(self.__itemTreeDict) == 0: | |
3851 | quitAction2.setEnabled(False) |
|
4046 | quitAction2.setEnabled(False) | |
3852 | else: |
|
4047 | else: | |
3853 | quitAction2.setEnabled(True) |
|
4048 | quitAction2.setEnabled(True) | |
3854 |
|
4049 | |||
3855 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4050 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
3856 |
|
4051 | |||
3857 | if action == quitAction0: |
|
4052 | if action == quitAction0: | |
3858 | self. setInputsProject_View() |
|
4053 | self. setInputsProject_View() | |
3859 | self.create = True |
|
4054 | self.create = True | |
3860 |
|
4055 | |||
3861 | if action == quitAction1: |
|
4056 | if action == quitAction1: | |
3862 | if len(self.__projectObjDict) == 0: |
|
4057 | if len(self.__projectObjDict) == 0: | |
3863 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4058 | outputstr = "You need to create a Project before adding a Processing Unit" | |
3864 | self.console.clear() |
|
4059 | self.console.clear() | |
3865 | self.console.append(outputstr) |
|
4060 | self.console.append(outputstr) | |
3866 | return 0 |
|
4061 | return 0 | |
3867 | else: |
|
4062 | else: | |
3868 | self.addPUWindow() |
|
4063 | self.addPUWindow() | |
3869 | self.console.clear() |
|
4064 | self.console.clear() | |
3870 | self.console.append("Please, Choose the type of Processing Unit") |
|
4065 | self.console.append("Please, Choose the type of Processing Unit") | |
3871 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4066 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
3872 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4067 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
3873 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4068 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
3874 |
|
4069 | |||
3875 | if action == quitAction2: |
|
4070 | if action == quitAction2: | |
3876 | index = self.selectedItemTree |
|
4071 | index = self.selectedItemTree | |
3877 | try: |
|
4072 | try: | |
3878 | index.parent() |
|
4073 | index.parent() | |
3879 | except: |
|
4074 | except: | |
3880 | self.console.append('Please first select a Project or Processing Unit') |
|
4075 | self.console.append('Please first select a Project or Processing Unit') | |
3881 | return 0 |
|
4076 | return 0 | |
3882 | # print index.parent(),index |
|
4077 | # print index.parent(),index | |
3883 | if index.parent() == None: |
|
4078 | if index.parent() == None: | |
3884 | self.projectExplorerModel.removeRow(index.row()) |
|
4079 | self.projectExplorerModel.removeRow(index.row()) | |
3885 | else: |
|
4080 | else: | |
3886 | index.parent().removeRow(index.row()) |
|
4081 | index.parent().removeRow(index.row()) | |
3887 | self.removeItemTreeFromProject() |
|
4082 | self.removeItemTreeFromProject() | |
3888 | self.console.clear() |
|
4083 | self.console.clear() | |
3889 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4084 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
3890 | # print i.row() |
|
4085 | # print i.row() | |
3891 |
|
4086 | |||
3892 | if action == quitAction3: |
|
4087 | if action == quitAction3: | |
3893 | self.close() |
|
4088 | self.close() | |
3894 | return 0 |
|
4089 | return 0 | |
3895 |
|
4090 | |||
3896 | def create_updating_timer(self): |
|
4091 | def create_updating_timer(self): | |
3897 | self.comm_data_timer = QtCore.QTimer(self) |
|
4092 | self.comm_data_timer = QtCore.QTimer(self) | |
3898 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4093 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
3899 | self.comm_data_timer.start(1000) |
|
4094 | self.comm_data_timer.start(1000) | |
3900 |
|
4095 | |||
3901 | def createProjectView(self, id): |
|
4096 | def createProjectView(self, id): | |
3902 |
|
4097 | |||
3903 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4098 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
3904 | id = str(id) |
|
4099 | id = str(id) | |
3905 | projectParms = self.__getParmsFromProjectWindow() |
|
4100 | projectParms = self.__getParmsFromProjectWindow() | |
3906 |
|
4101 | |||
3907 | if not projectParms.isValid(): |
|
4102 | if not projectParms.isValid(): | |
3908 | return None |
|
4103 | return None | |
3909 |
|
4104 | |||
3910 | projectObjView = Project() |
|
4105 | projectObjView = Project() | |
3911 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4106 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
3912 |
|
4107 | |||
3913 | self.__projectObjDict[id] = projectObjView |
|
4108 | self.__projectObjDict[id] = projectObjView | |
3914 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4109 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
3915 |
|
4110 | |||
3916 | self.create = False |
|
4111 | self.create = False | |
3917 |
|
4112 | |||
3918 | return projectObjView |
|
4113 | return projectObjView | |
3919 |
|
4114 | |||
3920 | def updateProjectView(self): |
|
4115 | def updateProjectView(self): | |
3921 |
|
4116 | |||
3922 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4117 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
3923 |
|
4118 | |||
3924 | projectParms = self.__getParmsFromProjectWindow() |
|
4119 | projectParms = self.__getParmsFromProjectWindow() | |
3925 |
|
4120 | |||
3926 | if not projectParms.isValid(): |
|
4121 | if not projectParms.isValid(): | |
3927 | return None |
|
4122 | return None | |
3928 |
|
4123 | |||
3929 | projectObjView = self.getSelectedProjectObj() |
|
4124 | projectObjView = self.getSelectedProjectObj() | |
3930 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4125 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
3931 |
|
4126 | |||
3932 | return projectObjView |
|
4127 | return projectObjView | |
3933 |
|
4128 | |||
3934 | def createReadUnitView(self, projectObjView): |
|
4129 | def createReadUnitView(self, projectObjView): | |
3935 |
|
4130 | |||
3936 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4131 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
3937 |
|
4132 | |||
3938 | projectParms = self.__getParmsFromProjectWindow() |
|
4133 | projectParms = self.__getParmsFromProjectWindow() | |
3939 |
|
4134 | |||
3940 | if not projectParms.isValid(): |
|
4135 | if not projectParms.isValid(): | |
3941 | return None |
|
4136 | return None | |
3942 |
|
4137 | |||
3943 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4138 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
3944 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4139 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
3945 | path=projectParms.dpath, |
|
4140 | path=projectParms.dpath, | |
3946 | startDate=projectParms.startDate, |
|
4141 | startDate=projectParms.startDate, | |
3947 | endDate=projectParms.endDate, |
|
4142 | endDate=projectParms.endDate, | |
3948 | startTime=projectParms.startTime, |
|
4143 | startTime=projectParms.startTime, | |
3949 | endTime=projectParms.endTime, |
|
4144 | endTime=projectParms.endTime, | |
3950 | online=projectParms.online, |
|
4145 | online=projectParms.online, | |
3951 | walk=projectParms.walk |
|
4146 | walk=projectParms.walk | |
3952 | ) |
|
4147 | ) | |
3953 |
|
4148 | |||
3954 | if projectParms.set: |
|
4149 | if projectParms.set: | |
3955 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4150 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
3956 |
|
4151 | |||
3957 | if projectParms.delay: |
|
4152 | if projectParms.delay: | |
3958 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4153 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
3959 |
|
4154 | |||
3960 | if projectParms.datatype == "USRP": |
|
4155 | if projectParms.datatype == "USRP": | |
3961 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4156 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
3962 | path=projectParms.dpath, |
|
4157 | path=projectParms.dpath, | |
3963 | startDate=projectParms.startDate, |
|
4158 | startDate=projectParms.startDate, | |
3964 | endDate=projectParms.endDate, |
|
4159 | endDate=projectParms.endDate, | |
3965 | startTime=projectParms.startTime, |
|
4160 | startTime=projectParms.startTime, | |
3966 | endTime=projectParms.endTime, |
|
4161 | endTime=projectParms.endTime, | |
3967 | online=projectParms.online, |
|
4162 | online=projectParms.online, | |
3968 | ippKm=projectParms.ippKm |
|
4163 | ippKm=projectParms.ippKm | |
3969 | ) |
|
4164 | ) | |
3970 |
|
4165 | |||
3971 | if projectParms.delay: |
|
4166 | if projectParms.delay: | |
3972 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4167 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
3973 |
|
4168 | |||
3974 | return readUnitConfObj |
|
4169 | return readUnitConfObj | |
3975 |
|
4170 | |||
3976 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4171 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
3977 |
|
4172 | |||
3978 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
4173 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() | |
3979 |
|
4174 | |||
3980 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
4175 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) | |
3981 |
|
4176 | |||
3982 | projectParms = self.__getParmsFromProjectWindow() |
|
4177 | projectParms = self.__getParmsFromProjectWindow() | |
3983 |
|
4178 | |||
3984 | if not projectParms.isValid(): |
|
4179 | if not projectParms.isValid(): | |
3985 | return None |
|
4180 | return None | |
3986 |
|
4181 | |||
3987 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: |
|
4182 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: | |
3988 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4183 | readUnitConfObj.update(datatype=projectParms.datatype, | |
3989 | path=projectParms.dpath, |
|
4184 | path=projectParms.dpath, | |
3990 | startDate=projectParms.startDate, |
|
4185 | startDate=projectParms.startDate, | |
3991 | endDate=projectParms.endDate, |
|
4186 | endDate=projectParms.endDate, | |
3992 | startTime=projectParms.startTime, |
|
4187 | startTime=projectParms.startTime, | |
3993 | endTime=projectParms.endTime, |
|
4188 | endTime=projectParms.endTime, | |
3994 | online=projectParms.online, |
|
4189 | online=projectParms.online, | |
3995 | walk=projectParms.walk |
|
4190 | walk=projectParms.walk | |
3996 | ) |
|
4191 | ) | |
3997 | if projectParms.set: |
|
4192 | if projectParms.set: | |
3998 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4193 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
3999 |
|
4194 | |||
4000 | if projectParms.delay: |
|
4195 | if projectParms.delay: | |
4001 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4196 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4002 |
|
4197 | |||
4003 | if projectParms.datatype == "USRP": |
|
4198 | if projectParms.datatype == "USRP": | |
4004 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4199 | readUnitConfObj.update(datatype=projectParms.datatype, | |
4005 | path=projectParms.dpath, |
|
4200 | path=projectParms.dpath, | |
4006 | startDate=projectParms.startDate, |
|
4201 | startDate=projectParms.startDate, | |
4007 | endDate=projectParms.endDate, |
|
4202 | endDate=projectParms.endDate, | |
4008 | startTime=projectParms.startTime, |
|
4203 | startTime=projectParms.startTime, | |
4009 | endTime=projectParms.endTime, |
|
4204 | endTime=projectParms.endTime, | |
4010 | online=projectParms.online, |
|
4205 | online=projectParms.online, | |
4011 | ippKm=projectParms.ippKm |
|
4206 | ippKm=projectParms.ippKm | |
4012 | ) |
|
4207 | ) | |
4013 |
|
4208 | |||
4014 | if projectParms.delay: |
|
4209 | if projectParms.delay: | |
4015 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4210 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4016 |
|
4211 | |||
4017 | return readUnitConfObj |
|
4212 | return readUnitConfObj | |
4018 |
|
4213 | |||
4019 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4214 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4020 |
|
4215 | |||
4021 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4216 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4022 |
|
4217 | |||
4023 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4218 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4024 |
|
4219 | |||
4025 | return procUnitConfObj |
|
4220 | return procUnitConfObj | |
4026 |
|
4221 | |||
4027 | def updateProcUnitView(self, id): |
|
4222 | def updateProcUnitView(self, id): | |
4028 |
|
4223 | |||
4029 | procUnitConfObj = projectObjView.getProcUnitObj(id) |
|
4224 | procUnitConfObj = projectObjView.getProcUnitObj(id) | |
4030 | procUnitConfObj.removeOperations() |
|
4225 | procUnitConfObj.removeOperations() | |
4031 |
|
4226 | |||
4032 | return procUnitConfObj |
|
4227 | return procUnitConfObj | |
4033 |
|
4228 | |||
4034 | def addPUWindow(self): |
|
4229 | def addPUWindow(self): | |
4035 |
|
4230 | |||
4036 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4231 | self.configUPWindowObj = UnitProcessWindow(self) | |
4037 | fatherObj = self.getSelectedItemObj() |
|
4232 | fatherObj = self.getSelectedItemObj() | |
4038 | try: |
|
4233 | try: | |
4039 | fatherObj.getElementName() |
|
4234 | fatherObj.getElementName() | |
4040 | except: |
|
4235 | except: | |
4041 | self.console.append("First left click on Project or Processing Unit") |
|
4236 | self.console.append("First left click on Project or Processing Unit") | |
4042 | return 0 |
|
4237 | return 0 | |
4043 |
|
4238 | |||
4044 | if fatherObj.getElementName() == 'Project': |
|
4239 | if fatherObj.getElementName() == 'Project': | |
4045 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4240 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4046 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4241 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4047 |
|
4242 | |||
4048 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4243 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4049 | self.configUPWindowObj.loadTotalList() |
|
4244 | self.configUPWindowObj.loadTotalList() | |
4050 | self.configUPWindowObj.show() |
|
4245 | self.configUPWindowObj.show() | |
4051 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4246 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4052 |
|
4247 | |||
4053 | def createPUWindow(self): |
|
4248 | def createPUWindow(self): | |
4054 |
|
4249 | |||
4055 | if not self.configUPWindowObj.create: |
|
4250 | if not self.configUPWindowObj.create: | |
4056 | return |
|
4251 | return | |
4057 |
|
4252 | |||
4058 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4253 | fatherObj = self.configUPWindowObj.getFromWindow | |
4059 | datatype = self.configUPWindowObj.typeofUP |
|
4254 | datatype = self.configUPWindowObj.typeofUP | |
4060 |
|
4255 | |||
4061 | if fatherObj.getElementName() == 'Project': |
|
4256 | if fatherObj.getElementName() == 'Project': | |
4062 | inputId = fatherObj.getReadUnitId() |
|
4257 | inputId = fatherObj.getReadUnitId() | |
4063 | projectObjView = fatherObj |
|
4258 | projectObjView = fatherObj | |
4064 | else: |
|
4259 | else: | |
4065 | inputId = fatherObj.getId() |
|
4260 | inputId = fatherObj.getId() | |
4066 | projectObjView = self.getSelectedProjectObj() |
|
4261 | projectObjView = self.getSelectedProjectObj() | |
4067 |
|
4262 | |||
4068 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4263 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4069 |
|
4264 | |||
4070 |
self.addPU2ProjectExplorer( |
|
4265 | self.addPU2ProjectExplorer(puObj) | |
4071 |
|
4266 | |||
4072 | self.showtabPUCreated(datatype) |
|
4267 | self.showtabPUCreated(datatype) | |
4073 |
|
4268 | |||
4074 | self.clearPUWindow(datatype) |
|
4269 | self.clearPUWindow(datatype) | |
4075 |
|
4270 | |||
4076 | self.showPUinitView() |
|
4271 | self.showPUinitView() | |
4077 |
|
4272 | |||
4078 | def addFTPConf2Operation(self, puObj, opObj): |
|
4273 | def addFTPConf2Operation(self, puObj, opObj): | |
4079 |
|
4274 | |||
4080 | if self.temporalFTP.create: |
|
4275 | if not self.temporalFTP.create: | |
4081 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
|||
4082 | else: |
|
|||
4083 | self.temporalFTP.setwithoutconfiguration() |
|
4276 | self.temporalFTP.setwithoutconfiguration() | |
4084 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
|||
4085 |
|
||||
4086 | # opObj.addParameter(name='server', value=server, format='str') |
|
|||
4087 | # opObj.addParameter(name='folder', value=remotefolder, format='str') |
|
|||
4088 | # opObj.addParameter(name='username', value=username, format='str') |
|
|||
4089 | # opObj.addParameter(name='password', value=password, format='str') |
|
|||
4090 |
|
||||
4091 | if ftp_wei: |
|
|||
4092 | opObj.addParameter(name='ftp_wei', value=int(ftp_wei), format='int') |
|
|||
4093 | if exp_code: |
|
|||
4094 | opObj.addParameter(name='exp_code', value=int(exp_code), format='int') |
|
|||
4095 | if sub_exp_code: |
|
|||
4096 | opObj.addParameter(name='sub_exp_code', value=int(sub_exp_code), format='int') |
|
|||
4097 | if plot_pos: |
|
|||
4098 | opObj.addParameter(name='plot_pos', value=int(plot_pos), format='int') |
|
|||
4099 |
|
||||
4100 | if puObj.datatype == "Spectra": |
|
|||
4101 | value = self.specGgraphftpratio.text() |
|
|||
4102 | if puObj.datatype == "SpectraHeis": |
|
|||
4103 | value = self.specHeisGgraphftpratio.text() |
|
|||
4104 |
|
4277 | |||
4105 | if not value == "": |
|
4278 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4106 | try: |
|
4279 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4107 | value = int(value) |
|
4280 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4108 |
|
|
4281 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4109 |
|
|
4282 | ||
4110 | pass |
|
4283 | if self.temporalFTP.ftp_wei: | |
|
4284 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |||
|
4285 | if self.temporalFTP.exp_code: | |||
|
4286 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |||
|
4287 | if self.temporalFTP.sub_exp_code: | |||
|
4288 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |||
|
4289 | if self.temporalFTP.plot_pos: | |||
|
4290 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |||
4111 |
|
4291 | |||
|
4292 | def __checkFTPProcUnit(self, projectObj, localfolder): | |||
4112 |
|
4293 | |||
4113 | def addFTPProcUnitView(self, server, username, password, remotefolder, |
|
4294 | puId = None | |
4114 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
4295 | puObj = None | |
4115 | localfolder='./', extension='.png', period='60', protocol='ftp'): |
|
4296 | ||
|
4297 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |||
|
4298 | ||||
|
4299 | if not thisPuObj.name == "SendToServer": | |||
|
4300 | continue | |||
|
4301 | ||||
|
4302 | opObj = thisPuObj.getOperationObj(name='run') | |||
|
4303 | ||||
|
4304 | parmObj = opObj.getParameterObj('localfolder') | |||
|
4305 | ||||
|
4306 | #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |||
|
4307 | if not parmObj: | |||
|
4308 | projectObj.removeProcUnit(thisPuId) | |||
|
4309 | continue | |||
|
4310 | ||||
|
4311 | thisLocalfolder = parmObj.getValue() | |||
|
4312 | ||||
|
4313 | if localfolder != thisLocalfolder: | |||
|
4314 | continue | |||
|
4315 | ||||
|
4316 | puId = thisPuId | |||
|
4317 | puObj = thisPuObj | |||
|
4318 | break | |||
|
4319 | ||||
|
4320 | return puObj | |||
|
4321 | ||||
|
4322 | def __addFTPProcUnitFrom(self, operationObj): | |||
|
4323 | ||||
|
4324 | if operationObj.name != "SendByFTP": | |||
|
4325 | return | |||
4116 |
|
4326 | |||
4117 | projectObj = self.getSelectedProjectObj() |
|
4327 | projectObj = self.getSelectedProjectObj() | |
4118 | procUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") |
|
|||
4119 |
|
4328 | |||
4120 | if not procUnitConfObj: |
|
4329 | self.removeAllFTPProcUnitView(projectObj) | |
|
4330 | ||||
4121 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4331 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4122 |
|
|
4332 | ||
4123 | procUnitConfObj.removeOperations() |
|
4333 | server = operationObj.getParameterValue("server") | |
|
4334 | username = operationObj.getParameterValue("username") | |||
|
4335 | password = operationObj.getParameterValue("pasword") | |||
|
4336 | localfolder = operationObj.getParameterValue("localfolder") | |||
|
4337 | remotefolder = operationObj.getParameterValue("remotefolder") | |||
|
4338 | ext = operationObj.getParameterValue("ext") | |||
|
4339 | period = operationObj.getParameterValue("period") | |||
4124 |
|
4340 | |||
4125 | procUnitConfObj.addParameter(name='server', value=server, format='str') |
|
4341 | procUnitConfObj.addParameter(name='server', value=server, format='str') | |
4126 | procUnitConfObj.addParameter(name='username', value=username, format='str') |
|
4342 | procUnitConfObj.addParameter(name='username', value=username, format='str') | |
4127 | procUnitConfObj.addParameter(name='password', value=password, format='str') |
|
4343 | procUnitConfObj.addParameter(name='password', value=password, format='str') | |
4128 |
procUnitConfObj.addParameter(name='localfolder', value=localfolder, format='st |
|
4344 | procUnitConfObj.addParameter(name='localfolder', value=localfolder, format='list') | |
4129 | procUnitConfObj.addParameter(name='remotefolder', value=remotefolder, format='str') |
|
4345 | procUnitConfObj.addParameter(name='remotefolder', value=remotefolder, format='str') | |
4130 |
procUnitConfObj.addParameter(name='ext', value=ext |
|
4346 | procUnitConfObj.addParameter(name='ext', value=ext, format='str') | |
4131 | procUnitConfObj.addParameter(name='period', value=period, format='int') |
|
4347 | procUnitConfObj.addParameter(name='period', value=period, format='int') | |
4132 | procUnitConfObj.addParameter(name='protocol', value=protocol, format='str') |
|
|||
4133 |
|
||||
4134 | procUnitConfObj.addParameter(name='ftp_wei', value=ftp_wei, format='str') |
|
|||
4135 | procUnitConfObj.addParameter(name='exp_code', value=exp_code, format='str') |
|
|||
4136 | procUnitConfObj.addParameter(name='sub_exp_code', value=sub_exp_code, format='str') |
|
|||
4137 | procUnitConfObj.addParameter(name='plot_pos', value=plot_pos, format='str') |
|
|||
4138 |
|
4348 | |||
4139 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4349 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4140 |
|
4350 | |||
4141 | self.__ftpProcUnitAdded = True |
|
4351 | return procUnitConfObj | |
4142 | self.__ftpProcUnitId = procUnitConfObj.getId() |
|
|||
4143 |
|
4352 | |||
4144 |
def |
|
4353 | def addFTPProcUnitView(self): | |
|
4354 | ||||
|
4355 | if not self.temporalFTP.create: | |||
|
4356 | self.temporalFTP.setwithoutconfiguration() | |||
4145 |
|
4357 | |||
4146 | projectObj = self.getSelectedProjectObj() |
|
4358 | projectObj = self.getSelectedProjectObj() | |
4147 | procUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") |
|
|||
4148 |
|
4359 | |||
4149 | self.__ftpProcUnitAdded = False |
|
4360 | self.removeAllFTPProcUnitView(projectObj) | |
4150 | self.__ftpProcUnitId = None |
|
|||
4151 |
|
4361 | |||
4152 | if not procUnitConfObj: |
|
4362 | if not self.__puLocalFolder2FTP: | |
4153 | return |
|
4363 | return | |
4154 |
|
4364 | |||
4155 | projectObj.removeProcUnit(procUnitConfObj.getId()) |
|
4365 | folderList = "" | |
4156 |
|
4366 | |||
4157 | if procUnitConfObj.getId() not in self.__puObjDict.keys(): |
|
4367 | for localfolder in self.__puLocalFolder2FTP.values(): | |
4158 | return |
|
4368 | folderList += str(localfolder) + "," | |
|
4369 | ||||
|
4370 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |||
|
4371 | ||||
|
4372 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |||
|
4373 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |||
|
4374 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |||
|
4375 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |||
|
4376 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |||
|
4377 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |||
|
4378 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |||
|
4379 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |||
|
4380 | ||||
|
4381 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='str') | |||
|
4382 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='str') | |||
|
4383 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='str') | |||
|
4384 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='str') | |||
4159 |
|
4385 | |||
4160 |
self.__puObjDict |
|
4386 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
|
4387 | ||||
|
4388 | def removeAllFTPProcUnitView(self, projectObj): | |||
|
4389 | ||||
|
4390 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |||
|
4391 | ||||
|
4392 | if not thisPuObj.name == "SendToServer": | |||
|
4393 | continue | |||
|
4394 | ||||
|
4395 | projectObj.removeProcUnit(thisPuId) | |||
|
4396 | ||||
|
4397 | if thisPuId not in self.__puObjDict.keys(): | |||
|
4398 | continue | |||
|
4399 | ||||
|
4400 | self.__puObjDict.pop(thisPuId) | |||
4161 |
|
4401 | |||
4162 | def showPUinitView(self): |
|
4402 | def showPUinitView(self): | |
|
4403 | ||||
4163 | self.propertiesModel = TreeModel() |
|
4404 | self.propertiesModel = TreeModel() | |
4164 | self.propertiesModel.initPUVoltageView() |
|
4405 | self.propertiesModel.initPUVoltageView() | |
4165 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4406 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4166 | self.treeProjectProperties.expandAll() |
|
4407 | self.treeProjectProperties.expandAll() | |
4167 | self.treeProjectProperties.allColumnsShowFocus() |
|
4408 | self.treeProjectProperties.allColumnsShowFocus() | |
4168 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4409 | self.treeProjectProperties.resizeColumnToContents(1) | |
4169 |
|
4410 | |||
4170 |
def saveFTPvalues(self, |
|
4411 | def saveFTPvalues(self, puObj): | |
|
4412 | ||||
|
4413 | opObj = puObj.getOperationObj(name="run") | |||
4171 |
|
4414 | |||
4172 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4415 | parmObj = opObj.getParameterObj(parameterName="server") | |
4173 | if parmObj == None: |
|
4416 | if parmObj == None: | |
4174 | server = 'jro-app.igp.gob.pe' |
|
4417 | server = 'jro-app.igp.gob.pe' | |
4175 | else: |
|
4418 | else: | |
4176 |
server = |
|
4419 | server = parmObj.getValue() | |
4177 |
|
4420 | |||
4178 | parmObj = opObj.getParameterObj(parameterName="folder") |
|
4421 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4179 | if parmObj == None: |
|
4422 | if parmObj == None: | |
4180 | folder = '/home/wmaster/graficos' |
|
4423 | remotefolder = '/home/wmaster/graficos' | |
4181 | else: |
|
4424 | else: | |
4182 |
folder = |
|
4425 | remotefolder = parmObj.getValue() | |
4183 |
|
4426 | |||
4184 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4427 | parmObj = opObj.getParameterObj(parameterName="username") | |
4185 | if parmObj == None: |
|
4428 | if parmObj == None: | |
4186 | username = 'wmaster' |
|
4429 | username = 'wmaster' | |
4187 | else: |
|
4430 | else: | |
4188 |
username = |
|
4431 | username = parmObj.getValue() | |
4189 |
|
4432 | |||
4190 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4433 | parmObj = opObj.getParameterObj(parameterName="password") | |
4191 | if parmObj == None: |
|
4434 | if parmObj == None: | |
4192 | password = 'mst2010vhf' |
|
4435 | password = 'mst2010vhf' | |
4193 | else: |
|
4436 | else: | |
4194 |
password = |
|
4437 | password = parmObj.getValue() | |
4195 |
|
4438 | |||
4196 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4439 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4197 | if parmObj == None: |
|
4440 | if parmObj == None: | |
4198 | ftp_wei = '0' |
|
4441 | ftp_wei = '0' | |
4199 | else: |
|
4442 | else: | |
4200 |
ftp_wei = |
|
4443 | ftp_wei = parmObj.getValue() | |
4201 |
|
4444 | |||
4202 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4445 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4203 | if parmObj == None: |
|
4446 | if parmObj == None: | |
4204 | exp_code = '0' |
|
4447 | exp_code = '0' | |
4205 | else: |
|
4448 | else: | |
4206 |
exp_code = |
|
4449 | exp_code = parmObj.getValue() | |
4207 |
|
4450 | |||
4208 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4451 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4209 | if parmObj == None: |
|
4452 | if parmObj == None: | |
4210 | sub_exp_code = '0' |
|
4453 | sub_exp_code = '0' | |
4211 | else: |
|
4454 | else: | |
4212 |
sub_exp_code = |
|
4455 | sub_exp_code = parmObj.getValue() | |
4213 |
|
4456 | |||
4214 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4457 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4215 | if parmObj == None: |
|
4458 | if parmObj == None: | |
4216 | plot_pos = '0' |
|
4459 | plot_pos = '0' | |
4217 | else: |
|
4460 | else: | |
4218 |
plot_pos = |
|
4461 | plot_pos = parmObj.getValue() | |
4219 |
|
4462 | |||
4220 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4463 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4221 | if parmObj == None: |
|
4464 | if parmObj == None: | |
4222 | localfolder = None |
|
4465 | localfolder = None | |
4223 | else: |
|
4466 | else: | |
4224 |
localfolder = |
|
4467 | localfolder = parmObj.getValue() | |
4225 |
|
4468 | |||
4226 | parmObj = opObj.getParameterObj(parameterName="extension") |
|
4469 | parmObj = opObj.getParameterObj(parameterName="extension") | |
4227 | if parmObj == None: |
|
4470 | if parmObj == None: | |
4228 |
extension = |
|
4471 | extension = '.png' | |
4229 | else: |
|
4472 | else: | |
4230 |
extension = |
|
4473 | extension = parmObj.getValue() | |
4231 |
|
4474 | |||
4232 | self.temporalFTP.save(server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
4475 | self.temporalFTP.save(server=server, | |
|
4476 | remotefolder=remotefolder, | |||
|
4477 | username=username, | |||
|
4478 | password=password, | |||
|
4479 | ftp_wei=ftp_wei, | |||
|
4480 | exp_code=exp_code, | |||
|
4481 | sub_exp_code=sub_exp_code, | |||
|
4482 | plot_pos=plot_pos, | |||
4233 | localfolder=localfolder, |
|
4483 | localfolder=localfolder, | |
4234 | extension=extension) |
|
4484 | extension=extension) | |
4235 |
|
4485 | |||
4236 | def addProject2ProjectExplorer(self, id, name): |
|
4486 | def addProject2ProjectExplorer(self, id, name): | |
4237 |
|
4487 | |||
4238 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4488 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4239 | self.parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4489 | ||
4240 | self.parentItem.appendRow(itemTree) |
|
4490 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4241 |
|
|
4491 | parentItem.appendRow(itemTree) | |
4242 | self.projectExplorerTree.setCurrentIndex(self.parentItem.index()) |
|
4492 | ||
|
4493 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |||
4243 |
|
4494 | |||
4244 | self.selectedItemTree = itemTree |
|
4495 | self.selectedItemTree = itemTree | |
4245 |
|
4496 | |||
4246 | self.__itemTreeDict[id] = itemTree |
|
4497 | self.__itemTreeDict[id] = itemTree | |
4247 |
|
4498 | |||
4248 |
def addPU2ProjectExplorer(self, |
|
4499 | def addPU2ProjectExplorer(self, puObj): | |
4249 | # id1= round(int(id)/10.)*10 |
|
4500 | ||
4250 | # id= int(id) |
|
4501 | id, name = puObj.id, puObj.datatype | |
4251 |
|
|
4502 | ||
4252 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4503 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4253 |
|
4504 | |||
4254 |
|
|
4505 | parentItem = self.selectedItemTree | |
4255 |
|
|
4506 | parentItem.appendRow(itemTree) | |
4256 | self.projectExplorerTree.expandAll() |
|
4507 | self.projectExplorerTree.expandAll() | |
4257 | self.parentItem = itemTree |
|
4508 | ||
4258 |
self.projectExplorerTree.setCurrentIndex( |
|
4509 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4259 |
|
4510 | |||
4260 | self.selectedItemTree = itemTree |
|
4511 | self.selectedItemTree = itemTree | |
4261 |
|
4512 | |||
4262 | self.__itemTreeDict[id] = itemTree |
|
4513 | self.__itemTreeDict[id] = itemTree | |
4263 |
|
4514 | |||
4264 |
def addPU2PELoadXML(self, |
|
4515 | def addPU2PELoadXML(self, puObj): | |
|
4516 | ||||
|
4517 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |||
4265 |
|
4518 | |||
4266 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4519 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4267 |
|
4520 | |||
4268 | if self.__itemTreeDict.has_key(inputId): |
|
4521 | if self.__itemTreeDict.has_key(inputId): | |
4269 |
|
|
4522 | parentItem = self.__itemTreeDict[inputId] | |
4270 | else: |
|
4523 | else: | |
4271 | #If parent is a Reader object |
|
4524 | #If parent is a Reader object | |
4272 |
|
|
4525 | parentItem = self.__itemTreeDict[id[:-1]] | |
4273 |
|
4526 | |||
4274 |
|
|
4527 | parentItem.appendRow(itemTree) | |
4275 | self.projectExplorerTree.expandAll() |
|
4528 | self.projectExplorerTree.expandAll() | |
4276 |
|
|
4529 | parentItem = itemTree | |
4277 |
self.projectExplorerTree.setCurrentIndex( |
|
4530 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4278 |
|
||||
4279 | self.selectedItemTree = itemTree |
|
|||
4280 |
|
4531 | |||
4281 | self.__itemTreeDict[id] = itemTree |
|
4532 | self.__itemTreeDict[id] = itemTree | |
4282 | # print "stop" |
|
4533 | self.selectedItemTree = itemTree | |
4283 |
|
4534 | |||
4284 | def getSelectedProjectObj(self): |
|
4535 | def getSelectedProjectObj(self): | |
4285 | """ |
|
4536 | """ | |
4286 | Return the current project object selected. If a processing unit is |
|
4537 | Return the current project object selected. If a processing unit is | |
4287 | actually selected this function returns associated project. |
|
4538 | actually selected this function returns associated project. | |
4288 |
|
4539 | |||
4289 | None if any project or processing unit is selected |
|
4540 | None if any project or processing unit is selected | |
4290 | """ |
|
4541 | """ | |
4291 | for key in self.__itemTreeDict.keys(): |
|
4542 | for key in self.__itemTreeDict.keys(): | |
4292 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4543 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4293 | continue |
|
4544 | continue | |
4294 |
|
4545 | |||
4295 | if self.__projectObjDict.has_key(key): |
|
4546 | if self.__projectObjDict.has_key(key): | |
4296 | projectObj = self.__projectObjDict[key] |
|
4547 | projectObj = self.__projectObjDict[key] | |
4297 | return projectObj |
|
4548 | return projectObj | |
4298 |
|
4549 | |||
4299 | puObj = self.__puObjDict[key] |
|
4550 | puObj = self.__puObjDict[key] | |
4300 |
|
4551 | |||
4301 | if puObj.parentId == None: |
|
4552 | if puObj.parentId == None: | |
4302 | projectId = puObj.getId()[0] |
|
4553 | projectId = puObj.getId()[0] | |
4303 | else: |
|
4554 | else: | |
4304 | projectId = puObj.parentId |
|
4555 | projectId = puObj.parentId | |
4305 |
|
4556 | |||
4306 | projectObj = self.__projectObjDict[projectId] |
|
4557 | projectObj = self.__projectObjDict[projectId] | |
4307 | return projectObj |
|
4558 | return projectObj | |
4308 |
|
4559 | |||
4309 | return None |
|
4560 | return None | |
4310 |
|
4561 | |||
4311 | def getSelectedItemObj(self): |
|
4562 | def getSelectedItemObj(self): | |
4312 | """ |
|
4563 | """ | |
4313 | Return the current project or processing unit object selected |
|
4564 | Return the current project or processing unit object selected | |
4314 |
|
4565 | |||
4315 | None if any project or processing unit is selected |
|
4566 | None if any project or processing unit is selected | |
4316 | """ |
|
4567 | """ | |
4317 | for key in self.__itemTreeDict.keys(): |
|
4568 | for key in self.__itemTreeDict.keys(): | |
4318 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4569 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4319 | continue |
|
4570 | continue | |
4320 |
|
4571 | |||
4321 | if self.__projectObjDict.has_key(key) == True: |
|
4572 | if self.__projectObjDict.has_key(key) == True: | |
4322 | fatherObj = self.__projectObjDict[key] |
|
4573 | fatherObj = self.__projectObjDict[key] | |
4323 | else: |
|
4574 | else: | |
4324 | fatherObj = self.__puObjDict[key] |
|
4575 | fatherObj = self.__puObjDict[key] | |
4325 |
|
4576 | |||
4326 | return fatherObj |
|
4577 | return fatherObj | |
4327 |
|
4578 | |||
4328 | return None |
|
4579 | return None | |
4329 |
|
4580 | |||
4330 | def _WarningWindow(self, text, information): |
|
4581 | def _WarningWindow(self, text, information): | |
4331 |
|
4582 | |||
4332 | msgBox = QtGui.QMessageBox() |
|
4583 | msgBox = QtGui.QMessageBox() | |
4333 | msgBox.setText(text) |
|
4584 | msgBox.setText(text) | |
4334 | msgBox.setInformativeText(information) |
|
4585 | msgBox.setInformativeText(information) | |
4335 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4586 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4336 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4587 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4337 | ret = msgBox.exec_() |
|
4588 | ret = msgBox.exec_() | |
4338 |
|
4589 | |||
4339 | answer = False |
|
4590 | answer = False | |
4340 |
|
4591 | |||
4341 | if ret == QtGui.QMessageBox.Ok: |
|
4592 | if ret == QtGui.QMessageBox.Ok: | |
4342 | answer = True |
|
4593 | answer = True | |
4343 |
|
4594 | |||
4344 | return answer |
|
4595 | return answer | |
4345 |
|
4596 | |||
4346 | def __getNewProjectId(self): |
|
4597 | def __getNewProjectId(self): | |
4347 |
|
4598 | |||
4348 | loadProject = False |
|
4599 | loadProject = False | |
4349 |
|
4600 | |||
4350 | for thisId in range(1,10): |
|
4601 | for thisId in range(1,10): | |
4351 | newId = str(thisId) |
|
4602 | newId = str(thisId) | |
4352 | if newId in self.__projectObjDict.keys(): |
|
4603 | if newId in self.__projectObjDict.keys(): | |
4353 | continue |
|
4604 | continue | |
4354 |
|
4605 | |||
4355 | loadProject = True |
|
4606 | loadProject = True | |
4356 | projectId = newId |
|
4607 | projectId = newId | |
4357 | break |
|
4608 | break | |
4358 |
|
4609 | |||
4359 | if not loadProject: |
|
4610 | if not loadProject: | |
4360 | self.console.clear() |
|
4611 | self.console.clear() | |
4361 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4612 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4362 | return None |
|
4613 | return None | |
4363 |
|
4614 | |||
4364 | return projectId |
|
4615 | return projectId | |
4365 |
|
4616 | |||
4366 | def openProject(self): |
|
4617 | def openProject(self): | |
4367 |
|
4618 | |||
4368 | self.actionStart.setEnabled(False) |
|
4619 | self.actionStart.setEnabled(False) | |
4369 | self.actionStarToolbar.setEnabled(False) |
|
4620 | self.actionStarToolbar.setEnabled(False) | |
4370 |
|
4621 | |||
4371 | self.create = False |
|
4622 | self.create = False | |
4372 | self.frame_2.setEnabled(True) |
|
4623 | self.frame_2.setEnabled(True) | |
4373 |
|
4624 | |||
4374 | # print self.dir |
|
4625 | # print self.dir | |
4375 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
4626 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
4376 |
|
4627 | |||
4377 | projectObjLoad = Project() |
|
4628 | projectObjLoad = Project() | |
4378 |
|
4629 | |||
4379 | try: |
|
4630 | try: | |
4380 | projectObjLoad.readXml(filename) |
|
4631 | projectObjLoad.readXml(filename) | |
4381 | except: |
|
4632 | except: | |
4382 | self.console.clear() |
|
4633 | self.console.clear() | |
4383 | self.console.append("The selected xml file could not be loaded ...") |
|
4634 | self.console.append("The selected xml file could not be loaded ...") | |
4384 | return 0 |
|
4635 | return 0 | |
4385 |
|
4636 | |||
4386 | self.refreshProjectWindow2(projectObjLoad) |
|
4637 | self.refreshProjectWindow2(projectObjLoad) | |
4387 | self.refreshProjectProperties(projectObjLoad) |
|
4638 | self.refreshProjectProperties(projectObjLoad) | |
4388 |
|
4639 | |||
4389 | projectId = projectObjLoad.id |
|
4640 | projectId = projectObjLoad.id | |
4390 |
|
4641 | |||
4391 | if projectId in self.__projectObjDict.keys(): |
|
4642 | if projectId in self.__projectObjDict.keys(): | |
4392 |
|
4643 | |||
4393 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4644 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4394 | # "Do you want to load the file anyway?") |
|
4645 | # "Do you want to load the file anyway?") | |
4395 | # if not answer: |
|
4646 | # if not answer: | |
4396 | # return |
|
4647 | # return | |
4397 |
|
4648 | |||
4398 | projectId = self.__getNewProjectId() |
|
4649 | projectId = self.__getNewProjectId() | |
4399 |
|
4650 | |||
4400 | if not projectId: |
|
4651 | if not projectId: | |
4401 | return |
|
4652 | return | |
4402 |
|
4653 | |||
4403 | projectObjLoad.updateId(projectId) |
|
4654 | projectObjLoad.updateId(projectId) | |
4404 |
|
4655 | |||
4405 | self.__projectObjDict[projectId] = projectObjLoad |
|
4656 | self.__projectObjDict[projectId] = projectObjLoad | |
4406 |
|
4657 | |||
4407 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4658 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4408 |
|
4659 | |||
4409 | self.tabWidgetProject.setEnabled(True) |
|
4660 | self.tabWidgetProject.setEnabled(True) | |
4410 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4661 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4411 | # Disable tabProject after finish the creation |
|
4662 | # Disable tabProject after finish the creation | |
4412 | self.tabProject.setEnabled(True) |
|
4663 | self.tabProject.setEnabled(True) | |
4413 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4664 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4414 |
|
4665 | |||
4415 | for puId, puObj in puObjorderList.items(): |
|
4666 | for puId, puObj in puObjorderList.items(): | |
4416 |
|
4667 | |||
4417 | self.__puObjDict[puId] = puObj |
|
4668 | self.__puObjDict[puId] = puObj | |
4418 |
|
4669 | |||
4419 | if puObj.name == "SendToServer": |
|
4670 | if puObj.name == "SendToServer": | |
4420 | self.__ftpProcUnitAdded = True |
|
4671 | self.saveFTPvalues(puObj) | |
4421 | self.__ftpProcUnitId = puObj.getId() |
|
|||
4422 |
|
||||
4423 | opObj = puObj.getOperationObj(name="run") |
|
|||
4424 | self.saveFTPvalues(opObj) |
|
|||
4425 |
|
4672 | |||
4426 | if puObj.inputId == '0': |
|
4673 | if puObj.inputId == '0': | |
4427 | continue |
|
4674 | continue | |
4428 |
|
4675 | |||
4429 |
self.addPU2PELoadXML( |
|
4676 | self.addPU2PELoadXML(puObj) | |
4430 |
|
4677 | |||
4431 | if puObj.datatype in ("Voltage", "Spectra", "SpectraHeis"): |
|
|||
4432 | self.refreshPUWindow(puObj) |
|
4678 | self.refreshPUWindow(puObj) | |
4433 | self.refreshPUProperties(puObj) |
|
4679 | self.refreshPUProperties(puObj) | |
4434 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4680 | self.showtabPUCreated(datatype=puObj.datatype) | |
4435 |
|
4681 | |||
|
4682 | ############## COMPATIBLE FROM OLD VERSIONS ################ | |||
|
4683 | operationObj = puObj.getOperationObj("SendByFTP") | |||
|
4684 | ||||
|
4685 | if operationObj: | |||
|
4686 | send2ServerObj = self.__addFTPProcUnitFrom(operationObj) | |||
|
4687 | self.saveFTPvalues(send2ServerObj) | |||
|
4688 | ############################################################ | |||
4436 |
|
4689 | |||
4437 | self.console.clear() |
|
4690 | self.console.clear() | |
4438 | self.console.append("The selected xml file has been loaded successfully") |
|
4691 | self.console.append("The selected xml file has been loaded successfully") | |
4439 |
|
4692 | |||
4440 | self.actionStart.setEnabled(True) |
|
4693 | self.actionStart.setEnabled(True) | |
4441 | self.actionStarToolbar.setEnabled(True) |
|
4694 | self.actionStarToolbar.setEnabled(True) | |
4442 |
|
4695 | |||
4443 | def on_comm_updating_timer(self): |
|
4696 | def on_comm_updating_timer(self): | |
4444 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4697 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4445 |
|
4698 | |||
4446 | if not self.__initialized: |
|
4699 | if not self.__initialized: | |
4447 | return |
|
4700 | return | |
4448 |
|
4701 | |||
4449 | if not self.controllerObj.isAlive(): |
|
4702 | if not self.controllerObj.isAlive(): | |
4450 | self.stopProject() |
|
4703 | self.stopProject() | |
4451 |
|
4704 | |||
4452 | def playProject(self, ext=".xml", save=1): |
|
4705 | def playProject(self, ext=".xml", save=1): | |
4453 |
|
4706 | |||
4454 | # self.console.clear() |
|
4707 | # self.console.clear() | |
4455 | projectObj = self.getSelectedProjectObj() |
|
4708 | projectObj = self.getSelectedProjectObj() | |
4456 |
|
4709 | |||
4457 | if not projectObj: |
|
4710 | if not projectObj: | |
4458 | print "Please select a project before pressing PLAY button" |
|
4711 | print "Please select a project before pressing PLAY button" | |
4459 | return |
|
4712 | return | |
4460 |
|
4713 | |||
4461 | if save: |
|
4714 | if save: | |
4462 | filename = self.saveProject() |
|
4715 | filename = self.saveProject() | |
4463 | if filename == None: |
|
4716 | if filename == None: | |
4464 | self.console.append("Process did not initialize.") |
|
4717 | self.console.append("Process did not initialize.") | |
4465 | return |
|
4718 | return | |
4466 | else: |
|
4719 | else: | |
4467 | filename = TEMPORAL_FILE |
|
4720 | filename = TEMPORAL_FILE | |
4468 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4721 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4469 |
|
4722 | |||
4470 | self.actionStart.setEnabled(False) |
|
4723 | self.actionStart.setEnabled(False) | |
4471 | self.actionPause.setEnabled(True) |
|
4724 | self.actionPause.setEnabled(True) | |
4472 | self.actionStop.setEnabled(True) |
|
4725 | self.actionStop.setEnabled(True) | |
4473 |
|
4726 | |||
4474 | self.actionStarToolbar.setEnabled(False) |
|
4727 | self.actionStarToolbar.setEnabled(False) | |
4475 | self.actionPauseToolbar.setEnabled(True) |
|
4728 | self.actionPauseToolbar.setEnabled(True) | |
4476 | self.actionStopToolbar.setEnabled(True) |
|
4729 | self.actionStopToolbar.setEnabled(True) | |
4477 |
|
4730 | |||
4478 | self.console.append("Please Wait...") |
|
4731 | self.console.append("Please Wait...") | |
4479 |
|
4732 | |||
4480 | self.controllerObj = ControllerThread(filename) |
|
4733 | self.controllerObj = ControllerThread(filename) | |
4481 | self.controllerObj.start() |
|
4734 | self.controllerObj.start() | |
4482 | sleep(0.5) |
|
4735 | sleep(0.5) | |
4483 | self.__initialized = True |
|
4736 | self.__initialized = True | |
4484 |
|
4737 | |||
4485 | def stopProject(self): |
|
4738 | def stopProject(self): | |
4486 |
|
4739 | |||
4487 | self.__initialized = False |
|
4740 | self.__initialized = False | |
4488 |
|
4741 | |||
4489 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) |
|
4742 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
4490 | self.controllerObj.stop() |
|
4743 | self.controllerObj.stop() | |
4491 |
|
4744 | |||
4492 | self.actionStart.setEnabled(True) |
|
4745 | self.actionStart.setEnabled(True) | |
4493 | self.actionPause.setEnabled(False) |
|
4746 | self.actionPause.setEnabled(False) | |
4494 | self.actionStop.setEnabled(False) |
|
4747 | self.actionStop.setEnabled(False) | |
4495 |
|
4748 | |||
4496 | self.actionStarToolbar.setEnabled(True) |
|
4749 | self.actionStarToolbar.setEnabled(True) | |
4497 | self.actionPauseToolbar.setEnabled(False) |
|
4750 | self.actionPauseToolbar.setEnabled(False) | |
4498 | self.actionStopToolbar.setEnabled(False) |
|
4751 | self.actionStopToolbar.setEnabled(False) | |
4499 |
|
4752 | |||
4500 | self.restorePauseIcon() |
|
4753 | self.restorePauseIcon() | |
4501 |
|
4754 | |||
4502 | def pauseProject(self): |
|
4755 | def pauseProject(self): | |
4503 |
|
4756 | |||
4504 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4757 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4505 | self.controllerObj.pause() |
|
4758 | self.controllerObj.pause() | |
4506 |
|
4759 | |||
4507 | self.actionStart.setEnabled(False) |
|
4760 | self.actionStart.setEnabled(False) | |
4508 | self.actionPause.setEnabled(True) |
|
4761 | self.actionPause.setEnabled(True) | |
4509 | self.actionStop.setEnabled(True) |
|
4762 | self.actionStop.setEnabled(True) | |
4510 |
|
4763 | |||
4511 | self.actionStarToolbar.setEnabled(False) |
|
4764 | self.actionStarToolbar.setEnabled(False) | |
4512 | self.actionPauseToolbar.setEnabled(True) |
|
4765 | self.actionPauseToolbar.setEnabled(True) | |
4513 | self.actionStopToolbar.setEnabled(True) |
|
4766 | self.actionStopToolbar.setEnabled(True) | |
4514 |
|
4767 | |||
4515 | def saveProject(self, filename=None): |
|
4768 | def saveProject(self, filename=None): | |
4516 |
|
4769 | |||
4517 | self.actionStart.setEnabled(False) |
|
4770 | self.actionStart.setEnabled(False) | |
4518 | self.actionStarToolbar.setEnabled(False) |
|
4771 | self.actionStarToolbar.setEnabled(False) | |
4519 |
|
4772 | |||
4520 | projectObj = self.getSelectedProjectObj() |
|
4773 | projectObj = self.getSelectedProjectObj() | |
4521 | self.refreshGraphicsId() |
|
4774 | self.refreshGraphicsId() | |
4522 |
|
4775 | |||
4523 | sts = True |
|
4776 | sts = True | |
4524 | selectedItemObj = self.getSelectedItemObj() |
|
4777 | selectedItemObj = self.getSelectedItemObj() | |
4525 |
|
4778 | |||
4526 | #A Processing Unit has been selected |
|
4779 | #A Processing Unit has been selected | |
4527 | if projectObj == selectedItemObj: |
|
4780 | if projectObj == selectedItemObj: | |
4528 | if not self.on_proOk_clicked(): |
|
4781 | if not self.on_proOk_clicked(): | |
4529 | return None |
|
4782 | return None | |
4530 |
|
4783 | |||
4531 | #A Processing Unit has been selected |
|
4784 | #A Processing Unit has been selected | |
4532 | if projectObj != selectedItemObj: |
|
4785 | if projectObj != selectedItemObj: | |
4533 | puObj = selectedItemObj |
|
4786 | puObj = selectedItemObj | |
4534 |
|
4787 | |||
4535 | if puObj.name == 'VoltageProc': |
|
4788 | if puObj.name == 'VoltageProc': | |
4536 | sts = self.on_volOpOk_clicked() |
|
4789 | sts = self.on_volOpOk_clicked() | |
4537 | if puObj.name == 'SpectraProc': |
|
4790 | if puObj.name == 'SpectraProc': | |
4538 | sts = self.on_specOpOk_clicked() |
|
4791 | sts = self.on_specOpOk_clicked() | |
4539 | if puObj.name == 'SpectraHeisProc': |
|
4792 | if puObj.name == 'SpectraHeisProc': | |
4540 | sts = self.on_specHeisOpOk_clicked() |
|
4793 | sts = self.on_specHeisOpOk_clicked() | |
4541 |
|
4794 | |||
4542 | if not sts: |
|
4795 | if not sts: | |
4543 | return None |
|
4796 | return None | |
4544 |
|
4797 | |||
|
4798 | self.addFTPProcUnitView() | |||
|
4799 | ||||
4545 | if not filename: |
|
4800 | if not filename: | |
4546 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4801 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4547 |
|
4802 | |||
4548 | projectObj.writeXml(filename) |
|
4803 | projectObj.writeXml(filename) | |
4549 | self.console.append("Now, you can press Start button") |
|
4804 | self.console.append("Now, you can press Start button") | |
4550 |
|
4805 | |||
4551 | self.actionStart.setEnabled(True) |
|
4806 | self.actionStart.setEnabled(True) | |
4552 | self.actionStarToolbar.setEnabled(True) |
|
4807 | self.actionStarToolbar.setEnabled(True) | |
4553 |
|
4808 | |||
4554 | return filename |
|
4809 | return filename | |
4555 |
|
4810 | |||
4556 | def removeItemTreeFromProject(self): |
|
4811 | def removeItemTreeFromProject(self): | |
4557 | """ |
|
4812 | """ | |
4558 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4813 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4559 | """ |
|
4814 | """ | |
4560 | for key in self.__itemTreeDict.keys(): |
|
4815 | for key in self.__itemTreeDict.keys(): | |
4561 |
|
4816 | |||
4562 | #Check again because an item can delete multiple items (childs) |
|
4817 | #Check again because an item can delete multiple items (childs) | |
4563 | if key not in self.__itemTreeDict.keys(): |
|
4818 | if key not in self.__itemTreeDict.keys(): | |
4564 | continue |
|
4819 | continue | |
4565 |
|
4820 | |||
4566 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4821 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4567 | continue |
|
4822 | continue | |
4568 |
|
4823 | |||
4569 | if self.__projectObjDict.has_key(key) == True: |
|
4824 | if self.__projectObjDict.has_key(key) == True: | |
4570 |
|
4825 | |||
4571 | del self.__projectObjDict[key] |
|
4826 | del self.__projectObjDict[key] | |
4572 | del self.__itemTreeDict[key] |
|
4827 | del self.__itemTreeDict[key] | |
4573 |
|
4828 | |||
4574 | else: |
|
4829 | else: | |
4575 | puObj = self.__puObjDict[key] |
|
4830 | puObj = self.__puObjDict[key] | |
4576 | idProjectParent = puObj.parentId |
|
4831 | idProjectParent = puObj.parentId | |
4577 | projectObj = self.__projectObjDict[idProjectParent] |
|
4832 | projectObj = self.__projectObjDict[idProjectParent] | |
4578 |
|
4833 | |||
4579 | del self.__puObjDict[key] |
|
4834 | del self.__puObjDict[key] | |
4580 | del self.__itemTreeDict[key] |
|
4835 | del self.__itemTreeDict[key] | |
4581 | del projectObj.procUnitConfObjDict[key] |
|
4836 | del projectObj.procUnitConfObjDict[key] | |
4582 |
|
4837 | |||
4583 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4838 | for key in projectObj.procUnitConfObjDict.keys(): | |
4584 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4839 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4585 | continue |
|
4840 | continue | |
4586 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4841 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4587 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4842 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4588 | del projectObj.procUnitConfObjDict[key] |
|
4843 | del projectObj.procUnitConfObjDict[key] | |
4589 | # print projectObj.procUnitConfObjDict |
|
4844 | # print projectObj.procUnitConfObjDict | |
4590 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4845 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4591 |
|
4846 | |||
4592 | def removefromtree(self, row): |
|
|||
4593 | self.parentItem.removeRow(row) |
|
|||
4594 |
|
||||
4595 |
|
||||
4596 | def setInputsProject_View(self): |
|
4847 | def setInputsProject_View(self): | |
4597 |
|
4848 | |||
4598 | self.tabWidgetProject.setEnabled(True) |
|
4849 | self.tabWidgetProject.setEnabled(True) | |
4599 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4850 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4600 | self.tabProject.setEnabled(True) |
|
4851 | self.tabProject.setEnabled(True) | |
4601 | self.frame_2.setEnabled(False) |
|
4852 | self.frame_2.setEnabled(False) | |
4602 | self.proName.clear() |
|
4853 | self.proName.clear() | |
4603 | self.proName.setFocus() |
|
4854 | self.proName.setFocus() | |
4604 | self.proName.setSelection(0, 0) |
|
4855 | self.proName.setSelection(0, 0) | |
4605 | self.proName.setCursorPosition(0) |
|
4856 | self.proName.setCursorPosition(0) | |
4606 | self.proDataType.setText('.r') |
|
4857 | self.proDataType.setText('.r') | |
4607 | self.proDataPath.clear() |
|
4858 | self.proDataPath.clear() | |
4608 | self.proComDataType.clear() |
|
4859 | self.proComDataType.clear() | |
4609 | self.proComDataType.addItem("Voltage") |
|
4860 | self.proComDataType.addItem("Voltage") | |
4610 | self.proComDataType.addItem("Spectra") |
|
4861 | self.proComDataType.addItem("Spectra") | |
4611 | self.proComDataType.addItem("Fits") |
|
4862 | self.proComDataType.addItem("Fits") | |
4612 | self.proComDataType.addItem("USRP") |
|
4863 | self.proComDataType.addItem("USRP") | |
4613 |
|
4864 | |||
4614 | self.proComStartDate.clear() |
|
4865 | self.proComStartDate.clear() | |
4615 | self.proComEndDate.clear() |
|
4866 | self.proComEndDate.clear() | |
4616 |
|
4867 | |||
4617 | startTime = "00:00:00" |
|
4868 | startTime = "00:00:00" | |
4618 | endTime = "23:59:59" |
|
4869 | endTime = "23:59:59" | |
4619 | starlist = startTime.split(":") |
|
4870 | starlist = startTime.split(":") | |
4620 | endlist = endTime.split(":") |
|
4871 | endlist = endTime.split(":") | |
4621 | self.proDelay.setText("60") |
|
4872 | self.proDelay.setText("60") | |
4622 | self.proSet.setText("") |
|
4873 | self.proSet.setText("") | |
4623 |
|
4874 | |||
4624 | self.labelSet.show() |
|
4875 | self.labelSet.show() | |
4625 | self.proSet.show() |
|
4876 | self.proSet.show() | |
4626 |
|
4877 | |||
4627 | self.labelIPPKm.hide() |
|
4878 | self.labelIPPKm.hide() | |
4628 | self.proIPPKm.hide() |
|
4879 | self.proIPPKm.hide() | |
4629 |
|
4880 | |||
4630 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4881 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4631 | self.proStartTime.setTime(self.time) |
|
4882 | self.proStartTime.setTime(self.time) | |
4632 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4883 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4633 | self.proEndTime.setTime(self.time) |
|
4884 | self.proEndTime.setTime(self.time) | |
4634 | self.proDescription.clear() |
|
4885 | self.proDescription.clear() | |
4635 | self.proOk.setEnabled(False) |
|
4886 | self.proOk.setEnabled(False) | |
4636 | # self.console.append("Please, Write a name Project") |
|
4887 | # self.console.append("Please, Write a name Project") | |
4637 | # self.console.append("Introduce Project Parameters")DC |
|
4888 | # self.console.append("Introduce Project Parameters")DC | |
4638 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4889 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4639 |
|
4890 | |||
4640 | def clearPUWindow(self, datatype): |
|
4891 | def clearPUWindow(self, datatype): | |
4641 |
|
4892 | |||
4642 | projectObjView = self.getSelectedProjectObj() |
|
4893 | projectObjView = self.getSelectedProjectObj() | |
4643 |
|
4894 | |||
4644 | if not projectObjView: |
|
4895 | if not projectObjView: | |
4645 | return |
|
4896 | return | |
4646 |
|
4897 | |||
4647 | puObj = self.getSelectedItemObj() |
|
4898 | puObj = self.getSelectedItemObj() | |
4648 | inputId = puObj.getInputId() |
|
4899 | inputId = puObj.getInputId() | |
4649 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4900 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4650 |
|
4901 | |||
4651 | if datatype == 'Voltage': |
|
4902 | if datatype == 'Voltage': | |
4652 | self.volOpComChannels.setEnabled(False) |
|
4903 | self.volOpComChannels.setEnabled(False) | |
4653 | self.volOpComHeights.setEnabled(False) |
|
4904 | self.volOpComHeights.setEnabled(False) | |
4654 | self.volOpFilter.setEnabled(False) |
|
4905 | self.volOpFilter.setEnabled(False) | |
4655 | self.volOpComProfile.setEnabled(False) |
|
4906 | self.volOpComProfile.setEnabled(False) | |
4656 | self.volOpComCode.setEnabled(False) |
|
4907 | self.volOpComCode.setEnabled(False) | |
4657 | self.volOpCohInt.setEnabled(False) |
|
4908 | self.volOpCohInt.setEnabled(False) | |
4658 | self.volOpChannel.setEnabled(False) |
|
4909 | self.volOpChannel.setEnabled(False) | |
4659 | self.volOpHeights.setEnabled(False) |
|
4910 | self.volOpHeights.setEnabled(False) | |
4660 | self.volOpProfile.setEnabled(False) |
|
4911 | self.volOpProfile.setEnabled(False) | |
4661 | self.volOpRadarfrequency.setEnabled(False) |
|
4912 | self.volOpRadarfrequency.setEnabled(False) | |
4662 | self.volOpCebChannels.setCheckState(0) |
|
4913 | self.volOpCebChannels.setCheckState(0) | |
4663 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4914 | self.volOpCebRadarfrequency.setCheckState(0) | |
4664 | self.volOpCebHeights.setCheckState(0) |
|
4915 | self.volOpCebHeights.setCheckState(0) | |
4665 | self.volOpCebFilter.setCheckState(0) |
|
4916 | self.volOpCebFilter.setCheckState(0) | |
4666 | self.volOpCebProfile.setCheckState(0) |
|
4917 | self.volOpCebProfile.setCheckState(0) | |
4667 | self.volOpCebDecodification.setCheckState(0) |
|
4918 | self.volOpCebDecodification.setCheckState(0) | |
4668 | self.volOpCebCohInt.setCheckState(0) |
|
4919 | self.volOpCebCohInt.setCheckState(0) | |
4669 |
|
4920 | |||
4670 | self.volOpChannel.clear() |
|
4921 | self.volOpChannel.clear() | |
4671 | self.volOpHeights.clear() |
|
4922 | self.volOpHeights.clear() | |
4672 | self.volOpProfile.clear() |
|
4923 | self.volOpProfile.clear() | |
4673 | self.volOpFilter.clear() |
|
4924 | self.volOpFilter.clear() | |
4674 | self.volOpCohInt.clear() |
|
4925 | self.volOpCohInt.clear() | |
4675 | self.volOpRadarfrequency.clear() |
|
4926 | self.volOpRadarfrequency.clear() | |
4676 |
|
4927 | |||
4677 | if datatype == 'Spectra': |
|
4928 | if datatype == 'Spectra': | |
4678 |
|
4929 | |||
4679 | if inputPUObj.datatype == 'Spectra': |
|
4930 | if inputPUObj.datatype == 'Spectra': | |
4680 | self.specOpnFFTpoints.setEnabled(False) |
|
4931 | self.specOpnFFTpoints.setEnabled(False) | |
4681 | self.specOpProfiles.setEnabled(False) |
|
4932 | self.specOpProfiles.setEnabled(False) | |
4682 | self.specOpippFactor.setEnabled(False) |
|
4933 | self.specOpippFactor.setEnabled(False) | |
4683 | else: |
|
4934 | else: | |
4684 | self.specOpnFFTpoints.setEnabled(True) |
|
4935 | self.specOpnFFTpoints.setEnabled(True) | |
4685 | self.specOpProfiles.setEnabled(True) |
|
4936 | self.specOpProfiles.setEnabled(True) | |
4686 | self.specOpippFactor.setEnabled(True) |
|
4937 | self.specOpippFactor.setEnabled(True) | |
4687 |
|
4938 | |||
4688 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4939 | self.specOpCebCrossSpectra.setCheckState(0) | |
4689 | self.specOpCebChannel.setCheckState(0) |
|
4940 | self.specOpCebChannel.setCheckState(0) | |
4690 | self.specOpCebHeights.setCheckState(0) |
|
4941 | self.specOpCebHeights.setCheckState(0) | |
4691 | self.specOpCebIncoherent.setCheckState(0) |
|
4942 | self.specOpCebIncoherent.setCheckState(0) | |
4692 | self.specOpCebRemoveDC.setCheckState(0) |
|
4943 | self.specOpCebRemoveDC.setCheckState(0) | |
4693 | self.specOpCebRemoveInt.setCheckState(0) |
|
4944 | self.specOpCebRemoveInt.setCheckState(0) | |
4694 | self.specOpCebgetNoise.setCheckState(0) |
|
4945 | self.specOpCebgetNoise.setCheckState(0) | |
4695 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4946 | self.specOpCebRadarfrequency.setCheckState(0) | |
4696 |
|
4947 | |||
4697 | self.specOpRadarfrequency.setEnabled(False) |
|
4948 | self.specOpRadarfrequency.setEnabled(False) | |
4698 | self.specOppairsList.setEnabled(False) |
|
4949 | self.specOppairsList.setEnabled(False) | |
4699 | self.specOpChannel.setEnabled(False) |
|
4950 | self.specOpChannel.setEnabled(False) | |
4700 | self.specOpHeights.setEnabled(False) |
|
4951 | self.specOpHeights.setEnabled(False) | |
4701 | self.specOpIncoherent.setEnabled(False) |
|
4952 | self.specOpIncoherent.setEnabled(False) | |
4702 | self.specOpgetNoise.setEnabled(False) |
|
4953 | self.specOpgetNoise.setEnabled(False) | |
4703 |
|
4954 | |||
4704 | self.specOpRadarfrequency.clear() |
|
4955 | self.specOpRadarfrequency.clear() | |
4705 | self.specOpnFFTpoints.clear() |
|
4956 | self.specOpnFFTpoints.clear() | |
4706 | self.specOpProfiles.clear() |
|
4957 | self.specOpProfiles.clear() | |
4707 | self.specOpippFactor.clear |
|
4958 | self.specOpippFactor.clear | |
4708 | self.specOppairsList.clear() |
|
4959 | self.specOppairsList.clear() | |
4709 | self.specOpChannel.clear() |
|
4960 | self.specOpChannel.clear() | |
4710 | self.specOpHeights.clear() |
|
4961 | self.specOpHeights.clear() | |
4711 | self.specOpIncoherent.clear() |
|
4962 | self.specOpIncoherent.clear() | |
4712 | self.specOpgetNoise.clear() |
|
4963 | self.specOpgetNoise.clear() | |
4713 |
|
4964 | |||
4714 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4965 | self.specGraphCebSpectraplot.setCheckState(0) | |
4715 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4966 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4716 | self.specGraphCebRTIplot.setCheckState(0) |
|
4967 | self.specGraphCebRTIplot.setCheckState(0) | |
4717 | self.specGraphCebRTInoise.setCheckState(0) |
|
4968 | self.specGraphCebRTInoise.setCheckState(0) | |
4718 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4969 | self.specGraphCebCoherencmap.setCheckState(0) | |
4719 | self.specGraphPowerprofile.setCheckState(0) |
|
4970 | self.specGraphPowerprofile.setCheckState(0) | |
4720 |
|
4971 | |||
4721 | self.specGraphSaveSpectra.setCheckState(0) |
|
4972 | self.specGraphSaveSpectra.setCheckState(0) | |
4722 | self.specGraphSaveCross.setCheckState(0) |
|
4973 | self.specGraphSaveCross.setCheckState(0) | |
4723 | self.specGraphSaveRTIplot.setCheckState(0) |
|
4974 | self.specGraphSaveRTIplot.setCheckState(0) | |
4724 | self.specGraphSaveRTInoise.setCheckState(0) |
|
4975 | self.specGraphSaveRTInoise.setCheckState(0) | |
4725 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
4976 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4726 | self.specGraphSavePowerprofile.setCheckState(0) |
|
4977 | self.specGraphSavePowerprofile.setCheckState(0) | |
4727 |
|
4978 | |||
4728 | self.specGraphftpRTIplot.setCheckState(0) |
|
4979 | self.specGraphftpRTIplot.setCheckState(0) | |
4729 | self.specGraphftpRTInoise.setCheckState(0) |
|
4980 | self.specGraphftpRTInoise.setCheckState(0) | |
4730 | self.specGraphftpCoherencemap.setCheckState(0) |
|
4981 | self.specGraphftpCoherencemap.setCheckState(0) | |
4731 |
|
4982 | |||
4732 | self.specGraphPath.clear() |
|
4983 | self.specGraphPath.clear() | |
4733 | self.specGraphPrefix.clear() |
|
4984 | self.specGraphPrefix.clear() | |
4734 |
|
4985 | |||
4735 | self.specGgraphftpratio.clear() |
|
4986 | self.specGgraphftpratio.clear() | |
4736 |
|
4987 | |||
4737 | self.specGgraphChannelList.clear() |
|
4988 | self.specGgraphChannelList.clear() | |
4738 | self.specGgraphFreq.clear() |
|
4989 | self.specGgraphFreq.clear() | |
4739 | self.specGgraphHeight.clear() |
|
4990 | self.specGgraphHeight.clear() | |
4740 | self.specGgraphDbsrange.clear() |
|
4991 | self.specGgraphDbsrange.clear() | |
4741 | self.specGgraphmagnitud.clear() |
|
4992 | self.specGgraphmagnitud.clear() | |
4742 | self.specGgraphTminTmax.clear() |
|
4993 | self.specGgraphTminTmax.clear() | |
4743 | self.specGgraphTimeRange.clear() |
|
4994 | self.specGgraphTimeRange.clear() | |
4744 |
|
4995 | |||
4745 | if datatype == 'SpectraHeis': |
|
4996 | if datatype == 'SpectraHeis': | |
4746 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
4997 | self.specHeisOpCebIncoherent.setCheckState(0) | |
4747 | self.specHeisOpIncoherent.setEnabled(False) |
|
4998 | self.specHeisOpIncoherent.setEnabled(False) | |
4748 | self.specHeisOpIncoherent.clear() |
|
4999 | self.specHeisOpIncoherent.clear() | |
4749 |
|
5000 | |||
4750 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5001 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
4751 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5002 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
4752 |
|
5003 | |||
4753 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5004 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
4754 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5005 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
4755 |
|
5006 | |||
4756 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5007 | self.specHeisGraphftpSpectra.setCheckState(0) | |
4757 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5008 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
4758 |
|
5009 | |||
4759 | self.specHeisGraphPath.clear() |
|
5010 | self.specHeisGraphPath.clear() | |
4760 | self.specHeisGraphPrefix.clear() |
|
5011 | self.specHeisGraphPrefix.clear() | |
4761 | self.specHeisGgraphChannelList.clear() |
|
5012 | self.specHeisGgraphChannelList.clear() | |
4762 | self.specHeisGgraphXminXmax.clear() |
|
5013 | self.specHeisGgraphXminXmax.clear() | |
4763 | self.specHeisGgraphYminYmax.clear() |
|
5014 | self.specHeisGgraphYminYmax.clear() | |
4764 | self.specHeisGgraphTminTmax.clear() |
|
5015 | self.specHeisGgraphTminTmax.clear() | |
4765 | self.specHeisGgraphTimeRange.clear() |
|
5016 | self.specHeisGgraphTimeRange.clear() | |
4766 | self.specHeisGgraphftpratio.clear() |
|
5017 | self.specHeisGgraphftpratio.clear() | |
4767 |
|
5018 | |||
4768 |
|
||||
4769 |
|
||||
4770 |
|
||||
4771 |
|
||||
4772 | def showtabPUCreated(self, datatype): |
|
5019 | def showtabPUCreated(self, datatype): | |
|
5020 | ||||
4773 | if datatype == "Voltage": |
|
5021 | if datatype == "Voltage": | |
4774 | self.tabVoltage.setEnabled(True) |
|
5022 | self.tabVoltage.setEnabled(True) | |
4775 | self.tabProject.setEnabled(False) |
|
5023 | self.tabProject.setEnabled(False) | |
4776 | self.tabSpectra.setEnabled(False) |
|
5024 | self.tabSpectra.setEnabled(False) | |
4777 | self.tabCorrelation.setEnabled(False) |
|
5025 | self.tabCorrelation.setEnabled(False) | |
4778 | self.tabSpectraHeis.setEnabled(False) |
|
5026 | self.tabSpectraHeis.setEnabled(False) | |
4779 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5027 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
4780 |
|
5028 | |||
4781 | if datatype == "Spectra": |
|
5029 | if datatype == "Spectra": | |
4782 | self.tabVoltage.setEnabled(False) |
|
5030 | self.tabVoltage.setEnabled(False) | |
4783 | self.tabProject.setEnabled(False) |
|
5031 | self.tabProject.setEnabled(False) | |
4784 | self.tabSpectra.setEnabled(True) |
|
5032 | self.tabSpectra.setEnabled(True) | |
4785 | self.tabCorrelation.setEnabled(False) |
|
5033 | self.tabCorrelation.setEnabled(False) | |
4786 | self.tabSpectraHeis.setEnabled(False) |
|
5034 | self.tabSpectraHeis.setEnabled(False) | |
4787 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5035 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
|
5036 | ||||
4788 | if datatype == "SpectraHeis": |
|
5037 | if datatype == "SpectraHeis": | |
4789 | self.tabVoltage.setEnabled(False) |
|
5038 | self.tabVoltage.setEnabled(False) | |
4790 | self.tabProject.setEnabled(False) |
|
5039 | self.tabProject.setEnabled(False) | |
4791 | self.tabSpectra.setEnabled(False) |
|
5040 | self.tabSpectra.setEnabled(False) | |
4792 | self.tabCorrelation.setEnabled(False) |
|
5041 | self.tabCorrelation.setEnabled(False) | |
4793 | self.tabSpectraHeis.setEnabled(True) |
|
5042 | self.tabSpectraHeis.setEnabled(True) | |
4794 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5043 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
4795 |
|
5044 | |||
4796 | def checkInputsProject(self): |
|
5045 | def checkInputsProject(self): | |
4797 | """ |
|
5046 | """ | |
4798 | Check Inputs Project: |
|
5047 | Check Inputs Project: | |
4799 | - project_name |
|
5048 | - project_name | |
4800 | - datatype |
|
5049 | - datatype | |
4801 | - ext |
|
5050 | - ext | |
4802 | - data_path |
|
5051 | - data_path | |
4803 | - readmode |
|
5052 | - readmode | |
4804 | - delay |
|
5053 | - delay | |
4805 | - set |
|
5054 | - set | |
4806 | - walk |
|
5055 | - walk | |
4807 | """ |
|
5056 | """ | |
4808 | parms_ok = True |
|
5057 | parms_ok = True | |
4809 | project_name = str(self.proName.text()) |
|
5058 | project_name = str(self.proName.text()) | |
4810 | if project_name == '' or project_name == None: |
|
5059 | if project_name == '' or project_name == None: | |
4811 | outputstr = "Enter the Project Name" |
|
5060 | outputstr = "Enter the Project Name" | |
4812 | self.console.append(outputstr) |
|
5061 | self.console.append(outputstr) | |
4813 | parms_ok = False |
|
5062 | parms_ok = False | |
4814 | project_name = None |
|
5063 | project_name = None | |
4815 |
|
5064 | |||
4816 | datatype = str(self.proComDataType.currentText()) |
|
5065 | datatype = str(self.proComDataType.currentText()) | |
4817 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5066 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
4818 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5067 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
4819 | self.console.append(outputstr) |
|
5068 | self.console.append(outputstr) | |
4820 | parms_ok = False |
|
5069 | parms_ok = False | |
4821 | datatype = None |
|
5070 | datatype = None | |
4822 |
|
5071 | |||
4823 | ext = str(self.proDataType.text()) |
|
5072 | ext = str(self.proDataType.text()) | |
4824 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5073 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
4825 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5074 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
4826 | self.console.append(outputstr) |
|
5075 | self.console.append(outputstr) | |
4827 | parms_ok = False |
|
5076 | parms_ok = False | |
4828 | ext = None |
|
5077 | ext = None | |
4829 |
|
5078 | |||
4830 | data_path = str(self.proDataPath.text()) |
|
5079 | data_path = str(self.proDataPath.text()) | |
4831 |
|
5080 | |||
4832 | if data_path == '': |
|
5081 | if data_path == '': | |
4833 | outputstr = 'Datapath is empty' |
|
5082 | outputstr = 'Datapath is empty' | |
4834 | self.console.append(outputstr) |
|
5083 | self.console.append(outputstr) | |
4835 | parms_ok = False |
|
5084 | parms_ok = False | |
4836 | data_path = None |
|
5085 | data_path = None | |
4837 |
|
5086 | |||
4838 | if data_path != None: |
|
5087 | if data_path != None: | |
4839 | if not os.path.isdir(data_path): |
|
5088 | if not os.path.isdir(data_path): | |
4840 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5089 | outputstr = 'Datapath:%s does not exists' % data_path | |
4841 | self.console.append(outputstr) |
|
5090 | self.console.append(outputstr) | |
4842 | parms_ok = False |
|
5091 | parms_ok = False | |
4843 | data_path = None |
|
5092 | data_path = None | |
4844 |
|
5093 | |||
4845 | read_mode = str(self.proComReadMode.currentText()) |
|
5094 | read_mode = str(self.proComReadMode.currentText()) | |
4846 | if not(read_mode in ['Online', 'Offline']): |
|
5095 | if not(read_mode in ['Online', 'Offline']): | |
4847 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5096 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
4848 | self.console.append(outputstr) |
|
5097 | self.console.append(outputstr) | |
4849 | parms_ok = False |
|
5098 | parms_ok = False | |
4850 | read_mode = None |
|
5099 | read_mode = None | |
4851 |
|
5100 | |||
4852 | try: |
|
5101 | try: | |
4853 | delay = int(str(self.proDelay.text())) |
|
5102 | delay = int(str(self.proDelay.text())) | |
4854 | except: |
|
5103 | except: | |
4855 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5104 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
4856 | self.console.append(outputstr) |
|
5105 | self.console.append(outputstr) | |
4857 | # parms_ok = False |
|
5106 | # parms_ok = False | |
4858 | delay = None |
|
5107 | delay = None | |
4859 |
|
5108 | |||
4860 | try: |
|
5109 | try: | |
4861 | set = int(str(self.proSet.text())) |
|
5110 | set = int(str(self.proSet.text())) | |
4862 | except: |
|
5111 | except: | |
4863 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5112 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
4864 | # self.console.append(outputstr) |
|
5113 | # self.console.append(outputstr) | |
4865 | # parms_ok = False |
|
5114 | # parms_ok = False | |
4866 | set = None |
|
5115 | set = None | |
4867 |
|
5116 | |||
4868 | walk_str = str(self.proComWalk.currentText()) |
|
5117 | walk_str = str(self.proComWalk.currentText()) | |
4869 | if walk_str == 'On Files': |
|
5118 | if walk_str == 'On Files': | |
4870 | walk = 0 |
|
5119 | walk = 0 | |
4871 | elif walk_str == 'On Folder': |
|
5120 | elif walk_str == 'On Folder': | |
4872 | walk = 1 |
|
5121 | walk = 1 | |
4873 | else: |
|
5122 | else: | |
4874 | outputstr = 'Walk: %s, this must be either On Files or On Folders' % walk_str |
|
5123 | outputstr = 'Walk: %s, this must be either On Files or On Folders' % walk_str | |
4875 | self.console.append(outputstr) |
|
5124 | self.console.append(outputstr) | |
4876 | parms_ok = False |
|
5125 | parms_ok = False | |
4877 | walk = None |
|
5126 | walk = None | |
4878 |
|
5127 | |||
4879 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set |
|
5128 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set | |
4880 |
|
5129 | |||
4881 | def checkInputsPUSave(self, datatype): |
|
5130 | def checkInputsPUSave(self, datatype): | |
4882 | """ |
|
5131 | """ | |
4883 | Check Inputs Spectra Save: |
|
5132 | Check Inputs Spectra Save: | |
4884 | - path |
|
5133 | - path | |
4885 | - blocks Per File |
|
5134 | - blocks Per File | |
4886 | - sufix |
|
5135 | - sufix | |
4887 | - dataformat |
|
5136 | - dataformat | |
4888 | """ |
|
5137 | """ | |
4889 | parms_ok = True |
|
5138 | parms_ok = True | |
4890 |
|
5139 | |||
4891 | if datatype == "Voltage": |
|
5140 | if datatype == "Voltage": | |
4892 | output_path = str(self.volOutputPath.text()) |
|
5141 | output_path = str(self.volOutputPath.text()) | |
4893 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5142 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
4894 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5143 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
4895 |
|
5144 | |||
4896 | if datatype == "Spectra": |
|
5145 | if datatype == "Spectra": | |
4897 | output_path = str(self.specOutputPath.text()) |
|
5146 | output_path = str(self.specOutputPath.text()) | |
4898 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5147 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
4899 | profilesperblock = str(self.specOutputprofileperblock.text()) |
|
5148 | profilesperblock = str(self.specOutputprofileperblock.text()) | |
4900 |
|
5149 | |||
4901 | if datatype == "SpectraHeis": |
|
5150 | if datatype == "SpectraHeis": | |
4902 | output_path = str(self.specHeisOutputPath.text()) |
|
5151 | output_path = str(self.specHeisOutputPath.text()) | |
4903 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5152 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
4904 | metada = str(self.specHeisOutputMetada.text()) |
|
5153 | metada = str(self.specHeisOutputMetada.text()) | |
4905 |
|
5154 | |||
4906 | if output_path == '': |
|
5155 | if output_path == '': | |
4907 | outputstr = 'Outputpath is empty' |
|
5156 | outputstr = 'Outputpath is empty' | |
4908 | self.console.append(outputstr) |
|
5157 | self.console.append(outputstr) | |
4909 | parms_ok = False |
|
5158 | parms_ok = False | |
4910 | data_path = None |
|
5159 | data_path = None | |
4911 |
|
5160 | |||
4912 | if output_path != None: |
|
5161 | if output_path != None: | |
4913 | if not os.path.exists(output_path): |
|
5162 | if not os.path.exists(output_path): | |
4914 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5163 | outputstr = 'OutputPath:%s does not exists' % output_path | |
4915 | self.console.append(outputstr) |
|
5164 | self.console.append(outputstr) | |
4916 | parms_ok = False |
|
5165 | parms_ok = False | |
4917 | output_path = None |
|
5166 | output_path = None | |
4918 |
|
5167 | |||
4919 |
|
5168 | |||
4920 | try: |
|
5169 | try: | |
4921 | profilesperblock = int(profilesperblock) |
|
5170 | profilesperblock = int(profilesperblock) | |
4922 | except: |
|
5171 | except: | |
4923 | if datatype == "Voltage": |
|
5172 | if datatype == "Voltage": | |
4924 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5173 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
4925 | self.console.append(outputstr) |
|
5174 | self.console.append(outputstr) | |
4926 | parms_ok = False |
|
5175 | parms_ok = False | |
4927 | profilesperblock = None |
|
5176 | profilesperblock = None | |
4928 |
|
5177 | |||
4929 | elif datatype == "Spectra": |
|
5178 | elif datatype == "Spectra": | |
4930 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.specOutputprofileperblock.text()) |
|
5179 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.specOutputprofileperblock.text()) | |
4931 | self.console.append(outputstr) |
|
5180 | self.console.append(outputstr) | |
4932 | parms_ok = False |
|
5181 | parms_ok = False | |
4933 | profilesperblock = None |
|
5182 | profilesperblock = None | |
4934 |
|
5183 | |||
4935 | try: |
|
5184 | try: | |
4936 | blocksperfile = int(blocksperfile) |
|
5185 | blocksperfile = int(blocksperfile) | |
4937 | except: |
|
5186 | except: | |
4938 | if datatype == "Voltage": |
|
5187 | if datatype == "Voltage": | |
4939 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5188 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
4940 | elif datatype == "Spectra": |
|
5189 | elif datatype == "Spectra": | |
4941 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5190 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
4942 | elif datatype == "SpectraHeis": |
|
5191 | elif datatype == "SpectraHeis": | |
4943 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5192 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
4944 |
|
5193 | |||
4945 | self.console.append(outputstr) |
|
5194 | self.console.append(outputstr) | |
4946 | parms_ok = False |
|
5195 | parms_ok = False | |
4947 | blocksperfile = None |
|
5196 | blocksperfile = None | |
4948 |
|
5197 | |||
4949 | if datatype == "SpectraHeis": |
|
5198 | if datatype == "SpectraHeis": | |
4950 | if metada == '': |
|
5199 | if metada == '': | |
4951 | outputstr = 'Choose metada file' |
|
5200 | outputstr = 'Choose metada file' | |
4952 | self.console.append(outputstr) |
|
5201 | self.console.append(outputstr) | |
4953 | parms_ok = False |
|
5202 | parms_ok = False | |
4954 | if metada != None: |
|
5203 | if metada != None: | |
4955 | if not os.path.isfile(metada): |
|
5204 | if not os.path.isfile(metada): | |
4956 | outputstr = 'Metadata:%s does not exists' % metada |
|
5205 | outputstr = 'Metadata:%s does not exists' % metada | |
4957 | self.console.append(outputstr) |
|
5206 | self.console.append(outputstr) | |
4958 | parms_ok = False |
|
5207 | parms_ok = False | |
4959 | output_path = None |
|
5208 | output_path = None | |
4960 |
|
5209 | |||
4961 | if datatype == "Voltage": |
|
5210 | if datatype == "Voltage": | |
4962 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5211 | return parms_ok, output_path, blocksperfile, profilesperblock | |
4963 |
|
5212 | |||
4964 |
|
5213 | |||
4965 | if datatype == "Spectra": |
|
5214 | if datatype == "Spectra": | |
4966 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5215 | return parms_ok, output_path, blocksperfile, profilesperblock | |
4967 |
|
5216 | |||
4968 |
|
5217 | |||
4969 | if datatype == "SpectraHeis": |
|
5218 | if datatype == "SpectraHeis": | |
4970 | return parms_ok, output_path, blocksperfile, metada |
|
5219 | return parms_ok, output_path, blocksperfile, metada | |
4971 |
|
5220 | |||
4972 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5221 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
4973 |
|
5222 | |||
4974 | dateList = [] |
|
5223 | dateList = [] | |
4975 | fileList = [] |
|
5224 | fileList = [] | |
4976 |
|
5225 | |||
4977 | if ext == ".r": |
|
5226 | if ext == ".r": | |
4978 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5227 | from schainpy.model.io.jroIO_base import JRODataReader | |
4979 |
|
5228 | |||
4980 | readerObj = JRODataReader() |
|
5229 | readerObj = JRODataReader() | |
4981 | dateList = readerObj.findDatafiles(path=data_path, |
|
5230 | dateList = readerObj.findDatafiles(path=data_path, | |
4982 | expLabel=expLabel, |
|
5231 | expLabel=expLabel, | |
4983 | ext=ext, |
|
5232 | ext=ext, | |
4984 | walk=walk) |
|
5233 | walk=walk) | |
4985 |
|
5234 | |||
4986 | if ext == ".pdata": |
|
5235 | if ext == ".pdata": | |
4987 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5236 | from schainpy.model.io.jroIO_base import JRODataReader | |
4988 |
|
5237 | |||
4989 | readerObj = JRODataReader() |
|
5238 | readerObj = JRODataReader() | |
4990 | dateList = readerObj.findDatafiles(path=data_path, |
|
5239 | dateList = readerObj.findDatafiles(path=data_path, | |
4991 | expLabel=expLabel, |
|
5240 | expLabel=expLabel, | |
4992 | ext=ext, |
|
5241 | ext=ext, | |
4993 | walk=walk) |
|
5242 | walk=walk) | |
4994 |
|
5243 | |||
4995 | if ext == ".fits": |
|
5244 | if ext == ".fits": | |
4996 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5245 | from schainpy.model.io.jroIO_base import JRODataReader | |
4997 |
|
5246 | |||
4998 | readerObj = JRODataReader() |
|
5247 | readerObj = JRODataReader() | |
4999 | dateList = readerObj.findDatafiles(path=data_path, |
|
5248 | dateList = readerObj.findDatafiles(path=data_path, | |
5000 | expLabel=expLabel, |
|
5249 | expLabel=expLabel, | |
5001 | ext=ext, |
|
5250 | ext=ext, | |
5002 | walk=walk) |
|
5251 | walk=walk) | |
5003 |
|
5252 | |||
5004 | if ext == ".hdf5": |
|
5253 | if ext == ".hdf5": | |
5005 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5254 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5006 |
|
5255 | |||
5007 | readerObj = USRPReader() |
|
5256 | readerObj = USRPReader() | |
5008 | dateList = readerObj.findDatafiles(path=data_path) |
|
5257 | dateList = readerObj.findDatafiles(path=data_path) | |
5009 |
|
5258 | |||
5010 | return dateList |
|
5259 | return dateList | |
5011 |
|
5260 | |||
5012 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5261 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5013 | """ |
|
5262 | """ | |
5014 | Method to loads day |
|
5263 | Method to loads day | |
5015 | """ |
|
5264 | """ | |
5016 | self.proOk.setEnabled(False) |
|
5265 | self.proOk.setEnabled(False) | |
5017 | self.dateList = [] |
|
5266 | self.dateList = [] | |
5018 |
|
5267 | |||
5019 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5268 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5020 |
|
5269 | |||
5021 | if not dateList: |
|
5270 | if not dateList: | |
5022 | # self.console.clear() |
|
5271 | # self.console.clear() | |
5023 | outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext) |
|
5272 | outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext) | |
5024 | self.console.append(outputstr) |
|
5273 | self.console.append(outputstr) | |
5025 | return |
|
5274 | return | |
5026 |
|
5275 | |||
5027 | self.proComStartDate.clear() |
|
5276 | self.proComStartDate.clear() | |
5028 | self.proComEndDate.clear() |
|
5277 | self.proComEndDate.clear() | |
5029 |
|
5278 | |||
5030 | dateStrList = [] |
|
5279 | dateStrList = [] | |
5031 | for thisDate in dateList: |
|
5280 | for thisDate in dateList: | |
5032 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5281 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5033 |
|
5282 | |||
5034 | self.proComStartDate.addItem(dateStr) |
|
5283 | self.proComStartDate.addItem(dateStr) | |
5035 | self.proComEndDate.addItem(dateStr) |
|
5284 | self.proComEndDate.addItem(dateStr) | |
5036 | dateStrList.append(dateStr) |
|
5285 | dateStrList.append(dateStr) | |
5037 |
|
5286 | |||
5038 | self.proComStartDate.setCurrentIndex(0) |
|
5287 | self.proComStartDate.setCurrentIndex(0) | |
5039 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5288 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5040 |
|
5289 | |||
5041 | self.dateList = dateStrList |
|
5290 | self.dateList = dateStrList | |
5042 | self.proOk.setEnabled(True) |
|
5291 | self.proOk.setEnabled(True) | |
5043 |
|
5292 | |||
5044 | return self.dateList |
|
5293 | return self.dateList | |
5045 |
|
5294 | |||
5046 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5295 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5047 |
|
5296 | |||
5048 | if pathWorkSpace == None: |
|
5297 | if pathWorkSpace == None: | |
5049 | home = os.path.expanduser("~") |
|
5298 | home = os.path.expanduser("~") | |
5050 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5299 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5051 |
|
5300 | |||
5052 | self.pathWorkSpace = pathWorkSpace |
|
5301 | self.pathWorkSpace = pathWorkSpace | |
5053 |
|
5302 | |||
5054 | """ |
|
5303 | """ | |
5055 | Comandos Usados en Console |
|
5304 | Comandos Usados en Console | |
5056 | """ |
|
5305 | """ | |
5057 | def __del__(self): |
|
5306 | def __del__(self): | |
5058 | sys.stdout = sys.__stdout__ |
|
5307 | sys.stdout = sys.__stdout__ | |
5059 | sys.stderr = sys.__stderr__ |
|
5308 | sys.stderr = sys.__stderr__ | |
5060 |
|
5309 | |||
5061 | def normalOutputWritten(self, text): |
|
5310 | def normalOutputWritten(self, text): | |
5062 | color_black = QtGui.QColor(0,0,0) |
|
5311 | color_black = QtGui.QColor(0,0,0) | |
5063 | self.console.setTextColor(color_black) |
|
5312 | self.console.setTextColor(color_black) | |
5064 | self.console.append(text) |
|
5313 | self.console.append(text) | |
5065 |
|
5314 | |||
5066 | def errorOutputWritten(self, text): |
|
5315 | def errorOutputWritten(self, text): | |
5067 | color_red = QtGui.QColor(255,0,0) |
|
5316 | color_red = QtGui.QColor(255,0,0) | |
5068 | color_black = QtGui.QColor(0,0,0) |
|
5317 | color_black = QtGui.QColor(0,0,0) | |
5069 |
|
5318 | |||
5070 | self.console.setTextColor(color_red) |
|
5319 | self.console.setTextColor(color_red) | |
5071 | self.console.append(text) |
|
5320 | self.console.append(text) | |
5072 | self.console.setTextColor(color_black) |
|
5321 | self.console.setTextColor(color_black) | |
5073 |
|
5322 | |||
5074 | def setParameter(self): |
|
5323 | def setParameter(self): | |
5075 |
|
5324 | |||
5076 | self.setWindowTitle("ROJ-Signal Chain") |
|
5325 | self.setWindowTitle("ROJ-Signal Chain") | |
5077 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) |
|
5326 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) | |
5078 |
|
5327 | |||
5079 | self.tabWidgetProject.setEnabled(False) |
|
5328 | self.tabWidgetProject.setEnabled(False) | |
5080 | self.tabVoltage.setEnabled(False) |
|
5329 | self.tabVoltage.setEnabled(False) | |
5081 | self.tabSpectra.setEnabled(False) |
|
5330 | self.tabSpectra.setEnabled(False) | |
5082 | self.tabCorrelation.setEnabled(False) |
|
5331 | self.tabCorrelation.setEnabled(False) | |
5083 | self.frame_2.setEnabled(False) |
|
5332 | self.frame_2.setEnabled(False) | |
5084 |
|
5333 | |||
5085 | self.actionCreate.setShortcut('Ctrl+N') |
|
5334 | self.actionCreate.setShortcut('Ctrl+N') | |
5086 | self.actionOpen.setShortcut('Ctrl+O') |
|
5335 | self.actionOpen.setShortcut('Ctrl+O') | |
5087 | self.actionSave.setShortcut('Ctrl+S') |
|
5336 | self.actionSave.setShortcut('Ctrl+S') | |
5088 | self.actionClose.setShortcut('Ctrl+X') |
|
5337 | self.actionClose.setShortcut('Ctrl+X') | |
5089 |
|
5338 | |||
5090 | self.actionStart.setShortcut('Ctrl+1') |
|
5339 | self.actionStart.setShortcut('Ctrl+1') | |
5091 | self.actionPause.setShortcut('Ctrl+2') |
|
5340 | self.actionPause.setShortcut('Ctrl+2') | |
5092 | self.actionStop.setShortcut('Ctrl+3') |
|
5341 | self.actionStop.setShortcut('Ctrl+3') | |
5093 |
|
5342 | |||
5094 | self.actionFTP.setShortcut('Ctrl+F') |
|
5343 | self.actionFTP.setShortcut('Ctrl+F') | |
5095 |
|
5344 | |||
5096 | self.actionStart.setEnabled(False) |
|
5345 | self.actionStart.setEnabled(False) | |
5097 | self.actionPause.setEnabled(False) |
|
5346 | self.actionPause.setEnabled(False) | |
5098 | self.actionStop.setEnabled(False) |
|
5347 | self.actionStop.setEnabled(False) | |
5099 |
|
5348 | |||
5100 | self.actionStarToolbar.setEnabled(False) |
|
5349 | self.actionStarToolbar.setEnabled(False) | |
5101 | self.actionPauseToolbar.setEnabled(False) |
|
5350 | self.actionPauseToolbar.setEnabled(False) | |
5102 | self.actionStopToolbar.setEnabled(False) |
|
5351 | self.actionStopToolbar.setEnabled(False) | |
5103 |
|
5352 | |||
5104 | self.proName.clear() |
|
5353 | self.proName.clear() | |
5105 | self.proDataPath.setText('') |
|
5354 | self.proDataPath.setText('') | |
5106 | self.console.setReadOnly(True) |
|
5355 | self.console.setReadOnly(True) | |
5107 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5356 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5108 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5357 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5109 | self.proDataType.setEnabled(False) |
|
5358 | self.proDataType.setEnabled(False) | |
5110 | self.time = QtCore.QTime() |
|
5359 | self.time = QtCore.QTime() | |
5111 | self.hour = 0 |
|
5360 | self.hour = 0 | |
5112 | self.min = 0 |
|
5361 | self.min = 0 | |
5113 | self.sec = 0 |
|
5362 | self.sec = 0 | |
5114 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5363 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5115 | startTime = "00:00:00" |
|
5364 | startTime = "00:00:00" | |
5116 | endTime = "23:59:59" |
|
5365 | endTime = "23:59:59" | |
5117 | starlist = startTime.split(":") |
|
5366 | starlist = startTime.split(":") | |
5118 | endlist = endTime.split(":") |
|
5367 | endlist = endTime.split(":") | |
5119 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5368 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5120 | self.proStartTime.setTime(self.time) |
|
5369 | self.proStartTime.setTime(self.time) | |
5121 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5370 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5122 | self.proEndTime.setTime(self.time) |
|
5371 | self.proEndTime.setTime(self.time) | |
5123 | self.proOk.setEnabled(False) |
|
5372 | self.proOk.setEnabled(False) | |
5124 | # set model Project Explorer |
|
5373 | # set model Project Explorer | |
5125 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5374 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5126 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5375 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5127 | layout = QtGui.QVBoxLayout() |
|
5376 | layout = QtGui.QVBoxLayout() | |
5128 | layout.addWidget(self.projectExplorerTree) |
|
5377 | layout.addWidget(self.projectExplorerTree) | |
5129 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5378 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5130 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5379 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5131 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5380 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5132 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5381 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5133 | self.projectExplorerTree.expandAll() |
|
5382 | self.projectExplorerTree.expandAll() | |
5134 | # set model Project Properties |
|
5383 | # set model Project Properties | |
5135 |
|
5384 | |||
5136 | self.propertiesModel = TreeModel() |
|
5385 | self.propertiesModel = TreeModel() | |
5137 | self.propertiesModel.initProjectView() |
|
5386 | self.propertiesModel.initProjectView() | |
5138 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5387 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5139 | self.treeProjectProperties.expandAll() |
|
5388 | self.treeProjectProperties.expandAll() | |
5140 | self.treeProjectProperties.allColumnsShowFocus() |
|
5389 | self.treeProjectProperties.allColumnsShowFocus() | |
5141 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5390 | self.treeProjectProperties.resizeColumnToContents(1) | |
5142 |
|
5391 | |||
5143 | # set Project |
|
5392 | # set Project | |
5144 | self.proDelay.setEnabled(False) |
|
5393 | self.proDelay.setEnabled(False) | |
5145 | self.proSet.setEnabled(False) |
|
5394 | self.proSet.setEnabled(False) | |
5146 | self.proDataType.setReadOnly(True) |
|
5395 | self.proDataType.setReadOnly(True) | |
5147 |
|
5396 | |||
5148 | # set Operation Voltage |
|
5397 | # set Operation Voltage | |
5149 | self.volOpComChannels.setEnabled(False) |
|
5398 | self.volOpComChannels.setEnabled(False) | |
5150 | self.volOpComHeights.setEnabled(False) |
|
5399 | self.volOpComHeights.setEnabled(False) | |
5151 | self.volOpFilter.setEnabled(False) |
|
5400 | self.volOpFilter.setEnabled(False) | |
5152 | self.volOpComProfile.setEnabled(False) |
|
5401 | self.volOpComProfile.setEnabled(False) | |
5153 | self.volOpComCode.setEnabled(False) |
|
5402 | self.volOpComCode.setEnabled(False) | |
5154 | self.volOpFlip.setEnabled(False) |
|
5403 | self.volOpFlip.setEnabled(False) | |
5155 | self.volOpCohInt.setEnabled(False) |
|
5404 | self.volOpCohInt.setEnabled(False) | |
5156 | self.volOpRadarfrequency.setEnabled(False) |
|
5405 | self.volOpRadarfrequency.setEnabled(False) | |
5157 |
|
5406 | |||
5158 | self.volOpChannel.setEnabled(False) |
|
5407 | self.volOpChannel.setEnabled(False) | |
5159 | self.volOpHeights.setEnabled(False) |
|
5408 | self.volOpHeights.setEnabled(False) | |
5160 | self.volOpProfile.setEnabled(False) |
|
5409 | self.volOpProfile.setEnabled(False) | |
5161 | self.volOpComMode.setEnabled(False) |
|
5410 | self.volOpComMode.setEnabled(False) | |
5162 |
|
5411 | |||
5163 | self.volGraphPath.setEnabled(False) |
|
5412 | self.volGraphPath.setEnabled(False) | |
5164 | self.volGraphPrefix.setEnabled(False) |
|
5413 | self.volGraphPrefix.setEnabled(False) | |
5165 | self.volGraphToolPath.setEnabled(False) |
|
5414 | self.volGraphToolPath.setEnabled(False) | |
5166 |
|
5415 | |||
5167 | # set Graph Voltage |
|
5416 | # set Graph Voltage | |
5168 | self.volGraphChannelList.setEnabled(False) |
|
5417 | self.volGraphChannelList.setEnabled(False) | |
5169 | self.volGraphfreqrange.setEnabled(False) |
|
5418 | self.volGraphfreqrange.setEnabled(False) | |
5170 | self.volGraphHeightrange.setEnabled(False) |
|
5419 | self.volGraphHeightrange.setEnabled(False) | |
5171 |
|
5420 | |||
5172 | # set Operation Spectra |
|
5421 | # set Operation Spectra | |
5173 | self.specOpnFFTpoints.setEnabled(False) |
|
5422 | self.specOpnFFTpoints.setEnabled(False) | |
5174 | self.specOpProfiles.setEnabled(False) |
|
5423 | self.specOpProfiles.setEnabled(False) | |
5175 | self.specOpippFactor.setEnabled(False) |
|
5424 | self.specOpippFactor.setEnabled(False) | |
5176 | self.specOppairsList.setEnabled(False) |
|
5425 | self.specOppairsList.setEnabled(False) | |
5177 | self.specOpComChannel.setEnabled(False) |
|
5426 | self.specOpComChannel.setEnabled(False) | |
5178 | self.specOpComHeights.setEnabled(False) |
|
5427 | self.specOpComHeights.setEnabled(False) | |
5179 | self.specOpIncoherent.setEnabled(False) |
|
5428 | self.specOpIncoherent.setEnabled(False) | |
5180 | self.specOpgetNoise.setEnabled(False) |
|
5429 | self.specOpgetNoise.setEnabled(False) | |
5181 | self.specOpRadarfrequency.setEnabled(False) |
|
5430 | self.specOpRadarfrequency.setEnabled(False) | |
5182 |
|
5431 | |||
5183 |
|
5432 | |||
5184 | self.specOpChannel.setEnabled(False) |
|
5433 | self.specOpChannel.setEnabled(False) | |
5185 | self.specOpHeights.setEnabled(False) |
|
5434 | self.specOpHeights.setEnabled(False) | |
5186 | # set Graph Spectra |
|
5435 | # set Graph Spectra | |
5187 | self.specGgraphChannelList.setEnabled(False) |
|
5436 | self.specGgraphChannelList.setEnabled(False) | |
5188 | self.specGgraphFreq.setEnabled(False) |
|
5437 | self.specGgraphFreq.setEnabled(False) | |
5189 | self.specGgraphHeight.setEnabled(False) |
|
5438 | self.specGgraphHeight.setEnabled(False) | |
5190 | self.specGgraphDbsrange.setEnabled(False) |
|
5439 | self.specGgraphDbsrange.setEnabled(False) | |
5191 | self.specGgraphmagnitud.setEnabled(False) |
|
5440 | self.specGgraphmagnitud.setEnabled(False) | |
5192 | self.specGgraphTminTmax.setEnabled(False) |
|
5441 | self.specGgraphTminTmax.setEnabled(False) | |
5193 | self.specGgraphTimeRange.setEnabled(False) |
|
5442 | self.specGgraphTimeRange.setEnabled(False) | |
5194 | self.specGraphPath.setEnabled(False) |
|
5443 | self.specGraphPath.setEnabled(False) | |
5195 | self.specGraphToolPath.setEnabled(False) |
|
5444 | self.specGraphToolPath.setEnabled(False) | |
5196 | self.specGraphPrefix.setEnabled(False) |
|
5445 | self.specGraphPrefix.setEnabled(False) | |
5197 |
|
5446 | |||
5198 | self.specGgraphftpratio.setEnabled(False) |
|
5447 | self.specGgraphftpratio.setEnabled(False) | |
5199 | # set Operation SpectraHeis |
|
5448 | # set Operation SpectraHeis | |
5200 | self.specHeisOpIncoherent.setEnabled(False) |
|
5449 | self.specHeisOpIncoherent.setEnabled(False) | |
5201 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5450 | self.specHeisOpCobIncInt.setEnabled(False) | |
5202 | # set Graph SpectraHeis |
|
5451 | # set Graph SpectraHeis | |
5203 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5452 | self.specHeisGgraphChannelList.setEnabled(False) | |
5204 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5453 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5205 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5454 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5206 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5455 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5207 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5456 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5208 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5457 | self.specHeisGgraphftpratio.setEnabled(False) | |
5209 | self.specHeisGraphPath.setEnabled(False) |
|
5458 | self.specHeisGraphPath.setEnabled(False) | |
5210 | self.specHeisGraphPrefix.setEnabled(False) |
|
5459 | self.specHeisGraphPrefix.setEnabled(False) | |
5211 | self.specHeisGraphToolPath.setEnabled(False) |
|
5460 | self.specHeisGraphToolPath.setEnabled(False) | |
5212 |
|
5461 | |||
5213 |
|
5462 | |||
5214 | # tool tip gui |
|
5463 | # tool tip gui | |
5215 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5464 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5216 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5465 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5217 | # tool tip gui project |
|
5466 | # tool tip gui project | |
5218 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') |
|
5467 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') | |
5219 | self.proComWalk.setCurrentIndex(0) |
|
5468 | self.proComWalk.setCurrentIndex(0) | |
5220 | # tool tip gui volOp |
|
5469 | # tool tip gui volOp | |
5221 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5470 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5222 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5471 | self.volOpHeights.setToolTip('Example: 90,180') | |
5223 | self.volOpFilter.setToolTip('Example: 2') |
|
5472 | self.volOpFilter.setToolTip('Example: 2') | |
5224 | self.volOpProfile.setToolTip('Example:0,127') |
|
5473 | self.volOpProfile.setToolTip('Example:0,127') | |
5225 | self.volOpCohInt.setToolTip('Example: 128') |
|
5474 | self.volOpCohInt.setToolTip('Example: 128') | |
5226 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5475 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5227 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5476 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5228 | # tool tip gui volGraph |
|
5477 | # tool tip gui volGraph | |
5229 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5478 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5230 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5479 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5231 | # tool tip gui specOp |
|
5480 | # tool tip gui specOp | |
5232 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5481 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5233 | self.specOpProfiles.setToolTip('Example: 128') |
|
5482 | self.specOpProfiles.setToolTip('Example: 128') | |
5234 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5483 | self.specOpippFactor.setToolTip('Example:1.0') | |
5235 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5484 | self.specOpIncoherent.setToolTip('Example: 10') | |
5236 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5485 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5237 |
|
5486 | |||
5238 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5487 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5239 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5488 | self.specOpHeights.setToolTip('Example: 90,180') | |
5240 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5489 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5241 | # tool tip gui specGraph |
|
5490 | # tool tip gui specGraph | |
5242 |
|
5491 | |||
5243 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5492 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5244 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5493 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5245 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5494 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5246 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5495 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5247 |
|
5496 | |||
5248 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5497 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5249 |
|
5498 | |||
5250 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5499 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5251 | sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5500 | sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5252 |
|
5501 | |||
5253 |
|
5502 | |||
5254 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5503 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5255 | """ |
|
5504 | """ | |
5256 | Class documentation goes here. |
|
5505 | Class documentation goes here. | |
5257 | """ |
|
5506 | """ | |
5258 | closed = pyqtSignal() |
|
5507 | closed = pyqtSignal() | |
5259 | create = False |
|
5508 | create = False | |
5260 |
|
5509 | |||
5261 | def __init__(self, parent=None): |
|
5510 | def __init__(self, parent=None): | |
5262 | """ |
|
5511 | """ | |
5263 | Constructor |
|
5512 | Constructor | |
5264 | """ |
|
5513 | """ | |
5265 | QMainWindow.__init__(self, parent) |
|
5514 | QMainWindow.__init__(self, parent) | |
5266 | self.setupUi(self) |
|
5515 | self.setupUi(self) | |
5267 | self.getFromWindow = None |
|
5516 | self.getFromWindow = None | |
5268 | self.getfromWindowList = [] |
|
5517 | self.getfromWindowList = [] | |
5269 | self.dataTypeProject = None |
|
5518 | self.dataTypeProject = None | |
5270 |
|
5519 | |||
5271 | self.listUP = None |
|
5520 | self.listUP = None | |
5272 |
|
5521 | |||
5273 | @pyqtSignature("") |
|
5522 | @pyqtSignature("") | |
5274 | def on_unitPokbut_clicked(self): |
|
5523 | def on_unitPokbut_clicked(self): | |
5275 | """ |
|
5524 | """ | |
5276 | Slot documentation goes here. |
|
5525 | Slot documentation goes here. | |
5277 | """ |
|
5526 | """ | |
5278 | self.create = True |
|
5527 | self.create = True | |
5279 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5528 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5280 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5529 | # self.nameofUP= str(self.nameUptxt.text()) | |
5281 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5530 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5282 | self.close() |
|
5531 | self.close() | |
5283 |
|
5532 | |||
5284 |
|
5533 | |||
5285 | @pyqtSignature("") |
|
5534 | @pyqtSignature("") | |
5286 | def on_unitPcancelbut_clicked(self): |
|
5535 | def on_unitPcancelbut_clicked(self): | |
5287 | """ |
|
5536 | """ | |
5288 | Slot documentation goes here. |
|
5537 | Slot documentation goes here. | |
5289 | """ |
|
5538 | """ | |
5290 | self.create = False |
|
5539 | self.create = False | |
5291 | self.close() |
|
5540 | self.close() | |
5292 |
|
5541 | |||
5293 | def loadTotalList(self): |
|
5542 | def loadTotalList(self): | |
5294 | self.comboInputBox.clear() |
|
5543 | self.comboInputBox.clear() | |
5295 | for i in self.getfromWindowList: |
|
5544 | for i in self.getfromWindowList: | |
5296 |
|
5545 | |||
5297 | name = i.getElementName() |
|
5546 | name = i.getElementName() | |
5298 | if name == 'Project': |
|
5547 | if name == 'Project': | |
5299 | id = i.id |
|
5548 | id = i.id | |
5300 | name = i.name |
|
5549 | name = i.name | |
5301 | if self.dataTypeProject == 'Voltage': |
|
5550 | if self.dataTypeProject == 'Voltage': | |
5302 | self.comboTypeBox.clear() |
|
5551 | self.comboTypeBox.clear() | |
5303 | self.comboTypeBox.addItem("Voltage") |
|
5552 | self.comboTypeBox.addItem("Voltage") | |
5304 |
|
5553 | |||
5305 | if self.dataTypeProject == 'Spectra': |
|
5554 | if self.dataTypeProject == 'Spectra': | |
5306 | self.comboTypeBox.clear() |
|
5555 | self.comboTypeBox.clear() | |
5307 | self.comboTypeBox.addItem("Spectra") |
|
5556 | self.comboTypeBox.addItem("Spectra") | |
5308 | self.comboTypeBox.addItem("Correlation") |
|
5557 | self.comboTypeBox.addItem("Correlation") | |
5309 | if self.dataTypeProject == 'Fits': |
|
5558 | if self.dataTypeProject == 'Fits': | |
5310 | self.comboTypeBox.clear() |
|
5559 | self.comboTypeBox.clear() | |
5311 | self.comboTypeBox.addItem("SpectraHeis") |
|
5560 | self.comboTypeBox.addItem("SpectraHeis") | |
5312 |
|
5561 | |||
5313 |
|
5562 | |||
5314 | if name == 'ProcUnit': |
|
5563 | if name == 'ProcUnit': | |
5315 | id = int(i.id) - 1 |
|
5564 | id = int(i.id) - 1 | |
5316 | name = i.datatype |
|
5565 | name = i.datatype | |
5317 | if name == 'Voltage': |
|
5566 | if name == 'Voltage': | |
5318 | self.comboTypeBox.clear() |
|
5567 | self.comboTypeBox.clear() | |
5319 | self.comboTypeBox.addItem("Spectra") |
|
5568 | self.comboTypeBox.addItem("Spectra") | |
5320 | self.comboTypeBox.addItem("SpectraHeis") |
|
5569 | self.comboTypeBox.addItem("SpectraHeis") | |
5321 | self.comboTypeBox.addItem("Correlation") |
|
5570 | self.comboTypeBox.addItem("Correlation") | |
5322 | if name == 'Spectra': |
|
5571 | if name == 'Spectra': | |
5323 | self.comboTypeBox.clear() |
|
5572 | self.comboTypeBox.clear() | |
5324 | self.comboTypeBox.addItem("Spectra") |
|
5573 | self.comboTypeBox.addItem("Spectra") | |
5325 | self.comboTypeBox.addItem("SpectraHeis") |
|
5574 | self.comboTypeBox.addItem("SpectraHeis") | |
5326 | self.comboTypeBox.addItem("Correlation") |
|
5575 | self.comboTypeBox.addItem("Correlation") | |
5327 | if name == 'SpectraHeis': |
|
5576 | if name == 'SpectraHeis': | |
5328 | self.comboTypeBox.clear() |
|
5577 | self.comboTypeBox.clear() | |
5329 | self.comboTypeBox.addItem("SpectraHeis") |
|
5578 | self.comboTypeBox.addItem("SpectraHeis") | |
5330 |
|
5579 | |||
5331 | self.comboInputBox.addItem(str(name)) |
|
5580 | self.comboInputBox.addItem(str(name)) | |
5332 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5581 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5333 |
|
5582 | |||
5334 | def closeEvent(self, event): |
|
5583 | def closeEvent(self, event): | |
5335 | self.closed.emit() |
|
5584 | self.closed.emit() | |
5336 | event.accept() |
|
5585 | event.accept() | |
5337 |
|
5586 | |||
5338 | class Ftp(QMainWindow, Ui_Ftp): |
|
5587 | class Ftp(QMainWindow, Ui_Ftp): | |
5339 | """ |
|
5588 | """ | |
5340 | Class documentation goes here. |
|
5589 | Class documentation goes here. | |
5341 | """ |
|
5590 | """ | |
5342 | create = False |
|
5591 | create = False | |
5343 | closed = pyqtSignal() |
|
5592 | closed = pyqtSignal() | |
5344 | server = None |
|
5593 | server = None | |
5345 | folder = None |
|
5594 | remotefolder = None | |
5346 | username = None |
|
5595 | username = None | |
5347 | password = None |
|
5596 | password = None | |
5348 | ftp_wei = None |
|
5597 | ftp_wei = None | |
5349 | exp_code = None |
|
5598 | exp_code = None | |
5350 | sub_exp_code = None |
|
5599 | sub_exp_code = None | |
5351 | plot_pos = None |
|
5600 | plot_pos = None | |
5352 |
|
5601 | |||
5353 | def __init__(self, parent=None): |
|
5602 | def __init__(self, parent=None): | |
5354 | """ |
|
5603 | """ | |
5355 | Constructor |
|
5604 | Constructor | |
5356 | """ |
|
5605 | """ | |
5357 | QMainWindow.__init__(self, parent) |
|
5606 | QMainWindow.__init__(self, parent) | |
5358 | self.setupUi(self) |
|
5607 | self.setupUi(self) | |
5359 | self.setParameter() |
|
5608 | self.setParameter() | |
5360 |
|
5609 | |||
5361 | def setParameter(self): |
|
5610 | def setParameter(self): | |
5362 | self.setWindowTitle("ROJ-Signal Chain") |
|
5611 | self.setWindowTitle("ROJ-Signal Chain") | |
5363 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5612 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5364 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5613 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5365 | self.usernameFTP.setToolTip('Example: myusername') |
|
5614 | self.usernameFTP.setToolTip('Example: myusername') | |
5366 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5615 | self.passwordFTP.setToolTip('Example: mypass ') | |
5367 | self.weightFTP.setToolTip('Example: 0') |
|
5616 | self.weightFTP.setToolTip('Example: 0') | |
5368 | self.expcodeFTP.setToolTip('Example: 0') |
|
5617 | self.expcodeFTP.setToolTip('Example: 0') | |
5369 | self.subexpFTP.setToolTip('Example: 0') |
|
5618 | self.subexpFTP.setToolTip('Example: 0') | |
5370 | self.plotposFTP.setToolTip('Example: 0') |
|
5619 | self.plotposFTP.setToolTip('Example: 0') | |
5371 |
|
5620 | |||
5372 | def setParmsfromTemporal(self, server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5621 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5373 | self.serverFTP.setText(str(server)) |
|
5622 | self.serverFTP.setText(str(server)) | |
5374 | self.folderFTP.setText(str(folder)) |
|
5623 | self.folderFTP.setText(str(remotefolder)) | |
5375 | self.usernameFTP.setText(str(username)) |
|
5624 | self.usernameFTP.setText(str(username)) | |
5376 | self.passwordFTP.setText(str(password)) |
|
5625 | self.passwordFTP.setText(str(password)) | |
5377 | self.weightFTP.setText(str(ftp_wei)) |
|
5626 | self.weightFTP.setText(str(ftp_wei)) | |
5378 | self.expcodeFTP.setText(str(exp_code)) |
|
5627 | self.expcodeFTP.setText(str(exp_code)) | |
5379 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5628 | self.subexpFTP.setText(str(sub_exp_code)) | |
5380 | self.plotposFTP.setText(str(plot_pos)) |
|
5629 | self.plotposFTP.setText(str(plot_pos)) | |
5381 |
|
5630 | |||
5382 | def getParmsFromFtpWindow(self): |
|
5631 | def getParmsFromFtpWindow(self): | |
5383 | """ |
|
5632 | """ | |
5384 | Return Inputs Project: |
|
5633 | Return Inputs Project: | |
5385 | - server |
|
5634 | - server | |
5386 | - folder |
|
5635 | - remotefolder | |
5387 | - username |
|
5636 | - username | |
5388 | - password |
|
5637 | - password | |
5389 | - ftp_wei |
|
5638 | - ftp_wei | |
5390 | - exp_code |
|
5639 | - exp_code | |
5391 | - sub_exp_code |
|
5640 | - sub_exp_code | |
5392 | - plot_pos |
|
5641 | - plot_pos | |
5393 | """ |
|
5642 | """ | |
5394 | name_server_ftp = str(self.serverFTP.text()) |
|
5643 | name_server_ftp = str(self.serverFTP.text()) | |
5395 | try: |
|
5644 | if not name_server_ftp: | |
5396 | name = str(self.serverFTP.text()) |
|
|||
5397 | except: |
|
|||
5398 | self.console.clear() |
|
5645 | self.console.clear() | |
5399 | self.console.append("Please Write a FTP Server") |
|
5646 | self.console.append("Please Write a FTP Server") | |
5400 | return 0 |
|
5647 | return 0 | |
5401 |
|
5648 | |||
5402 | folder_server_ftp = str(self.folderFTP.text()) |
|
5649 | folder_server_ftp = str(self.folderFTP.text()) | |
5403 | try: |
|
5650 | if not folder_server_ftp: | |
5404 | folder = str(self.folderFTP.text()) |
|
|||
5405 | except: |
|
|||
5406 | self.console.clear() |
|
5651 | self.console.clear() | |
5407 | self.console.append("Please Write a Folder") |
|
5652 | self.console.append("Please Write a Folder") | |
5408 | return 0 |
|
5653 | return 0 | |
5409 |
|
5654 | |||
5410 | username_ftp = str(self.usernameFTP.text()) |
|
5655 | username_ftp = str(self.usernameFTP.text()) | |
5411 | try: |
|
5656 | if not username_ftp: | |
5412 | username = str(self.usernameFTP.text()) |
|
|||
5413 | except: |
|
|||
5414 | self.console.clear() |
|
5657 | self.console.clear() | |
5415 | self.console.append("Please Write a User Name") |
|
5658 | self.console.append("Please Write a User Name") | |
5416 | return 0 |
|
5659 | return 0 | |
5417 |
|
5660 | |||
5418 | password_ftp = str(self.passwordFTP.text()) |
|
5661 | password_ftp = str(self.passwordFTP.text()) | |
5419 | try: |
|
5662 | if not password_ftp: | |
5420 | password = str(self.passwordFTP.text()) |
|
|||
5421 | except: |
|
|||
5422 | self.console.clear() |
|
5663 | self.console.clear() | |
5423 | self.console.append("Please Write a passwordFTP") |
|
5664 | self.console.append("Please Write a passwordFTP") | |
5424 | return 0 |
|
5665 | return 0 | |
5425 |
|
5666 | |||
5426 | ftp_wei = self.weightFTP.text() |
|
5667 | ftp_wei = self.weightFTP.text() | |
5427 | if not ftp_wei == "": |
|
5668 | if not ftp_wei == "": | |
5428 | try: |
|
5669 | try: | |
5429 | ftp_wei = int(self.weightFTP.text()) |
|
5670 | ftp_wei = int(self.weightFTP.text()) | |
5430 | except: |
|
5671 | except: | |
5431 | self.console.clear() |
|
5672 | self.console.clear() | |
5432 | self.console.append("Please Write a ftp_wei number") |
|
5673 | self.console.append("Please Write a ftp_wei number") | |
5433 | return 0 |
|
5674 | return 0 | |
5434 |
|
5675 | |||
5435 | exp_code = self.expcodeFTP.text() |
|
5676 | exp_code = self.expcodeFTP.text() | |
5436 | if not exp_code == "": |
|
5677 | if not exp_code == "": | |
5437 | try: |
|
5678 | try: | |
5438 | exp_code = int(self.expcodeFTP.text()) |
|
5679 | exp_code = int(self.expcodeFTP.text()) | |
5439 | except: |
|
5680 | except: | |
5440 | self.console.clear() |
|
5681 | self.console.clear() | |
5441 | self.console.append("Please Write a exp_code number") |
|
5682 | self.console.append("Please Write a exp_code number") | |
5442 | return 0 |
|
5683 | return 0 | |
5443 |
|
5684 | |||
5444 |
|
5685 | |||
5445 | sub_exp_code = self.subexpFTP.text() |
|
5686 | sub_exp_code = self.subexpFTP.text() | |
5446 | if not sub_exp_code == "": |
|
5687 | if not sub_exp_code == "": | |
5447 | try: |
|
5688 | try: | |
5448 | sub_exp_code = int(self.subexpFTP.text()) |
|
5689 | sub_exp_code = int(self.subexpFTP.text()) | |
5449 | except: |
|
5690 | except: | |
5450 | self.console.clear() |
|
5691 | self.console.clear() | |
5451 | self.console.append("Please Write a sub_exp_code number") |
|
5692 | self.console.append("Please Write a sub_exp_code number") | |
5452 | return 0 |
|
5693 | return 0 | |
5453 |
|
5694 | |||
5454 | plot_pos = self.plotposFTP.text() |
|
5695 | plot_pos = self.plotposFTP.text() | |
5455 | if not plot_pos == "": |
|
5696 | if not plot_pos == "": | |
5456 | try: |
|
5697 | try: | |
5457 | plot_pos = int(self.plotposFTP.text()) |
|
5698 | plot_pos = int(self.plotposFTP.text()) | |
5458 | except: |
|
5699 | except: | |
5459 | self.console.clear() |
|
5700 | self.console.clear() | |
5460 | self.console.append("Please Write a plot_pos number") |
|
5701 | self.console.append("Please Write a plot_pos number") | |
5461 | return 0 |
|
5702 | return 0 | |
5462 |
|
5703 | |||
5463 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5704 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5464 |
|
5705 | |||
5465 | @pyqtSignature("") |
|
5706 | @pyqtSignature("") | |
5466 | def on_ftpOkButton_clicked(self): |
|
5707 | def on_ftpOkButton_clicked(self): | |
5467 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5708 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5468 | self.create = True |
|
5709 | self.create = True | |
5469 | self.close() |
|
5710 | self.close() | |
5470 |
|
5711 | |||
5471 | @pyqtSignature("") |
|
5712 | @pyqtSignature("") | |
5472 | def on_ftpCancelButton_clicked(self): |
|
5713 | def on_ftpCancelButton_clicked(self): | |
5473 | self.create = False |
|
5714 | self.create = False | |
5474 | self.close() |
|
5715 | self.close() | |
5475 |
|
5716 | |||
5476 | def closeEvent(self, event): |
|
5717 | def closeEvent(self, event): | |
5477 | self.closed.emit() |
|
5718 | self.closed.emit() | |
5478 | event.accept() |
|
5719 | event.accept() | |
5479 |
|
5720 | |||
5480 | class ftpBuffer(): |
|
5721 | class ftpBuffer(): | |
|
5722 | ||||
5481 | server = None |
|
5723 | server = None | |
5482 | folder = None |
|
5724 | remotefolder = None | |
5483 | username = None |
|
5725 | username = None | |
5484 | password = None |
|
5726 | password = None | |
5485 | ftp_wei = None |
|
5727 | ftp_wei = None | |
5486 | exp_code = None |
|
5728 | exp_code = None | |
5487 | sub_exp_code = None |
|
5729 | sub_exp_code = None | |
5488 | plot_pos = None |
|
5730 | plot_pos = None | |
5489 | create = False |
|
5731 | create = False | |
5490 | withoutconfig = False |
|
5732 | withoutconfig = False | |
5491 | createforView = False |
|
5733 | createforView = False | |
5492 | localfolder = None |
|
5734 | localfolder = None | |
5493 | extension = None |
|
5735 | extension = None | |
5494 | period = None |
|
5736 | period = None | |
5495 | protocol = None |
|
5737 | protocol = None | |
5496 |
|
5738 | |||
5497 | def __init__(self): |
|
5739 | def __init__(self): | |
5498 |
|
5740 | |||
5499 | self.create = False |
|
5741 | self.create = False | |
5500 | self.server = None |
|
5742 | self.server = None | |
5501 | self.folder = None |
|
5743 | self.remotefolder = None | |
5502 | self.username = None |
|
5744 | self.username = None | |
5503 | self.password = None |
|
5745 | self.password = None | |
5504 | self.ftp_wei = None |
|
5746 | self.ftp_wei = None | |
5505 | self.exp_code = None |
|
5747 | self.exp_code = None | |
5506 | self.sub_exp_code = None |
|
5748 | self.sub_exp_code = None | |
5507 | self.plot_pos = None |
|
5749 | self.plot_pos = None | |
5508 | # self.create = False |
|
5750 | # self.create = False | |
5509 | self.localfolder = None |
|
5751 | self.localfolder = None | |
5510 | self.extension = None |
|
5752 | self.extension = None | |
5511 | self.period = None |
|
5753 | self.period = None | |
5512 | self.protocol = None |
|
5754 | self.protocol = None | |
5513 |
|
5755 | |||
5514 | def setwithoutconfiguration(self): |
|
5756 | def setwithoutconfiguration(self): | |
5515 |
|
5757 | |||
5516 | self.create = False |
|
5758 | self.create = False | |
5517 | self.server = "jro-app.igp.gob.pe" |
|
5759 | self.server = "jro-app.igp.gob.pe" | |
5518 | self.folder = "/home/wmaster/graficos" |
|
5760 | self.remotefolder = "/home/wmaster/graficos" | |
5519 | self.username = "wmaster" |
|
5761 | self.username = "wmaster" | |
5520 | self.password = "mst2010vhf" |
|
5762 | self.password = "mst2010vhf" | |
5521 | self.ftp_wei = "0" |
|
|||
5522 | self.exp_code = "0" |
|
|||
5523 | self.sub_exp_code = "0" |
|
|||
5524 | self.plot_pos = "0" |
|
|||
5525 | self.withoutconfig = True |
|
5763 | self.withoutconfig = True | |
5526 | self.localfolder = './' |
|
5764 | self.localfolder = './' | |
5527 | self.extension = '.png' |
|
5765 | self.extension = '.png' | |
5528 | self.period = '60' |
|
5766 | self.period = '60' | |
5529 | self.protocol = 'ftp' |
|
5767 | self.protocol = 'ftp' | |
5530 | self.createforView = True |
|
5768 | self.createforView = True | |
5531 |
|
5769 | |||
5532 | def save(self, server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos, localfolder='./', extension='.png', period='60', protocol='ftp'): |
|
5770 | if not self.ftp_wei: | |
|
5771 | self.ftp_wei = "0" | |||
|
5772 | ||||
|
5773 | if not self.exp_code: | |||
|
5774 | self.exp_code = "0" | |||
|
5775 | ||||
|
5776 | if not self.sub_exp_code: | |||
|
5777 | self.sub_exp_code = "0" | |||
|
5778 | ||||
|
5779 | if not self.plot_pos: | |||
|
5780 | self.plot_pos = "0" | |||
|
5781 | ||||
|
5782 | def save(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos, localfolder='./', extension='.png', period='60', protocol='ftp'): | |||
5533 |
|
5783 | |||
5534 | self.server = server |
|
5784 | self.server = server | |
5535 | self.folder = folder |
|
5785 | self.remotefolder = remotefolder | |
5536 | self.username = username |
|
5786 | self.username = username | |
5537 | self.password = password |
|
5787 | self.password = password | |
5538 | self.ftp_wei = ftp_wei |
|
5788 | self.ftp_wei = ftp_wei | |
5539 | self.exp_code = exp_code |
|
5789 | self.exp_code = exp_code | |
5540 | self.sub_exp_code = sub_exp_code |
|
5790 | self.sub_exp_code = sub_exp_code | |
5541 | self.plot_pos = plot_pos |
|
5791 | self.plot_pos = plot_pos | |
5542 | self.create = True |
|
5792 | self.create = True | |
5543 | self.withoutconfig = False |
|
5793 | self.withoutconfig = False | |
5544 | self.createforView = True |
|
5794 | self.createforView = True | |
5545 | self.localfolder = localfolder |
|
5795 | self.localfolder = localfolder | |
5546 |
|
5796 | self.extension = extension | ||
|
5797 | self.period = period | |||
|
5798 | self.protocol = protocol | |||
5547 |
|
5799 | |||
5548 | def recover(self): |
|
5800 | def recover(self): | |
5549 |
|
5801 | |||
5550 | return self.server, self.folder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos |
|
5802 | return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol | |
5551 |
|
5803 | |||
5552 | class ShowMeConsole(QtCore.QObject): |
|
5804 | class ShowMeConsole(QtCore.QObject): | |
5553 | textWritten = QtCore.pyqtSignal(str) |
|
5805 | textWritten = QtCore.pyqtSignal(str) | |
5554 | def write (self, text): |
|
5806 | def write (self, text): | |
5555 | self.textWritten.emit(str(text)) |
|
5807 | self.textWritten.emit(str(text)) | |
5556 |
|
5808 | |||
5557 | class PlotManager(): |
|
5809 | class PlotManager(): | |
5558 | def __init__(self, queue): |
|
5810 | def __init__(self, queue): | |
5559 | self.queue = queue |
|
5811 | self.queue = queue | |
5560 | self.objPlotDict = {} |
|
5812 | self.objPlotDict = {} | |
5561 |
|
5813 | |||
5562 | def processIncoming(self): |
|
5814 | def processIncoming(self): | |
5563 | while self.queue.qsize(): |
|
5815 | while self.queue.qsize(): | |
5564 | try: |
|
5816 | try: | |
5565 | dataFromQueue = self.queue.get(True) |
|
5817 | dataFromQueue = self.queue.get(True) | |
5566 | if dataFromQueue == None: |
|
5818 | if dataFromQueue == None: | |
5567 | continue |
|
5819 | continue | |
5568 |
|
5820 | |||
5569 | dataPlot = dataFromQueue['data'] |
|
5821 | dataPlot = dataFromQueue['data'] | |
5570 | kwargs = dataFromQueue['kwargs'] |
|
5822 | kwargs = dataFromQueue['kwargs'] | |
5571 | id = kwargs['id'] |
|
5823 | id = kwargs['id'] | |
5572 | if 'channelList' in kwargs.keys(): |
|
5824 | if 'channelList' in kwargs.keys(): | |
5573 | channelList = kwargs['channelList'] |
|
5825 | channelList = kwargs['channelList'] | |
5574 | else: |
|
5826 | else: | |
5575 | channelList = None |
|
5827 | channelList = None | |
5576 | plotname = kwargs.pop('type') |
|
5828 | plotname = kwargs.pop('type') | |
5577 |
|
5829 | |||
5578 | if not(id in self.objPlotDict.keys()): |
|
5830 | if not(id in self.objPlotDict.keys()): | |
5579 | className = eval(plotname) |
|
5831 | className = eval(plotname) | |
5580 | self.objPlotDict[id] = className(id, channelList, dataPlot) |
|
5832 | self.objPlotDict[id] = className(id, channelList, dataPlot) | |
5581 | self.objPlotDict[id].show() |
|
5833 | self.objPlotDict[id].show() | |
5582 |
|
5834 | |||
5583 | self.objPlotDict[id].run(dataPlot , **kwargs) |
|
5835 | self.objPlotDict[id].run(dataPlot , **kwargs) | |
5584 |
|
5836 | |||
5585 | except Queue.Empty: |
|
5837 | except Queue.Empty: | |
5586 | pass |
|
5838 | pass | |
5587 |
|
5839 | |||
5588 |
|
5840 |
@@ -1,93 +1,94 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/roj-idl71/SignalChain/initwindowv2.ui' |
|
3 | # Form implementation generated from reading ui file '/home/roj-idl71/SignalChain/initwindowv2.ui' | |
4 | # |
|
4 | # | |
5 | # Created: Wed Mar 6 15:32:39 2013 |
|
5 | # Created: Wed Mar 6 15:32:39 2013 | |
6 | # by: PyQt4 UI code generator 4.8.6 |
|
6 | # by: PyQt4 UI code generator 4.8.6 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
9 |
|
9 | |||
10 | from PyQt4 import QtCore, QtGui |
|
10 | from PyQt4 import QtCore, QtGui | |
11 |
|
11 | |||
12 | try: |
|
12 | try: | |
13 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
13 | _fromUtf8 = QtCore.QString.fromUtf8 | |
14 | except AttributeError: |
|
14 | except AttributeError: | |
15 | _fromUtf8 = lambda s: s |
|
15 | _fromUtf8 = lambda s: s | |
16 |
|
16 | |||
17 | import os |
|
17 | import os | |
18 | from schainpy.gui.figures import tools |
|
18 | from schainpy.gui.figures import tools | |
19 |
|
19 | |||
|
20 | INITIAL_MSG = "Signal Chain GUI - v2.1" | |||
20 | FIGURES_PATH = tools.get_path() |
|
21 | FIGURES_PATH = tools.get_path() | |
21 |
|
22 | |||
22 | class Ui_InitWindow(object): |
|
23 | class Ui_InitWindow(object): | |
23 | def setupUi(self, Dialog): |
|
24 | def setupUi(self, Dialog): | |
24 | Dialog.setObjectName(_fromUtf8("Dialog")) |
|
25 | Dialog.setObjectName(_fromUtf8("Dialog")) | |
25 | Dialog.resize(652, 496) |
|
26 | Dialog.resize(652, 496) | |
26 | Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) |
|
27 | Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8)) | |
27 | self.gridLayout = QtGui.QGridLayout(Dialog) |
|
28 | self.gridLayout = QtGui.QGridLayout(Dialog) | |
28 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) |
|
29 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) | |
29 | self.verticalLayout_3 = QtGui.QVBoxLayout() |
|
30 | self.verticalLayout_3 = QtGui.QVBoxLayout() | |
30 | self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) |
|
31 | self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3")) | |
31 | self.verticalLayout_4 = QtGui.QVBoxLayout() |
|
32 | self.verticalLayout_4 = QtGui.QVBoxLayout() | |
32 | self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) |
|
33 | self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4")) | |
33 | self.label_3 = QtGui.QLabel(Dialog) |
|
34 | self.label_3 = QtGui.QLabel(Dialog) | |
34 | font = QtGui.QFont() |
|
35 | font = QtGui.QFont() | |
35 | font.setFamily(_fromUtf8("Cambria")) |
|
36 | font.setFamily(_fromUtf8("Cambria")) | |
36 | font.setPointSize(22) |
|
37 | font.setPointSize(22) | |
37 | font.setBold(False) |
|
38 | font.setBold(False) | |
38 | font.setWeight(50) |
|
39 | font.setWeight(50) | |
39 | self.label_3.setFont(font) |
|
40 | self.label_3.setFont(font) | |
40 |
self.label_3.setText(QtGui.QApplication.translate("Dialog", |
|
41 | self.label_3.setText(QtGui.QApplication.translate("Dialog", INITIAL_MSG, None, QtGui.QApplication.UnicodeUTF8)) | |
41 | self.label_3.setObjectName(_fromUtf8("label_3")) |
|
42 | self.label_3.setObjectName(_fromUtf8("label_3")) | |
42 | self.verticalLayout_4.addWidget(self.label_3) |
|
43 | self.verticalLayout_4.addWidget(self.label_3) | |
43 | self.line_2 = QtGui.QFrame(Dialog) |
|
44 | self.line_2 = QtGui.QFrame(Dialog) | |
44 | self.line_2.setFrameShape(QtGui.QFrame.HLine) |
|
45 | self.line_2.setFrameShape(QtGui.QFrame.HLine) | |
45 | self.line_2.setFrameShadow(QtGui.QFrame.Sunken) |
|
46 | self.line_2.setFrameShadow(QtGui.QFrame.Sunken) | |
46 | self.line_2.setObjectName(_fromUtf8("line_2")) |
|
47 | self.line_2.setObjectName(_fromUtf8("line_2")) | |
47 | self.verticalLayout_4.addWidget(self.line_2) |
|
48 | self.verticalLayout_4.addWidget(self.line_2) | |
48 | self.label_4 = QtGui.QLabel(Dialog) |
|
49 | self.label_4 = QtGui.QLabel(Dialog) | |
49 | self.label_4.setText(_fromUtf8("")) |
|
50 | self.label_4.setText(_fromUtf8("")) | |
50 | self.label_4.setPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"w.jpg") ))) |
|
51 | self.label_4.setPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"w.jpg") ))) | |
51 | self.label_4.setScaledContents(True) |
|
52 | self.label_4.setScaledContents(True) | |
52 | self.label_4.setObjectName(_fromUtf8("label_4")) |
|
53 | self.label_4.setObjectName(_fromUtf8("label_4")) | |
53 | self.verticalLayout_4.addWidget(self.label_4) |
|
54 | self.verticalLayout_4.addWidget(self.label_4) | |
54 | self.verticalLayout_3.addLayout(self.verticalLayout_4) |
|
55 | self.verticalLayout_3.addLayout(self.verticalLayout_4) | |
55 | self.horizontalLayout_3 = QtGui.QHBoxLayout() |
|
56 | self.horizontalLayout_3 = QtGui.QHBoxLayout() | |
56 | self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) |
|
57 | self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3")) | |
57 | self.horizontalLayout_4 = QtGui.QHBoxLayout() |
|
58 | self.horizontalLayout_4 = QtGui.QHBoxLayout() | |
58 | self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) |
|
59 | self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4")) | |
59 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
60 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
60 | self.horizontalLayout_4.addItem(spacerItem) |
|
61 | self.horizontalLayout_4.addItem(spacerItem) | |
61 | self.ExitBtn = QtGui.QPushButton(Dialog) |
|
62 | self.ExitBtn = QtGui.QPushButton(Dialog) | |
62 | self.ExitBtn.setText(QtGui.QApplication.translate("Dialog", "Exit", None, QtGui.QApplication.UnicodeUTF8)) |
|
63 | self.ExitBtn.setText(QtGui.QApplication.translate("Dialog", "Exit", None, QtGui.QApplication.UnicodeUTF8)) | |
63 | self.ExitBtn.setObjectName(_fromUtf8("ExitBtn")) |
|
64 | self.ExitBtn.setObjectName(_fromUtf8("ExitBtn")) | |
64 | self.horizontalLayout_4.addWidget(self.ExitBtn) |
|
65 | self.horizontalLayout_4.addWidget(self.ExitBtn) | |
65 | self.ContinueBtn = QtGui.QPushButton(Dialog) |
|
66 | self.ContinueBtn = QtGui.QPushButton(Dialog) | |
66 | self.ContinueBtn.setText(QtGui.QApplication.translate("Dialog", "Continue", None, QtGui.QApplication.UnicodeUTF8)) |
|
67 | self.ContinueBtn.setText(QtGui.QApplication.translate("Dialog", "Continue", None, QtGui.QApplication.UnicodeUTF8)) | |
67 | self.ContinueBtn.setObjectName(_fromUtf8("ContinueBtn")) |
|
68 | self.ContinueBtn.setObjectName(_fromUtf8("ContinueBtn")) | |
68 | self.horizontalLayout_4.addWidget(self.ContinueBtn) |
|
69 | self.horizontalLayout_4.addWidget(self.ContinueBtn) | |
69 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
70 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
70 | self.horizontalLayout_4.addItem(spacerItem1) |
|
71 | self.horizontalLayout_4.addItem(spacerItem1) | |
71 | self.horizontalLayout_3.addLayout(self.horizontalLayout_4) |
|
72 | self.horizontalLayout_3.addLayout(self.horizontalLayout_4) | |
72 | self.verticalLayout_3.addLayout(self.horizontalLayout_3) |
|
73 | self.verticalLayout_3.addLayout(self.horizontalLayout_3) | |
73 | self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1) |
|
74 | self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1) | |
74 |
|
75 | |||
75 | self.retranslateUi(Dialog) |
|
76 | self.retranslateUi(Dialog) | |
76 | QtCore.QMetaObject.connectSlotsByName(Dialog) |
|
77 | QtCore.QMetaObject.connectSlotsByName(Dialog) | |
77 |
|
78 | |||
78 | def retranslateUi(self, Dialog): |
|
79 | def retranslateUi(self, Dialog): | |
79 | pass |
|
80 | pass | |
80 |
|
81 | |||
81 |
|
82 | |||
82 | if __name__ == "__main__": |
|
83 | if __name__ == "__main__": | |
83 | import sys |
|
84 | import sys | |
84 | app = QtGui.QApplication(sys.argv) |
|
85 | app = QtGui.QApplication(sys.argv) | |
85 | Dialog = QtGui.QDialog() |
|
86 | Dialog = QtGui.QDialog() | |
86 | ui = Ui_InitWindow() |
|
87 | ui = Ui_InitWindow() | |
87 | ui.setupUi(Dialog) |
|
88 | ui.setupUi(Dialog) | |
88 | Dialog.show() |
|
89 | Dialog.show() | |
89 | sys.exit(app.exec_()) |
|
90 | sys.exit(app.exec_()) | |
90 |
|
91 | |||
91 |
|
92 | |||
92 |
|
93 | |||
93 |
|
94 |
@@ -1,451 +1,451 | |||||
1 | from PyQt4 import QtCore, QtGui |
|
1 | from PyQt4 import QtCore, QtGui | |
2 |
|
2 | |||
3 | try: |
|
3 | try: | |
4 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
4 | _fromUtf8 = QtCore.QString.fromUtf8 | |
5 | except AttributeError: |
|
5 | except AttributeError: | |
6 | def _fromUtf8(s): |
|
6 | def _fromUtf8(s): | |
7 | return s |
|
7 | return s | |
8 |
|
8 | |||
9 | try: |
|
9 | try: | |
10 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
10 | _encoding = QtGui.QApplication.UnicodeUTF8 | |
11 | def _translate(context, text, disambig): |
|
11 | def _translate(context, text, disambig): | |
12 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
12 | return QtGui.QApplication.translate(context, text, disambig, _encoding) | |
13 | except AttributeError: |
|
13 | except AttributeError: | |
14 | def _translate(context, text, disambig): |
|
14 | def _translate(context, text, disambig): | |
15 | return QtGui.QApplication.translate(context, text, disambig) |
|
15 | return QtGui.QApplication.translate(context, text, disambig) | |
16 |
|
16 | |||
17 | class Ui_SpectraTab(object): |
|
17 | class Ui_SpectraTab(object): | |
18 |
|
18 | |||
19 | def setupUi(self): |
|
19 | def setupUi(self): | |
20 |
|
20 | |||
21 | self.tabSpectra = QtGui.QWidget() |
|
21 | self.tabSpectra = QtGui.QWidget() | |
22 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) |
|
22 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) | |
23 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) |
|
23 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) | |
24 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) |
|
24 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) | |
25 | self.frame_5 = QtGui.QFrame(self.tabSpectra) |
|
25 | self.frame_5 = QtGui.QFrame(self.tabSpectra) | |
26 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) |
|
26 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) | |
27 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) |
|
27 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) | |
28 | self.frame_5.setObjectName(_fromUtf8("frame_5")) |
|
28 | self.frame_5.setObjectName(_fromUtf8("frame_5")) | |
29 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) |
|
29 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) | |
30 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) |
|
30 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) | |
31 | self.specOpOk = QtGui.QPushButton(self.frame_5) |
|
31 | self.specOpOk = QtGui.QPushButton(self.frame_5) | |
32 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) |
|
32 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) | |
33 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) |
|
33 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) | |
34 | self.specGraphClear = QtGui.QPushButton(self.frame_5) |
|
34 | self.specGraphClear = QtGui.QPushButton(self.frame_5) | |
35 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) |
|
35 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) | |
36 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) |
|
36 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) | |
37 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) |
|
37 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) | |
38 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) |
|
38 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) | |
39 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) |
|
39 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) | |
40 | self.tabopSpectra = QtGui.QWidget() |
|
40 | self.tabopSpectra = QtGui.QWidget() | |
41 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) |
|
41 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) | |
42 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) |
|
42 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) | |
43 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) |
|
43 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) | |
44 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) |
|
44 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) | |
45 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) |
|
45 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) | |
46 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2) |
|
46 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2) | |
47 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) |
|
47 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) | |
48 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) |
|
48 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) | |
49 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
49 | self.specOpComChannel.addItem(_fromUtf8("")) | |
50 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
50 | self.specOpComChannel.addItem(_fromUtf8("")) | |
51 | self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2) |
|
51 | self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2) | |
52 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) |
|
52 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) | |
53 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) |
|
53 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) | |
54 | self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2) |
|
54 | self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2) | |
55 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) |
|
55 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) | |
56 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) |
|
56 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) | |
57 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
57 | self.specOpComHeights.addItem(_fromUtf8("")) | |
58 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
58 | self.specOpComHeights.addItem(_fromUtf8("")) | |
59 | self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2) |
|
59 | self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2) | |
60 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) |
|
60 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) | |
61 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) |
|
61 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) | |
62 | self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2) |
|
62 | self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2) | |
63 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) |
|
63 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) | |
64 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) |
|
64 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) | |
65 | self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2) |
|
65 | self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2) | |
66 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) |
|
66 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) | |
67 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) |
|
67 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) | |
68 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2) |
|
68 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2) | |
69 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) |
|
69 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) | |
70 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) |
|
70 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) | |
71 | self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1) |
|
71 | self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1) | |
72 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) |
|
72 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) | |
73 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) |
|
73 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) | |
74 | self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1) |
|
74 | self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1) | |
75 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) |
|
75 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) | |
76 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) |
|
76 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) | |
77 | self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2) |
|
77 | self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2) | |
78 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) |
|
78 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) | |
79 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) |
|
79 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) | |
80 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2) |
|
80 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2) | |
81 | self.label_31 = QtGui.QLabel(self.tabopSpectra) |
|
81 | self.label_31 = QtGui.QLabel(self.tabopSpectra) | |
82 | self.label_31.setObjectName(_fromUtf8("label_31")) |
|
82 | self.label_31.setObjectName(_fromUtf8("label_31")) | |
83 | self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2) |
|
83 | self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2) | |
84 | self.label_26 = QtGui.QLabel(self.tabopSpectra) |
|
84 | self.label_26 = QtGui.QLabel(self.tabopSpectra) | |
85 | self.label_26.setObjectName(_fromUtf8("label_26")) |
|
85 | self.label_26.setObjectName(_fromUtf8("label_26")) | |
86 | self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2) |
|
86 | self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2) | |
87 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) |
|
87 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) | |
88 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) |
|
88 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) | |
89 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1) |
|
89 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1) | |
90 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) |
|
90 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) | |
91 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) |
|
91 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) | |
92 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
92 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
93 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
93 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
94 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2) |
|
94 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2) | |
95 | spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
95 | spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
96 | self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) |
|
96 | self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) | |
97 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) |
|
97 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) | |
98 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) |
|
98 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) | |
99 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2) |
|
99 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2) | |
100 | spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
100 | spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
101 | self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) |
|
101 | self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) | |
102 | spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
102 | spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
103 | self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) |
|
103 | self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) | |
104 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) |
|
104 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) | |
105 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) |
|
105 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) | |
106 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) |
|
106 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) | |
107 | spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
107 | spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
108 | self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) |
|
108 | self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) | |
109 | self.label_21 = QtGui.QLabel(self.tabopSpectra) |
|
109 | self.label_21 = QtGui.QLabel(self.tabopSpectra) | |
110 | self.label_21.setObjectName(_fromUtf8("label_21")) |
|
110 | self.label_21.setObjectName(_fromUtf8("label_21")) | |
111 | self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) |
|
111 | self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) | |
112 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) |
|
112 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) | |
113 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) |
|
113 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) | |
114 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2) |
|
114 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2) | |
115 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) |
|
115 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) | |
116 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) |
|
116 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) | |
117 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) |
|
117 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) | |
118 | spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
118 | spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
119 | self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) |
|
119 | self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) | |
120 | self.label_70 = QtGui.QLabel(self.tabopSpectra) |
|
120 | self.label_70 = QtGui.QLabel(self.tabopSpectra) | |
121 | self.label_70.setObjectName(_fromUtf8("label_70")) |
|
121 | self.label_70.setObjectName(_fromUtf8("label_70")) | |
122 | self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) |
|
122 | self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) | |
123 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) |
|
123 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) | |
124 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) |
|
124 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) | |
125 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1) |
|
125 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1) | |
126 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) |
|
126 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) | |
127 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) |
|
127 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) | |
128 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2) |
|
128 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2) | |
129 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) |
|
129 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) | |
130 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) |
|
130 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) | |
131 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
131 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
132 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
132 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
133 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2) |
|
133 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2) | |
134 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) |
|
134 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) | |
135 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) |
|
135 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) | |
136 | self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) |
|
136 | self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) | |
137 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) |
|
137 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) | |
138 |
|
138 | |||
139 |
|
139 | |||
140 | self.tabgraphSpectra = QtGui.QWidget() |
|
140 | self.tabgraphSpectra = QtGui.QWidget() | |
141 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) |
|
141 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) | |
142 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) |
|
142 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) | |
143 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) |
|
143 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) | |
144 |
|
144 | |||
145 | spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
145 | spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
146 | self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) |
|
146 | self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) | |
147 |
|
147 | |||
148 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) |
|
148 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) | |
149 | self.label_24.setObjectName(_fromUtf8("label_24")) |
|
149 | self.label_24.setObjectName(_fromUtf8("label_24")) | |
150 | self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) |
|
150 | self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) | |
151 |
|
151 | |||
152 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) |
|
152 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) | |
153 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) |
|
153 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) | |
154 | self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) |
|
154 | self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) | |
155 |
|
155 | |||
156 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) |
|
156 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) | |
157 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) |
|
157 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) | |
158 | self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) |
|
158 | self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) | |
159 |
|
159 | |||
160 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) |
|
160 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) | |
161 | self.label_25.setObjectName(_fromUtf8("label_25")) |
|
161 | self.label_25.setObjectName(_fromUtf8("label_25")) | |
162 | self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) |
|
162 | self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) | |
163 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) |
|
163 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) | |
164 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) |
|
164 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) | |
165 | self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) |
|
165 | self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) | |
166 |
|
166 | |||
167 |
|
167 | |||
168 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) |
|
168 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) | |
169 | self.label_40.setObjectName(_fromUtf8("label_40")) |
|
169 | self.label_40.setObjectName(_fromUtf8("label_40")) | |
170 | self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) |
|
170 | self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) | |
171 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) |
|
171 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) | |
172 | self.label_41.setObjectName(_fromUtf8("label_41")) |
|
172 | self.label_41.setObjectName(_fromUtf8("label_41")) | |
173 | self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) |
|
173 | self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) | |
174 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) |
|
174 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) | |
175 | self.label_42.setObjectName(_fromUtf8("label_42")) |
|
175 | self.label_42.setObjectName(_fromUtf8("label_42")) | |
176 | self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) |
|
176 | self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) | |
177 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) |
|
177 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) | |
178 | self.label_44.setObjectName(_fromUtf8("label_44")) |
|
178 | self.label_44.setObjectName(_fromUtf8("label_44")) | |
179 | self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) |
|
179 | self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) | |
180 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) |
|
180 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) | |
181 | self.label_46.setObjectName(_fromUtf8("label_46")) |
|
181 | self.label_46.setObjectName(_fromUtf8("label_46")) | |
182 | self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) |
|
182 | self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) | |
183 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) |
|
183 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) | |
184 | self.label_45.setObjectName(_fromUtf8("label_45")) |
|
184 | self.label_45.setObjectName(_fromUtf8("label_45")) | |
185 | self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) |
|
185 | self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) | |
186 |
|
186 | |||
187 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) |
|
187 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) | |
188 | self.label_43.setObjectName(_fromUtf8("label_43")) |
|
188 | self.label_43.setObjectName(_fromUtf8("label_43")) | |
189 | self.gridLayout_9.addWidget(self.label_43, 3, 3, 2, 1) |
|
189 | self.gridLayout_9.addWidget(self.label_43, 3, 3, 2, 1) | |
190 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
190 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
191 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) |
|
191 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) | |
192 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) |
|
192 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) | |
193 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 3, 1, 1) |
|
193 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 3, 1, 1) | |
194 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
194 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
195 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) |
|
195 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) | |
196 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) |
|
196 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) | |
197 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 3, 1, 1) |
|
197 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 3, 1, 1) | |
198 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
198 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
199 | self.specGraphCebRTIplot.setText(_fromUtf8("")) |
|
199 | self.specGraphCebRTIplot.setText(_fromUtf8("")) | |
200 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) |
|
200 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) | |
201 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 3, 1, 1) |
|
201 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 3, 1, 1) | |
202 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
202 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) | |
203 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) |
|
203 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) | |
204 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) |
|
204 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) | |
205 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 3, 1, 1) |
|
205 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 3, 1, 1) | |
206 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
206 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
207 | self.specGraphPowerprofile.setText(_fromUtf8("")) |
|
207 | self.specGraphPowerprofile.setText(_fromUtf8("")) | |
208 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) |
|
208 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) | |
209 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 3, 1, 1) |
|
209 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 3, 1, 1) | |
210 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
210 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
211 | self.specGraphCebRTInoise.setText(_fromUtf8("")) |
|
211 | self.specGraphCebRTInoise.setText(_fromUtf8("")) | |
212 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) |
|
212 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) | |
213 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 3, 1, 1) |
|
213 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 3, 1, 1) | |
214 |
|
214 | |||
215 | # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
215 | # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
216 | # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) |
|
216 | # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) | |
217 |
|
217 | |||
218 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) |
|
218 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) | |
219 | self.label_47.setObjectName(_fromUtf8("label_47")) |
|
219 | self.label_47.setObjectName(_fromUtf8("label_47")) | |
220 | self.gridLayout_9.addWidget(self.label_47, 3, 5, 2, 1) |
|
220 | self.gridLayout_9.addWidget(self.label_47, 3, 5, 2, 1) | |
221 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
221 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
222 | self.specGraphSaveSpectra.setText(_fromUtf8("")) |
|
222 | self.specGraphSaveSpectra.setText(_fromUtf8("")) | |
223 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) |
|
223 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) | |
224 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 5, 1, 1) |
|
224 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 5, 1, 1) | |
225 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
225 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
226 | self.specGraphSaveCross.setText(_fromUtf8("")) |
|
226 | self.specGraphSaveCross.setText(_fromUtf8("")) | |
227 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) |
|
227 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) | |
228 | self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 5, 1, 1) |
|
228 | self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 5, 1, 1) | |
229 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
229 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
230 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) |
|
230 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) | |
231 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) |
|
231 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) | |
232 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 5, 1, 1) |
|
232 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 5, 1, 1) | |
233 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
233 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
234 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) |
|
234 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) | |
235 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) |
|
235 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) | |
236 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 5, 1, 1) |
|
236 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 5, 1, 1) | |
237 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
237 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
238 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) |
|
238 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) | |
239 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) |
|
239 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) | |
240 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 5, 1, 1) |
|
240 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 5, 1, 1) | |
241 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
241 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
242 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) |
|
242 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) | |
243 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) |
|
243 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) | |
244 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 5, 1, 1) |
|
244 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 5, 1, 1) | |
245 |
|
245 | |||
246 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) |
|
246 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) | |
247 | self.label_19.setObjectName(_fromUtf8("label_19")) |
|
247 | self.label_19.setObjectName(_fromUtf8("label_19")) | |
248 | self.gridLayout_9.addWidget(self.label_19, 3, 7, 2, 1) |
|
248 | self.gridLayout_9.addWidget(self.label_19, 3, 7, 2, 1) | |
249 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
249 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
250 | self.specGraphftpSpectra.setText(_fromUtf8("")) |
|
250 | self.specGraphftpSpectra.setText(_fromUtf8("")) | |
251 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) |
|
251 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) | |
252 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 7, 1, 1) |
|
252 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 7, 1, 1) | |
253 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
253 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
254 | self.specGraphftpCross.setText(_fromUtf8("")) |
|
254 | self.specGraphftpCross.setText(_fromUtf8("")) | |
255 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) |
|
255 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) | |
256 | self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 7, 1, 1) |
|
256 | self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 7, 1, 1) | |
257 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
257 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
258 | self.specGraphftpRTIplot.setText(_fromUtf8("")) |
|
258 | self.specGraphftpRTIplot.setText(_fromUtf8("")) | |
259 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) |
|
259 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) | |
260 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 7, 1, 1) |
|
260 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 7, 1, 1) | |
261 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
261 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
262 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) |
|
262 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) | |
263 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) |
|
263 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) | |
264 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 7, 1, 1) |
|
264 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 7, 1, 1) | |
265 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
265 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
266 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) |
|
266 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) | |
267 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) |
|
267 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) | |
268 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 7, 1, 1) |
|
268 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 7, 1, 1) | |
269 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
269 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
270 | self.specGraphftpRTInoise.setText(_fromUtf8("")) |
|
270 | self.specGraphftpRTInoise.setText(_fromUtf8("")) | |
271 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) |
|
271 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) | |
272 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 7, 1, 1) |
|
272 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 7, 1, 1) | |
273 |
|
273 | |||
274 | spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
274 | spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
275 | self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) |
|
275 | self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) | |
276 |
|
276 | |||
277 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) |
|
277 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) | |
278 | self.label_22.setObjectName(_fromUtf8("label_22")) |
|
278 | self.label_22.setObjectName(_fromUtf8("label_22")) | |
279 | self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) |
|
279 | self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) | |
280 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) |
|
280 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) | |
281 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) |
|
281 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) | |
282 | self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 2, 1, 2) |
|
282 | self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 2, 1, 2) | |
283 |
|
283 | |||
284 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) |
|
284 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) | |
285 | self.label_16.setObjectName(_fromUtf8("label_16")) |
|
285 | self.label_16.setObjectName(_fromUtf8("label_16")) | |
286 | self.gridLayout_9.addWidget(self.label_16, 17, 0, 1, 1) |
|
286 | self.gridLayout_9.addWidget(self.label_16, 17, 0, 1, 1) | |
287 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) |
|
287 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) | |
288 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) |
|
288 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) | |
289 | self.gridLayout_9.addWidget(self.specGgraphHeight, 17, 2, 1, 2) |
|
289 | self.gridLayout_9.addWidget(self.specGgraphHeight, 17, 2, 1, 2) | |
290 |
|
290 | |||
291 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) |
|
291 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) | |
292 | self.label_17.setObjectName(_fromUtf8("label_17")) |
|
292 | self.label_17.setObjectName(_fromUtf8("label_17")) | |
293 | self.gridLayout_9.addWidget(self.label_17, 18, 0, 1, 1) |
|
293 | self.gridLayout_9.addWidget(self.label_17, 18, 0, 1, 1) | |
294 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
294 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) | |
295 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) |
|
295 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) | |
296 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, 18, 2, 1, 2) |
|
296 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, 18, 2, 1, 2) | |
297 |
|
297 | |||
298 | self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
298 | self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra) | |
299 | self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel")) |
|
299 | self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel")) | |
300 | self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, 19, 0, 1, 2) |
|
300 | self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, 19, 0, 1, 2) | |
301 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) |
|
301 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) | |
302 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) |
|
302 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) | |
303 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, 19, 2, 1, 2) |
|
303 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, 19, 2, 1, 2) | |
304 |
|
304 | |||
305 | self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
305 | self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra) | |
306 | self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel")) |
|
306 | self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel")) | |
307 | self.gridLayout_9.addWidget(self.specGraphMagLabel, 16, 4, 1, 2) |
|
307 | self.gridLayout_9.addWidget(self.specGraphMagLabel, 16, 4, 1, 2) | |
308 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) |
|
308 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) | |
309 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) |
|
309 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) | |
310 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, 16, 6, 1, 2) |
|
310 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, 16, 6, 1, 2) | |
311 |
|
311 | |||
312 | self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra) |
|
312 | self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra) | |
313 | self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel")) |
|
313 | self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel")) | |
314 | self.gridLayout_9.addWidget(self.specGraphPhaseLabel, 17, 4, 1, 2) |
|
314 | self.gridLayout_9.addWidget(self.specGraphPhaseLabel, 17, 4, 1, 2) | |
315 | self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra) |
|
315 | self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra) | |
316 | self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase")) |
|
316 | self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase")) | |
317 | self.gridLayout_9.addWidget(self.specGgraphPhase, 17, 6, 1, 2) |
|
317 | self.gridLayout_9.addWidget(self.specGgraphPhase, 17, 6, 1, 2) | |
318 |
|
318 | |||
319 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) |
|
319 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) | |
320 | self.label_6.setObjectName(_fromUtf8("label_6")) |
|
320 | self.label_6.setObjectName(_fromUtf8("label_6")) | |
321 | self.gridLayout_9.addWidget(self.label_6, 18, 4, 1, 1) |
|
321 | self.gridLayout_9.addWidget(self.label_6, 18, 4, 1, 1) | |
322 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) |
|
322 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) | |
323 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) |
|
323 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) | |
324 | self.gridLayout_9.addWidget(self.specGgraphChannelList, 18, 6, 1, 2) |
|
324 | self.gridLayout_9.addWidget(self.specGgraphChannelList, 18, 6, 1, 2) | |
325 |
|
325 | |||
326 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) |
|
326 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) | |
327 | self.label_29.setObjectName(_fromUtf8("label_29")) |
|
327 | self.label_29.setObjectName(_fromUtf8("label_29")) | |
328 | self.gridLayout_9.addWidget(self.label_29, 19, 4, 1, 2) |
|
328 | self.gridLayout_9.addWidget(self.label_29, 19, 4, 1, 2) | |
329 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) |
|
329 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) | |
330 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) |
|
330 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) | |
331 | self.gridLayout_9.addWidget(self.specGgraphftpratio, 19, 6, 1, 2) |
|
331 | self.gridLayout_9.addWidget(self.specGgraphftpratio, 19, 6, 1, 2) | |
332 |
|
332 | |||
333 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) |
|
333 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) | |
334 | self.label_48.setObjectName(_fromUtf8("label_48")) |
|
334 | self.label_48.setObjectName(_fromUtf8("label_48")) | |
335 | self.gridLayout_9.addWidget(self.label_48, 20, 4, 1, 2) |
|
335 | self.gridLayout_9.addWidget(self.label_48, 20, 4, 1, 2) | |
336 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
336 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) | |
337 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) |
|
337 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) | |
338 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, 20, 6, 1, 2) |
|
338 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, 20, 6, 1, 2) | |
339 |
|
339 | |||
340 | spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
340 | spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
341 | self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) |
|
341 | self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) | |
342 | spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
342 | spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
343 | self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) |
|
343 | self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) | |
344 | spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
344 | spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
345 | self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) |
|
345 | self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) | |
346 |
|
346 | |||
347 |
|
347 | |||
348 |
|
348 | |||
349 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) |
|
349 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) | |
350 | self.taboutputSpectra = QtGui.QWidget() |
|
350 | self.taboutputSpectra = QtGui.QWidget() | |
351 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) |
|
351 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) | |
352 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) |
|
352 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) | |
353 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) |
|
353 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) | |
354 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) |
|
354 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) | |
355 | self.label_39.setObjectName(_fromUtf8("label_39")) |
|
355 | self.label_39.setObjectName(_fromUtf8("label_39")) | |
356 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) |
|
356 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) | |
357 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) |
|
357 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) | |
358 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) |
|
358 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) | |
359 | self.specOutputComData.addItem(_fromUtf8("")) |
|
359 | self.specOutputComData.addItem(_fromUtf8("")) | |
360 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) |
|
360 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) | |
361 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) |
|
361 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) | |
362 | self.label_34.setObjectName(_fromUtf8("label_34")) |
|
362 | self.label_34.setObjectName(_fromUtf8("label_34")) | |
363 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) |
|
363 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) | |
364 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) |
|
364 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) | |
365 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) |
|
365 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) | |
366 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) |
|
366 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) | |
367 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
367 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
368 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) |
|
368 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) | |
369 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) |
|
369 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) | |
370 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) |
|
370 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) | |
371 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) |
|
371 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) | |
372 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) |
|
372 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) | |
373 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) |
|
373 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) | |
374 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) |
|
374 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) | |
375 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) |
|
375 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) | |
376 | self.label_9.setObjectName(_fromUtf8("label_9")) |
|
376 | self.label_9.setObjectName(_fromUtf8("label_9")) | |
377 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) |
|
377 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) | |
378 | self.label_38 = QtGui.QLabel(self.taboutputSpectra) |
|
378 | self.label_38 = QtGui.QLabel(self.taboutputSpectra) | |
379 | self.label_38.setObjectName(_fromUtf8("label_38")) |
|
379 | self.label_38.setObjectName(_fromUtf8("label_38")) | |
380 | self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) |
|
380 | self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) | |
381 | self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) |
|
381 | self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) | |
382 | self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) |
|
382 | self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) | |
383 | self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) |
|
383 | self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) | |
384 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) |
|
384 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) | |
385 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) |
|
385 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) | |
386 |
|
386 | |||
387 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) |
|
387 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) | |
388 |
|
388 | |||
389 | self.tabWidgetSpectra.setCurrentIndex(0) |
|
389 | self.tabWidgetSpectra.setCurrentIndex(0) | |
390 |
|
390 | |||
391 | def retranslateUi(self): |
|
391 | def retranslateUi(self): | |
392 |
|
392 | |||
393 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
393 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) | |
394 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
394 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
395 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None)) |
|
395 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None)) | |
396 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) |
|
396 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) | |
397 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) |
|
397 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) | |
398 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) |
|
398 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
399 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) |
|
399 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
400 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None)) |
|
400 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None)) | |
401 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) |
|
401 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
402 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None)) |
|
402 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None)) | |
403 | self.label_31.setText(_translate("MainWindow", "x-y pairs", None)) |
|
403 | self.label_31.setText(_translate("MainWindow", "x-y pairs", None)) | |
404 | self.label_26.setText(_translate("MainWindow", "nFFTPoints", None)) |
|
404 | self.label_26.setText(_translate("MainWindow", "nFFTPoints", None)) | |
405 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None)) |
|
405 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None)) | |
406 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) |
|
406 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
407 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None)) |
|
407 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None)) | |
408 |
self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar |
|
408 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar frequency (MHz)", None)) | |
409 | self.label_21.setText(_translate("MainWindow", "Profiles", None)) |
|
409 | self.label_21.setText(_translate("MainWindow", "Profiles", None)) | |
410 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None)) |
|
410 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None)) | |
411 | self.label_70.setText(_translate("MainWindow", "IppFactor", None)) |
|
411 | self.label_70.setText(_translate("MainWindow", "IppFactor", None)) | |
412 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None)) |
|
412 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None)) | |
413 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) |
|
413 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) | |
414 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) |
|
414 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) | |
415 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) |
|
415 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) | |
416 |
|
416 | |||
417 | self.label_44.setText(_translate("MainWindow", "Coherence Map", None)) |
|
417 | self.label_44.setText(_translate("MainWindow", "Coherence Map", None)) | |
418 | self.specGraphTminTmaxLabel.setText(_translate("MainWindow", "Time range:", None)) |
|
418 | self.specGraphTminTmaxLabel.setText(_translate("MainWindow", "Time range:", None)) | |
419 | self.label_25.setText(_translate("MainWindow", "Prefix", None)) |
|
419 | self.label_25.setText(_translate("MainWindow", "Prefix", None)) | |
420 | self.label_42.setText(_translate("MainWindow", "RTI Plot", None)) |
|
420 | self.label_42.setText(_translate("MainWindow", "RTI Plot", None)) | |
421 | self.label_16.setText(_translate("MainWindow", "Height range", None)) |
|
421 | self.label_16.setText(_translate("MainWindow", "Height range", None)) | |
422 | self.label_17.setText(_translate("MainWindow", "dB range", None)) |
|
422 | self.label_17.setText(_translate("MainWindow", "dB range", None)) | |
423 | self.specGraphMagLabel.setText(_translate("MainWindow", "Coh. Magnitud ", None)) |
|
423 | self.specGraphMagLabel.setText(_translate("MainWindow", "Coh. Magnitud ", None)) | |
424 | self.label_24.setText(_translate("MainWindow", "Path", None)) |
|
424 | self.label_24.setText(_translate("MainWindow", "Path", None)) | |
425 | self.label_46.setText(_translate("MainWindow", "Power Profile", None)) |
|
425 | self.label_46.setText(_translate("MainWindow", "Power Profile", None)) | |
426 | self.label_22.setText(_translate("MainWindow", "Freq/Vel range:", None)) |
|
426 | self.label_22.setText(_translate("MainWindow", "Freq/Vel range:", None)) | |
427 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None)) |
|
427 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None)) | |
428 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
428 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
429 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) |
|
429 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) | |
430 | self.label_40.setText(_translate("MainWindow", "Spectra Plot", None)) |
|
430 | self.label_40.setText(_translate("MainWindow", "Spectra Plot", None)) | |
431 | self.label_43.setText(_translate("MainWindow", "Show", None)) |
|
431 | self.label_43.setText(_translate("MainWindow", "Show", None)) | |
432 | self.label_29.setText(_translate("MainWindow", "Writing Period:", None)) |
|
432 | self.label_29.setText(_translate("MainWindow", "Writing Period:", None)) | |
433 | self.label_47.setText(_translate("MainWindow", "Save", None)) |
|
433 | self.label_47.setText(_translate("MainWindow", "Save", None)) | |
434 | self.label_19.setText(_translate("MainWindow", "Ftp", None)) |
|
434 | self.label_19.setText(_translate("MainWindow", "Ftp", None)) | |
435 | self.label_45.setText(_translate("MainWindow", "Noise", None)) |
|
435 | self.label_45.setText(_translate("MainWindow", "Noise", None)) | |
436 | self.label_48.setText(_translate("MainWindow", "Time Range:", None)) |
|
436 | self.label_48.setText(_translate("MainWindow", "Time Range:", None)) | |
437 | self.specGraphPhaseLabel.setText(_translate("MainWindow", "Coh. Phase:", None)) |
|
437 | self.specGraphPhaseLabel.setText(_translate("MainWindow", "Coh. Phase:", None)) | |
438 | self.label_48.hide() |
|
438 | self.label_48.hide() | |
439 | self.specGgraphTimeRange.hide() |
|
439 | self.specGgraphTimeRange.hide() | |
440 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) |
|
440 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) | |
441 |
|
441 | |||
442 | self.label_39.setText(_translate("MainWindow", "Type:", None)) |
|
442 | self.label_39.setText(_translate("MainWindow", "Type:", None)) | |
443 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) |
|
443 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) | |
444 | self.label_34.setText(_translate("MainWindow", "Path:", None)) |
|
444 | self.label_34.setText(_translate("MainWindow", "Path:", None)) | |
445 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
445 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
446 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) |
|
446 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) | |
447 | self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) |
|
447 | self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) | |
448 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) |
|
448 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) | |
449 |
|
449 | |||
450 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) |
|
450 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) | |
451 | No newline at end of file |
|
451 |
@@ -1,324 +1,324 | |||||
1 |
|
1 | |||
2 | from PyQt4 import QtCore, QtGui |
|
2 | from PyQt4 import QtCore, QtGui | |
3 |
|
3 | |||
4 | try: |
|
4 | try: | |
5 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
5 | _fromUtf8 = QtCore.QString.fromUtf8 | |
6 | except AttributeError: |
|
6 | except AttributeError: | |
7 | def _fromUtf8(s): |
|
7 | def _fromUtf8(s): | |
8 | return s |
|
8 | return s | |
9 |
|
9 | |||
10 | try: |
|
10 | try: | |
11 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
11 | _encoding = QtGui.QApplication.UnicodeUTF8 | |
12 | def _translate(context, text, disambig): |
|
12 | def _translate(context, text, disambig): | |
13 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
13 | return QtGui.QApplication.translate(context, text, disambig, _encoding) | |
14 | except AttributeError: |
|
14 | except AttributeError: | |
15 | def _translate(context, text, disambig): |
|
15 | def _translate(context, text, disambig): | |
16 | return QtGui.QApplication.translate(context, text, disambig) |
|
16 | return QtGui.QApplication.translate(context, text, disambig) | |
17 |
|
17 | |||
18 | class Ui_VoltageTab(object): |
|
18 | class Ui_VoltageTab(object): | |
19 |
|
19 | |||
20 | def setupUi(self): |
|
20 | def setupUi(self): | |
21 |
|
21 | |||
22 | self.tabVoltage = QtGui.QWidget() |
|
22 | self.tabVoltage = QtGui.QWidget() | |
23 | self.tabVoltage.setObjectName(_fromUtf8("tabVoltage")) |
|
23 | self.tabVoltage.setObjectName(_fromUtf8("tabVoltage")) | |
24 |
|
24 | |||
25 | self.gridLayout_3 = QtGui.QGridLayout(self.tabVoltage) |
|
25 | self.gridLayout_3 = QtGui.QGridLayout(self.tabVoltage) | |
26 | self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) |
|
26 | self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) | |
27 |
|
27 | |||
28 | self.frame_4 = QtGui.QFrame(self.tabVoltage) |
|
28 | self.frame_4 = QtGui.QFrame(self.tabVoltage) | |
29 | self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) |
|
29 | self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) | |
30 | self.frame_4.setFrameShadow(QtGui.QFrame.Raised) |
|
30 | self.frame_4.setFrameShadow(QtGui.QFrame.Raised) | |
31 | self.frame_4.setObjectName(_fromUtf8("frame_4")) |
|
31 | self.frame_4.setObjectName(_fromUtf8("frame_4")) | |
32 |
|
32 | |||
33 | self.gridLayout_17 = QtGui.QGridLayout(self.frame_4) |
|
33 | self.gridLayout_17 = QtGui.QGridLayout(self.frame_4) | |
34 | self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) |
|
34 | self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) | |
35 | self.volOpOk = QtGui.QPushButton(self.frame_4) |
|
35 | self.volOpOk = QtGui.QPushButton(self.frame_4) | |
36 | self.volOpOk.setObjectName(_fromUtf8("volOpOk")) |
|
36 | self.volOpOk.setObjectName(_fromUtf8("volOpOk")) | |
37 | self.gridLayout_17.addWidget(self.volOpOk, 0, 0, 1, 1) |
|
37 | self.gridLayout_17.addWidget(self.volOpOk, 0, 0, 1, 1) | |
38 | self.volGraphClear = QtGui.QPushButton(self.frame_4) |
|
38 | self.volGraphClear = QtGui.QPushButton(self.frame_4) | |
39 | self.volGraphClear.setObjectName(_fromUtf8("volGraphClear")) |
|
39 | self.volGraphClear.setObjectName(_fromUtf8("volGraphClear")) | |
40 | self.gridLayout_17.addWidget(self.volGraphClear, 0, 1, 1, 1) |
|
40 | self.gridLayout_17.addWidget(self.volGraphClear, 0, 1, 1, 1) | |
41 | self.gridLayout_3.addWidget(self.frame_4, 1, 1, 1, 1) |
|
41 | self.gridLayout_3.addWidget(self.frame_4, 1, 1, 1, 1) | |
42 |
|
42 | |||
43 |
|
43 | |||
44 | self.tabWidgetVoltage = QtGui.QTabWidget(self.tabVoltage) |
|
44 | self.tabWidgetVoltage = QtGui.QTabWidget(self.tabVoltage) | |
45 | self.tabWidgetVoltage.setObjectName(_fromUtf8("tabWidgetVoltage")) |
|
45 | self.tabWidgetVoltage.setObjectName(_fromUtf8("tabWidgetVoltage")) | |
46 | self.tabopVoltage = QtGui.QWidget() |
|
46 | self.tabopVoltage = QtGui.QWidget() | |
47 | self.tabopVoltage.setObjectName(_fromUtf8("tabopVoltage")) |
|
47 | self.tabopVoltage.setObjectName(_fromUtf8("tabopVoltage")) | |
48 | self.gridLayout = QtGui.QGridLayout(self.tabopVoltage) |
|
48 | self.gridLayout = QtGui.QGridLayout(self.tabopVoltage) | |
49 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) |
|
49 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) | |
50 | self.volOpHeights = QtGui.QLineEdit(self.tabopVoltage) |
|
50 | self.volOpHeights = QtGui.QLineEdit(self.tabopVoltage) | |
51 | self.volOpHeights.setObjectName(_fromUtf8("volOpHeights")) |
|
51 | self.volOpHeights.setObjectName(_fromUtf8("volOpHeights")) | |
52 | self.gridLayout.addWidget(self.volOpHeights, 4, 4, 1, 1) |
|
52 | self.gridLayout.addWidget(self.volOpHeights, 4, 4, 1, 1) | |
53 | self.volOpComHeights = QtGui.QComboBox(self.tabopVoltage) |
|
53 | self.volOpComHeights = QtGui.QComboBox(self.tabopVoltage) | |
54 | self.volOpComHeights.setObjectName(_fromUtf8("volOpComHeights")) |
|
54 | self.volOpComHeights.setObjectName(_fromUtf8("volOpComHeights")) | |
55 | self.volOpComHeights.addItem(_fromUtf8("")) |
|
55 | self.volOpComHeights.addItem(_fromUtf8("")) | |
56 | self.volOpComHeights.addItem(_fromUtf8("")) |
|
56 | self.volOpComHeights.addItem(_fromUtf8("")) | |
57 | self.gridLayout.addWidget(self.volOpComHeights, 4, 0, 1, 3) |
|
57 | self.gridLayout.addWidget(self.volOpComHeights, 4, 0, 1, 3) | |
58 | self.volOpComChannels = QtGui.QComboBox(self.tabopVoltage) |
|
58 | self.volOpComChannels = QtGui.QComboBox(self.tabopVoltage) | |
59 | self.volOpComChannels.setObjectName(_fromUtf8("volOpComChannels")) |
|
59 | self.volOpComChannels.setObjectName(_fromUtf8("volOpComChannels")) | |
60 | self.volOpComChannels.addItem(_fromUtf8("")) |
|
60 | self.volOpComChannels.addItem(_fromUtf8("")) | |
61 | self.volOpComChannels.addItem(_fromUtf8("")) |
|
61 | self.volOpComChannels.addItem(_fromUtf8("")) | |
62 | self.gridLayout.addWidget(self.volOpComChannels, 2, 0, 1, 3) |
|
62 | self.gridLayout.addWidget(self.volOpComChannels, 2, 0, 1, 3) | |
63 | self.volOpCebProfile = QtGui.QCheckBox(self.tabopVoltage) |
|
63 | self.volOpCebProfile = QtGui.QCheckBox(self.tabopVoltage) | |
64 | self.volOpCebProfile.setObjectName(_fromUtf8("volOpCebProfile")) |
|
64 | self.volOpCebProfile.setObjectName(_fromUtf8("volOpCebProfile")) | |
65 | self.gridLayout.addWidget(self.volOpCebProfile, 6, 0, 1, 3) |
|
65 | self.gridLayout.addWidget(self.volOpCebProfile, 6, 0, 1, 3) | |
66 | self.volOpComProfile = QtGui.QComboBox(self.tabopVoltage) |
|
66 | self.volOpComProfile = QtGui.QComboBox(self.tabopVoltage) | |
67 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) |
|
67 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) | |
68 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
68 | self.volOpComProfile.addItem(_fromUtf8("")) | |
69 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
69 | self.volOpComProfile.addItem(_fromUtf8("")) | |
70 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
70 | self.volOpComProfile.addItem(_fromUtf8("")) | |
71 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) |
|
71 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) | |
72 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) |
|
72 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) | |
73 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) |
|
73 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) | |
74 | self.gridLayout.addWidget(self.volOpCebDecodification, 8, 0, 1, 3) |
|
74 | self.gridLayout.addWidget(self.volOpCebDecodification, 8, 0, 1, 3) | |
75 | self.volOpProfile = QtGui.QLineEdit(self.tabopVoltage) |
|
75 | self.volOpProfile = QtGui.QLineEdit(self.tabopVoltage) | |
76 | self.volOpProfile.setObjectName(_fromUtf8("volOpProfile")) |
|
76 | self.volOpProfile.setObjectName(_fromUtf8("volOpProfile")) | |
77 | self.gridLayout.addWidget(self.volOpProfile, 7, 4, 1, 1) |
|
77 | self.gridLayout.addWidget(self.volOpProfile, 7, 4, 1, 1) | |
78 | self.volOpFilter = QtGui.QLineEdit(self.tabopVoltage) |
|
78 | self.volOpFilter = QtGui.QLineEdit(self.tabopVoltage) | |
79 | self.volOpFilter.setObjectName(_fromUtf8("volOpFilter")) |
|
79 | self.volOpFilter.setObjectName(_fromUtf8("volOpFilter")) | |
80 | self.gridLayout.addWidget(self.volOpFilter, 5, 4, 1, 1) |
|
80 | self.gridLayout.addWidget(self.volOpFilter, 5, 4, 1, 1) | |
81 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
81 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
82 | self.gridLayout.addItem(spacerItem, 6, 4, 1, 1) |
|
82 | self.gridLayout.addItem(spacerItem, 6, 4, 1, 1) | |
83 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
83 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
84 | self.gridLayout.addItem(spacerItem1, 8, 4, 1, 1) |
|
84 | self.gridLayout.addItem(spacerItem1, 8, 4, 1, 1) | |
85 | spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
85 | spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
86 | self.gridLayout.addItem(spacerItem2, 3, 4, 1, 1) |
|
86 | self.gridLayout.addItem(spacerItem2, 3, 4, 1, 1) | |
87 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) |
|
87 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) | |
88 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) |
|
88 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) | |
89 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) |
|
89 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) | |
90 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) |
|
90 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) | |
91 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) |
|
91 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) | |
92 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) |
|
92 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) | |
93 | self.volOpCebHeights = QtGui.QCheckBox(self.tabopVoltage) |
|
93 | self.volOpCebHeights = QtGui.QCheckBox(self.tabopVoltage) | |
94 | self.volOpCebHeights.setObjectName(_fromUtf8("volOpCebHeights")) |
|
94 | self.volOpCebHeights.setObjectName(_fromUtf8("volOpCebHeights")) | |
95 | self.gridLayout.addWidget(self.volOpCebHeights, 3, 0, 1, 3) |
|
95 | self.gridLayout.addWidget(self.volOpCebHeights, 3, 0, 1, 3) | |
96 | self.volOpCebFilter = QtGui.QCheckBox(self.tabopVoltage) |
|
96 | self.volOpCebFilter = QtGui.QCheckBox(self.tabopVoltage) | |
97 | self.volOpCebFilter.setObjectName(_fromUtf8("volOpCebFilter")) |
|
97 | self.volOpCebFilter.setObjectName(_fromUtf8("volOpCebFilter")) | |
98 | self.gridLayout.addWidget(self.volOpCebFilter, 5, 0, 1, 3) |
|
98 | self.gridLayout.addWidget(self.volOpCebFilter, 5, 0, 1, 3) | |
99 | self.volOpRadarfrequency = QtGui.QLineEdit(self.tabopVoltage) |
|
99 | self.volOpRadarfrequency = QtGui.QLineEdit(self.tabopVoltage) | |
100 | self.volOpRadarfrequency.setObjectName(_fromUtf8("volOpRadarfrequency")) |
|
100 | self.volOpRadarfrequency.setObjectName(_fromUtf8("volOpRadarfrequency")) | |
101 | self.gridLayout.addWidget(self.volOpRadarfrequency, 0, 4, 1, 1) |
|
101 | self.gridLayout.addWidget(self.volOpRadarfrequency, 0, 4, 1, 1) | |
102 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) |
|
102 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) | |
103 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) |
|
103 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) | |
104 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) |
|
104 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) | |
105 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
105 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
106 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) |
|
106 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) | |
107 | self.volOpCebFlip = QtGui.QCheckBox(self.tabopVoltage) |
|
107 | self.volOpCebFlip = QtGui.QCheckBox(self.tabopVoltage) | |
108 | self.volOpCebFlip.setObjectName(_fromUtf8("volOpCebFlip")) |
|
108 | self.volOpCebFlip.setObjectName(_fromUtf8("volOpCebFlip")) | |
109 | self.gridLayout.addWidget(self.volOpCebFlip, 11, 0, 1, 3) |
|
109 | self.gridLayout.addWidget(self.volOpCebFlip, 11, 0, 1, 3) | |
110 | self.volOpFlip = QtGui.QLineEdit(self.tabopVoltage) |
|
110 | self.volOpFlip = QtGui.QLineEdit(self.tabopVoltage) | |
111 | self.volOpFlip.setObjectName(_fromUtf8("volOpFlip")) |
|
111 | self.volOpFlip.setObjectName(_fromUtf8("volOpFlip")) | |
112 | self.gridLayout.addWidget(self.volOpFlip, 11, 4, 1, 1) |
|
112 | self.gridLayout.addWidget(self.volOpFlip, 11, 4, 1, 1) | |
113 |
|
113 | |||
114 | self.volOpCebCohInt = QtGui.QCheckBox(self.tabopVoltage) |
|
114 | self.volOpCebCohInt = QtGui.QCheckBox(self.tabopVoltage) | |
115 | self.volOpCebCohInt.setObjectName(_fromUtf8("volOpCebCohInt")) |
|
115 | self.volOpCebCohInt.setObjectName(_fromUtf8("volOpCebCohInt")) | |
116 | self.gridLayout.addWidget(self.volOpCebCohInt, 12, 0, 1, 3) |
|
116 | self.gridLayout.addWidget(self.volOpCebCohInt, 12, 0, 1, 3) | |
117 | self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage) |
|
117 | self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage) | |
118 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) |
|
118 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) | |
119 | self.gridLayout.addWidget(self.volOpCohInt, 12, 4, 1, 1) |
|
119 | self.gridLayout.addWidget(self.volOpCohInt, 12, 4, 1, 1) | |
120 |
|
120 | |||
121 | self.volLabCodeMode = QtGui.QLabel(self.tabopVoltage) |
|
121 | self.volLabCodeMode = QtGui.QLabel(self.tabopVoltage) | |
122 | self.volLabCodeMode.setObjectName(_fromUtf8("volLabCodeMode")) |
|
122 | self.volLabCodeMode.setObjectName(_fromUtf8("volLabCodeMode")) | |
123 | self.gridLayout.addWidget(self.volLabCodeMode, 8, 2, 1, 1) |
|
123 | self.gridLayout.addWidget(self.volLabCodeMode, 8, 2, 1, 1) | |
124 | self.volLabCodeType = QtGui.QLabel(self.tabopVoltage) |
|
124 | self.volLabCodeType = QtGui.QLabel(self.tabopVoltage) | |
125 | self.volLabCodeType.setObjectName(_fromUtf8("volLabCodeType")) |
|
125 | self.volLabCodeType.setObjectName(_fromUtf8("volLabCodeType")) | |
126 | self.gridLayout.addWidget(self.volLabCodeType, 9, 2, 1, 1) |
|
126 | self.gridLayout.addWidget(self.volLabCodeType, 9, 2, 1, 1) | |
127 | self.volLabCode = QtGui.QLabel(self.tabopVoltage) |
|
127 | self.volLabCode = QtGui.QLabel(self.tabopVoltage) | |
128 | self.volLabCode.setObjectName(_fromUtf8("volLabCode")) |
|
128 | self.volLabCode.setObjectName(_fromUtf8("volLabCode")) | |
129 | self.gridLayout.addWidget(self.volLabCode, 10, 2, 1, 1) |
|
129 | self.gridLayout.addWidget(self.volLabCode, 10, 2, 1, 1) | |
130 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) |
|
130 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) | |
131 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) |
|
131 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) | |
132 | self.volOpComMode.addItem(_fromUtf8("")) |
|
132 | self.volOpComMode.addItem(_fromUtf8("")) | |
133 | self.volOpComMode.addItem(_fromUtf8("")) |
|
133 | self.volOpComMode.addItem(_fromUtf8("")) | |
134 | self.gridLayout.addWidget(self.volOpComMode, 8, 4, 1, 1) |
|
134 | self.gridLayout.addWidget(self.volOpComMode, 8, 4, 1, 1) | |
135 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) |
|
135 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) | |
136 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) |
|
136 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) | |
137 | self.volOpComCode.addItem(_fromUtf8("")) |
|
137 | self.volOpComCode.addItem(_fromUtf8("")) | |
138 | self.volOpComCode.addItem(_fromUtf8("")) |
|
138 | self.volOpComCode.addItem(_fromUtf8("")) | |
139 | self.volOpComCode.addItem(_fromUtf8("")) |
|
139 | self.volOpComCode.addItem(_fromUtf8("")) | |
140 | self.volOpComCode.addItem(_fromUtf8("")) |
|
140 | self.volOpComCode.addItem(_fromUtf8("")) | |
141 | self.volOpComCode.addItem(_fromUtf8("")) |
|
141 | self.volOpComCode.addItem(_fromUtf8("")) | |
142 | self.volOpComCode.addItem(_fromUtf8("")) |
|
142 | self.volOpComCode.addItem(_fromUtf8("")) | |
143 | self.volOpComCode.addItem(_fromUtf8("")) |
|
143 | self.volOpComCode.addItem(_fromUtf8("")) | |
144 | self.volOpComCode.addItem(_fromUtf8("")) |
|
144 | self.volOpComCode.addItem(_fromUtf8("")) | |
145 | self.volOpComCode.addItem(_fromUtf8("")) |
|
145 | self.volOpComCode.addItem(_fromUtf8("")) | |
146 | self.volOpComCode.addItem(_fromUtf8("")) |
|
146 | self.volOpComCode.addItem(_fromUtf8("")) | |
147 | self.volOpComCode.addItem(_fromUtf8("")) |
|
147 | self.volOpComCode.addItem(_fromUtf8("")) | |
148 | self.volOpComCode.addItem(_fromUtf8("")) |
|
148 | self.volOpComCode.addItem(_fromUtf8("")) | |
149 | self.volOpComCode.addItem(_fromUtf8("")) |
|
149 | self.volOpComCode.addItem(_fromUtf8("")) | |
150 | self.volOpComCode.addItem(_fromUtf8("")) |
|
150 | self.volOpComCode.addItem(_fromUtf8("")) | |
151 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) |
|
151 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) | |
152 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) |
|
152 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) | |
153 | self.volOpCode = QtGui.QLineEdit(self.tabopVoltage) |
|
153 | self.volOpCode = QtGui.QLineEdit(self.tabopVoltage) | |
154 | self.volOpCode.setObjectName(_fromUtf8("volOpCode")) |
|
154 | self.volOpCode.setObjectName(_fromUtf8("volOpCode")) | |
155 | self.gridLayout.addWidget(self.volOpCode, 10, 4, 1, 1) |
|
155 | self.gridLayout.addWidget(self.volOpCode, 10, 4, 1, 1) | |
156 |
|
156 | |||
157 | self.tabgraphVoltage = QtGui.QWidget() |
|
157 | self.tabgraphVoltage = QtGui.QWidget() | |
158 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) |
|
158 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) | |
159 | self.gridLayout_6 = QtGui.QGridLayout(self.tabgraphVoltage) |
|
159 | self.gridLayout_6 = QtGui.QGridLayout(self.tabgraphVoltage) | |
160 | self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) |
|
160 | self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) | |
161 | spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
161 | spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
162 | self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) |
|
162 | self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) | |
163 | self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) |
|
163 | self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
164 | self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) |
|
164 | self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) | |
165 | self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) |
|
165 | self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) | |
166 | self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) |
|
166 | self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) | |
167 | self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) |
|
167 | self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) | |
168 | self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) |
|
168 | self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) | |
169 | self.volGraphToolPath = QtGui.QToolButton(self.tabgraphVoltage) |
|
169 | self.volGraphToolPath = QtGui.QToolButton(self.tabgraphVoltage) | |
170 | self.volGraphToolPath.setObjectName(_fromUtf8("volGraphToolPath")) |
|
170 | self.volGraphToolPath.setObjectName(_fromUtf8("volGraphToolPath")) | |
171 | self.gridLayout_6.addWidget(self.volGraphToolPath, 1, 5, 1, 2) |
|
171 | self.gridLayout_6.addWidget(self.volGraphToolPath, 1, 5, 1, 2) | |
172 | self.volGraphPath = QtGui.QLineEdit(self.tabgraphVoltage) |
|
172 | self.volGraphPath = QtGui.QLineEdit(self.tabgraphVoltage) | |
173 | self.volGraphPath.setObjectName(_fromUtf8("volGraphPath")) |
|
173 | self.volGraphPath.setObjectName(_fromUtf8("volGraphPath")) | |
174 | self.gridLayout_6.addWidget(self.volGraphPath, 1, 1, 1, 4) |
|
174 | self.gridLayout_6.addWidget(self.volGraphPath, 1, 1, 1, 4) | |
175 | self.label_14 = QtGui.QLabel(self.tabgraphVoltage) |
|
175 | self.label_14 = QtGui.QLabel(self.tabgraphVoltage) | |
176 | self.label_14.setObjectName(_fromUtf8("label_14")) |
|
176 | self.label_14.setObjectName(_fromUtf8("label_14")) | |
177 | self.gridLayout_6.addWidget(self.label_14, 6, 0, 1, 1) |
|
177 | self.gridLayout_6.addWidget(self.label_14, 6, 0, 1, 1) | |
178 | spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
178 | spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
179 | self.gridLayout_6.addItem(spacerItem5, 3, 3, 1, 1) |
|
179 | self.gridLayout_6.addItem(spacerItem5, 3, 3, 1, 1) | |
180 | self.label_8 = QtGui.QLabel(self.tabgraphVoltage) |
|
180 | self.label_8 = QtGui.QLabel(self.tabgraphVoltage) | |
181 | self.label_8.setObjectName(_fromUtf8("label_8")) |
|
181 | self.label_8.setObjectName(_fromUtf8("label_8")) | |
182 | self.gridLayout_6.addWidget(self.label_8, 8, 0, 1, 1) |
|
182 | self.gridLayout_6.addWidget(self.label_8, 8, 0, 1, 1) | |
183 | self.label_49 = QtGui.QLabel(self.tabgraphVoltage) |
|
183 | self.label_49 = QtGui.QLabel(self.tabgraphVoltage) | |
184 | self.label_49.setObjectName(_fromUtf8("label_49")) |
|
184 | self.label_49.setObjectName(_fromUtf8("label_49")) | |
185 | self.gridLayout_6.addWidget(self.label_49, 4, 3, 1, 1) |
|
185 | self.gridLayout_6.addWidget(self.label_49, 4, 3, 1, 1) | |
186 | self.label_51 = QtGui.QLabel(self.tabgraphVoltage) |
|
186 | self.label_51 = QtGui.QLabel(self.tabgraphVoltage) | |
187 | self.label_51.setObjectName(_fromUtf8("label_51")) |
|
187 | self.label_51.setObjectName(_fromUtf8("label_51")) | |
188 | self.gridLayout_6.addWidget(self.label_51, 9, 0, 1, 1) |
|
188 | self.gridLayout_6.addWidget(self.label_51, 9, 0, 1, 1) | |
189 | self.volGraphCebshow = QtGui.QCheckBox(self.tabgraphVoltage) |
|
189 | self.volGraphCebshow = QtGui.QCheckBox(self.tabgraphVoltage) | |
190 | self.volGraphCebshow.setText(_fromUtf8("")) |
|
190 | self.volGraphCebshow.setText(_fromUtf8("")) | |
191 | self.volGraphCebshow.setObjectName(_fromUtf8("volGraphCebshow")) |
|
191 | self.volGraphCebshow.setObjectName(_fromUtf8("volGraphCebshow")) | |
192 | self.gridLayout_6.addWidget(self.volGraphCebshow, 6, 3, 1, 1) |
|
192 | self.gridLayout_6.addWidget(self.volGraphCebshow, 6, 3, 1, 1) | |
193 | self.label_12 = QtGui.QLabel(self.tabgraphVoltage) |
|
193 | self.label_12 = QtGui.QLabel(self.tabgraphVoltage) | |
194 | self.label_12.setObjectName(_fromUtf8("label_12")) |
|
194 | self.label_12.setObjectName(_fromUtf8("label_12")) | |
195 | self.gridLayout_6.addWidget(self.label_12, 1, 0, 1, 1) |
|
195 | self.gridLayout_6.addWidget(self.label_12, 1, 0, 1, 1) | |
196 | self.label_13 = QtGui.QLabel(self.tabgraphVoltage) |
|
196 | self.label_13 = QtGui.QLabel(self.tabgraphVoltage) | |
197 | self.label_13.setObjectName(_fromUtf8("label_13")) |
|
197 | self.label_13.setObjectName(_fromUtf8("label_13")) | |
198 | self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) |
|
198 | self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) | |
199 | self.label_52 = QtGui.QLabel(self.tabgraphVoltage) |
|
199 | self.label_52 = QtGui.QLabel(self.tabgraphVoltage) | |
200 | self.label_52.setObjectName(_fromUtf8("label_52")) |
|
200 | self.label_52.setObjectName(_fromUtf8("label_52")) | |
201 | self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) |
|
201 | self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) | |
202 | spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
202 | spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
203 | self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) |
|
203 | self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) | |
204 | spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
204 | spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
205 | self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) |
|
205 | self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) | |
206 | self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) |
|
206 | self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) | |
207 | self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) |
|
207 | self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) | |
208 | self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) |
|
208 | self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) | |
209 | self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) |
|
209 | self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
210 | self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) |
|
210 | self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) | |
211 | self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) |
|
211 | self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) | |
212 | self.label_50 = QtGui.QLabel(self.tabgraphVoltage) |
|
212 | self.label_50 = QtGui.QLabel(self.tabgraphVoltage) | |
213 | self.label_50.setObjectName(_fromUtf8("label_50")) |
|
213 | self.label_50.setObjectName(_fromUtf8("label_50")) | |
214 | self.gridLayout_6.addWidget(self.label_50, 4, 4, 1, 1) |
|
214 | self.gridLayout_6.addWidget(self.label_50, 4, 4, 1, 1) | |
215 | self.volGraphCebSave = QtGui.QCheckBox(self.tabgraphVoltage) |
|
215 | self.volGraphCebSave = QtGui.QCheckBox(self.tabgraphVoltage) | |
216 | self.volGraphCebSave.setText(_fromUtf8("")) |
|
216 | self.volGraphCebSave.setText(_fromUtf8("")) | |
217 | self.volGraphCebSave.setObjectName(_fromUtf8("volGraphCebSave")) |
|
217 | self.volGraphCebSave.setObjectName(_fromUtf8("volGraphCebSave")) | |
218 | self.gridLayout_6.addWidget(self.volGraphCebSave, 6, 4, 1, 1) |
|
218 | self.gridLayout_6.addWidget(self.volGraphCebSave, 6, 4, 1, 1) | |
219 | self.tabWidgetVoltage.addTab(self.tabgraphVoltage, _fromUtf8("")) |
|
219 | self.tabWidgetVoltage.addTab(self.tabgraphVoltage, _fromUtf8("")) | |
220 |
|
220 | |||
221 | self.taboutputVoltage = QtGui.QWidget() |
|
221 | self.taboutputVoltage = QtGui.QWidget() | |
222 | self.taboutputVoltage.setObjectName(_fromUtf8("taboutputVoltage")) |
|
222 | self.taboutputVoltage.setObjectName(_fromUtf8("taboutputVoltage")) | |
223 | self.gridLayout_12 = QtGui.QGridLayout(self.taboutputVoltage) |
|
223 | self.gridLayout_12 = QtGui.QGridLayout(self.taboutputVoltage) | |
224 | self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) |
|
224 | self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) | |
225 | self.label_36 = QtGui.QLabel(self.taboutputVoltage) |
|
225 | self.label_36 = QtGui.QLabel(self.taboutputVoltage) | |
226 | self.label_36.setObjectName(_fromUtf8("label_36")) |
|
226 | self.label_36.setObjectName(_fromUtf8("label_36")) | |
227 | self.gridLayout_12.addWidget(self.label_36, 0, 0, 1, 1) |
|
227 | self.gridLayout_12.addWidget(self.label_36, 0, 0, 1, 1) | |
228 | self.label_37 = QtGui.QLabel(self.taboutputVoltage) |
|
228 | self.label_37 = QtGui.QLabel(self.taboutputVoltage) | |
229 | self.label_37.setObjectName(_fromUtf8("label_37")) |
|
229 | self.label_37.setObjectName(_fromUtf8("label_37")) | |
230 | self.gridLayout_12.addWidget(self.label_37, 1, 0, 1, 1) |
|
230 | self.gridLayout_12.addWidget(self.label_37, 1, 0, 1, 1) | |
231 | self.volOutputPath = QtGui.QLineEdit(self.taboutputVoltage) |
|
231 | self.volOutputPath = QtGui.QLineEdit(self.taboutputVoltage) | |
232 | self.volOutputPath.setObjectName(_fromUtf8("volOutputPath")) |
|
232 | self.volOutputPath.setObjectName(_fromUtf8("volOutputPath")) | |
233 | self.gridLayout_12.addWidget(self.volOutputPath, 1, 2, 1, 1) |
|
233 | self.gridLayout_12.addWidget(self.volOutputPath, 1, 2, 1, 1) | |
234 | self.volOutputToolPath = QtGui.QToolButton(self.taboutputVoltage) |
|
234 | self.volOutputToolPath = QtGui.QToolButton(self.taboutputVoltage) | |
235 | self.volOutputToolPath.setObjectName(_fromUtf8("volOutputToolPath")) |
|
235 | self.volOutputToolPath.setObjectName(_fromUtf8("volOutputToolPath")) | |
236 | self.gridLayout_12.addWidget(self.volOutputToolPath, 1, 3, 1, 1) |
|
236 | self.gridLayout_12.addWidget(self.volOutputToolPath, 1, 3, 1, 1) | |
237 | self.volOutputComData = QtGui.QComboBox(self.taboutputVoltage) |
|
237 | self.volOutputComData = QtGui.QComboBox(self.taboutputVoltage) | |
238 | self.volOutputComData.setObjectName(_fromUtf8("volOutputComData")) |
|
238 | self.volOutputComData.setObjectName(_fromUtf8("volOutputComData")) | |
239 | self.volOutputComData.addItem(_fromUtf8("")) |
|
239 | self.volOutputComData.addItem(_fromUtf8("")) | |
240 | self.gridLayout_12.addWidget(self.volOutputComData, 0, 2, 1, 2) |
|
240 | self.gridLayout_12.addWidget(self.volOutputComData, 0, 2, 1, 2) | |
241 | spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
241 | spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
242 | self.gridLayout_12.addItem(spacerItem8, 5, 2, 1, 1) |
|
242 | self.gridLayout_12.addItem(spacerItem8, 5, 2, 1, 1) | |
243 | self.volOutputblocksperfile = QtGui.QLineEdit(self.taboutputVoltage) |
|
243 | self.volOutputblocksperfile = QtGui.QLineEdit(self.taboutputVoltage) | |
244 | self.volOutputblocksperfile.setObjectName(_fromUtf8("volOutputblocksperfile")) |
|
244 | self.volOutputblocksperfile.setObjectName(_fromUtf8("volOutputblocksperfile")) | |
245 | self.gridLayout_12.addWidget(self.volOutputblocksperfile, 3, 2, 1, 1) |
|
245 | self.gridLayout_12.addWidget(self.volOutputblocksperfile, 3, 2, 1, 1) | |
246 | self.label_7 = QtGui.QLabel(self.taboutputVoltage) |
|
246 | self.label_7 = QtGui.QLabel(self.taboutputVoltage) | |
247 | self.label_7.setObjectName(_fromUtf8("label_7")) |
|
247 | self.label_7.setObjectName(_fromUtf8("label_7")) | |
248 | self.gridLayout_12.addWidget(self.label_7, 3, 0, 1, 1) |
|
248 | self.gridLayout_12.addWidget(self.label_7, 3, 0, 1, 1) | |
249 | self.label_35 = QtGui.QLabel(self.taboutputVoltage) |
|
249 | self.label_35 = QtGui.QLabel(self.taboutputVoltage) | |
250 | self.label_35.setObjectName(_fromUtf8("label_35")) |
|
250 | self.label_35.setObjectName(_fromUtf8("label_35")) | |
251 | self.gridLayout_12.addWidget(self.label_35, 4, 0, 1, 1) |
|
251 | self.gridLayout_12.addWidget(self.label_35, 4, 0, 1, 1) | |
252 | self.volOutputprofilesperblock = QtGui.QLineEdit(self.taboutputVoltage) |
|
252 | self.volOutputprofilesperblock = QtGui.QLineEdit(self.taboutputVoltage) | |
253 | self.volOutputprofilesperblock.setObjectName(_fromUtf8("volOutputprofilesperblock")) |
|
253 | self.volOutputprofilesperblock.setObjectName(_fromUtf8("volOutputprofilesperblock")) | |
254 | self.gridLayout_12.addWidget(self.volOutputprofilesperblock, 4, 2, 1, 1) |
|
254 | self.gridLayout_12.addWidget(self.volOutputprofilesperblock, 4, 2, 1, 1) | |
255 | self.tabWidgetVoltage.addTab(self.taboutputVoltage, _fromUtf8("")) |
|
255 | self.tabWidgetVoltage.addTab(self.taboutputVoltage, _fromUtf8("")) | |
256 | self.gridLayout_3.addWidget(self.tabWidgetVoltage, 0, 1, 1, 1) |
|
256 | self.gridLayout_3.addWidget(self.tabWidgetVoltage, 0, 1, 1, 1) | |
257 |
|
257 | |||
258 | self.tabWidgetProject.addTab(self.tabVoltage, _fromUtf8("")) |
|
258 | self.tabWidgetProject.addTab(self.tabVoltage, _fromUtf8("")) | |
259 |
|
259 | |||
260 | self.tabWidgetVoltage.setCurrentIndex(0) |
|
260 | self.tabWidgetVoltage.setCurrentIndex(0) | |
261 |
|
261 | |||
262 | def retranslateUi(self): |
|
262 | def retranslateUi(self): | |
263 |
|
263 | |||
264 | self.volOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
264 | self.volOpOk.setText(_translate("MainWindow", "Ok", None)) | |
265 | self.volGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
265 | self.volGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
266 | self.volOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) |
|
266 | self.volOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
267 | self.volOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) |
|
267 | self.volOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
268 | self.volOpComChannels.setItemText(0, _translate("MainWindow", "Value", None)) |
|
268 | self.volOpComChannels.setItemText(0, _translate("MainWindow", "Value", None)) | |
269 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) |
|
269 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) | |
270 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) |
|
270 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) | |
271 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) |
|
271 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) | |
272 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range", None)) |
|
272 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range", None)) | |
273 | self.volOpComProfile.setItemText(2, _translate("MainWindow", "List of Profile Ranges", None)) |
|
273 | self.volOpComProfile.setItemText(2, _translate("MainWindow", "List of Profile Ranges", None)) | |
274 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) |
|
274 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) | |
275 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) |
|
275 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) | |
276 | self.volOpCebFlip.setText(_translate("MainWindow", "Flip", None)) |
|
276 | self.volOpCebFlip.setText(_translate("MainWindow", "Flip", None)) | |
277 | self.volLabCodeType.setText(_translate("MainWindow", "Code type:", None)) |
|
277 | self.volLabCodeType.setText(_translate("MainWindow", "Code type:", None)) | |
278 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) |
|
278 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) | |
279 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) |
|
279 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
280 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) |
|
280 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) | |
281 |
self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar |
|
281 | self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar frequency (MHz)", None)) | |
282 | self.volLabCodeMode.setText(_translate("MainWindow", "Mode:", None)) |
|
282 | self.volLabCodeMode.setText(_translate("MainWindow", "Mode:", None)) | |
283 | self.volLabCode.setText(_translate("MainWindow", "Code:", None)) |
|
283 | self.volLabCode.setText(_translate("MainWindow", "Code:", None)) | |
284 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Read from header", None)) |
|
284 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Read from header", None)) | |
285 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 3", None)) |
|
285 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 3", None)) | |
286 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 4", None)) |
|
286 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 4", None)) | |
287 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 5", None)) |
|
287 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 5", None)) | |
288 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 7", None)) |
|
288 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 7", None)) | |
289 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 11", None)) |
|
289 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 11", None)) | |
290 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 13", None)) |
|
290 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 13", None)) | |
291 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 3 + Comp.", None)) |
|
291 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 3 + Comp.", None)) | |
292 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 4 + Comp.", None)) |
|
292 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 4 + Comp.", None)) | |
293 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 5 + Comp.", None)) |
|
293 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 5 + Comp.", None)) | |
294 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 7 + Comp.", None)) |
|
294 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 7 + Comp.", None)) | |
295 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 11+ Comp.", None)) |
|
295 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 11+ Comp.", None)) | |
296 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Barker 13+ Comp.", None)) |
|
296 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Barker 13+ Comp.", None)) | |
297 | self.volOpComCode.setItemText(13, _translate("MainWindow", "User defined", None)) |
|
297 | self.volOpComCode.setItemText(13, _translate("MainWindow", "User defined", None)) | |
298 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) |
|
298 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) | |
299 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Frequency", None)) |
|
299 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Frequency", None)) | |
300 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) |
|
300 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) | |
301 |
|
301 | |||
302 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
302 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
303 | self.label_14.setText(_translate("MainWindow", "Scope", None)) |
|
303 | self.label_14.setText(_translate("MainWindow", "Scope", None)) | |
304 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) |
|
304 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) | |
305 | self.label_49.setText(_translate("MainWindow", "Show", None)) |
|
305 | self.label_49.setText(_translate("MainWindow", "Show", None)) | |
306 | self.label_51.setText(_translate("MainWindow", "Height range", None)) |
|
306 | self.label_51.setText(_translate("MainWindow", "Height range", None)) | |
307 | self.label_12.setText(_translate("MainWindow", "Path :", None)) |
|
307 | self.label_12.setText(_translate("MainWindow", "Path :", None)) | |
308 | self.label_13.setText(_translate("MainWindow", "Figure name:", None)) |
|
308 | self.label_13.setText(_translate("MainWindow", "Figure name:", None)) | |
309 | self.label_52.setText(_translate("MainWindow", "Amplitude", None)) |
|
309 | self.label_52.setText(_translate("MainWindow", "Amplitude", None)) | |
310 | self.label_50.setText(_translate("MainWindow", "Save", None)) |
|
310 | self.label_50.setText(_translate("MainWindow", "Save", None)) | |
311 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) |
|
311 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) | |
312 |
|
312 | |||
313 | self.label_36.setText(_translate("MainWindow", "Type:", None)) |
|
313 | self.label_36.setText(_translate("MainWindow", "Type:", None)) | |
314 | self.label_37.setText(_translate("MainWindow", "Path:", None)) |
|
314 | self.label_37.setText(_translate("MainWindow", "Path:", None)) | |
315 | self.volOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
315 | self.volOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
316 | self.volOutputComData.setItemText(0, _translate("MainWindow", ".rawdata", None)) |
|
316 | self.volOutputComData.setItemText(0, _translate("MainWindow", ".rawdata", None)) | |
317 | self.label_7.setText(_translate("MainWindow", "Blocks per File : ", None)) |
|
317 | self.label_7.setText(_translate("MainWindow", "Blocks per File : ", None)) | |
318 | self.label_35.setText(_translate("MainWindow", "Profiles per Block: ", None)) |
|
318 | self.label_35.setText(_translate("MainWindow", "Profiles per Block: ", None)) | |
319 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.taboutputVoltage), _translate("MainWindow", "Output", None)) |
|
319 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.taboutputVoltage), _translate("MainWindow", "Output", None)) | |
320 |
|
320 | |||
321 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabVoltage), _translate("MainWindow", "Voltage", None)) |
|
321 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabVoltage), _translate("MainWindow", "Voltage", None)) | |
322 |
|
322 | |||
323 |
|
323 | |||
324 | No newline at end of file |
|
324 |
@@ -1,581 +1,583 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on Jul 3, 2014 |
|
2 | Created on Jul 3, 2014 | |
3 |
|
3 | |||
4 | @author: roj-idl71 |
|
4 | @author: roj-idl71 | |
5 | ''' |
|
5 | ''' | |
6 | import datetime |
|
6 | import datetime | |
7 | import numpy |
|
7 | import numpy | |
8 |
|
8 | |||
9 | try: |
|
9 | try: | |
10 | from gevent import sleep |
|
10 | from gevent import sleep | |
11 | except: |
|
11 | except: | |
12 | from time import sleep |
|
12 | from time import sleep | |
13 |
|
13 | |||
14 | from schainpy.model.data.jroheaderIO import RadarControllerHeader, SystemHeader |
|
14 | from schainpy.model.data.jroheaderIO import RadarControllerHeader, SystemHeader | |
15 | from schainpy.model.data.jrodata import Voltage |
|
15 | from schainpy.model.data.jrodata import Voltage | |
16 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation |
|
16 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation | |
17 |
|
17 | |||
18 | try: |
|
18 | try: | |
19 | import digital_rf_hdf5 |
|
19 | import digital_rf_hdf5 | |
20 | except: |
|
20 | except: | |
21 | print 'You should install "digital_rf_hdf5" module if you want to read USRP data' |
|
21 | print 'You should install "digital_rf_hdf5" module if you want to read USRP data' | |
22 |
|
22 | |||
23 | class USRPReader(ProcessingUnit): |
|
23 | class USRPReader(ProcessingUnit): | |
24 | ''' |
|
24 | ''' | |
25 | classdocs |
|
25 | classdocs | |
26 | ''' |
|
26 | ''' | |
27 |
|
27 | |||
28 | def __init__(self): |
|
28 | def __init__(self): | |
29 | ''' |
|
29 | ''' | |
30 | Constructor |
|
30 | Constructor | |
31 | ''' |
|
31 | ''' | |
32 |
|
32 | |||
33 | ProcessingUnit.__init__(self) |
|
33 | ProcessingUnit.__init__(self) | |
34 |
|
34 | |||
35 | self.dataOut = Voltage() |
|
35 | self.dataOut = Voltage() | |
36 | self.__printInfo = True |
|
36 | self.__printInfo = True | |
37 | self.__flagDiscontinuousBlock = False |
|
37 | self.__flagDiscontinuousBlock = False | |
38 | self.__bufferIndex = 9999999 |
|
38 | self.__bufferIndex = 9999999 | |
39 |
|
39 | |||
40 | self.__ippKm = None |
|
40 | self.__ippKm = None | |
41 | self.__codeType = 0 |
|
41 | self.__codeType = 0 | |
42 | self.__nCode = None |
|
42 | self.__nCode = None | |
43 | self.__nBaud = None |
|
43 | self.__nBaud = None | |
44 | self.__code = None |
|
44 | self.__code = None | |
45 |
|
45 | |||
46 | def __getCurrentSecond(self): |
|
46 | def __getCurrentSecond(self): | |
47 |
|
47 | |||
48 | return self.__thisUnixSample/self.__sample_rate |
|
48 | return self.__thisUnixSample/self.__sample_rate | |
49 |
|
49 | |||
50 | thisSecond = property(__getCurrentSecond, "I'm the 'thisSecond' property.") |
|
50 | thisSecond = property(__getCurrentSecond, "I'm the 'thisSecond' property.") | |
51 |
|
51 | |||
52 | def __setFileHeader(self): |
|
52 | def __setFileHeader(self): | |
53 | ''' |
|
53 | ''' | |
54 | In this method will be initialized every parameter of dataOut object (header, no data) |
|
54 | In this method will be initialized every parameter of dataOut object (header, no data) | |
55 | ''' |
|
55 | ''' | |
56 | nProfiles = self.__sample_rate #Number of profiles by second |
|
56 | nProfiles = self.__sample_rate #Number of profiles by second | |
57 |
|
57 | |||
58 | self.dataOut.radarControllerHeaderObj = RadarControllerHeader(ippKm=self.__ippKm, |
|
58 | self.dataOut.radarControllerHeaderObj = RadarControllerHeader(ippKm=self.__ippKm, | |
59 | txA=0, |
|
59 | txA=0, | |
60 | txB=0, |
|
60 | txB=0, | |
61 | nWindows=1, |
|
61 | nWindows=1, | |
62 | nHeights=self.__nSamples, |
|
62 | nHeights=self.__nSamples, | |
63 | firstHeight=self.__firstHeigth, |
|
63 | firstHeight=self.__firstHeigth, | |
64 | deltaHeight=self.__deltaHeigth, |
|
64 | deltaHeight=self.__deltaHeigth, | |
65 | codeType=self.__codeType, |
|
65 | codeType=self.__codeType, | |
66 | nCode=self.__nCode, nBaud=self.__nBaud, |
|
66 | nCode=self.__nCode, nBaud=self.__nBaud, | |
67 | code = self.__code) |
|
67 | code = self.__code) | |
68 |
|
68 | |||
69 | self.dataOut.systemHeaderObj = SystemHeader(nSamples=self.__nSamples, |
|
69 | self.dataOut.systemHeaderObj = SystemHeader(nSamples=self.__nSamples, | |
70 | nProfiles=nProfiles, |
|
70 | nProfiles=nProfiles, | |
71 | nChannels=len(self.__channelList), |
|
71 | nChannels=len(self.__channelList), | |
72 | adcResolution=14) |
|
72 | adcResolution=14) | |
73 |
|
73 | |||
74 | self.dataOut.type = "Voltage" |
|
74 | self.dataOut.type = "Voltage" | |
75 |
|
75 | |||
76 | self.dataOut.data = None |
|
76 | self.dataOut.data = None | |
77 |
|
77 | |||
78 | self.dataOut.dtype = numpy.dtype([('real','<i8'),('imag','<i8')]) |
|
78 | self.dataOut.dtype = numpy.dtype([('real','<i8'),('imag','<i8')]) | |
79 |
|
79 | |||
80 | # self.dataOut.nChannels = 0 |
|
80 | # self.dataOut.nChannels = 0 | |
81 |
|
81 | |||
82 | # self.dataOut.nHeights = 0 |
|
82 | # self.dataOut.nHeights = 0 | |
83 |
|
83 | |||
84 | self.dataOut.nProfiles = nProfiles |
|
84 | self.dataOut.nProfiles = nProfiles | |
85 |
|
85 | |||
86 | self.dataOut.heightList = self.__firstHeigth + numpy.arange(self.__nSamples, dtype = numpy.float)*self.__deltaHeigth |
|
86 | self.dataOut.heightList = self.__firstHeigth + numpy.arange(self.__nSamples, dtype = numpy.float)*self.__deltaHeigth | |
87 |
|
87 | |||
88 | self.dataOut.channelList = self.__channelList |
|
88 | self.dataOut.channelList = self.__channelList | |
89 |
|
89 | |||
90 | self.dataOut.blocksize = self.dataOut.getNChannels() * self.dataOut.getNHeights() |
|
90 | self.dataOut.blocksize = self.dataOut.getNChannels() * self.dataOut.getNHeights() | |
91 |
|
91 | |||
92 | # self.dataOut.channelIndexList = None |
|
92 | # self.dataOut.channelIndexList = None | |
93 |
|
93 | |||
94 | self.dataOut.flagNoData = True |
|
94 | self.dataOut.flagNoData = True | |
95 |
|
95 | |||
96 | #Set to TRUE if the data is discontinuous |
|
96 | #Set to TRUE if the data is discontinuous | |
97 | self.dataOut.flagDiscontinuousBlock = False |
|
97 | self.dataOut.flagDiscontinuousBlock = False | |
98 |
|
98 | |||
99 | self.dataOut.utctime = None |
|
99 | self.dataOut.utctime = None | |
100 |
|
100 | |||
101 | self.dataOut.timeZone = self.__timezone/60 #timezone like jroheader, difference in minutes between UTC and localtime |
|
101 | self.dataOut.timeZone = self.__timezone/60 #timezone like jroheader, difference in minutes between UTC and localtime | |
102 |
|
102 | |||
103 | self.dataOut.dstFlag = 0 |
|
103 | self.dataOut.dstFlag = 0 | |
104 |
|
104 | |||
105 | self.dataOut.errorCount = 0 |
|
105 | self.dataOut.errorCount = 0 | |
106 |
|
106 | |||
107 | self.dataOut.nCohInt = 1 |
|
107 | self.dataOut.nCohInt = 1 | |
108 |
|
108 | |||
109 | self.dataOut.flagDecodeData = False #asumo que la data esta decodificada |
|
109 | self.dataOut.flagDecodeData = False #asumo que la data esta decodificada | |
110 |
|
110 | |||
111 | self.dataOut.flagDeflipData = False #asumo que la data esta sin flip |
|
111 | self.dataOut.flagDeflipData = False #asumo que la data esta sin flip | |
112 |
|
112 | |||
113 | self.dataOut.flagShiftFFT = False |
|
113 | self.dataOut.flagShiftFFT = False | |
114 |
|
114 | |||
115 | self.dataOut.ippSeconds = 1.0*self.__nSamples/self.__sample_rate |
|
115 | self.dataOut.ippSeconds = 1.0*self.__nSamples/self.__sample_rate | |
116 |
|
116 | |||
117 | #Time interval between profiles |
|
117 | #Time interval between profiles | |
118 | #self.dataOut.timeInterval = self.dataOut.ippSeconds * self.dataOut.nCohInt |
|
118 | #self.dataOut.timeInterval = self.dataOut.ippSeconds * self.dataOut.nCohInt | |
119 |
|
119 | |||
120 | self.dataOut.frequency = self.__frequency |
|
120 | self.dataOut.frequency = self.__frequency | |
121 |
|
121 | |||
122 | self.dataOut.realtime = self.__online |
|
122 | self.dataOut.realtime = self.__online | |
123 |
|
123 | |||
124 | def findDatafiles(self, path, startDate=None, endDate=None): |
|
124 | def findDatafiles(self, path, startDate=None, endDate=None): | |
125 |
|
125 | |||
126 | try: |
|
126 | try: | |
127 | digitalReadObj = digital_rf_hdf5.read_hdf5(path, load_all_metadata=True) |
|
127 | digitalReadObj = digital_rf_hdf5.read_hdf5(path, load_all_metadata=True) | |
128 | except: |
|
128 | except: | |
129 | digitalReadObj = digital_rf_hdf5.read_hdf5(path) |
|
129 | digitalReadObj = digital_rf_hdf5.read_hdf5(path) | |
130 |
|
130 | |||
131 | channelNameList = digitalReadObj.get_channels() |
|
131 | channelNameList = digitalReadObj.get_channels() | |
132 |
|
132 | |||
133 | if not channelNameList: |
|
133 | if not channelNameList: | |
134 | return [] |
|
134 | return [] | |
135 |
|
135 | |||
136 | metadata_dict = digitalReadObj.get_rf_file_metadata(channelNameList[0]) |
|
136 | metadata_dict = digitalReadObj.get_rf_file_metadata(channelNameList[0]) | |
137 |
|
137 | |||
138 | sample_rate = metadata_dict['sample_rate'][0] |
|
138 | sample_rate = metadata_dict['sample_rate'][0] | |
139 |
|
139 | |||
140 | this_metadata_file = digitalReadObj.get_metadata(channelNameList[0]) |
|
140 | this_metadata_file = digitalReadObj.get_metadata(channelNameList[0]) | |
141 |
|
141 | |||
142 | try: |
|
142 | try: | |
143 | timezone = this_metadata_file['timezone'].value |
|
143 | timezone = this_metadata_file['timezone'].value | |
144 | except: |
|
144 | except: | |
145 | timezone = 0 |
|
145 | timezone = 0 | |
146 |
|
146 | |||
147 | startUTCSecond, endUTCSecond = digitalReadObj.get_bounds(channelNameList[0])/sample_rate - timezone |
|
147 | startUTCSecond, endUTCSecond = digitalReadObj.get_bounds(channelNameList[0])/sample_rate - timezone | |
148 |
|
148 | |||
149 | startDatetime = datetime.datetime.utcfromtimestamp(startUTCSecond) |
|
149 | startDatetime = datetime.datetime.utcfromtimestamp(startUTCSecond) | |
150 | endDatatime = datetime.datetime.utcfromtimestamp(endUTCSecond) |
|
150 | endDatatime = datetime.datetime.utcfromtimestamp(endUTCSecond) | |
151 |
|
151 | |||
152 | if not startDate: |
|
152 | if not startDate: | |
153 | startDate = startDatetime.date() |
|
153 | startDate = startDatetime.date() | |
154 |
|
154 | |||
155 | if not endDate: |
|
155 | if not endDate: | |
156 | endDate = endDatatime.date() |
|
156 | endDate = endDatatime.date() | |
157 |
|
157 | |||
158 | dateList = [] |
|
158 | dateList = [] | |
159 |
|
159 | |||
160 | thisDatetime = startDatetime |
|
160 | thisDatetime = startDatetime | |
161 |
|
161 | |||
162 | while(thisDatetime<=endDatatime): |
|
162 | while(thisDatetime<=endDatatime): | |
163 |
|
163 | |||
164 | thisDate = thisDatetime.date() |
|
164 | thisDate = thisDatetime.date() | |
165 |
|
165 | |||
166 | if thisDate < startDate: |
|
166 | if thisDate < startDate: | |
167 | continue |
|
167 | continue | |
168 |
|
168 | |||
169 | if thisDate > endDate: |
|
169 | if thisDate > endDate: | |
170 | break |
|
170 | break | |
171 |
|
171 | |||
172 | dateList.append(thisDate) |
|
172 | dateList.append(thisDate) | |
173 | thisDatetime += datetime.timedelta(1) |
|
173 | thisDatetime += datetime.timedelta(1) | |
174 |
|
174 | |||
175 | return dateList |
|
175 | return dateList | |
176 |
|
176 | |||
177 | def setup(self, path = None, |
|
177 | def setup(self, path = None, | |
178 | startDate = None, |
|
178 | startDate = None, | |
179 | endDate = None, |
|
179 | endDate = None, | |
180 | startTime = datetime.time(0,0,0), |
|
180 | startTime = datetime.time(0,0,0), | |
181 | endTime = datetime.time(23,59,59), |
|
181 | endTime = datetime.time(23,59,59), | |
182 | channelList = None, |
|
182 | channelList = None, | |
183 | nSamples = None, |
|
183 | nSamples = None, | |
184 | ippKm = 60, |
|
184 | ippKm = 60, | |
185 | online = False, |
|
185 | online = False, | |
186 | delay = 60, |
|
186 | delay = 60, | |
187 | buffer_size = None, |
|
187 | buffer_size = None, | |
188 | nbuffer = 1024, |
|
188 | nbuffer = 1024, | |
189 | **kwargs): |
|
189 | **kwargs): | |
190 | ''' |
|
190 | ''' | |
191 | In this method we should set all initial parameters. |
|
191 | In this method we should set all initial parameters. | |
192 |
|
192 | |||
193 | Inputs: |
|
193 | Inputs: | |
194 | path |
|
194 | path | |
195 | startDate |
|
195 | startDate | |
196 | endDate |
|
196 | endDate | |
197 | startTime |
|
197 | startTime | |
198 | endTime |
|
198 | endTime | |
199 | set |
|
199 | set | |
200 | expLabel |
|
200 | expLabel | |
201 | ext |
|
201 | ext | |
202 | online |
|
202 | online | |
203 | delay |
|
203 | delay | |
204 | ''' |
|
204 | ''' | |
205 |
|
205 | |||
206 | if not buffer_size: |
|
206 | if not buffer_size: | |
207 | buffer_size = nbuffer |
|
207 | buffer_size = nbuffer | |
208 |
|
208 | |||
209 | try: |
|
209 | try: | |
210 | self.digitalReadObj = digital_rf_hdf5.read_hdf5(path, load_all_metadata=True) |
|
210 | self.digitalReadObj = digital_rf_hdf5.read_hdf5(path, load_all_metadata=True) | |
211 | except: |
|
211 | except: | |
212 | self.digitalReadObj = digital_rf_hdf5.read_hdf5(path) |
|
212 | self.digitalReadObj = digital_rf_hdf5.read_hdf5(path) | |
213 |
|
213 | |||
214 | channelNameList = self.digitalReadObj.get_channels() |
|
214 | channelNameList = self.digitalReadObj.get_channels() | |
215 |
|
215 | |||
216 | if not channelNameList: |
|
216 | if not channelNameList: | |
217 | raise IOError, "[Reading] The path doesn,t have any files .. " |
|
217 | raise IOError, "[Reading] The path doesn,t have any files .. " | |
218 |
|
218 | |||
219 | if not channelList: |
|
219 | if not channelList: | |
220 | channelList = range(len(channelNameList)) |
|
220 | channelList = range(len(channelNameList)) | |
221 |
|
221 | |||
222 | ########## Reading metadata ###################### |
|
222 | ########## Reading metadata ###################### | |
223 |
|
223 | |||
224 | metadata_dict = self.digitalReadObj.get_rf_file_metadata(channelNameList[channelList[0]]) |
|
224 | metadata_dict = self.digitalReadObj.get_rf_file_metadata(channelNameList[channelList[0]]) | |
225 |
|
225 | |||
226 | self.__sample_rate = metadata_dict['sample_rate'][0] |
|
226 | self.__sample_rate = metadata_dict['sample_rate'][0] | |
227 | self.__samples_per_file = metadata_dict['samples_per_file'][0] |
|
227 | self.__samples_per_file = metadata_dict['samples_per_file'][0] | |
228 | self.__deltaHeigth = 1e6*0.15/self.__sample_rate |
|
228 | self.__deltaHeigth = 1e6*0.15/self.__sample_rate | |
229 |
|
229 | |||
230 | this_metadata_file = self.digitalReadObj.get_metadata(channelNameList[channelList[0]]) |
|
230 | this_metadata_file = self.digitalReadObj.get_metadata(channelNameList[channelList[0]]) | |
231 |
|
231 | |||
232 | self.__frequency = this_metadata_file['center_frequencies'].value |
|
232 | self.__frequency = this_metadata_file['center_frequencies'].value | |
233 | try: |
|
233 | try: | |
234 | self.__timezone = this_metadata_file['timezone'].value |
|
234 | self.__timezone = this_metadata_file['timezone'].value | |
235 | except: |
|
235 | except: | |
236 | self.__timezone = 0 |
|
236 | self.__timezone = 0 | |
237 |
|
237 | |||
238 | self.__firstHeigth = 0 |
|
238 | self.__firstHeigth = 0 | |
239 |
|
239 | |||
240 | try: |
|
240 | try: | |
241 | codeType = this_metadata_file['codeType'].value |
|
241 | codeType = this_metadata_file['codeType'].value | |
242 | except: |
|
242 | except: | |
243 | codeType = 0 |
|
243 | codeType = 0 | |
244 |
|
244 | |||
245 | nCode = 0 |
|
245 | nCode = 0 | |
246 | nBaud = 0 |
|
246 | nBaud = 0 | |
247 | code = None |
|
247 | code = None | |
248 |
|
248 | |||
249 | if codeType: |
|
249 | if codeType: | |
250 | nCode = this_metadata_file['nCode'].value |
|
250 | nCode = this_metadata_file['nCode'].value | |
251 | nBaud = this_metadata_file['nBaud'].value |
|
251 | nBaud = this_metadata_file['nBaud'].value | |
252 | code = this_metadata_file['code'].value |
|
252 | code = this_metadata_file['code'].value | |
253 |
|
253 | |||
254 | if not ippKm: |
|
254 | if not ippKm: | |
255 | try: |
|
255 | try: | |
256 | #seconds to km |
|
256 | #seconds to km | |
257 | ippKm = 1e6*0.15*this_metadata_file['ipp'].value |
|
257 | ippKm = 1e6*0.15*this_metadata_file['ipp'].value | |
258 | except: |
|
258 | except: | |
259 | ippKm = None |
|
259 | ippKm = None | |
260 |
|
260 | |||
261 | #################################################### |
|
261 | #################################################### | |
262 | startUTCSecond = None |
|
262 | startUTCSecond = None | |
263 | endUTCSecond = None |
|
263 | endUTCSecond = None | |
264 |
|
264 | |||
265 | if startDate: |
|
265 | if startDate: | |
266 | startDatetime = datetime.datetime.combine(startDate, startTime) |
|
266 | startDatetime = datetime.datetime.combine(startDate, startTime) | |
267 | startUTCSecond = (startDatetime-datetime.datetime(1970,1,1)).total_seconds() + self.__timezone |
|
267 | startUTCSecond = (startDatetime-datetime.datetime(1970,1,1)).total_seconds() + self.__timezone | |
268 |
|
268 | |||
269 | if endDate: |
|
269 | if endDate: | |
270 | endDatetime = datetime.datetime.combine(endDate, endTime) |
|
270 | endDatetime = datetime.datetime.combine(endDate, endTime) | |
271 | endUTCSecond = (endDatetime-datetime.datetime(1970,1,1)).total_seconds() + self.__timezone |
|
271 | endUTCSecond = (endDatetime-datetime.datetime(1970,1,1)).total_seconds() + self.__timezone | |
272 |
|
272 | |||
273 | start_index, end_index = self.digitalReadObj.get_bounds(channelNameList[channelList[0]]) |
|
273 | start_index, end_index = self.digitalReadObj.get_bounds(channelNameList[channelList[0]]) | |
274 |
|
274 | |||
275 | if not startUTCSecond: |
|
275 | if not startUTCSecond: | |
276 | startUTCSecond = start_index/self.__sample_rate |
|
276 | startUTCSecond = start_index/self.__sample_rate | |
277 |
|
277 | |||
278 | if start_index > startUTCSecond*self.__sample_rate: |
|
278 | if start_index > startUTCSecond*self.__sample_rate: | |
279 | startUTCSecond = start_index/self.__sample_rate |
|
279 | startUTCSecond = start_index/self.__sample_rate | |
280 |
|
280 | |||
281 | if not endUTCSecond: |
|
281 | if not endUTCSecond: | |
282 | endUTCSecond = end_index/self.__sample_rate |
|
282 | endUTCSecond = end_index/self.__sample_rate | |
283 |
|
283 | |||
284 | if end_index < endUTCSecond*self.__sample_rate: |
|
284 | if end_index < endUTCSecond*self.__sample_rate: | |
285 | endUTCSecond = end_index/self.__sample_rate |
|
285 | endUTCSecond = end_index/self.__sample_rate | |
286 |
|
286 | |||
287 | if not nSamples: |
|
287 | if not nSamples: | |
288 | if not ippKm: |
|
288 | if not ippKm: | |
289 | raise ValueError, "[Reading] nSamples or ippKm should be defined" |
|
289 | raise ValueError, "[Reading] nSamples or ippKm should be defined" | |
290 |
|
290 | |||
291 | nSamples = ippKm / (1e6*0.15/self.__sample_rate) |
|
291 | nSamples = ippKm / (1e6*0.15/self.__sample_rate) | |
292 |
|
292 | |||
293 | channelBoundList = [] |
|
293 | channelBoundList = [] | |
294 | channelNameListFiltered = [] |
|
294 | channelNameListFiltered = [] | |
295 |
|
295 | |||
296 | for thisIndexChannel in channelList: |
|
296 | for thisIndexChannel in channelList: | |
297 | thisChannelName = channelNameList[thisIndexChannel] |
|
297 | thisChannelName = channelNameList[thisIndexChannel] | |
298 | start_index, end_index = self.digitalReadObj.get_bounds(thisChannelName) |
|
298 | start_index, end_index = self.digitalReadObj.get_bounds(thisChannelName) | |
299 | channelBoundList.append((start_index, end_index)) |
|
299 | channelBoundList.append((start_index, end_index)) | |
300 | channelNameListFiltered.append(thisChannelName) |
|
300 | channelNameListFiltered.append(thisChannelName) | |
301 |
|
301 | |||
302 | self.profileIndex = 0 |
|
302 | self.profileIndex = 0 | |
303 |
|
303 | |||
304 | self.__delay = delay |
|
304 | self.__delay = delay | |
305 | self.__ippKm = ippKm |
|
305 | self.__ippKm = ippKm | |
306 | self.__codeType = codeType |
|
306 | self.__codeType = codeType | |
307 | self.__nCode = nCode |
|
307 | self.__nCode = nCode | |
308 | self.__nBaud = nBaud |
|
308 | self.__nBaud = nBaud | |
309 | self.__code = code |
|
309 | self.__code = code | |
310 |
|
310 | |||
311 | self.__datapath = path |
|
311 | self.__datapath = path | |
312 | self.__online = online |
|
312 | self.__online = online | |
313 | self.__channelList = channelList |
|
313 | self.__channelList = channelList | |
314 | self.__channelNameList = channelNameListFiltered |
|
314 | self.__channelNameList = channelNameListFiltered | |
315 | self.__channelBoundList = channelBoundList |
|
315 | self.__channelBoundList = channelBoundList | |
316 | self.__nSamples = nSamples |
|
316 | self.__nSamples = nSamples | |
317 | self.__samples_to_read = buffer_size*nSamples |
|
317 | self.__samples_to_read = buffer_size*nSamples | |
318 | self.__nChannels = len(self.__channelList) |
|
318 | self.__nChannels = len(self.__channelList) | |
319 |
|
319 | |||
320 | self.__startUTCSecond = startUTCSecond |
|
320 | self.__startUTCSecond = startUTCSecond | |
321 | self.__endUTCSecond = endUTCSecond |
|
321 | self.__endUTCSecond = endUTCSecond | |
322 |
|
322 | |||
323 | self.__timeInterval = 1.0 * self.__samples_to_read/self.__sample_rate #Time interval |
|
323 | self.__timeInterval = 1.0 * self.__samples_to_read/self.__sample_rate #Time interval | |
324 |
|
324 | |||
325 | if online: |
|
325 | if online: | |
326 | # self.__thisUnixSample = int(endUTCSecond*self.__sample_rate - 4*self.__samples_to_read) |
|
326 | # self.__thisUnixSample = int(endUTCSecond*self.__sample_rate - 4*self.__samples_to_read) | |
327 | startUTCSecond = numpy.floor(endUTCSecond) |
|
327 | startUTCSecond = numpy.floor(endUTCSecond) | |
328 |
|
328 | |||
329 | self.__thisUnixSample = int(startUTCSecond*self.__sample_rate) - self.__samples_to_read |
|
329 | self.__thisUnixSample = int(startUTCSecond*self.__sample_rate) - self.__samples_to_read | |
330 |
|
330 | |||
331 | self.__data_buffer = numpy.zeros((self.__nChannels, self.__samples_to_read), dtype = numpy.complex) |
|
331 | self.__data_buffer = numpy.zeros((self.__nChannels, self.__samples_to_read), dtype = numpy.complex) | |
332 |
|
332 | |||
333 | self.__setFileHeader() |
|
333 | self.__setFileHeader() | |
334 | self.isConfig = True |
|
334 | self.isConfig = True | |
335 |
|
335 | |||
336 | print "[Reading] USRP Data was found from %s to %s " %( |
|
336 | print "[Reading] USRP Data was found from %s to %s " %( | |
337 | datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), |
|
337 | datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), | |
338 | datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) |
|
338 | datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) | |
339 | ) |
|
339 | ) | |
340 |
|
340 | |||
341 |
print "[Reading] Starting process from " |
|
341 | print "[Reading] Starting process from %s to %s" %(datetime.datetime.utcfromtimestamp(startUTCSecond - self.__timezone), | |
|
342 | datetime.datetime.utcfromtimestamp(endUTCSecond - self.__timezone) | |||
|
343 | ) | |||
342 |
|
344 | |||
343 | def __reload(self): |
|
345 | def __reload(self): | |
344 |
|
346 | |||
345 | if not self.__online: |
|
347 | if not self.__online: | |
346 | return |
|
348 | return | |
347 |
|
349 | |||
348 |
|
350 | |||
349 | # print "%s not in range [%s, %s]" %( |
|
351 | # print "%s not in range [%s, %s]" %( | |
350 | # datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), |
|
352 | # datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), | |
351 | # datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), |
|
353 | # datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), | |
352 | # datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) |
|
354 | # datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) | |
353 | # ) |
|
355 | # ) | |
354 | print "[Reading] reloading metadata ..." |
|
356 | print "[Reading] reloading metadata ..." | |
355 |
|
357 | |||
356 | try: |
|
358 | try: | |
357 | self.digitalReadObj.reload(complete_update=True) |
|
359 | self.digitalReadObj.reload(complete_update=True) | |
358 | except: |
|
360 | except: | |
359 | self.digitalReadObj.reload() |
|
361 | self.digitalReadObj.reload() | |
360 |
|
362 | |||
361 | start_index, end_index = self.digitalReadObj.get_bounds(self.__channelNameList[self.__channelList[0]]) |
|
363 | start_index, end_index = self.digitalReadObj.get_bounds(self.__channelNameList[self.__channelList[0]]) | |
362 |
|
364 | |||
363 | if start_index > self.__startUTCSecond*self.__sample_rate: |
|
365 | if start_index > self.__startUTCSecond*self.__sample_rate: | |
364 | self.__startUTCSecond = 1.0*start_index/self.__sample_rate |
|
366 | self.__startUTCSecond = 1.0*start_index/self.__sample_rate | |
365 |
|
367 | |||
366 | if end_index > self.__endUTCSecond*self.__sample_rate: |
|
368 | if end_index > self.__endUTCSecond*self.__sample_rate: | |
367 | self.__endUTCSecond = 1.0*end_index/self.__sample_rate |
|
369 | self.__endUTCSecond = 1.0*end_index/self.__sample_rate | |
368 |
|
370 | |||
369 | print "[Reading] New timerange found [%s, %s] " %( |
|
371 | print "[Reading] New timerange found [%s, %s] " %( | |
370 | datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), |
|
372 | datetime.datetime.utcfromtimestamp(self.__startUTCSecond - self.__timezone), | |
371 | datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) |
|
373 | datetime.datetime.utcfromtimestamp(self.__endUTCSecond - self.__timezone) | |
372 | ) |
|
374 | ) | |
373 |
|
375 | |||
374 | return True |
|
376 | return True | |
375 |
|
377 | |||
376 | return False |
|
378 | return False | |
377 |
|
379 | |||
378 | def __readNextBlock(self, seconds=30, volt_scale = 218776): |
|
380 | def __readNextBlock(self, seconds=30, volt_scale = 218776): | |
379 | ''' |
|
381 | ''' | |
380 | ''' |
|
382 | ''' | |
381 |
|
383 | |||
382 | #Set the next data |
|
384 | #Set the next data | |
383 | self.__flagDiscontinuousBlock = False |
|
385 | self.__flagDiscontinuousBlock = False | |
384 | self.__thisUnixSample += self.__samples_to_read |
|
386 | self.__thisUnixSample += self.__samples_to_read | |
385 |
|
387 | |||
386 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: |
|
388 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: | |
387 | print "[Reading] There are no more data into selected timerange" |
|
389 | print "[Reading] There are no more data into selected timerange" | |
388 |
|
390 | |||
389 | self.__reload() |
|
391 | self.__reload() | |
390 |
|
392 | |||
391 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: |
|
393 | if self.__thisUnixSample + 2*self.__samples_to_read > self.__endUTCSecond*self.__sample_rate: | |
392 | self.__thisUnixSample -= self.__samples_to_read |
|
394 | self.__thisUnixSample -= self.__samples_to_read | |
393 | return False |
|
395 | return False | |
394 |
|
396 | |||
395 | indexChannel = 0 |
|
397 | indexChannel = 0 | |
396 |
|
398 | |||
397 | dataOk = False |
|
399 | dataOk = False | |
398 |
|
400 | |||
399 | for thisChannelName in self.__channelNameList: |
|
401 | for thisChannelName in self.__channelNameList: | |
400 |
|
402 | |||
401 | try: |
|
403 | try: | |
402 | result = self.digitalReadObj.read_vector_c81d(self.__thisUnixSample, |
|
404 | result = self.digitalReadObj.read_vector_c81d(self.__thisUnixSample, | |
403 | self.__samples_to_read, |
|
405 | self.__samples_to_read, | |
404 | thisChannelName) |
|
406 | thisChannelName) | |
405 |
|
407 | |||
406 | except IOError, e: |
|
408 | except IOError, e: | |
407 | #read next profile |
|
409 | #read next profile | |
408 | self.__flagDiscontinuousBlock = True |
|
410 | self.__flagDiscontinuousBlock = True | |
409 | print e |
|
411 | print e | |
410 | break |
|
412 | break | |
411 |
|
413 | |||
412 | if result.shape[0] != self.__samples_to_read: |
|
414 | if result.shape[0] != self.__samples_to_read: | |
413 | self.__flagDiscontinuousBlock = True |
|
415 | self.__flagDiscontinuousBlock = True | |
414 | print "[Reading] %s: Too few samples were found, just %d samples" %(datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), |
|
416 | print "[Reading] %s: Too few samples were found, just %d samples" %(datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), | |
415 | result.shape[0]) |
|
417 | result.shape[0]) | |
416 | break |
|
418 | break | |
417 |
|
419 | |||
418 | self.__data_buffer[indexChannel,:] = result*volt_scale |
|
420 | self.__data_buffer[indexChannel,:] = result*volt_scale | |
419 |
|
421 | |||
420 | indexChannel += 1 |
|
422 | indexChannel += 1 | |
421 |
|
423 | |||
422 | dataOk = True |
|
424 | dataOk = True | |
423 |
|
425 | |||
424 | self.__utctime = self.__thisUnixSample/self.__sample_rate |
|
426 | self.__utctime = self.__thisUnixSample/self.__sample_rate | |
425 |
|
427 | |||
426 | if not dataOk: |
|
428 | if not dataOk: | |
427 | return False |
|
429 | return False | |
428 |
|
430 | |||
429 | print "[Reading] %s: %d samples <> %f sec" %(datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), |
|
431 | print "[Reading] %s: %d samples <> %f sec" %(datetime.datetime.utcfromtimestamp(self.thisSecond - self.__timezone), | |
430 | self.__samples_to_read, |
|
432 | self.__samples_to_read, | |
431 | self.__timeInterval) |
|
433 | self.__timeInterval) | |
432 |
|
434 | |||
433 | self.__bufferIndex = 0 |
|
435 | self.__bufferIndex = 0 | |
434 |
|
436 | |||
435 | return True |
|
437 | return True | |
436 |
|
438 | |||
437 | def __isBufferEmpty(self): |
|
439 | def __isBufferEmpty(self): | |
438 |
|
440 | |||
439 | if self.__bufferIndex <= self.__samples_to_read - self.__nSamples: |
|
441 | if self.__bufferIndex <= self.__samples_to_read - self.__nSamples: | |
440 | return False |
|
442 | return False | |
441 |
|
443 | |||
442 | return True |
|
444 | return True | |
443 |
|
445 | |||
444 | def getData(self, seconds=30, nTries=5): |
|
446 | def getData(self, seconds=30, nTries=5): | |
445 |
|
447 | |||
446 | ''' |
|
448 | ''' | |
447 | This method gets the data from files and put the data into the dataOut object |
|
449 | This method gets the data from files and put the data into the dataOut object | |
448 |
|
450 | |||
449 | In addition, increase el the buffer counter in one. |
|
451 | In addition, increase el the buffer counter in one. | |
450 |
|
452 | |||
451 | Return: |
|
453 | Return: | |
452 | data : retorna un perfil de voltages (alturas * canales) copiados desde el |
|
454 | data : retorna un perfil de voltages (alturas * canales) copiados desde el | |
453 | buffer. Si no hay mas archivos a leer retorna None. |
|
455 | buffer. Si no hay mas archivos a leer retorna None. | |
454 |
|
456 | |||
455 | Affected: |
|
457 | Affected: | |
456 | self.dataOut |
|
458 | self.dataOut | |
457 | self.profileIndex |
|
459 | self.profileIndex | |
458 | self.flagDiscontinuousBlock |
|
460 | self.flagDiscontinuousBlock | |
459 | self.flagIsNewBlock |
|
461 | self.flagIsNewBlock | |
460 | ''' |
|
462 | ''' | |
461 |
|
463 | |||
462 | err_counter = 0 |
|
464 | err_counter = 0 | |
463 | self.dataOut.flagNoData = True |
|
465 | self.dataOut.flagNoData = True | |
464 |
|
466 | |||
465 | if self.__isBufferEmpty(): |
|
467 | if self.__isBufferEmpty(): | |
466 |
|
468 | |||
467 | self.__flagDiscontinuousBlock = False |
|
469 | self.__flagDiscontinuousBlock = False | |
468 |
|
470 | |||
469 | while True: |
|
471 | while True: | |
470 | if self.__readNextBlock(): |
|
472 | if self.__readNextBlock(): | |
471 | break |
|
473 | break | |
472 |
|
474 | |||
473 | if self.__thisUnixSample > self.__endUTCSecond*self.__sample_rate: |
|
475 | if self.__thisUnixSample > self.__endUTCSecond*self.__sample_rate: | |
474 | return False |
|
476 | return False | |
475 |
|
477 | |||
476 | if self.__flagDiscontinuousBlock: |
|
478 | if self.__flagDiscontinuousBlock: | |
477 | print '[Reading] discontinuous block found ... continue with the next block' |
|
479 | print '[Reading] discontinuous block found ... continue with the next block' | |
478 | continue |
|
480 | continue | |
479 |
|
481 | |||
480 | if not self.__online: |
|
482 | if not self.__online: | |
481 | return False |
|
483 | return False | |
482 |
|
484 | |||
483 | err_counter += 1 |
|
485 | err_counter += 1 | |
484 | if err_counter > nTries: |
|
486 | if err_counter > nTries: | |
485 | return False |
|
487 | return False | |
486 |
|
488 | |||
487 | print '[Reading] waiting %d seconds to read a new block' %seconds |
|
489 | print '[Reading] waiting %d seconds to read a new block' %seconds | |
488 | sleep(seconds) |
|
490 | sleep(seconds) | |
489 |
|
491 | |||
490 | self.dataOut.data = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex+self.__nSamples] |
|
492 | self.dataOut.data = self.__data_buffer[:,self.__bufferIndex:self.__bufferIndex+self.__nSamples] | |
491 | self.dataOut.utctime = (self.__thisUnixSample + self.__bufferIndex)/self.__sample_rate |
|
493 | self.dataOut.utctime = (self.__thisUnixSample + self.__bufferIndex)/self.__sample_rate | |
492 | self.dataOut.flagNoData = False |
|
494 | self.dataOut.flagNoData = False | |
493 | self.dataOut.flagDiscontinuousBlock = self.__flagDiscontinuousBlock |
|
495 | self.dataOut.flagDiscontinuousBlock = self.__flagDiscontinuousBlock | |
494 |
|
496 | |||
495 | self.__bufferIndex += self.__nSamples |
|
497 | self.__bufferIndex += self.__nSamples | |
496 | self.profileIndex += 1 |
|
498 | self.profileIndex += 1 | |
497 |
|
499 | |||
498 | return True |
|
500 | return True | |
499 |
|
501 | |||
500 | def printInfo(self): |
|
502 | def printInfo(self): | |
501 | ''' |
|
503 | ''' | |
502 | ''' |
|
504 | ''' | |
503 | if self.__printInfo == False: |
|
505 | if self.__printInfo == False: | |
504 | return |
|
506 | return | |
505 |
|
507 | |||
506 | # self.systemHeaderObj.printInfo() |
|
508 | # self.systemHeaderObj.printInfo() | |
507 | # self.radarControllerHeaderObj.printInfo() |
|
509 | # self.radarControllerHeaderObj.printInfo() | |
508 |
|
510 | |||
509 | self.__printInfo = False |
|
511 | self.__printInfo = False | |
510 |
|
512 | |||
511 | def printNumberOfBlock(self): |
|
513 | def printNumberOfBlock(self): | |
512 | ''' |
|
514 | ''' | |
513 | ''' |
|
515 | ''' | |
514 |
|
516 | |||
515 | print self.profileIndex |
|
517 | print self.profileIndex | |
516 |
|
518 | |||
517 | def run(self, **kwargs): |
|
519 | def run(self, **kwargs): | |
518 | ''' |
|
520 | ''' | |
519 | This method will be called many times so here you should put all your code |
|
521 | This method will be called many times so here you should put all your code | |
520 | ''' |
|
522 | ''' | |
521 |
|
523 | |||
522 | if not self.isConfig: |
|
524 | if not self.isConfig: | |
523 | self.setup(**kwargs) |
|
525 | self.setup(**kwargs) | |
524 |
|
526 | |||
525 | self.getData(seconds=self.__delay) |
|
527 | self.getData(seconds=self.__delay) | |
526 |
|
528 | |||
527 | return |
|
529 | return | |
528 |
|
530 | |||
529 | class USRPWriter(Operation): |
|
531 | class USRPWriter(Operation): | |
530 | ''' |
|
532 | ''' | |
531 | classdocs |
|
533 | classdocs | |
532 | ''' |
|
534 | ''' | |
533 |
|
535 | |||
534 | def __init__(self): |
|
536 | def __init__(self): | |
535 | ''' |
|
537 | ''' | |
536 | Constructor |
|
538 | Constructor | |
537 | ''' |
|
539 | ''' | |
538 | self.dataOut = None |
|
540 | self.dataOut = None | |
539 |
|
541 | |||
540 | def setup(self, dataIn, path, blocksPerFile, set=0, ext=None): |
|
542 | def setup(self, dataIn, path, blocksPerFile, set=0, ext=None): | |
541 | ''' |
|
543 | ''' | |
542 | In this method we should set all initial parameters. |
|
544 | In this method we should set all initial parameters. | |
543 |
|
545 | |||
544 | Input: |
|
546 | Input: | |
545 | dataIn : Input data will also be outputa data |
|
547 | dataIn : Input data will also be outputa data | |
546 |
|
548 | |||
547 | ''' |
|
549 | ''' | |
548 | self.dataOut = dataIn |
|
550 | self.dataOut = dataIn | |
549 |
|
551 | |||
550 |
|
552 | |||
551 |
|
553 | |||
552 |
|
554 | |||
553 |
|
555 | |||
554 | self.isConfig = True |
|
556 | self.isConfig = True | |
555 |
|
557 | |||
556 | return |
|
558 | return | |
557 |
|
559 | |||
558 | def run(self, dataIn, **kwargs): |
|
560 | def run(self, dataIn, **kwargs): | |
559 | ''' |
|
561 | ''' | |
560 | This method will be called many times so here you should put all your code |
|
562 | This method will be called many times so here you should put all your code | |
561 |
|
563 | |||
562 | Inputs: |
|
564 | Inputs: | |
563 |
|
565 | |||
564 | dataIn : object with the data |
|
566 | dataIn : object with the data | |
565 |
|
567 | |||
566 | ''' |
|
568 | ''' | |
567 |
|
569 | |||
568 | if not self.isConfig: |
|
570 | if not self.isConfig: | |
569 | self.setup(dataIn, **kwargs) |
|
571 | self.setup(dataIn, **kwargs) | |
570 |
|
572 | |||
571 |
|
573 | |||
572 | if __name__ == '__main__': |
|
574 | if __name__ == '__main__': | |
573 |
|
575 | |||
574 | readObj = USRPReader() |
|
576 | readObj = USRPReader() | |
575 |
|
577 | |||
576 | while True: |
|
578 | while True: | |
577 | readObj.run(path='/Volumes/DATA/haystack/passive_radar/') |
|
579 | readObj.run(path='/Volumes/DATA/haystack/passive_radar/') | |
578 | # readObj.printInfo() |
|
580 | # readObj.printInfo() | |
579 | readObj.printNumberOfBlock() |
|
581 | readObj.printNumberOfBlock() | |
580 |
|
582 | |||
581 | No newline at end of file |
|
583 |
@@ -1,949 +1,965 | |||||
1 | ''' |
|
1 | ''' | |
2 | @author: Daniel Suarez |
|
2 | @author: Daniel Suarez | |
3 | ''' |
|
3 | ''' | |
4 | import os |
|
4 | import os | |
5 | import glob |
|
5 | import glob | |
6 | import ftplib |
|
6 | import ftplib | |
7 |
|
7 | |||
8 | try: |
|
8 | try: | |
9 | import paramiko |
|
9 | import paramiko | |
10 | import scp |
|
10 | import scp | |
11 | except: |
|
11 | except: | |
12 | print "You should install paramiko if you will use SSH protocol to upload files to a server" |
|
12 | print "You should install paramiko if you will use SSH protocol to upload files to a server" | |
13 |
|
13 | |||
14 | import multiprocessing |
|
14 | import multiprocessing | |
15 |
|
15 | |||
16 | import time |
|
16 | import time | |
17 | import threading |
|
17 | import threading | |
18 |
|
18 | |||
19 |
|
19 | |||
20 | try: |
|
20 | try: | |
21 | from gevent import sleep |
|
21 | from gevent import sleep | |
22 | except: |
|
22 | except: | |
23 | from time import sleep |
|
23 | from time import sleep | |
24 |
|
24 | |||
25 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation |
|
25 | from schainpy.model.proc.jroproc_base import ProcessingUnit, Operation | |
26 |
|
26 | |||
27 | class Remote(threading.Thread): |
|
27 | class Remote(threading.Thread): | |
28 | """ |
|
28 | """ | |
29 | Remote is a parent class used to define the behaviour of FTP and SSH class. These clases are |
|
29 | Remote is a parent class used to define the behaviour of FTP and SSH class. These clases are | |
30 | used to upload or download files remotely. |
|
30 | used to upload or download files remotely. | |
31 |
|
31 | |||
32 | Non-standard Python modules used: |
|
32 | Non-standard Python modules used: | |
33 | None |
|
33 | None | |
34 |
|
34 | |||
35 | Written by: |
|
35 | Written by: | |
36 |
|
36 | |||
37 | "Miguel Urco":mailto:miguel.urco@jro.igp.gob.pe Jun. 03, 2015 |
|
37 | "Miguel Urco":mailto:miguel.urco@jro.igp.gob.pe Jun. 03, 2015 | |
38 |
|
38 | |||
39 | """ |
|
39 | """ | |
40 |
|
40 | |||
41 | server = None |
|
41 | server = None | |
42 | username = None |
|
42 | username = None | |
43 | password = None |
|
43 | password = None | |
44 | remotefolder = None |
|
44 | remotefolder = None | |
45 |
|
45 | |||
46 | period = 60 |
|
46 | period = 60 | |
47 | fileList = [] |
|
47 | fileList = [] | |
48 | bussy = False |
|
48 | bussy = False | |
49 |
|
49 | |||
50 | def __init__(self, server, username, password, remotefolder, period=60): |
|
50 | def __init__(self, server, username, password, remotefolder, period=60): | |
51 |
|
51 | |||
52 | threading.Thread.__init__(self) |
|
52 | threading.Thread.__init__(self) | |
53 | self._stop = threading.Event() |
|
53 | self._stop = threading.Event() | |
54 |
|
54 | |||
|
55 | self.setDaemon(True) | |||
|
56 | ||||
55 | self.status = 0 |
|
57 | self.status = 0 | |
56 |
|
58 | |||
57 | self.period = period |
|
59 | self.period = period | |
58 | self.fileList = [] |
|
60 | self.fileList = [] | |
59 | self.bussy = False |
|
61 | self.bussy = False | |
60 |
|
62 | |||
61 | self.stopFlag = False |
|
63 | self.stopFlag = False | |
62 |
|
64 | |||
63 | print "[Remote Server] Opening server: %s" %server |
|
65 | print "[Remote Server] Opening server: %s" %server | |
64 | if self.open(server, username, password, remotefolder): |
|
66 | if self.open(server, username, password, remotefolder): | |
65 | print "[Remote Server] %s server was opened successfully" %server |
|
67 | print "[Remote Server] %s server was opened successfully" %server | |
66 |
|
68 | |||
67 | def stop(self): |
|
69 | def stop(self): | |
68 |
|
70 | |||
69 | self.stopFlag = True |
|
71 | self.stopFlag = True | |
70 |
|
72 | |||
71 | def open(self): |
|
73 | def open(self): | |
72 | """ |
|
74 | """ | |
73 | Connect to server and create a connection class (FTP or SSH) to remote server. |
|
75 | Connect to server and create a connection class (FTP or SSH) to remote server. | |
74 | """ |
|
76 | """ | |
75 | raise NotImplementedError, "Implement this method in child class" |
|
77 | raise NotImplementedError, "Implement this method in child class" | |
76 |
|
78 | |||
77 | def close(self): |
|
79 | def close(self): | |
78 | """ |
|
80 | """ | |
79 | Close connection to server |
|
81 | Close connection to server | |
80 | """ |
|
82 | """ | |
81 | raise NotImplementedError, "Implement this method in child class" |
|
83 | raise NotImplementedError, "Implement this method in child class" | |
82 |
|
84 | |||
83 | def mkdir(self, remotefolder): |
|
85 | def mkdir(self, remotefolder): | |
84 | """ |
|
86 | """ | |
85 | Create a folder remotely |
|
87 | Create a folder remotely | |
86 | """ |
|
88 | """ | |
87 | raise NotImplementedError, "Implement this method in child class" |
|
89 | raise NotImplementedError, "Implement this method in child class" | |
88 |
|
90 | |||
89 | def cd(self, remotefolder): |
|
91 | def cd(self, remotefolder): | |
90 | """ |
|
92 | """ | |
91 | Change working directory in remote server |
|
93 | Change working directory in remote server | |
92 | """ |
|
94 | """ | |
93 | raise NotImplementedError, "Implement this method in child class" |
|
95 | raise NotImplementedError, "Implement this method in child class" | |
94 |
|
96 | |||
95 | def download(self, filename, localfolder=None): |
|
97 | def download(self, filename, localfolder=None): | |
96 | """ |
|
98 | """ | |
97 | Download a file from server to local host |
|
99 | Download a file from server to local host | |
98 | """ |
|
100 | """ | |
99 | raise NotImplementedError, "Implement this method in child class" |
|
101 | raise NotImplementedError, "Implement this method in child class" | |
100 |
|
102 | |||
101 | def sendFile(self, fullfilename): |
|
103 | def sendFile(self, fullfilename): | |
102 | """ |
|
104 | """ | |
103 | sendFile method is used to upload a local file to the current directory in remote server |
|
105 | sendFile method is used to upload a local file to the current directory in remote server | |
104 |
|
106 | |||
105 | Inputs: |
|
107 | Inputs: | |
106 | fullfilename - full path name of local file to store in remote directory |
|
108 | fullfilename - full path name of local file to store in remote directory | |
107 |
|
109 | |||
108 | Returns: |
|
110 | Returns: | |
109 | 0 in error case else 1 |
|
111 | 0 in error case else 1 | |
110 | """ |
|
112 | """ | |
111 | raise NotImplementedError, "Implement this method in child class" |
|
113 | raise NotImplementedError, "Implement this method in child class" | |
112 |
|
114 | |||
113 | def upload(self, fullfilename, remotefolder=None): |
|
115 | def upload(self, fullfilename, remotefolder=None): | |
114 | """ |
|
116 | """ | |
115 | upload method is used to upload a local file to remote directory. This method changes |
|
117 | upload method is used to upload a local file to remote directory. This method changes | |
116 | working directory before sending a file. |
|
118 | working directory before sending a file. | |
117 |
|
119 | |||
118 | Inputs: |
|
120 | Inputs: | |
119 | fullfilename - full path name of local file to store in remote directory |
|
121 | fullfilename - full path name of local file to store in remote directory | |
120 |
|
122 | |||
121 | remotefolder - remote directory |
|
123 | remotefolder - remote directory | |
122 |
|
124 | |||
123 | Returns: |
|
125 | Returns: | |
124 | 0 in error case else 1 |
|
126 | 0 in error case else 1 | |
125 | """ |
|
127 | """ | |
126 | print "[Remote Server] Uploading %s to %s:%s" %(fullfilename, self.server, self.remotefolder) |
|
128 | print "[Remote Server] Uploading %s to %s:%s" %(fullfilename, self.server, self.remotefolder) | |
127 |
|
129 | |||
128 | if not self.status: |
|
130 | if not self.status: | |
129 | return 0 |
|
131 | return 0 | |
130 |
|
132 | |||
131 | if remotefolder == None: |
|
133 | if remotefolder == None: | |
132 | remotefolder = self.remotefolder |
|
134 | remotefolder = self.remotefolder | |
133 |
|
135 | |||
134 | if not self.cd(remotefolder): |
|
136 | if not self.cd(remotefolder): | |
135 | return 0 |
|
137 | return 0 | |
136 |
|
138 | |||
137 | if not self.sendFile(fullfilename): |
|
139 | if not self.sendFile(fullfilename): | |
138 | print "[Remote Server] Error uploading file %s" %fullfilename |
|
140 | print "[Remote Server] Error uploading file %s" %fullfilename | |
139 | return 0 |
|
141 | return 0 | |
140 |
|
142 | |||
141 | print "[Remote Server] upload finished successfully" |
|
143 | print "[Remote Server] upload finished successfully" | |
142 |
|
144 | |||
143 | return 1 |
|
145 | return 1 | |
144 |
|
146 | |||
145 | def delete(self, filename): |
|
147 | def delete(self, filename): | |
146 | """ |
|
148 | """ | |
147 | Remove a file from remote server |
|
149 | Remove a file from remote server | |
148 | """ |
|
150 | """ | |
149 | pass |
|
151 | pass | |
150 |
|
152 | |||
151 | def updateFileList(self, fileList): |
|
153 | def updateFileList(self, fileList): | |
152 | """ |
|
154 | """ | |
153 | Remove a file from remote server |
|
155 | Remove a file from remote server | |
154 | """ |
|
156 | """ | |
155 |
|
157 | |||
156 | if fileList == self.fileList: |
|
158 | if fileList == self.fileList: | |
157 |
return |
|
159 | return 0 | |
158 |
|
160 | |||
159 | init = time.time() |
|
161 | init = time.time() | |
160 |
|
162 | |||
161 | while(self.bussy): |
|
163 | while(self.bussy): | |
162 | sleep(0.1) |
|
164 | sleep(0.1) | |
163 | if time.time() - init > 2*self.period: |
|
165 | if time.time() - init > 2*self.period: | |
164 | return 0 |
|
166 | return 0 | |
165 |
|
167 | |||
166 | self.fileList = fileList |
|
168 | self.fileList = fileList | |
167 |
|
169 | |||
168 | return 1 |
|
170 | return 1 | |
169 |
|
171 | |||
170 | def run(self): |
|
172 | def run(self): | |
171 |
|
173 | |||
172 | if not self.status: |
|
174 | if not self.status: | |
173 | print "Finishing FTP service" |
|
175 | print "Finishing FTP service" | |
174 | return |
|
176 | return | |
175 |
|
177 | |||
176 | if not self.cd(self.remotefolder): |
|
178 | if not self.cd(self.remotefolder): | |
177 | raise ValueError, "Could not access to the new remote directory: %s" %self.remotefolder |
|
179 | raise ValueError, "Could not access to the new remote directory: %s" %self.remotefolder | |
178 |
|
180 | |||
179 | sts = True |
|
181 | sts = True | |
180 |
|
182 | |||
181 | while True: |
|
183 | while True: | |
182 |
|
184 | |||
183 | sleep(self.period) |
|
185 | sleep(self.period) | |
184 |
|
186 | |||
185 | self.bussy = True |
|
187 | self.bussy = True | |
186 |
|
188 | |||
187 | for thisFile in self.fileList: |
|
189 | for thisFile in self.fileList: | |
188 | sts = self.upload(thisFile, self.remotefolder) |
|
190 | sts = self.upload(thisFile, self.remotefolder) | |
189 | if not sts: break |
|
191 | if not sts: break | |
190 |
|
192 | |||
191 | if not sts: break |
|
|||
192 |
|
||||
193 | self.bussy = False |
|
193 | self.bussy = False | |
194 |
|
194 | |||
|
195 | if not sts: break | |||
|
196 | ||||
195 | if self.stopFlag: |
|
197 | if self.stopFlag: | |
196 | break |
|
198 | break | |
197 |
|
199 | |||
198 | print "[Remote Server] Thread stopped successfully" |
|
200 | print "[Remote Server] Thread stopped successfully" | |
199 |
|
201 | |||
200 | class FTPClient(Remote): |
|
202 | class FTPClient(Remote): | |
201 |
|
203 | |||
202 | __ftpClientObj = None |
|
204 | __ftpClientObj = None | |
203 |
|
205 | |||
204 | def __init__(self, server, username, password, remotefolder, period=60): |
|
206 | def __init__(self, server, username, password, remotefolder, period=60): | |
205 | """ |
|
207 | """ | |
206 | """ |
|
208 | """ | |
207 | Remote.__init__(self, server, username, password, remotefolder, period) |
|
209 | Remote.__init__(self, server, username, password, remotefolder, period) | |
208 |
|
210 | |||
209 | def open(self, server, username, password, remotefolder): |
|
211 | def open(self, server, username, password, remotefolder): | |
210 |
|
212 | |||
211 | """ |
|
213 | """ | |
212 | This method is used to set FTP parameters and establish a connection to remote server |
|
214 | This method is used to set FTP parameters and establish a connection to remote server | |
213 |
|
215 | |||
214 | Inputs: |
|
216 | Inputs: | |
215 | server - remote server IP Address |
|
217 | server - remote server IP Address | |
216 |
|
218 | |||
217 | username - remote server Username |
|
219 | username - remote server Username | |
218 |
|
220 | |||
219 | password - remote server password |
|
221 | password - remote server password | |
220 |
|
222 | |||
221 | remotefolder - remote server current working directory |
|
223 | remotefolder - remote server current working directory | |
222 |
|
224 | |||
223 | Return: void |
|
225 | Return: void | |
224 |
|
226 | |||
225 | Affects: |
|
227 | Affects: | |
226 | self.status - in case of error or fail connection this parameter is set to 0 else 1 |
|
228 | self.status - in case of error or fail connection this parameter is set to 0 else 1 | |
227 |
|
229 | |||
228 | """ |
|
230 | """ | |
229 |
|
231 | |||
230 | if server == None: |
|
232 | if server == None: | |
231 | raise ValueError, "FTP server should be defined" |
|
233 | raise ValueError, "FTP server should be defined" | |
232 |
|
234 | |||
233 | if username == None: |
|
235 | if username == None: | |
234 | raise ValueError, "FTP username should be defined" |
|
236 | raise ValueError, "FTP username should be defined" | |
235 |
|
237 | |||
236 | if password == None: |
|
238 | if password == None: | |
237 | raise ValueError, "FTP password should be defined" |
|
239 | raise ValueError, "FTP password should be defined" | |
238 |
|
240 | |||
239 | if remotefolder == None: |
|
241 | if remotefolder == None: | |
240 | raise ValueError, "FTP remote folder should be defined" |
|
242 | raise ValueError, "FTP remote folder should be defined" | |
241 |
|
243 | |||
242 | try: |
|
244 | try: | |
243 | ftpClientObj = ftplib.FTP(server) |
|
245 | ftpClientObj = ftplib.FTP(server) | |
244 | except ftplib.all_errors: |
|
246 | except ftplib.all_errors: | |
245 | print "FTP server connection fail: %s" %server |
|
247 | print "FTP server connection fail: %s" %server | |
246 | self.status = 0 |
|
248 | self.status = 0 | |
247 | return 0 |
|
249 | return 0 | |
248 |
|
250 | |||
249 | try: |
|
251 | try: | |
250 | ftpClientObj.login(username, password) |
|
252 | ftpClientObj.login(username, password) | |
251 | except ftplib.all_errors: |
|
253 | except ftplib.all_errors: | |
252 | print "FTP username or password are incorrect" |
|
254 | print "FTP username or password are incorrect" | |
253 | self.status = 0 |
|
255 | self.status = 0 | |
254 | return 0 |
|
256 | return 0 | |
255 |
|
257 | |||
256 | if remotefolder == None: |
|
258 | if remotefolder == None: | |
257 | remotefolder = ftpClientObj.pwd() |
|
259 | remotefolder = ftpClientObj.pwd() | |
258 | else: |
|
260 | else: | |
259 | try: |
|
261 | try: | |
260 | ftpClientObj.cwd(remotefolder) |
|
262 | ftpClientObj.cwd(remotefolder) | |
261 | except ftplib.all_errors: |
|
263 | except ftplib.all_errors: | |
262 | print "FTP remote folder is invalid: %s" %remotefolder |
|
264 | print "FTP remote folder is invalid: %s" %remotefolder | |
263 | remotefolder = ftpClientObj.pwd() |
|
265 | remotefolder = ftpClientObj.pwd() | |
264 |
|
266 | |||
265 | self.server = server |
|
267 | self.server = server | |
266 | self.username = username |
|
268 | self.username = username | |
267 | self.password = password |
|
269 | self.password = password | |
268 | self.remotefolder = remotefolder |
|
270 | self.remotefolder = remotefolder | |
269 | self.__ftpClientObj = ftpClientObj |
|
271 | self.__ftpClientObj = ftpClientObj | |
270 | self.status = 1 |
|
272 | self.status = 1 | |
271 |
|
273 | |||
272 | return 1 |
|
274 | return 1 | |
273 |
|
275 | |||
274 | def close(self): |
|
276 | def close(self): | |
275 | """ |
|
277 | """ | |
276 | Close connection to remote server |
|
278 | Close connection to remote server | |
277 | """ |
|
279 | """ | |
278 | if not self.status: |
|
280 | if not self.status: | |
279 | return 0 |
|
281 | return 0 | |
280 |
|
282 | |||
281 | self.__ftpClientObj.close() |
|
283 | self.__ftpClientObj.close() | |
282 |
|
284 | |||
283 | def mkdir(self, remotefolder): |
|
285 | def mkdir(self, remotefolder): | |
284 | """ |
|
286 | """ | |
285 | mkdir is used to make a new directory in remote server |
|
287 | mkdir is used to make a new directory in remote server | |
286 |
|
288 | |||
287 | Input: |
|
289 | Input: | |
288 | remotefolder - directory name |
|
290 | remotefolder - directory name | |
289 |
|
291 | |||
290 | Return: |
|
292 | Return: | |
291 | 0 in error case else 1 |
|
293 | 0 in error case else 1 | |
292 | """ |
|
294 | """ | |
293 | if not self.status: |
|
295 | if not self.status: | |
294 | return 0 |
|
296 | return 0 | |
295 |
|
297 | |||
296 | try: |
|
298 | try: | |
297 | self.__ftpClientObj.mkd(dirname) |
|
299 | self.__ftpClientObj.mkd(dirname) | |
298 | except ftplib.all_errors: |
|
300 | except ftplib.all_errors: | |
299 | print "Error creating remote folder: %s" %remotefolder |
|
301 | print "Error creating remote folder: %s" %remotefolder | |
300 | return 0 |
|
302 | return 0 | |
301 |
|
303 | |||
302 | return 1 |
|
304 | return 1 | |
303 |
|
305 | |||
304 | def cd(self, remotefolder): |
|
306 | def cd(self, remotefolder): | |
305 | """ |
|
307 | """ | |
306 | cd is used to change remote working directory on server |
|
308 | cd is used to change remote working directory on server | |
307 |
|
309 | |||
308 | Input: |
|
310 | Input: | |
309 | remotefolder - current working directory |
|
311 | remotefolder - current working directory | |
310 |
|
312 | |||
311 | Affects: |
|
313 | Affects: | |
312 | self.remotefolder |
|
314 | self.remotefolder | |
313 |
|
315 | |||
314 | Return: |
|
316 | Return: | |
315 | 0 in case of error else 1 |
|
317 | 0 in case of error else 1 | |
316 | """ |
|
318 | """ | |
317 | if not self.status: |
|
319 | if not self.status: | |
318 | return 0 |
|
320 | return 0 | |
319 |
|
321 | |||
320 | if remotefolder == self.remotefolder: |
|
322 | if remotefolder == self.remotefolder: | |
321 | return 1 |
|
323 | return 1 | |
322 |
|
324 | |||
323 | try: |
|
325 | try: | |
324 | self.__ftpClientObj.cwd(remotefolder) |
|
326 | self.__ftpClientObj.cwd(remotefolder) | |
325 | except ftplib.all_errors: |
|
327 | except ftplib.all_errors: | |
326 | print 'Error changing to %s' %remotefolder |
|
328 | print 'Error changing to %s' %remotefolder | |
327 | print 'Trying to create remote folder' |
|
329 | print 'Trying to create remote folder' | |
328 |
|
330 | |||
329 | if not self.mkdir(remotefolder): |
|
331 | if not self.mkdir(remotefolder): | |
330 | print 'Remote folder could not be created' |
|
332 | print 'Remote folder could not be created' | |
331 | return 0 |
|
333 | return 0 | |
332 |
|
334 | |||
333 | try: |
|
335 | try: | |
334 | self.__ftpClientObj.cwd(remotefolder) |
|
336 | self.__ftpClientObj.cwd(remotefolder) | |
335 | except ftplib.all_errors: |
|
337 | except ftplib.all_errors: | |
336 | return 0 |
|
338 | return 0 | |
337 |
|
339 | |||
338 | self.remotefolder = remotefolder |
|
340 | self.remotefolder = remotefolder | |
339 |
|
341 | |||
340 | return 1 |
|
342 | return 1 | |
341 |
|
343 | |||
342 | def sendFile(self, fullfilename): |
|
344 | def sendFile(self, fullfilename): | |
343 |
|
345 | |||
344 | if not self.status: |
|
346 | if not self.status: | |
345 | return 0 |
|
347 | return 0 | |
346 |
|
348 | |||
347 | file = open(fullfilename, 'rb') |
|
349 | file = open(fullfilename, 'rb') | |
348 |
|
350 | |||
349 |
filename = os.path. |
|
351 | filename = os.path.basename(fullfilename) | |
350 |
|
352 | |||
351 | command = "STOR %s" %filename |
|
353 | command = "STOR %s" %filename | |
352 |
|
354 | |||
353 | try: |
|
355 | try: | |
354 | self.__ftpClientObj.storbinary(command, file) |
|
356 | self.__ftpClientObj.storbinary(command, file) | |
355 | except ftplib.all_errors: |
|
357 | except ftplib.all_errors: | |
356 | return 0 |
|
358 | return 0 | |
357 |
|
359 | |||
358 | try: |
|
360 | try: | |
359 | self.__ftpClientObj.sendcmd('SITE CHMOD 755 ' + filename) |
|
361 | self.__ftpClientObj.sendcmd('SITE CHMOD 755 ' + filename) | |
360 | except ftplib.all_errors, e: |
|
362 | except ftplib.all_errors, e: | |
361 | print e |
|
363 | print e | |
362 |
|
364 | |||
363 | file.close() |
|
365 | file.close() | |
364 |
|
366 | |||
365 | return 1 |
|
367 | return 1 | |
366 |
|
368 | |||
367 | class SSHClient(Remote): |
|
369 | class SSHClient(Remote): | |
368 |
|
370 | |||
369 | __sshClientObj = None |
|
371 | __sshClientObj = None | |
370 | __scpClientObj = None |
|
372 | __scpClientObj = None | |
371 |
|
373 | |||
372 | def __init__(self, server, username, password, remotefolder, period=60): |
|
374 | def __init__(self, server, username, password, remotefolder, period=60): | |
373 | """ |
|
375 | """ | |
374 | """ |
|
376 | """ | |
375 | Remote.__init__(self, server, username, password, remotefolder, period) |
|
377 | Remote.__init__(self, server, username, password, remotefolder, period) | |
376 |
|
378 | |||
377 | def open(self, server, username, password, remotefolder, port=22): |
|
379 | def open(self, server, username, password, remotefolder, port=22): | |
378 |
|
380 | |||
379 | """ |
|
381 | """ | |
380 | This method is used to set SSH parameters and establish a connection to a remote server |
|
382 | This method is used to set SSH parameters and establish a connection to a remote server | |
381 |
|
383 | |||
382 | Inputs: |
|
384 | Inputs: | |
383 | server - remote server IP Address |
|
385 | server - remote server IP Address | |
384 |
|
386 | |||
385 | username - remote server Username |
|
387 | username - remote server Username | |
386 |
|
388 | |||
387 | password - remote server password |
|
389 | password - remote server password | |
388 |
|
390 | |||
389 | remotefolder - remote server current working directory |
|
391 | remotefolder - remote server current working directory | |
390 |
|
392 | |||
391 | Return: void |
|
393 | Return: void | |
392 |
|
394 | |||
393 | Affects: |
|
395 | Affects: | |
394 | self.status - in case of error or fail connection this parameter is set to 0 else 1 |
|
396 | self.status - in case of error or fail connection this parameter is set to 0 else 1 | |
395 |
|
397 | |||
396 | """ |
|
398 | """ | |
397 |
|
399 | |||
398 | if server == None: |
|
400 | if server == None: | |
399 | raise ValueError, "SSH server should be defined" |
|
401 | raise ValueError, "SSH server should be defined" | |
400 |
|
402 | |||
401 | if username == None: |
|
403 | if username == None: | |
402 | raise ValueError, "SSH username should be defined" |
|
404 | raise ValueError, "SSH username should be defined" | |
403 |
|
405 | |||
404 | if password == None: |
|
406 | if password == None: | |
405 | raise ValueError, "SSH password should be defined" |
|
407 | raise ValueError, "SSH password should be defined" | |
406 |
|
408 | |||
407 | if remotefolder == None: |
|
409 | if remotefolder == None: | |
408 | raise ValueError, "SSH remote folder should be defined" |
|
410 | raise ValueError, "SSH remote folder should be defined" | |
409 |
|
411 | |||
410 | try: |
|
412 | try: | |
411 | sshClientObj = paramiko.SSHClient() |
|
413 | sshClientObj = paramiko.SSHClient() | |
412 | except: |
|
414 | except: | |
413 | print "SSH server connection fail: %s" %server |
|
415 | print "SSH server connection fail: %s" %server | |
414 | self.status = 0 |
|
416 | self.status = 0 | |
415 | return 0 |
|
417 | return 0 | |
416 |
|
418 | |||
417 | sshClientObj.load_system_host_keys() |
|
419 | sshClientObj.load_system_host_keys() | |
418 | sshClientObj.set_missing_host_key_policy(paramiko.WarningPolicy()) |
|
420 | sshClientObj.set_missing_host_key_policy(paramiko.WarningPolicy()) | |
419 |
|
421 | |||
420 | try: |
|
422 | try: | |
421 | sshClientObj.connect(server, username=username, password=password, port=port) |
|
423 | sshClientObj.connect(server, username=username, password=password, port=port) | |
422 | except : |
|
424 | except : | |
423 | print "SSH username or password are incorrect: %s" |
|
425 | print "SSH username or password are incorrect: %s" | |
424 | self.status = 0 |
|
426 | self.status = 0 | |
425 | return 0 |
|
427 | return 0 | |
426 |
|
428 | |||
427 | scpClientObj = scp.SCPClient(sshClientObj.get_transport(), socket_timeout=30) |
|
429 | scpClientObj = scp.SCPClient(sshClientObj.get_transport(), socket_timeout=30) | |
428 |
|
430 | |||
429 | if remotefolder == None: |
|
431 | if remotefolder == None: | |
430 | remotefolder = self.pwd() |
|
432 | remotefolder = self.pwd() | |
431 |
|
433 | |||
432 | self.server = server |
|
434 | self.server = server | |
433 | self.username = username |
|
435 | self.username = username | |
434 | self.password = password |
|
436 | self.password = password | |
435 | self.__sshClientObj = sshClientObj |
|
437 | self.__sshClientObj = sshClientObj | |
436 | self.__scpClientObj = scpClientObj |
|
438 | self.__scpClientObj = scpClientObj | |
437 | self.status = 1 |
|
439 | self.status = 1 | |
438 |
|
440 | |||
439 | if not self.cd(remotefolder): |
|
441 | if not self.cd(remotefolder): | |
440 | raise ValueError, "Could not access to remote folder: %s" %remotefolder |
|
442 | raise ValueError, "Could not access to remote folder: %s" %remotefolder | |
441 | return 0 |
|
443 | return 0 | |
442 |
|
444 | |||
443 | self.remotefolder = remotefolder |
|
445 | self.remotefolder = remotefolder | |
444 |
|
446 | |||
445 | return 1 |
|
447 | return 1 | |
446 |
|
448 | |||
447 | def close(self): |
|
449 | def close(self): | |
448 | """ |
|
450 | """ | |
449 | Close connection to remote server |
|
451 | Close connection to remote server | |
450 | """ |
|
452 | """ | |
451 | if not self.status: |
|
453 | if not self.status: | |
452 | return 0 |
|
454 | return 0 | |
453 |
|
455 | |||
454 | self.__sshObj.close() |
|
456 | self.__sshObj.close() | |
455 |
|
457 | |||
456 | def __execute(self, command): |
|
458 | def __execute(self, command): | |
457 | """ |
|
459 | """ | |
458 | __execute a command on remote server |
|
460 | __execute a command on remote server | |
459 |
|
461 | |||
460 | Input: |
|
462 | Input: | |
461 | command - Exmaple 'ls -l' |
|
463 | command - Exmaple 'ls -l' | |
462 |
|
464 | |||
463 | Return: |
|
465 | Return: | |
464 | 0 in error case else 1 |
|
466 | 0 in error case else 1 | |
465 | """ |
|
467 | """ | |
466 | if not self.status: |
|
468 | if not self.status: | |
467 | return 0 |
|
469 | return 0 | |
468 |
|
470 | |||
469 | stdin, stdout, stderr = self.__sshClientObj.exec_command(command) |
|
471 | stdin, stdout, stderr = self.__sshClientObj.exec_command(command) | |
470 |
|
472 | |||
471 | result = stderr.readlines() |
|
473 | result = stderr.readlines() | |
472 | if len(result) > 1: |
|
474 | if len(result) > 1: | |
473 | return 0 |
|
475 | return 0 | |
474 |
|
476 | |||
475 | result = stdout.readlines() |
|
477 | result = stdout.readlines() | |
476 | if len(result) > 1: |
|
478 | if len(result) > 1: | |
477 | return result[0][:-1] |
|
479 | return result[0][:-1] | |
478 |
|
480 | |||
479 | return 1 |
|
481 | return 1 | |
480 |
|
482 | |||
481 | def mkdir(self, remotefolder): |
|
483 | def mkdir(self, remotefolder): | |
482 | """ |
|
484 | """ | |
483 | mkdir is used to make a new directory in remote server |
|
485 | mkdir is used to make a new directory in remote server | |
484 |
|
486 | |||
485 | Input: |
|
487 | Input: | |
486 | remotefolder - directory name |
|
488 | remotefolder - directory name | |
487 |
|
489 | |||
488 | Return: |
|
490 | Return: | |
489 | 0 in error case else 1 |
|
491 | 0 in error case else 1 | |
490 | """ |
|
492 | """ | |
491 |
|
493 | |||
492 | command = 'mkdir %s' %remotefolder |
|
494 | command = 'mkdir %s' %remotefolder | |
493 |
|
495 | |||
494 | return self.__execute(command) |
|
496 | return self.__execute(command) | |
495 |
|
497 | |||
496 | def pwd(self): |
|
498 | def pwd(self): | |
497 |
|
499 | |||
498 | command = 'pwd' |
|
500 | command = 'pwd' | |
499 |
|
501 | |||
500 | return self.__execute(command) |
|
502 | return self.__execute(command) | |
501 |
|
503 | |||
502 | def cd(self, remotefolder): |
|
504 | def cd(self, remotefolder): | |
503 | """ |
|
505 | """ | |
504 | cd is used to change remote working directory on server |
|
506 | cd is used to change remote working directory on server | |
505 |
|
507 | |||
506 | Input: |
|
508 | Input: | |
507 | remotefolder - current working directory |
|
509 | remotefolder - current working directory | |
508 |
|
510 | |||
509 | Affects: |
|
511 | Affects: | |
510 | self.remotefolder |
|
512 | self.remotefolder | |
511 |
|
513 | |||
512 | Return: |
|
514 | Return: | |
513 | 0 in case of error else 1 |
|
515 | 0 in case of error else 1 | |
514 | """ |
|
516 | """ | |
515 | if not self.status: |
|
517 | if not self.status: | |
516 | return 0 |
|
518 | return 0 | |
517 |
|
519 | |||
518 | if remotefolder == self.remotefolder: |
|
520 | if remotefolder == self.remotefolder: | |
519 | return 1 |
|
521 | return 1 | |
520 |
|
522 | |||
521 | chk_command = "cd %s; pwd" %remotefolder |
|
523 | chk_command = "cd %s; pwd" %remotefolder | |
522 | mkdir_command = "mkdir %s" %remotefolder |
|
524 | mkdir_command = "mkdir %s" %remotefolder | |
523 |
|
525 | |||
524 | if not self.__execute(chk_command): |
|
526 | if not self.__execute(chk_command): | |
525 | if not self.__execute(mkdir_command): |
|
527 | if not self.__execute(mkdir_command): | |
526 | self.remotefolder = None |
|
528 | self.remotefolder = None | |
527 | return 0 |
|
529 | return 0 | |
528 |
|
530 | |||
529 | self.remotefolder = remotefolder |
|
531 | self.remotefolder = remotefolder | |
530 |
|
532 | |||
531 | return 1 |
|
533 | return 1 | |
532 |
|
534 | |||
533 | def sendFile(self, fullfilename): |
|
535 | def sendFile(self, fullfilename): | |
534 |
|
536 | |||
535 | if not self.status: |
|
537 | if not self.status: | |
536 | return 0 |
|
538 | return 0 | |
537 |
|
539 | |||
538 | try: |
|
540 | try: | |
539 | self.__scpClientObj.put(fullfilename, remote_path=self.remotefolder) |
|
541 | self.__scpClientObj.put(fullfilename, remote_path=self.remotefolder) | |
540 | except: |
|
542 | except: | |
541 | return 0 |
|
543 | return 0 | |
542 |
|
544 | |||
543 | remotefile = os.path.join(self.remotefolder, os.path.split(fullfilename)[-1]) |
|
545 | remotefile = os.path.join(self.remotefolder, os.path.split(fullfilename)[-1]) | |
544 | command = 'chmod 775 %s' %remotefile |
|
546 | command = 'chmod 775 %s' %remotefile | |
545 |
|
547 | |||
546 | return self.__execute(command) |
|
548 | return self.__execute(command) | |
547 |
|
549 | |||
548 | class SendToServer(ProcessingUnit): |
|
550 | class SendToServer(ProcessingUnit): | |
549 |
|
551 | |||
550 | def __init__(self): |
|
552 | def __init__(self): | |
551 |
|
553 | |||
552 | ProcessingUnit.__init__(self) |
|
554 | ProcessingUnit.__init__(self) | |
553 |
|
555 | |||
554 | self.isConfig = False |
|
556 | self.isConfig = False | |
555 | self.clientObj = None |
|
557 | self.clientObj = None | |
556 |
|
558 | |||
557 | def setup(self, server, username, password, remotefolder, localfolder, ext='.png', period=60, protocol='ftp', **kwargs): |
|
559 | def setup(self, server, username, password, remotefolder, localfolder, ext='.png', period=60, protocol='ftp', **kwargs): | |
558 |
|
560 | |||
559 | self.clientObj = None |
|
561 | self.clientObj = None | |
560 | self.localfolder = localfolder |
|
562 | self.localfolder = localfolder | |
561 | self.ext = ext |
|
563 | self.ext = ext | |
562 | self.period = period |
|
564 | self.period = period | |
563 |
|
565 | |||
564 | if str.lower(protocol) == 'ftp': |
|
566 | if str.lower(protocol) == 'ftp': | |
565 | self.clientObj = FTPClient(server, username, password, remotefolder, period) |
|
567 | self.clientObj = FTPClient(server, username, password, remotefolder, period) | |
566 |
|
568 | |||
567 | if str.lower(protocol) == 'ssh': |
|
569 | if str.lower(protocol) == 'ssh': | |
568 | self.clientObj = SSHClient(server, username, password, remotefolder, period) |
|
570 | self.clientObj = SSHClient(server, username, password, remotefolder, period) | |
569 |
|
571 | |||
570 | if not self.clientObj: |
|
572 | if not self.clientObj: | |
571 | raise ValueError, "%s has been chosen as remote access protocol but it is not valid" %protocol |
|
573 | raise ValueError, "%s has been chosen as remote access protocol but it is not valid" %protocol | |
572 |
|
574 | |||
573 | self.clientObj.start() |
|
575 | self.clientObj.start() | |
574 |
|
576 | |||
575 | def findFiles(self): |
|
577 | def findFiles(self): | |
576 |
|
578 | |||
577 | filenameList = glob.glob1(self.localfolder, '*%s' %self.ext) |
|
579 | if not type(self.localfolder) == list: | |
|
580 | folderList = [self.localfolder] | |||
|
581 | else: | |||
|
582 | folderList = self.localfolder | |||
|
583 | ||||
|
584 | fullfilenameList = [] | |||
|
585 | ||||
|
586 | for thisFolder in folderList: | |||
|
587 | ||||
|
588 | filenameList = glob.glob1(thisFolder, '*%s' %self.ext) | |||
578 |
|
589 | |||
579 | if len(filenameList) < 1: |
|
590 | if len(filenameList) < 1: | |
580 | return [] |
|
591 | continue | |
581 |
|
592 | |||
582 | fullfilenameList = [os.path.join(self.localfolder, thisFile) for thisFile in filenameList] |
|
593 | for thisFile in filenameList: | |
|
594 | fullfilename = os.path.join(thisFolder, thisFile) | |||
|
595 | fullfilenameList.append(fullfilename) | |||
583 |
|
596 | |||
584 | return fullfilenameList |
|
597 | return fullfilenameList | |
585 |
|
598 | |||
586 | def run(self, **kwargs): |
|
599 | def run(self, **kwargs): | |
587 |
|
600 | |||
588 | if not self.isConfig: |
|
601 | if not self.isConfig: | |
589 | self.init = time.time() |
|
602 | self.init = time.time() | |
590 | self.setup(**kwargs) |
|
603 | self.setup(**kwargs) | |
591 | self.isConfig = True |
|
604 | self.isConfig = True | |
592 |
|
605 | |||
593 | if time.time() - self.init >= self.period: |
|
606 | if time.time() - self.init >= self.period: | |
594 | fullfilenameList = self.findFiles() |
|
607 | fullfilenameList = self.findFiles() | |
595 | self.clientObj.updateFileList(fullfilenameList) |
|
608 | ||
|
609 | if self.clientObj.updateFileList(fullfilenameList): | |||
|
610 | print "[Remote Server]: Sending the next files ", str(fullfilenameList) | |||
|
611 | ||||
596 | self.init = time.time() |
|
612 | self.init = time.time() | |
597 |
|
613 | |||
598 | def close(self): |
|
614 | def close(self): | |
599 | print "[Remote Server] Stopping thread" |
|
615 | print "[Remote Server] Stopping thread" | |
600 | self.clientObj.stop() |
|
616 | self.clientObj.stop() | |
601 |
|
617 | |||
602 |
|
618 | |||
603 | class FTP(object): |
|
619 | class FTP(object): | |
604 | """ |
|
620 | """ | |
605 | Ftp is a public class used to define custom File Transfer Protocol from "ftplib" python module |
|
621 | Ftp is a public class used to define custom File Transfer Protocol from "ftplib" python module | |
606 |
|
622 | |||
607 | Non-standard Python modules used: None |
|
623 | Non-standard Python modules used: None | |
608 |
|
624 | |||
609 | Written by "Daniel Suarez":mailto:daniel.suarez@jro.igp.gob.pe Oct. 26, 2010 |
|
625 | Written by "Daniel Suarez":mailto:daniel.suarez@jro.igp.gob.pe Oct. 26, 2010 | |
610 | """ |
|
626 | """ | |
611 |
|
627 | |||
612 | def __init__(self,server = None, username=None, password=None, remotefolder=None): |
|
628 | def __init__(self,server = None, username=None, password=None, remotefolder=None): | |
613 | """ |
|
629 | """ | |
614 | This method is used to setting parameters for FTP and establishing connection to remote server |
|
630 | This method is used to setting parameters for FTP and establishing connection to remote server | |
615 |
|
631 | |||
616 | Inputs: |
|
632 | Inputs: | |
617 | server - remote server IP Address |
|
633 | server - remote server IP Address | |
618 |
|
634 | |||
619 | username - remote server Username |
|
635 | username - remote server Username | |
620 |
|
636 | |||
621 | password - remote server password |
|
637 | password - remote server password | |
622 |
|
638 | |||
623 | remotefolder - remote server current working directory |
|
639 | remotefolder - remote server current working directory | |
624 |
|
640 | |||
625 | Return: void |
|
641 | Return: void | |
626 |
|
642 | |||
627 | Affects: |
|
643 | Affects: | |
628 | self.status - in Error Case or Connection Failed this parameter is set to 1 else 0 |
|
644 | self.status - in Error Case or Connection Failed this parameter is set to 1 else 0 | |
629 |
|
645 | |||
630 | self.folderList - sub-folder list of remote folder |
|
646 | self.folderList - sub-folder list of remote folder | |
631 |
|
647 | |||
632 | self.fileList - file list of remote folder |
|
648 | self.fileList - file list of remote folder | |
633 |
|
649 | |||
634 |
|
650 | |||
635 | """ |
|
651 | """ | |
636 |
|
652 | |||
637 | if ((server == None) and (username==None) and (password==None) and (remotefolder==None)): |
|
653 | if ((server == None) and (username==None) and (password==None) and (remotefolder==None)): | |
638 | server, username, password, remotefolder = self.parmsByDefault() |
|
654 | server, username, password, remotefolder = self.parmsByDefault() | |
639 |
|
655 | |||
640 | self.server = server |
|
656 | self.server = server | |
641 | self.username = username |
|
657 | self.username = username | |
642 | self.password = password |
|
658 | self.password = password | |
643 | self.remotefolder = remotefolder |
|
659 | self.remotefolder = remotefolder | |
644 | self.file = None |
|
660 | self.file = None | |
645 | self.ftp = None |
|
661 | self.ftp = None | |
646 | self.status = 0 |
|
662 | self.status = 0 | |
647 |
|
663 | |||
648 | try: |
|
664 | try: | |
649 | self.ftp = ftplib.FTP(self.server) |
|
665 | self.ftp = ftplib.FTP(self.server) | |
650 | self.ftp.login(self.username,self.password) |
|
666 | self.ftp.login(self.username,self.password) | |
651 | self.ftp.cwd(self.remotefolder) |
|
667 | self.ftp.cwd(self.remotefolder) | |
652 | # print 'Connect to FTP Server: Successfully' |
|
668 | # print 'Connect to FTP Server: Successfully' | |
653 |
|
669 | |||
654 | except ftplib.all_errors: |
|
670 | except ftplib.all_errors: | |
655 | print 'Error FTP Service' |
|
671 | print 'Error FTP Service' | |
656 | self.status = 1 |
|
672 | self.status = 1 | |
657 | return |
|
673 | return | |
658 |
|
674 | |||
659 |
|
675 | |||
660 |
|
676 | |||
661 | self.dirList = [] |
|
677 | self.dirList = [] | |
662 |
|
678 | |||
663 | try: |
|
679 | try: | |
664 | self.dirList = self.ftp.nlst() |
|
680 | self.dirList = self.ftp.nlst() | |
665 |
|
681 | |||
666 | except ftplib.error_perm, resp: |
|
682 | except ftplib.error_perm, resp: | |
667 | if str(resp) == "550 No files found": |
|
683 | if str(resp) == "550 No files found": | |
668 | print "no files in this directory" |
|
684 | print "no files in this directory" | |
669 | self.status = 1 |
|
685 | self.status = 1 | |
670 | return |
|
686 | return | |
671 |
|
687 | |||
672 | except ftplib.all_errors: |
|
688 | except ftplib.all_errors: | |
673 | print 'Error Displaying Dir-Files' |
|
689 | print 'Error Displaying Dir-Files' | |
674 | self.status = 1 |
|
690 | self.status = 1 | |
675 | return |
|
691 | return | |
676 |
|
692 | |||
677 | self.fileList = [] |
|
693 | self.fileList = [] | |
678 | self.folderList = [] |
|
694 | self.folderList = [] | |
679 | #only for test |
|
695 | #only for test | |
680 | for f in self.dirList: |
|
696 | for f in self.dirList: | |
681 | name, ext = os.path.splitext(f) |
|
697 | name, ext = os.path.splitext(f) | |
682 | if ext != '': |
|
698 | if ext != '': | |
683 | self.fileList.append(f) |
|
699 | self.fileList.append(f) | |
684 | # print 'filename: %s - size: %d'%(f,self.ftp.size(f)) |
|
700 | # print 'filename: %s - size: %d'%(f,self.ftp.size(f)) | |
685 |
|
701 | |||
686 | def parmsByDefault(self): |
|
702 | def parmsByDefault(self): | |
687 | server = 'jro-app.igp.gob.pe' |
|
703 | server = 'jro-app.igp.gob.pe' | |
688 | username = 'wmaster' |
|
704 | username = 'wmaster' | |
689 | password = 'mst2010vhf' |
|
705 | password = 'mst2010vhf' | |
690 | remotefolder = '/home/wmaster/graficos' |
|
706 | remotefolder = '/home/wmaster/graficos' | |
691 |
|
707 | |||
692 | return server, username, password, remotefolder |
|
708 | return server, username, password, remotefolder | |
693 |
|
709 | |||
694 |
|
710 | |||
695 | def mkd(self,dirname): |
|
711 | def mkd(self,dirname): | |
696 | """ |
|
712 | """ | |
697 | mkd is used to make directory in remote server |
|
713 | mkd is used to make directory in remote server | |
698 |
|
714 | |||
699 | Input: |
|
715 | Input: | |
700 | dirname - directory name |
|
716 | dirname - directory name | |
701 |
|
717 | |||
702 | Return: |
|
718 | Return: | |
703 | 1 in error case else 0 |
|
719 | 1 in error case else 0 | |
704 | """ |
|
720 | """ | |
705 | try: |
|
721 | try: | |
706 | self.ftp.mkd(dirname) |
|
722 | self.ftp.mkd(dirname) | |
707 | except: |
|
723 | except: | |
708 | print 'Error creating remote folder:%s'%dirname |
|
724 | print 'Error creating remote folder:%s'%dirname | |
709 | return 1 |
|
725 | return 1 | |
710 |
|
726 | |||
711 | return 0 |
|
727 | return 0 | |
712 |
|
728 | |||
713 |
|
729 | |||
714 | def delete(self,filename): |
|
730 | def delete(self,filename): | |
715 | """ |
|
731 | """ | |
716 | delete is used to delete file in current working directory of remote server |
|
732 | delete is used to delete file in current working directory of remote server | |
717 |
|
733 | |||
718 | Input: |
|
734 | Input: | |
719 | filename - filename to delete in remote folder |
|
735 | filename - filename to delete in remote folder | |
720 |
|
736 | |||
721 | Return: |
|
737 | Return: | |
722 | 1 in error case else 0 |
|
738 | 1 in error case else 0 | |
723 | """ |
|
739 | """ | |
724 |
|
740 | |||
725 | try: |
|
741 | try: | |
726 | self.ftp.delete(filename) |
|
742 | self.ftp.delete(filename) | |
727 | except: |
|
743 | except: | |
728 | print 'Error deleting remote file:%s'%filename |
|
744 | print 'Error deleting remote file:%s'%filename | |
729 | return 1 |
|
745 | return 1 | |
730 |
|
746 | |||
731 | return 0 |
|
747 | return 0 | |
732 |
|
748 | |||
733 | def download(self,filename,localfolder): |
|
749 | def download(self,filename,localfolder): | |
734 | """ |
|
750 | """ | |
735 | download is used to downloading file from remote folder into local folder |
|
751 | download is used to downloading file from remote folder into local folder | |
736 |
|
752 | |||
737 | Inputs: |
|
753 | Inputs: | |
738 | filename - filename to donwload |
|
754 | filename - filename to donwload | |
739 |
|
755 | |||
740 | localfolder - directory local to store filename |
|
756 | localfolder - directory local to store filename | |
741 |
|
757 | |||
742 | Returns: |
|
758 | Returns: | |
743 | self.status - 1 in error case else 0 |
|
759 | self.status - 1 in error case else 0 | |
744 | """ |
|
760 | """ | |
745 |
|
761 | |||
746 | self.status = 0 |
|
762 | self.status = 0 | |
747 |
|
763 | |||
748 |
|
764 | |||
749 | if not(filename in self.fileList): |
|
765 | if not(filename in self.fileList): | |
750 | print 'filename:%s not exists'%filename |
|
766 | print 'filename:%s not exists'%filename | |
751 | self.status = 1 |
|
767 | self.status = 1 | |
752 | return self.status |
|
768 | return self.status | |
753 |
|
769 | |||
754 | newfilename = os.path.join(localfolder,filename) |
|
770 | newfilename = os.path.join(localfolder,filename) | |
755 |
|
771 | |||
756 | self.file = open(newfilename, 'wb') |
|
772 | self.file = open(newfilename, 'wb') | |
757 |
|
773 | |||
758 | try: |
|
774 | try: | |
759 | print 'Download: ' + filename |
|
775 | print 'Download: ' + filename | |
760 | self.ftp.retrbinary('RETR ' + filename, self.__handleDownload) |
|
776 | self.ftp.retrbinary('RETR ' + filename, self.__handleDownload) | |
761 | print 'Download Complete' |
|
777 | print 'Download Complete' | |
762 | except ftplib.all_errors: |
|
778 | except ftplib.all_errors: | |
763 | print 'Error Downloading ' + filename |
|
779 | print 'Error Downloading ' + filename | |
764 | self.status = 1 |
|
780 | self.status = 1 | |
765 | return self.status |
|
781 | return self.status | |
766 |
|
782 | |||
767 | self.file.close() |
|
783 | self.file.close() | |
768 |
|
784 | |||
769 | return self.status |
|
785 | return self.status | |
770 |
|
786 | |||
771 |
|
787 | |||
772 | def __handleDownload(self,block): |
|
788 | def __handleDownload(self,block): | |
773 | """ |
|
789 | """ | |
774 | __handleDownload is used to handle writing file |
|
790 | __handleDownload is used to handle writing file | |
775 | """ |
|
791 | """ | |
776 | self.file.write(block) |
|
792 | self.file.write(block) | |
777 |
|
793 | |||
778 |
|
794 | |||
779 | def upload(self,filename,remotefolder=None): |
|
795 | def upload(self,filename,remotefolder=None): | |
780 | """ |
|
796 | """ | |
781 | upload is used to uploading local file to remote directory |
|
797 | upload is used to uploading local file to remote directory | |
782 |
|
798 | |||
783 | Inputs: |
|
799 | Inputs: | |
784 | filename - full path name of local file to store in remote directory |
|
800 | filename - full path name of local file to store in remote directory | |
785 |
|
801 | |||
786 | remotefolder - remote directory |
|
802 | remotefolder - remote directory | |
787 |
|
803 | |||
788 | Returns: |
|
804 | Returns: | |
789 | self.status - 1 in error case else 0 |
|
805 | self.status - 1 in error case else 0 | |
790 | """ |
|
806 | """ | |
791 |
|
807 | |||
792 | if remotefolder == None: |
|
808 | if remotefolder == None: | |
793 | remotefolder = self.remotefolder |
|
809 | remotefolder = self.remotefolder | |
794 |
|
810 | |||
795 | self.status = 0 |
|
811 | self.status = 0 | |
796 |
|
812 | |||
797 | try: |
|
813 | try: | |
798 | self.ftp.cwd(remotefolder) |
|
814 | self.ftp.cwd(remotefolder) | |
799 |
|
815 | |||
800 | self.file = open(filename, 'rb') |
|
816 | self.file = open(filename, 'rb') | |
801 |
|
817 | |||
802 | (head, tail) = os.path.split(filename) |
|
818 | (head, tail) = os.path.split(filename) | |
803 |
|
819 | |||
804 | command = "STOR " + tail |
|
820 | command = "STOR " + tail | |
805 |
|
821 | |||
806 | print 'Uploading: ' + tail |
|
822 | print 'Uploading: ' + tail | |
807 | self.ftp.storbinary(command, self.file) |
|
823 | self.ftp.storbinary(command, self.file) | |
808 | print 'Upload Completed' |
|
824 | print 'Upload Completed' | |
809 |
|
825 | |||
810 | except ftplib.all_errors: |
|
826 | except ftplib.all_errors: | |
811 | print 'Error Uploading ' + tail |
|
827 | print 'Error Uploading ' + tail | |
812 | self.status = 1 |
|
828 | self.status = 1 | |
813 | return self.status |
|
829 | return self.status | |
814 |
|
830 | |||
815 | self.file.close() |
|
831 | self.file.close() | |
816 |
|
832 | |||
817 | #back to initial directory in __init__() |
|
833 | #back to initial directory in __init__() | |
818 | self.ftp.cwd(self.remotefolder) |
|
834 | self.ftp.cwd(self.remotefolder) | |
819 |
|
835 | |||
820 | return self.status |
|
836 | return self.status | |
821 |
|
837 | |||
822 |
|
838 | |||
823 | def dir(self,remotefolder): |
|
839 | def dir(self,remotefolder): | |
824 | """ |
|
840 | """ | |
825 | dir is used to change working directory of remote server and get folder and file list |
|
841 | dir is used to change working directory of remote server and get folder and file list | |
826 |
|
842 | |||
827 | Input: |
|
843 | Input: | |
828 | remotefolder - current working directory |
|
844 | remotefolder - current working directory | |
829 |
|
845 | |||
830 | Affects: |
|
846 | Affects: | |
831 | self.fileList - file list of working directory |
|
847 | self.fileList - file list of working directory | |
832 |
|
848 | |||
833 | Return: |
|
849 | Return: | |
834 | infoList - list with filenames and size of file in bytes |
|
850 | infoList - list with filenames and size of file in bytes | |
835 |
|
851 | |||
836 | self.folderList - folder list |
|
852 | self.folderList - folder list | |
837 | """ |
|
853 | """ | |
838 |
|
854 | |||
839 | self.remotefolder = remotefolder |
|
855 | self.remotefolder = remotefolder | |
840 | print 'Change to ' + self.remotefolder |
|
856 | print 'Change to ' + self.remotefolder | |
841 | try: |
|
857 | try: | |
842 | self.ftp.cwd(remotefolder) |
|
858 | self.ftp.cwd(remotefolder) | |
843 | except ftplib.all_errors: |
|
859 | except ftplib.all_errors: | |
844 | print 'Error Change to ' + self.remotefolder |
|
860 | print 'Error Change to ' + self.remotefolder | |
845 | infoList = None |
|
861 | infoList = None | |
846 | self.folderList = None |
|
862 | self.folderList = None | |
847 | return infoList,self.folderList |
|
863 | return infoList,self.folderList | |
848 |
|
864 | |||
849 | self.dirList = [] |
|
865 | self.dirList = [] | |
850 |
|
866 | |||
851 | try: |
|
867 | try: | |
852 | self.dirList = self.ftp.nlst() |
|
868 | self.dirList = self.ftp.nlst() | |
853 |
|
869 | |||
854 | except ftplib.error_perm, resp: |
|
870 | except ftplib.error_perm, resp: | |
855 | if str(resp) == "550 No files found": |
|
871 | if str(resp) == "550 No files found": | |
856 | print "no files in this directory" |
|
872 | print "no files in this directory" | |
857 | infoList = None |
|
873 | infoList = None | |
858 | self.folderList = None |
|
874 | self.folderList = None | |
859 | return infoList,self.folderList |
|
875 | return infoList,self.folderList | |
860 | except ftplib.all_errors: |
|
876 | except ftplib.all_errors: | |
861 | print 'Error Displaying Dir-Files' |
|
877 | print 'Error Displaying Dir-Files' | |
862 | infoList = None |
|
878 | infoList = None | |
863 | self.folderList = None |
|
879 | self.folderList = None | |
864 | return infoList,self.folderList |
|
880 | return infoList,self.folderList | |
865 |
|
881 | |||
866 | infoList = [] |
|
882 | infoList = [] | |
867 | self.fileList = [] |
|
883 | self.fileList = [] | |
868 | self.folderList = [] |
|
884 | self.folderList = [] | |
869 | for f in self.dirList: |
|
885 | for f in self.dirList: | |
870 | name,ext = os.path.splitext(f) |
|
886 | name,ext = os.path.splitext(f) | |
871 | if ext != '': |
|
887 | if ext != '': | |
872 | self.fileList.append(f) |
|
888 | self.fileList.append(f) | |
873 | value = (f,self.ftp.size(f)) |
|
889 | value = (f,self.ftp.size(f)) | |
874 | infoList.append(value) |
|
890 | infoList.append(value) | |
875 |
|
891 | |||
876 | if ext == '': |
|
892 | if ext == '': | |
877 | self.folderList.append(f) |
|
893 | self.folderList.append(f) | |
878 |
|
894 | |||
879 | return infoList,self.folderList |
|
895 | return infoList,self.folderList | |
880 |
|
896 | |||
881 |
|
897 | |||
882 | def close(self): |
|
898 | def close(self): | |
883 | """ |
|
899 | """ | |
884 | close is used to close and end FTP connection |
|
900 | close is used to close and end FTP connection | |
885 |
|
901 | |||
886 | Inputs: None |
|
902 | Inputs: None | |
887 |
|
903 | |||
888 | Return: void |
|
904 | Return: void | |
889 |
|
905 | |||
890 | """ |
|
906 | """ | |
891 | self.ftp.close() |
|
907 | self.ftp.close() | |
892 |
|
908 | |||
893 | class SendByFTP(Operation): |
|
909 | class SendByFTP(Operation): | |
894 |
|
910 | |||
895 | def __init__(self): |
|
911 | def __init__(self): | |
896 |
|
912 | |||
897 | self.status = 1 |
|
913 | self.status = 1 | |
898 | self.counter = 0 |
|
914 | self.counter = 0 | |
899 |
|
915 | |||
900 | def error_print(self, ValueError): |
|
916 | def error_print(self, ValueError): | |
901 |
|
917 | |||
902 | print ValueError, 'Error FTP' |
|
918 | print ValueError, 'Error FTP' | |
903 | print "don't worry the program is running..." |
|
919 | print "don't worry the program is running..." | |
904 |
|
920 | |||
905 | def worker_ftp(self, server, username, password, remotefolder, filenameList): |
|
921 | def worker_ftp(self, server, username, password, remotefolder, filenameList): | |
906 |
|
922 | |||
907 | self.ftpClientObj = FTP(server, username, password, remotefolder) |
|
923 | self.ftpClientObj = FTP(server, username, password, remotefolder) | |
908 | for filename in filenameList: |
|
924 | for filename in filenameList: | |
909 | self.ftpClientObj.upload(filename) |
|
925 | self.ftpClientObj.upload(filename) | |
910 | self.ftpClientObj.close() |
|
926 | self.ftpClientObj.close() | |
911 |
|
927 | |||
912 | def ftp_thread(self, server, username, password, remotefolder): |
|
928 | def ftp_thread(self, server, username, password, remotefolder): | |
913 | if not(self.status): |
|
929 | if not(self.status): | |
914 | return |
|
930 | return | |
915 |
|
931 | |||
916 | p = multiprocessing.Process(target=self.worker_ftp, args=(server, username, password, remotefolder, self.filenameList,)) |
|
932 | p = multiprocessing.Process(target=self.worker_ftp, args=(server, username, password, remotefolder, self.filenameList,)) | |
917 | p.start() |
|
933 | p.start() | |
918 |
|
934 | |||
919 | p.join(3) |
|
935 | p.join(3) | |
920 |
|
936 | |||
921 | if p.is_alive(): |
|
937 | if p.is_alive(): | |
922 | p.terminate() |
|
938 | p.terminate() | |
923 | p.join() |
|
939 | p.join() | |
924 | print 'killing ftp process...' |
|
940 | print 'killing ftp process...' | |
925 | self.status = 0 |
|
941 | self.status = 0 | |
926 | return |
|
942 | return | |
927 |
|
943 | |||
928 | self.status = 1 |
|
944 | self.status = 1 | |
929 | return |
|
945 | return | |
930 |
|
946 | |||
931 | def filterByExt(self, ext, localfolder): |
|
947 | def filterByExt(self, ext, localfolder): | |
932 | fnameList = glob.glob1(localfolder,ext) |
|
948 | fnameList = glob.glob1(localfolder,ext) | |
933 | self.filenameList = [os.path.join(localfolder,x) for x in fnameList] |
|
949 | self.filenameList = [os.path.join(localfolder,x) for x in fnameList] | |
934 |
|
950 | |||
935 | if len(self.filenameList) == 0: |
|
951 | if len(self.filenameList) == 0: | |
936 | self.status = 0 |
|
952 | self.status = 0 | |
937 |
|
953 | |||
938 | def run(self, dataOut, ext, localfolder, remotefolder, server, username, password, period=1): |
|
954 | def run(self, dataOut, ext, localfolder, remotefolder, server, username, password, period=1): | |
939 |
|
955 | |||
940 | self.counter += 1 |
|
956 | self.counter += 1 | |
941 | if self.counter >= period: |
|
957 | if self.counter >= period: | |
942 | self.filterByExt(ext, localfolder) |
|
958 | self.filterByExt(ext, localfolder) | |
943 |
|
959 | |||
944 | self.ftp_thread(server, username, password, remotefolder) |
|
960 | self.ftp_thread(server, username, password, remotefolder) | |
945 |
|
961 | |||
946 | self.counter = 0 |
|
962 | self.counter = 0 | |
947 |
|
963 | |||
948 | self.status = 1 |
|
964 | self.status = 1 | |
949 |
|
965 |
General Comments 0
You need to be logged in to leave comments.
Login now