@@ -1,1034 +1,1051 | |||
|
1 | 1 | ''' |
|
2 | 2 | Created on September , 2012 |
|
3 | 3 | @author: |
|
4 | 4 | ''' |
|
5 | 5 | from xml.etree.ElementTree import Element, SubElement |
|
6 | 6 | from xml.etree import ElementTree as ET |
|
7 | 7 | from xml.dom import minidom |
|
8 | 8 | |
|
9 | 9 | #import datetime |
|
10 | 10 | from model import * |
|
11 | 11 | |
|
12 | 12 | import ast |
|
13 | 13 | |
|
14 | 14 | def prettify(elem): |
|
15 | 15 | """Return a pretty-printed XML string for the Element. |
|
16 | 16 | """ |
|
17 | 17 | rough_string = ET.tostring(elem, 'utf-8') |
|
18 | 18 | reparsed = minidom.parseString(rough_string) |
|
19 | 19 | return reparsed.toprettyxml(indent=" ") |
|
20 | 20 | |
|
21 | 21 | class ParameterConf(): |
|
22 | 22 | |
|
23 | 23 | id = None |
|
24 | 24 | name = None |
|
25 | 25 | value = None |
|
26 | 26 | format = None |
|
27 | 27 | |
|
28 | 28 | __formated_value = None |
|
29 | 29 | |
|
30 | 30 | ELEMENTNAME = 'Parameter' |
|
31 | 31 | |
|
32 | 32 | def __init__(self): |
|
33 | 33 | |
|
34 | 34 | self.format = 'str' |
|
35 | 35 | |
|
36 | 36 | def getElementName(self): |
|
37 | 37 | |
|
38 | 38 | return self.ELEMENTNAME |
|
39 | 39 | |
|
40 | 40 | def getValue(self): |
|
41 | 41 | |
|
42 | 42 | if self.__formated_value != None: |
|
43 | 43 | |
|
44 | 44 | return self.__formated_value |
|
45 | 45 | |
|
46 | 46 | value = self.value |
|
47 | 47 | |
|
48 | 48 | if self.format == 'bool': |
|
49 | 49 | value = int(value) |
|
50 | 50 | |
|
51 | 51 | if self.format == 'list': |
|
52 | 52 | strList = value.split(',') |
|
53 | 53 | |
|
54 | 54 | self.__formated_value = strList |
|
55 | 55 | |
|
56 | 56 | return self.__formated_value |
|
57 | 57 | |
|
58 | 58 | if self.format == 'intlist': |
|
59 | 59 | """ |
|
60 | 60 | Example: |
|
61 | 61 | value = (0,1,2) |
|
62 | 62 | """ |
|
63 | value = value.replace('(', '') | |
|
64 | value = value.replace(')', '') | |
|
65 | ||
|
66 | value = value.replace('[', '') | |
|
67 | value = value.replace(']', '') | |
|
68 | ||
|
63 | 69 | strList = value.split(',') |
|
64 | 70 | intList = [int(x) for x in strList] |
|
65 | 71 | |
|
66 | 72 | self.__formated_value = intList |
|
67 | 73 | |
|
68 | 74 | return self.__formated_value |
|
69 | 75 | |
|
70 | 76 | if self.format == 'floatlist': |
|
71 | 77 | """ |
|
72 | 78 | Example: |
|
73 | 79 | value = (0.5, 1.4, 2.7) |
|
74 | 80 | """ |
|
81 | ||
|
82 | value = value.replace('(', '') | |
|
83 | value = value.replace(')', '') | |
|
84 | ||
|
85 | value = value.replace('[', '') | |
|
86 | value = value.replace(']', '') | |
|
87 | ||
|
75 | 88 | strList = value.split(',') |
|
76 | 89 | floatList = [float(x) for x in strList] |
|
77 | 90 | |
|
78 | 91 | self.__formated_value = floatList |
|
79 | 92 | |
|
80 | 93 | return self.__formated_value |
|
81 | 94 | |
|
82 | 95 | if self.format == 'date': |
|
83 | 96 | strList = value.split('/') |
|
84 | 97 | intList = [int(x) for x in strList] |
|
85 | 98 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
86 | 99 | |
|
87 | 100 | self.__formated_value = date |
|
88 | 101 | |
|
89 | 102 | return self.__formated_value |
|
90 | 103 | |
|
91 | 104 | if self.format == 'time': |
|
92 | 105 | strList = value.split(':') |
|
93 | 106 | intList = [int(x) for x in strList] |
|
94 | 107 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
95 | 108 | |
|
96 | 109 | self.__formated_value = time |
|
97 | 110 | |
|
98 | 111 | return self.__formated_value |
|
99 | 112 | |
|
100 | 113 | if self.format == 'pairslist': |
|
101 | 114 | """ |
|
102 | 115 | Example: |
|
103 | 116 | value = (0,1),(1,2) |
|
104 | 117 | """ |
|
105 | 118 | |
|
106 | 119 | value = value.replace('(', '') |
|
107 | 120 | value = value.replace(')', '') |
|
108 | 121 | |
|
122 | value = value.replace('[', '') | |
|
123 | value = value.replace(']', '') | |
|
124 | ||
|
109 | 125 | strList = value.split(',') |
|
110 | 126 | intList = [int(item) for item in strList] |
|
111 | 127 | pairList = [] |
|
112 | 128 | for i in range(len(intList)/2): |
|
113 | 129 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
114 | 130 | |
|
115 | 131 | self.__formated_value = pairList |
|
116 | 132 | |
|
117 | 133 | return self.__formated_value |
|
118 | 134 | |
|
119 | 135 | if self.format == 'multilist': |
|
120 | 136 | """ |
|
121 | 137 | Example: |
|
122 | 138 | value = (0,1,2),(3,4,5) |
|
123 | 139 | """ |
|
124 | 140 | multiList = ast.literal_eval(value) |
|
125 | 141 | |
|
126 | 142 | self.__formated_value = multiList |
|
127 | 143 | |
|
128 | 144 | return self.__formated_value |
|
129 | 145 | |
|
130 | 146 | format_func = eval(self.format) |
|
131 | 147 | |
|
132 | 148 | self.__formated_value = format_func(value) |
|
133 | 149 | |
|
134 | 150 | return self.__formated_value |
|
135 | 151 | |
|
136 | 152 | def setup(self, id, name, value, format='str'): |
|
137 | 153 | |
|
138 | 154 | self.id = id |
|
139 | 155 | self.name = name |
|
140 | 156 | self.value = str(value) |
|
141 | 157 | self.format = str.lower(format) |
|
142 | 158 | |
|
143 | 159 | def update(self, name, value, format='str'): |
|
144 | 160 | |
|
145 | 161 | self.name = name |
|
146 | 162 | self.value = str(value) |
|
147 | 163 | self.format = format |
|
148 | 164 | |
|
149 | 165 | def makeXml(self, opElement): |
|
150 | 166 | |
|
151 | 167 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
152 | 168 | parmElement.set('id', str(self.id)) |
|
153 | 169 | parmElement.set('name', self.name) |
|
154 | 170 | parmElement.set('value', self.value) |
|
155 | 171 | parmElement.set('format', self.format) |
|
156 | 172 | |
|
157 | 173 | def readXml(self, parmElement): |
|
158 | 174 | |
|
159 | 175 | self.id = parmElement.get('id') |
|
160 | 176 | self.name = parmElement.get('name') |
|
161 | 177 | self.value = parmElement.get('value') |
|
162 | 178 | self.format = str.lower(parmElement.get('format')) |
|
163 | 179 | |
|
164 | 180 | #Compatible with old signal chain version |
|
165 | 181 | if self.format == 'int' and self.name == 'idfigure': |
|
166 | 182 | self.name = 'id' |
|
167 | 183 | |
|
168 | 184 | def printattr(self): |
|
169 | 185 | |
|
170 | 186 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
171 | 187 | |
|
172 | 188 | class OperationConf(): |
|
173 | 189 | |
|
174 | 190 | id = None |
|
175 | 191 | name = None |
|
176 | 192 | priority = None |
|
177 | 193 | type = None |
|
178 | 194 | |
|
179 | 195 | parmConfObjList = [] |
|
180 | 196 | |
|
181 | 197 | ELEMENTNAME = 'Operation' |
|
182 | 198 | |
|
183 | 199 | def __init__(self): |
|
184 | 200 | |
|
185 | 201 | self.id = 0 |
|
186 | 202 | self.name = None |
|
187 | 203 | self.priority = None |
|
188 | 204 | self.type = 'self' |
|
189 | 205 | |
|
190 | 206 | |
|
191 | 207 | def __getNewId(self): |
|
192 | 208 | |
|
193 | 209 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
194 | 210 | |
|
195 | 211 | def getElementName(self): |
|
196 | 212 | |
|
197 | 213 | return self.ELEMENTNAME |
|
198 | 214 | |
|
199 | 215 | def getParameterObjList(self): |
|
200 | 216 | |
|
201 | 217 | return self.parmConfObjList |
|
202 | 218 | |
|
203 | 219 | def getParameterObj(self, parameterName): |
|
204 | 220 | |
|
205 | 221 | for parmConfObj in self.parmConfObjList: |
|
206 | 222 | |
|
207 | 223 | if parmConfObj.name != parameterName: |
|
208 | 224 | continue |
|
209 | 225 | |
|
210 | 226 | return parmConfObj |
|
211 | 227 | |
|
212 | 228 | return None |
|
213 | 229 | |
|
214 | 230 | def getParameterObjfromValue(self,parameterValue): |
|
215 | 231 | for parmConfObj in self.parmConfObjList: |
|
216 | 232 | |
|
217 | 233 | if parmConfObj.getValue() != parameterValue: |
|
218 | 234 | continue |
|
219 | 235 | |
|
220 | 236 | return parmConfObj.getValue() |
|
221 | 237 | |
|
222 | 238 | return None |
|
223 | 239 | |
|
224 | 240 | def getParameterValue(self, parameterName): |
|
225 | 241 | |
|
226 | 242 | parameterObj = self.getParameterObj(parameterName) |
|
227 | 243 | value = parameterObj.getValue() |
|
228 | 244 | |
|
229 | 245 | return value |
|
230 | 246 | |
|
231 | 247 | def setup(self, id, name, priority, type): |
|
232 | 248 | |
|
233 | 249 | self.id = id |
|
234 | 250 | self.name = name |
|
235 | 251 | self.type = type |
|
236 | 252 | self.priority = priority |
|
237 | 253 | |
|
238 | 254 | self.parmConfObjList = [] |
|
239 | 255 | |
|
240 | 256 | def removeParameters(self): |
|
241 | 257 | |
|
242 | 258 | for obj in self.parmConfObjList: |
|
243 | 259 | del obj |
|
244 | 260 | |
|
245 | 261 | self.parmConfObjList = [] |
|
246 | 262 | |
|
247 | 263 | def addParameter(self, name, value, format='str'): |
|
248 | 264 | |
|
249 | 265 | id = self.__getNewId() |
|
250 | 266 | |
|
251 | 267 | parmConfObj = ParameterConf() |
|
252 | 268 | parmConfObj.setup(id, name, value, format) |
|
253 | 269 | |
|
254 | 270 | self.parmConfObjList.append(parmConfObj) |
|
255 | 271 | |
|
256 | 272 | return parmConfObj |
|
257 | 273 | |
|
258 | 274 | def changeParameter(self, name, value, format='str'): |
|
259 | 275 | |
|
260 | 276 | parmConfObj = self.getParameterObj(name) |
|
261 | 277 | parmConfObj.update(name, value, format) |
|
262 | 278 | |
|
263 | 279 | return parmConfObj |
|
264 | 280 | |
|
265 | 281 | def makeXml(self, upElement): |
|
266 | 282 | |
|
267 | 283 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
268 | 284 | opElement.set('id', str(self.id)) |
|
269 | 285 | opElement.set('name', self.name) |
|
270 | 286 | opElement.set('type', self.type) |
|
271 | 287 | opElement.set('priority', str(self.priority)) |
|
272 | 288 | |
|
273 | 289 | for parmConfObj in self.parmConfObjList: |
|
274 | 290 | parmConfObj.makeXml(opElement) |
|
275 | 291 | |
|
276 | 292 | def readXml(self, opElement): |
|
277 | 293 | |
|
278 | 294 | self.id = opElement.get('id') |
|
279 | 295 | self.name = opElement.get('name') |
|
280 | 296 | self.type = opElement.get('type') |
|
281 | 297 | self.priority = opElement.get('priority') |
|
282 | 298 | |
|
283 | 299 | #Compatible with old signal chain version |
|
284 | 300 | #Use of 'run' method instead 'init' |
|
285 | 301 | if self.type == 'self' and self.name == 'init': |
|
286 | 302 | self.name = 'run' |
|
287 | 303 | |
|
288 | 304 | self.parmConfObjList = [] |
|
289 | 305 | |
|
290 | 306 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
291 | 307 | |
|
292 | 308 | for parmElement in parmElementList: |
|
293 | 309 | parmConfObj = ParameterConf() |
|
294 | 310 | parmConfObj.readXml(parmElement) |
|
295 | 311 | |
|
296 | 312 | #Compatible with old signal chain version |
|
297 | 313 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
298 | 314 | if self.type != 'self' and self.name == 'Plot': |
|
299 | 315 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
300 | 316 | self.name = parmConfObj.value |
|
301 | 317 | continue |
|
302 | 318 | |
|
303 | 319 | self.parmConfObjList.append(parmConfObj) |
|
304 | 320 | |
|
305 | 321 | def printattr(self): |
|
306 | 322 | |
|
307 | 323 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
308 | 324 | self.id, |
|
309 | 325 | self.name, |
|
310 | 326 | self.type, |
|
311 | 327 | self.priority) |
|
312 | 328 | |
|
313 | 329 | for parmConfObj in self.parmConfObjList: |
|
314 | 330 | parmConfObj.printattr() |
|
315 | 331 | |
|
316 | 332 | def createObject(self): |
|
317 | 333 | |
|
318 | 334 | if self.type == 'self': |
|
319 | 335 | raise ValueError, "This operation type cannot be created" |
|
320 | 336 | |
|
321 | 337 | if self.type == 'external' or self.type == 'other': |
|
322 | 338 | className = eval(self.name) |
|
323 | 339 | opObj = className() |
|
324 | 340 | |
|
325 | 341 | return opObj |
|
326 | 342 | |
|
327 | 343 | class ProcUnitConf(): |
|
328 | 344 | |
|
329 | 345 | id = None |
|
330 | 346 | name = None |
|
331 | 347 | datatype = None |
|
332 | 348 | inputId = None |
|
333 | 349 | parentId = None |
|
334 | 350 | |
|
335 | 351 | opConfObjList = [] |
|
336 | 352 | |
|
337 | 353 | procUnitObj = None |
|
338 | 354 | opObjList = [] |
|
339 | 355 | |
|
340 | 356 | ELEMENTNAME = 'ProcUnit' |
|
341 | 357 | |
|
342 | 358 | def __init__(self): |
|
343 | 359 | |
|
344 | 360 | self.id = None |
|
345 | 361 | self.datatype = None |
|
346 | 362 | self.name = None |
|
347 | 363 | self.inputId = None |
|
348 | 364 | |
|
349 | 365 | self.opConfObjList = [] |
|
350 | 366 | |
|
351 | 367 | self.procUnitObj = None |
|
352 | 368 | self.opObjDict = {} |
|
353 | 369 | |
|
354 | 370 | def __getPriority(self): |
|
355 | 371 | |
|
356 | 372 | return len(self.opConfObjList)+1 |
|
357 | 373 | |
|
358 | 374 | def __getNewId(self): |
|
359 | 375 | |
|
360 | 376 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
361 | 377 | |
|
362 | 378 | def getElementName(self): |
|
363 | 379 | |
|
364 | 380 | return self.ELEMENTNAME |
|
365 | 381 | |
|
366 | 382 | def getId(self): |
|
367 | 383 | |
|
368 | 384 | return str(self.id) |
|
369 | 385 | |
|
370 | 386 | def getInputId(self): |
|
371 | 387 | |
|
372 | 388 | return str(self.inputId) |
|
373 | 389 | |
|
374 | 390 | def getOperationObjList(self): |
|
375 | 391 | |
|
376 | 392 | return self.opConfObjList |
|
377 | 393 | |
|
378 | 394 | def getOperationObj(self, name=None): |
|
379 | 395 | |
|
380 | 396 | for opConfObj in self.opConfObjList: |
|
381 | 397 | |
|
382 | 398 | if opConfObj.name != name: |
|
383 | 399 | continue |
|
384 | 400 | |
|
385 | 401 | return opConfObj |
|
386 | 402 | |
|
387 | 403 | return None |
|
388 | 404 | |
|
389 | 405 | def getOpObjfromParamValue(self,value=None): |
|
390 | 406 | |
|
391 | 407 | for opConfObj in self.opConfObjList: |
|
392 | 408 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
393 | 409 | continue |
|
394 | 410 | return opConfObj |
|
395 | 411 | return None |
|
396 | 412 | |
|
397 | 413 | def getProcUnitObj(self): |
|
398 | 414 | |
|
399 | 415 | return self.procUnitObj |
|
400 | 416 | |
|
401 | 417 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
402 | 418 | |
|
403 | 419 | self.id = id |
|
404 | 420 | self.name = name |
|
405 | 421 | self.datatype = datatype |
|
406 | 422 | self.inputId = inputId |
|
407 | 423 | self.parentId = parentId |
|
408 | 424 | |
|
409 | 425 | self.opConfObjList = [] |
|
410 | 426 | |
|
411 | 427 | self.addOperation(name='run', optype='self') |
|
412 | 428 | |
|
413 | 429 | def removeOperations(self): |
|
414 | 430 | |
|
415 | 431 | for obj in self.opConfObjList: |
|
416 | 432 | del obj |
|
417 | 433 | |
|
418 | 434 | self.opConfObjList = [] |
|
419 | 435 | self.addOperation(name='run') |
|
420 | 436 | |
|
421 | 437 | def addParameter(self, **kwargs): |
|
422 | 438 | ''' |
|
423 | 439 | Add parameters to "run" operation |
|
424 | 440 | ''' |
|
425 | 441 | opObj = self.opConfObjList[0] |
|
426 | 442 | |
|
427 | 443 | opObj.addParameter(**kwargs) |
|
428 | 444 | |
|
429 | 445 | return opObj |
|
430 | 446 | |
|
431 | 447 | def addOperation(self, name, optype='self'): |
|
432 | 448 | |
|
433 | 449 | id = self.__getNewId() |
|
434 | 450 | priority = self.__getPriority() |
|
435 | 451 | |
|
436 | 452 | opConfObj = OperationConf() |
|
437 | 453 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
438 | 454 | |
|
439 | 455 | self.opConfObjList.append(opConfObj) |
|
440 | 456 | |
|
441 | 457 | return opConfObj |
|
442 | 458 | |
|
443 | 459 | def makeXml(self, procUnitElement): |
|
444 | 460 | |
|
445 | 461 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
446 | 462 | upElement.set('id', str(self.id)) |
|
447 | 463 | upElement.set('name', self.name) |
|
448 | 464 | upElement.set('datatype', self.datatype) |
|
449 | 465 | upElement.set('inputId', str(self.inputId)) |
|
450 | 466 | |
|
451 | 467 | for opConfObj in self.opConfObjList: |
|
452 | 468 | opConfObj.makeXml(upElement) |
|
453 | 469 | |
|
454 | 470 | def readXml(self, upElement): |
|
455 | 471 | |
|
456 | 472 | self.id = upElement.get('id') |
|
457 | 473 | self.name = upElement.get('name') |
|
458 | 474 | self.datatype = upElement.get('datatype') |
|
459 | 475 | self.inputId = upElement.get('inputId') |
|
460 | 476 | |
|
461 | 477 | self.opConfObjList = [] |
|
462 | 478 | |
|
463 | 479 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
464 | 480 | |
|
465 | 481 | for opElement in opElementList: |
|
466 | 482 | opConfObj = OperationConf() |
|
467 | 483 | opConfObj.readXml(opElement) |
|
468 | 484 | self.opConfObjList.append(opConfObj) |
|
469 | 485 | |
|
470 | 486 | def printattr(self): |
|
471 | 487 | |
|
472 | 488 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
473 | 489 | self.id, |
|
474 | 490 | self.name, |
|
475 | 491 | self.datatype, |
|
476 | 492 | self.inputId) |
|
477 | 493 | |
|
478 | 494 | for opConfObj in self.opConfObjList: |
|
479 | 495 | opConfObj.printattr() |
|
480 | 496 | |
|
481 | 497 | def createObjects(self): |
|
482 | 498 | |
|
483 | 499 | className = eval(self.name) |
|
484 | 500 | procUnitObj = className() |
|
485 | 501 | |
|
486 | 502 | for opConfObj in self.opConfObjList: |
|
487 | 503 | |
|
488 | 504 | if opConfObj.type == 'self': |
|
489 | 505 | continue |
|
490 | 506 | |
|
491 | 507 | opObj = opConfObj.createObject() |
|
492 | 508 | |
|
493 | 509 | self.opObjDict[opConfObj.id] = opObj |
|
494 | 510 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
495 | 511 | |
|
496 | 512 | self.procUnitObj = procUnitObj |
|
497 | 513 | |
|
498 | 514 | return procUnitObj |
|
499 | 515 | |
|
500 | 516 | def run(self): |
|
501 | 517 | |
|
502 | 518 | finalSts = False |
|
503 | 519 | |
|
504 | 520 | for opConfObj in self.opConfObjList: |
|
505 | 521 | |
|
506 | 522 | kwargs = {} |
|
507 | 523 | for parmConfObj in opConfObj.getParameterObjList(): |
|
508 | 524 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
509 | 525 | continue |
|
510 | 526 | |
|
511 | 527 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
512 | 528 | |
|
513 | 529 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
514 | 530 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
515 | 531 | opName = opConfObj.name, |
|
516 | 532 | opId = opConfObj.id, |
|
517 | 533 | **kwargs) |
|
518 | 534 | finalSts = finalSts or sts |
|
519 | 535 | |
|
520 | 536 | return finalSts |
|
521 | 537 | |
|
522 | 538 | def close(self): |
|
523 | 539 | |
|
524 | 540 | for opConfObj in self.opConfObjList: |
|
525 | 541 | if opConfObj.type == 'self': |
|
526 | 542 | continue |
|
527 | 543 | |
|
528 | 544 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
529 | 545 | opObj.close() |
|
530 | 546 | |
|
531 | 547 | self.procUnitObj.close() |
|
532 | 548 | |
|
533 | 549 | return |
|
534 | 550 | |
|
535 | 551 | class ReadUnitConf(ProcUnitConf): |
|
536 | 552 | |
|
537 | 553 | path = None |
|
538 | 554 | startDate = None |
|
539 | 555 | endDate = None |
|
540 | 556 | startTime = None |
|
541 | 557 | endTime = None |
|
542 | 558 | |
|
543 | 559 | ELEMENTNAME = 'ReadUnit' |
|
544 | 560 | |
|
545 | 561 | def __init__(self): |
|
546 | 562 | |
|
547 | 563 | self.id = None |
|
548 | 564 | self.datatype = None |
|
549 | 565 | self.name = None |
|
550 | 566 | self.inputId = 0 |
|
551 | 567 | |
|
552 | 568 | self.opConfObjList = [] |
|
553 | 569 | self.opObjList = [] |
|
554 | 570 | |
|
555 | 571 | def getElementName(self): |
|
556 | 572 | |
|
557 | 573 | return self.ELEMENTNAME |
|
558 | 574 | |
|
559 | 575 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
560 | 576 | |
|
561 | 577 | self.id = id |
|
562 | 578 | self.name = name |
|
563 | 579 | self.datatype = datatype |
|
564 | 580 | |
|
565 | 581 | self.path = path |
|
566 | 582 | self.startDate = startDate |
|
567 | 583 | self.endDate = endDate |
|
568 | 584 | self.startTime = startTime |
|
569 | 585 | self.endTime = endTime |
|
570 | 586 | |
|
571 | 587 | self.addRunOperation(**kwargs) |
|
572 | 588 | |
|
573 | 589 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, **kwargs): |
|
574 | 590 | |
|
575 | 591 | self.datatype = datatype |
|
576 | 592 | self.path = path |
|
577 | 593 | self.startDate = startDate |
|
578 | 594 | self.endDate = endDate |
|
579 | 595 | self.startTime = startTime |
|
580 | 596 | self.endTime = endTime |
|
581 | 597 | |
|
582 | 598 | self.updateRunOperation(**kwargs) |
|
583 | 599 | |
|
584 | 600 | def addRunOperation(self, **kwargs): |
|
585 | 601 | |
|
586 | 602 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
587 | 603 | |
|
588 | 604 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
589 | 605 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
590 | 606 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
591 | 607 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
592 | 608 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
593 | 609 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
594 | 610 | |
|
595 | 611 | for key, value in kwargs.items(): |
|
596 | 612 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
597 | 613 | |
|
598 | 614 | return opObj |
|
599 | 615 | |
|
600 | 616 | def updateRunOperation(self, **kwargs): |
|
601 | 617 | |
|
602 | 618 | opObj = self.getOperationObj(name = 'run') |
|
603 | 619 | opObj.removeParameters() |
|
604 | 620 | |
|
605 | 621 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
606 | 622 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
607 | 623 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
608 | 624 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
609 | 625 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
610 | 626 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
611 | 627 | |
|
612 | 628 | for key, value in kwargs.items(): |
|
613 | 629 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
614 | 630 | |
|
615 | 631 | return opObj |
|
616 | 632 | |
|
617 | 633 | class Project(): |
|
618 | 634 | |
|
619 | 635 | id = None |
|
620 | 636 | name = None |
|
621 | 637 | description = None |
|
622 | 638 | # readUnitConfObjList = None |
|
623 | 639 | procUnitConfObjDict = None |
|
624 | 640 | |
|
625 | 641 | ELEMENTNAME = 'Project' |
|
626 | 642 | |
|
627 | 643 | def __init__(self, control=None, dataq=None): |
|
628 | 644 | |
|
629 | 645 | self.id = None |
|
630 | 646 | self.name = None |
|
631 | 647 | self.description = None |
|
632 | 648 | |
|
633 | 649 | self.procUnitConfObjDict = {} |
|
634 | 650 | |
|
635 | 651 | #global data_q |
|
636 | 652 | #data_q = dataq |
|
637 | 653 | |
|
638 | 654 | if control==None: |
|
639 | 655 | control = {} |
|
640 | 656 | control['stop'] = False |
|
641 | 657 | control['pause'] = False |
|
642 | 658 | |
|
643 | 659 | self.control = control |
|
644 | 660 | |
|
645 | 661 | def __getNewId(self): |
|
646 | 662 | |
|
647 | 663 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
648 | 664 | |
|
649 | 665 | return str(id) |
|
650 | 666 | |
|
651 | 667 | def getElementName(self): |
|
652 | 668 | |
|
653 | 669 | return self.ELEMENTNAME |
|
654 | 670 | |
|
655 | 671 | def getId(self): |
|
656 | 672 | |
|
657 | 673 | return self.id |
|
658 | 674 | |
|
659 | 675 | def setup(self, id, name, description): |
|
660 | 676 | |
|
661 | 677 | self.id = id |
|
662 | 678 | self.name = name |
|
663 | 679 | self.description = description |
|
664 | 680 | |
|
665 | 681 | def update(self, name, description): |
|
666 | 682 | |
|
667 | 683 | self.name = name |
|
668 | 684 | self.description = description |
|
669 | 685 | |
|
670 | 686 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
671 | 687 | |
|
672 | 688 | #Compatible with old signal chain version |
|
673 | 689 | if datatype==None and name==None: |
|
674 | 690 | raise ValueError, "datatype or name should be defined" |
|
675 | 691 | |
|
676 | 692 | if name==None: |
|
677 | 693 | if 'Reader' in datatype: |
|
678 | 694 | name = datatype |
|
679 | 695 | else: |
|
680 | 696 | name = '%sReader' %(datatype) |
|
681 | 697 | |
|
682 | 698 | if datatype==None: |
|
683 | 699 | datatype = name.replace('Reader','') |
|
684 | 700 | |
|
685 | 701 | id = self.__getNewId() |
|
686 | 702 | |
|
687 | 703 | readUnitConfObj = ReadUnitConf() |
|
688 | 704 | readUnitConfObj.setup(id, name, datatype, parentId=self.id, **kwargs) |
|
689 | 705 | |
|
690 | 706 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
691 | 707 | |
|
692 | 708 | return readUnitConfObj |
|
693 | 709 | |
|
694 | 710 | def addProcUnit(self, inputId=0, datatype=None, name=None): |
|
695 | 711 | |
|
696 | 712 | #Compatible with old signal chain version |
|
697 | 713 | if datatype==None and name==None: |
|
698 | 714 | raise ValueError, "datatype or name should be defined" |
|
699 | 715 | |
|
700 | 716 | if name==None: |
|
701 | 717 | if 'Proc' in datatype: |
|
702 | 718 | name = datatype |
|
703 | 719 | else: |
|
704 | 720 | name = '%sProc' %(datatype) |
|
705 | 721 | |
|
706 | 722 | if datatype==None: |
|
707 | 723 | datatype = name.replace('Proc','') |
|
708 | 724 | |
|
709 | 725 | id = self.__getNewId() |
|
710 | 726 | |
|
711 | 727 | procUnitConfObj = ProcUnitConf() |
|
712 | 728 | procUnitConfObj.setup(id, name, datatype, inputId, parentId=self.id) |
|
713 | 729 | |
|
714 | 730 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
715 | 731 | |
|
716 | 732 | return procUnitConfObj |
|
717 | 733 | |
|
718 | 734 | def getReadUnitId(self): |
|
719 | 735 | |
|
720 | 736 | readUnitConfObj = self.getReadUnitObj() |
|
721 | 737 | |
|
722 | 738 | return readUnitConfObj.id |
|
723 | 739 | |
|
724 | 740 | def getReadUnitObj(self): |
|
725 | 741 | |
|
726 | 742 | for obj in self.procUnitConfObjDict.values(): |
|
727 | 743 | if obj.getElementName() == "ReadUnit": |
|
728 | 744 | return obj |
|
729 | 745 | |
|
730 | 746 | return None |
|
731 | 747 | |
|
732 | 748 | def getProcUnitObj(self, id): |
|
733 | 749 | |
|
734 | 750 | return self.procUnitConfObjDict[id] |
|
735 | 751 | |
|
736 | 752 | def getProcUnitObjByName(self, name): |
|
737 | 753 | |
|
738 | 754 | for obj in self.procUnitConfObjDict.values(): |
|
739 | 755 | if obj.name == name: |
|
740 | 756 | return obj |
|
741 | 757 | |
|
742 | 758 | return None |
|
743 | 759 | |
|
744 | 760 | def makeXml(self): |
|
745 | 761 | |
|
746 | 762 | projectElement = Element('Project') |
|
747 | 763 | projectElement.set('id', str(self.id)) |
|
748 | 764 | projectElement.set('name', self.name) |
|
749 | 765 | projectElement.set('description', self.description) |
|
750 | 766 | |
|
751 | 767 | # for readUnitConfObj in self.readUnitConfObjList: |
|
752 | 768 | # readUnitConfObj.makeXml(projectElement) |
|
753 | 769 | |
|
754 | 770 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
755 | 771 | procUnitConfObj.makeXml(projectElement) |
|
756 | 772 | |
|
757 | 773 | self.projectElement = projectElement |
|
758 | 774 | |
|
759 | 775 | def writeXml(self, filename): |
|
760 | 776 | |
|
761 | 777 | self.makeXml() |
|
762 | 778 | |
|
763 | 779 | #print prettify(self.projectElement) |
|
764 | 780 | |
|
765 | 781 | ElementTree(self.projectElement).write(filename, method='xml') |
|
766 | 782 | |
|
767 | 783 | def readXml(self, filename): |
|
768 | 784 | |
|
769 | 785 | #tree = ET.parse(filename) |
|
770 | 786 | self.projectElement = None |
|
771 | 787 | # self.readUnitConfObjList = [] |
|
772 | 788 | self.procUnitConfObjDict = {} |
|
773 | 789 | |
|
774 | 790 | self.projectElement = ElementTree().parse(filename) |
|
775 | 791 | |
|
776 | 792 | self.project = self.projectElement.tag |
|
777 | 793 | |
|
778 | 794 | self.id = self.projectElement.get('id') |
|
779 | 795 | self.name = self.projectElement.get('name') |
|
780 | 796 | self.description = self.projectElement.get('description') |
|
781 | 797 | |
|
782 | 798 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
783 | 799 | |
|
784 | 800 | for readUnitElement in readUnitElementList: |
|
785 | 801 | readUnitConfObj = ReadUnitConf() |
|
786 | 802 | readUnitConfObj.readXml(readUnitElement) |
|
787 | 803 | |
|
788 | 804 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
789 | 805 | |
|
790 | 806 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
791 | 807 | |
|
792 | 808 | for procUnitElement in procUnitElementList: |
|
793 | 809 | procUnitConfObj = ProcUnitConf() |
|
794 | 810 | procUnitConfObj.readXml(procUnitElement) |
|
795 | 811 | |
|
796 | 812 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
797 | 813 | |
|
798 | 814 | def printattr(self): |
|
799 | 815 | |
|
800 | 816 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
801 | 817 | self.name, |
|
802 | 818 | self.description) |
|
803 | 819 | |
|
804 | 820 | # for readUnitConfObj in self.readUnitConfObjList: |
|
805 | 821 | # readUnitConfObj.printattr() |
|
806 | 822 | |
|
807 | 823 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
808 | 824 | procUnitConfObj.printattr() |
|
809 | 825 | |
|
810 | 826 | def createObjects(self): |
|
811 | 827 | |
|
812 | 828 | # for readUnitConfObj in self.readUnitConfObjList: |
|
813 | 829 | # readUnitConfObj.createObjects() |
|
814 | 830 | |
|
815 | 831 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
816 | 832 | procUnitConfObj.createObjects() |
|
817 | 833 | |
|
818 | 834 | def __connect(self, objIN, thisObj): |
|
819 | 835 | |
|
820 | 836 | thisObj.setInput(objIN.getOutputObj()) |
|
821 | 837 | |
|
822 | 838 | def connectObjects(self): |
|
823 | 839 | |
|
824 | 840 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
825 | 841 | |
|
826 | 842 | inputId = thisPUConfObj.getInputId() |
|
827 | 843 | |
|
828 | 844 | if int(inputId) == 0: |
|
829 | 845 | continue |
|
830 | 846 | |
|
831 | 847 | #Get input object |
|
832 | 848 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
833 | 849 | puObjIN = puConfINObj.getProcUnitObj() |
|
834 | 850 | |
|
835 | 851 | #Get current object |
|
836 | 852 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
837 | 853 | |
|
838 | 854 | self.__connect(puObjIN, thisPUObj) |
|
839 | 855 | |
|
840 | 856 | def run(self): |
|
841 | 857 | |
|
842 | 858 | # for readUnitConfObj in self.readUnitConfObjList: |
|
843 | 859 | # readUnitConfObj.run() |
|
844 | 860 | |
|
845 | 861 | print "*"*40 |
|
846 | 862 | print " Starting SIGNAL CHAIN PROCESSING " |
|
847 | 863 | print "*"*40 |
|
848 | 864 | |
|
849 | 865 | |
|
850 | 866 | keyList = self.procUnitConfObjDict.keys() |
|
851 | 867 | keyList.sort() |
|
852 | 868 | |
|
853 | 869 | while(True): |
|
854 | 870 | |
|
855 | 871 | finalSts = False |
|
856 | 872 | |
|
857 | 873 | for procKey in keyList: |
|
858 | 874 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
859 | 875 | |
|
860 | 876 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
861 | 877 | sts = procUnitConfObj.run() |
|
862 | 878 | finalSts = finalSts or sts |
|
863 | 879 | |
|
864 | 880 | #If every process unit finished so end process |
|
865 | 881 | if not(finalSts): |
|
866 | 882 | print "Every process unit have finished" |
|
867 | 883 | break |
|
868 | 884 | |
|
869 | 885 | if self.control['pause']: |
|
870 |
print "P |
|
|
886 | print "Process suspended" | |
|
871 | 887 | |
|
872 | 888 | while True: |
|
873 | 889 | time.sleep(0.1) |
|
874 | 890 | |
|
875 | 891 | if not self.control['pause']: |
|
876 | 892 | break |
|
877 | 893 | |
|
878 | 894 | if self.control['stop']: |
|
879 | 895 | break |
|
896 | print "Process reinitialized" | |
|
880 | 897 | |
|
881 | 898 | if self.control['stop']: |
|
882 | 899 | print "Stopping process" |
|
883 | 900 | break |
|
884 | 901 | |
|
885 | 902 | #Closing every process |
|
886 | 903 | for procKey in keyList: |
|
887 | 904 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
888 | 905 | procUnitConfObj.close() |
|
889 | 906 | |
|
890 | 907 | print "Process stopped" |
|
891 | 908 | |
|
892 | 909 | def start(self, filename): |
|
893 | 910 | |
|
894 | 911 | self.writeXml(filename) |
|
895 | 912 | self.readXml(filename) |
|
896 | 913 | |
|
897 | 914 | self.createObjects() |
|
898 | 915 | self.connectObjects() |
|
899 | 916 | self.run() |
|
900 | 917 | |
|
901 | 918 | if __name__ == '__main__': |
|
902 | 919 | |
|
903 | 920 | desc = "Segundo Test" |
|
904 | 921 | filename = "schain.xml" |
|
905 | 922 | |
|
906 | 923 | controllerObj = Project() |
|
907 | 924 | |
|
908 | 925 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
909 | 926 | |
|
910 | 927 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
911 | 928 | path='data/rawdata/', |
|
912 | 929 | startDate='2011/01/01', |
|
913 | 930 | endDate='2012/12/31', |
|
914 | 931 | startTime='00:00:00', |
|
915 | 932 | endTime='23:59:59', |
|
916 | 933 | online=1, |
|
917 | 934 | walk=1) |
|
918 | 935 | |
|
919 | 936 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') |
|
920 | 937 | |
|
921 | 938 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
922 | 939 | |
|
923 | 940 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
924 | 941 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
925 | 942 | |
|
926 | 943 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
927 | 944 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
928 | 945 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
929 | 946 | |
|
930 | 947 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
931 | 948 | opObj12.addParameter(name='n', value='10', format='int') |
|
932 | 949 | |
|
933 | 950 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
934 | 951 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
935 | 952 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
936 | 953 | |
|
937 | 954 | |
|
938 | 955 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
939 | 956 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
940 | 957 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
941 | 958 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
942 | 959 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
943 | 960 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
944 | 961 | |
|
945 | 962 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') |
|
946 | 963 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
947 | 964 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
948 | 965 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
949 | 966 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
950 | 967 | |
|
951 | 968 | |
|
952 | 969 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) |
|
953 | 970 | # |
|
954 | 971 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') |
|
955 | 972 | # opObj12.addParameter(name='n', value='2', format='int') |
|
956 | 973 | # opObj12.addParameter(name='overlapping', value='1', format='int') |
|
957 | 974 | # |
|
958 | 975 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) |
|
959 | 976 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') |
|
960 | 977 | # |
|
961 | 978 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') |
|
962 | 979 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
963 | 980 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') |
|
964 | 981 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
965 | 982 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
966 | 983 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
967 | 984 | |
|
968 | 985 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') |
|
969 | 986 | # opObj11.addParameter(name='idfigure', value='10', format='int') |
|
970 | 987 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') |
|
971 | 988 | ## opObj11.addParameter(name='xmin', value='21', format='float') |
|
972 | 989 | ## opObj11.addParameter(name='xmax', value='22', format='float') |
|
973 | 990 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
974 | 991 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
975 | 992 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
976 | 993 | # opObj11.addParameter(name='timerange', value=str(60), format='int') |
|
977 | 994 | |
|
978 | 995 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
979 | 996 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') |
|
980 | 997 | # |
|
981 | 998 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
982 | 999 | # opObj12.addParameter(name='n', value='2', format='int') |
|
983 | 1000 | # |
|
984 | 1001 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
985 | 1002 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
986 | 1003 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
987 | 1004 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
988 | 1005 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
989 | 1006 | # |
|
990 | 1007 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
991 | 1008 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') |
|
992 | 1009 | # |
|
993 | 1010 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
994 | 1011 | # opObj12.addParameter(name='n', value='2', format='int') |
|
995 | 1012 | # |
|
996 | 1013 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
997 | 1014 | # opObj11.addParameter(name='idfigure', value='3', format='int') |
|
998 | 1015 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
999 | 1016 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1000 | 1017 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1001 | 1018 | |
|
1002 | 1019 | |
|
1003 | 1020 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') |
|
1004 | 1021 | # opObj12.addParameter(name='ncode', value='2', format='int') |
|
1005 | 1022 | # opObj12.addParameter(name='nbauds', value='8', format='int') |
|
1006 | 1023 | # opObj12.addParameter(name='code0', value='001110011', format='int') |
|
1007 | 1024 | # opObj12.addParameter(name='code1', value='001110011', format='int') |
|
1008 | 1025 | |
|
1009 | 1026 | |
|
1010 | 1027 | |
|
1011 | 1028 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) |
|
1012 | 1029 | # |
|
1013 | 1030 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') |
|
1014 | 1031 | # opObj21.addParameter(name='n', value='2', format='int') |
|
1015 | 1032 | # |
|
1016 | 1033 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') |
|
1017 | 1034 | # opObj11.addParameter(name='idfigure', value='4', format='int') |
|
1018 | 1035 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') |
|
1019 | 1036 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1020 | 1037 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1021 | 1038 | |
|
1022 | 1039 | print "Escribiendo el archivo XML" |
|
1023 | 1040 | |
|
1024 | 1041 | controllerObj.writeXml(filename) |
|
1025 | 1042 | |
|
1026 | 1043 | print "Leyendo el archivo XML" |
|
1027 | 1044 | controllerObj.readXml(filename) |
|
1028 | 1045 | #controllerObj.printattr() |
|
1029 | 1046 | |
|
1030 | 1047 | controllerObj.createObjects() |
|
1031 | 1048 | controllerObj.connectObjects() |
|
1032 | 1049 | controllerObj.run() |
|
1033 | 1050 | |
|
1034 | 1051 | No newline at end of file |
@@ -1,6480 +1,6543 | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """ |
|
3 | 3 | Module implementing MainWindow. |
|
4 | 4 | #+++++++++++++GUI V1++++++++++++++# |
|
5 | 5 | @author: AlexanderValdezPortocarrero Γ±_Γ± |
|
6 | 6 | """ |
|
7 | 7 | import os, sys, time |
|
8 | 8 | import datetime |
|
9 | 9 | import Queue |
|
10 | 10 | from PyQt4.QtGui import QMainWindow |
|
11 | 11 | from PyQt4.QtCore import pyqtSignature |
|
12 | 12 | from PyQt4.QtCore import pyqtSignal |
|
13 | 13 | from PyQt4 import QtCore |
|
14 | 14 | from PyQt4 import QtGui |
|
15 | 15 | |
|
16 | 16 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
17 | 17 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
18 | 18 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
19 | 19 | from schainpy.controller import Project |
|
20 | 20 | |
|
21 | 21 | from modelProperties import treeModel |
|
22 | 22 | from collections import OrderedDict |
|
23 | 23 | from os.path import expanduser |
|
24 | 24 | #from CodeWarrior.Standard_Suite import file |
|
25 | 25 | from comm import * |
|
26 | 26 | |
|
27 | 27 | from schainpy.gui.figures import tools |
|
28 | import numpy | |
|
28 | 29 | |
|
29 | 30 | FIGURES_PATH = tools.get_path() |
|
30 | 31 | |
|
31 | 32 | def isRadarFile(file): |
|
32 | 33 | try: |
|
33 | 34 | year = int(file[1:5]) |
|
34 | 35 | doy = int(file[5:8]) |
|
35 | 36 | set = int(file[8:11]) |
|
36 | 37 | except: |
|
37 | 38 | return 0 |
|
38 | 39 | |
|
39 | 40 | return 1 |
|
40 | 41 | |
|
41 | 42 | def isRadarPath(path): |
|
42 | 43 | try: |
|
43 | 44 | year = int(path[1:5]) |
|
44 | 45 | doy = int(path[5:8]) |
|
45 | 46 | except: |
|
46 | 47 | return 0 |
|
47 | 48 | |
|
48 | 49 | return 1 |
|
49 | 50 | |
|
50 | 51 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
51 | 52 | """ |
|
52 | 53 | """ |
|
53 | 54 | def __init__(self, parent=None): |
|
54 | 55 | """ |
|
55 | 56 | |
|
56 | 57 | """ |
|
57 | 58 | QMainWindow.__init__(self, parent) |
|
58 | 59 | self.setupUi(self) |
|
59 | 60 | self.__puObjDict = {} |
|
60 | 61 | self.__itemTreeDict = {} |
|
61 | 62 | self.readUnitConfObjList = [] |
|
62 | 63 | self.operObjList = [] |
|
63 | 64 | self.projecObjView = None |
|
64 | 65 | self.idProject = 0 |
|
65 | 66 | # self.idImag = 0 |
|
66 | 67 | |
|
67 | 68 | self.idImagscope = 0 |
|
68 | 69 | self.idImagspectra = 0 |
|
69 | 70 | self.idImagcross = 0 |
|
70 | 71 | self.idImagrti = 0 |
|
71 | 72 | self.idImagcoherence = 0 |
|
72 | 73 | self.idImagpower = 0 |
|
73 | 74 | self.idImagrtinoise = 0 |
|
74 | 75 | self.idImagspectraHeis = 0 |
|
75 | 76 | self.idImagrtiHeis = 0 |
|
76 | 77 | |
|
77 | 78 | self.online = 0 |
|
78 | 79 | self.walk = 0 |
|
79 | 80 | self.create = False |
|
80 | 81 | self.selectedItemTree = None |
|
81 | 82 | self.commCtrlPThread = None |
|
82 | 83 | self.setParameter() |
|
83 | 84 | self.create_comm() |
|
84 | 85 | # self.create_timers() |
|
85 | 86 | # self.create_figure() |
|
86 | 87 | self.temporalFTP = ftpBuffer() |
|
87 | 88 | self.projectProperCaracteristica = [] |
|
88 | 89 | self.projectProperPrincipal = [] |
|
89 | 90 | self.projectProperDescripcion = [] |
|
90 | 91 | self.volProperCaracteristica = [] |
|
91 | 92 | self.volProperPrincipal = [] |
|
92 | 93 | self.volProperDescripcion = [] |
|
93 | 94 | self.specProperCaracteristica = [] |
|
94 | 95 | self.specProperPrincipal = [] |
|
95 | 96 | self.specProperDescripcion = [] |
|
96 | 97 | |
|
97 | 98 | self.specHeisProperCaracteristica = [] |
|
98 | 99 | self.specHeisProperPrincipal = [] |
|
99 | 100 | self.specHeisProperDescripcion = [] |
|
100 | 101 | |
|
101 | 102 | # self.pathWorkSpace = './' |
|
102 | 103 | |
|
103 | 104 | self.__projectObjDict = {} |
|
104 | 105 | self.__operationObjDict = {} |
|
105 | 106 | |
|
106 | 107 | self.__ftpProcUnitAdded = False |
|
107 | 108 | self.__ftpProcUnitId = None |
|
108 | ||
|
109 | ||
|
110 | @pyqtSignature("") | |
|
111 | def on_actionOpen_triggered(self): | |
|
112 | """ | |
|
113 | Slot documentation goes here. | |
|
114 | """ | |
|
115 | self.openProject() | |
|
116 | ||
|
109 | 117 | @pyqtSignature("") |
|
110 | 118 | def on_actionCreate_triggered(self): |
|
111 | 119 | """ |
|
112 | 120 | Slot documentation goes here. |
|
113 | 121 | """ |
|
114 | 122 | self.setInputsProject_View() |
|
115 | 123 | self.create = True |
|
116 | 124 | |
|
117 | 125 | @pyqtSignature("") |
|
118 | 126 | def on_actionSave_triggered(self): |
|
119 | 127 | """ |
|
120 | 128 | Slot documentation goes here. |
|
121 | 129 | """ |
|
122 | 130 | self.saveProject() |
|
123 | 131 | |
|
124 | 132 | @pyqtSignature("") |
|
125 | 133 | def on_actionClose_triggered(self): |
|
126 | 134 | """ |
|
127 | 135 | Slot documentation goes here. |
|
128 | 136 | """ |
|
129 | 137 | self.close() |
|
130 | 138 | |
|
131 | 139 | @pyqtSignature("") |
|
132 | 140 | def on_actionStart_triggered(self): |
|
133 | 141 | """ |
|
134 | 142 | """ |
|
135 | 143 | self.playProject() |
|
136 | 144 | |
|
137 | 145 | @pyqtSignature("") |
|
138 | 146 | def on_actionPause_triggered(self): |
|
139 | 147 | """ |
|
140 | 148 | """ |
|
141 | 149 | self.pauseProject() |
|
142 | 150 | |
|
143 | 151 | @pyqtSignature("") |
|
144 | 152 | def on_actionStop_triggered(self): |
|
145 | 153 | """ |
|
146 | 154 | """ |
|
147 | 155 | self.stopProject() |
|
148 | 156 | |
|
149 | 157 | @pyqtSignature("") |
|
150 | 158 | def on_actionFTP_triggered(self): |
|
151 | 159 | """ |
|
152 | 160 | """ |
|
153 | 161 | self.configFTPWindowObj = Ftp(self) |
|
154 | 162 | # if self.temporalFTP.create: |
|
155 | 163 | if self.temporalFTP.createforView: |
|
156 | 164 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
157 | 165 | self.configFTPWindowObj.setParmsfromTemporal(server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos) |
|
158 | 166 | self.configFTPWindowObj.show() |
|
159 | 167 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
160 | 168 | |
|
161 | 169 | def createFTPConfig(self): |
|
162 | 170 | self.console.clear() |
|
163 | 171 | if not self.configFTPWindowObj.create: |
|
164 | 172 | self.console.append("There is no FTP configuration") |
|
165 | 173 | return |
|
166 | 174 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
167 | 175 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
168 | 176 | self.temporalFTP.save(server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos) |
|
169 | 177 | |
|
170 | 178 | @pyqtSignature("") |
|
171 | 179 | def on_actionOpenToolbar_triggered(self): |
|
172 | 180 | """ |
|
173 | 181 | Slot documentation goes here. |
|
174 | 182 | """ |
|
175 | self.create = False | |
|
176 | self.frame_2.setEnabled(True) | |
|
177 | home = expanduser("~") | |
|
178 | self.dir = os.path.join(home, 'schain_workspace') | |
|
179 | # print self.dir | |
|
180 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.dir, self.tr("Text Files (*.xml)"))) | |
|
181 | self.console.clear() | |
|
182 | projectObjLoad = Project() | |
|
183 | try: | |
|
184 | projectObjLoad.readXml(filename) | |
|
185 | except: | |
|
186 | self.console.clear() | |
|
187 | self.console.append("The selected xml file could not be loaded ...") | |
|
188 | return 0 | |
|
189 | ||
|
190 | project_name, description = projectObjLoad.name, projectObjLoad.description | |
|
191 | id = projectObjLoad.id | |
|
192 | self.__projectObjDict[id] = projectObjLoad | |
|
193 | # Project Properties | |
|
194 | datatype, data_path, startDate, endDate, startTime, endTime , online , delay, walk, set = self.showProjectProperties(projectObjLoad) | |
|
195 | # show ProjectView | |
|
196 | self.addProject2ProjectExplorer(id=id, name=project_name) | |
|
197 | self.refreshProjectWindow(project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set) | |
|
198 | ||
|
199 | if datatype == "Voltage": | |
|
200 | ext = '.r' | |
|
201 | self.specOpProfiles.setEnabled(True) | |
|
202 | self.specOpippFactor.setEnabled(True) | |
|
203 | elif datatype == "Spectra": | |
|
204 | ext = '.pdata' | |
|
205 | self.specOpProfiles.setEnabled(False) | |
|
206 | self.specOpippFactor.setEnabled(False) | |
|
207 | elif datatype == "Fits": | |
|
208 | ext = '.fits' | |
|
209 | ||
|
210 | if online == 0: | |
|
211 | self.loadDays(data_path, ext, walk) | |
|
212 | else: | |
|
213 | self.proComStartDate.setEnabled(False) | |
|
214 | self.proComEndDate.setEnabled(False) | |
|
215 | self.proStartTime.setEnabled(False) | |
|
216 | self.proEndTime.setEnabled(False) | |
|
217 | self.frame_2.setEnabled(True) | |
|
218 | ||
|
219 | self.tabWidgetProject.setEnabled(True) | |
|
220 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
221 | # Disable tabProject after finish the creation | |
|
222 | self.tabProject.setEnabled(True) | |
|
223 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
|
224 | ||
|
225 | for inputId, puObj in puObjorderList.items(): | |
|
226 | # print puObj.datatype, puObj.inputId,puObj.getId(),puObj.parentId | |
|
227 | self.__puObjDict[puObj.getId()] = puObj | |
|
228 | ||
|
229 | if puObj.inputId != "0": | |
|
230 | self.addPU2PELoadXML(id=puObj.getId() , name=puObj.datatype , idParent=puObj.inputId) | |
|
231 | ||
|
232 | if puObj.datatype == "Voltage": | |
|
233 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
234 | self.showPUVoltageProperties(puObj) | |
|
235 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
236 | ||
|
237 | if puObj.datatype == "Spectra": | |
|
238 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
239 | self.showPUSpectraProperties(puObj) | |
|
240 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
241 | ||
|
242 | if puObj.datatype == "SpectraHeis": | |
|
243 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
244 | self.showPUSpectraHeisProperties(puObj) | |
|
245 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
246 | ||
|
247 | if puObj.name == "SendToServer": | |
|
248 | self.__ftpProcUnitAdded = True | |
|
249 | self.__ftpProcUnitId = puObj.getId() | |
|
250 | ||
|
251 | opObj = puObj.getOperationObj(name="run") | |
|
252 | self.saveFTPvalues(opObj) | |
|
253 | ||
|
254 | self.console.clear() | |
|
255 | self.console.append("The selected xml file has been loaded successfully") | |
|
256 | # self.refreshPUWindow(datatype=datatype,puObj=puObj) | |
|
183 | self.openProject() | |
|
257 | 184 | |
|
258 | 185 | @pyqtSignature("") |
|
259 | 186 | def on_actionCreateToolbar_triggered(self): |
|
260 | 187 | """ |
|
261 | 188 | Slot documentation goes here. |
|
262 | 189 | """ |
|
263 | 190 | self.setInputsProject_View() |
|
264 | 191 | self.create = True |
|
265 | 192 | |
|
266 | 193 | @pyqtSignature("") |
|
267 | 194 | def on_actionAddPU_triggered(self): |
|
268 | 195 | if len(self.__projectObjDict) == 0: |
|
269 | 196 | outputstr = "First Create a Project then add Processing Unit" |
|
270 | 197 | self.console.clear() |
|
271 | 198 | self.console.append(outputstr) |
|
272 | 199 | return 0 |
|
273 | 200 | else: |
|
274 | 201 | self.addPUWindow() |
|
275 | 202 | self.console.clear() |
|
276 | 203 | self.console.append("Please, Choose the type of Processing Unit") |
|
277 | 204 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
278 | 205 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
279 | 206 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
280 | 207 | |
|
281 | 208 | |
|
282 | 209 | @pyqtSignature("") |
|
283 | 210 | def on_actionSaveToolbar_triggered(self): |
|
284 | 211 | """ |
|
285 | 212 | Slot documentation goes here. |
|
286 | 213 | """ |
|
287 | 214 | self.saveProject() |
|
288 | 215 | |
|
289 | 216 | @pyqtSignature("") |
|
290 | 217 | def on_actionStarToolbar_triggered(self): |
|
291 | 218 | """ |
|
292 | 219 | Slot documentation goes here. |
|
293 | 220 | """ |
|
294 | 221 | self.playProject() |
|
295 | 222 | |
|
296 | 223 | @pyqtSignature("") |
|
297 | 224 | def on_actionPauseToolbar_triggered(self): |
|
298 | 225 | |
|
299 | 226 | self.pauseProject() |
|
300 | 227 | |
|
301 | 228 | @pyqtSignature("") |
|
302 | 229 | def on_actionStopToolbar_triggered(self): |
|
303 | 230 | """ |
|
304 | 231 | Slot documentation goes here. |
|
305 | 232 | """ |
|
306 | 233 | self.stopProject() |
|
307 | 234 | |
|
308 | 235 | @pyqtSignature("int") |
|
309 | 236 | def on_proComReadMode_activated(self, index): |
|
310 | 237 | """ |
|
311 | 238 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
312 | 239 | """ |
|
313 | 240 | if index == 0: |
|
314 | 241 | self.online = 0 |
|
315 | 242 | self.proDelay.setText("0") |
|
316 | 243 | self.proSet.setText("0") |
|
317 | 244 | self.proSet.setEnabled(False) |
|
318 | 245 | self.proDelay.setEnabled(False) |
|
319 | 246 | elif index == 1: |
|
320 | 247 | self.online = 1 |
|
321 | 248 | self.proSet.setText(" ") |
|
322 | 249 | self.proDelay.setText("5") |
|
323 | 250 | self.proSet.setEnabled(True) |
|
324 | 251 | self.proDelay.setEnabled(True) |
|
325 | 252 | |
|
326 | 253 | @pyqtSignature("int") |
|
327 | 254 | def on_proComDataType_activated(self, index): |
|
328 | 255 | """ |
|
329 | 256 | Voltage or Spectra |
|
330 | 257 | """ |
|
331 | 258 | if index == 0: |
|
332 | 259 | self.datatype = '.r' |
|
333 | 260 | elif index == 1: |
|
334 | 261 | self.datatype = '.pdata' |
|
335 | 262 | elif index == 2: |
|
336 | 263 | self.datatype = '.fits' |
|
337 | 264 | |
|
338 | 265 | self.proDataType.setText(self.datatype) |
|
339 | 266 | self.console.clear() |
|
340 | 267 | |
|
341 | 268 | @pyqtSignature("int") |
|
342 | 269 | def on_proComWalk_activated(self, index): |
|
343 | 270 | """ |
|
344 | 271 | |
|
345 | 272 | """ |
|
346 | 273 | if index == 0: |
|
347 | 274 | self.walk = 0 |
|
348 | 275 | elif index == 1: |
|
349 | 276 | self.walk = 1 |
|
350 | 277 | |
|
351 | 278 | @pyqtSignature("") |
|
352 | 279 | def on_proToolPath_clicked(self): |
|
353 | 280 | """ |
|
354 | 281 | Choose your path |
|
355 | 282 | """ |
|
356 | 283 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
357 | 284 | self.proDataPath.setText(self.dataPath) |
|
358 | 285 | |
|
359 | 286 | self.proComStartDate.clear() |
|
360 | 287 | self.proComEndDate.clear() |
|
361 | 288 | |
|
362 | 289 | if not os.path.exists(self.dataPath): |
|
363 | 290 | self.proOk.setEnabled(False) |
|
364 | 291 | self.console.clear() |
|
365 | 292 | self.console.append("Write a correct a path") |
|
366 | 293 | return |
|
367 | 294 | self.console.clear() |
|
368 | 295 | self.console.append("Select the read mode") |
|
369 | 296 | |
|
370 | 297 | |
|
371 | 298 | @pyqtSignature("") |
|
372 | 299 | def on_proLoadButton_clicked(self): |
|
373 | 300 | self.console.clear() |
|
374 | 301 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk , set = self.checkInputsProject() |
|
375 | 302 | if read_mode == "Offline": |
|
376 | 303 | if parms_ok: |
|
377 | 304 | self.proComStartDate.clear() |
|
378 | 305 | self.proComEndDate.clear() |
|
379 | 306 | self.loadDays(data_path, ext, walk) |
|
380 | 307 | self.proComStartDate.setEnabled(True) |
|
381 | 308 | self.proComEndDate.setEnabled(True) |
|
382 | 309 | self.proStartTime.setEnabled(True) |
|
383 | 310 | self.proEndTime.setEnabled(True) |
|
384 | 311 | self.frame_2.setEnabled(True) |
|
385 | 312 | return |
|
386 | 313 | if read_mode == "Online": |
|
387 | 314 | if parms_ok: |
|
388 | 315 | self.proComStartDate.addItem("2010/01/30") |
|
389 | 316 | self.proComEndDate.addItem("2013/12/30") |
|
390 | 317 | self.loadDays(data_path, ext, walk) |
|
391 | 318 | self.proComStartDate.setEnabled(False) |
|
392 | 319 | self.proComEndDate.setEnabled(False) |
|
393 | 320 | self.proStartTime.setEnabled(False) |
|
394 | 321 | self.proEndTime.setEnabled(False) |
|
395 | 322 | self.frame_2.setEnabled(True) |
|
396 | 323 | |
|
397 | 324 | @pyqtSignature("int") |
|
398 | 325 | def on_proComStartDate_activated(self, index): |
|
399 | 326 | """ |
|
400 | 327 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
401 | 328 | """ |
|
402 | 329 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() |
|
403 | 330 | self.proComEndDate.clear() |
|
404 | 331 | for i in self.dateList[index:]: |
|
405 | 332 | self.proComEndDate.addItem(i) |
|
406 | 333 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) |
|
407 | 334 | |
|
408 | 335 | @pyqtSignature("int") |
|
409 | 336 | def on_proComEndDate_activated(self, index): |
|
410 | 337 | """ |
|
411 | 338 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
412 | 339 | """ |
|
413 | 340 | startIndex = self.proComStartDate.currentIndex() |
|
414 | 341 | stopIndex = self.proComEndDate.count() - index |
|
415 | 342 | self.proComStartDate.clear() |
|
416 | 343 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: |
|
417 | 344 | self.proComStartDate.addItem(i) |
|
418 | 345 | self.proComStartDate.setCurrentIndex(startIndex) |
|
419 | 346 | |
|
420 | 347 | @pyqtSignature("") |
|
421 | 348 | def on_proOk_clicked(self): |
|
422 | 349 | """ |
|
423 | 350 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
424 | 351 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
425 | 352 | """ |
|
426 | 353 | if self.create: |
|
427 | 354 | self.idProject += 1 |
|
428 | 355 | projectId = self.idProject |
|
429 | 356 | projectObjView = self.createProjectView(projectId) |
|
430 | 357 | readUnitObj = self.createReadUnitView(projectObjView) |
|
431 | 358 | self.addProject2ProjectExplorer(id=projectId, name=projectObjView.name) |
|
432 | 359 | else: |
|
433 | 360 | projectObjView = self.updateProjectView() |
|
434 | 361 | projectId = projectObjView.getId() |
|
435 | 362 | idReadUnit = projectObjView.getReadUnitId() |
|
436 | 363 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
437 | 364 | |
|
438 | 365 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
439 | 366 | # Project Properties |
|
440 | 367 | self.showProjectProperties(projectObjView) |
|
441 | 368 | # Disable tabProject after finish the creation |
|
442 | 369 | self.tabProject.setEnabled(True) |
|
443 | 370 | |
|
444 | 371 | @pyqtSignature("") |
|
445 | 372 | def on_proClear_clicked(self): |
|
446 | 373 | self.setInputsProject_View() |
|
447 | 374 | projectObj = self.getSelectedProjectObj() |
|
448 | 375 | |
|
449 | 376 | @pyqtSignature("int") |
|
450 | 377 | def on_volOpCebChannels_stateChanged(self, p0): |
|
451 | 378 | """ |
|
452 | 379 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
453 | 380 | """ |
|
454 | 381 | if p0 == 2: |
|
455 | 382 | self.volOpComChannels.setEnabled(True) |
|
456 | 383 | self.volOpChannel.setEnabled(True) |
|
457 | 384 | |
|
458 | 385 | if p0 == 0: |
|
459 | 386 | self.volOpComChannels.setEnabled(False) |
|
460 | 387 | self.volOpChannel.setEnabled(False) |
|
461 | 388 | self.volOpChannel.clear() |
|
462 | 389 | |
|
463 | 390 | @pyqtSignature("int") |
|
464 | 391 | def on_volOpCebHeights_stateChanged(self, p0): |
|
465 | 392 | """ |
|
466 | 393 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
467 | 394 | """ |
|
468 | 395 | if p0 == 2: |
|
469 | 396 | self.volOpHeights.setEnabled(True) |
|
470 | 397 | self.volOpComHeights.setEnabled(True) |
|
471 | 398 | |
|
472 | 399 | if p0 == 0: |
|
473 | 400 | self.volOpHeights.setEnabled(False) |
|
474 | 401 | self.volOpHeights.clear() |
|
475 | 402 | self.volOpComHeights.setEnabled(False) |
|
476 | 403 | |
|
477 | 404 | @pyqtSignature("int") |
|
478 | 405 | def on_volOpCebFilter_stateChanged(self, p0): |
|
479 | 406 | """ |
|
480 | 407 | Name='Decoder', optype='other' |
|
481 | 408 | """ |
|
482 | 409 | if p0 == 2: |
|
483 | 410 | self.volOpFilter.setEnabled(True) |
|
484 | 411 | |
|
485 | 412 | if p0 == 0: |
|
486 | 413 | self.volOpFilter.setEnabled(False) |
|
487 | 414 | self.volOpFilter.clear() |
|
488 | 415 | |
|
489 | 416 | @pyqtSignature("int") |
|
490 | 417 | def on_volOpCebProfile_stateChanged(self, p0): |
|
491 | 418 | """ |
|
492 | 419 | Check Box habilita ingreso del rango de Perfiles |
|
493 | 420 | """ |
|
494 | 421 | if p0 == 2: |
|
495 | 422 | self.volOpComProfile.setEnabled(True) |
|
496 | 423 | self.volOpProfile.setEnabled(True) |
|
497 | 424 | |
|
498 | 425 | if p0 == 0: |
|
499 | 426 | self.volOpComProfile.setEnabled(False) |
|
500 | 427 | self.volOpProfile.setEnabled(False) |
|
501 | 428 | self.volOpProfile.clear() |
|
502 | 429 | |
|
503 | 430 | @pyqtSignature("int") |
|
504 | 431 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
505 | 432 | """ |
|
506 | 433 | Check Box habilita |
|
507 | 434 | """ |
|
508 | 435 | if p0 == 2: |
|
509 | 436 | self.volOpComCode.setEnabled(True) |
|
510 | 437 | self.volOpComMode.setEnabled(True) |
|
511 | 438 | if p0 == 0: |
|
512 | 439 | self.volOpComCode.setEnabled(False) |
|
513 | 440 | self.volOpComMode.setEnabled(False) |
|
514 | ||
|
441 | ||
|
442 | @pyqtSignature("int") | |
|
443 | def on_volOpCebFlip_stateChanged(self, p0): | |
|
444 | """ | |
|
445 | Check Box habilita ingresode del numero de Integraciones a realizar | |
|
446 | """ | |
|
447 | if p0 == 2: | |
|
448 | self.volOpFlip.setEnabled(True) | |
|
449 | if p0 == 0: | |
|
450 | self.volOpFlip.setEnabled(False) | |
|
451 | self.volOpFlip.clear() | |
|
452 | ||
|
515 | 453 | @pyqtSignature("int") |
|
516 | 454 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
517 | 455 | """ |
|
518 | 456 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
519 | 457 | """ |
|
520 | 458 | if p0 == 2: |
|
521 | 459 | self.volOpCohInt.setEnabled(True) |
|
522 | 460 | if p0 == 0: |
|
523 | 461 | self.volOpCohInt.setEnabled(False) |
|
524 | 462 | self.volOpCohInt.clear() |
|
525 | 463 | |
|
526 | 464 | @pyqtSignature("int") |
|
527 | 465 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
528 | 466 | """ |
|
529 | 467 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
530 | 468 | """ |
|
531 | 469 | if p0 == 2: |
|
532 | 470 | self.volOpRadarfrequency.setEnabled(True) |
|
533 | 471 | if p0 == 0: |
|
534 | 472 | self.volOpRadarfrequency.clear() |
|
535 | 473 | self.volOpRadarfrequency.setEnabled(False) |
|
536 | 474 | |
|
537 | 475 | @pyqtSignature("") |
|
538 | 476 | def on_volOutputToolPath_clicked(self): |
|
539 | 477 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
540 | 478 | self.volOutputPath.setText(dirOutPath) |
|
541 | 479 | |
|
542 | 480 | @pyqtSignature("") |
|
543 | 481 | def on_specOutputToolPath_clicked(self): |
|
544 | 482 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
545 | 483 | self.specOutputPath.setText(dirOutPath) |
|
546 | 484 | |
|
547 | 485 | @pyqtSignature("") |
|
548 | 486 | def on_specHeisOutputToolPath_clicked(self): |
|
549 | 487 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
550 | 488 | self.specHeisOutputPath.setText(dirOutPath) |
|
551 | 489 | |
|
552 | 490 | @pyqtSignature("") |
|
553 | 491 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
554 | 492 | home = expanduser("~") |
|
555 | 493 | self.dir = os.path.join(home, 'schain_workspace') |
|
556 | 494 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.dir, self.tr("Text Files (*.xml)"))) |
|
557 | 495 | self.specHeisOutputMetada.setText(filename) |
|
558 | 496 | |
|
559 | 497 | @pyqtSignature("") |
|
560 | 498 | def on_volOpOk_clicked(self): |
|
561 | 499 | """ |
|
562 | 500 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
563 | 501 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
564 | 502 | """ |
|
565 | 503 | |
|
566 | 504 | checkPath = False |
|
567 | 505 | |
|
568 | 506 | self.actionSaveToolbar.setEnabled(False) |
|
569 | 507 | self.actionStarToolbar.setEnabled(False) |
|
570 | 508 | |
|
571 | 509 | puObj = self.getSelectedPUObj() |
|
572 | 510 | puObj.removeOperations() |
|
573 | 511 | |
|
574 | 512 | if self.volOpCebRadarfrequency.isChecked(): |
|
575 | 513 | value = self.volOpRadarfrequency.text() |
|
576 | 514 | format = 'float' |
|
577 | 515 | name_operation = 'setRadarFrequency' |
|
578 | 516 | name_parameter = 'frequency' |
|
579 | 517 | if not value == "": |
|
580 | 518 | try: |
|
581 | 519 | radarfreq = float(self.volOpRadarfrequency.text()) |
|
582 | 520 | except: |
|
583 | 521 | self.console.clear() |
|
584 | 522 | self.console.append("Write the parameter Radar Frequency type float") |
|
585 | 523 | return 0 |
|
586 | 524 | opObj = puObj.addOperation(name=name_operation) |
|
587 | 525 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
588 | 526 | |
|
589 | 527 | |
|
590 | 528 | |
|
591 | 529 | if self.volOpCebChannels.isChecked(): |
|
592 | 530 | value = self.volOpChannel.text() |
|
593 | 531 | format = 'intlist' |
|
594 | 532 | if self.volOpComChannels.currentIndex() == 0: |
|
595 | 533 | name_operation = "selectChannels" |
|
596 | 534 | name_parameter = 'channelList' |
|
597 | 535 | else: |
|
598 | 536 | name_operation = "selectChannelsByIndex" |
|
599 | 537 | name_parameter = 'channelIndexList' |
|
600 | 538 | |
|
601 | 539 | opObj = puObj.addOperation(name=name_operation) |
|
602 | 540 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
603 | 541 | |
|
604 | 542 | if self.volOpCebHeights.isChecked(): |
|
605 | 543 | value = self.volOpHeights.text() |
|
606 | 544 | valueList = value.split(',') |
|
607 | 545 | format = 'float' |
|
608 | 546 | if self.volOpComHeights.currentIndex() == 0: |
|
609 | 547 | name_operation = 'selectHeights' |
|
610 | 548 | name_parameter1 = 'minHei' |
|
611 | 549 | name_parameter2 = 'maxHei' |
|
612 | 550 | else: |
|
613 | 551 | name_operation = 'selectHeightsByIndex' |
|
614 | 552 | name_parameter1 = 'minIndex' |
|
615 | 553 | name_parameter2 = 'maxIndex' |
|
616 | 554 | opObj = puObj.addOperation(name=name_operation) |
|
617 | 555 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
618 | 556 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
619 | 557 | |
|
620 | 558 | if self.volOpCebFilter.isChecked(): |
|
621 | 559 | value = self.volOpFilter.text() |
|
622 | 560 | format = 'int' |
|
623 | 561 | name_operation = 'filterByHeights' |
|
624 | 562 | name_parameter = 'window' |
|
625 | 563 | opObj = puObj.addOperation(name=name_operation) |
|
626 | 564 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
627 | 565 | |
|
628 | 566 | if self.volOpCebProfile.isChecked(): |
|
629 | 567 | value = self.volOpProfile.text() |
|
630 | 568 | format = 'intlist' |
|
631 | 569 | optype = 'other' |
|
632 | 570 | name_operation = 'ProfileSelector' |
|
633 | 571 | if self.volOpComProfile.currentIndex() == 0: |
|
634 | 572 | name_parameter = 'profileList' |
|
635 | 573 | else: |
|
636 | 574 | name_parameter = 'profileRangeList' |
|
637 | 575 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
638 | 576 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
639 | 577 | |
|
640 | 578 | if self.volOpCebDecodification.isChecked(): |
|
641 | 579 | name_operation = 'Decoder' |
|
642 | 580 | optype = 'other' |
|
643 | 581 | format1 = 'floatlist' |
|
644 | 582 | format2 = 'int' |
|
645 | 583 | format3 = 'int' |
|
646 | 584 | format4 = 'int' |
|
647 | 585 | name_parameter1 = 'code' |
|
648 | 586 | name_parameter2 = 'nCode' |
|
649 | 587 | name_parameter3 = 'nBaud' |
|
650 | 588 | name_parameter4 = 'mode' |
|
651 | 589 | |
|
652 | 590 | if self.volOpComCode.currentIndex() == 0: |
|
653 | 591 | value1 = '1,1,-1' |
|
654 | 592 | value2 = '1' |
|
655 | 593 | value3 = '3' |
|
656 | 594 | if self.volOpComCode.currentIndex() == 1: |
|
657 | 595 | value1 = '1,1,-1,1' |
|
658 | 596 | value2 = '1' |
|
659 | 597 | value3 = '4' |
|
660 | 598 | if self.volOpComCode.currentIndex() == 2: |
|
661 |
value1 = '1,1,1, |
|
|
599 | value1 = '1,1,1,-1,1' | |
|
662 | 600 | value2 = '1' |
|
663 | 601 | value3 = '5' |
|
664 | 602 | if self.volOpComCode.currentIndex() == 3: |
|
665 | 603 | value1 = '1,1,1,-1,-1,1,-1' |
|
666 | 604 | value2 = '1' |
|
667 | 605 | value3 = '7' |
|
668 | 606 | if self.volOpComCode.currentIndex() == 4: |
|
669 | 607 | value1 = '1,1,1,-1,-1,-1,1,-1,-1,1,-1' |
|
670 | 608 | value2 = '1' |
|
671 | 609 | value3 = '11' |
|
672 | 610 | if self.volOpComCode.currentIndex() == 5: |
|
673 | 611 | value1 = '1,1,1,1,1,-1,-1,1,1,-1,1,-1,1' |
|
674 | 612 | value2 = '1' |
|
675 | 613 | value3 = '13' |
|
676 | 614 | if self.volOpComCode.currentIndex() == 6: |
|
677 | 615 | value1 = '1,1,-1,-1,-1,1' |
|
678 | 616 | value2 = '2' |
|
679 | 617 | value3 = '3' |
|
680 | 618 | if self.volOpComCode.currentIndex() == 7: |
|
681 | 619 | value1 = '1,1,-1,1,-1,-1,1,-1' |
|
682 | 620 | value2 = '2' |
|
683 | 621 | value3 = '4' |
|
684 | 622 | if self.volOpComCode.currentIndex() == 8: |
|
685 | 623 | value1 = '1,1,1,-1,1,-1,-1,-1,1,-1' |
|
686 | 624 | value2 = '2' |
|
687 | 625 | value3 = '5' |
|
688 | 626 | if self.volOpComCode.currentIndex() == 9: |
|
689 | 627 | value1 = '1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1' |
|
690 | 628 | value2 = '2' |
|
691 | 629 | value3 = '7' |
|
692 | 630 | if self.volOpComCode.currentIndex() == 10: |
|
693 | 631 | value1 = '1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1' |
|
694 | 632 | value2 = '2' |
|
695 | 633 | value3 = '11' |
|
696 | 634 | if self.volOpComCode.currentIndex() == 11: |
|
697 | 635 | value1 = '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' |
|
698 | 636 | value2 = '2' |
|
699 | 637 | value3 = '13' |
|
700 | 638 | if self.volOpComMode.currentIndex() == 0: |
|
701 | 639 | value4 = '0' |
|
702 | 640 | if self.volOpComMode.currentIndex() == 1: |
|
703 | 641 | value4 = '1' |
|
704 | 642 | if self.volOpComMode.currentIndex() == 2: |
|
705 | 643 | value4 = '2' |
|
706 | 644 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
707 | 645 | if self.volOpComCode.currentIndex() == 12: |
|
708 | 646 | pass |
|
709 | 647 | else: |
|
710 | 648 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
711 | 649 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
712 | 650 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
713 | 651 | opObj.addParameter(name=name_parameter4, value=value4, format=format4) |
|
714 | 652 | |
|
715 | 653 | if self.volOpCebFlip.isChecked(): |
|
716 | 654 | name_operation = 'deFlip' |
|
717 | 655 | optype = 'self' |
|
718 | 656 | value = self.volOpFlip.text() |
|
719 | 657 | name_parameter = 'channelList' |
|
720 |
format = 'int |
|
|
658 | format = 'intlist' | |
|
721 | 659 | |
|
722 | 660 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
723 | 661 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
724 | 662 | |
|
725 | 663 | if self.volOpCebCohInt.isChecked(): |
|
726 | 664 | name_operation = 'CohInt' |
|
727 | 665 | optype = 'other' |
|
728 | 666 | value = self.volOpCohInt.text() |
|
729 | 667 | name_parameter = 'n' |
|
730 | 668 | format = 'float' |
|
731 | 669 | |
|
732 | 670 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
733 | 671 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
734 | 672 | |
|
735 | 673 | if self.volGraphCebshow.isChecked(): |
|
736 | 674 | name_operation = 'Scope' |
|
737 | 675 | optype = 'other' |
|
738 | 676 | name_parameter = 'type' |
|
739 | 677 | value = 'Scope' |
|
740 | 678 | if self.idImagscope == 0: |
|
741 | 679 | self.idImagscope = 100 |
|
742 | 680 | else: |
|
743 | 681 | self.idImagscope = self.idImagscope + 1 |
|
744 | 682 | |
|
745 | 683 | name_parameter1 = 'id' |
|
746 | 684 | value1 = int(self.idImagscope) |
|
747 | 685 | format1 = 'int' |
|
748 | 686 | format = 'str' |
|
749 | 687 | |
|
750 | 688 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
751 | 689 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
752 | 690 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
753 | 691 | |
|
754 | 692 | channelList = self.volGraphChannelList.text() |
|
755 | 693 | xvalue = self.volGraphfreqrange.text() |
|
756 | 694 | yvalue = self.volGraphHeightrange.text() |
|
757 | 695 | |
|
758 | 696 | if self.volGraphChannelList.isModified(): |
|
759 | 697 | try: |
|
760 | 698 | value = str(channelList) |
|
761 | 699 | except: |
|
762 | 700 | return 0 |
|
763 | 701 | opObj.addParameter(name='channelList', value=value, format='intlist') |
|
764 | 702 | |
|
765 | 703 | if not xvalue == "": |
|
766 | 704 | xvalueList = xvalue.split(',') |
|
767 | 705 | try: |
|
768 | 706 | value0 = int(xvalueList[0]) |
|
769 | 707 | value1 = int(xvalueList[1]) |
|
770 | 708 | except: |
|
771 | 709 | return 0 |
|
772 | 710 | opObj.addParameter(name='xmin', value=value0, format='int') |
|
773 | 711 | opObj.addParameter(name='xmax', value=value1, format='int') |
|
774 | 712 | |
|
775 | 713 | |
|
776 | 714 | if not yvalue == "": |
|
777 | 715 | yvalueList = yvalue.split(",") |
|
778 | 716 | try: |
|
779 | 717 | value = yvalueList[0] |
|
780 | 718 | value = yvalueList[1] |
|
781 | 719 | except: |
|
782 | 720 | return 0 |
|
783 | 721 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
784 | 722 | opObj.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
785 | 723 | |
|
786 | 724 | if self.volGraphCebSave.isChecked(): |
|
787 | 725 | checkPath = True |
|
788 | 726 | opObj.addParameter(name='save', value='1', format='int') |
|
789 | 727 | opObj.addParameter(name='figpath', value=self.volGraphPath.text(), format='str') |
|
790 | 728 | value = self.volGraphPrefix.text() |
|
791 | 729 | if not value == "": |
|
792 | 730 | try: |
|
793 | 731 | value = str(self.volGraphPrefix.text()) |
|
794 | 732 | except: |
|
795 | 733 | self.console.clear() |
|
796 | 734 | self.console.append("Please Write prefix") |
|
797 | 735 | return 0 |
|
798 | 736 | opObj.addParameter(name='figfile', value=self.volGraphPrefix.text(), format='str') |
|
799 | 737 | |
|
800 | 738 | localfolder = None |
|
801 | 739 | if checkPath: |
|
802 | 740 | localfolder = str(self.specGraphPath.text()) |
|
803 | 741 | if localfolder == '': |
|
804 | 742 | self.console.clear() |
|
805 | 743 | self.console.append("Graphic path should be defined") |
|
806 | 744 | return 0 |
|
807 | 745 | |
|
808 | 746 | # if something happend |
|
809 | 747 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
810 | 748 | if parms_ok: |
|
811 | 749 | name_operation = 'VoltageWriter' |
|
812 | 750 | optype = 'other' |
|
813 | 751 | name_parameter1 = 'path' |
|
814 | 752 | name_parameter2 = 'blocksPerFile' |
|
815 | 753 | name_parameter3 = 'profilesPerBlock' |
|
816 | 754 | value1 = output_path |
|
817 | 755 | value2 = blocksperfile |
|
818 | 756 | value3 = profilesperblock |
|
819 | 757 | format = "int" |
|
820 | 758 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
821 | 759 | opObj.addParameter(name=name_parameter1, value=value1) |
|
822 | 760 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
823 | 761 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
824 | 762 | |
|
825 | 763 | #---------NEW VOLTAGE PROPERTIES |
|
826 | 764 | self.showPUVoltageProperties(puObj) |
|
827 | 765 | |
|
828 | 766 | self.console.clear() |
|
829 | 767 | self.console.append("If you want to save your project") |
|
830 | 768 | self.console.append("click on your project name in the Tree Project Explorer") |
|
831 | 769 | |
|
832 | 770 | self.actionSaveToolbar.setEnabled(True) |
|
833 | 771 | self.actionStarToolbar.setEnabled(True) |
|
834 | 772 | |
|
835 | 773 | return 1 |
|
836 | 774 | |
|
837 | 775 | """ |
|
838 | 776 | Voltage Graph |
|
839 | 777 | """ |
|
840 | 778 | @pyqtSignature("int") |
|
841 | 779 | def on_volGraphCebSave_stateChanged(self, p0): |
|
842 | 780 | """ |
|
843 | 781 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
844 | 782 | """ |
|
845 | 783 | if p0 == 2: |
|
846 | 784 | self.volGraphPath.setEnabled(True) |
|
847 | 785 | self.volGraphPrefix.setEnabled(True) |
|
848 | 786 | self.volGraphToolPath.setEnabled(True) |
|
849 | 787 | |
|
850 | 788 | if p0 == 0: |
|
851 | 789 | self.volGraphPath.setEnabled(False) |
|
852 | 790 | self.volGraphPrefix.setEnabled(False) |
|
853 | 791 | self.volGraphToolPath.setEnabled(False) |
|
854 | 792 | |
|
855 | 793 | @pyqtSignature("") |
|
856 | 794 | def on_volGraphToolPath_clicked(self): |
|
857 | 795 | """ |
|
858 | 796 | Donde se guardan los DATOS |
|
859 | 797 | """ |
|
860 | 798 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
861 | 799 | self.volGraphPath.setText(self.dataPath) |
|
862 | 800 | |
|
863 | 801 | # if not os.path.exists(self.dataPath): |
|
864 | 802 | # self.volGraphOk.setEnabled(False) |
|
865 | 803 | # return |
|
866 | 804 | |
|
867 | 805 | @pyqtSignature("int") |
|
868 | 806 | def on_volGraphCebshow_stateChanged(self, p0): |
|
869 | 807 | """ |
|
870 | 808 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
871 | 809 | """ |
|
872 | 810 | if p0 == 0: |
|
873 | 811 | |
|
874 | 812 | self.volGraphChannelList.setEnabled(False) |
|
875 | 813 | self.volGraphfreqrange.setEnabled(False) |
|
876 | 814 | self.volGraphHeightrange.setEnabled(False) |
|
877 | 815 | if p0 == 2: |
|
878 | 816 | |
|
879 | 817 | self.volGraphChannelList.setEnabled(True) |
|
880 | 818 | self.volGraphfreqrange.setEnabled(True) |
|
881 | 819 | self.volGraphHeightrange.setEnabled(True) |
|
882 | 820 | |
|
883 | 821 | """ |
|
884 | 822 | Spectra operation |
|
885 | 823 | """ |
|
886 | 824 | @pyqtSignature("int") |
|
887 | 825 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
888 | 826 | """ |
|
889 | 827 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
890 | 828 | """ |
|
891 | 829 | if p0 == 2: |
|
892 | 830 | self.specOpRadarfrequency.setEnabled(True) |
|
893 | 831 | if p0 == 0: |
|
894 | 832 | self.specOpRadarfrequency.clear() |
|
895 | 833 | self.specOpRadarfrequency.setEnabled(False) |
|
896 | 834 | |
|
897 | 835 | |
|
898 | 836 | @pyqtSignature("int") |
|
899 | 837 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
900 | 838 | """ |
|
901 | 839 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
902 | 840 | """ |
|
903 | 841 | if p0 == 2: |
|
904 | 842 | # self.specOpnFFTpoints.setEnabled(True) |
|
905 | 843 | self.specOppairsList.setEnabled(True) |
|
906 | 844 | if p0 == 0: |
|
907 | 845 | # self.specOpnFFTpoints.setEnabled(False) |
|
908 | 846 | self.specOppairsList.setEnabled(False) |
|
909 | 847 | |
|
910 | 848 | @pyqtSignature("int") |
|
911 | 849 | def on_specOpCebChannel_stateChanged(self, p0): |
|
912 | 850 | """ |
|
913 | 851 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
914 | 852 | """ |
|
915 | 853 | if p0 == 2: |
|
916 | 854 | self.specOpChannel.setEnabled(True) |
|
917 | 855 | self.specOpComChannel.setEnabled(True) |
|
918 | 856 | if p0 == 0: |
|
919 | 857 | self.specOpChannel.setEnabled(False) |
|
920 | 858 | self.specOpComChannel.setEnabled(False) |
|
921 | 859 | |
|
922 | 860 | @pyqtSignature("int") |
|
923 | 861 | def on_specOpCebHeights_stateChanged(self, p0): |
|
924 | 862 | """ |
|
925 | 863 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
926 | 864 | """ |
|
927 | 865 | if p0 == 2: |
|
928 | 866 | self.specOpComHeights.setEnabled(True) |
|
929 | 867 | self.specOpHeights.setEnabled(True) |
|
930 | 868 | if p0 == 0: |
|
931 | 869 | self.specOpComHeights.setEnabled(False) |
|
932 | 870 | self.specOpHeights.setEnabled(False) |
|
933 | 871 | |
|
934 | 872 | |
|
935 | 873 | @pyqtSignature("int") |
|
936 | 874 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
937 | 875 | """ |
|
938 | 876 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
939 | 877 | """ |
|
940 | 878 | if p0 == 2: |
|
941 | 879 | self.specOpIncoherent.setEnabled(True) |
|
942 | 880 | if p0 == 0: |
|
943 | 881 | self.specOpIncoherent.setEnabled(False) |
|
944 | 882 | |
|
945 | 883 | @pyqtSignature("int") |
|
946 | 884 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
947 | 885 | """ |
|
948 | 886 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
949 | 887 | """ |
|
950 | 888 | if p0 == 2: |
|
951 | 889 | self.specOpComRemoveDC.setEnabled(True) |
|
952 | 890 | if p0 == 0: |
|
953 | 891 | self.specOpComRemoveDC.setEnabled(False) |
|
954 | 892 | |
|
955 | 893 | @pyqtSignature("int") |
|
956 | 894 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
957 | 895 | """ |
|
958 | 896 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
959 | 897 | """ |
|
960 | 898 | if p0 == 2: |
|
961 | 899 | self.specOpgetNoise.setEnabled(True) |
|
962 | 900 | |
|
963 | 901 | if p0 == 0: |
|
964 | 902 | self.specOpgetNoise.setEnabled(False) |
|
965 | 903 | |
|
966 | 904 | def refreshID(self, puObj): |
|
967 | 905 | opObj = puObj.getOperationObj(name='Scope') |
|
968 | 906 | # opObj = puObj.getOpObjfromParamValue(value="Scope") |
|
969 | 907 | if opObj == None: |
|
970 | 908 | pass |
|
971 | 909 | else: |
|
972 | 910 | name_parameter1 = 'id' |
|
973 | 911 | format1 = 'int' |
|
974 | 912 | if self.idImagscope == 0: |
|
975 | 913 | self.idImagscope = 100 |
|
976 | 914 | else: |
|
977 | 915 | self.idImagscope = self.idImagscope + 1 |
|
978 | 916 | value1 = int(self.idImagscope) |
|
979 | 917 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
980 | 918 | |
|
981 | 919 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
982 | 920 | # opObj = puObj.getOpObjfromParamValue(value="SpectraPlot") |
|
983 | 921 | if opObj == None: |
|
984 | 922 | pass |
|
985 | 923 | else: |
|
986 | 924 | name_parameter1 = 'id' |
|
987 | 925 | format1 = 'int' |
|
988 | 926 | if self.idImagspectra == 0: |
|
989 | 927 | self.idImagspectra = 200 |
|
990 | 928 | else: |
|
991 | 929 | self.idImagspectra = self.idImagspectra + 1 |
|
992 | 930 | value1 = int(self.idImagspectra) |
|
993 | 931 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
994 | 932 | |
|
995 | 933 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
996 | 934 | # opObj = puObj.getOpObjfromParamValue(value="CrossSpectraPlot") |
|
997 | 935 | if opObj == None: |
|
998 | 936 | pass |
|
999 | 937 | else: |
|
1000 | 938 | name_parameter1 = 'id' |
|
1001 | 939 | format1 = 'int' |
|
1002 | 940 | if self.idImagcross == 0: |
|
1003 | 941 | self.idImagcross = 300 |
|
1004 | 942 | else: |
|
1005 | 943 | self.idImagcross = self.idImagcross + 1 |
|
1006 | 944 | value1 = int(self.idImagcross) |
|
1007 | 945 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1008 | 946 | |
|
1009 | 947 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
1010 | 948 | # opObj = puObj.getOpObjfromParamValue(value="RTIPlot") |
|
1011 | 949 | if opObj == None: |
|
1012 | 950 | pass |
|
1013 | 951 | else: |
|
1014 | 952 | name_parameter1 = 'id' |
|
1015 | 953 | format1 = 'int' |
|
1016 | 954 | if self.idImagrti == 0: |
|
1017 | 955 | self.idImagrti = 400 |
|
1018 | 956 | else: |
|
1019 | 957 | self.idImagrti = self.idImagrti + 1 |
|
1020 | 958 | value1 = int(self.idImagrti) |
|
1021 | 959 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1022 | 960 | |
|
1023 | 961 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
1024 | 962 | # opObj = puObj.getOpObjfromParamValue(value="CoherenceMap") |
|
1025 | 963 | if opObj == None: |
|
1026 | 964 | pass |
|
1027 | 965 | else: |
|
1028 | 966 | name_parameter1 = 'id' |
|
1029 | 967 | format1 = 'int' |
|
1030 | 968 | if self.idImagcoherence == 0: |
|
1031 | 969 | self.idImagcoherence = 500 |
|
1032 | 970 | else: |
|
1033 | 971 | self.idImagcoherence = self.idImagcoherence + 1 |
|
1034 | 972 | value1 = int(self.idImagcoherence) |
|
1035 | 973 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1036 | 974 | |
|
1037 | 975 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
1038 | 976 | # opObj = puObj.getOpObjfromParamValue(value="PowerProfilePlot") |
|
1039 | 977 | if opObj == None: |
|
1040 | 978 | pass |
|
1041 | 979 | else: |
|
1042 | 980 | name_parameter1 = 'id' |
|
1043 | 981 | format1 = 'int' |
|
1044 | 982 | if self.idImagpower == 0: |
|
1045 | 983 | self.idImagpower = 600 |
|
1046 | 984 | else: |
|
1047 | 985 | self.idImagpower = self.idImagpower + 1 |
|
1048 | 986 | value1 = int(self.idImagpower) |
|
1049 | 987 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1050 | 988 | |
|
1051 | 989 | opObj = puObj.getOperationObj(name='Noise') |
|
1052 | 990 | # opObj = puObj.getOpObjfromParamValue(value="Noise") |
|
1053 | 991 | if opObj == None: |
|
1054 | 992 | pass |
|
1055 | 993 | else: |
|
1056 | 994 | name_parameter1 = 'id' |
|
1057 | 995 | format1 = 'int' |
|
1058 | 996 | if self.idImagrtinoise == 0: |
|
1059 | 997 | self.idImagrtinoise = 700 |
|
1060 | 998 | else: |
|
1061 | 999 | self.idImagrtinoise = self.idImagrtinoise + 1 |
|
1062 | 1000 | value1 = int(self.idImagrtinoise) |
|
1063 | 1001 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1064 | 1002 | |
|
1065 | 1003 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
1066 | 1004 | # opObj = puObj.getOpObjfromParamValue(value="SpectraHeisScope") |
|
1067 | 1005 | if opObj == None: |
|
1068 | 1006 | pass |
|
1069 | 1007 | else: |
|
1070 | 1008 | name_parameter1 = 'id' |
|
1071 | 1009 | format1 = 'int' |
|
1072 | 1010 | if self.idImagspectraHeis == 0: |
|
1073 | 1011 | self.idImagspectraHeis = 800 |
|
1074 | 1012 | else: |
|
1075 | 1013 | self.idImagspectraHeis = self.idImagspectraHeis + 1 |
|
1076 | 1014 | value1 = int(self.idImagspectraHeis) |
|
1077 | 1015 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1078 | 1016 | |
|
1079 | 1017 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
1080 | 1018 | # opObj = puObj.getOpObjfromParamValue(value="RTIfromSpectraHeis") |
|
1081 | 1019 | if opObj == None: |
|
1082 | 1020 | pass |
|
1083 | 1021 | else: |
|
1084 | 1022 | name_parameter1 = 'id' |
|
1085 | 1023 | format1 = 'int' |
|
1086 | 1024 | if self.idImagrtiHeis == 0: |
|
1087 | 1025 | self.idImagrtiHeis = 900 |
|
1088 | 1026 | else: |
|
1089 | 1027 | self.idImagrtiHeis = self.idImagrtiHeis + 1 |
|
1090 | 1028 | value1 = int(self.idImagrtiHeis) |
|
1091 | 1029 | opObj.changeParameter(name=name_parameter1, value=value1, format=format1) |
|
1092 | 1030 | |
|
1093 | 1031 | @pyqtSignature("") |
|
1094 | 1032 | def on_specOpOk_clicked(self): |
|
1095 | 1033 | """ |
|
1096 | 1034 | AΓADE OPERACION SPECTRA |
|
1097 | 1035 | """ |
|
1098 | 1036 | |
|
1099 | 1037 | addFTP = False |
|
1100 | 1038 | checkPath = False |
|
1101 | 1039 | |
|
1102 | 1040 | self.actionSaveToolbar.setEnabled(False) |
|
1103 | 1041 | self.actionStarToolbar.setEnabled(False) |
|
1104 | 1042 | |
|
1105 | 1043 | puObj = self.getSelectedPUObj() |
|
1106 | 1044 | puObj.removeOperations() |
|
1107 | 1045 | |
|
1108 | 1046 | if self.specOpCebRadarfrequency.isChecked(): |
|
1109 | 1047 | value = self.specOpRadarfrequency.text() |
|
1110 | 1048 | format = 'float' |
|
1111 | 1049 | name_operation = 'setRadarFrequency' |
|
1112 | 1050 | name_parameter = 'frequency' |
|
1113 | 1051 | if not value == "": |
|
1114 | 1052 | try: |
|
1115 | 1053 | radarfreq = float(self.specOpRadarfrequency.text()) |
|
1116 | 1054 | except: |
|
1117 | 1055 | self.console.clear() |
|
1118 | 1056 | self.console.append("Write the parameter Radar Frequency type float") |
|
1119 | 1057 | return 0 |
|
1120 | 1058 | opObj = puObj.addOperation(name=name_operation) |
|
1121 | 1059 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1122 | 1060 | |
|
1123 | 1061 | |
|
1124 | 1062 | if self.proComDataType.currentText() == 'Voltage': |
|
1125 | 1063 | name_parameter = 'nFFTPoints' |
|
1126 | 1064 | value = self.specOpnFFTpoints.text() |
|
1127 | 1065 | name_parameter1 = 'nProfiles' |
|
1128 | 1066 | value1 = self.specOpProfiles.text() |
|
1129 | 1067 | name_parameter2 = 'ippFactor' |
|
1130 | 1068 | value2 = self.specOpippFactor.text() |
|
1131 | 1069 | format = 'int' |
|
1132 | 1070 | try: |
|
1133 | 1071 | value = int(self.specOpnFFTpoints.text()) |
|
1134 | 1072 | except: |
|
1135 | 1073 | self.console.clear() |
|
1136 | 1074 | self.console.append("Please Write the number of FFT") |
|
1137 | 1075 | return 0 |
|
1138 | 1076 | puObj.addParameter(name=name_parameter, value=value, format=format) |
|
1139 | 1077 | if not value1 == "": |
|
1140 | 1078 | try: |
|
1141 | 1079 | value1 = int(self.specOpProfiles.text()) |
|
1142 | 1080 | except: |
|
1143 | 1081 | self.console.clear() |
|
1144 | 1082 | self.console.append("Please Write the number of Profiles") |
|
1145 | 1083 | return 0 |
|
1146 | 1084 | puObj.addParameter(name=name_parameter1, value=value1, format=format) |
|
1147 | 1085 | if not value2 == "": |
|
1148 | 1086 | try: |
|
1149 | 1087 | value2 = int(self.specOpippFactor.text()) |
|
1150 | 1088 | except: |
|
1151 | 1089 | self.console.clear() |
|
1152 | 1090 | self.console.append("Please Write the Number of IppFactor") |
|
1153 | 1091 | puObj.addParameter(name=name_parameter2 , value=value2 , format=format) |
|
1154 | 1092 | |
|
1155 | 1093 | if self.specOpCebCrossSpectra.isChecked(): |
|
1156 | 1094 | name_parameter = 'pairsList' |
|
1157 | 1095 | format = 'pairslist' |
|
1158 | 1096 | value2 = self.specOppairsList.text() |
|
1159 | 1097 | puObj.addParameter(name=name_parameter, value=value2, format=format) |
|
1160 | 1098 | |
|
1161 | 1099 | if self.specOpCebHeights.isChecked(): |
|
1162 | 1100 | value = self.specOpHeights.text() |
|
1163 | 1101 | valueList = value.split(',') |
|
1164 | 1102 | format = 'float' |
|
1165 | 1103 | value0 = valueList[0] |
|
1166 | 1104 | value1 = valueList[1] |
|
1167 | 1105 | |
|
1168 | 1106 | if self.specOpComHeights.currentIndex() == 0: |
|
1169 | 1107 | name_operation = 'selectHeights' |
|
1170 | 1108 | name_parameter1 = 'minHei' |
|
1171 | 1109 | name_parameter2 = 'maxHei' |
|
1172 | 1110 | else: |
|
1173 | 1111 | name_operation = 'selectHeightsByIndex' |
|
1174 | 1112 | name_parameter1 = 'minIndex' |
|
1175 | 1113 | name_parameter2 = 'maxIndex' |
|
1176 | 1114 | opObj = puObj.addOperation(name=name_operation) |
|
1177 | 1115 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1178 | 1116 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1179 | 1117 | |
|
1180 | 1118 | if self.specOpCebChannel.isChecked(): |
|
1181 | 1119 | value = self.specOpChannel.text() |
|
1182 | 1120 | format = 'intlist' |
|
1183 | 1121 | if self.specOpComChannel.currentIndex() == 0: |
|
1184 | 1122 | name_operation = "selectChannels" |
|
1185 | 1123 | name_parameter = 'channelList' |
|
1186 | 1124 | else: |
|
1187 | 1125 | name_operation = "selectChannelsByIndex" |
|
1188 | 1126 | name_parameter = 'channelIndexList' |
|
1189 | 1127 | opObj = puObj.addOperation(name="selectChannels") |
|
1190 | 1128 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1191 | 1129 | |
|
1192 | 1130 | if self.specOpCebIncoherent.isChecked(): |
|
1193 | 1131 | value = self.specOpIncoherent.text() |
|
1194 | 1132 | name_operation = 'IncohInt' |
|
1195 | 1133 | optype = 'other' |
|
1196 | 1134 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1197 | 1135 | name_parameter = 'timeInterval' |
|
1198 | 1136 | format = 'float' |
|
1199 | 1137 | else: |
|
1200 | 1138 | name_parameter = 'n' |
|
1201 | 1139 | format = 'float' |
|
1202 | 1140 | |
|
1203 | 1141 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1204 | 1142 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1205 | 1143 | |
|
1206 | 1144 | if self.specOpCebRemoveDC.isChecked(): |
|
1207 | 1145 | name_operation = 'removeDC' |
|
1208 | 1146 | name_parameter = 'mode' |
|
1209 | 1147 | format = 'int' |
|
1210 | 1148 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1211 | 1149 | value = 1 |
|
1212 | 1150 | else: |
|
1213 | 1151 | value = 2 |
|
1214 | 1152 | opObj = puObj.addOperation(name=name_operation) |
|
1215 | 1153 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1216 | 1154 | |
|
1217 | 1155 | if self.specOpCebRemoveInt.isChecked(): |
|
1218 | 1156 | name_operation = 'removeInterference' |
|
1219 | 1157 | opObj = puObj.addOperation(name=name_operation) |
|
1220 | 1158 | |
|
1221 | 1159 | |
|
1222 | 1160 | if self.specOpCebgetNoise.isChecked(): |
|
1223 | 1161 | value = self.specOpgetNoise.text() |
|
1224 | 1162 | valueList = value.split(',') |
|
1225 | 1163 | format = 'float' |
|
1226 | 1164 | name_operation = "getNoise" |
|
1227 | 1165 | opObj = puObj.addOperation(name=name_operation) |
|
1228 | 1166 | |
|
1229 | 1167 | if not value == '': |
|
1230 | 1168 | valueList = value.split(',') |
|
1231 | 1169 | length = len(valueList) |
|
1232 | 1170 | if length == 1: |
|
1233 | 1171 | try: |
|
1234 | 1172 | value1 = float(valueList[0]) |
|
1235 | 1173 | except: |
|
1236 | 1174 | self.console.clear() |
|
1237 | 1175 | self.console.append("Please Write correct parameter Get Noise") |
|
1238 | 1176 | return 0 |
|
1239 | 1177 | name1 = 'minHei' |
|
1240 | 1178 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1241 | 1179 | elif length == 2: |
|
1242 | 1180 | try: |
|
1243 | 1181 | value1 = float(valueList[0]) |
|
1244 | 1182 | value2 = float(valueList[1]) |
|
1245 | 1183 | except: |
|
1246 | 1184 | self.console.clear() |
|
1247 | 1185 | self.console.append("Please Write corrects parameter Get Noise") |
|
1248 | 1186 | return 0 |
|
1249 | 1187 | name1 = 'minHei' |
|
1250 | 1188 | name2 = 'maxHei' |
|
1251 | 1189 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1252 | 1190 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1253 | 1191 | |
|
1254 | 1192 | elif length == 3: |
|
1255 | 1193 | try: |
|
1256 | 1194 | value1 = float(valueList[0]) |
|
1257 | 1195 | value2 = float(valueList[1]) |
|
1258 | 1196 | value3 = float(valueList[2]) |
|
1259 | 1197 | except: |
|
1260 | 1198 | self.console.clear() |
|
1261 | 1199 | self.console.append("Please Write corrects parameter Get Noise") |
|
1262 | 1200 | return 0 |
|
1263 | 1201 | name1 = 'minHei' |
|
1264 | 1202 | name2 = 'maxHei' |
|
1265 | 1203 | name3 = 'minVel' |
|
1266 | 1204 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1267 | 1205 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1268 | 1206 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1269 | 1207 | |
|
1270 | 1208 | elif length == 4: |
|
1271 | 1209 | try: |
|
1272 | 1210 | value1 = float(valueList[0]) |
|
1273 | 1211 | value2 = float(valueList[1]) |
|
1274 | 1212 | value3 = float(valueList[2]) |
|
1275 | 1213 | value4 = float(valueList[3]) |
|
1276 | 1214 | except: |
|
1277 | 1215 | self.console.clear() |
|
1278 | 1216 | self.console.append("Please Write corrects parameter Get Noise") |
|
1279 | 1217 | return 0 |
|
1280 | 1218 | name1 = 'minHei' |
|
1281 | 1219 | name2 = 'maxHei' |
|
1282 | 1220 | name3 = 'minVel' |
|
1283 | 1221 | name4 = 'maxVel' |
|
1284 | 1222 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1285 | 1223 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1286 | 1224 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1287 | 1225 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1288 | 1226 | |
|
1289 | 1227 | elif length > 4: |
|
1290 | 1228 | self.console.clear() |
|
1291 | 1229 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1292 | 1230 | return 0 |
|
1293 | 1231 | |
|
1294 | 1232 | #-----Spectra Plot----- |
|
1295 | 1233 | if self.specGraphCebSpectraplot.isChecked(): |
|
1296 | 1234 | name_operation = 'SpectraPlot' |
|
1297 | 1235 | optype = 'other' |
|
1298 | 1236 | name_parameter = 'type' |
|
1299 | 1237 | value = 'SpectraPlot' |
|
1300 | 1238 | format = 'str' |
|
1301 | 1239 | if self.idImagspectra == 0: |
|
1302 | 1240 | self.idImagspectra = 200 |
|
1303 | 1241 | else: |
|
1304 | 1242 | self.idImagspectra = self.idImagspectra + 1 |
|
1305 | 1243 | name_parameter1 = 'id' |
|
1306 | 1244 | value1 = int(self.idImagspectra) |
|
1307 | 1245 | format1 = 'int' |
|
1308 | 1246 | |
|
1309 | 1247 | format = 'str' |
|
1310 | 1248 | |
|
1311 | 1249 | channelList = self.specGgraphChannelList.text() |
|
1312 | 1250 | xvalue = self.specGgraphFreq.text() |
|
1313 | 1251 | yvalue = self.specGgraphHeight.text() |
|
1314 | 1252 | zvalue = self.specGgraphDbsrange.text() |
|
1315 | 1253 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1316 | 1254 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1317 | 1255 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
1318 | 1256 | |
|
1319 | 1257 | if not channelList == '': |
|
1320 | 1258 | name_parameter = 'channelList' |
|
1321 | 1259 | format = 'intlist' |
|
1322 | 1260 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
1323 | 1261 | |
|
1324 | 1262 | if not xvalue == '': |
|
1325 | 1263 | xvalueList = xvalue.split(',') |
|
1326 | 1264 | try: |
|
1327 | 1265 | value1 = float(xvalueList[0]) |
|
1328 | 1266 | value2 = float(xvalueList[1]) |
|
1329 | 1267 | except: |
|
1330 | 1268 | self.console.clear() |
|
1331 | 1269 | self.console.append("Please Write corrects parameter freq") |
|
1332 | 1270 | return 0 |
|
1333 | 1271 | name1 = 'xmin' |
|
1334 | 1272 | name2 = 'xmax' |
|
1335 | 1273 | format = 'float' |
|
1336 | 1274 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1337 | 1275 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1338 | 1276 | #------specGgraphHeight--- |
|
1339 | 1277 | if not yvalue == '': |
|
1340 | 1278 | yvalueList = yvalue.split(",") |
|
1341 | 1279 | try: |
|
1342 | 1280 | value1 = float(yvalueList[0]) |
|
1343 | 1281 | value2 = float(yvalueList[1]) |
|
1344 | 1282 | except: |
|
1345 | 1283 | self.console.clear() |
|
1346 | 1284 | self.console.append("Please Write corrects parameter Height") |
|
1347 | 1285 | return 0 |
|
1348 | 1286 | name1 = 'ymin' |
|
1349 | 1287 | name2 = 'ymax' |
|
1350 | 1288 | format = 'float' |
|
1351 | 1289 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1352 | 1290 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1353 | 1291 | |
|
1354 | 1292 | if not zvalue == '': |
|
1355 | 1293 | zvalueList = zvalue.split(",") |
|
1356 | 1294 | try: |
|
1357 | 1295 | value = float(zvalueList[0]) |
|
1358 | 1296 | value = float(zvalueList[1]) |
|
1359 | 1297 | except: |
|
1360 | 1298 | self.console.clear() |
|
1361 | 1299 | self.console.append("Please Write corrects parameter Dbsrange") |
|
1362 | 1300 | return 0 |
|
1363 | 1301 | format = 'float' |
|
1364 | 1302 | opObj.addParameter(name='zmin', value=zvalueList[0], format=format) |
|
1365 | 1303 | opObj.addParameter(name='zmax', value=zvalueList[1], format=format) |
|
1366 | 1304 | |
|
1367 | 1305 | if self.specGraphSaveSpectra.isChecked(): |
|
1368 | 1306 | checkPath = True |
|
1369 | 1307 | name_parameter1 = 'save' |
|
1370 | 1308 | name_parameter2 = 'figpath' |
|
1371 | 1309 | name_parameter3 = 'figfile' |
|
1372 | 1310 | value1 = '1' |
|
1373 | 1311 | value2 = self.specGraphPath.text() |
|
1374 | 1312 | value3 = self.specGraphPrefix.text() |
|
1375 | 1313 | format1 = 'bool' |
|
1376 | 1314 | format2 = 'str' |
|
1377 | 1315 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
1378 | 1316 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
1379 | 1317 | opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
1380 | 1318 | |
|
1381 | 1319 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
1382 | 1320 | |
|
1383 | 1321 | if self.specGraphftpSpectra.isChecked(): |
|
1384 | 1322 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1385 | 1323 | self.addFTPConf2Operation(puObj, opObj) |
|
1386 | 1324 | addFTP = True |
|
1387 | 1325 | |
|
1388 | 1326 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1389 | 1327 | name_operation = 'CrossSpectraPlot' |
|
1390 | 1328 | optype = 'other' |
|
1391 | 1329 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1392 | 1330 | # opObj.addParameter(name='type', value="CrossSpectraPlot", format='str') |
|
1393 | 1331 | opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1394 | 1332 | opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1395 | 1333 | opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1396 | 1334 | |
|
1397 | 1335 | if self.idImagcross == 0: |
|
1398 | 1336 | self.idImagcross = 300 |
|
1399 | 1337 | else: |
|
1400 | 1338 | self.idImagcross = self.idImagcross + 1 |
|
1401 | 1339 | value1 = int(self.idImagcross) |
|
1402 | 1340 | channelList = self.specGgraphChannelList.text() |
|
1403 | 1341 | xvalue = self.specGgraphFreq.text() |
|
1404 | 1342 | yvalue = self.specGgraphHeight.text() |
|
1405 | 1343 | zvalue = self.specGgraphDbsrange.text() |
|
1406 | 1344 | |
|
1407 | 1345 | opObj.addParameter(name='id', value=value1, format='int') |
|
1408 | 1346 | |
|
1409 | 1347 | if self.specGgraphChannelList.isModified(): |
|
1410 | 1348 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1411 | 1349 | |
|
1412 | 1350 | if not xvalue == '': |
|
1413 | 1351 | xvalueList = xvalue.split(',') |
|
1414 | 1352 | try: |
|
1415 | 1353 | value = float(xvalueList[0]) |
|
1416 | 1354 | value = float(xvalueList[1]) |
|
1417 | 1355 | except: |
|
1418 | 1356 | return 0 |
|
1419 | 1357 | format = 'float' |
|
1420 | 1358 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
1421 | 1359 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
1422 | 1360 | |
|
1423 | 1361 | if not yvalue == '': |
|
1424 | 1362 | yvalueList = yvalue.split(",") |
|
1425 | 1363 | try: |
|
1426 | 1364 | value = float(yvalueList[0]) |
|
1427 | 1365 | value = float(yvalueList[1]) |
|
1428 | 1366 | except: |
|
1429 | 1367 | return 0 |
|
1430 | 1368 | format = 'float' |
|
1431 | 1369 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
1432 | 1370 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
1433 | 1371 | |
|
1434 | 1372 | |
|
1435 | 1373 | if not zvalue == '': |
|
1436 | 1374 | zvalueList = zvalue.split(",") |
|
1437 | 1375 | try: |
|
1438 | 1376 | value = float(zvalueList[0]) |
|
1439 | 1377 | value = float(zvalueList[1]) |
|
1440 | 1378 | except: |
|
1441 | 1379 | return 0 |
|
1442 | 1380 | opObj.addParameter(name='zmin', value=zvalueList[0], format='float') |
|
1443 | 1381 | opObj.addParameter(name='zmax', value=zvalueList[1], format='float') |
|
1444 | 1382 | |
|
1445 | 1383 | if self.specGraphSaveCross.isChecked(): |
|
1446 | 1384 | checkPath = True |
|
1447 | 1385 | opObj.addParameter(name='save', value='1', format='bool') |
|
1448 | 1386 | opObj.addParameter(name='figpath', value=self.specGraphPath.text(), format='str') |
|
1449 | 1387 | value = self.specGraphPrefix.text() |
|
1450 | 1388 | if not value == "": |
|
1451 | 1389 | try: |
|
1452 | 1390 | value = str(self.specGraphPrefix.text()) |
|
1453 | 1391 | except: |
|
1454 | 1392 | self.console.clear() |
|
1455 | 1393 | self.console.append("Please Write prefix") |
|
1456 | 1394 | return 0 |
|
1457 | 1395 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1458 | 1396 | # opObj.addParameter(name='figfile', value=self.specGraphPrefix.text(), format='str') |
|
1459 | 1397 | if self.specGraphftpCross.isChecked(): |
|
1460 | 1398 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1461 | 1399 | self.addFTPConf2Operation(puObj, opObj) |
|
1462 | 1400 | addFTP = True |
|
1463 | 1401 | |
|
1464 | 1402 | if self.specGraphCebRTIplot.isChecked(): |
|
1465 | 1403 | name_operation = 'RTIPlot' |
|
1466 | 1404 | optype = 'other' |
|
1467 | 1405 | name_parameter = 'type' |
|
1468 | 1406 | value = 'RTIPlot' |
|
1469 | 1407 | format = 'str' |
|
1470 | 1408 | |
|
1471 | 1409 | if self.idImagrti == 0: |
|
1472 | 1410 | self.idImagrti = 400 |
|
1473 | 1411 | else: |
|
1474 | 1412 | self.idImagrti = self.idImagrti + 1 |
|
1475 | 1413 | |
|
1476 | 1414 | name_parameter1 = 'id' |
|
1477 | 1415 | value1 = int(self.idImagrti) |
|
1478 | 1416 | format1 = 'int' |
|
1479 | 1417 | |
|
1480 | 1418 | format = 'str' |
|
1481 | 1419 | |
|
1482 | 1420 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1483 | 1421 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1484 | 1422 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
1485 | 1423 | |
|
1486 | 1424 | channelList = self.specGgraphChannelList.text() |
|
1487 | 1425 | xvalue = self.specGgraphTminTmax.text() |
|
1488 | 1426 | yvalue = self.specGgraphHeight.text() |
|
1489 | 1427 | zvalue = self.specGgraphDbsrange.text() |
|
1490 | 1428 | timerange = self.specGgraphTimeRange.text() |
|
1491 | 1429 | |
|
1492 | 1430 | if not channelList == '': |
|
1493 | 1431 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1494 | 1432 | |
|
1495 | 1433 | if not xvalue == '': |
|
1496 | 1434 | xvalueList = xvalue.split(',') |
|
1497 | 1435 | try: |
|
1498 | 1436 | value = float(xvalueList[0]) |
|
1499 | 1437 | value = float(xvalueList[1]) |
|
1500 | 1438 | except: |
|
1501 | 1439 | return 0 |
|
1502 | 1440 | format = 'float' |
|
1503 | 1441 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
1504 | 1442 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
1505 | 1443 | |
|
1506 | 1444 | if not timerange == '': |
|
1507 | 1445 | format = 'int' |
|
1508 | 1446 | try: |
|
1509 | 1447 | timerange = int(timerange) |
|
1510 | 1448 | except: |
|
1511 | 1449 | return 0 |
|
1512 | 1450 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
1513 | 1451 | |
|
1514 | 1452 | |
|
1515 | 1453 | if not yvalue == '': |
|
1516 | 1454 | yvalueList = yvalue.split(",") |
|
1517 | 1455 | try: |
|
1518 | 1456 | value = float(yvalueList[0]) |
|
1519 | 1457 | value = float(yvalueList[1]) |
|
1520 | 1458 | except: |
|
1521 | 1459 | return 0 |
|
1522 | 1460 | format = 'float' |
|
1523 | 1461 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
1524 | 1462 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
1525 | 1463 | |
|
1526 | 1464 | if not zvalue == '': |
|
1527 | 1465 | zvalueList = zvalue.split(",") |
|
1528 | 1466 | try: |
|
1529 | 1467 | value = float(zvalueList[0]) |
|
1530 | 1468 | value = float(zvalueList[1]) |
|
1531 | 1469 | except: |
|
1532 | 1470 | return 0 |
|
1533 | 1471 | format = 'float' |
|
1534 | 1472 | opObj.addParameter(name='zmin', value=zvalueList[0], format=format) |
|
1535 | 1473 | opObj.addParameter(name='zmax', value=zvalueList[1], format=format) |
|
1536 | 1474 | |
|
1537 | 1475 | if self.specGraphSaveRTIplot.isChecked(): |
|
1538 | 1476 | checkPath = True |
|
1539 | 1477 | opObj.addParameter(name='save', value='1', format='bool') |
|
1540 | 1478 | opObj.addParameter(name='figpath', value=self.specGraphPath.text(), format='str') |
|
1541 | 1479 | value = self.specGraphPrefix.text() |
|
1542 | 1480 | if not value == "": |
|
1543 | 1481 | try: |
|
1544 | 1482 | value = str(self.specGraphPrefix.text()) |
|
1545 | 1483 | except: |
|
1546 | 1484 | self.console.clear() |
|
1547 | 1485 | self.console.append("Please Write prefix") |
|
1548 | 1486 | return 0 |
|
1549 | 1487 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1550 | 1488 | |
|
1551 | 1489 | # test_ftp |
|
1552 | 1490 | if self.specGraphftpRTIplot.isChecked(): |
|
1553 | 1491 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1554 | 1492 | self.addFTPConf2Operation(puObj, opObj) |
|
1555 | 1493 | addFTP = True |
|
1556 | 1494 | |
|
1557 | 1495 | if self.specGraphCebCoherencmap.isChecked(): |
|
1558 | 1496 | name_operation = 'CoherenceMap' |
|
1559 | 1497 | optype = 'other' |
|
1560 | 1498 | name_parameter = 'type' |
|
1561 | 1499 | value = 'CoherenceMap' |
|
1562 | 1500 | format = 'str' |
|
1563 | 1501 | if self.idImagcoherence == 0: |
|
1564 | 1502 | self.idImagcoherence = 500 |
|
1565 | 1503 | else: |
|
1566 | 1504 | self.idImagcoherence = self.idImagcoherence + 1 |
|
1567 | 1505 | |
|
1568 | 1506 | name_parameter1 = 'id' |
|
1569 | 1507 | value1 = int(self.idImagcoherence) |
|
1570 | 1508 | format1 = 'int' |
|
1571 | 1509 | |
|
1572 | 1510 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1573 | 1511 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1574 | 1512 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1575 | 1513 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1576 | 1514 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
1577 | 1515 | |
|
1578 | 1516 | channelList = self.specGgraphChannelList.text() |
|
1579 | 1517 | if not channelList == '': |
|
1580 | 1518 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1581 | 1519 | |
|
1582 | 1520 | timerange = self.specGgraphTimeRange.text() |
|
1583 | 1521 | if not timerange == '': |
|
1584 | 1522 | try: |
|
1585 | 1523 | timerange = int(timerange) |
|
1586 | 1524 | except: |
|
1587 | 1525 | return 0 |
|
1588 | 1526 | format = 'int' |
|
1589 | 1527 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
1590 | 1528 | |
|
1591 | 1529 | xvalue = self.specGgraphTminTmax.text() |
|
1592 | 1530 | if not xvalue == '': |
|
1593 | 1531 | xvalueList = xvalue.split(',') |
|
1594 | 1532 | try: |
|
1595 | 1533 | value = float(xvalueList[0]) |
|
1596 | 1534 | value = float(xvalueList[1]) |
|
1597 | 1535 | except: |
|
1598 | 1536 | return 0 |
|
1599 | 1537 | format = 'float' |
|
1600 | 1538 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
1601 | 1539 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
1602 | 1540 | |
|
1603 | 1541 | yvalue = self.specGgraphHeight.text() |
|
1604 | 1542 | if not yvalue == '': |
|
1605 | 1543 | yvalueList = yvalue.split(",") |
|
1606 | 1544 | try: |
|
1607 | 1545 | value = float(yvalueList[0]) |
|
1608 | 1546 | value = float(yvalueList[1]) |
|
1609 | 1547 | except: |
|
1610 | 1548 | return 0 |
|
1611 | 1549 | format = 'float' |
|
1612 | 1550 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
1613 | 1551 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
1614 | 1552 | |
|
1615 | 1553 | zvalue = self.specGgraphmagnitud.text() |
|
1616 | 1554 | if not zvalue == '': |
|
1617 | 1555 | zvalueList = zvalue.split(",") |
|
1618 | 1556 | try: |
|
1619 | 1557 | value = float(zvalueList[0]) |
|
1620 | 1558 | value = float(zvalueList[1]) |
|
1621 | 1559 | except: |
|
1622 | 1560 | return 0 |
|
1623 | 1561 | opObj.addParameter(name='zmin', value=zvalueList[0], format='float') |
|
1624 | 1562 | opObj.addParameter(name='zmax', value=zvalueList[1], format='float') |
|
1625 | 1563 | |
|
1626 | 1564 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1627 | 1565 | checkPath = True |
|
1628 | 1566 | opObj.addParameter(name='save', value='1', format='bool') |
|
1629 | 1567 | opObj.addParameter(name='figpath', value=self.specGraphPath.text(), format='str') |
|
1630 | 1568 | value = self.specGraphPrefix.text() |
|
1631 | 1569 | if not value == "": |
|
1632 | 1570 | try: |
|
1633 | 1571 | value = str(self.specGraphPrefix.text()) |
|
1634 | 1572 | except: |
|
1635 | 1573 | self.console.clear() |
|
1636 | 1574 | self.console.append("Please Write prefix") |
|
1637 | 1575 | return 0 |
|
1638 | 1576 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1639 | 1577 | |
|
1640 | 1578 | # test_ftp |
|
1641 | 1579 | if self.specGraphftpCoherencemap.isChecked(): |
|
1642 | 1580 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1643 | 1581 | self.addFTPConf2Operation(puObj, opObj) |
|
1644 | 1582 | addFTP = True |
|
1645 | 1583 | |
|
1646 | 1584 | if self.specGraphPowerprofile.isChecked(): |
|
1647 | 1585 | name_operation = 'PowerProfilePlot' |
|
1648 | 1586 | optype = 'other' |
|
1649 | 1587 | name_parameter = 'type' |
|
1650 | 1588 | value = 'PowerProfilePlot' |
|
1651 | 1589 | format = 'str' |
|
1652 | 1590 | |
|
1653 | 1591 | if self.idImagpower == 0: |
|
1654 | 1592 | self.idImagpower = 600 |
|
1655 | 1593 | else: |
|
1656 | 1594 | self.idImagpower = self.idImagpower + 1 |
|
1657 | 1595 | value1 = int(self.idImagpower) |
|
1658 | 1596 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1659 | 1597 | # opObj.addParameter(name=name_parameter, value=value, format='str') |
|
1660 | 1598 | opObj.addParameter(name='id', value=value1, format='int') |
|
1661 | 1599 | |
|
1662 | 1600 | channelList = self.specGgraphChannelList.text() |
|
1663 | 1601 | if not channelList == '': |
|
1664 | 1602 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1665 | 1603 | |
|
1666 | 1604 | xvalue = self.specGgraphDbsrange.text() |
|
1667 | 1605 | if not xvalue == '': |
|
1668 | 1606 | xvalueList = xvalue.split(',') |
|
1669 | 1607 | try: |
|
1670 | 1608 | value = float(xvalueList[0]) |
|
1671 | 1609 | value = float(xvalueList[1]) |
|
1672 | 1610 | except: |
|
1673 | 1611 | return 0 |
|
1674 | 1612 | format = 'float' |
|
1675 | 1613 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
1676 | 1614 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
1677 | 1615 | |
|
1678 | 1616 | yvalue = self.specGgraphHeight.text() |
|
1679 | 1617 | if not yvalue == '': |
|
1680 | 1618 | yvalueList = yvalue.split(",") |
|
1681 | 1619 | try: |
|
1682 | 1620 | value = float(yvalueList[0]) |
|
1683 | 1621 | value = float(yvalueList[1]) |
|
1684 | 1622 | except: |
|
1685 | 1623 | return 0 |
|
1686 | 1624 | format = 'float' |
|
1687 | 1625 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
1688 | 1626 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
1689 | 1627 | |
|
1690 | 1628 | |
|
1691 | 1629 | if self.specGraphSavePowerprofile.isChecked(): |
|
1692 | 1630 | checkPath = True |
|
1693 | 1631 | opObj.addParameter(name='save', value='1', format='bool') |
|
1694 | 1632 | opObj.addParameter(name='figpath', value=self.specGraphPath.text(), format='str') |
|
1695 | 1633 | value = self.specGraphPrefix.text() |
|
1696 | 1634 | if not value == "": |
|
1697 | 1635 | try: |
|
1698 | 1636 | value = str(self.specGraphPrefix.text()) |
|
1699 | 1637 | except: |
|
1700 | 1638 | self.console.clear() |
|
1701 | 1639 | self.console.append("Please Write prefix") |
|
1702 | 1640 | return 0 |
|
1703 | 1641 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1704 | 1642 | |
|
1705 | 1643 | |
|
1706 | 1644 | if self.specGraphftpPowerprofile.isChecked(): |
|
1707 | 1645 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1708 | 1646 | self.addFTPConf2Operation(puObj, opObj) |
|
1709 | 1647 | addFTP = True |
|
1710 | 1648 | # rti noise |
|
1711 | 1649 | |
|
1712 | 1650 | if self.specGraphCebRTInoise.isChecked(): |
|
1713 | 1651 | name_operation = 'Noise' |
|
1714 | 1652 | optype = 'other' |
|
1715 | 1653 | name_parameter = 'type' |
|
1716 | 1654 | value = 'Noise' |
|
1717 | 1655 | format = 'str' |
|
1718 | 1656 | |
|
1719 | 1657 | if self.idImagrtinoise == 0: |
|
1720 | 1658 | self.idImagrtinoise = 700 |
|
1721 | 1659 | else: |
|
1722 | 1660 | self.idImagrtinoise = self.idImagrtinoise + 1 |
|
1723 | 1661 | |
|
1724 | 1662 | name_parameter1 = 'id' |
|
1725 | 1663 | value1 = int(self.idImagrtinoise) |
|
1726 | 1664 | format1 = 'int' |
|
1727 | 1665 | format = 'str' |
|
1728 | 1666 | |
|
1729 | 1667 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1730 | 1668 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1731 | 1669 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
1732 | 1670 | |
|
1733 | 1671 | channelList = self.specGgraphChannelList.text() |
|
1734 | 1672 | xvalue = self.specGgraphTminTmax.text() |
|
1735 | 1673 | yvalue = self.specGgraphDbsrange.text() |
|
1736 | 1674 | timerange = self.specGgraphTimeRange.text() |
|
1737 | 1675 | |
|
1738 | 1676 | |
|
1739 | 1677 | if not channelList == '': |
|
1740 | 1678 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1741 | 1679 | |
|
1742 | 1680 | if not timerange == '': |
|
1743 | 1681 | format = 'int' |
|
1744 | 1682 | try: |
|
1745 | 1683 | timerange = int(timerange) |
|
1746 | 1684 | except: |
|
1747 | 1685 | return 0 |
|
1748 | 1686 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
1749 | 1687 | |
|
1750 | 1688 | if not xvalue == '': |
|
1751 | 1689 | xvalueList = xvalue.split(',') |
|
1752 | 1690 | try: |
|
1753 | 1691 | value = float(xvalueList[0]) |
|
1754 | 1692 | value = float(xvalueList[1]) |
|
1755 | 1693 | except: |
|
1756 | 1694 | return 0 |
|
1757 | 1695 | format = 'float' |
|
1758 | 1696 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
1759 | 1697 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
1760 | 1698 | |
|
1761 | 1699 | if not yvalue == '': |
|
1762 | 1700 | yvalueList = yvalue.split(",") |
|
1763 | 1701 | try: |
|
1764 | 1702 | value = float(yvalueList[0]) |
|
1765 | 1703 | value = float(yvalueList[1]) |
|
1766 | 1704 | except: |
|
1767 | 1705 | return 0 |
|
1768 | 1706 | format = 'float' |
|
1769 | 1707 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
1770 | 1708 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
1771 | 1709 | |
|
1772 | 1710 | if self.specGraphSaveRTInoise.isChecked(): |
|
1773 | 1711 | checkPath = True |
|
1774 | 1712 | opObj.addParameter(name='save', value='1', format='bool') |
|
1775 | 1713 | opObj.addParameter(name='figpath', value=self.specGraphPath.text(), format='str') |
|
1776 | 1714 | value = self.specGraphPrefix.text() |
|
1777 | 1715 | if not value == "": |
|
1778 | 1716 | try: |
|
1779 | 1717 | value = str(self.specGraphPrefix.text()) |
|
1780 | 1718 | except: |
|
1781 | 1719 | self.console.clear() |
|
1782 | 1720 | self.console.append("Please Write prefix") |
|
1783 | 1721 | return 0 |
|
1784 | 1722 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1785 | 1723 | |
|
1786 | 1724 | # test_ftp |
|
1787 | 1725 | if self.specGraphftpRTInoise.isChecked(): |
|
1788 | 1726 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1789 | 1727 | self.addFTPConf2Operation(puObj, opObj) |
|
1790 | 1728 | addFTP = True |
|
1791 | 1729 | |
|
1792 | 1730 | localfolder = None |
|
1793 | 1731 | if checkPath: |
|
1794 | 1732 | localfolder = str(self.specGraphPath.text()) |
|
1795 | 1733 | if localfolder == '': |
|
1796 | 1734 | self.console.clear() |
|
1797 | 1735 | self.console.append("Graphic path should be defined") |
|
1798 | 1736 | return 0 |
|
1799 | 1737 | |
|
1800 | 1738 | if addFTP: |
|
1801 | 1739 | if not localfolder: |
|
1802 | 1740 | self.console.clear() |
|
1803 | 1741 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1804 | 1742 | return 0 |
|
1805 | 1743 | |
|
1806 | 1744 | if not self.temporalFTP.create: |
|
1807 | 1745 | self.temporalFTP.setwithoutconfiguration() |
|
1808 | 1746 | |
|
1809 | 1747 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
1810 | 1748 | self.createFTPProcUnitView(server, username, password, remotefolder, |
|
1811 | 1749 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
1812 | 1750 | localfolder=localfolder) |
|
1813 | 1751 | else: |
|
1814 | 1752 | self.removeFTPProcUnitView() |
|
1815 | 1753 | |
|
1816 | 1754 | # if something happend |
|
1817 | 1755 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1818 | 1756 | if parms_ok: |
|
1819 | 1757 | name_operation = 'SpectraWriter' |
|
1820 | 1758 | optype = 'other' |
|
1821 | 1759 | name_parameter1 = 'path' |
|
1822 | 1760 | name_parameter2 = 'blocksPerFile' |
|
1823 | 1761 | name_parameter3 = 'profilesPerBlock' |
|
1824 | 1762 | value1 = output_path |
|
1825 | 1763 | value2 = blocksperfile |
|
1826 | 1764 | value3 = profilesperblock |
|
1827 | 1765 | format = "int" |
|
1828 | 1766 | |
|
1829 | 1767 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1830 | 1768 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1831 | 1769 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1832 | 1770 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1833 | 1771 | |
|
1834 | 1772 | self.showPUSpectraProperties(puObj) |
|
1835 | 1773 | |
|
1836 | 1774 | self.console.clear() |
|
1837 | 1775 | self.console.append("If you want to save your project") |
|
1838 | 1776 | self.console.append("click on your project name in the Tree Project Explorer") |
|
1839 | 1777 | |
|
1840 | 1778 | self.actionSaveToolbar.setEnabled(True) |
|
1841 | 1779 | self.actionStarToolbar.setEnabled(True) |
|
1842 | 1780 | |
|
1843 | 1781 | return 1 |
|
1844 | 1782 | |
|
1845 | 1783 | """ |
|
1846 | 1784 | Spectra Graph |
|
1847 | 1785 | """ |
|
1848 | 1786 | @pyqtSignature("int") |
|
1849 | 1787 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1850 | 1788 | |
|
1851 | 1789 | if p0 == 2: |
|
1852 | 1790 | self.specGgraphChannelList.setEnabled(True) |
|
1853 | 1791 | self.specGgraphFreq.setEnabled(True) |
|
1854 | 1792 | self.specGgraphHeight.setEnabled(True) |
|
1855 | 1793 | self.specGgraphDbsrange.setEnabled(True) |
|
1856 | 1794 | if p0 == 0: |
|
1857 | 1795 | self.specGgraphFreq.setEnabled(False) |
|
1858 | 1796 | self.specGgraphHeight.setEnabled(False) |
|
1859 | 1797 | self.specGgraphDbsrange.setEnabled(False) |
|
1860 | 1798 | |
|
1861 | 1799 | |
|
1862 | 1800 | @pyqtSignature("int") |
|
1863 | 1801 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1864 | 1802 | |
|
1865 | 1803 | if p0 == 2: |
|
1866 | 1804 | self.specGgraphFreq.setEnabled(True) |
|
1867 | 1805 | self.specGgraphHeight.setEnabled(True) |
|
1868 | 1806 | self.specGgraphDbsrange.setEnabled(True) |
|
1869 | 1807 | if p0 == 0: |
|
1870 | 1808 | self.specGgraphFreq.setEnabled(False) |
|
1871 | 1809 | self.specGgraphHeight.setEnabled(False) |
|
1872 | 1810 | self.specGgraphDbsrange.setEnabled(False) |
|
1873 | 1811 | |
|
1874 | 1812 | @pyqtSignature("int") |
|
1875 | 1813 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1876 | 1814 | |
|
1877 | 1815 | if p0 == 2: |
|
1878 | 1816 | self.specGgraphChannelList.setEnabled(True) |
|
1879 | 1817 | self.specGgraphTminTmax.setEnabled(True) |
|
1880 | 1818 | self.specGgraphHeight.setEnabled(True) |
|
1881 | 1819 | self.specGgraphDbsrange.setEnabled(True) |
|
1882 | 1820 | self.specGgraphTimeRange.setEnabled(True) |
|
1883 | 1821 | |
|
1884 | 1822 | if p0 == 0: |
|
1885 | 1823 | self.specGgraphTminTmax.setEnabled(False) |
|
1886 | 1824 | self.specGgraphHeight.setEnabled(False) |
|
1887 | 1825 | self.specGgraphDbsrange.setEnabled(False) |
|
1888 | 1826 | self.specGgraphTimeRange.setEnabled(False) |
|
1889 | 1827 | |
|
1890 | 1828 | |
|
1891 | 1829 | @pyqtSignature("int") |
|
1892 | 1830 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1893 | 1831 | if p0 == 2: |
|
1894 | 1832 | self.specGgraphChannelList.setEnabled(True) |
|
1895 | 1833 | self.specGgraphTminTmax.setEnabled(True) |
|
1896 | 1834 | self.specGgraphDbsrange.setEnabled(True) |
|
1897 | 1835 | self.specGgraphTimeRange.setEnabled(True) |
|
1898 | 1836 | |
|
1899 | 1837 | if p0 == 0: |
|
1900 | 1838 | self.specGgraphTminTmax.setEnabled(False) |
|
1901 | 1839 | self.specGgraphDbsrange.setEnabled(False) |
|
1902 | 1840 | self.specGgraphTimeRange.setEnabled(False) |
|
1903 | 1841 | |
|
1904 | 1842 | |
|
1905 | 1843 | |
|
1906 | 1844 | |
|
1907 | 1845 | @pyqtSignature("int") |
|
1908 | 1846 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1909 | 1847 | |
|
1910 | 1848 | if p0 == 2: |
|
1911 | 1849 | self.specGgraphTminTmax.setEnabled(True) |
|
1912 | 1850 | self.specGgraphHeight.setEnabled(True) |
|
1913 | 1851 | self.specGgraphmagnitud.setEnabled(True) |
|
1914 | 1852 | self.specGgraphTimeRange.setEnabled(True) |
|
1915 | 1853 | |
|
1916 | 1854 | if p0 == 0: |
|
1917 | 1855 | self.specGgraphTminTmax.setEnabled(False) |
|
1918 | 1856 | self.specGgraphHeight.setEnabled(False) |
|
1919 | 1857 | self.specGgraphmagnitud.setEnabled(False) |
|
1920 | 1858 | self.specGgraphTimeRange.setEnabled(False) |
|
1921 | 1859 | |
|
1922 | 1860 | |
|
1923 | 1861 | |
|
1924 | 1862 | |
|
1925 | 1863 | @pyqtSignature("int") |
|
1926 | 1864 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1927 | 1865 | |
|
1928 | 1866 | if p0 == 2: |
|
1929 | 1867 | |
|
1930 | 1868 | self.specGgraphHeight.setEnabled(True) |
|
1931 | 1869 | self.specGgraphDbsrange.setEnabled(True) |
|
1932 | 1870 | if p0 == 0: |
|
1933 | 1871 | self.specGgraphHeight.setEnabled(False) |
|
1934 | 1872 | self.specGgraphDbsrange.setEnabled(False) |
|
1935 | 1873 | |
|
1936 | 1874 | @pyqtSignature("int") |
|
1937 | 1875 | def on_specGraphPhase_stateChanged(self, p0): |
|
1938 | 1876 | |
|
1939 | 1877 | if p0 == 2: |
|
1940 | 1878 | self.specGgraphTminTmax.setEnabled(True) |
|
1941 | 1879 | self.specGgraphPhaserange.setEnabled(True) |
|
1942 | 1880 | |
|
1943 | 1881 | if p0 == 0: |
|
1944 | 1882 | self.specGgraphTminTmax.setEnabled(False) |
|
1945 | 1883 | self.specGgraphPhaserange.setEnabled(False) |
|
1946 | 1884 | |
|
1947 | 1885 | @pyqtSignature("int") |
|
1948 | 1886 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1949 | 1887 | """ |
|
1950 | 1888 | """ |
|
1951 | 1889 | if p0 == 2: |
|
1952 | 1890 | self.specGraphPath.setEnabled(True) |
|
1953 | 1891 | self.specGraphPrefix.setEnabled(True) |
|
1954 | 1892 | self.specGraphToolPath.setEnabled(True) |
|
1955 | 1893 | if p0 == 0: |
|
1956 | 1894 | self.specGraphPath.setEnabled(False) |
|
1957 | 1895 | self.specGraphPrefix.setEnabled(False) |
|
1958 | 1896 | self.specGraphToolPath.setEnabled(False) |
|
1959 | 1897 | |
|
1960 | 1898 | |
|
1961 | 1899 | @pyqtSignature("int") |
|
1962 | 1900 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1963 | 1901 | if p0 == 2: |
|
1964 | 1902 | self.specGraphPath.setEnabled(True) |
|
1965 | 1903 | self.specGraphPrefix.setEnabled(True) |
|
1966 | 1904 | self.specGraphToolPath.setEnabled(True) |
|
1967 | 1905 | |
|
1968 | 1906 | @pyqtSignature("int") |
|
1969 | 1907 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1970 | 1908 | if p0 == 2: |
|
1971 | 1909 | self.specGraphPath.setEnabled(True) |
|
1972 | 1910 | self.specGraphPrefix.setEnabled(True) |
|
1973 | 1911 | self.specGraphToolPath.setEnabled(True) |
|
1974 | 1912 | |
|
1975 | 1913 | @pyqtSignature("int") |
|
1976 | 1914 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1977 | 1915 | if p0 == 2: |
|
1978 | 1916 | self.specGraphPath.setEnabled(True) |
|
1979 | 1917 | self.specGraphPrefix.setEnabled(True) |
|
1980 | 1918 | self.specGraphToolPath.setEnabled(True) |
|
1981 | 1919 | |
|
1982 | 1920 | @pyqtSignature("int") |
|
1983 | 1921 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1984 | 1922 | if p0 == 2: |
|
1985 | 1923 | self.specGraphPath.setEnabled(True) |
|
1986 | 1924 | self.specGraphPrefix.setEnabled(True) |
|
1987 | 1925 | self.specGraphToolPath.setEnabled(True) |
|
1988 | 1926 | |
|
1989 | 1927 | |
|
1990 | 1928 | @pyqtSignature("int") |
|
1991 | 1929 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1992 | 1930 | if p0 == 2: |
|
1993 | 1931 | self.specGraphPath.setEnabled(True) |
|
1994 | 1932 | self.specGraphPrefix.setEnabled(True) |
|
1995 | 1933 | self.specGraphToolPath.setEnabled(True) |
|
1996 | 1934 | |
|
1997 | 1935 | |
|
1998 | 1936 | #-------ftp-----# |
|
1999 | 1937 | @pyqtSignature("int") |
|
2000 | 1938 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
2001 | 1939 | """ |
|
2002 | 1940 | """ |
|
2003 | 1941 | if p0 == 2: |
|
2004 | 1942 | self.specGgraphftpratio.setEnabled(True) |
|
2005 | 1943 | |
|
2006 | 1944 | if p0 == 0: |
|
2007 | 1945 | self.specGgraphftpratio.setEnabled(False) |
|
2008 | 1946 | |
|
2009 | 1947 | |
|
2010 | 1948 | @pyqtSignature("int") |
|
2011 | 1949 | def on_specGraphftpCross_stateChanged(self, p0): |
|
2012 | 1950 | if p0 == 2: |
|
2013 | 1951 | self.specGgraphftpratio.setEnabled(True) |
|
2014 | 1952 | |
|
2015 | 1953 | @pyqtSignature("int") |
|
2016 | 1954 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
2017 | 1955 | if p0 == 2: |
|
2018 | 1956 | self.specGgraphftpratio.setEnabled(True) |
|
2019 | 1957 | |
|
2020 | 1958 | @pyqtSignature("int") |
|
2021 | 1959 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
2022 | 1960 | if p0 == 2: |
|
2023 | 1961 | self.specGgraphftpratio.setEnabled(True) |
|
2024 | 1962 | |
|
2025 | 1963 | @pyqtSignature("int") |
|
2026 | 1964 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
2027 | 1965 | if p0 == 2: |
|
2028 | 1966 | self.specGgraphftpratio.setEnabled(True) |
|
2029 | 1967 | |
|
2030 | 1968 | @pyqtSignature("int") |
|
2031 | 1969 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
2032 | 1970 | if p0 == 2: |
|
2033 | 1971 | self.specGgraphftpratio.setEnabled(True) |
|
2034 | 1972 | |
|
2035 | 1973 | #-------------------# |
|
2036 | 1974 | |
|
2037 | 1975 | |
|
2038 | 1976 | |
|
2039 | 1977 | @pyqtSignature("") |
|
2040 | 1978 | def on_specGraphToolPath_clicked(self): |
|
2041 | 1979 | """ |
|
2042 | 1980 | """ |
|
2043 | 1981 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2044 | 1982 | self.specGraphPath.setText(self.savePath) |
|
2045 | 1983 | if not os.path.exists(self.savePath): |
|
2046 | 1984 | self.console.clear() |
|
2047 | 1985 | self.console.append("Write a correct a path") |
|
2048 | 1986 | return |
|
2049 | 1987 | |
|
2050 | 1988 | @pyqtSignature("") |
|
2051 | 1989 | def on_specHeisGraphToolPath_clicked(self): |
|
2052 | 1990 | """ |
|
2053 | 1991 | """ |
|
2054 | 1992 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2055 | 1993 | self.specHeisGraphPath.setText(self.savePath) |
|
2056 | 1994 | if not os.path.exists(self.savePath): |
|
2057 | 1995 | self.console.clear() |
|
2058 | 1996 | self.console.append("Write a correct a path") |
|
2059 | 1997 | return |
|
2060 | 1998 | |
|
2061 | 1999 | @pyqtSignature("") |
|
2062 | 2000 | def on_specGraphClear_clicked(self): |
|
2063 | 2001 | self.clearspecGraph() |
|
2064 | 2002 | |
|
2065 | 2003 | @pyqtSignature("int") |
|
2066 | 2004 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2067 | 2005 | """ |
|
2068 | 2006 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2069 | 2007 | """ |
|
2070 | 2008 | if p0 == 2: |
|
2071 | 2009 | self.specHeisOpIncoherent.setEnabled(True) |
|
2072 | 2010 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2073 | 2011 | if p0 == 0: |
|
2074 | 2012 | self.specHeisOpIncoherent.setEnabled(False) |
|
2075 | 2013 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2076 | 2014 | |
|
2077 | 2015 | @pyqtSignature("") |
|
2078 | 2016 | def on_specHeisOpOk_clicked(self): |
|
2079 | 2017 | """ |
|
2080 | 2018 | AΓADE OPERACION SPECTRAHEIS |
|
2081 | 2019 | """ |
|
2082 | 2020 | addFTP = False |
|
2083 | 2021 | checkPath = False |
|
2084 | 2022 | |
|
2085 | 2023 | self.actionSaveToolbar.setEnabled(False) |
|
2086 | 2024 | self.actionStarToolbar.setEnabled(False) |
|
2087 | 2025 | |
|
2088 | 2026 | puObj = self.getSelectedPUObj() |
|
2089 | 2027 | puObj.removeOperations() |
|
2090 | 2028 | |
|
2091 | 2029 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2092 | 2030 | value = self.specHeisOpIncoherent.text() |
|
2093 | 2031 | name_operation = 'IncohInt4SpectraHeis' |
|
2094 | 2032 | optype = 'other' |
|
2095 | 2033 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2096 | 2034 | name_parameter = 'timeInterval' |
|
2097 | 2035 | format = 'float' |
|
2098 | 2036 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2099 | 2037 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2100 | 2038 | |
|
2101 | 2039 | # ---- Spectra Plot----- |
|
2102 | 2040 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2103 | 2041 | name_operation = 'SpectraHeisScope' |
|
2104 | 2042 | optype = 'other' |
|
2105 | 2043 | name_parameter = 'type' |
|
2106 | 2044 | value = 'SpectraHeisScope' |
|
2107 | 2045 | format = 'str' |
|
2108 | 2046 | if self.idImagspectraHeis == 0: |
|
2109 | 2047 | self.idImagspectraHeis = 800 |
|
2110 | 2048 | else: |
|
2111 | 2049 | self.idImagspectraHeis = self.idImagspectraHeis + 1 |
|
2112 | 2050 | name_parameter1 = 'id' |
|
2113 | 2051 | value1 = int(self.idImagspectraHeis) |
|
2114 | 2052 | format1 = 'int' |
|
2115 | 2053 | |
|
2116 | 2054 | format = 'str' |
|
2117 | 2055 | |
|
2118 | 2056 | channelList = self.specHeisGgraphChannelList.text() |
|
2119 | 2057 | xvalue = self.specHeisGgraphXminXmax.text() |
|
2120 | 2058 | yvalue = self.specHeisGgraphYminYmax.text() |
|
2121 | 2059 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2122 | 2060 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2123 | 2061 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
2124 | 2062 | |
|
2125 | 2063 | if not channelList == '': |
|
2126 | 2064 | name_parameter = 'channelList' |
|
2127 | 2065 | format = 'intlist' |
|
2128 | 2066 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2129 | 2067 | |
|
2130 | 2068 | if not xvalue == '': |
|
2131 | 2069 | xvalueList = xvalue.split(',') |
|
2132 | 2070 | try: |
|
2133 | 2071 | value1 = float(xvalueList[0]) |
|
2134 | 2072 | value2 = float(xvalueList[1]) |
|
2135 | 2073 | except: |
|
2136 | 2074 | self.console.clear() |
|
2137 | 2075 | self.console.append("Please Write corrects parameter xmin-xmax") |
|
2138 | 2076 | return 0 |
|
2139 | 2077 | name1 = 'xmin' |
|
2140 | 2078 | name2 = 'xmax' |
|
2141 | 2079 | format = 'float' |
|
2142 | 2080 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2143 | 2081 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2144 | 2082 | #------specHeisGgraphYmin-Ymax--- |
|
2145 | 2083 | if not yvalue == '': |
|
2146 | 2084 | yvalueList = yvalue.split(",") |
|
2147 | 2085 | try: |
|
2148 | 2086 | value1 = float(yvalueList[0]) |
|
2149 | 2087 | value2 = float(yvalueList[1]) |
|
2150 | 2088 | except: |
|
2151 | 2089 | self.console.clear() |
|
2152 | 2090 | self.console.append("Please Write corrects parameter Ymix-Ymax") |
|
2153 | 2091 | return 0 |
|
2154 | 2092 | name1 = 'ymin' |
|
2155 | 2093 | name2 = 'ymax' |
|
2156 | 2094 | format = 'float' |
|
2157 | 2095 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2158 | 2096 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2159 | 2097 | |
|
2160 | 2098 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2161 | 2099 | checkPath = True |
|
2162 | 2100 | name_parameter1 = 'save' |
|
2163 | 2101 | name_parameter2 = 'figpath' |
|
2164 | 2102 | name_parameter3 = 'figfile' |
|
2165 | 2103 | value1 = '1' |
|
2166 | 2104 | value2 = self.specHeisGraphPath.text() |
|
2167 | 2105 | value3 = self.specHeisGraphPrefix.text() |
|
2168 | 2106 | format1 = 'bool' |
|
2169 | 2107 | format2 = 'str' |
|
2170 | 2108 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2171 | 2109 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2172 | 2110 | if not value3 == "": |
|
2173 | 2111 | try: |
|
2174 | 2112 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2175 | 2113 | except: |
|
2176 | 2114 | self.console.clear() |
|
2177 | 2115 | self.console.append("Please Write prefix") |
|
2178 | 2116 | return 0 |
|
2179 | 2117 | opObj.addParameter(name='figfile', value=self.specHeisGraphPrefix.text(), format='str') |
|
2180 | 2118 | |
|
2181 | 2119 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2182 | 2120 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2183 | 2121 | |
|
2184 | 2122 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2185 | 2123 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2186 | 2124 | self.addFTPConf2Operation(puObj, opObj) |
|
2187 | 2125 | addFTP = True |
|
2188 | 2126 | |
|
2189 | 2127 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2190 | 2128 | name_operation = 'RTIfromSpectraHeis' |
|
2191 | 2129 | optype = 'other' |
|
2192 | 2130 | name_parameter = 'type' |
|
2193 | 2131 | value = 'RTIfromSpectraHeis' |
|
2194 | 2132 | format = 'str' |
|
2195 | 2133 | |
|
2196 | 2134 | if self.idImagrtiHeis == 0: |
|
2197 | 2135 | self.idImagrtiHeis = 900 |
|
2198 | 2136 | else: |
|
2199 | 2137 | self.idImagrtiHeis = self.idImagrtiHeis + 1 |
|
2200 | 2138 | |
|
2201 | 2139 | name_parameter1 = 'id' |
|
2202 | 2140 | value1 = int(self.idImagrtiHeis) |
|
2203 | 2141 | format1 = 'int' |
|
2204 | 2142 | |
|
2205 | 2143 | format = 'str' |
|
2206 | 2144 | |
|
2207 | 2145 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2208 | 2146 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2209 | 2147 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) |
|
2210 | 2148 | |
|
2211 | 2149 | channelList = self.specHeisGgraphChannelList.text() |
|
2212 | 2150 | xvalue = self.specHeisGgraphTminTmax.text() |
|
2213 | 2151 | yvalue = self.specHeisGgraphYminYmax.text() |
|
2214 | 2152 | timerange = self.specHeisGgraphTimeRange.text() |
|
2215 | 2153 | |
|
2216 | 2154 | if not channelList == '': |
|
2217 | 2155 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2218 | 2156 | |
|
2219 | 2157 | if not xvalue == '': |
|
2220 | 2158 | xvalueList = xvalue.split(',') |
|
2221 | 2159 | try: |
|
2222 | 2160 | value = float(xvalueList[0]) |
|
2223 | 2161 | value = float(xvalueList[1]) |
|
2224 | 2162 | except: |
|
2225 | 2163 | return 0 |
|
2226 | 2164 | format = 'float' |
|
2227 | 2165 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2228 | 2166 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2229 | 2167 | |
|
2230 | 2168 | if not timerange == '': |
|
2231 | 2169 | format = 'int' |
|
2232 | 2170 | try: |
|
2233 | 2171 | timerange = int(timerange) |
|
2234 | 2172 | except: |
|
2235 | 2173 | return 0 |
|
2236 | 2174 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2237 | 2175 | |
|
2238 | 2176 | |
|
2239 | 2177 | if not yvalue == '': |
|
2240 | 2178 | yvalueList = yvalue.split(",") |
|
2241 | 2179 | try: |
|
2242 | 2180 | value = float(yvalueList[0]) |
|
2243 | 2181 | value = float(yvalueList[1]) |
|
2244 | 2182 | except: |
|
2245 | 2183 | return 0 |
|
2246 | 2184 | format = 'float' |
|
2247 | 2185 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2248 | 2186 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2249 | 2187 | |
|
2250 | 2188 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2251 | 2189 | checkPath = True |
|
2252 | 2190 | opObj.addParameter(name='save', value='1', format='bool') |
|
2253 | 2191 | opObj.addParameter(name='figpath', value=self.specHeisGraphPath.text(), format='str') |
|
2254 | 2192 | value = self.specHeisGraphPrefix.text() |
|
2255 | 2193 | if not value == "": |
|
2256 | 2194 | try: |
|
2257 | 2195 | value = str(self.specHeisGraphPrefix.text()) |
|
2258 | 2196 | except: |
|
2259 | 2197 | self.console.clear() |
|
2260 | 2198 | self.console.append("Please Write prefix") |
|
2261 | 2199 | return 0 |
|
2262 | 2200 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2263 | 2201 | |
|
2264 | 2202 | # test_ftp |
|
2265 | 2203 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2266 | 2204 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2267 | 2205 | self.addFTPConf2Operation(puObj, opObj) |
|
2268 | 2206 | addFTP = True |
|
2269 | 2207 | |
|
2270 | 2208 | localfolder = None |
|
2271 | 2209 | if checkPath: |
|
2272 | 2210 | localfolder = str(self.specGraphPath.text()) |
|
2273 | 2211 | if localfolder == '': |
|
2274 | 2212 | self.console.clear() |
|
2275 | 2213 | self.console.append("Graphic path should be defined") |
|
2276 | 2214 | return 0 |
|
2277 | 2215 | |
|
2278 | 2216 | if addFTP: |
|
2279 | 2217 | if not localfolder: |
|
2280 | 2218 | self.console.clear() |
|
2281 | 2219 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
2282 | 2220 | return 0 |
|
2283 | 2221 | |
|
2284 | 2222 | if not self.temporalFTP.create: |
|
2285 | 2223 | self.temporalFTP.setwithoutconfiguration() |
|
2286 | 2224 | |
|
2287 | 2225 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
2288 | 2226 | self.createFTPProcUnitView(server, username, password, remotefolder, |
|
2289 | 2227 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
2290 | 2228 | localfolder=localfolder) |
|
2291 | 2229 | else: |
|
2292 | 2230 | self.removeFTPProcUnitView() |
|
2293 | 2231 | |
|
2294 | 2232 | # if something happened |
|
2295 | 2233 | parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2296 | 2234 | if parms_ok: |
|
2297 | 2235 | name_operation = 'FitsWriter' |
|
2298 | 2236 | optype = 'other' |
|
2299 | 2237 | name_parameter1 = 'path' |
|
2300 | 2238 | name_parameter2 = 'dataBlocksPerFile' |
|
2301 | 2239 | name_parameter3 = 'metadatafile' |
|
2302 | 2240 | value1 = output_path |
|
2303 | 2241 | value2 = blocksperfile |
|
2304 | 2242 | value3 = metada |
|
2305 | 2243 | format2 = "int" |
|
2306 | 2244 | format3 = "str" |
|
2307 | 2245 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2308 | 2246 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2309 | 2247 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2310 | 2248 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2311 | 2249 | |
|
2312 | 2250 | self.showPUSpectraHeisProperties(puObj) |
|
2313 | 2251 | |
|
2314 | 2252 | self.console.clear() |
|
2315 | 2253 | self.console.append("Click on save icon ff you want to save your project") |
|
2316 | 2254 | |
|
2317 | 2255 | self.actionSaveToolbar.setEnabled(True) |
|
2318 | 2256 | self.actionStarToolbar.setEnabled(True) |
|
2319 | 2257 | |
|
2320 | 2258 | return 1 |
|
2321 | 2259 | @pyqtSignature("int") |
|
2322 | 2260 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2323 | 2261 | |
|
2324 | 2262 | if p0 == 2: |
|
2325 | 2263 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2326 | 2264 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2327 | 2265 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2328 | 2266 | if p0 == 0: |
|
2329 | 2267 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2330 | 2268 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2331 | 2269 | |
|
2332 | 2270 | @pyqtSignature("int") |
|
2333 | 2271 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2334 | 2272 | |
|
2335 | 2273 | if p0 == 2: |
|
2336 | 2274 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2337 | 2275 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2338 | 2276 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2339 | 2277 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2340 | 2278 | |
|
2341 | 2279 | if p0 == 0: |
|
2342 | 2280 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2343 | 2281 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2344 | 2282 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2345 | 2283 | |
|
2346 | 2284 | @pyqtSignature("int") |
|
2347 | 2285 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2348 | 2286 | """ |
|
2349 | 2287 | """ |
|
2350 | 2288 | if p0 == 2: |
|
2351 | 2289 | self.specHeisGraphPath.setEnabled(True) |
|
2352 | 2290 | self.specHeisGraphPrefix.setEnabled(True) |
|
2353 | 2291 | self.specHeisGraphToolPath.setEnabled(True) |
|
2354 | 2292 | if p0 == 0: |
|
2355 | 2293 | self.specHeisGraphPath.setEnabled(False) |
|
2356 | 2294 | self.specHeisGraphPrefix.setEnabled(False) |
|
2357 | 2295 | self.specHeisGraphToolPath.setEnabled(False) |
|
2358 | 2296 | |
|
2359 | 2297 | @pyqtSignature("int") |
|
2360 | 2298 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2361 | 2299 | if p0 == 2: |
|
2362 | 2300 | self.specHeisGraphPath.setEnabled(True) |
|
2363 | 2301 | self.specHeisGraphPrefix.setEnabled(True) |
|
2364 | 2302 | self.specHeisGraphToolPath.setEnabled(True) |
|
2365 | 2303 | |
|
2366 | 2304 | #-------ftp-----# |
|
2367 | 2305 | @pyqtSignature("int") |
|
2368 | 2306 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2369 | 2307 | """ |
|
2370 | 2308 | """ |
|
2371 | 2309 | if p0 == 2: |
|
2372 | 2310 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2373 | 2311 | |
|
2374 | 2312 | if p0 == 0: |
|
2375 | 2313 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2376 | 2314 | |
|
2377 | 2315 | @pyqtSignature("int") |
|
2378 | 2316 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2379 | 2317 | if p0 == 2: |
|
2380 | 2318 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2381 | 2319 | |
|
2382 | 2320 | @pyqtSignature("") |
|
2383 | 2321 | def on_specHeisGraphClear_clicked(self): |
|
2384 | 2322 | pass |
|
2385 | 2323 | |
|
2386 | 2324 | def on_click(self, index): |
|
2387 | 2325 | |
|
2388 | 2326 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
2389 | 2327 | if self.getSelectedProjectObj(): |
|
2390 | 2328 | projectObjView = self.getSelectedProjectObj() |
|
2391 | 2329 | project_name, description = projectObjView.name, projectObjView.description |
|
2392 | 2330 | id = int(projectObjView.id) |
|
2393 | 2331 | idReadUnit = projectObjView.getReadUnitId() |
|
2394 | 2332 | readUnitObj = projectObjView.getProcUnitObj(idReadUnit) |
|
2395 | 2333 | datatype, data_path, startDate, endDate, startTime, endTime , online , delay, walk , set = self.showProjectProperties(projectObjView) |
|
2396 | 2334 | # show ProjectView |
|
2397 | 2335 | self.refreshProjectWindow(project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set) |
|
2398 | 2336 | if datatype == 'Voltage': |
|
2399 | 2337 | ext = '.r' |
|
2400 | 2338 | elif datatype == 'Spectra': |
|
2401 | 2339 | ext = '.pdata' |
|
2402 | 2340 | elif datatype == 'Fits': |
|
2403 | 2341 | ext = '.fits' |
|
2404 | 2342 | if online == 0: |
|
2405 | 2343 | self.proComStartDate.clear() |
|
2406 | 2344 | self.proComEndDate.clear() |
|
2407 | 2345 | self.loadDays(data_path, ext, walk) |
|
2408 | 2346 | self.tabProject.setEnabled(True) |
|
2409 | 2347 | self.tabVoltage.setEnabled(False) |
|
2410 | 2348 | self.tabSpectra.setEnabled(False) |
|
2411 | 2349 | self.tabCorrelation.setEnabled(False) |
|
2412 | 2350 | self.tabSpectraHeis.setEnabled(False) |
|
2413 | 2351 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
2414 | 2352 | |
|
2415 | 2353 | if self.selectedItemTree.text() == 'Voltage': |
|
2416 | 2354 | datatype = 'Voltage' |
|
2417 | 2355 | puObj = self.getSelectedPUObj() |
|
2418 | 2356 | self.showtabPUCreated(datatype=datatype) |
|
2419 | 2357 | if len(puObj.getOperationObjList()) == 1: |
|
2420 | 2358 | self.setInputsPU_View(datatype) |
|
2421 | 2359 | else: |
|
2422 | 2360 | self.refreshPUWindow(datatype=datatype, puObj=puObj) |
|
2423 | 2361 | self.showPUVoltageProperties(puObj) |
|
2424 | 2362 | |
|
2425 | 2363 | if self.selectedItemTree.text() == 'Spectra': |
|
2426 | 2364 | |
|
2427 | 2365 | datatype = 'Spectra' |
|
2428 | 2366 | puObj = self.getSelectedPUObj() |
|
2429 | 2367 | self.showtabPUCreated(datatype=datatype) |
|
2430 | 2368 | if readUnitObj.datatype == 'Spectra': |
|
2431 | 2369 | self.specOpnFFTpoints.setEnabled(False) |
|
2432 | 2370 | self.specOpProfiles.setEnabled(False) |
|
2433 | 2371 | self.specOpippFactor.setEnabled(False) |
|
2434 | 2372 | |
|
2435 | 2373 | else: |
|
2436 | 2374 | self.specOpnFFTpoints.setEnabled(True) |
|
2437 | 2375 | self.specOpProfiles.setEnabled(True) |
|
2438 | 2376 | self.specOpippFactor.setEnabled(True) |
|
2439 | 2377 | |
|
2440 | 2378 | if len(puObj.getOperationObjList()) == 1: |
|
2441 | 2379 | self.setInputsPU_View(datatype) |
|
2442 | 2380 | |
|
2443 | 2381 | opObj = puObj.getOperationObj(name="run") |
|
2444 | 2382 | if opObj == None: |
|
2445 | 2383 | self.specOpnFFTpoints.clear() |
|
2446 | 2384 | self.specOpProfiles.clear() |
|
2447 | 2385 | self.specOpippFactor.clear() |
|
2448 | 2386 | else: |
|
2449 | 2387 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
2450 | 2388 | if parmObj == None: |
|
2451 | 2389 | self.specOpnFFTpoints.clear() |
|
2452 | 2390 | else: |
|
2453 | 2391 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
2454 | 2392 | self.specOpnFFTpoints.setText(str(value)) |
|
2455 | 2393 | |
|
2456 | 2394 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
2457 | 2395 | if parmObj == None: |
|
2458 | 2396 | self.specOpProfiles.clear() |
|
2459 | 2397 | else: |
|
2460 | 2398 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
2461 | 2399 | self.specOpProfiles.setText(str(value)) |
|
2462 | 2400 | |
|
2463 | 2401 | parmObj = opObj.getParameterObj(parameterName="ippFactor") |
|
2464 | 2402 | if parmObj == None: |
|
2465 | 2403 | self.specOpippFactor.clear() |
|
2466 | 2404 | else: |
|
2467 | 2405 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
2468 | 2406 | self.specOpippFactor.setText(str(value)) |
|
2469 | 2407 | |
|
2470 | 2408 | opObj = puObj.getOperationObj(name="run") |
|
2471 | 2409 | if opObj == None: |
|
2472 | 2410 | self.specOppairsList.clear() |
|
2473 | 2411 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2474 | 2412 | else: |
|
2475 | 2413 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
2476 | 2414 | if parmObj == None: |
|
2477 | 2415 | self.specOppairsList.clear() |
|
2478 | 2416 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2479 | 2417 | else: |
|
2480 | 2418 | value = opObj.getParameterValue(parameterName='pairsList') |
|
2481 | 2419 | value = str(value)[1:-1] |
|
2482 | 2420 | self.specOppairsList.setText(str(value)) |
|
2483 | 2421 | self.specOppairsList.setEnabled(True) |
|
2484 | 2422 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
2485 | 2423 | |
|
2486 | 2424 | else: |
|
2487 | 2425 | self.refreshPUWindow(datatype=datatype, puObj=puObj) |
|
2488 | 2426 | self.showPUSpectraProperties(puObj) |
|
2489 | 2427 | |
|
2490 | 2428 | if self.selectedItemTree.text() == 'Correlation': |
|
2491 | 2429 | self.tabCorrelation.setEnabled(True) |
|
2492 | 2430 | self.tabVoltage.setEnabled(False) |
|
2493 | 2431 | self.tabSpectra.setEnabled(False) |
|
2494 | 2432 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) |
|
2495 | 2433 | |
|
2496 | 2434 | if self.selectedItemTree.text() == 'SpectraHeis': |
|
2497 | 2435 | datatype = 'SpectraHeis' |
|
2498 | 2436 | puObj = self.getSelectedPUObj() |
|
2499 | 2437 | self.showtabPUCreated(datatype=datatype) |
|
2500 | 2438 | if len(puObj.getOperationObjList()) == 1: |
|
2501 | 2439 | self.setInputsPU_View(datatype) |
|
2502 | 2440 | else: |
|
2503 | 2441 | self.refreshPUWindow(datatype=datatype, puObj=puObj) |
|
2504 | 2442 | self.showPUSpectraHeisProperties(puObj) |
|
2505 | 2443 | |
|
2506 | 2444 | |
|
2507 | 2445 | def on_right_click(self, pos): |
|
2508 | 2446 | |
|
2509 | 2447 | self.menu = QtGui.QMenu() |
|
2510 | 2448 | quitAction0 = self.menu.addAction("NewProject") |
|
2511 | 2449 | quitAction1 = self.menu.addAction("NewProcessingUnit") |
|
2512 | 2450 | quitAction2 = self.menu.addAction("Delete") |
|
2513 | 2451 | quitAction3 = self.menu.addAction("Exit") |
|
2514 | 2452 | |
|
2515 | 2453 | if len(self.__itemTreeDict) == 0: |
|
2516 | 2454 | quitAction2.setEnabled(False) |
|
2517 | 2455 | else: |
|
2518 | 2456 | quitAction2.setEnabled(True) |
|
2519 | 2457 | |
|
2520 | 2458 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
2521 | 2459 | |
|
2522 | 2460 | if action == quitAction0: |
|
2523 | 2461 | self. setInputsProject_View() |
|
2524 | 2462 | self.create = True |
|
2525 | 2463 | |
|
2526 | 2464 | if action == quitAction1: |
|
2527 | 2465 | if len(self.__projectObjDict) == 0: |
|
2528 | 2466 | outputstr = "First Create a Project then add Processing Unit" |
|
2529 | 2467 | self.console.clear() |
|
2530 | 2468 | self.console.append(outputstr) |
|
2531 | 2469 | return 0 |
|
2532 | 2470 | else: |
|
2533 | 2471 | self.addPUWindow() |
|
2534 | 2472 | self.console.clear() |
|
2535 | 2473 | self.console.append("Please, Choose the type of Processing Unit") |
|
2536 | 2474 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
2537 | 2475 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
2538 | 2476 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
2539 | 2477 | |
|
2540 | 2478 | if action == quitAction2: |
|
2541 | 2479 | index = self.selectedItemTree |
|
2542 | 2480 | try: |
|
2543 | 2481 | index.parent() |
|
2544 | 2482 | except: |
|
2545 | 2483 | self.console.append('First left click on Project or Processing Unit') |
|
2546 | 2484 | return 0 |
|
2547 | 2485 | # print index.parent(),index |
|
2548 | 2486 | if index.parent() == None: |
|
2549 | 2487 | self.projectExplorerModel.removeRow(index.row()) |
|
2550 | 2488 | else: |
|
2551 | 2489 | index.parent().removeRow(index.row()) |
|
2552 | 2490 | self.deleteProjectorPU() |
|
2553 | 2491 | self.console.clear() |
|
2554 | 2492 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
2555 | 2493 | # print i.row() |
|
2556 | 2494 | |
|
2557 | 2495 | if action == quitAction3: |
|
2558 | 2496 | return |
|
2559 | 2497 | |
|
2560 | 2498 | def refreshProjectWindow(self, project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set): |
|
2561 | 2499 | |
|
2562 | 2500 | self.proName.setText(str(project_name)) |
|
2563 | 2501 | |
|
2564 | 2502 | if datatype == 'Voltage': |
|
2565 | 2503 | ext = '.r' |
|
2566 | 2504 | value = 0 |
|
2567 | 2505 | elif datatype == 'Spectra': |
|
2568 | 2506 | ext = '.pdata' |
|
2569 | 2507 | value = 1 |
|
2570 | 2508 | elif datatype == 'Fits': |
|
2571 | 2509 | ext = 'fits' |
|
2572 | 2510 | value = 2 |
|
2573 | 2511 | self.proDataType.setText(ext) |
|
2574 | 2512 | self.proDataPath.setText(str(data_path)) |
|
2575 | 2513 | self.proComDataType.setCurrentIndex(value) |
|
2576 | 2514 | self.proComReadMode.setCurrentIndex(int(online)) |
|
2577 | 2515 | self.proDelay.setText(str(delay)) |
|
2578 | 2516 | self.proSet.setText(str(set)) |
|
2579 | 2517 | self.proComStartDate.clear() |
|
2580 | 2518 | self.proComEndDate.clear() |
|
2581 | 2519 | self.proComStartDate.addItem(str(startDate)) |
|
2582 | 2520 | self.proComEndDate.addItem(str(endDate)) |
|
2583 | 2521 | starTime = str(startTime) |
|
2584 | 2522 | starlist = starTime.split(":") |
|
2585 | 2523 | endTime = str(endTime) |
|
2586 | 2524 | endlist = endTime.split(":") |
|
2587 | 2525 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
2588 | 2526 | self.proStartTime.setTime(self.time) |
|
2589 | 2527 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2590 | 2528 | self.proEndTime.setTime(self.time) |
|
2591 | 2529 | self.proDescription.clear() |
|
2592 | 2530 | self.proDescription.append(description) |
|
2593 | 2531 | |
|
2594 | 2532 | def refreshPUWindow(self, datatype, puObj): |
|
2595 | 2533 | |
|
2596 | 2534 | if datatype == 'Voltage': |
|
2597 | 2535 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2598 | 2536 | if opObj == None: |
|
2599 | 2537 | self.volOpRadarfrequency.clear() |
|
2600 | 2538 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2601 | 2539 | else: |
|
2602 | 2540 | value = opObj.getParameterValue(parameterName='frequency') |
|
2603 | 2541 | value = str(value) |
|
2604 | 2542 | self.volOpRadarfrequency.setText(value) |
|
2605 | 2543 | self.volOpRadarfrequency.setEnabled(True) |
|
2606 | 2544 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2607 | 2545 | |
|
2608 | 2546 | |
|
2609 | 2547 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2610 | 2548 | if opObj == None: |
|
2611 | 2549 | self.volOpChannel.clear() |
|
2612 | 2550 | self.volOpCebChannels.setCheckState(0) |
|
2613 | 2551 | |
|
2614 | 2552 | else: |
|
2615 | 2553 | value = opObj.getParameterValue(parameterName='channelList') |
|
2616 | 2554 | value = str(value)[1:-1] |
|
2617 | 2555 | self.volOpChannel.setText(value) |
|
2618 | 2556 | self.volOpChannel.setEnabled(True) |
|
2619 | 2557 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2620 | 2558 | |
|
2621 | 2559 | |
|
2622 | 2560 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2623 | 2561 | if opObj == None: |
|
2624 | 2562 | self.volOpHeights.clear() |
|
2625 | 2563 | self.volOpCebHeights.setCheckState(0) |
|
2626 | 2564 | else: |
|
2627 | 2565 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
2628 | 2566 | value1 = str(value1) |
|
2629 | 2567 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
2630 | 2568 | value2 = str(value2) |
|
2631 | 2569 | value = value1 + "," + value2 |
|
2632 | 2570 | self.volOpHeights.setText(value) |
|
2633 | 2571 | self.volOpHeights.setEnabled(True) |
|
2634 | 2572 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2635 | 2573 | |
|
2636 | 2574 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2637 | 2575 | if opObj == None: |
|
2638 | 2576 | self.volOpFilter.clear() |
|
2639 | 2577 | self.volOpCebFilter.setCheckState(0) |
|
2640 | 2578 | else: |
|
2641 | 2579 | value = opObj.getParameterValue(parameterName='window') |
|
2642 | 2580 | value = str(value) |
|
2643 | 2581 | self.volOpFilter.setText(value) |
|
2644 | 2582 | self.volOpFilter.setEnabled(True) |
|
2645 | 2583 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2646 | 2584 | |
|
2647 | 2585 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2648 | 2586 | if opObj == None: |
|
2649 | 2587 | self.volOpProfile.clear() |
|
2650 | 2588 | self.volOpCebProfile.setCheckState(0) |
|
2651 | 2589 | else: |
|
2652 | 2590 | for parmObj in opObj.getParameterObjList(): |
|
2653 | 2591 | if parmObj.name == "profileRangeList": |
|
2654 | 2592 | value = opObj.getParameterValue(parameterName='profileRangeList') |
|
2655 | 2593 | value = str(value)[1:-1] |
|
2656 | 2594 | self.volOpProfile.setText(value) |
|
2657 | 2595 | self.volOpProfile.setEnabled(True) |
|
2658 | 2596 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2659 | 2597 | self.volOpComProfile.setCurrentIndex(1) |
|
2660 | 2598 | if parmObj.name == "profileList": |
|
2661 | 2599 | value = opObj.getParameterValue(parameterName='profileList') |
|
2662 | 2600 | value = str(value)[1:-1] |
|
2663 | 2601 | self.volOpProfile.setText(value) |
|
2664 | 2602 | self.volOpProfile.setEnabled(True) |
|
2665 | 2603 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2666 | 2604 | self.volOpComProfile.setCurrentIndex(0) |
|
2667 | 2605 | |
|
2668 | 2606 | |
|
2669 | 2607 | opObj = puObj.getOperationObj(name="Decoder") |
|
2670 | 2608 | if opObj == None: |
|
2671 | 2609 | self.volOpCebDecodification.setCheckState(0) |
|
2672 | 2610 | else: |
|
2673 | 2611 | try: |
|
2674 | 2612 | valueCode = opObj.getParameterValue(parameterName='nCode') |
|
2675 | 2613 | status = "on" |
|
2676 | 2614 | except: |
|
2677 | 2615 | status = "off" |
|
2678 | 2616 | if not status == "off": |
|
2679 | 2617 | if int(valueCode) == 1: |
|
2680 | 2618 | valueBaud = opObj.getParameterValue(parameterName='nBaud') |
|
2681 | 2619 | if int(valueBaud) == 3: |
|
2682 | 2620 | self.volOpComCode.setCurrentIndex(0) |
|
2683 | 2621 | if int(valueBaud) == 4: |
|
2684 | 2622 | self.volOpComCode.setCurrentIndex(1) |
|
2685 | 2623 | if int(valueBaud) == 5: |
|
2686 | 2624 | self.volOpComCode.setCurrentIndex(2) |
|
2687 | 2625 | if int(valueBaud) == 7: |
|
2688 | 2626 | self.volOpComCode.setCurrentIndex(3) |
|
2689 | 2627 | if int(valueBaud) == 11: |
|
2690 | 2628 | self.volOpComCode.setCurrentIndex(4) |
|
2691 | 2629 | if int(valueBaud) == 13: |
|
2692 | 2630 | self.volOpComCode.setCurrentIndex(5) |
|
2693 | 2631 | else: |
|
2694 | 2632 | valueBaud = opObj.getParameterValue(parameterName='nBaud') |
|
2695 | 2633 | if int(valueBaud) == 3: |
|
2696 | 2634 | self.volOpComCode.setCurrentIndex(6) |
|
2697 | 2635 | if int(valueBaud) == 4: |
|
2698 | 2636 | self.volOpComCode.setCurrentIndex(7) |
|
2699 | 2637 | if int(valueBaud) == 5: |
|
2700 | 2638 | self.volOpComCode.setCurrentIndex(8) |
|
2701 | 2639 | if int(valueBaud) == 7: |
|
2702 | 2640 | self.volOpComCode.setCurrentIndex(9) |
|
2703 | 2641 | if int(valueBaud) == 11: |
|
2704 | 2642 | self.volOpComCode.setCurrentIndex(10) |
|
2705 | 2643 | if int(valueBaud) == 13: |
|
2706 | 2644 | self.volOpComCode.setCurrentIndex(11) |
|
2707 | 2645 | |
|
2708 | 2646 | for parmObj in opObj.getParameterObjList(): |
|
2709 | 2647 | if parmObj.name == "nBaud": |
|
2710 | 2648 | value = opObj.getParameterValue(parameterName='nBaud') |
|
2711 | 2649 | if parmObj.name == "mode": |
|
2712 | 2650 | value = opObj.getParameterValue(parameterName='mode') |
|
2713 | 2651 | self.volOpComMode.setCurrentIndex(value) |
|
2714 | 2652 | else: |
|
2715 | 2653 | self.volOpComCode.setCurrentIndex(12) |
|
2716 | 2654 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2717 | ||
|
2655 | ||
|
2656 | opObj = puObj.getOperationObj(name="deFlip") | |
|
2657 | if opObj == None: | |
|
2658 | self.volOpFlip.clear() | |
|
2659 | self.volOpFlip.setEnabled(False) | |
|
2660 | self.volOpCebFlip.setCheckState(0) | |
|
2661 | else: | |
|
2662 | try: | |
|
2663 | value = opObj.getParameterValue(parameterName='channelList') | |
|
2664 | value = str(value)[1:-1] | |
|
2665 | except: | |
|
2666 | value = "" | |
|
2667 | ||
|
2668 | self.volOpFlip.setText(value) | |
|
2669 | self.volOpFlip.setEnabled(True) | |
|
2670 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
|
2671 | ||
|
2718 | 2672 | opObj = puObj.getOperationObj(name="CohInt") |
|
2719 | 2673 | if opObj == None: |
|
2720 | 2674 | self.volOpCohInt.clear() |
|
2721 | 2675 | self.volOpCebCohInt.setCheckState(0) |
|
2722 | 2676 | else: |
|
2723 | 2677 | value = opObj.getParameterValue(parameterName='n') |
|
2724 | 2678 | self.volOpCohInt.setText(str(value)) |
|
2725 | 2679 | self.volOpCohInt.setEnabled(True) |
|
2726 | 2680 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2727 | 2681 | |
|
2728 | 2682 | opObj = puObj.getOperationObj(name='Scope') |
|
2729 | 2683 | if opObj == None: |
|
2730 | 2684 | self.volGraphCebshow.setCheckState(0) |
|
2731 | 2685 | else: |
|
2732 | 2686 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2733 | 2687 | value = opObj.getParameterObj(parameterName='channelList') |
|
2734 | 2688 | if value == None: |
|
2735 | 2689 | self.volGraphChannelList.clear() |
|
2736 | 2690 | else: |
|
2737 | 2691 | value = opObj.getParameterValue(parameterName='channelList') |
|
2738 | 2692 | value = str(value)[1:-1] |
|
2739 | 2693 | self.volGraphChannelList.setText(value) |
|
2740 | 2694 | self.volOpProfile.setEnabled(True) |
|
2741 | 2695 | |
|
2742 | 2696 | for parmObj in opObj.getParameterObjList(): |
|
2743 | 2697 | if parmObj.name == "xmin": |
|
2744 | 2698 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
2745 | 2699 | value1 = str(value1) |
|
2746 | 2700 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
2747 | 2701 | value2 = str(value2) |
|
2748 | 2702 | value = value1 + "," + value2 |
|
2749 | 2703 | self.volGraphfreqrange.setText(value) |
|
2750 | 2704 | else: |
|
2751 | 2705 | self.volGraphfreqrange.clear() |
|
2752 | 2706 | for parmObj in opObj.getParameterObjList(): |
|
2753 | 2707 | if parmObj.name == "ymin": |
|
2754 | 2708 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
2755 | 2709 | value1 = str(value1) |
|
2756 | 2710 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
2757 | 2711 | value2 = str(value2) |
|
2758 | 2712 | value = value1 + "," + value2 |
|
2759 | 2713 | value2 = str(value2) |
|
2760 | 2714 | self.volGraphHeightrange.setText(value) |
|
2761 | 2715 | else: |
|
2762 | 2716 | self.volGraphHeightrange.clear() |
|
2763 | 2717 | |
|
2764 | 2718 | |
|
2765 | 2719 | for parmObj in opObj.getParameterObjList(): |
|
2766 | 2720 | if parmObj.name == "save": |
|
2767 | 2721 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2768 | 2722 | else: |
|
2769 | 2723 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2770 | 2724 | |
|
2771 | 2725 | # outputVoltageWrite |
|
2772 | 2726 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2773 | 2727 | if opObj == None: |
|
2774 | 2728 | self.volOutputPath.clear() |
|
2775 | 2729 | self.volOutputblocksperfile.clear() |
|
2776 | 2730 | self.volOutputprofilesperblock.clear() |
|
2777 | 2731 | else: |
|
2778 | 2732 | value = opObj.getParameterObj(parameterName='path') |
|
2779 | 2733 | if value == None: |
|
2780 | 2734 | self.volOutputPath.clear() |
|
2781 | 2735 | else: |
|
2782 | 2736 | value = opObj.getParameterValue(parameterName='path') |
|
2783 | 2737 | path = str(value) |
|
2784 | 2738 | self.volOutputPath.setText(path) |
|
2785 | 2739 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2786 | 2740 | if value == None: |
|
2787 | 2741 | self.volOutputblocksperfile.clear() |
|
2788 | 2742 | else: |
|
2789 | 2743 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
2790 | 2744 | blocksperfile = str(value) |
|
2791 | 2745 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2792 | 2746 | value = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2793 | 2747 | if value == None: |
|
2794 | 2748 | self.volOutputprofilesperblock.clear() |
|
2795 | 2749 | else: |
|
2796 | 2750 | value = opObj.getParameterValue(parameterName='profilesPerBlock') |
|
2797 | 2751 | profilesPerBlock = str(value) |
|
2798 | 2752 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2799 | 2753 | |
|
2800 | 2754 | if datatype == 'Spectra': |
|
2801 | 2755 | |
|
2802 | 2756 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2803 | 2757 | if opObj == None: |
|
2804 | 2758 | self.specOpRadarfrequency.clear() |
|
2805 | 2759 | self.specOpCebRadarfrequency.setCheckState(0) |
|
2806 | 2760 | else: |
|
2807 | 2761 | value = opObj.getParameterValue(parameterName='frequency') |
|
2808 | 2762 | value = str(value) |
|
2809 | 2763 | self.specOpRadarfrequency.setText(value) |
|
2810 | 2764 | self.specOpRadarfrequency.setEnabled(True) |
|
2811 | 2765 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2812 | 2766 | |
|
2813 | 2767 | opObj = puObj.getOperationObj(name="run") |
|
2814 | 2768 | if opObj == None: |
|
2815 | 2769 | self.specOpnFFTpoints.clear() |
|
2816 | 2770 | self.specOpProfiles.clear() |
|
2817 | 2771 | self.specOpippFactor.clear() |
|
2818 | 2772 | else: |
|
2819 | 2773 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
2820 | 2774 | if parmObj == None: |
|
2821 | 2775 | self.specOpnFFTpoints.clear() |
|
2822 | 2776 | else: |
|
2823 | 2777 | self.specOpnFFTpoints.setEnabled(True) |
|
2824 | 2778 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
2825 | 2779 | self.specOpnFFTpoints.setText(str(value)) |
|
2826 | 2780 | |
|
2827 | 2781 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
2828 | 2782 | if parmObj == None: |
|
2829 | 2783 | self.specOpProfiles.clear() |
|
2830 | 2784 | else: |
|
2831 | 2785 | self.specOpProfiles.setEnabled(True) |
|
2832 | 2786 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
2833 | 2787 | self.specOpProfiles.setText(str(value)) |
|
2834 | 2788 | |
|
2835 | 2789 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
2836 | 2790 | if parmObj == None: |
|
2837 | 2791 | self.specOpippFactor.clear() |
|
2838 | 2792 | else: |
|
2839 | 2793 | self.specOpippFactor.setEnabled(True) |
|
2840 | 2794 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
2841 | 2795 | self.specOpippFactor.setText(str(value)) |
|
2842 | 2796 | |
|
2843 | 2797 | opObj = puObj.getOperationObj(name="run") |
|
2844 | 2798 | if opObj == None: |
|
2845 | 2799 | self.specOppairsList.clear() |
|
2846 | 2800 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2847 | 2801 | else: |
|
2848 | 2802 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
2849 | 2803 | if parmObj == None: |
|
2850 | 2804 | self.specOppairsList.clear() |
|
2851 | 2805 | self.specOpCebCrossSpectra.setCheckState(0) |
|
2852 | 2806 | else: |
|
2853 | 2807 | value = opObj.getParameterValue(parameterName='pairsList') |
|
2854 | 2808 | value = str(value)[1:-1] |
|
2855 | 2809 | self.specOppairsList.setText(str(value)) |
|
2856 | 2810 | self.specOppairsList.setEnabled(True) |
|
2857 | 2811 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
2858 | 2812 | |
|
2859 | 2813 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2860 | 2814 | if opObj == None: |
|
2861 | 2815 | self.specOpChannel.clear() |
|
2862 | 2816 | self.specOpCebChannel.setCheckState(0) |
|
2863 | 2817 | else: |
|
2864 | 2818 | value = opObj.getParameterValue(parameterName='channelList') |
|
2865 | 2819 | value = str(value)[1:-1] |
|
2866 | 2820 | self.specOpChannel.setText(value) |
|
2867 | 2821 | self.specOpChannel.setEnabled(True) |
|
2868 | 2822 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
2869 | 2823 | |
|
2870 | 2824 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2871 | 2825 | if opObj == None: |
|
2872 | 2826 | self.specOpHeights.clear() |
|
2873 | 2827 | self.specOpCebHeights.setCheckState(0) |
|
2874 | 2828 | else: |
|
2875 | 2829 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
2876 | 2830 | value1 = str(value1) |
|
2877 | 2831 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
2878 | 2832 | value2 = str(value2) |
|
2879 | 2833 | value = value1 + "," + value2 |
|
2880 | 2834 | self.specOpHeights.setText(value) |
|
2881 | 2835 | self.specOpHeights.setEnabled(True) |
|
2882 | 2836 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2883 | 2837 | |
|
2884 | 2838 | opObj = puObj.getOperationObj(name="IncohInt") |
|
2885 | 2839 | if opObj == None: |
|
2886 | 2840 | self.specOpIncoherent.clear() |
|
2887 | 2841 | self.specOpCebIncoherent.setCheckState(0) |
|
2888 | 2842 | else: |
|
2889 | 2843 | for parmObj in opObj.getParameterObjList(): |
|
2890 | 2844 | if parmObj.name == 'timeInterval': |
|
2891 | 2845 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
2892 | 2846 | value = float(value) |
|
2893 | 2847 | self.specOpIncoherent.setText(str(value)) |
|
2894 | 2848 | self.specOpIncoherent.setEnabled(True) |
|
2895 | 2849 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
2896 | 2850 | self.specOpCobIncInt.setCurrentIndex(0) |
|
2897 | 2851 | |
|
2898 | 2852 | if parmObj.name == 'n': |
|
2899 | 2853 | value = opObj.getParameterValue(parameterName='n') |
|
2900 | 2854 | value = float(value) |
|
2901 | 2855 | self.specOpIncoherent.setText(str(value)) |
|
2902 | 2856 | self.specOpIncoherent.setEnabled(True) |
|
2903 | 2857 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
2904 | 2858 | self.specOpCobIncInt.setCurrentIndex(1) |
|
2905 | 2859 | |
|
2906 | 2860 | opObj = puObj.getOperationObj(name="removeDC") |
|
2907 | 2861 | if opObj == None: |
|
2908 | 2862 | self.specOpCebRemoveDC.setCheckState(0) |
|
2909 | 2863 | else: |
|
2910 | 2864 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
2911 | 2865 | value = opObj.getParameterValue(parameterName='mode') |
|
2912 | 2866 | if value == 1: |
|
2913 | 2867 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
2914 | 2868 | elif value == 2: |
|
2915 | 2869 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
2916 | 2870 | |
|
2917 | 2871 | opObj = puObj.getOperationObj(name="removeInterference") |
|
2918 | 2872 | if opObj == None: |
|
2919 | 2873 | self.specOpCebRemoveInt.setCheckState(0) |
|
2920 | 2874 | else: |
|
2921 | 2875 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
2922 | 2876 | |
|
2923 | 2877 | opObj = puObj.getOperationObj(name='getNoise') |
|
2924 | 2878 | if opObj == None: |
|
2925 | 2879 | self.specOpCebgetNoise.setCheckState(0) |
|
2926 | 2880 | self.specOpgetNoise.clear() |
|
2927 | 2881 | else: |
|
2928 | 2882 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
2929 | 2883 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
2930 | 2884 | if parmObj == None: |
|
2931 | 2885 | self.specOpgetNoise.clear() |
|
2932 | 2886 | value1 = None |
|
2933 | 2887 | else: |
|
2934 | 2888 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
2935 | 2889 | value1 = str(value1) |
|
2936 | 2890 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
2937 | 2891 | if parmObj == None: |
|
2938 | 2892 | value2 = None |
|
2939 | 2893 | value = value1 |
|
2940 | 2894 | self.specOpgetNoise.setText(value) |
|
2941 | 2895 | self.specOpgetNoise.setEnabled(True) |
|
2942 | 2896 | else: |
|
2943 | 2897 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
2944 | 2898 | value2 = str(value2) |
|
2945 | 2899 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
2946 | 2900 | if parmObj == None: |
|
2947 | 2901 | value3 = None |
|
2948 | 2902 | value = value1 + "," + value2 |
|
2949 | 2903 | self.specOpgetNoise.setText(value) |
|
2950 | 2904 | self.specOpgetNoise.setEnabled(True) |
|
2951 | 2905 | else: |
|
2952 | 2906 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
2953 | 2907 | value3 = str(value3) |
|
2954 | 2908 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
2955 | 2909 | if parmObj == None: |
|
2956 | 2910 | value4 = None |
|
2957 | 2911 | value = value1 + "," + value2 + "," + value3 |
|
2958 | 2912 | self.specOpgetNoise.setText(value) |
|
2959 | 2913 | self.specOpgetNoise.setEnabled(True) |
|
2960 | 2914 | else: |
|
2961 | 2915 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
2962 | 2916 | value4 = str(value4) |
|
2963 | 2917 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
2964 | 2918 | self.specOpgetNoise.setText(value) |
|
2965 | 2919 | self.specOpgetNoise.setEnabled(True) |
|
2966 | 2920 | |
|
2967 | 2921 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
2968 | 2922 | # opObj = puObj.getOpObjfromParamValue(value="SpectraPlot") |
|
2969 | 2923 | if opObj == None: |
|
2970 | 2924 | self.specGraphCebSpectraplot.setCheckState(0) |
|
2971 | 2925 | self.specGraphSaveSpectra.setCheckState(0) |
|
2972 | 2926 | self.specGraphftpSpectra.setCheckState(0) |
|
2973 | 2927 | |
|
2974 | 2928 | else: |
|
2975 | 2929 | operationSpectraPlot = "Enable" |
|
2976 | 2930 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
2977 | 2931 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2978 | 2932 | if parmObj == None: |
|
2979 | 2933 | self.specGgraphChannelList.clear() |
|
2980 | 2934 | else: |
|
2981 | 2935 | value = opObj.getParameterValue(parameterName='channelList') |
|
2982 | 2936 | channelListSpectraPlot = str(value)[1:-1] |
|
2983 | 2937 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
2984 | 2938 | self.specGgraphChannelList.setEnabled(True) |
|
2985 | 2939 | |
|
2986 | 2940 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
2987 | 2941 | if parmObj == None: |
|
2988 | 2942 | self.specGgraphFreq.clear() |
|
2989 | 2943 | else: |
|
2990 | 2944 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
2991 | 2945 | value1 = str(value1) |
|
2992 | 2946 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
2993 | 2947 | value2 = str(value2) |
|
2994 | 2948 | value = value1 + "," + value2 |
|
2995 | 2949 | self.specGgraphFreq.setText(value) |
|
2996 | 2950 | self.specGgraphFreq.setEnabled(True) |
|
2997 | 2951 | |
|
2998 | 2952 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
2999 | 2953 | if parmObj == None: |
|
3000 | 2954 | self.specGgraphHeight.clear() |
|
3001 | 2955 | else: |
|
3002 | 2956 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3003 | 2957 | value1 = str(value1) |
|
3004 | 2958 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3005 | 2959 | value2 = str(value2) |
|
3006 | 2960 | value = value1 + "," + value2 |
|
3007 | 2961 | self.specGgraphHeight.setText(value) |
|
3008 | 2962 | self.specGgraphHeight.setEnabled(True) |
|
3009 | 2963 | |
|
3010 | 2964 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3011 | 2965 | if parmObj == None: |
|
3012 | 2966 | self.specGgraphDbsrange.clear() |
|
3013 | 2967 | else: |
|
3014 | 2968 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3015 | 2969 | value1 = str(value1) |
|
3016 | 2970 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3017 | 2971 | value2 = str(value2) |
|
3018 | 2972 | value = value1 + "," + value2 |
|
3019 | 2973 | self.specGgraphDbsrange.setText(value) |
|
3020 | 2974 | self.specGgraphDbsrange.setEnabled(True) |
|
3021 | 2975 | |
|
3022 | 2976 | |
|
3023 | 2977 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3024 | 2978 | if parmObj == None: |
|
3025 | 2979 | self.specGraphSaveSpectra.setCheckState(0) |
|
3026 | 2980 | else: |
|
3027 | 2981 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3028 | 2982 | value = opObj.getParameterValue(parameterName='figpath') |
|
3029 | 2983 | self.specGraphPath.setText(value) |
|
3030 | 2984 | |
|
3031 | 2985 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3032 | 2986 | if parmObj == None: |
|
3033 | 2987 | self.specGraphftpSpectra.setCheckState(0) |
|
3034 | 2988 | else: |
|
3035 | 2989 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3036 | 2990 | try: |
|
3037 | 2991 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3038 | 2992 | except: |
|
3039 | 2993 | value = " " |
|
3040 | 2994 | self.specGgraphftpratio.setText(str(value)) |
|
3041 | 2995 | |
|
3042 | 2996 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3043 | 2997 | # opObj = puObj.getOpObjfromParamValue(value="CrossSpectraPlot") |
|
3044 | 2998 | if opObj == None: |
|
3045 | 2999 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3046 | 3000 | self.specGraphSaveCross.setCheckState(0) |
|
3047 | 3001 | |
|
3048 | 3002 | else: |
|
3049 | 3003 | operationCrossSpectraPlot = "Enable" |
|
3050 | 3004 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3051 | 3005 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3052 | 3006 | if parmObj == None: |
|
3053 | 3007 | self.specGgraphFreq.clear() |
|
3054 | 3008 | else: |
|
3055 | 3009 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3056 | 3010 | value1 = str(value1) |
|
3057 | 3011 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3058 | 3012 | value2 = str(value2) |
|
3059 | 3013 | value = value1 + "," + value2 |
|
3060 | 3014 | self.specGgraphFreq.setText(value) |
|
3061 | 3015 | self.specGgraphFreq.setEnabled(True) |
|
3062 | 3016 | |
|
3063 | 3017 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3064 | 3018 | if parmObj == None: |
|
3065 | 3019 | self.specGgraphHeight.clear() |
|
3066 | 3020 | else: |
|
3067 | 3021 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3068 | 3022 | value1 = str(value1) |
|
3069 | 3023 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3070 | 3024 | value2 = str(value2) |
|
3071 | 3025 | value = value1 + "," + value2 |
|
3072 | 3026 | self.specGgraphHeight.setText(value) |
|
3073 | 3027 | self.specGgraphHeight.setEnabled(True) |
|
3074 | 3028 | |
|
3075 | 3029 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3076 | 3030 | if parmObj == None: |
|
3077 | 3031 | self.specGgraphDbsrange.clear() |
|
3078 | 3032 | else: |
|
3079 | 3033 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3080 | 3034 | value1 = str(value1) |
|
3081 | 3035 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3082 | 3036 | value2 = str(value2) |
|
3083 | 3037 | value = value1 + "," + value2 |
|
3084 | 3038 | self.specGgraphDbsrange.setText(value) |
|
3085 | 3039 | self.specGgraphDbsrange.setEnabled(True) |
|
3086 | 3040 | |
|
3087 | 3041 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3088 | 3042 | if parmObj == None: |
|
3089 | 3043 | self.specGraphSaveCross.setCheckState(0) |
|
3090 | 3044 | |
|
3091 | 3045 | else: |
|
3092 | 3046 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3093 | 3047 | value = opObj.getParameterValue(parameterName='figpath') |
|
3094 | 3048 | self.specGraphPath.setText(value) |
|
3095 | 3049 | |
|
3096 | 3050 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3097 | 3051 | if parmObj == None: |
|
3098 | 3052 | self.specGraphftpCross.setCheckState(0) |
|
3099 | 3053 | else: |
|
3100 | 3054 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3101 | 3055 | try: |
|
3102 | 3056 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3103 | 3057 | except: |
|
3104 | 3058 | value = " " |
|
3105 | 3059 | self.specGgraphftpratio.setText(str(value)) |
|
3106 | 3060 | |
|
3107 | 3061 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3108 | 3062 | # opObj = puObj.getOpObjfromParamValue(value="RTIPlot") |
|
3109 | 3063 | if opObj == None: |
|
3110 | 3064 | self.specGraphCebRTIplot.setCheckState(0) |
|
3111 | 3065 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3112 | 3066 | self.specGraphftpRTIplot.setCheckState(0) |
|
3113 | 3067 | else: |
|
3114 | 3068 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3115 | 3069 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3116 | 3070 | if parmObj == None: |
|
3117 | 3071 | self.specGgraphChannelList.clear() |
|
3118 | 3072 | else: |
|
3119 | 3073 | value = opObj.getParameterValue(parameterName='channelList') |
|
3120 | 3074 | channelListRTIPlot = str(value)[1:-1] |
|
3121 | 3075 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3122 | 3076 | self.specGgraphChannelList.setEnabled(True) |
|
3123 | 3077 | |
|
3124 | 3078 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3125 | 3079 | if parmObj == None: |
|
3126 | 3080 | self.specGgraphTminTmax.clear() |
|
3127 | 3081 | else: |
|
3128 | 3082 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3129 | 3083 | value1 = str(value1) |
|
3130 | 3084 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3131 | 3085 | value2 = str(value2) |
|
3132 | 3086 | value = value1 + "," + value2 |
|
3133 | 3087 | self.specGgraphTminTmax.setText(value) |
|
3134 | 3088 | self.specGgraphTminTmax.setEnabled(True) |
|
3135 | 3089 | |
|
3136 | 3090 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3137 | 3091 | if parmObj == None: |
|
3138 | 3092 | self.specGgraphTimeRange.clear() |
|
3139 | 3093 | else: |
|
3140 | 3094 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3141 | 3095 | value1 = str(value1) |
|
3142 | 3096 | self.specGgraphTimeRange.setText(value1) |
|
3143 | 3097 | self.specGgraphTimeRange.setEnabled(True) |
|
3144 | 3098 | |
|
3145 | 3099 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3146 | 3100 | if parmObj == None: |
|
3147 | 3101 | self.specGgraphHeight.clear() |
|
3148 | 3102 | else: |
|
3149 | 3103 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3150 | 3104 | value1 = str(value1) |
|
3151 | 3105 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3152 | 3106 | value2 = str(value2) |
|
3153 | 3107 | value = value1 + "," + value2 |
|
3154 | 3108 | self.specGgraphHeight.setText(value) |
|
3155 | 3109 | self.specGgraphHeight.setEnabled(True) |
|
3156 | 3110 | |
|
3157 | 3111 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3158 | 3112 | if parmObj == None: |
|
3159 | 3113 | self.specGgraphDbsrange.clear() |
|
3160 | 3114 | else: |
|
3161 | 3115 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3162 | 3116 | value1 = str(value1) |
|
3163 | 3117 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3164 | 3118 | value2 = str(value2) |
|
3165 | 3119 | value = value1 + "," + value2 |
|
3166 | 3120 | self.specGgraphDbsrange.setText(value) |
|
3167 | 3121 | self.specGgraphDbsrange.setEnabled(True) |
|
3168 | 3122 | |
|
3169 | 3123 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3170 | 3124 | if parmObj == None: |
|
3171 | 3125 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3172 | 3126 | else: |
|
3173 | 3127 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3174 | 3128 | value = opObj.getParameterValue(parameterName='figpath') |
|
3175 | 3129 | self.specGraphPath.setText(value) |
|
3176 | 3130 | #---------add----# |
|
3177 | 3131 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3178 | 3132 | if parmObj == None: |
|
3179 | 3133 | self.specGraphftpRTIplot.setCheckState(0) |
|
3180 | 3134 | else: |
|
3181 | 3135 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3182 | 3136 | try: |
|
3183 | 3137 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3184 | 3138 | except: |
|
3185 | 3139 | value = " " |
|
3186 | 3140 | self.specGgraphftpratio.setText(str(value)) |
|
3187 | 3141 | |
|
3188 | 3142 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3189 | 3143 | # opObj = puObj.getOpObjfromParamValue(value="CoherenceMap") |
|
3190 | 3144 | if opObj == None: |
|
3191 | 3145 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3192 | 3146 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3193 | 3147 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3194 | 3148 | |
|
3195 | 3149 | else: |
|
3196 | 3150 | operationCoherenceMap = "Enable" |
|
3197 | 3151 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3198 | 3152 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3199 | 3153 | if parmObj == None: |
|
3200 | 3154 | self.specGgraphTminTmax.clear() |
|
3201 | 3155 | else: |
|
3202 | 3156 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3203 | 3157 | value1 = str(value1) |
|
3204 | 3158 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3205 | 3159 | value2 = str(value2) |
|
3206 | 3160 | value = value1 + "," + value2 |
|
3207 | 3161 | self.specGgraphTminTmax.setText(value) |
|
3208 | 3162 | self.specGgraphTminTmax.setEnabled(True) |
|
3209 | 3163 | |
|
3210 | 3164 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3211 | 3165 | if parmObj == None: |
|
3212 | 3166 | self.specGgraphTimeRange.clear() |
|
3213 | 3167 | else: |
|
3214 | 3168 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3215 | 3169 | value1 = str(value1) |
|
3216 | 3170 | self.specGgraphTimeRange.setText(value1) |
|
3217 | 3171 | self.specGgraphTimeRange.setEnabled(True) |
|
3218 | 3172 | |
|
3219 | 3173 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3220 | 3174 | if parmObj == None: |
|
3221 | 3175 | self.specGgraphHeight.clear() |
|
3222 | 3176 | else: |
|
3223 | 3177 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3224 | 3178 | value1 = str(value1) |
|
3225 | 3179 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3226 | 3180 | value2 = str(value2) |
|
3227 | 3181 | value = value1 + "," + value2 |
|
3228 | 3182 | self.specGgraphHeight.setText(value) |
|
3229 | 3183 | self.specGgraphHeight.setEnabled(True) |
|
3230 | 3184 | |
|
3231 | 3185 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3232 | 3186 | if parmObj == None: |
|
3233 | 3187 | self.specGgraphmagnitud.clear() |
|
3234 | 3188 | else: |
|
3235 | 3189 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3236 | 3190 | value1 = str(value1) |
|
3237 | 3191 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3238 | 3192 | value2 = str(value2) |
|
3239 | 3193 | value = value1 + "," + value2 |
|
3240 | 3194 | self.specGgraphmagnitud.setText(value) |
|
3241 | 3195 | self.specGgraphmagnitud.setEnabled(True) |
|
3242 | 3196 | |
|
3243 | 3197 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3244 | 3198 | if parmObj == None: |
|
3245 | 3199 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3246 | 3200 | else: |
|
3247 | 3201 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3248 | 3202 | value = opObj.getParameterValue(parameterName='figpath') |
|
3249 | 3203 | self.specGraphPath.setText(value) |
|
3250 | 3204 | |
|
3251 | 3205 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3252 | 3206 | if parmObj == None: |
|
3253 | 3207 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3254 | 3208 | else: |
|
3255 | 3209 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3256 | 3210 | try: |
|
3257 | 3211 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3258 | 3212 | except: |
|
3259 | 3213 | value = " " |
|
3260 | 3214 | self.specGgraphftpratio.setText(str(value)) |
|
3261 | 3215 | |
|
3262 | 3216 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3263 | 3217 | # opObj = puObj.getOpObjfromParamValue(value="PowerProfilePlot") |
|
3264 | 3218 | if opObj == None: |
|
3265 | 3219 | self.specGraphPowerprofile.setCheckState(0) |
|
3266 | 3220 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3267 | 3221 | operationPowerProfilePlot = "Disabled" |
|
3268 | 3222 | channelList = None |
|
3269 | 3223 | freq_vel = None |
|
3270 | 3224 | heightsrange = None |
|
3271 | 3225 | else: |
|
3272 | 3226 | operationPowerProfilePlot = "Enable" |
|
3273 | 3227 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3274 | 3228 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3275 | 3229 | if parmObj == None: |
|
3276 | 3230 | self.specGgraphDbsrange.clear() |
|
3277 | 3231 | else: |
|
3278 | 3232 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3279 | 3233 | value1 = str(value1) |
|
3280 | 3234 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3281 | 3235 | value2 = str(value2) |
|
3282 | 3236 | value = value1 + "," + value2 |
|
3283 | 3237 | self.specGgraphDbsrange.setText(value) |
|
3284 | 3238 | self.specGgraphDbsrange.setEnabled(True) |
|
3285 | 3239 | |
|
3286 | 3240 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3287 | 3241 | if parmObj == None: |
|
3288 | 3242 | self.specGgraphHeight.clear() |
|
3289 | 3243 | else: |
|
3290 | 3244 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3291 | 3245 | value1 = str(value1) |
|
3292 | 3246 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3293 | 3247 | value2 = str(value2) |
|
3294 | 3248 | value = value1 + "," + value2 |
|
3295 | 3249 | self.specGgraphHeight.setText(value) |
|
3296 | 3250 | self.specGgraphHeight.setEnabled(True) |
|
3297 | 3251 | |
|
3298 | 3252 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3299 | 3253 | if parmObj == None: |
|
3300 | 3254 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3301 | 3255 | else: |
|
3302 | 3256 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3303 | 3257 | value = opObj.getParameterValue(parameterName='figpath') |
|
3304 | 3258 | self.specGraphPath.setText(value) |
|
3305 | 3259 | |
|
3306 | 3260 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3307 | 3261 | if parmObj == None: |
|
3308 | 3262 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3309 | 3263 | else: |
|
3310 | 3264 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3311 | 3265 | try: |
|
3312 | 3266 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3313 | 3267 | except: |
|
3314 | 3268 | value = " " |
|
3315 | 3269 | self.specGgraphftpratio.setText(str(value)) |
|
3316 | 3270 | # -noise |
|
3317 | 3271 | opObj = puObj.getOperationObj(name='Noise') |
|
3318 | 3272 | # opObj = puObj.getOpObjfromParamValue(value="Noise") |
|
3319 | 3273 | if opObj == None: |
|
3320 | 3274 | self.specGraphCebRTInoise.setCheckState(0) |
|
3321 | 3275 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3322 | 3276 | self.specGraphftpRTInoise.setCheckState(0) |
|
3323 | 3277 | else: |
|
3324 | 3278 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3325 | 3279 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3326 | 3280 | if parmObj == None: |
|
3327 | 3281 | self.specGgraphChannelList.clear() |
|
3328 | 3282 | else: |
|
3329 | 3283 | value = opObj.getParameterValue(parameterName='channelList') |
|
3330 | 3284 | channelListRTINoise = str(value)[1:-1] |
|
3331 | 3285 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3332 | 3286 | self.specGgraphChannelList.setEnabled(True) |
|
3333 | 3287 | |
|
3334 | 3288 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3335 | 3289 | if parmObj == None: |
|
3336 | 3290 | self.specGgraphTminTmax.clear() |
|
3337 | 3291 | else: |
|
3338 | 3292 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3339 | 3293 | value1 = str(value1) |
|
3340 | 3294 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3341 | 3295 | value2 = str(value2) |
|
3342 | 3296 | value = value1 + "," + value2 |
|
3343 | 3297 | self.specGgraphTminTmax.setText(value) |
|
3344 | 3298 | self.specGgraphTminTmax.setEnabled(True) |
|
3345 | 3299 | |
|
3346 | 3300 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3347 | 3301 | if parmObj == None: |
|
3348 | 3302 | self.specGgraphTimeRange.clear() |
|
3349 | 3303 | else: |
|
3350 | 3304 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3351 | 3305 | value1 = str(value1) |
|
3352 | 3306 | self.specGgraphTimeRange.setText(value1) |
|
3353 | 3307 | self.specGgraphTimeRange.setEnabled(True) |
|
3354 | 3308 | |
|
3355 | 3309 | |
|
3356 | 3310 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3357 | 3311 | if parmObj == None: |
|
3358 | 3312 | self.specGgraphDbsrange.clear() |
|
3359 | 3313 | else: |
|
3360 | 3314 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3361 | 3315 | value1 = str(value1) |
|
3362 | 3316 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3363 | 3317 | value2 = str(value2) |
|
3364 | 3318 | value = value1 + "," + value2 |
|
3365 | 3319 | self.specGgraphDbsrange.setText(value) |
|
3366 | 3320 | self.specGgraphDbsrange.setEnabled(True) |
|
3367 | 3321 | |
|
3368 | 3322 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3369 | 3323 | if parmObj == None: |
|
3370 | 3324 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3371 | 3325 | else: |
|
3372 | 3326 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3373 | 3327 | value = opObj.getParameterValue(parameterName='figpath') |
|
3374 | 3328 | self.specGraphPath.setText(value) |
|
3375 | 3329 | #---------add----# |
|
3376 | 3330 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3377 | 3331 | if parmObj == None: |
|
3378 | 3332 | self.specGraphftpRTInoise.setCheckState(0) |
|
3379 | 3333 | else: |
|
3380 | 3334 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3381 | 3335 | try: |
|
3382 | 3336 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3383 | 3337 | except: |
|
3384 | 3338 | value = " " |
|
3385 | 3339 | self.specGgraphftpratio.setText(str(value)) |
|
3386 | 3340 | |
|
3387 | 3341 | # outputSpectraWrite |
|
3388 | 3342 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3389 | 3343 | if opObj == None: |
|
3390 | 3344 | self.specOutputPath.clear() |
|
3391 | 3345 | self.specOutputblocksperfile.clear() |
|
3392 | 3346 | self.specOutputprofileperblock.clear() |
|
3393 | 3347 | else: |
|
3394 | 3348 | value = opObj.getParameterObj(parameterName='path') |
|
3395 | 3349 | if value == None: |
|
3396 | 3350 | self.specOutputPath.clear() |
|
3397 | 3351 | else: |
|
3398 | 3352 | value = opObj.getParameterValue(parameterName='path') |
|
3399 | 3353 | path = str(value) |
|
3400 | 3354 | self.specOutputPath.setText(path) |
|
3401 | 3355 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3402 | 3356 | if value == None: |
|
3403 | 3357 | self.specOutputblocksperfile.clear() |
|
3404 | 3358 | else: |
|
3405 | 3359 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3406 | 3360 | blocksperfile = str(value) |
|
3407 | 3361 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3408 | 3362 | value = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
3409 | 3363 | if value == None: |
|
3410 | 3364 | self.specOutputprofileperblock.clear() |
|
3411 | 3365 | else: |
|
3412 | 3366 | value = opObj.getParameterValue(parameterName='profilesPerBlock') |
|
3413 | 3367 | profilesPerBlock = str(value) |
|
3414 | 3368 | self.specOutputprofileperblock.setText(profilesPerBlock) |
|
3415 | 3369 | |
|
3416 | 3370 | if datatype == 'SpectraHeis': |
|
3417 | 3371 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3418 | 3372 | if opObj == None: |
|
3419 | 3373 | self.specHeisOpIncoherent.clear() |
|
3420 | 3374 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3421 | 3375 | else: |
|
3422 | 3376 | for parmObj in opObj.getParameterObjList(): |
|
3423 | 3377 | if parmObj.name == 'timeInterval': |
|
3424 | 3378 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3425 | 3379 | value = float(value) |
|
3426 | 3380 | self.specHeisOpIncoherent.setText(str(value)) |
|
3427 | 3381 | self.specHeisOpIncoherent.setEnabled(True) |
|
3428 | 3382 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3429 | 3383 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3430 | 3384 | |
|
3431 | 3385 | # SpectraHeis Graph |
|
3432 | 3386 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3433 | 3387 | # opObj = puObj.getOpObjfromParamValue(value="SpectraHeisScope") |
|
3434 | 3388 | if opObj == None: |
|
3435 | 3389 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3436 | 3390 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3437 | 3391 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3438 | 3392 | |
|
3439 | 3393 | else: |
|
3440 | 3394 | operationSpectraHeisScope = "Enable" |
|
3441 | 3395 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3442 | 3396 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3443 | 3397 | if parmObj == None: |
|
3444 | 3398 | self.specHeisGgraphChannelList.clear() |
|
3445 | 3399 | else: |
|
3446 | 3400 | value = opObj.getParameterValue(parameterName='channelList') |
|
3447 | 3401 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3448 | 3402 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3449 | 3403 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3450 | 3404 | |
|
3451 | 3405 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3452 | 3406 | if parmObj == None: |
|
3453 | 3407 | self.specHeisGgraphXminXmax.clear() |
|
3454 | 3408 | else: |
|
3455 | 3409 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3456 | 3410 | value1 = str(value1) |
|
3457 | 3411 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3458 | 3412 | value2 = str(value2) |
|
3459 | 3413 | value = value1 + "," + value2 |
|
3460 | 3414 | self.specHeisGgraphXminXmax.setText(value) |
|
3461 | 3415 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3462 | 3416 | |
|
3463 | 3417 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3464 | 3418 | if parmObj == None: |
|
3465 | 3419 | self.specHeisGgraphYminYmax.clear() |
|
3466 | 3420 | else: |
|
3467 | 3421 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3468 | 3422 | value1 = str(value1) |
|
3469 | 3423 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3470 | 3424 | value2 = str(value2) |
|
3471 | 3425 | value = value1 + "," + value2 |
|
3472 | 3426 | self.specHeisGgraphYminYmax.setText(value) |
|
3473 | 3427 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3474 | 3428 | |
|
3475 | 3429 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3476 | 3430 | if parmObj == None: |
|
3477 | 3431 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3478 | 3432 | else: |
|
3479 | 3433 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3480 | 3434 | value = opObj.getParameterValue(parameterName='figpath') |
|
3481 | 3435 | self.specHeisGraphPath.setText(value) |
|
3482 | 3436 | |
|
3483 | 3437 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3484 | 3438 | if parmObj == None: |
|
3485 | 3439 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3486 | 3440 | else: |
|
3487 | 3441 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3488 | 3442 | try: |
|
3489 | 3443 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3490 | 3444 | except: |
|
3491 | 3445 | value = " " |
|
3492 | 3446 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3493 | 3447 | |
|
3494 | 3448 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3495 | 3449 | # opObj = puObj.getOpObjfromParamValue(value="RTIfromSpectraHeis") |
|
3496 | 3450 | if opObj == None: |
|
3497 | 3451 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3498 | 3452 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3499 | 3453 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3500 | 3454 | else: |
|
3501 | 3455 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3502 | 3456 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3503 | 3457 | if parmObj == None: |
|
3504 | 3458 | self.specHeisGgraphChannelList.clear() |
|
3505 | 3459 | else: |
|
3506 | 3460 | value = opObj.getParameterValue(parameterName='channelList') |
|
3507 | 3461 | channelListRTIPlot = str(value)[1:-1] |
|
3508 | 3462 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3509 | 3463 | self.specGgraphChannelList.setEnabled(True) |
|
3510 | 3464 | |
|
3511 | 3465 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3512 | 3466 | if parmObj == None: |
|
3513 | 3467 | self.specHeisGgraphTminTmax.clear() |
|
3514 | 3468 | else: |
|
3515 | 3469 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3516 | 3470 | value1 = str(value1) |
|
3517 | 3471 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3518 | 3472 | value2 = str(value2) |
|
3519 | 3473 | value = value1 + "," + value2 |
|
3520 | 3474 | self.specHeisGgraphTminTmax.setText(value) |
|
3521 | 3475 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3522 | 3476 | |
|
3523 | 3477 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3524 | 3478 | if parmObj == None: |
|
3525 | 3479 | self.specGgraphTimeRange.clear() |
|
3526 | 3480 | else: |
|
3527 | 3481 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3528 | 3482 | value1 = str(value1) |
|
3529 | 3483 | self.specHeisGgraphTimeRange.setText(value1) |
|
3530 | 3484 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3531 | 3485 | |
|
3532 | 3486 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3533 | 3487 | if parmObj == None: |
|
3534 | 3488 | self.specHeisGgraphYminYmax.clear() |
|
3535 | 3489 | else: |
|
3536 | 3490 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3537 | 3491 | value1 = str(value1) |
|
3538 | 3492 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3539 | 3493 | value2 = str(value2) |
|
3540 | 3494 | value = value1 + "," + value2 |
|
3541 | 3495 | self.specHeisGgraphYminYmax.setText(value) |
|
3542 | 3496 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3543 | 3497 | |
|
3544 | 3498 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3545 | 3499 | if parmObj == None: |
|
3546 | 3500 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3547 | 3501 | else: |
|
3548 | 3502 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3549 | 3503 | value = opObj.getParameterValue(parameterName='figpath') |
|
3550 | 3504 | self.specHeisGraphPath.setText(value) |
|
3551 | 3505 | #---------add----# |
|
3552 | 3506 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3553 | 3507 | if parmObj == None: |
|
3554 | 3508 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3555 | 3509 | else: |
|
3556 | 3510 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3557 | 3511 | try: |
|
3558 | 3512 | value = opObj.getParameterValue(parameterName='wr_period') |
|
3559 | 3513 | except: |
|
3560 | 3514 | value = " " |
|
3561 | 3515 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3562 | 3516 | |
|
3563 | 3517 | |
|
3564 | 3518 | |
|
3565 | 3519 | # outputSpectraHeisWrite |
|
3566 | 3520 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3567 | 3521 | if opObj == None: |
|
3568 | 3522 | self.specHeisOutputPath.clear() |
|
3569 | 3523 | self.specHeisOutputblocksperfile.clear() |
|
3570 | 3524 | self.specHeisOutputMetada.clear() |
|
3571 | 3525 | else: |
|
3572 | 3526 | value = opObj.getParameterObj(parameterName='path') |
|
3573 | 3527 | if value == None: |
|
3574 | 3528 | self.specHeisOutputPath.clear() |
|
3575 | 3529 | else: |
|
3576 | 3530 | value = opObj.getParameterValue(parameterName='path') |
|
3577 | 3531 | path = str(value) |
|
3578 | 3532 | self.specHeisOutputPath.setText(path) |
|
3579 | 3533 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3580 | 3534 | if value == None: |
|
3581 | 3535 | self.specHeisOutputblocksperfile.clear() |
|
3582 | 3536 | else: |
|
3583 | 3537 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3584 | 3538 | blocksperfile = str(value) |
|
3585 | 3539 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3586 | 3540 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3587 | 3541 | if value == None: |
|
3588 | 3542 | self.specHeisOutputMetada.clear() |
|
3589 | 3543 | else: |
|
3590 | 3544 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3591 | 3545 | metada = str(value) |
|
3592 | 3546 | self.specHeisOutputMetada.setText(metada) |
|
3593 | 3547 | |
|
3594 | 3548 | |
|
3595 | 3549 | |
|
3596 | 3550 | def setspecGraph(self): |
|
3597 | 3551 | |
|
3598 | 3552 | self.specGgraphChannelList.setEnabled(True) |
|
3599 | 3553 | |
|
3600 | 3554 | def clearspecGraph(self): |
|
3601 | 3555 | |
|
3602 | 3556 | self.specGgraphChannelList.clear() |
|
3603 | 3557 | |
|
3604 | 3558 | def create_comm(self): |
|
3605 | 3559 | self.commCtrlPThread = CommCtrlProcessThread() |
|
3606 | 3560 | self.commCtrlPThread.start() |
|
3607 | 3561 | |
|
3608 | 3562 | def create_timers(self): |
|
3609 | 3563 | self.comm_data_timer = QtCore.QTimer(self) |
|
3610 | 3564 | self.comm_data_timer.timeout.connect(self.on_comm_data_timer) |
|
3611 | 3565 | self.comm_data_timer.start(10) |
|
3612 | 3566 | |
|
3613 | 3567 | def create_figure(self): |
|
3614 | 3568 | self.queue_plot = Queue.Queue() |
|
3615 | 3569 | self.plotmanager = PlotManager(self.queue_plot) |
|
3616 | 3570 | self.plot_timer = QtCore.QTimer() |
|
3617 | 3571 | QtCore.QObject.connect(self.plot_timer, QtCore.SIGNAL("timeout()"), self.periodicCall) |
|
3618 | 3572 | self.plot_timer.start(100) |
|
3619 | 3573 | self.running = 1 |
|
3620 | 3574 | |
|
3621 | 3575 | def periodicCall(self): |
|
3622 | 3576 | """ |
|
3623 | 3577 | Check every 100 ms if there is something new in the queue. |
|
3624 | 3578 | """ |
|
3625 | 3579 | self.plotmanager.processIncoming() |
|
3626 | 3580 | if not self.running: |
|
3627 | 3581 | app.quit() |
|
3628 | 3582 | |
|
3629 | 3583 | def on_comm_data_timer(self): |
|
3630 | 3584 | # lee el data_queue y la coloca en el queue de ploteo |
|
3631 | 3585 | try: |
|
3632 | 3586 | reply = self.commCtrlPThread.data_q.get(block=False) |
|
3633 | 3587 | self.queue_plot.put(reply.data) |
|
3634 | 3588 | |
|
3635 | 3589 | except Queue.Empty: |
|
3636 | 3590 | pass |
|
3637 | 3591 | |
|
3638 | 3592 | def createProjectView(self, id): |
|
3639 | 3593 | |
|
3640 | 3594 | self.create = False |
|
3641 | 3595 | project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
3642 | 3596 | |
|
3643 | 3597 | projectObjView = Project() |
|
3644 | 3598 | projectObjView.setup(id=id, name=project_name, description=description) |
|
3645 | 3599 | |
|
3646 | 3600 | self.__projectObjDict[id] = projectObjView |
|
3647 | 3601 | |
|
3648 | 3602 | return projectObjView |
|
3649 | 3603 | |
|
3650 | 3604 | def updateProjectView(self): |
|
3651 | 3605 | |
|
3652 | 3606 | project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
3653 | 3607 | |
|
3654 | 3608 | projectObjView = self.getSelectedProjectObj() |
|
3655 | 3609 | projectObjView.update(name=project_name, description=description) |
|
3656 | 3610 | |
|
3657 | 3611 | return projectObjView |
|
3658 | 3612 | |
|
3659 | 3613 | def createReadUnitView(self, projectObjView): |
|
3660 | 3614 | |
|
3661 | 3615 | project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
3662 | 3616 | if set == None: |
|
3663 | 3617 | readUnitConfObj = projectObjView.addReadUnit(datatype=datatype, |
|
3664 | 3618 | path=data_path, |
|
3665 | 3619 | startDate=startDate, |
|
3666 | 3620 | endDate=endDate, |
|
3667 | 3621 | startTime=startTime, |
|
3668 | 3622 | endTime=endTime, |
|
3669 | 3623 | online=online, |
|
3670 | 3624 | delay=delay, |
|
3671 | 3625 | walk=walk) |
|
3672 | 3626 | else: |
|
3673 | 3627 | readUnitConfObj = projectObjView.addReadUnit(datatype=datatype, |
|
3674 | 3628 | path=data_path, |
|
3675 | 3629 | startDate=startDate, |
|
3676 | 3630 | endDate=endDate, |
|
3677 | 3631 | startTime=startTime, |
|
3678 | 3632 | endTime=endTime, |
|
3679 | 3633 | online=online, |
|
3680 | 3634 | delay=delay, |
|
3681 | 3635 | walk=walk, |
|
3682 | 3636 | set=set) |
|
3683 | 3637 | |
|
3684 | 3638 | return readUnitConfObj |
|
3685 | 3639 | |
|
3686 | 3640 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
3687 | 3641 | |
|
3688 | 3642 | project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
3689 | 3643 | |
|
3690 | 3644 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
3691 | 3645 | |
|
3692 | 3646 | if set == None: |
|
3693 | 3647 | |
|
3694 | 3648 | readUnitConfObj.update(datatype=datatype, |
|
3695 | 3649 | path=data_path, |
|
3696 | 3650 | startDate=startDate, |
|
3697 | 3651 | endDate=endDate, |
|
3698 | 3652 | startTime=startTime, |
|
3699 | 3653 | endTime=endTime, |
|
3700 | 3654 | online=online, |
|
3701 | 3655 | delay=delay, |
|
3702 | 3656 | walk=walk) |
|
3703 | 3657 | |
|
3704 | 3658 | else: |
|
3705 | 3659 | readUnitConfObj.update(datatype=datatype, |
|
3706 | 3660 | path=data_path, |
|
3707 | 3661 | startDate=startDate, |
|
3708 | 3662 | endDate=endDate, |
|
3709 | 3663 | startTime=startTime, |
|
3710 | 3664 | endTime=endTime, |
|
3711 | 3665 | online=online, |
|
3712 | 3666 | delay=delay, |
|
3713 | 3667 | walk=walk, |
|
3714 | 3668 | set=set) |
|
3715 | 3669 | |
|
3716 | 3670 | |
|
3717 | 3671 | |
|
3718 | 3672 | return readUnitConfObj |
|
3719 | 3673 | |
|
3720 | 3674 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
3721 | 3675 | |
|
3722 | 3676 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
3723 | 3677 | |
|
3724 | 3678 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
3725 | 3679 | |
|
3726 | 3680 | return procUnitConfObj |
|
3727 | 3681 | |
|
3728 | 3682 | def updateProcUnitView(self, id): |
|
3729 | 3683 | |
|
3730 | 3684 | procUnitConfObj = projectObjView.getProcUnitObj(id) |
|
3731 | 3685 | procUnitConfObj.removeOperations() |
|
3732 | 3686 | |
|
3733 | 3687 | return procUnitConfObj |
|
3734 | 3688 | |
|
3735 | 3689 | def addPUWindow(self): |
|
3736 | 3690 | |
|
3737 | 3691 | self.configUPWindowObj = UnitProcessWindow(self) |
|
3738 | 3692 | fatherObj = self.getSelectedPUObj() |
|
3739 | 3693 | try: |
|
3740 | 3694 | fatherObj.getElementName() |
|
3741 | 3695 | except: |
|
3742 | 3696 | self.console.append("First left click on Project or Processing Unit") |
|
3743 | 3697 | return 0 |
|
3744 | 3698 | |
|
3745 | 3699 | if fatherObj.getElementName() == 'Project': |
|
3746 | 3700 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
3747 | 3701 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
3748 | 3702 | |
|
3749 | 3703 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
3750 | 3704 | self.configUPWindowObj.loadTotalList() |
|
3751 | 3705 | self.configUPWindowObj.show() |
|
3752 | 3706 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
3753 | 3707 | |
|
3754 | 3708 | def createPUWindow(self): |
|
3755 | 3709 | |
|
3756 | 3710 | self.console.clear() |
|
3757 | 3711 | |
|
3758 | 3712 | if not self.configUPWindowObj.create: |
|
3759 | 3713 | return |
|
3760 | 3714 | |
|
3761 | 3715 | fatherObj = self.configUPWindowObj.getFromWindow |
|
3762 | 3716 | datatype = self.configUPWindowObj.typeofUP |
|
3763 | 3717 | |
|
3764 | 3718 | if fatherObj.getElementName() == 'Project': |
|
3765 | 3719 | inputId = fatherObj.getReadUnitId() |
|
3766 | 3720 | projectObjView = fatherObj |
|
3767 | 3721 | else: |
|
3768 | 3722 | inputId = fatherObj.getId() |
|
3769 | 3723 | projectObjView = self.getSelectedProjectObj() |
|
3770 | 3724 | |
|
3771 | 3725 | #---------------------------- |
|
3772 | 3726 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
3773 | 3727 | #---------------------------- |
|
3774 | 3728 | self.addPU2ProjectExplorer(id=puObj.getId(), name=datatype) |
|
3775 | 3729 | |
|
3776 | 3730 | self.showtabPUCreated(datatype) |
|
3777 | 3731 | |
|
3778 | 3732 | self.setInputsPU_View(datatype) |
|
3779 | 3733 | |
|
3780 | 3734 | self.showPUinitView() |
|
3781 | 3735 | |
|
3782 | 3736 | def addFTPConf2Operation(self, puObj, opObj): |
|
3783 | 3737 | |
|
3784 | 3738 | if self.temporalFTP.create: |
|
3785 | 3739 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
3786 | 3740 | else: |
|
3787 | 3741 | self.temporalFTP.setwithoutconfiguration() |
|
3788 | 3742 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
3789 | 3743 | |
|
3790 | 3744 | # opObj.addParameter(name='server', value=server, format='str') |
|
3791 | 3745 | # opObj.addParameter(name='folder', value=remotefolder, format='str') |
|
3792 | 3746 | # opObj.addParameter(name='username', value=username, format='str') |
|
3793 | 3747 | # opObj.addParameter(name='password', value=password, format='str') |
|
3794 | 3748 | |
|
3795 | 3749 | if ftp_wei: |
|
3796 | 3750 | opObj.addParameter(name='ftp_wei', value=int(ftp_wei), format='int') |
|
3797 | 3751 | if exp_code: |
|
3798 | 3752 | opObj.addParameter(name='exp_code', value=int(exp_code), format='int') |
|
3799 | 3753 | if sub_exp_code: |
|
3800 | 3754 | opObj.addParameter(name='sub_exp_code', value=int(sub_exp_code), format='int') |
|
3801 | 3755 | if plot_pos: |
|
3802 | 3756 | opObj.addParameter(name='plot_pos', value=int(plot_pos), format='int') |
|
3803 | 3757 | |
|
3804 | 3758 | if puObj.datatype == "Spectra": |
|
3805 | 3759 | value = self.specGgraphftpratio.text() |
|
3806 | 3760 | if puObj.datatype == "SpectraHeis": |
|
3807 | 3761 | value = self.specHeisGgraphftpratio.text() |
|
3808 | 3762 | |
|
3809 | 3763 | if not value == "": |
|
3810 | 3764 | try: |
|
3811 | 3765 | value = int(value) |
|
3812 | 3766 | except: |
|
3813 | 3767 | self.console.clear() |
|
3814 | 3768 | self.console.append("Please fill Ratio on the textbox") |
|
3815 | 3769 | return 0 |
|
3816 | 3770 | |
|
3817 | 3771 | opObj.addParameter(name='wr_period', value=value, format='int') |
|
3818 | 3772 | |
|
3819 | 3773 | def createFTPProcUnitView(self, server, username, password, remotefolder, |
|
3820 | 3774 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
3821 | 3775 | localfolder='./', extension='.png', period='60', protocol='ftp'): |
|
3822 | 3776 | |
|
3823 | 3777 | projectObj = self.getSelectedProjectObj() |
|
3824 | 3778 | procUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") |
|
3825 | 3779 | |
|
3826 | 3780 | if not procUnitConfObj: |
|
3827 | 3781 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
3828 | 3782 | else: |
|
3829 | 3783 | procUnitConfObj.removeOperations() |
|
3830 | 3784 | |
|
3831 | 3785 | procUnitConfObj.addParameter(name='server', value=server, format='str') |
|
3832 | 3786 | procUnitConfObj.addParameter(name='username', value=username, format='str') |
|
3833 | 3787 | procUnitConfObj.addParameter(name='password', value=password, format='str') |
|
3834 | 3788 | procUnitConfObj.addParameter(name='localfolder', value=localfolder, format='str') |
|
3835 | 3789 | procUnitConfObj.addParameter(name='remotefolder', value=remotefolder, format='str') |
|
3836 | 3790 | procUnitConfObj.addParameter(name='ext', value=extension, format='str') |
|
3837 | 3791 | procUnitConfObj.addParameter(name='period', value=period, format='int') |
|
3838 | 3792 | procUnitConfObj.addParameter(name='protocol', value=protocol, format='str') |
|
3839 | 3793 | |
|
3840 | 3794 | procUnitConfObj.addParameter(name='ftp_wei', value=ftp_wei, format='str') |
|
3841 | 3795 | procUnitConfObj.addParameter(name='exp_code', value=exp_code, format='str') |
|
3842 | 3796 | procUnitConfObj.addParameter(name='sub_exp_code', value=sub_exp_code, format='str') |
|
3843 | 3797 | procUnitConfObj.addParameter(name='plot_pos', value=plot_pos, format='str') |
|
3844 | 3798 | |
|
3845 | 3799 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
3846 | 3800 | |
|
3847 | 3801 | self.__ftpProcUnitAdded = True |
|
3848 | 3802 | self.__ftpProcUnitId = procUnitConfObj.getId() |
|
3849 | 3803 | |
|
3850 | 3804 | def removeFTPProcUnitView(self): |
|
3851 | 3805 | |
|
3852 | 3806 | projectObj = self.getSelectedProjectObj() |
|
3853 | 3807 | procUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") |
|
3854 | 3808 | |
|
3855 | 3809 | self.__ftpProcUnitAdded = False |
|
3856 | 3810 | self.__ftpProcUnitId = None |
|
3857 | 3811 | |
|
3858 | 3812 | if not procUnitConfObj: |
|
3859 | 3813 | return |
|
3860 | 3814 | |
|
3861 | 3815 | procUnitConfObj.removeOperations() |
|
3862 | 3816 | |
|
3863 | 3817 | self.__puObjDict.pop(procUnitConfObj.getId()) |
|
3864 | 3818 | |
|
3865 | 3819 | def bufferProject(self, caracteristica, principal, description): |
|
3866 | 3820 | |
|
3867 | 3821 | self.projectProperCaracteristica.append(caracteristica) |
|
3868 | 3822 | self.projectProperPrincipal.append(principal) |
|
3869 | 3823 | self.projectProperDescripcion.append(description) |
|
3870 | 3824 | return self.projectProperCaracteristica, self.projectProperPrincipal, self.projectProperDescripcion |
|
3871 | 3825 | |
|
3872 | 3826 | |
|
3873 | 3827 | def showProjectProperties(self, projectObjView): |
|
3874 | 3828 | |
|
3875 | 3829 | project_name, description = projectObjView.name, projectObjView.description |
|
3876 | 3830 | |
|
3877 | 3831 | id = projectObjView.id |
|
3878 | 3832 | readUnitId = projectObjView.getReadUnitId() |
|
3879 | 3833 | readUnitObj = projectObjView.getProcUnitObj(readUnitId) |
|
3880 | 3834 | operationObj = readUnitObj.getOperationObj(name='run') |
|
3881 | 3835 | |
|
3882 | 3836 | |
|
3883 | 3837 | datatype = operationObj.getParameterValue(parameterName='datatype') |
|
3884 | 3838 | dpath = operationObj.getParameterValue(parameterName='path') |
|
3885 | 3839 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
3886 | 3840 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
3887 | 3841 | startDate = str(startDate) |
|
3888 | 3842 | endDate = str(endDate) |
|
3889 | 3843 | startDateList = startDate.split('-') |
|
3890 | 3844 | endDateList = endDate.split('-') |
|
3891 | 3845 | startDate = startDateList[0] + "/" + startDateList[1] + "/" + startDateList[2] |
|
3892 | 3846 | endDate = endDateList[0] + "/" + endDateList[1] + "/" + endDateList[2] |
|
3893 | 3847 | |
|
3894 | 3848 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
3895 | 3849 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
3896 | 3850 | online = operationObj.getParameterValue(parameterName='online') |
|
3897 | 3851 | walk = operationObj.getParameterValue(parameterName='walk') |
|
3898 | 3852 | delay = operationObj.getParameterValue(parameterName='delay') |
|
3899 | 3853 | try: |
|
3900 | 3854 | set = operationObj.getParameterValue(parameterName='set') |
|
3901 | 3855 | except: |
|
3902 | 3856 | set = " " |
|
3903 | 3857 | |
|
3904 | 3858 | if online == 0: |
|
3905 | 3859 | remode = "offline" |
|
3906 | 3860 | else: |
|
3907 | 3861 | remode = "online" |
|
3908 | 3862 | |
|
3909 | 3863 | if walk == 0: |
|
3910 | 3864 | walk_str = 'On Files' |
|
3911 | 3865 | else: |
|
3912 | 3866 | walk_str = 'On Folder' |
|
3913 | 3867 | |
|
3914 | 3868 | self.bufferProject("Properties", "Name", project_name), |
|
3915 | 3869 | self.bufferProject("Properties", "Data Path", dpath) |
|
3916 | 3870 | self.bufferProject("Properties", "Workspace", self.pathWorkSpace) |
|
3917 | 3871 | self.bufferProject("Parameters", "Read Mode ", remode) |
|
3918 | 3872 | self.bufferProject("Parameters", "DataType ", datatype) |
|
3919 | 3873 | self.bufferProject("Parameters", "Start Date", str(startDate)) |
|
3920 | 3874 | self.bufferProject("Parameters", "End Date ", str(endDate)) |
|
3921 | 3875 | self.bufferProject("Parameters", "Start Time", str(startTime)) |
|
3922 | 3876 | self.bufferProject("Parameters", "End Time ", str(endTime)) |
|
3923 | 3877 | self.bufferProject("Parameters", "Delay ", str(delay)) |
|
3924 | 3878 | try: |
|
3925 | 3879 | set = operationObj.getParameterValue(parameterName='set') |
|
3926 | 3880 | self.bufferProject("Parameters", "Set ", set) |
|
3927 | 3881 | except: |
|
3928 | 3882 | set = " " |
|
3929 | 3883 | self.bufferProject("Parameters", "Walk ", str(walk_str)) |
|
3930 | 3884 | self.bufferProject("Parameters", "Time zone", "Local") |
|
3931 | 3885 | self.bufferProject("Description", "Summary ", description) |
|
3932 | 3886 | |
|
3933 | 3887 | self.propertiesModel = treeModel() |
|
3934 | 3888 | self.propertiesModel.showProjectParms(self.projectProperCaracteristica, self.projectProperPrincipal, self.projectProperDescripcion) |
|
3935 | 3889 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
3936 | 3890 | self.treeProjectProperties.expandAll() |
|
3937 | 3891 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3938 | 3892 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3939 | 3893 | |
|
3940 | 3894 | self.projectProperCaracteristica = [] |
|
3941 | 3895 | self.projectProperPrincipal = [] |
|
3942 | 3896 | self.projectProperDescripcion = [] |
|
3943 | 3897 | |
|
3944 | 3898 | return datatype , dpath , startDate , endDate, startTime, endTime, online, delay, walk, set |
|
3945 | 3899 | |
|
3946 | 3900 | def showPUinitView(self): |
|
3947 | 3901 | self.propertiesModel = treeModel() |
|
3948 | 3902 | self.propertiesModel.initPUVoltageView() |
|
3949 | 3903 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
3950 | 3904 | self.treeProjectProperties.expandAll() |
|
3951 | 3905 | self.treeProjectProperties.allColumnsShowFocus() |
|
3952 | 3906 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3953 | 3907 | |
|
3954 | 3908 | def bufferVoltage(self, caracteristica, principal, description): |
|
3955 | 3909 | self.volProperCaracteristica.append(caracteristica) |
|
3956 | 3910 | self.volProperPrincipal.append(principal) |
|
3957 | 3911 | self.volProperDescripcion.append(description) |
|
3958 | 3912 | return self.volProperCaracteristica, self.volProperPrincipal, self.volProperDescripcion |
|
3959 | 3913 | |
|
3960 | 3914 | def showPUVoltageProperties(self, puObj): |
|
3961 | 3915 | |
|
3962 | 3916 | |
|
3963 | 3917 | type = puObj.name |
|
3964 | 3918 | self.bufferVoltage("Processing Unit", "Type", type) |
|
3965 | 3919 | |
|
3966 | 3920 | opObj = puObj.getOperationObj(name="setRadarFrequency") |
|
3967 | 3921 | if opObj == None: |
|
3968 | 3922 | radarfrequency = None |
|
3969 | 3923 | else: |
|
3970 | 3924 | value = opObj.getParameterValue(parameterName='frequency') |
|
3971 | 3925 | value = str(value) |
|
3972 | 3926 | radarfrequency = value |
|
3973 | 3927 | self.bufferVoltage("Processing Unit", "Radar Frequency", radarfrequency) |
|
3974 | 3928 | |
|
3975 | 3929 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3976 | 3930 | if opObj == None: |
|
3977 | 3931 | channel = None |
|
3978 | 3932 | else: |
|
3979 | 3933 | value = opObj.getParameterValue(parameterName='channelList') |
|
3980 | value = str(value)[1:-1] | |
|
3934 | value = str(value)#[1:-1] | |
|
3981 | 3935 | channel = value |
|
3982 | 3936 | self.bufferVoltage("Processing Unit", "Select Channel", channel) |
|
3983 | 3937 | |
|
3984 | 3938 | |
|
3985 | 3939 | |
|
3986 | 3940 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3987 | 3941 | if opObj == None: |
|
3988 | 3942 | heights = None |
|
3989 | 3943 | else: |
|
3990 | 3944 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3991 | 3945 | value1 = str(value1) |
|
3992 | 3946 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3993 | 3947 | value2 = str(value2) |
|
3994 | 3948 | value = value1 + "," + value2 |
|
3995 | 3949 | heights = value |
|
3996 | 3950 | self.bufferVoltage("Processing Unit", "Select Heights", heights) |
|
3997 | 3951 | |
|
3998 | 3952 | |
|
3999 | 3953 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
4000 | 3954 | if opObj == None: |
|
4001 | 3955 | filter = None |
|
4002 | 3956 | else: |
|
4003 | 3957 | value = opObj.getParameterValue(parameterName='window') |
|
4004 | 3958 | value = str(value) |
|
4005 | 3959 | filter = value |
|
4006 | 3960 | self.bufferVoltage("Processing Unit", "Filter", filter) |
|
4007 | 3961 | |
|
4008 | 3962 | |
|
4009 | 3963 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
4010 | 3964 | if opObj == None: |
|
4011 | 3965 | profile = None |
|
4012 | 3966 | else: |
|
4013 | 3967 | for parmObj in opObj.getParameterObjList(): |
|
4014 | 3968 | if parmObj.name == "profileRangeList": |
|
4015 | 3969 | value = opObj.getParameterValue(parameterName='profileRangeList') |
|
4016 | value = str(value)[1:-1] | |
|
3970 | value = str(value)#[1:-1] | |
|
4017 | 3971 | profile = value |
|
4018 | 3972 | self.bufferVoltage("Processing Unit", "Select Profile", profile) |
|
4019 | 3973 | |
|
4020 | 3974 | if parmObj.name == "profileList": |
|
4021 | 3975 | value = opObj.getParameterValue(parameterName='profileList') |
|
4022 | value = str(value)[1:-1] | |
|
3976 | value = str(value)#[1:-1] | |
|
4023 | 3977 | profile = value |
|
4024 | 3978 | self.bufferVoltage("Processing Unit", "Select Profile", profile) |
|
4025 | 3979 | |
|
4026 | opObj = puObj.getOperationObj(name="CohInt") | |
|
4027 | if opObj == None: | |
|
4028 | coherentintegration = None | |
|
4029 | else: | |
|
4030 | value = opObj.getParameterValue(parameterName='n') | |
|
4031 | coherentintegration = value | |
|
4032 | self.bufferVoltage("Processing Unit", "Coherente Integration", coherentintegration) | |
|
4033 | ||
|
4034 | ||
|
4035 | 3980 | |
|
4036 | 3981 | opObj = puObj.getOperationObj(name="Decoder") |
|
4037 | 3982 | if opObj == None: |
|
4038 | 3983 | self.volOpCebDecodification.setCheckState(0) |
|
4039 | 3984 | code = None |
|
4040 | 3985 | mode = None |
|
4041 | 3986 | else: |
|
4042 | 3987 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
4043 | 3988 | try: |
|
4044 |
|
|
|
3989 | code = opObj.getParameterValue(parameterName='code') | |
|
3990 | nBaud = opObj.getParameterValue(parameterName='nBaud') | |
|
3991 | nCode = opObj.getParameterValue(parameterName='nCode') | |
|
3992 | code = numpy.array(code).reshape(nCode,nBaud) | |
|
4045 | 3993 | except: |
|
4046 | status = "off" | |
|
4047 | try: | |
|
4048 | valueCode = opObj.getParameterValue(parameterName='nCode') | |
|
4049 | status = "on" | |
|
4050 | except: | |
|
4051 | status = "off" | |
|
4052 | ||
|
4053 | if not status == "off": | |
|
4054 | if int(valueCode) == 1: | |
|
4055 | Comp = "" | |
|
4056 | else: | |
|
4057 | Comp = "+" + "Comp." | |
|
4058 | code = "Barker" + str(valueBaud) + str(Comp) | |
|
4059 | else: | |
|
4060 | 3994 | code = "Default" |
|
4061 | self.bufferVoltage("Decodification", "Code", code) | |
|
3995 | ||
|
3996 | self.bufferVoltage("Processing Unit", "Code", str(code).replace('\n','')) | |
|
4062 | 3997 | |
|
4063 | 3998 | try: |
|
4064 | 3999 | value = opObj.getParameterValue(parameterName='mode') |
|
4065 | status = "on" | |
|
4066 | except: | |
|
4067 | status = "off" | |
|
4068 | ||
|
4069 | if not status == "off": | |
|
4070 | self.volOpComMode.setCurrentIndex(value) | |
|
4071 | 4000 | if int(value) == 0: |
|
4072 | 4001 | mode = "Time" |
|
4073 | 4002 | else: |
|
4074 | 4003 | mode = "freq" + str(value) |
|
4075 |
e |
|
|
4004 | except: | |
|
4076 | 4005 | mode = "Default" |
|
4077 |
self.bufferVoltage(" |
|
|
4006 | self.bufferVoltage("Processing Unit", "Decoder mode", mode) | |
|
4007 | ||
|
4008 | opObj = puObj.getOperationObj(name="deFlip") | |
|
4009 | if opObj == None: | |
|
4010 | value = None | |
|
4011 | else: | |
|
4012 | try: | |
|
4013 | value = opObj.getParameterValue(parameterName='channelList') | |
|
4014 | value = str(value) | |
|
4015 | except: | |
|
4016 | value = "All channels" | |
|
4017 | ||
|
4018 | self.bufferVoltage("Processing Unit", "Flip", value) | |
|
4019 | ||
|
4020 | opObj = puObj.getOperationObj(name="CohInt") | |
|
4021 | if opObj == None: | |
|
4022 | coherentintegration = None | |
|
4023 | else: | |
|
4024 | value = opObj.getParameterValue(parameterName='n') | |
|
4025 | coherentintegration = value | |
|
4026 | self.bufferVoltage("Processing Unit", "Coh Int", coherentintegration) | |
|
4027 | ||
|
4078 | 4028 | |
|
4079 | 4029 | # graph |
|
4080 | 4030 | # opObj = puObj.getOperationObj(name='Plot') |
|
4081 | 4031 | opObj = puObj.getOperationObj(name='Scope') |
|
4082 | 4032 | if opObj == None: |
|
4083 | 4033 | self.volGraphCebshow.setCheckState(0) |
|
4084 | 4034 | operation = "Disabled" |
|
4085 | 4035 | channelList = None |
|
4086 | 4036 | freq_vel = None |
|
4087 | 4037 | heightsrange = None |
|
4088 | 4038 | else: |
|
4089 | 4039 | operation = 'Enabled' |
|
4090 | 4040 | self.bufferVoltage("Scope", "Operation", operation), |
|
4091 | 4041 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
4092 | 4042 | value = opObj.getParameterObj(parameterName='channelList') |
|
4093 | 4043 | if value == None: |
|
4094 | 4044 | channelList = None |
|
4095 | 4045 | else: |
|
4096 | 4046 | value = opObj.getParameterValue(parameterName='channelList') |
|
4097 | 4047 | value = str(value)[1:-1] |
|
4098 | 4048 | channelList = value |
|
4099 | 4049 | self.bufferVoltage("Scope", "Channel List", channelList) |
|
4100 | 4050 | |
|
4101 | 4051 | |
|
4102 | 4052 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4103 | 4053 | if value1 == None: |
|
4104 | 4054 | freq_vel = None |
|
4105 | 4055 | else: |
|
4106 | 4056 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4107 | 4057 | value1 = str(value1) |
|
4108 | 4058 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4109 | 4059 | if value2 == None: |
|
4110 | 4060 | freq_vel = None |
|
4111 | 4061 | else: |
|
4112 | 4062 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4113 | 4063 | value2 = str(value2) |
|
4114 | 4064 | value = value1 + "," + value2 |
|
4115 | 4065 | freq_vel = value |
|
4116 | 4066 | self.bufferVoltage("Scope", "Freq/Vel", freq_vel) |
|
4117 | 4067 | |
|
4118 | 4068 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4119 | 4069 | if value1 == None: |
|
4120 | 4070 | heightsrange = None |
|
4121 | 4071 | else: |
|
4122 | 4072 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4123 | 4073 | value1 = str(value1) |
|
4124 | 4074 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4125 | 4075 | if value2 == None: |
|
4126 | 4076 | fheightsrange = None |
|
4127 | 4077 | else: |
|
4128 | 4078 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4129 | 4079 | value2 = str(value2) |
|
4130 | 4080 | value = value1 + "," + value2 |
|
4131 | 4081 | heightsrange = value |
|
4132 | 4082 | self.bufferVoltage("Scope", "Height Range", heightsrange) |
|
4133 | 4083 | |
|
4134 | 4084 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4135 | 4085 | if parmObj == None: |
|
4136 | 4086 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
4137 | 4087 | figpath = None |
|
4138 | 4088 | else: |
|
4139 | 4089 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
4140 | 4090 | value = opObj.getParameterValue(parameterName='figpath') |
|
4141 | 4091 | figpath = value |
|
4142 | 4092 | self.bufferVoltage("Scope", "Path", figpath) |
|
4143 | 4093 | # outputVoltageWrite |
|
4144 | 4094 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
4145 | 4095 | if opObj == None: |
|
4146 | 4096 | pass |
|
4147 | 4097 | else: |
|
4148 | 4098 | operation = 'Enabled' |
|
4149 | 4099 | self.bufferVoltage("Output", "Operation", operation) |
|
4150 | 4100 | value = opObj.getParameterObj(parameterName='path') |
|
4151 | 4101 | if value == None: |
|
4152 | 4102 | path = None |
|
4153 | 4103 | else: |
|
4154 | 4104 | value = opObj.getParameterValue(parameterName='path') |
|
4155 | 4105 | path = str(value) |
|
4156 | 4106 | self.bufferVoltage("Output", "Path", path) |
|
4157 | 4107 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
4158 | 4108 | if value == None: |
|
4159 | 4109 | blocksperfile = None |
|
4160 | 4110 | else: |
|
4161 | 4111 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
4162 | 4112 | blocksperfile = str(value) |
|
4163 | 4113 | self.bufferVoltage("Output", "BlocksPerFile", blocksperfile) |
|
4164 | 4114 | value = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
4165 | 4115 | if value == None: |
|
4166 | 4116 | profilesPerBlock = None |
|
4167 | 4117 | else: |
|
4168 | 4118 | value = opObj.getParameterValue(parameterName='profilesPerBlock') |
|
4169 | 4119 | profilesPerBlock = str(value) |
|
4170 | 4120 | self.bufferVoltage("Output", "ProfilesPerBlock", profilesPerBlock) |
|
4171 | 4121 | |
|
4172 | 4122 | |
|
4173 | 4123 | # set model PU Properties |
|
4174 | 4124 | |
|
4175 | 4125 | self.propertiesModel = treeModel() |
|
4176 | 4126 | self.propertiesModel.showPUVoltageParms(self.volProperCaracteristica, self.volProperPrincipal, self.volProperDescripcion) |
|
4177 | 4127 | self.volProperCaracteristica = [] |
|
4178 | 4128 | self.volProperPrincipal = [] |
|
4179 | 4129 | self.volProperDescripcion = [] |
|
4180 | 4130 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4181 | 4131 | self.treeProjectProperties.expandAll() |
|
4182 | 4132 | self.treeProjectProperties.allColumnsShowFocus() |
|
4183 | 4133 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4184 | 4134 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4185 | 4135 | |
|
4186 | 4136 | def bufferSpectra(self, caracteristica, principal, description): |
|
4187 | 4137 | self.specProperCaracteristica.append(caracteristica) |
|
4188 | 4138 | self.specProperPrincipal.append(principal) |
|
4189 | 4139 | self.specProperDescripcion.append(description) |
|
4190 | 4140 | return self.specProperCaracteristica, self.specProperPrincipal, self.specProperDescripcion |
|
4191 | 4141 | |
|
4192 | 4142 | def showPUSpectraProperties(self, puObj): |
|
4193 | 4143 | type = puObj.name |
|
4194 | 4144 | self.bufferSpectra("Processing Unit", "Type", type) |
|
4195 | 4145 | |
|
4196 | 4146 | opObj = puObj.getOperationObj(name="setRadarFrequency") |
|
4197 | 4147 | if opObj == None: |
|
4198 | 4148 | radarfrequency = None |
|
4199 | 4149 | else: |
|
4200 | 4150 | value = opObj.getParameterValue(parameterName='frequency') |
|
4201 | 4151 | value = str(value) |
|
4202 | 4152 | radarfrequency = value |
|
4203 | 4153 | self.bufferSpectra("Processing Unit", "Radar Frequency", radarfrequency) |
|
4204 | 4154 | |
|
4205 | 4155 | |
|
4206 | 4156 | opObj = puObj.getOperationObj(name="run") |
|
4207 | 4157 | if opObj == None: |
|
4208 | 4158 | self.specOpnFFTpoints.clear() |
|
4209 | 4159 | self.specOpProfiles.clear() |
|
4210 | 4160 | self.specOpippFactor.clear() |
|
4211 | 4161 | else: |
|
4212 | 4162 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
4213 | 4163 | if parmObj == None: |
|
4214 | 4164 | nProfiles = None |
|
4215 | 4165 | else: |
|
4216 | 4166 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
4217 | 4167 | nProfiles = value |
|
4218 | 4168 | self.bufferSpectra("Processing Unit", "nProfiles", nProfiles) |
|
4219 | 4169 | |
|
4220 | 4170 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
4221 | 4171 | if parmObj == None: |
|
4222 | 4172 | nFFTPoints = None |
|
4223 | 4173 | else: |
|
4224 | 4174 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
4225 | 4175 | nFFTPoints = value |
|
4226 | 4176 | self.bufferSpectra("Processing Unit", "nFFTpoints", nFFTPoints) |
|
4227 | 4177 | |
|
4228 | 4178 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
4229 | 4179 | if parmObj == None: |
|
4230 | 4180 | ippFactor = None |
|
4231 | 4181 | else: |
|
4232 | 4182 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
4233 | 4183 | ippFactor = value |
|
4234 | 4184 | self.bufferSpectra("Processing Unit", "Ipp Factor", ippFactor) |
|
4235 | 4185 | |
|
4236 | 4186 | |
|
4237 | 4187 | opObj = puObj.getOperationObj(name="run") |
|
4238 | 4188 | if opObj == None: |
|
4239 | 4189 | pairsList = None |
|
4240 | 4190 | else: |
|
4241 | 4191 | parm = opObj.getParameterObj(parameterName='pairsList') |
|
4242 | 4192 | if parm == None: |
|
4243 | 4193 | pairsList = None |
|
4244 | 4194 | else: |
|
4245 | 4195 | value = opObj.getParameterValue(parameterName='pairsList') |
|
4246 | 4196 | value = str(value)[1:-1] |
|
4247 | 4197 | pairsList = value |
|
4248 | 4198 | self.bufferSpectra("Processing Unit", "PairsList", pairsList) |
|
4249 | 4199 | |
|
4250 | 4200 | |
|
4251 | 4201 | opObj = puObj.getOperationObj(name="selectChannels") |
|
4252 | 4202 | if opObj == None: |
|
4253 | 4203 | channel = None |
|
4254 | 4204 | else: |
|
4255 | 4205 | value = opObj.getParameterValue(parameterName='channelList') |
|
4256 | 4206 | value = str(value)[1:-1] |
|
4257 | 4207 | channel = value |
|
4258 | 4208 | self.bufferSpectra("Processing Unit", "Channel", channel) |
|
4259 | 4209 | |
|
4260 | 4210 | opObj = puObj.getOperationObj(name="selectHeights") |
|
4261 | 4211 | if opObj == None: |
|
4262 | 4212 | heights = None |
|
4263 | 4213 | else: |
|
4264 | 4214 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
4265 | 4215 | value1 = str(value1) |
|
4266 | 4216 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
4267 | 4217 | value2 = str(value2) |
|
4268 | 4218 | value = value1 + "," + value2 |
|
4269 | 4219 | heights = value |
|
4270 | 4220 | self.bufferSpectra("Processing Unit", "Heights", heights) |
|
4271 | 4221 | |
|
4272 | 4222 | opObj = puObj.getOperationObj(name="IncohInt") |
|
4273 | 4223 | if opObj == None: |
|
4274 | 4224 | incoherentintegration = None |
|
4275 | 4225 | else: |
|
4276 | 4226 | try: |
|
4277 | 4227 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
4278 | 4228 | except: |
|
4279 | 4229 | value = opObj.getParameterValue(parameterName='n') |
|
4280 | 4230 | |
|
4281 | 4231 | value = float(value) |
|
4282 | 4232 | incoherentintegration = str(value) |
|
4283 | 4233 | self.bufferSpectra("Processing Unit", "Incoherent Integration", incoherentintegration) |
|
4284 | 4234 | |
|
4285 | 4235 | |
|
4286 | 4236 | opObj = puObj.getOperationObj(name="removeDC") |
|
4287 | 4237 | if opObj == None: |
|
4288 | 4238 | removeDC = None |
|
4289 | 4239 | else: |
|
4290 | 4240 | value = opObj.getParameterValue(parameterName='mode') |
|
4291 | 4241 | self.bufferSpectra("Processing Unit", "Remove DC", value) |
|
4292 | 4242 | |
|
4293 | 4243 | opObj = puObj.getOperationObj(name="removeInterference") |
|
4294 | 4244 | if opObj == None: |
|
4295 | 4245 | removeInterference = None |
|
4296 | 4246 | else: |
|
4297 | 4247 | self.bufferSpectra("Processing Unit", "Remove Interference", "1") |
|
4298 | 4248 | |
|
4299 | 4249 | opObj = puObj.getOperationObj(name="getNoise") |
|
4300 | 4250 | if opObj == None: |
|
4301 | 4251 | getNoise = None |
|
4302 | 4252 | else: |
|
4303 | 4253 | value1 = opObj.getParameterObj(parameterName='minHei') |
|
4304 | 4254 | if value1 == None: |
|
4305 | 4255 | getNoise = None |
|
4306 | 4256 | getNoise = "Default" |
|
4307 | 4257 | self.bufferSpectra("Processing Unit", "Get Noise", getNoise) |
|
4308 | 4258 | |
|
4309 | 4259 | else: |
|
4310 | 4260 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
4311 | 4261 | value1 = str(value1) |
|
4312 | 4262 | value2 = opObj.getParameterObj(parameterName='maxHei') |
|
4313 | 4263 | if value2 == None: |
|
4314 | 4264 | getNoise = None |
|
4315 | 4265 | value = value1 |
|
4316 | 4266 | getNoise = value |
|
4317 | 4267 | self.bufferSpectra("Processing Unit", "Get Noise", getNoise) |
|
4318 | 4268 | else: |
|
4319 | 4269 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
4320 | 4270 | value2 = str(value2) |
|
4321 | 4271 | value3 = opObj.getParameterObj(parameterName='minVel') |
|
4322 | 4272 | if value3 == None: |
|
4323 | 4273 | getNoise = None |
|
4324 | 4274 | value = value1 + "," + value2 |
|
4325 | 4275 | getNoise = value |
|
4326 | 4276 | self.bufferSpectra("Processing Unit", "Get Noise", getNoise) |
|
4327 | 4277 | else: |
|
4328 | 4278 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
4329 | 4279 | value3 = str(value3) |
|
4330 | 4280 | value4 = opObj.getParameterObj(parameterName='maxVel') |
|
4331 | 4281 | if value4 == None: |
|
4332 | 4282 | getNoise = None |
|
4333 | 4283 | value = value1 + "," + value2 + ',' + value3 |
|
4334 | 4284 | getNoise = value |
|
4335 | 4285 | self.bufferSpectra("Processing Unit", "Get Noise", getNoise) |
|
4336 | 4286 | else: |
|
4337 | 4287 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
4338 | 4288 | value4 = str(value4) |
|
4339 | 4289 | value = value1 + "," + value2 + ',' + value3 + ',' + value4 |
|
4340 | 4290 | getNoise = value |
|
4341 | 4291 | self.bufferSpectra("Processing Unit", "Get Noise", getNoise) |
|
4342 | 4292 | |
|
4343 | 4293 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
4344 | 4294 | # opObj = puObj.getOpObjfromParamValue(value="SpectraPlot") |
|
4345 | 4295 | |
|
4346 | 4296 | if opObj == None: |
|
4347 | 4297 | operationSpectraPlot = "Disabled" |
|
4348 | 4298 | freq_vel = None |
|
4349 | 4299 | heightsrange = None |
|
4350 | 4300 | channelListSpectraPlot = None |
|
4351 | 4301 | else: |
|
4352 | 4302 | operationSpectraPlot = "Enable" |
|
4353 | 4303 | self.bufferSpectra("Spectra Plot", "Operation", operationSpectraPlot) |
|
4354 | 4304 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4355 | 4305 | if parmObj == None: |
|
4356 | 4306 | channelListSpectraPlot = None |
|
4357 | 4307 | else: |
|
4358 | 4308 | value = opObj.getParameterValue(parameterName='channelList') |
|
4359 | 4309 | channelListSpectraPlot = str(value)[1:-1] |
|
4360 | 4310 | self.bufferSpectra("Spectra Plot", "Channel List", channelListSpectraPlot) |
|
4361 | 4311 | |
|
4362 | 4312 | |
|
4363 | 4313 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4364 | 4314 | if value1 == None: |
|
4365 | 4315 | freq_vel = None |
|
4366 | 4316 | else: |
|
4367 | 4317 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4368 | 4318 | value1 = str(value1) |
|
4369 | 4319 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4370 | 4320 | if value2 == None: |
|
4371 | 4321 | freq_vel = None |
|
4372 | 4322 | else: |
|
4373 | 4323 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4374 | 4324 | value2 = str(value2) |
|
4375 | 4325 | value = value1 + "," + value2 |
|
4376 | 4326 | freq_vel = value |
|
4377 | 4327 | self.bufferSpectra("Spectra Plot", "Freq/Vel", freq_vel) |
|
4378 | 4328 | |
|
4379 | 4329 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4380 | 4330 | if value1 == None: |
|
4381 | 4331 | heightsrange = None |
|
4382 | 4332 | else: |
|
4383 | 4333 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4384 | 4334 | value1 = str(value1) |
|
4385 | 4335 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4386 | 4336 | if value2 == None: |
|
4387 | 4337 | fheightsrange = None |
|
4388 | 4338 | else: |
|
4389 | 4339 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4390 | 4340 | value2 = str(value2) |
|
4391 | 4341 | value = value1 + "," + value2 |
|
4392 | 4342 | heightsrange = value |
|
4393 | 4343 | self.bufferSpectra("Spectra Plot", "Height Range", heightsrange) |
|
4394 | 4344 | |
|
4395 | 4345 | value1 = opObj.getParameterObj(parameterName='zmin') |
|
4396 | 4346 | if value1 == None: |
|
4397 | 4347 | dBrange = None |
|
4398 | 4348 | else: |
|
4399 | 4349 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
4400 | 4350 | value1 = str(value1) |
|
4401 | 4351 | value2 = opObj.getParameterObj(parameterName='zmax') |
|
4402 | 4352 | if value2 == None: |
|
4403 | 4353 | fdBrange = None |
|
4404 | 4354 | else: |
|
4405 | 4355 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
4406 | 4356 | value2 = str(value2) |
|
4407 | 4357 | value = value1 + "," + value2 |
|
4408 | 4358 | dbrange = value |
|
4409 | 4359 | self.bufferSpectra("Spectra Plot", "dB Range", dbrange) |
|
4410 | 4360 | |
|
4411 | 4361 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4412 | 4362 | if parmObj == None: |
|
4413 | 4363 | path = None |
|
4414 | 4364 | else: |
|
4415 | 4365 | path = opObj.getParameterValue(parameterName='figpath') |
|
4416 | 4366 | self.bufferSpectra("Spectra Plot", "Save Path", path) |
|
4417 | 4367 | |
|
4418 | 4368 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4419 | 4369 | if parmObj == None: |
|
4420 | 4370 | status = 'disable' |
|
4421 | 4371 | else: |
|
4422 | 4372 | status = 'enable' |
|
4423 | 4373 | self.bufferSpectra("Spectra Plot", "FTP", status) |
|
4424 | 4374 | self.showWr_Period(puObj, opObj, nameplotop="Spectra Plot") |
|
4425 | 4375 | # self.saveFTPvalues(opObj) |
|
4426 | 4376 | |
|
4427 | 4377 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
4428 | 4378 | # opObj = puObj.getOpObjfromParamValue(value="CrossSpectraPlot") |
|
4429 | 4379 | if opObj == None: |
|
4430 | 4380 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4431 | 4381 | operationCrossSpectraPlot = "Disabled" |
|
4432 | 4382 | channelList = None |
|
4433 | 4383 | freq_vel = None |
|
4434 | 4384 | heightsrange = None |
|
4435 | 4385 | else: |
|
4436 | 4386 | operationCrossSpectraPlot = "Enable" |
|
4437 | 4387 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
4438 | 4388 | self.bufferSpectra("Cross Spectra Plot", "Operation", operationCrossSpectraPlot) |
|
4439 | 4389 | |
|
4440 | 4390 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4441 | 4391 | if value1 == None: |
|
4442 | 4392 | freq_vel = None |
|
4443 | 4393 | else: |
|
4444 | 4394 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4445 | 4395 | value1 = str(value1) |
|
4446 | 4396 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4447 | 4397 | if value2 == None: |
|
4448 | 4398 | freq_vel = None |
|
4449 | 4399 | else: |
|
4450 | 4400 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4451 | 4401 | value2 = str(value2) |
|
4452 | 4402 | value = value1 + "," + value2 |
|
4453 | 4403 | freq_vel = value |
|
4454 | 4404 | self.bufferSpectra("Cross Spectra Plot", "Freq/Vel", freq_vel) |
|
4455 | 4405 | |
|
4456 | 4406 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4457 | 4407 | if value1 == None: |
|
4458 | 4408 | heightsrange = None |
|
4459 | 4409 | else: |
|
4460 | 4410 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4461 | 4411 | value1 = str(value1) |
|
4462 | 4412 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4463 | 4413 | if value2 == None: |
|
4464 | 4414 | fheightsrange = None |
|
4465 | 4415 | else: |
|
4466 | 4416 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4467 | 4417 | value2 = str(value2) |
|
4468 | 4418 | value = value1 + "," + value2 |
|
4469 | 4419 | heightsrange = value |
|
4470 | 4420 | self.bufferSpectra("Cross Spectra Plot", "Height Range", heightsrange) |
|
4471 | 4421 | |
|
4472 | 4422 | value1 = opObj.getParameterObj(parameterName='zmin') |
|
4473 | 4423 | if value1 == None: |
|
4474 | 4424 | dBrange = None |
|
4475 | 4425 | else: |
|
4476 | 4426 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
4477 | 4427 | value1 = str(value1) |
|
4478 | 4428 | value2 = opObj.getParameterObj(parameterName='zmax') |
|
4479 | 4429 | if value2 == None: |
|
4480 | 4430 | fdBrange = None |
|
4481 | 4431 | else: |
|
4482 | 4432 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
4483 | 4433 | value2 = str(value2) |
|
4484 | 4434 | value = value1 + "," + value2 |
|
4485 | 4435 | dbrange = value |
|
4486 | 4436 | self.bufferSpectra("Cross Spectra Plot", "dB Range", dbrange) |
|
4487 | 4437 | |
|
4488 | 4438 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4489 | 4439 | if parmObj == None: |
|
4490 | 4440 | path = None |
|
4491 | 4441 | else: |
|
4492 | 4442 | path = opObj.getParameterValue(parameterName='figpath') |
|
4493 | 4443 | self.bufferSpectra("Cross Spectra Plot", "Save Path", path) |
|
4494 | 4444 | |
|
4495 | 4445 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4496 | 4446 | if parmObj == None: |
|
4497 | 4447 | status = 'disable' |
|
4498 | 4448 | else: |
|
4499 | 4449 | status = 'enable' |
|
4500 | 4450 | self.bufferSpectra("Cross Spectra Plot", "FTP", status) |
|
4501 | 4451 | self.showWr_Period(puObj, opObj, nameplotop="Cross Spectra Plot") |
|
4502 | 4452 | # self.saveFTPvalues(opObj) |
|
4503 | 4453 | |
|
4504 | 4454 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
4505 | 4455 | # opObj = puObj.getOpObjfromParamValue(value="RTIPlot") |
|
4506 | 4456 | if opObj == None: |
|
4507 | 4457 | self.specGraphCebRTIplot.setCheckState(0) |
|
4508 | 4458 | operationRTIPlot = "Disabled" |
|
4509 | 4459 | channelList = None |
|
4510 | 4460 | freq_vel = None |
|
4511 | 4461 | heightsrange = None |
|
4512 | 4462 | else: |
|
4513 | 4463 | operationRTIPlot = "Enable" |
|
4514 | 4464 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
4515 | 4465 | self.bufferSpectra("RTI Plot", "Operation", operationRTIPlot) |
|
4516 | 4466 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4517 | 4467 | if parmObj == None: |
|
4518 | 4468 | channelListRTIPlot = None |
|
4519 | 4469 | else: |
|
4520 | 4470 | value = opObj.getParameterValue(parameterName='channelList') |
|
4521 | 4471 | channelListRTIPlot = str(value)[1:-1] |
|
4522 | 4472 | self.bufferSpectra("RTI Plot", "Channel List", channelListRTIPlot) |
|
4523 | 4473 | |
|
4524 | 4474 | |
|
4525 | 4475 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4526 | 4476 | if value1 == None: |
|
4527 | 4477 | freq_vel = None |
|
4528 | 4478 | else: |
|
4529 | 4479 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4530 | 4480 | value1 = str(value1) |
|
4531 | 4481 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4532 | 4482 | if value2 == None: |
|
4533 | 4483 | freq_vel = None |
|
4534 | 4484 | else: |
|
4535 | 4485 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4536 | 4486 | value2 = str(value2) |
|
4537 | 4487 | value = value1 + "," + value2 |
|
4538 | 4488 | tmintmax = value |
|
4539 | 4489 | self.bufferSpectra("RTI Plot", "Tmin,Tmax", tmintmax) |
|
4540 | 4490 | |
|
4541 | 4491 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
4542 | 4492 | if parmObj == None: |
|
4543 | 4493 | timerange = None |
|
4544 | 4494 | else: |
|
4545 | 4495 | value = opObj.getParameterValue(parameterName='timerange') |
|
4546 | 4496 | timerange = str(value) |
|
4547 | 4497 | self.bufferSpectra("RTI Plot", "Time Range", timerange) |
|
4548 | 4498 | |
|
4549 | 4499 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4550 | 4500 | if value1 == None: |
|
4551 | 4501 | heightsrange = None |
|
4552 | 4502 | else: |
|
4553 | 4503 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4554 | 4504 | value1 = str(value1) |
|
4555 | 4505 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4556 | 4506 | if value2 == None: |
|
4557 | 4507 | fheightsrange = None |
|
4558 | 4508 | else: |
|
4559 | 4509 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4560 | 4510 | value2 = str(value2) |
|
4561 | 4511 | value = value1 + "," + value2 |
|
4562 | 4512 | heightsrange = value |
|
4563 | 4513 | self.bufferSpectra("RTI Plot", "Height Range", heightsrange) |
|
4564 | 4514 | |
|
4565 | 4515 | value1 = opObj.getParameterObj(parameterName='zmin') |
|
4566 | 4516 | if value1 == None: |
|
4567 | 4517 | dBrange = None |
|
4568 | 4518 | else: |
|
4569 | 4519 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
4570 | 4520 | value1 = str(value1) |
|
4571 | 4521 | value2 = opObj.getParameterObj(parameterName='zmax') |
|
4572 | 4522 | if value2 == None: |
|
4573 | 4523 | fdBrange = None |
|
4574 | 4524 | else: |
|
4575 | 4525 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
4576 | 4526 | value2 = str(value2) |
|
4577 | 4527 | value = value1 + "," + value2 |
|
4578 | 4528 | dbrange = value |
|
4579 | 4529 | self.bufferSpectra("RTI Plot", "dB Range", dbrange) |
|
4580 | 4530 | |
|
4581 | 4531 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4582 | 4532 | if parmObj == None: |
|
4583 | 4533 | path = None |
|
4584 | 4534 | else: |
|
4585 | 4535 | path = opObj.getParameterValue(parameterName='figpath') |
|
4586 | 4536 | self.bufferSpectra("RTI Plot", "Save Path", path) |
|
4587 | 4537 | |
|
4588 | 4538 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4589 | 4539 | if parmObj == None: |
|
4590 | 4540 | status = 'disable' |
|
4591 | 4541 | else: |
|
4592 | 4542 | status = 'enable' |
|
4593 | 4543 | self.bufferSpectra("RTI Plot", "FTP", status) |
|
4594 | 4544 | self.showWr_Period(puObj, opObj, nameplotop="RTI Plot") |
|
4595 | 4545 | # self.saveFTPvalues(opObj) |
|
4596 | 4546 | |
|
4597 | 4547 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
4598 | 4548 | # opObj = puObj.getOpObjfromParamValue(value="CoherenceMap") |
|
4599 | 4549 | if opObj == None: |
|
4600 | 4550 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4601 | 4551 | operationCoherenceMap = "Disabled" |
|
4602 | 4552 | channelList = None |
|
4603 | 4553 | freq_vel = None |
|
4604 | 4554 | heightsrange = None |
|
4605 | 4555 | else: |
|
4606 | 4556 | operationCoherenceMap = "Enable" |
|
4607 | 4557 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
4608 | 4558 | self.bufferSpectra("Coherence Map Plot", "Operation", operationCoherenceMap) |
|
4609 | 4559 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4610 | 4560 | if parmObj == None: |
|
4611 | 4561 | channelListRTIPlot = None |
|
4612 | 4562 | else: |
|
4613 | 4563 | value = opObj.getParameterValue(parameterName='channelList') |
|
4614 | 4564 | channelListRTIPlot = str(value)[1:-1] |
|
4615 | 4565 | self.bufferSpectra("Coherence Map Plot", "Channel List", channelListRTIPlot) |
|
4616 | 4566 | |
|
4617 | 4567 | |
|
4618 | 4568 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4619 | 4569 | if value1 == None: |
|
4620 | 4570 | freq_vel = None |
|
4621 | 4571 | else: |
|
4622 | 4572 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4623 | 4573 | value1 = str(value1) |
|
4624 | 4574 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4625 | 4575 | if value2 == None: |
|
4626 | 4576 | freq_vel = None |
|
4627 | 4577 | else: |
|
4628 | 4578 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4629 | 4579 | value2 = str(value2) |
|
4630 | 4580 | value = value1 + "," + value2 |
|
4631 | 4581 | tmintmax = value |
|
4632 | 4582 | self.bufferSpectra("Coherence Map Plot", "Tmin,Tmax", tmintmax) |
|
4633 | 4583 | |
|
4634 | 4584 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
4635 | 4585 | if parmObj == None: |
|
4636 | 4586 | timerange = None |
|
4637 | 4587 | else: |
|
4638 | 4588 | value = opObj.getParameterValue(parameterName='timerange') |
|
4639 | 4589 | timerange = str(value) |
|
4640 | 4590 | self.bufferSpectra("Coherence Map Plot", "Time Range", timerange) |
|
4641 | 4591 | |
|
4642 | 4592 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4643 | 4593 | if value1 == None: |
|
4644 | 4594 | heightsrange = None |
|
4645 | 4595 | else: |
|
4646 | 4596 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4647 | 4597 | value1 = str(value1) |
|
4648 | 4598 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4649 | 4599 | if value2 == None: |
|
4650 | 4600 | fheightsrange = None |
|
4651 | 4601 | else: |
|
4652 | 4602 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4653 | 4603 | value2 = str(value2) |
|
4654 | 4604 | value = value1 + "," + value2 |
|
4655 | 4605 | heightsrange = value |
|
4656 | 4606 | self.bufferSpectra("Coherence Map Plot", "Height Range", heightsrange) |
|
4657 | 4607 | |
|
4658 | 4608 | value1 = opObj.getParameterObj(parameterName='zmin') |
|
4659 | 4609 | if value1 == None: |
|
4660 | 4610 | dBrange = None |
|
4661 | 4611 | else: |
|
4662 | 4612 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
4663 | 4613 | value1 = str(value1) |
|
4664 | 4614 | value2 = opObj.getParameterObj(parameterName='zmax') |
|
4665 | 4615 | if value2 == None: |
|
4666 | 4616 | fdBrange = None |
|
4667 | 4617 | else: |
|
4668 | 4618 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
4669 | 4619 | value2 = str(value2) |
|
4670 | 4620 | value = value1 + "," + value2 |
|
4671 | 4621 | dbrange = value |
|
4672 | 4622 | self.bufferSpectra("Coherence Map Plot", "Magnitud", dbrange) |
|
4673 | 4623 | |
|
4674 | 4624 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4675 | 4625 | if parmObj == None: |
|
4676 | 4626 | path = None |
|
4677 | 4627 | else: |
|
4678 | 4628 | path = opObj.getParameterValue(parameterName='figpath') |
|
4679 | 4629 | self.bufferSpectra("Coherence Map Plot", "Save Path", path) |
|
4680 | 4630 | |
|
4681 | 4631 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4682 | 4632 | if parmObj == None: |
|
4683 | 4633 | status = 'disable' |
|
4684 | 4634 | else: |
|
4685 | 4635 | status = 'enable' |
|
4686 | 4636 | self.bufferSpectra("Coherence Map Plot", "FTP", status) |
|
4687 | 4637 | self.showWr_Period(puObj, opObj, nameplotop="Coherence Map Plot") |
|
4688 | 4638 | # self.saveFTPvalues(opObj) |
|
4689 | 4639 | |
|
4690 | 4640 | |
|
4691 | 4641 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
4692 | 4642 | # opObj = puObj.getOpObjfromParamValue(value="PowerProfilePlot") |
|
4693 | 4643 | if opObj == None: |
|
4694 | 4644 | self.specGraphPowerprofile.setCheckState(0) |
|
4695 | 4645 | operationPowerProfilePlot = "Disabled" |
|
4696 | 4646 | channelList = None |
|
4697 | 4647 | freq_vel = None |
|
4698 | 4648 | heightsrange = None |
|
4699 | 4649 | else: |
|
4700 | 4650 | operationPowerProfilePlot = "Enable" |
|
4701 | 4651 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
4702 | 4652 | self.bufferSpectra("PowerProfile Plot", "Operation", operationPowerProfilePlot) |
|
4703 | 4653 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4704 | 4654 | if parmObj == None: |
|
4705 | 4655 | channelListSpectraPlot = None |
|
4706 | 4656 | else: |
|
4707 | 4657 | value = opObj.getParameterValue(parameterName='channelList') |
|
4708 | 4658 | channelListSpectraPlot = str(value)[1:-1] |
|
4709 | 4659 | self.bufferSpectra("PowerProfile Plot", "Channel List", channelListSpectraPlot) |
|
4710 | 4660 | |
|
4711 | 4661 | |
|
4712 | 4662 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4713 | 4663 | if value1 == None: |
|
4714 | 4664 | freq_vel = None |
|
4715 | 4665 | else: |
|
4716 | 4666 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4717 | 4667 | value1 = str(value1) |
|
4718 | 4668 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4719 | 4669 | if value2 == None: |
|
4720 | 4670 | freq_vel = None |
|
4721 | 4671 | else: |
|
4722 | 4672 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4723 | 4673 | value2 = str(value2) |
|
4724 | 4674 | value = value1 + "," + value2 |
|
4725 | 4675 | dbrange = value |
|
4726 | 4676 | self.bufferSpectra("PowerProfile Plot", "dbRange", dbrange) |
|
4727 | 4677 | |
|
4728 | 4678 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4729 | 4679 | if value1 == None: |
|
4730 | 4680 | heightsrange = None |
|
4731 | 4681 | else: |
|
4732 | 4682 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4733 | 4683 | value1 = str(value1) |
|
4734 | 4684 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4735 | 4685 | if value2 == None: |
|
4736 | 4686 | fheightsrange = None |
|
4737 | 4687 | else: |
|
4738 | 4688 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4739 | 4689 | value2 = str(value2) |
|
4740 | 4690 | value = value1 + "," + value2 |
|
4741 | 4691 | heightsrange = value |
|
4742 | 4692 | self.bufferSpectra("PowerProfile Plot", "Height Range", heightsrange) |
|
4743 | 4693 | |
|
4744 | 4694 | |
|
4745 | 4695 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4746 | 4696 | if parmObj == None: |
|
4747 | 4697 | path = None |
|
4748 | 4698 | else: |
|
4749 | 4699 | path = opObj.getParameterValue(parameterName='figpath') |
|
4750 | 4700 | self.bufferSpectra("PowerProfile Plot", "Save Path", path) |
|
4751 | 4701 | |
|
4752 | 4702 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4753 | 4703 | if parmObj == None: |
|
4754 | 4704 | status = 'disable' |
|
4755 | 4705 | else: |
|
4756 | 4706 | status = 'enable' |
|
4757 | 4707 | self.bufferSpectra("PowerProfile Plot", "FTP", status) |
|
4758 | 4708 | self.showWr_Period(puObj, opObj, nameplotop="PowerProfile Plot") |
|
4759 | 4709 | # self.saveFTPvalues(opObj) |
|
4760 | 4710 | |
|
4761 | 4711 | # noise |
|
4762 | 4712 | opObj = puObj.getOperationObj(name='Noise') |
|
4763 | 4713 | # opObj = puObj.getOpObjfromParamValue(value="Noise") |
|
4764 | 4714 | if opObj == None: |
|
4765 | 4715 | self.specGraphCebRTInoise.setCheckState(0) |
|
4766 | 4716 | operationRTINoise = "Disabled" |
|
4767 | 4717 | channelList = None |
|
4768 | 4718 | freq_vel = None |
|
4769 | 4719 | dbRange = None |
|
4770 | 4720 | else: |
|
4771 | 4721 | operationRTINoise = "Enable" |
|
4772 | 4722 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
4773 | 4723 | self.bufferSpectra("Noise Plot", "Operation", operationRTINoise) |
|
4774 | 4724 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4775 | 4725 | if parmObj == None: |
|
4776 | 4726 | channelListRTINoise = None |
|
4777 | 4727 | else: |
|
4778 | 4728 | value = opObj.getParameterValue(parameterName='channelList') |
|
4779 | 4729 | channelListRTINoise = str(value)[1:-1] |
|
4780 | 4730 | self.bufferSpectra("Noise Plot", "Channel List", channelListRTINoise) |
|
4781 | 4731 | |
|
4782 | 4732 | |
|
4783 | 4733 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4784 | 4734 | if value1 == None: |
|
4785 | 4735 | freq_vel = None |
|
4786 | 4736 | else: |
|
4787 | 4737 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4788 | 4738 | value1 = str(value1) |
|
4789 | 4739 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4790 | 4740 | if value2 == None: |
|
4791 | 4741 | freq_vel = None |
|
4792 | 4742 | else: |
|
4793 | 4743 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4794 | 4744 | value2 = str(value2) |
|
4795 | 4745 | value = value1 + "," + value2 |
|
4796 | 4746 | tmintmax = value |
|
4797 | 4747 | self.bufferSpectra("Noise Plot", "Tmin,Tmax", tmintmax) |
|
4798 | 4748 | |
|
4799 | 4749 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
4800 | 4750 | if parmObj == None: |
|
4801 | 4751 | timerange = None |
|
4802 | 4752 | else: |
|
4803 | 4753 | value = opObj.getParameterValue(parameterName='timerange') |
|
4804 | 4754 | timerange = str(value) |
|
4805 | 4755 | self.bufferSpectra("Noise Plot", "Time Range", timerange) |
|
4806 | 4756 | |
|
4807 | 4757 | |
|
4808 | 4758 | |
|
4809 | 4759 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4810 | 4760 | if value1 == None: |
|
4811 | 4761 | DBrange = None |
|
4812 | 4762 | else: |
|
4813 | 4763 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4814 | 4764 | value1 = str(value1) |
|
4815 | 4765 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4816 | 4766 | if value2 == None: |
|
4817 | 4767 | fdBrange = None |
|
4818 | 4768 | else: |
|
4819 | 4769 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4820 | 4770 | value2 = str(value2) |
|
4821 | 4771 | value = value1 + "," + value2 |
|
4822 | 4772 | dBrange = value |
|
4823 | 4773 | self.bufferSpectra("Noise Plot", "dB Range", dBrange) |
|
4824 | 4774 | |
|
4825 | 4775 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4826 | 4776 | if parmObj == None: |
|
4827 | 4777 | path = None |
|
4828 | 4778 | else: |
|
4829 | 4779 | path = opObj.getParameterValue(parameterName='figpath') |
|
4830 | 4780 | self.bufferSpectra("Noise Plot", "Save Path", path) |
|
4831 | 4781 | |
|
4832 | 4782 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4833 | 4783 | if parmObj == None: |
|
4834 | 4784 | status = 'disable' |
|
4835 | 4785 | else: |
|
4836 | 4786 | status = 'enable' |
|
4837 | 4787 | self.bufferSpectra("Noise Plot", "FTP", status) |
|
4838 | 4788 | self.showWr_Period(puObj, opObj, nameplotop="Noise Plot") |
|
4839 | 4789 | # self.saveFTPvalues(opObj) |
|
4840 | 4790 | |
|
4841 | projectObj = self.getSelectedProjectObj() | |
|
4842 | ftpProcUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") | |
|
4843 | ||
|
4844 | if ftpProcUnitConfObj: | |
|
4845 | ||
|
4846 | opObj = ftpProcUnitConfObj.getOperationObj(name='run') | |
|
4847 | ||
|
4848 | server = opObj.getParameterValue(parameterName='server') | |
|
4849 | folder = opObj.getParameterValue(parameterName='remotefolder') | |
|
4850 | username = opObj.getParameterValue(parameterName='username') | |
|
4851 | password = opObj.getParameterValue(parameterName='password') | |
|
4852 | ftp_wei = opObj.getParameterValue(parameterName='ftp_wei') | |
|
4853 | exp_code = opObj.getParameterValue(parameterName='exp_code') | |
|
4854 | sub_exp_code = opObj.getParameterValue(parameterName='sub_exp_code') | |
|
4855 | plot_pos = opObj.getParameterValue(parameterName='plot_pos') | |
|
4856 | localfolder = opObj.getParameterValue(parameterName='localfolder') | |
|
4857 | ||
|
4858 | self.bufferSpectra("FTP", "Server", server) | |
|
4859 | self.bufferSpectra("FTP", "Remote folder", folder) | |
|
4860 | self.bufferSpectra("FTP", "Local folder", localfolder) | |
|
4861 | self.bufferSpectra("FTP", "Username", username) | |
|
4862 | self.bufferSpectra("FTP", "Password", '*'*len(password)) | |
|
4863 | self.bufferSpectra("FTP", "Ftp_wei", ftp_wei) | |
|
4864 | self.bufferSpectra("FTP", "Exp_code", exp_code) | |
|
4865 | self.bufferSpectra("FTP", "Sub_exp_code", sub_exp_code) | |
|
4866 | self.bufferSpectra("FTP", "Plot_pos", plot_pos) | |
|
4867 | ||
|
4868 | 4791 | # outputSpectraWrite |
|
4869 | 4792 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
4870 | 4793 | if opObj == None: |
|
4871 | 4794 | pass |
|
4872 | 4795 | else: |
|
4873 | 4796 | operation = 'Enabled' |
|
4874 | 4797 | self.bufferSpectra("Output", "Operation", operation) |
|
4875 | 4798 | value = opObj.getParameterObj(parameterName='path') |
|
4876 | 4799 | if value == None: |
|
4877 | 4800 | path = None |
|
4878 | 4801 | else: |
|
4879 | 4802 | value = opObj.getParameterValue(parameterName='path') |
|
4880 | 4803 | path = str(value) |
|
4881 | 4804 | self.bufferSpectra("Output", "Path", path) |
|
4882 | 4805 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
4883 | 4806 | if value == None: |
|
4884 | 4807 | blocksperfile = None |
|
4885 | 4808 | else: |
|
4886 | 4809 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
4887 | 4810 | blocksperfile = str(value) |
|
4888 | 4811 | self.bufferSpectra("Output", "BlocksPerFile", blocksperfile) |
|
4889 | 4812 | value = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
4890 | 4813 | if value == None: |
|
4891 | 4814 | profilesPerBlock = None |
|
4892 | 4815 | else: |
|
4893 | 4816 | value = opObj.getParameterValue(parameterName='profilesPerBlock') |
|
4894 | 4817 | profilesPerBlock = str(value) |
|
4895 | 4818 | self.bufferSpectra("Output", "ProfilesPerBlock", profilesPerBlock) |
|
4819 | ||
|
4820 | projectObj = self.getSelectedProjectObj() | |
|
4821 | ftpProcUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") | |
|
4822 | ||
|
4823 | if ftpProcUnitConfObj: | |
|
4824 | ||
|
4825 | opObj = ftpProcUnitConfObj.getOperationObj(name='run') | |
|
4826 | ||
|
4827 | server = opObj.getParameterValue(parameterName='server') | |
|
4828 | folder = opObj.getParameterValue(parameterName='remotefolder') | |
|
4829 | username = opObj.getParameterValue(parameterName='username') | |
|
4830 | password = opObj.getParameterValue(parameterName='password') | |
|
4831 | ftp_wei = opObj.getParameterValue(parameterName='ftp_wei') | |
|
4832 | exp_code = opObj.getParameterValue(parameterName='exp_code') | |
|
4833 | sub_exp_code = opObj.getParameterValue(parameterName='sub_exp_code') | |
|
4834 | plot_pos = opObj.getParameterValue(parameterName='plot_pos') | |
|
4835 | localfolder = opObj.getParameterValue(parameterName='localfolder') | |
|
4836 | ||
|
4837 | self.bufferSpectra("FTP", "Server", server) | |
|
4838 | self.bufferSpectra("FTP", "Remote folder", folder) | |
|
4839 | self.bufferSpectra("FTP", "Local folder", localfolder) | |
|
4840 | self.bufferSpectra("FTP", "Username", username) | |
|
4841 | self.bufferSpectra("FTP", "Password", '*'*len(password)) | |
|
4842 | self.bufferSpectra("FTP", "Ftp_wei", ftp_wei) | |
|
4843 | self.bufferSpectra("FTP", "Exp_code", exp_code) | |
|
4844 | self.bufferSpectra("FTP", "Sub_exp_code", sub_exp_code) | |
|
4845 | self.bufferSpectra("FTP", "Plot_pos", plot_pos) | |
|
4896 | 4846 | |
|
4897 | 4847 | # set model PU Properties |
|
4898 | 4848 | |
|
4899 | 4849 | self.propertiesModel = treeModel() |
|
4900 | 4850 | self.propertiesModel.showPUSpectraParms(self.specProperCaracteristica, self.specProperPrincipal, self.specProperDescripcion) |
|
4901 | 4851 | |
|
4902 | 4852 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4903 | 4853 | self.treeProjectProperties.expandAll() |
|
4904 | 4854 | self.treeProjectProperties.allColumnsShowFocus() |
|
4905 | 4855 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4906 | 4856 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4907 | 4857 | |
|
4908 | 4858 | self.specProperCaracteristica = [] |
|
4909 | 4859 | self.specProperDescripcion = [] |
|
4910 | 4860 | self.specProperPrincipal = [] |
|
4911 | 4861 | |
|
4912 | 4862 | |
|
4913 | 4863 | def bufferSpectraHeis(self, caracteristica, principal, description): |
|
4914 | 4864 | self.specHeisProperCaracteristica.append(caracteristica) |
|
4915 | 4865 | self.specHeisProperPrincipal.append(principal) |
|
4916 | 4866 | self.specHeisProperDescripcion.append(description) |
|
4917 | 4867 | return self.specHeisProperCaracteristica, self.specHeisProperPrincipal, self.specHeisProperDescripcion |
|
4918 | 4868 | |
|
4919 | 4869 | |
|
4920 | 4870 | def showPUSpectraHeisProperties(self, puObj): |
|
4921 | 4871 | type = puObj.name |
|
4922 | 4872 | self.bufferSpectraHeis("Processing Unit", "Type", type) |
|
4923 | 4873 | |
|
4924 | 4874 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
4925 | 4875 | if opObj == None: |
|
4926 | 4876 | incoherentintegration = None |
|
4927 | 4877 | else: |
|
4928 | 4878 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
4929 | 4879 | value = float(value) |
|
4930 | 4880 | incoherentintegration = str(value) |
|
4931 | 4881 | self.bufferSpectraHeis("Processing Unit", "Incoherent Integration", incoherentintegration) |
|
4932 | 4882 | # spectraheis graph |
|
4933 | 4883 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
4934 | 4884 | # opObj = puObj.getOpObjfromParamValue(value="SpectraHeisScope") |
|
4935 | 4885 | if opObj == None: |
|
4936 | 4886 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
4937 | 4887 | operationSpectraHeisPlot = "Disabled" |
|
4938 | 4888 | xmin_xmax = None |
|
4939 | 4889 | ymin_ymax = None |
|
4940 | 4890 | channelListSpectraPlot = None |
|
4941 | 4891 | else: |
|
4942 | 4892 | operationSpectraHeisPlot = "Enable" |
|
4943 | 4893 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
4944 | 4894 | self.bufferSpectraHeis("SpectraHeis Plot", "Operation", operationSpectraHeisPlot) |
|
4945 | 4895 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
4946 | 4896 | if parmObj == None: |
|
4947 | 4897 | channelListSpectraPlot = None |
|
4948 | 4898 | else: |
|
4949 | 4899 | value = opObj.getParameterValue(parameterName='channelList') |
|
4950 | 4900 | channelListSpectraPlot = str(value)[1:-1] |
|
4951 | 4901 | self.bufferSpectraHeis("SpectraHeis Plot", "Channel List", channelListSpectraPlot) |
|
4952 | 4902 | |
|
4953 | 4903 | |
|
4954 | 4904 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
4955 | 4905 | if value1 == None: |
|
4956 | 4906 | xmin_xmax = None |
|
4957 | 4907 | else: |
|
4958 | 4908 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
4959 | 4909 | value1 = str(value1) |
|
4960 | 4910 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
4961 | 4911 | if value2 == None: |
|
4962 | 4912 | xmin_xmax = None |
|
4963 | 4913 | else: |
|
4964 | 4914 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
4965 | 4915 | value2 = str(value2) |
|
4966 | 4916 | value = value1 + "," + value2 |
|
4967 | 4917 | xmin_xmax = value |
|
4968 | 4918 | self.bufferSpectraHeis("SpectraHeis Plot", "Xmin-Xmax", xmin_xmax) |
|
4969 | 4919 | |
|
4970 | 4920 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
4971 | 4921 | if value1 == None: |
|
4972 | 4922 | ymin_ymax = None |
|
4973 | 4923 | else: |
|
4974 | 4924 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
4975 | 4925 | value1 = str(value1) |
|
4976 | 4926 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
4977 | 4927 | if value2 == None: |
|
4978 | 4928 | ymin_ymax = None |
|
4979 | 4929 | else: |
|
4980 | 4930 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
4981 | 4931 | value2 = str(value2) |
|
4982 | 4932 | value = value1 + "," + value2 |
|
4983 | 4933 | ymin_ymax = value |
|
4984 | 4934 | self.bufferSpectraHeis("SpectraHeis Plot", "Ymin-Ymax", ymin_ymax) |
|
4985 | 4935 | |
|
4986 | 4936 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4987 | 4937 | if parmObj == None: |
|
4988 | 4938 | path = None |
|
4989 | 4939 | else: |
|
4990 | 4940 | path = opObj.getParameterValue(parameterName='figpath') |
|
4991 | 4941 | self.bufferSpectraHeis("SpectraHeis Plot", "Save Path", path) |
|
4992 | 4942 | |
|
4993 | 4943 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4994 | 4944 | if parmObj == None: |
|
4995 | 4945 | status = 'disable' |
|
4996 | 4946 | else: |
|
4997 | 4947 | status = 'enable' |
|
4998 | 4948 | self.bufferSpectraHeis("SpectraHeis Plot", "FTP", status) |
|
4999 | 4949 | self.showWr_Period(puObj, opObj, nameplotop="SpectraHeis Plot") |
|
5000 | 4950 | # self.saveFTPvalues(opObj) |
|
5001 | 4951 | |
|
5002 | 4952 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
5003 | 4953 | # opObj = puObj.getOpObjfromParamValue(value="RTIfromSpectraHeis") |
|
5004 | 4954 | if opObj == None: |
|
5005 | 4955 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5006 | 4956 | operationRTIPlot = "Disabled" |
|
5007 | 4957 | channelList = None |
|
5008 | 4958 | freq_vel = None |
|
5009 | 4959 | heightsrange = None |
|
5010 | 4960 | else: |
|
5011 | 4961 | operationRTIPlot = "Enable" |
|
5012 | 4962 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
5013 | 4963 | self.bufferSpectraHeis("RTIHeis Plot", "Operation", operationRTIPlot) |
|
5014 | 4964 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
5015 | 4965 | if parmObj == None: |
|
5016 | 4966 | channelListRTIPlot = None |
|
5017 | 4967 | else: |
|
5018 | 4968 | value = opObj.getParameterValue(parameterName='channelList') |
|
5019 | 4969 | channelListRTIPlot = str(value)[1:-1] |
|
5020 | 4970 | self.bufferSpectraHeis("RTIHeis Plot", "Channel List", channelListRTIPlot) |
|
5021 | 4971 | |
|
5022 | 4972 | |
|
5023 | 4973 | value1 = opObj.getParameterObj(parameterName='xmin') |
|
5024 | 4974 | if value1 == None: |
|
5025 | 4975 | freq_vel = None |
|
5026 | 4976 | else: |
|
5027 | 4977 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
5028 | 4978 | value1 = str(value1) |
|
5029 | 4979 | value2 = opObj.getParameterObj(parameterName='xmax') |
|
5030 | 4980 | if value2 == None: |
|
5031 | 4981 | freq_vel = None |
|
5032 | 4982 | else: |
|
5033 | 4983 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
5034 | 4984 | value2 = str(value2) |
|
5035 | 4985 | value = value1 + "," + value2 |
|
5036 | 4986 | tmintmax = value |
|
5037 | 4987 | self.bufferSpectraHeis("RTIHeis Plot", "Tmin,Tmax", tmintmax) |
|
5038 | 4988 | |
|
5039 | 4989 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
5040 | 4990 | if parmObj == None: |
|
5041 | 4991 | timerange = None |
|
5042 | 4992 | else: |
|
5043 | 4993 | value = opObj.getParameterValue(parameterName='timerange') |
|
5044 | 4994 | timerange = str(value) |
|
5045 | 4995 | self.bufferSpectraHeis("RTIHeis Plot", "Time Range", timerange) |
|
5046 | 4996 | |
|
5047 | 4997 | value1 = opObj.getParameterObj(parameterName='ymin') |
|
5048 | 4998 | if value1 == None: |
|
5049 | 4999 | heightsrange = None |
|
5050 | 5000 | else: |
|
5051 | 5001 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
5052 | 5002 | value1 = str(value1) |
|
5053 | 5003 | value2 = opObj.getParameterObj(parameterName='ymax') |
|
5054 | 5004 | if value2 == None: |
|
5055 | 5005 | fheightsrange = None |
|
5056 | 5006 | else: |
|
5057 | 5007 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
5058 | 5008 | value2 = str(value2) |
|
5059 | 5009 | value = value1 + "," + value2 |
|
5060 | 5010 | heightsrange = value |
|
5061 | 5011 | self.bufferSpectraHeis("RTIHeis Plot", "Ymin-Ymax", heightsrange) |
|
5062 | 5012 | |
|
5063 | 5013 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
5064 | 5014 | if parmObj == None: |
|
5065 | 5015 | path = None |
|
5066 | 5016 | else: |
|
5067 | 5017 | path = opObj.getParameterValue(parameterName='figpath') |
|
5068 | 5018 | self.bufferSpectraHeis("RTIHeis Plot", "Save Path", path) |
|
5069 | 5019 | |
|
5070 | 5020 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
5071 | 5021 | if parmObj == None: |
|
5072 | 5022 | status = 'disable' |
|
5073 | 5023 | else: |
|
5074 | 5024 | status = 'enable' |
|
5075 | 5025 | self.bufferSpectraHeis("RTIHeis Plot", "FTP", status) |
|
5076 | 5026 | self.showWr_Period(puObj, opObj, nameplotop="RTIHeis Plot") |
|
5077 | 5027 | # self.saveFTPvalues(opObj) |
|
5078 | ||
|
5079 | projectObj = self.getSelectedProjectObj() | |
|
5080 | ftpProcUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") | |
|
5081 | ||
|
5082 | if ftpProcUnitConfObj: | |
|
5083 | ||
|
5084 | opObj = ftpProcUnitConfObj.getOperationObj(name='run') | |
|
5085 | ||
|
5086 | server = opObj.getParameterValue(parameterName='server') | |
|
5087 | folder = opObj.getParameterValue(parameterName='folder') | |
|
5088 | username = opObj.getParameterValue(parameterName='username') | |
|
5089 | password = opObj.getParameterValue(parameterName='password') | |
|
5090 | ftp_wei = opObj.getParameterValue(parameterName='ftp_wei') | |
|
5091 | exp_code = opObj.getParameterValue(parameterName='exp_code') | |
|
5092 | sub_exp_code = opObj.getParameterValue(parameterName='sub_exp_code') | |
|
5093 | plot_pos = opObj.getParameterValue(parameterName='plot_pos') | |
|
5094 | localfolder = opObj.getParameterValue(parameterName='localfolder') | |
|
5095 | ||
|
5096 | self.bufferSpectraHeis("FTP", "Server", server) | |
|
5097 | self.bufferSpectraHeis("FTP", "Remote folder", folder) | |
|
5098 | self.bufferSpectraHeis("FTP", "Local folder", localfolder) | |
|
5099 | self.bufferSpectraHeis("FTP", "Username", username) | |
|
5100 | self.bufferSpectraHeis("FTP", "Password", '*'*len(password)) | |
|
5101 | self.bufferSpectraHeis("FTP", "Ftp_wei", ftp_wei) | |
|
5102 | self.bufferSpectraHeis("FTP", "Exp_code", exp_code) | |
|
5103 | self.bufferSpectraHeis("FTP", "Sub_exp_code", sub_exp_code) | |
|
5104 | self.bufferSpectraHeis("FTP", "Plot_pos", plot_pos) | |
|
5105 | 5028 | |
|
5106 | 5029 | # outputSpectraHeisWrite |
|
5107 | 5030 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
5108 | 5031 | if opObj == None: |
|
5109 | 5032 | pass |
|
5110 | 5033 | else: |
|
5111 | 5034 | operation = 'Enabled' |
|
5112 | 5035 | self.bufferSpectraHeis("Output", "Operation", operation) |
|
5113 | 5036 | value = opObj.getParameterObj(parameterName='path') |
|
5114 | 5037 | if value == None: |
|
5115 | 5038 | path = None |
|
5116 | 5039 | else: |
|
5117 | 5040 | value = opObj.getParameterValue(parameterName='path') |
|
5118 | 5041 | path = str(value) |
|
5119 | 5042 | self.bufferSpectraHeis("Output", "Path", path) |
|
5120 | 5043 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
5121 | 5044 | if value == None: |
|
5122 | 5045 | blocksperfile = None |
|
5123 | 5046 | else: |
|
5124 | 5047 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
5125 | 5048 | blocksperfile = str(value) |
|
5126 | 5049 | self.bufferSpectraHeis("Output", "BlocksPerFile", blocksperfile) |
|
5127 | 5050 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
5128 | 5051 | if value == None: |
|
5129 | 5052 | metadata = None |
|
5130 | 5053 | else: |
|
5131 | 5054 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
5132 | 5055 | metadata = str(value) |
|
5133 | 5056 | self.bufferSpectraHeis("Output", "Metadata", metadata) |
|
5057 | ||
|
5058 | projectObj = self.getSelectedProjectObj() | |
|
5059 | ftpProcUnitConfObj = projectObj.getProcUnitObjByName(name="SendToServer") | |
|
5060 | ||
|
5061 | if ftpProcUnitConfObj: | |
|
5062 | ||
|
5063 | opObj = ftpProcUnitConfObj.getOperationObj(name='run') | |
|
5064 | ||
|
5065 | server = opObj.getParameterValue(parameterName='server') | |
|
5066 | folder = opObj.getParameterValue(parameterName='folder') | |
|
5067 | username = opObj.getParameterValue(parameterName='username') | |
|
5068 | password = opObj.getParameterValue(parameterName='password') | |
|
5069 | ftp_wei = opObj.getParameterValue(parameterName='ftp_wei') | |
|
5070 | exp_code = opObj.getParameterValue(parameterName='exp_code') | |
|
5071 | sub_exp_code = opObj.getParameterValue(parameterName='sub_exp_code') | |
|
5072 | plot_pos = opObj.getParameterValue(parameterName='plot_pos') | |
|
5073 | localfolder = opObj.getParameterValue(parameterName='localfolder') | |
|
5074 | ||
|
5075 | self.bufferSpectraHeis("FTP", "Server", server) | |
|
5076 | self.bufferSpectraHeis("FTP", "Remote folder", folder) | |
|
5077 | self.bufferSpectraHeis("FTP", "Local folder", localfolder) | |
|
5078 | self.bufferSpectraHeis("FTP", "Username", username) | |
|
5079 | self.bufferSpectraHeis("FTP", "Password", '*'*len(password)) | |
|
5080 | self.bufferSpectraHeis("FTP", "Ftp_wei", ftp_wei) | |
|
5081 | self.bufferSpectraHeis("FTP", "Exp_code", exp_code) | |
|
5082 | self.bufferSpectraHeis("FTP", "Sub_exp_code", sub_exp_code) | |
|
5083 | self.bufferSpectraHeis("FTP", "Plot_pos", plot_pos) | |
|
5134 | 5084 | |
|
5135 | 5085 | # set model PU Properties |
|
5136 | 5086 | |
|
5137 | 5087 | self.propertiesModel = treeModel() |
|
5138 | 5088 | self.propertiesModel.showPUSpectraHeisParms(self.specHeisProperCaracteristica, self.specHeisProperPrincipal, self.specHeisProperDescripcion) |
|
5139 | 5089 | |
|
5140 | 5090 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5141 | 5091 | self.treeProjectProperties.expandAll() |
|
5142 | 5092 | self.treeProjectProperties.allColumnsShowFocus() |
|
5143 | 5093 | self.treeProjectProperties.resizeColumnToContents(0) |
|
5144 | 5094 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5145 | 5095 | |
|
5146 | 5096 | self.specHeisProperCaracteristica = [] |
|
5147 | 5097 | self.specHeisProperDescripcion = [] |
|
5148 | 5098 | self.specHeisProperPrincipal = [] |
|
5149 | 5099 | |
|
5150 | 5100 | |
|
5151 | 5101 | def showWr_Period(self, puObj, opObj, nameplotop): |
|
5152 | 5102 | parmObj = opObj.getParameterObj(parameterName='wr_period') |
|
5153 | 5103 | if parmObj == None: |
|
5154 | 5104 | wr_period = None |
|
5155 | 5105 | else: |
|
5156 | 5106 | value = opObj.getParameterValue(parameterName='wr_period') |
|
5157 | 5107 | wr_period = str(value) |
|
5158 | 5108 | if puObj.datatype == "Spectra": |
|
5159 | 5109 | self.bufferSpectra(nameplotop, "wr_period", wr_period) |
|
5160 | 5110 | if puObj.datatype == "SpectraHeis": |
|
5161 | 5111 | self.bufferSpectraHeis(nameplotop, "wr_period", wr_period) |
|
5162 | 5112 | |
|
5163 | 5113 | def saveFTPvalues(self, opObj): |
|
5164 | 5114 | |
|
5165 | 5115 | parmObj = opObj.getParameterObj(parameterName="server") |
|
5166 | 5116 | if parmObj == None: |
|
5167 | 5117 | server = 'jro-app.igp.gob.pe' |
|
5168 | 5118 | else: |
|
5169 | 5119 | server = opObj.getParameterValue(parameterName='server') |
|
5170 | 5120 | |
|
5171 | 5121 | parmObj = opObj.getParameterObj(parameterName="folder") |
|
5172 | 5122 | if parmObj == None: |
|
5173 | 5123 | folder = '/home/wmaster/graficos' |
|
5174 | 5124 | else: |
|
5175 | 5125 | folder = opObj.getParameterValue(parameterName='folder') |
|
5176 | 5126 | |
|
5177 | 5127 | parmObj = opObj.getParameterObj(parameterName="username") |
|
5178 | 5128 | if parmObj == None: |
|
5179 | 5129 | username = 'wmaster' |
|
5180 | 5130 | else: |
|
5181 | 5131 | username = opObj.getParameterValue(parameterName='username') |
|
5182 | 5132 | |
|
5183 | 5133 | parmObj = opObj.getParameterObj(parameterName="password") |
|
5184 | 5134 | if parmObj == None: |
|
5185 | 5135 | password = 'mst2010vhf' |
|
5186 | 5136 | else: |
|
5187 | 5137 | password = opObj.getParameterValue(parameterName='password') |
|
5188 | 5138 | |
|
5189 | 5139 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
5190 | 5140 | if parmObj == None: |
|
5191 | 5141 | ftp_wei = '0' |
|
5192 | 5142 | else: |
|
5193 | 5143 | ftp_wei = opObj.getParameterValue(parameterName='ftp_wei') |
|
5194 | 5144 | |
|
5195 | 5145 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
5196 | 5146 | if parmObj == None: |
|
5197 | 5147 | exp_code = '0' |
|
5198 | 5148 | else: |
|
5199 | 5149 | exp_code = opObj.getParameterValue(parameterName='exp_code') |
|
5200 | 5150 | |
|
5201 | 5151 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
5202 | 5152 | if parmObj == None: |
|
5203 | 5153 | sub_exp_code = '0' |
|
5204 | 5154 | else: |
|
5205 | 5155 | sub_exp_code = opObj.getParameterValue(parameterName='sub_exp_code') |
|
5206 | 5156 | |
|
5207 | 5157 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
5208 | 5158 | if parmObj == None: |
|
5209 | 5159 | plot_pos = '0' |
|
5210 | 5160 | else: |
|
5211 | 5161 | plot_pos = opObj.getParameterValue(parameterName='plot_pos') |
|
5212 | 5162 | |
|
5213 | 5163 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
5214 | 5164 | if parmObj == None: |
|
5215 | 5165 | localfolder = None |
|
5216 | 5166 | else: |
|
5217 | 5167 | localfolder = opObj.getParameterValue(parameterName='localfolder') |
|
5218 | 5168 | |
|
5219 | 5169 | parmObj = opObj.getParameterObj(parameterName="extension") |
|
5220 | 5170 | if parmObj == None: |
|
5221 | 5171 | extension = None |
|
5222 | 5172 | else: |
|
5223 | 5173 | extension = opObj.getParameterValue(parameterName='extension') |
|
5224 | 5174 | |
|
5225 | 5175 | self.temporalFTP.save(server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
5226 | 5176 | localfolder=localfolder, |
|
5227 | 5177 | extension=extension) |
|
5228 | 5178 | |
|
5229 | 5179 | def addProject2ProjectExplorer(self, id, name): |
|
5230 | 5180 | |
|
5231 | 5181 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
5232 | 5182 | self.parentItem = self.projectExplorerModel.invisibleRootItem() |
|
5233 | 5183 | self.parentItem.appendRow(itemTree) |
|
5234 | 5184 | self.parentItem = itemTree |
|
5235 | 5185 | self.projectExplorerTree.setCurrentIndex(self.parentItem.index()) |
|
5236 | 5186 | |
|
5237 | 5187 | self.selectedItemTree = itemTree |
|
5238 | 5188 | |
|
5239 | 5189 | self.__itemTreeDict[id] = itemTree |
|
5240 | 5190 | |
|
5241 | 5191 | def addPU2ProjectExplorer(self, id, name): |
|
5242 | 5192 | # id1= round(int(id)/10.)*10 |
|
5243 | 5193 | # id= int(id) |
|
5244 | 5194 | # id=id-id1 |
|
5245 | 5195 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
5246 | 5196 | |
|
5247 | 5197 | self.parentItem = self.selectedItemTree |
|
5248 | 5198 | self.parentItem.appendRow(itemTree) |
|
5249 | 5199 | self.projectExplorerTree.expandAll() |
|
5250 | 5200 | self.parentItem = itemTree |
|
5251 | 5201 | self.projectExplorerTree.setCurrentIndex(self.parentItem.index()) |
|
5252 | 5202 | |
|
5253 | 5203 | self.selectedItemTree = itemTree |
|
5254 | 5204 | |
|
5255 | 5205 | self.__itemTreeDict[id] = itemTree |
|
5256 | 5206 | |
|
5257 | 5207 | def addPU2PELoadXML(self, id, name, idParent): |
|
5258 | 5208 | |
|
5259 | 5209 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
5260 | 5210 | if self.__itemTreeDict.has_key(idParent): |
|
5261 | 5211 | self.parentItem = self.__itemTreeDict[idParent] |
|
5262 | 5212 | else: |
|
5263 | 5213 | self.parentItem = self.selectedItemTree |
|
5264 | 5214 | self.parentItem.appendRow(itemTree) |
|
5265 | 5215 | self.projectExplorerTree.expandAll() |
|
5266 | 5216 | self.parentItem = itemTree |
|
5267 | 5217 | self.projectExplorerTree.setCurrentIndex(self.parentItem.index()) |
|
5268 | 5218 | |
|
5269 | 5219 | self.selectedItemTree = itemTree |
|
5270 | 5220 | |
|
5271 | 5221 | self.__itemTreeDict[id] = itemTree |
|
5272 | 5222 | # print "stop" |
|
5273 | 5223 | |
|
5274 | 5224 | def getSelectedProjectObj(self): |
|
5275 | 5225 | |
|
5276 | 5226 | for key in self.__itemTreeDict.keys(): |
|
5277 | 5227 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
5278 | 5228 | continue |
|
5279 | 5229 | |
|
5280 | 5230 | if self.__projectObjDict.has_key(key): |
|
5281 | 5231 | projectObj = self.__projectObjDict[key] |
|
5282 | 5232 | else: |
|
5283 | 5233 | puObj = self.__puObjDict[key] |
|
5284 | 5234 | if puObj.parentId == None: |
|
5285 | 5235 | id = puObj.getId()[0] |
|
5286 | 5236 | else: |
|
5287 | 5237 | id = puObj.parentId |
|
5288 | 5238 | projectObj = self.__projectObjDict[id] |
|
5289 | 5239 | |
|
5290 | 5240 | return projectObj |
|
5291 | 5241 | |
|
5292 | 5242 | self.showWarning() |
|
5293 | 5243 | |
|
5294 | 5244 | return None |
|
5295 | 5245 | |
|
5296 | 5246 | def getSelectedPUObj(self): |
|
5297 | 5247 | |
|
5298 | 5248 | for key in self.__itemTreeDict.keys(): |
|
5299 | 5249 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
5300 | 5250 | continue |
|
5301 | 5251 | |
|
5302 | 5252 | if self.__projectObjDict.has_key(key) == True: |
|
5303 | 5253 | fatherObj = self.__projectObjDict[key] |
|
5304 | 5254 | else: |
|
5305 | 5255 | fatherObj = self.__puObjDict[key] |
|
5306 | 5256 | |
|
5307 | 5257 | return fatherObj |
|
5308 | 5258 | |
|
5309 | 5259 | self.showWarning() |
|
5310 | 5260 | |
|
5311 | 5261 | return None |
|
5312 |
|
|
|
5262 | ||
|
5263 | def openProject(self): | |
|
5264 | ||
|
5265 | self.create = False | |
|
5266 | self.frame_2.setEnabled(True) | |
|
5267 | home = expanduser("~") | |
|
5268 | self.dir = os.path.join(home, 'schain_workspace') | |
|
5269 | # print self.dir | |
|
5270 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.dir, self.tr("Text Files (*.xml)"))) | |
|
5271 | self.console.clear() | |
|
5272 | projectObjLoad = Project() | |
|
5273 | try: | |
|
5274 | projectObjLoad.readXml(filename) | |
|
5275 | except: | |
|
5276 | self.console.clear() | |
|
5277 | self.console.append("The selected xml file could not be loaded ...") | |
|
5278 | return 0 | |
|
5279 | ||
|
5280 | project_name, description = projectObjLoad.name, projectObjLoad.description | |
|
5281 | id = projectObjLoad.id | |
|
5282 | self.__projectObjDict[id] = projectObjLoad | |
|
5283 | # Project Properties | |
|
5284 | datatype, data_path, startDate, endDate, startTime, endTime , online , delay, walk, set = self.showProjectProperties(projectObjLoad) | |
|
5285 | # show ProjectView | |
|
5286 | self.addProject2ProjectExplorer(id=id, name=project_name) | |
|
5287 | self.refreshProjectWindow(project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set) | |
|
5288 | ||
|
5289 | if datatype == "Voltage": | |
|
5290 | ext = '.r' | |
|
5291 | self.specOpProfiles.setEnabled(True) | |
|
5292 | self.specOpippFactor.setEnabled(True) | |
|
5293 | elif datatype == "Spectra": | |
|
5294 | ext = '.pdata' | |
|
5295 | self.specOpProfiles.setEnabled(False) | |
|
5296 | self.specOpippFactor.setEnabled(False) | |
|
5297 | elif datatype == "Fits": | |
|
5298 | ext = '.fits' | |
|
5299 | ||
|
5300 | if online == 0: | |
|
5301 | self.loadDays(data_path, ext, walk) | |
|
5302 | else: | |
|
5303 | self.proComStartDate.setEnabled(False) | |
|
5304 | self.proComEndDate.setEnabled(False) | |
|
5305 | self.proStartTime.setEnabled(False) | |
|
5306 | self.proEndTime.setEnabled(False) | |
|
5307 | self.frame_2.setEnabled(True) | |
|
5308 | ||
|
5309 | self.tabWidgetProject.setEnabled(True) | |
|
5310 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
5311 | # Disable tabProject after finish the creation | |
|
5312 | self.tabProject.setEnabled(True) | |
|
5313 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
|
5314 | ||
|
5315 | for inputId, puObj in puObjorderList.items(): | |
|
5316 | # print puObj.datatype, puObj.inputId,puObj.getId(),puObj.parentId | |
|
5317 | self.__puObjDict[puObj.getId()] = puObj | |
|
5318 | ||
|
5319 | if puObj.inputId != "0": | |
|
5320 | self.addPU2PELoadXML(id=puObj.getId() , name=puObj.datatype , idParent=puObj.inputId) | |
|
5321 | ||
|
5322 | if puObj.datatype == "Voltage": | |
|
5323 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
5324 | self.showPUVoltageProperties(puObj) | |
|
5325 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
5326 | ||
|
5327 | if puObj.datatype == "Spectra": | |
|
5328 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
5329 | self.showPUSpectraProperties(puObj) | |
|
5330 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
5331 | ||
|
5332 | if puObj.datatype == "SpectraHeis": | |
|
5333 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
5334 | self.showPUSpectraHeisProperties(puObj) | |
|
5335 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
5336 | ||
|
5337 | if puObj.name == "SendToServer": | |
|
5338 | self.__ftpProcUnitAdded = True | |
|
5339 | self.__ftpProcUnitId = puObj.getId() | |
|
5340 | ||
|
5341 | opObj = puObj.getOperationObj(name="run") | |
|
5342 | self.saveFTPvalues(opObj) | |
|
5343 | ||
|
5344 | self.console.clear() | |
|
5345 | self.console.append("The selected xml file has been loaded successfully") | |
|
5346 | # self.refreshPUWindow(datatype=datatype,puObj=puObj) | |
|
5347 | ||
|
5313 | 5348 | def playProject(self, ext=".xml"): |
|
5314 | 5349 | |
|
5315 | 5350 | projectObj = self.getSelectedProjectObj() |
|
5316 | 5351 | |
|
5317 | 5352 | filename = os.path.join(str(self.pathWorkSpace), |
|
5318 | 5353 | "%s%s%s" %(str(projectObj.name), str(projectObj.id), ext) |
|
5319 | 5354 | ) |
|
5320 | 5355 | |
|
5321 | 5356 | self.console.clear() |
|
5322 | 5357 | filename = self.saveProject() |
|
5323 | 5358 | # projectObj.writeXml(filename) |
|
5324 | 5359 | if filename == None: |
|
5325 | 5360 | self.console.append("Process did not initialize.") |
|
5326 | 5361 | return |
|
5362 | ||
|
5363 | self.actionStart.setEnabled(False) | |
|
5364 | self.actionPause.setEnabled(True) | |
|
5365 | self.actionStop.setEnabled(True) | |
|
5327 | 5366 | |
|
5328 | 5367 | self.actionStarToolbar.setEnabled(False) |
|
5329 | 5368 | self.actionPauseToolbar.setEnabled(True) |
|
5330 | 5369 | self.actionStopToolbar.setEnabled(True) |
|
5331 | 5370 | |
|
5332 | 5371 | self.console.append("Please Wait...") |
|
5333 | 5372 | # try: |
|
5334 | 5373 | self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PROCESS, filename)) |
|
5335 | 5374 | # # |
|
5336 | 5375 | # except: |
|
5337 | 5376 | # self.console.append("Error............................................!") |
|
5338 | 5377 | # self.actionStarToolbar.setEnabled(True) |
|
5339 | 5378 | # self.actionPauseToolbar.setEnabled(False) |
|
5340 | 5379 | # self.actionStopToolbar.setEnabled(False) |
|
5341 | 5380 | |
|
5342 | 5381 | # filename = '/home/dsuarez/workspace_signalchain/schain_guiJune04/test/ewdrifts3.xml' |
|
5343 | 5382 | # data = filename |
|
5344 | 5383 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PROCESS, data)) |
|
5345 | 5384 | |
|
5346 | 5385 | def stopProject(self): |
|
5347 |
|
|
|
5386 | ||
|
5387 | self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
|
5388 | ||
|
5389 | self.actionStart.setEnabled(True) | |
|
5390 | self.actionPause.setEnabled(False) | |
|
5391 | self.actionStop.setEnabled(False) | |
|
5392 | ||
|
5348 | 5393 | self.actionStarToolbar.setEnabled(True) |
|
5349 |
self.actionPauseToolbar.setEnabled( |
|
|
5350 |
self.actionStopToolbar.setEnabled( |
|
|
5394 | self.actionPauseToolbar.setEnabled(False) | |
|
5395 | self.actionStopToolbar.setEnabled(False) | |
|
5351 | 5396 | |
|
5352 | self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, stop)) | |
|
5353 | ||
|
5397 | self.restorePauseIcon() | |
|
5398 | ||
|
5354 | 5399 | def pauseProject(self): |
|
5355 | 5400 | |
|
5401 | self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
|
5402 | ||
|
5403 | self.actionStart.setEnabled(False) | |
|
5404 | self.actionPause.setEnabled(True) | |
|
5405 | self.actionStop.setEnabled(True) | |
|
5406 | ||
|
5356 | 5407 | self.actionStarToolbar.setEnabled(False) |
|
5357 | 5408 | self.actionPauseToolbar.setEnabled(True) |
|
5358 | 5409 | self.actionStopToolbar.setEnabled(True) |
|
5359 | ||
|
5360 | self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
|
5361 | ||
|
5362 | ||
|
5410 | ||
|
5363 | 5411 | def saveProject(self): |
|
5364 | 5412 | |
|
5413 | self.actionStart.setEnabled(False) | |
|
5414 | self.actionStarToolbar.setEnabled(False) | |
|
5415 | ||
|
5365 | 5416 | sts = True |
|
5366 | 5417 | puObj = self.getSelectedPUObj() |
|
5367 | if puObj.name == 'VoltageProc': | |
|
5368 | sts = self.on_volOpOk_clicked() | |
|
5369 |
if puObj.name == ' |
|
|
5370 |
sts = self.on_ |
|
|
5371 |
if puObj.name == 'Spectra |
|
|
5372 |
sts = self.on_spec |
|
|
5373 | ||
|
5374 | if not sts: | |
|
5375 |
|
|
|
5418 | ||
|
5419 | if puObj != None: | |
|
5420 | if puObj.name == 'VoltageProc': | |
|
5421 | sts = self.on_volOpOk_clicked() | |
|
5422 | if puObj.name == 'SpectraProc': | |
|
5423 | sts = self.on_specOpOk_clicked() | |
|
5424 | if puObj.name == 'SpectraHeisProc': | |
|
5425 | sts = self.on_specHeisOpOk_clicked() | |
|
5426 | ||
|
5427 | if not sts: | |
|
5428 | return None | |
|
5376 | 5429 | |
|
5377 | 5430 | projectObj = self.getSelectedProjectObj() |
|
5378 | 5431 | puObjorderList = OrderedDict(sorted(projectObj.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
5379 | 5432 | |
|
5380 | 5433 | for inputId, puObj in puObjorderList.items(): |
|
5381 | 5434 | # print puObj.datatype, puObj.inputId,puObj.getId(),puObj.parentId |
|
5382 | 5435 | |
|
5383 | 5436 | if puObj.name == "VoltageProc": |
|
5384 | 5437 | self.refreshID(puObj) |
|
5385 | 5438 | if puObj.name == "SpectraProc": |
|
5386 | 5439 | self.refreshID(puObj) |
|
5387 | 5440 | if puObj.name == "SpectraHeisProc": |
|
5388 | 5441 | self.refreshID(puObj) |
|
5389 | 5442 | |
|
5390 | 5443 | filename = os.path.join(str(self.pathWorkSpace), |
|
5391 | 5444 | "%s%s%s" %(str(projectObj.name), str(projectObj.id), '.xml') |
|
5392 | 5445 | ) |
|
5393 | 5446 | projectObj.writeXml(filename) |
|
5394 | 5447 | self.console.append("Now, you can press the Start Icon on the toolbar") |
|
5395 | 5448 | |
|
5449 | self.actionStart.setEnabled(True) | |
|
5450 | self.actionStarToolbar.setEnabled(True) | |
|
5451 | ||
|
5396 | 5452 | return filename |
|
5397 | 5453 | |
|
5398 | 5454 | def deleteProjectorPU(self): |
|
5399 | 5455 | """ |
|
5400 | 5456 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
5401 | 5457 | """ |
|
5402 | 5458 | for key in self.__itemTreeDict.keys(): |
|
5403 | 5459 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
5404 | 5460 | continue |
|
5405 | 5461 | |
|
5406 | 5462 | if self.__projectObjDict.has_key(key) == True: |
|
5407 | 5463 | |
|
5408 | 5464 | del self.__projectObjDict[key] |
|
5409 | 5465 | del self.__itemTreeDict[key] |
|
5410 | 5466 | |
|
5411 | 5467 | else: |
|
5412 | 5468 | puObj = self.__puObjDict[key] |
|
5413 | 5469 | if puObj.parentId == None: |
|
5414 | 5470 | id = puObj.getId()[0] |
|
5415 | 5471 | else: |
|
5416 | 5472 | id = puObj.parentId |
|
5417 | 5473 | projectObj = self.__projectObjDict[id] |
|
5418 | 5474 | del self.__puObjDict[key] |
|
5419 | 5475 | del self.__itemTreeDict[key] |
|
5420 | 5476 | del projectObj.procUnitConfObjDict[key] |
|
5421 | 5477 | for key in projectObj.procUnitConfObjDict.keys(): |
|
5422 | 5478 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
5423 | 5479 | continue |
|
5424 | 5480 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5425 | 5481 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5426 | 5482 | del projectObj.procUnitConfObjDict[key] |
|
5427 | 5483 | # print projectObj.procUnitConfObjDict |
|
5428 | 5484 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
5429 | 5485 | self.showWarning() |
|
5430 | 5486 | |
|
5431 | 5487 | def showWarning(self): |
|
5432 | 5488 | pass |
|
5433 | 5489 | |
|
5434 | 5490 | def getParmsFromProjectWindow(self): |
|
5435 | 5491 | """ |
|
5436 | 5492 | Return Inputs Project: |
|
5437 | 5493 | - id |
|
5438 | 5494 | - project_name |
|
5439 | 5495 | - datatype |
|
5440 | 5496 | - ext |
|
5441 | 5497 | - data_path |
|
5442 | 5498 | - readmode |
|
5443 | 5499 | - delay |
|
5444 | 5500 | - set |
|
5445 | 5501 | - walk |
|
5446 | 5502 | """ |
|
5447 | 5503 | project_name = str(self.proName.text()) |
|
5448 | 5504 | try: |
|
5449 | 5505 | name = str(self.proName.text()) |
|
5450 | 5506 | except: |
|
5451 | 5507 | self.console.clear() |
|
5452 | 5508 | self.console.append("Please Write a name") |
|
5453 | 5509 | return 0 |
|
5454 | 5510 | |
|
5455 | 5511 | desc = str(self.proDescription.toPlainText()) |
|
5456 | 5512 | datatype = str(self.proComDataType.currentText()) |
|
5457 | 5513 | data_path = str(self.proDataPath.text()) |
|
5458 | 5514 | if not os.path.exists(data_path): |
|
5459 | 5515 | self.proOk.setEnabled(False) |
|
5460 | 5516 | self.console.clear() |
|
5461 | 5517 | self.console.append("Write a correct a path") |
|
5462 | 5518 | return |
|
5463 | 5519 | |
|
5464 | 5520 | online = int(self.online) |
|
5465 | 5521 | if online == 0: |
|
5466 | 5522 | delay = 0 |
|
5467 | 5523 | set = 0 |
|
5468 | 5524 | else: |
|
5469 | 5525 | delay = self.proDelay.text() |
|
5470 | 5526 | try: |
|
5471 | 5527 | delay = int(self.proDelay.text()) |
|
5472 | 5528 | except: |
|
5473 | 5529 | self.console.clear() |
|
5474 | 5530 | self.console.append("Please Write a number for delay") |
|
5475 | 5531 | return 0 |
|
5476 | 5532 | |
|
5477 | 5533 | set = self.proSet.text() |
|
5478 | 5534 | try: |
|
5479 | 5535 | set = int(self.proSet.text()) |
|
5480 | 5536 | except: |
|
5481 | 5537 | self.console.clear() |
|
5482 | 5538 | set = None |
|
5483 | 5539 | |
|
5484 | 5540 | |
|
5485 | 5541 | walk = int(self.walk) |
|
5486 | 5542 | starDate = str(self.proComStartDate.currentText()) |
|
5487 | 5543 | endDate = str(self.proComEndDate.currentText()) |
|
5488 | 5544 | reloj1 = self.proStartTime.time() |
|
5489 | 5545 | reloj2 = self.proEndTime.time() |
|
5490 | 5546 | startTime = str(reloj1.hour()) + ":" + str(reloj1.minute()) + ":" + str(reloj1.second()) |
|
5491 | 5547 | endTime = str(reloj2.hour()) + ":" + str(reloj2.minute()) + ":" + str(reloj2.second()) |
|
5492 | 5548 | |
|
5493 | 5549 | return project_name, desc, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk , set |
|
5494 | 5550 | |
|
5495 | 5551 | def removefromtree(self, row): |
|
5496 | 5552 | self.parentItem.removeRow(row) |
|
5497 | 5553 | |
|
5498 | 5554 | |
|
5499 | 5555 | def setInputsProject_View(self): |
|
5500 | 5556 | self.tabWidgetProject.setEnabled(True) |
|
5501 | 5557 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
5502 | 5558 | self.tabProject.setEnabled(True) |
|
5503 | 5559 | self.frame_2.setEnabled(False) |
|
5504 | 5560 | self.proName.clear() |
|
5505 | 5561 | self.proName.setFocus() |
|
5506 | 5562 | self.proName.setSelection(0, 0) |
|
5507 | 5563 | self.proName.setCursorPosition(0) |
|
5508 | 5564 | self.proDataType.setText('.r') |
|
5509 | 5565 | self.proDataPath.clear() |
|
5510 | 5566 | self.proComDataType.clear() |
|
5511 | 5567 | self.proComDataType.addItem("Voltage") |
|
5512 | 5568 | self.proComDataType.addItem("Spectra") |
|
5513 | 5569 | self.proComDataType.addItem("Fits") |
|
5514 | 5570 | |
|
5515 | 5571 | self.proComStartDate.clear() |
|
5516 | 5572 | self.proComEndDate.clear() |
|
5517 | 5573 | |
|
5518 | 5574 | startTime = "00:00:00" |
|
5519 | 5575 | endTime = "23:59:59" |
|
5520 | 5576 | starlist = startTime.split(":") |
|
5521 | 5577 | endlist = endTime.split(":") |
|
5522 | 5578 | self.proDelay.setText("0") |
|
5523 | 5579 | self.proSet.setText("0") |
|
5524 | 5580 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5525 | 5581 | self.proStartTime.setTime(self.time) |
|
5526 | 5582 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5527 | 5583 | self.proEndTime.setTime(self.time) |
|
5528 | 5584 | self.proDescription.clear() |
|
5529 | 5585 | self.proOk.setEnabled(False) |
|
5530 | 5586 | self.console.clear() |
|
5531 | 5587 | # self.console.append("Please, Write a name Project") |
|
5532 | 5588 | # self.console.append("Introduce Project Parameters")DC |
|
5533 | 5589 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
5534 | 5590 | |
|
5535 | 5591 | def setInputsPU_View(self, datatype): |
|
5536 | 5592 | projectObjView = self.getSelectedProjectObj() |
|
5537 | 5593 | idReadUnit = projectObjView.getReadUnitId() |
|
5538 | 5594 | readUnitObj = projectObjView.getProcUnitObj(idReadUnit) |
|
5539 | 5595 | |
|
5540 | 5596 | if datatype == 'Voltage': |
|
5541 | 5597 | self.volOpComChannels.setEnabled(False) |
|
5542 | 5598 | self.volOpComHeights.setEnabled(False) |
|
5543 | 5599 | self.volOpFilter.setEnabled(False) |
|
5544 | 5600 | self.volOpComProfile.setEnabled(False) |
|
5545 | 5601 | self.volOpComCode.setEnabled(False) |
|
5546 | 5602 | self.volOpCohInt.setEnabled(False) |
|
5547 | 5603 | self.volOpChannel.setEnabled(False) |
|
5548 | 5604 | self.volOpHeights.setEnabled(False) |
|
5549 | 5605 | self.volOpProfile.setEnabled(False) |
|
5550 | 5606 | self.volOpRadarfrequency.setEnabled(False) |
|
5551 | 5607 | self.volOpCebChannels.setCheckState(0) |
|
5552 | 5608 | self.volOpCebRadarfrequency.setCheckState(0) |
|
5553 | 5609 | self.volOpCebHeights.setCheckState(0) |
|
5554 | 5610 | self.volOpCebFilter.setCheckState(0) |
|
5555 | 5611 | self.volOpCebProfile.setCheckState(0) |
|
5556 | 5612 | self.volOpCebDecodification.setCheckState(0) |
|
5557 | 5613 | self.volOpCebCohInt.setCheckState(0) |
|
5558 | 5614 | |
|
5559 | 5615 | self.volOpChannel.clear() |
|
5560 | 5616 | self.volOpHeights.clear() |
|
5561 | 5617 | self.volOpProfile.clear() |
|
5562 | 5618 | self.volOpFilter.clear() |
|
5563 | 5619 | self.volOpCohInt.clear() |
|
5564 | 5620 | self.volOpRadarfrequency.clear() |
|
5565 | 5621 | |
|
5566 | 5622 | if datatype == 'Spectra': |
|
5567 | 5623 | |
|
5568 | 5624 | if readUnitObj.datatype == 'Spectra': |
|
5569 | 5625 | self.specOpnFFTpoints.setEnabled(False) |
|
5570 | 5626 | self.specOpProfiles.setEnabled(False) |
|
5571 | 5627 | self.specOpippFactor.setEnabled(False) |
|
5572 | 5628 | else: |
|
5573 | 5629 | self.specOpnFFTpoints.setEnabled(True) |
|
5574 | 5630 | self.specOpProfiles.setEnabled(True) |
|
5575 | 5631 | self.specOpippFactor.setEnabled(True) |
|
5576 | 5632 | |
|
5577 | 5633 | self.specOpCebCrossSpectra.setCheckState(0) |
|
5578 | 5634 | self.specOpCebChannel.setCheckState(0) |
|
5579 | 5635 | self.specOpCebHeights.setCheckState(0) |
|
5580 | 5636 | self.specOpCebIncoherent.setCheckState(0) |
|
5581 | 5637 | self.specOpCebRemoveDC.setCheckState(0) |
|
5582 | 5638 | self.specOpCebRemoveInt.setCheckState(0) |
|
5583 | 5639 | self.specOpCebgetNoise.setCheckState(0) |
|
5584 | 5640 | self.specOpCebRadarfrequency.setCheckState(0) |
|
5585 | 5641 | |
|
5586 | 5642 | self.specOpRadarfrequency.setEnabled(False) |
|
5587 | 5643 | self.specOppairsList.setEnabled(False) |
|
5588 | 5644 | self.specOpChannel.setEnabled(False) |
|
5589 | 5645 | self.specOpHeights.setEnabled(False) |
|
5590 | 5646 | self.specOpIncoherent.setEnabled(False) |
|
5591 | 5647 | self.specOpgetNoise.setEnabled(False) |
|
5592 | 5648 | |
|
5593 | 5649 | self.specOpRadarfrequency.clear() |
|
5594 | 5650 | self.specOpnFFTpoints.clear() |
|
5595 | 5651 | self.specOpProfiles.clear() |
|
5596 | 5652 | self.specOpippFactor.clear |
|
5597 | 5653 | self.specOppairsList.clear() |
|
5598 | 5654 | self.specOpChannel.clear() |
|
5599 | 5655 | self.specOpHeights.clear() |
|
5600 | 5656 | self.specOpIncoherent.clear() |
|
5601 | 5657 | self.specOpgetNoise.clear() |
|
5602 | 5658 | |
|
5603 | 5659 | self.specGraphCebSpectraplot.setCheckState(0) |
|
5604 | 5660 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
5605 | 5661 | self.specGraphCebRTIplot.setCheckState(0) |
|
5606 | 5662 | self.specGraphCebRTInoise.setCheckState(0) |
|
5607 | 5663 | self.specGraphCebCoherencmap.setCheckState(0) |
|
5608 | 5664 | self.specGraphPowerprofile.setCheckState(0) |
|
5609 | 5665 | |
|
5610 | 5666 | self.specGraphSaveSpectra.setCheckState(0) |
|
5611 | 5667 | self.specGraphSaveCross.setCheckState(0) |
|
5612 | 5668 | self.specGraphSaveRTIplot.setCheckState(0) |
|
5613 | 5669 | self.specGraphSaveRTInoise.setCheckState(0) |
|
5614 | 5670 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
5615 | 5671 | self.specGraphSavePowerprofile.setCheckState(0) |
|
5616 | 5672 | |
|
5617 | 5673 | self.specGraphftpRTIplot.setCheckState(0) |
|
5618 | 5674 | self.specGraphftpRTInoise.setCheckState(0) |
|
5619 | 5675 | self.specGraphftpCoherencemap.setCheckState(0) |
|
5620 | 5676 | |
|
5621 | 5677 | self.specGraphPath.clear() |
|
5622 | 5678 | self.specGraphPrefix.clear() |
|
5623 | 5679 | |
|
5624 | 5680 | self.specGgraphftpratio.clear() |
|
5625 | 5681 | |
|
5626 | 5682 | self.specGgraphChannelList.clear() |
|
5627 | 5683 | self.specGgraphFreq.clear() |
|
5628 | 5684 | self.specGgraphHeight.clear() |
|
5629 | 5685 | self.specGgraphDbsrange.clear() |
|
5630 | 5686 | self.specGgraphmagnitud.clear() |
|
5631 | 5687 | self.specGgraphTminTmax.clear() |
|
5632 | 5688 | self.specGgraphTimeRange.clear() |
|
5633 | 5689 | |
|
5634 | 5690 | if datatype == 'SpectraHeis': |
|
5635 | 5691 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5636 | 5692 | self.specHeisOpIncoherent.setEnabled(False) |
|
5637 | 5693 | self.specHeisOpIncoherent.clear() |
|
5638 | 5694 | |
|
5639 | 5695 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5640 | 5696 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5641 | 5697 | |
|
5642 | 5698 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5643 | 5699 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5644 | 5700 | |
|
5645 | 5701 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5646 | 5702 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5647 | 5703 | |
|
5648 | 5704 | self.specHeisGraphPath.clear() |
|
5649 | 5705 | self.specHeisGraphPrefix.clear() |
|
5650 | 5706 | self.specHeisGgraphChannelList.clear() |
|
5651 | 5707 | self.specHeisGgraphXminXmax.clear() |
|
5652 | 5708 | self.specHeisGgraphYminYmax.clear() |
|
5653 | 5709 | self.specHeisGgraphTminTmax.clear() |
|
5654 | 5710 | self.specHeisGgraphTimeRange.clear() |
|
5655 | 5711 | self.specHeisGgraphftpratio.clear() |
|
5656 | 5712 | |
|
5657 | 5713 | |
|
5658 | 5714 | |
|
5659 | 5715 | |
|
5660 | 5716 | |
|
5661 | 5717 | def showtabPUCreated(self, datatype): |
|
5662 | 5718 | if datatype == "Voltage": |
|
5663 | 5719 | self.tabVoltage.setEnabled(True) |
|
5664 | 5720 | self.tabProject.setEnabled(False) |
|
5665 | 5721 | self.tabSpectra.setEnabled(False) |
|
5666 | 5722 | self.tabCorrelation.setEnabled(False) |
|
5667 | 5723 | self.tabSpectraHeis.setEnabled(False) |
|
5668 | 5724 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5669 | 5725 | |
|
5670 | 5726 | if datatype == "Spectra": |
|
5671 | 5727 | self.tabVoltage.setEnabled(False) |
|
5672 | 5728 | self.tabProject.setEnabled(False) |
|
5673 | 5729 | self.tabSpectra.setEnabled(True) |
|
5674 | 5730 | self.tabCorrelation.setEnabled(False) |
|
5675 | 5731 | self.tabSpectraHeis.setEnabled(False) |
|
5676 | 5732 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5677 | 5733 | if datatype == "SpectraHeis": |
|
5678 | 5734 | self.tabVoltage.setEnabled(False) |
|
5679 | 5735 | self.tabProject.setEnabled(False) |
|
5680 | 5736 | self.tabSpectra.setEnabled(False) |
|
5681 | 5737 | self.tabCorrelation.setEnabled(False) |
|
5682 | 5738 | self.tabSpectraHeis.setEnabled(True) |
|
5683 | 5739 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5684 | 5740 | |
|
5685 | 5741 | |
|
5686 | 5742 | def searchData(self, data_path, ext, walk, expLabel=''): |
|
5687 | 5743 | dateList = [] |
|
5688 | 5744 | fileList = [] |
|
5689 | 5745 | |
|
5690 | 5746 | if not os.path.exists(data_path): |
|
5691 | 5747 | return None |
|
5692 | 5748 | |
|
5693 | 5749 | if walk == 0: |
|
5694 | 5750 | files = os.listdir(data_path) |
|
5695 | 5751 | for thisFile in files: |
|
5696 | 5752 | thisExt = os.path.splitext(thisFile)[-1] |
|
5697 | 5753 | if thisExt == ext: |
|
5698 | 5754 | fileList.append(thisFile) |
|
5699 | 5755 | |
|
5700 | 5756 | for thisFile in fileList: |
|
5701 | 5757 | try: |
|
5702 | 5758 | year = int(thisFile[1:5]) |
|
5703 | 5759 | doy = int(thisFile[5:8]) |
|
5704 | 5760 | |
|
5705 | 5761 | date = datetime.date(year, 1, 1) + datetime.timedelta(doy - 1) |
|
5706 | 5762 | dateformat = date.strftime("%Y/%m/%d") |
|
5707 | 5763 | |
|
5708 | 5764 | if dateformat not in dateList: |
|
5709 | 5765 | dateList.append(dateformat) |
|
5710 | 5766 | except: |
|
5711 | 5767 | continue |
|
5712 | 5768 | # REVISION---------------------------------1 |
|
5713 | 5769 | if walk == 1: |
|
5714 | 5770 | |
|
5715 | 5771 | dirList = os.listdir(data_path) |
|
5716 | 5772 | |
|
5717 | 5773 | dirList.sort() |
|
5718 | 5774 | |
|
5719 | 5775 | dateList = [] |
|
5720 | 5776 | |
|
5721 | 5777 | for thisDir in dirList: |
|
5722 | 5778 | |
|
5723 | 5779 | if not isRadarPath(thisDir): |
|
5724 | 5780 | self.console.clear() |
|
5725 | 5781 | self.console.append("Please, Choose the Correct Path") |
|
5726 | 5782 | self.proOk.setEnabled(False) |
|
5727 | 5783 | continue |
|
5728 | 5784 | |
|
5729 | 5785 | doypath = os.path.join(data_path, thisDir, expLabel) |
|
5730 | 5786 | if not os.path.exists(doypath): |
|
5731 | 5787 | self.console.clear() |
|
5732 | 5788 | self.console.append("Please, Choose the Correct Path") |
|
5733 | 5789 | return |
|
5734 | 5790 | files = os.listdir(doypath) |
|
5735 | 5791 | fileList = [] |
|
5736 | 5792 | |
|
5737 | 5793 | for thisFile in files: |
|
5738 | 5794 | thisExt = os.path.splitext(thisFile)[-1] |
|
5739 | 5795 | if thisExt != ext: |
|
5740 | 5796 | self.console.clear() |
|
5741 | 5797 | self.console.append("There is no datatype selected in the Path Directory") |
|
5742 | 5798 | self.proOk.setEnabled(False) |
|
5743 | 5799 | continue |
|
5744 | 5800 | |
|
5745 | 5801 | if not isRadarFile(thisFile): |
|
5746 | 5802 | self.proOk.setEnabled(False) |
|
5747 | 5803 | self.console.clear() |
|
5748 | 5804 | self.console.append("Please, Choose the Correct Path") |
|
5749 | 5805 | continue |
|
5750 | 5806 | |
|
5751 | 5807 | fileList.append(thisFile) |
|
5752 | 5808 | break |
|
5753 | 5809 | |
|
5754 | 5810 | if fileList == []: |
|
5755 | 5811 | continue |
|
5756 | 5812 | |
|
5757 | 5813 | year = int(thisDir[1:5]) |
|
5758 | 5814 | doy = int(thisDir[5:8]) |
|
5759 | 5815 | |
|
5760 | 5816 | date = datetime.date(year, 1, 1) + datetime.timedelta(doy - 1) |
|
5761 | 5817 | dateformat = date.strftime("%Y/%m/%d") |
|
5762 | 5818 | dateList.append(dateformat) |
|
5763 | 5819 | |
|
5764 | 5820 | if len(dateList) > 0: |
|
5765 | 5821 | self.proOk.setEnabled(True) |
|
5766 | 5822 | return dateList |
|
5767 | 5823 | |
|
5768 | 5824 | |
|
5769 | 5825 | # self.proOk.setEnabled(False) |
|
5770 | 5826 | return None |
|
5771 | 5827 | |
|
5772 | 5828 | def checkInputsProject(self): |
|
5773 | 5829 | """ |
|
5774 | 5830 | Check Inputs Project: |
|
5775 | 5831 | - project_name |
|
5776 | 5832 | - datatype |
|
5777 | 5833 | - ext |
|
5778 | 5834 | - data_path |
|
5779 | 5835 | - readmode |
|
5780 | 5836 | - delay |
|
5781 | 5837 | - set |
|
5782 | 5838 | - walk |
|
5783 | 5839 | """ |
|
5784 | 5840 | parms_ok = True |
|
5785 | 5841 | project_name = str(self.proName.text()) |
|
5786 | 5842 | if project_name == '' or project_name == None: |
|
5787 | 5843 | outputstr = "Enter the Project Name" |
|
5788 | 5844 | self.console.append(outputstr) |
|
5789 | 5845 | parms_ok = False |
|
5790 | 5846 | project_name = None |
|
5791 | 5847 | |
|
5792 | 5848 | datatype = str(self.proComDataType.currentText()) |
|
5793 | 5849 | if not(datatype in ['Voltage', 'Spectra', 'Fits']): |
|
5794 | 5850 | outputstr = 'datatype = %s, this must be either Voltage, Spectra or SpectraHeis' % datatype |
|
5795 | 5851 | self.console.append(outputstr) |
|
5796 | 5852 | parms_ok = False |
|
5797 | 5853 | datatype = None |
|
5798 | 5854 | |
|
5799 | 5855 | ext = str(self.proDataType.text()) |
|
5800 | 5856 | if not(ext in ['.r', '.pdata', '.fits']): |
|
5801 | 5857 | outputstr = "extension files must be .r , .pdata or .fits" |
|
5802 | 5858 | self.console.append(outputstr) |
|
5803 | 5859 | parms_ok = False |
|
5804 | 5860 | ext = None |
|
5805 | 5861 | |
|
5806 | 5862 | data_path = str(self.proDataPath.text()) |
|
5807 | 5863 | |
|
5808 | 5864 | if data_path == '': |
|
5809 | 5865 | outputstr = 'Datapath is empty' |
|
5810 | 5866 | self.console.append(outputstr) |
|
5811 | 5867 | parms_ok = False |
|
5812 | 5868 | data_path = None |
|
5813 | 5869 | |
|
5814 | 5870 | if data_path != None: |
|
5815 | 5871 | if not os.path.exists(data_path): |
|
5816 | 5872 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5817 | 5873 | self.console.append(outputstr) |
|
5818 | 5874 | parms_ok = False |
|
5819 | 5875 | data_path = None |
|
5820 | 5876 | |
|
5821 | 5877 | read_mode = str(self.proComReadMode.currentText()) |
|
5822 | 5878 | if not(read_mode in ['Online', 'Offline']): |
|
5823 | 5879 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5824 | 5880 | self.console.append(outputstr) |
|
5825 | 5881 | parms_ok = False |
|
5826 | 5882 | read_mode = None |
|
5827 | 5883 | |
|
5828 | 5884 | try: |
|
5829 | 5885 | delay = int(str(self.proDelay.text())) |
|
5830 | 5886 | except: |
|
5831 | 5887 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proName.text()) |
|
5832 | 5888 | self.console.append(outputstr) |
|
5833 | 5889 | parms_ok = False |
|
5834 | 5890 | delay = None |
|
5835 | 5891 | |
|
5836 | 5892 | try: |
|
5837 | 5893 | set = int(str(self.proSet.text())) |
|
5838 | 5894 | except: |
|
5839 | 5895 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5840 | 5896 | # self.console.append(outputstr) |
|
5841 | 5897 | # parms_ok = False |
|
5842 | 5898 | set = None |
|
5843 | 5899 | |
|
5844 | 5900 | walk_str = str(self.proComWalk.currentText()) |
|
5845 | 5901 | if walk_str == 'On Files': |
|
5846 | 5902 | walk = 0 |
|
5847 | 5903 | elif walk_str == 'On Folder': |
|
5848 | 5904 | walk = 1 |
|
5849 | 5905 | else: |
|
5850 | 5906 | outputstr = 'Walk: %s, this must be either On Files or On Folders' % walk_str |
|
5851 | 5907 | self.console.append(outputstr) |
|
5852 | 5908 | parms_ok = False |
|
5853 | 5909 | walk = None |
|
5854 | 5910 | |
|
5855 | 5911 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set |
|
5856 | 5912 | |
|
5857 | 5913 | def checkInputsPUSave(self, datatype): |
|
5858 | 5914 | """ |
|
5859 | 5915 | Check Inputs Spectra Save: |
|
5860 | 5916 | - path |
|
5861 | 5917 | - blocks Per File |
|
5862 | 5918 | - sufix |
|
5863 | 5919 | - dataformat |
|
5864 | 5920 | """ |
|
5865 | 5921 | parms_ok = True |
|
5866 | 5922 | |
|
5867 | 5923 | if datatype == "Voltage": |
|
5868 | 5924 | output_path = str(self.volOutputPath.text()) |
|
5869 | 5925 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5870 | 5926 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5871 | 5927 | |
|
5872 | 5928 | if datatype == "Spectra": |
|
5873 | 5929 | output_path = str(self.specOutputPath.text()) |
|
5874 | 5930 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5875 | 5931 | profilesperblock = str(self.specOutputprofileperblock.text()) |
|
5876 | 5932 | |
|
5877 | 5933 | if datatype == "SpectraHeis": |
|
5878 | 5934 | output_path = str(self.specHeisOutputPath.text()) |
|
5879 | 5935 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5880 | 5936 | metada = str(self.specHeisOutputMetada.text()) |
|
5881 | 5937 | |
|
5882 | 5938 | if output_path == '': |
|
5883 | 5939 | outputstr = 'Outputpath is empty' |
|
5884 | 5940 | self.console.append(outputstr) |
|
5885 | 5941 | parms_ok = False |
|
5886 | 5942 | data_path = None |
|
5887 | 5943 | |
|
5888 | 5944 | if output_path != None: |
|
5889 | 5945 | if not os.path.exists(output_path): |
|
5890 | 5946 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5891 | 5947 | self.console.append(outputstr) |
|
5892 | 5948 | parms_ok = False |
|
5893 | 5949 | output_path = None |
|
5894 | 5950 | |
|
5895 | 5951 | |
|
5896 | 5952 | try: |
|
5897 | 5953 | profilesperblock = int(profilesperblock) |
|
5898 | 5954 | except: |
|
5899 | 5955 | if datatype == "Voltage": |
|
5900 | 5956 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5901 | 5957 | self.console.append(outputstr) |
|
5902 | 5958 | parms_ok = False |
|
5903 | 5959 | profilesperblock = None |
|
5904 | 5960 | |
|
5905 | 5961 | elif datatype == "Spectra": |
|
5906 | 5962 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.specOutputprofileperblock.text()) |
|
5907 | 5963 | self.console.append(outputstr) |
|
5908 | 5964 | parms_ok = False |
|
5909 | 5965 | profilesperblock = None |
|
5910 | 5966 | |
|
5911 | 5967 | try: |
|
5912 | 5968 | blocksperfile = int(blocksperfile) |
|
5913 | 5969 | except: |
|
5914 | 5970 | if datatype == "Voltage": |
|
5915 | 5971 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5916 | 5972 | elif datatype == "Spectra": |
|
5917 | 5973 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5918 | 5974 | elif datatype == "SpectraHeis": |
|
5919 | 5975 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5920 | 5976 | |
|
5921 | 5977 | self.console.append(outputstr) |
|
5922 | 5978 | parms_ok = False |
|
5923 | 5979 | blocksperfile = None |
|
5924 | 5980 | |
|
5925 | 5981 | if datatype == "SpectraHeis": |
|
5926 | 5982 | if metada == '': |
|
5927 | 5983 | outputstr = 'Choose metada file' |
|
5928 | 5984 | self.console.append(outputstr) |
|
5929 | 5985 | parms_ok = False |
|
5930 | 5986 | if metada != None: |
|
5931 | 5987 | if not os.path.isfile(metada): |
|
5932 | 5988 | outputstr = 'Metadata:%s does not exists' % metada |
|
5933 | 5989 | self.console.append(outputstr) |
|
5934 | 5990 | parms_ok = False |
|
5935 | 5991 | output_path = None |
|
5936 | 5992 | |
|
5937 | 5993 | if datatype == "Voltage": |
|
5938 | 5994 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5939 | 5995 | |
|
5940 | 5996 | |
|
5941 | 5997 | if datatype == "Spectra": |
|
5942 | 5998 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5943 | 5999 | |
|
5944 | 6000 | |
|
5945 | 6001 | if datatype == "SpectraHeis": |
|
5946 | 6002 | return parms_ok, output_path, blocksperfile, metada |
|
5947 | 6003 | |
|
5948 | 6004 | def loadDays(self, data_path, ext, walk): |
|
5949 | 6005 | """ |
|
5950 | 6006 | Method to loads day |
|
5951 | 6007 | """ |
|
5952 | 6008 | dateList = self.searchData(data_path, ext, walk) |
|
5953 | 6009 | if dateList == None: |
|
5954 | 6010 | self.console.clear() |
|
5955 | 6011 | outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext) |
|
5956 | 6012 | self.console.append(outputstr) |
|
5957 | 6013 | return |
|
5958 | 6014 | |
|
5959 | 6015 | self.dateList = dateList |
|
5960 | 6016 | for thisDate in dateList: |
|
5961 | 6017 | self.proComStartDate.addItem(thisDate) |
|
5962 | 6018 | self.proComEndDate.addItem(thisDate) |
|
5963 | 6019 | self.proComEndDate.setCurrentIndex(self.proComStartDate.count() - 1) |
|
5964 | 6020 | |
|
5965 | 6021 | def setWorkSpaceGUI(self, pathWorkSpace): |
|
5966 | 6022 | self.pathWorkSpace = pathWorkSpace |
|
5967 | 6023 | |
|
5968 | 6024 | """ |
|
5969 | 6025 | Comandos Usados en Console |
|
5970 | 6026 | """ |
|
5971 | 6027 | def __del__(self): |
|
5972 | 6028 | sys.stdout = sys.__stdout__ |
|
5973 | 6029 | sys.stderr = sys.__stderr__ |
|
5974 | 6030 | |
|
5975 | 6031 | def normalOutputWritten(self, text): |
|
5976 | 6032 | self.console.append(text) |
|
5977 | 6033 | |
|
5978 | 6034 | |
|
5979 | 6035 | def setParameter(self): |
|
5980 | 6036 | |
|
5981 | 6037 | self.setWindowTitle("ROJ-Signal Chain") |
|
5982 | 6038 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) |
|
5983 | 6039 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5984 | 6040 | # sys.stderr = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5985 | 6041 | self.tabWidgetProject.setEnabled(False) |
|
5986 | 6042 | self.tabVoltage.setEnabled(False) |
|
5987 | 6043 | self.tabSpectra.setEnabled(False) |
|
5988 | 6044 | self.tabCorrelation.setEnabled(False) |
|
5989 | 6045 | self.frame_2.setEnabled(False) |
|
5990 | 6046 | |
|
5991 | 6047 | self.actionCreate.setShortcut('Ctrl+N') |
|
5992 |
self.action |
|
|
6048 | self.actionOpen.setShortcut('Ctrl+O') | |
|
5993 | 6049 | self.actionSave.setShortcut('Ctrl+S') |
|
5994 |
self.actionClose.setShortcut('Ctrl+ |
|
|
6050 | self.actionClose.setShortcut('Ctrl+X') | |
|
5995 | 6051 | |
|
5996 |
self.actionStar |
|
|
6052 | self.actionStart.setShortcut('Ctrl+1') | |
|
6053 | self.actionPause.setShortcut('Ctrl+2') | |
|
6054 | self.actionStop.setShortcut('Ctrl+3') | |
|
6055 | ||
|
6056 | self.actionFTP.setShortcut('Ctrl+F') | |
|
6057 | ||
|
6058 | self.actionStarToolbar.setEnabled(False) | |
|
5997 | 6059 | self.actionPauseToolbar.setEnabled(False) |
|
5998 | 6060 | self.actionStopToolbar.setEnabled(False) |
|
5999 | 6061 | |
|
6000 | 6062 | self.proName.clear() |
|
6001 | 6063 | self.proDataPath.setText('') |
|
6002 | 6064 | self.console.setReadOnly(True) |
|
6003 | 6065 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
6004 | 6066 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
6005 | 6067 | self.proDataType.setEnabled(False) |
|
6006 | 6068 | self.time = QtCore.QTime() |
|
6007 | 6069 | self.hour = 0 |
|
6008 | 6070 | self.min = 0 |
|
6009 | 6071 | self.sec = 0 |
|
6010 | 6072 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
6011 | 6073 | startTime = "00:00:00" |
|
6012 | 6074 | endTime = "23:59:59" |
|
6013 | 6075 | starlist = startTime.split(":") |
|
6014 | 6076 | endlist = endTime.split(":") |
|
6015 | 6077 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
6016 | 6078 | self.proStartTime.setTime(self.time) |
|
6017 | 6079 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
6018 | 6080 | self.proEndTime.setTime(self.time) |
|
6019 | 6081 | self.proOk.setEnabled(False) |
|
6020 | 6082 | # set model Project Explorer |
|
6021 | 6083 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
6022 | 6084 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
6023 | 6085 | layout = QtGui.QVBoxLayout() |
|
6024 | 6086 | layout.addWidget(self.projectExplorerTree) |
|
6025 | 6087 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
6026 | 6088 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
6027 | 6089 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
6028 | 6090 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
6029 | 6091 | self.projectExplorerTree.expandAll() |
|
6030 | 6092 | # set model Project Properties |
|
6031 | 6093 | |
|
6032 | 6094 | self.propertiesModel = treeModel() |
|
6033 | 6095 | self.propertiesModel.initProjectView() |
|
6034 | 6096 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
6035 | 6097 | self.treeProjectProperties.expandAll() |
|
6036 | 6098 | self.treeProjectProperties.allColumnsShowFocus() |
|
6037 | 6099 | self.treeProjectProperties.resizeColumnToContents(1) |
|
6038 | 6100 | |
|
6039 | 6101 | # set Project |
|
6040 | 6102 | self.proDelay.setEnabled(False) |
|
6041 | 6103 | self.proSet.setEnabled(False) |
|
6042 | 6104 | self.proDataType.setReadOnly(True) |
|
6043 | 6105 | |
|
6044 | 6106 | # set Operation Voltage |
|
6045 | 6107 | self.volOpComChannels.setEnabled(False) |
|
6046 | 6108 | self.volOpComHeights.setEnabled(False) |
|
6047 | 6109 | self.volOpFilter.setEnabled(False) |
|
6048 | 6110 | self.volOpComProfile.setEnabled(False) |
|
6049 | 6111 | self.volOpComCode.setEnabled(False) |
|
6112 | self.volOpFlip.setEnabled(False) | |
|
6050 | 6113 | self.volOpCohInt.setEnabled(False) |
|
6051 | 6114 | self.volOpRadarfrequency.setEnabled(False) |
|
6052 | 6115 | |
|
6053 | 6116 | self.volOpChannel.setEnabled(False) |
|
6054 | 6117 | self.volOpHeights.setEnabled(False) |
|
6055 | 6118 | self.volOpProfile.setEnabled(False) |
|
6056 | 6119 | self.volOpComMode.setEnabled(False) |
|
6057 | 6120 | |
|
6058 | 6121 | self.volGraphPath.setEnabled(False) |
|
6059 | 6122 | self.volGraphPrefix.setEnabled(False) |
|
6060 | 6123 | self.volGraphToolPath.setEnabled(False) |
|
6061 | 6124 | |
|
6062 | 6125 | # set Graph Voltage |
|
6063 | 6126 | self.volGraphChannelList.setEnabled(False) |
|
6064 | 6127 | self.volGraphfreqrange.setEnabled(False) |
|
6065 | 6128 | self.volGraphHeightrange.setEnabled(False) |
|
6066 | 6129 | |
|
6067 | 6130 | # set Operation Spectra |
|
6068 | 6131 | self.specOpnFFTpoints.setEnabled(False) |
|
6069 | 6132 | self.specOpProfiles.setEnabled(False) |
|
6070 | 6133 | self.specOpippFactor.setEnabled(False) |
|
6071 | 6134 | self.specOppairsList.setEnabled(False) |
|
6072 | 6135 | self.specOpComChannel.setEnabled(False) |
|
6073 | 6136 | self.specOpComHeights.setEnabled(False) |
|
6074 | 6137 | self.specOpIncoherent.setEnabled(False) |
|
6075 | 6138 | self.specOpgetNoise.setEnabled(False) |
|
6076 | 6139 | self.specOpRadarfrequency.setEnabled(False) |
|
6077 | 6140 | |
|
6078 | 6141 | |
|
6079 | 6142 | self.specOpChannel.setEnabled(False) |
|
6080 | 6143 | self.specOpHeights.setEnabled(False) |
|
6081 | 6144 | # set Graph Spectra |
|
6082 | 6145 | self.specGgraphChannelList.setEnabled(False) |
|
6083 | 6146 | self.specGgraphFreq.setEnabled(False) |
|
6084 | 6147 | self.specGgraphHeight.setEnabled(False) |
|
6085 | 6148 | self.specGgraphDbsrange.setEnabled(False) |
|
6086 | 6149 | self.specGgraphmagnitud.setEnabled(False) |
|
6087 | 6150 | self.specGgraphTminTmax.setEnabled(False) |
|
6088 | 6151 | self.specGgraphTimeRange.setEnabled(False) |
|
6089 | 6152 | self.specGraphPath.setEnabled(False) |
|
6090 | 6153 | self.specGraphToolPath.setEnabled(False) |
|
6091 | 6154 | self.specGraphPrefix.setEnabled(False) |
|
6092 | 6155 | |
|
6093 | 6156 | self.specGgraphftpratio.setEnabled(False) |
|
6094 | 6157 | # set Operation SpectraHeis |
|
6095 | 6158 | self.specHeisOpIncoherent.setEnabled(False) |
|
6096 | 6159 | self.specHeisOpCobIncInt.setEnabled(False) |
|
6097 | 6160 | # set Graph SpectraHeis |
|
6098 | 6161 | self.specHeisGgraphChannelList.setEnabled(False) |
|
6099 | 6162 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
6100 | 6163 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
6101 | 6164 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
6102 | 6165 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
6103 | 6166 | self.specHeisGgraphftpratio.setEnabled(False) |
|
6104 | 6167 | self.specHeisGraphPath.setEnabled(False) |
|
6105 | 6168 | self.specHeisGraphPrefix.setEnabled(False) |
|
6106 | 6169 | self.specHeisGraphToolPath.setEnabled(False) |
|
6107 | 6170 | |
|
6108 | 6171 | |
|
6109 | 6172 | # tool tip gui |
|
6110 | 6173 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
6111 | 6174 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
6112 | 6175 | # tool tip gui project |
|
6113 | 6176 | 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>') |
|
6114 | 6177 | self.proComWalk.setCurrentIndex(0) |
|
6115 | 6178 | # tool tip gui volOp |
|
6116 | 6179 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
6117 | 6180 | self.volOpHeights.setToolTip('Example: 90,180') |
|
6118 | 6181 | self.volOpFilter.setToolTip('Example: 2') |
|
6119 | 6182 | self.volOpProfile.setToolTip('Example:0,127') |
|
6120 | 6183 | self.volOpCohInt.setToolTip('Example: 128') |
|
6121 | 6184 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
6122 | 6185 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
6123 | 6186 | # tool tip gui volGraph |
|
6124 | 6187 | self.volGraphfreqrange.setToolTip('Example: -30,30') |
|
6125 | 6188 | self.volGraphHeightrange.setToolTip('Example: 20,180') |
|
6126 | 6189 | # tool tip gui specOp |
|
6127 | 6190 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
6128 | 6191 | self.specOpProfiles.setToolTip('Example: 128') |
|
6129 | 6192 | self.specOpippFactor.setToolTip('Example:1.0') |
|
6130 | 6193 | self.specOpIncoherent.setToolTip('Example: 10') |
|
6131 | 6194 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
6132 | 6195 | |
|
6133 | 6196 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
6134 | 6197 | self.specOpHeights.setToolTip('Example: 90,180') |
|
6135 | 6198 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
6136 | 6199 | # tool tip gui specGraph |
|
6137 | 6200 | |
|
6138 | 6201 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
6139 | 6202 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
6140 | 6203 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
6141 | 6204 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
6142 | 6205 | |
|
6143 | 6206 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
6144 | 6207 | |
|
6145 | 6208 | |
|
6146 | 6209 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
6147 | 6210 | """ |
|
6148 | 6211 | Class documentation goes here. |
|
6149 | 6212 | """ |
|
6150 | 6213 | closed = pyqtSignal() |
|
6151 | 6214 | create = False |
|
6152 | 6215 | |
|
6153 | 6216 | def __init__(self, parent=None): |
|
6154 | 6217 | """ |
|
6155 | 6218 | Constructor |
|
6156 | 6219 | """ |
|
6157 | 6220 | QMainWindow.__init__(self, parent) |
|
6158 | 6221 | self.setupUi(self) |
|
6159 | 6222 | self.getFromWindow = None |
|
6160 | 6223 | self.getfromWindowList = [] |
|
6161 | 6224 | self.dataTypeProject = None |
|
6162 | 6225 | |
|
6163 | 6226 | self.listUP = None |
|
6164 | 6227 | |
|
6165 | 6228 | @pyqtSignature("") |
|
6166 | 6229 | def on_unitPokbut_clicked(self): |
|
6167 | 6230 | """ |
|
6168 | 6231 | Slot documentation goes here. |
|
6169 | 6232 | """ |
|
6170 | 6233 | self.create = True |
|
6171 | 6234 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
6172 | 6235 | # self.nameofUP= str(self.nameUptxt.text()) |
|
6173 | 6236 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
6174 | 6237 | self.close() |
|
6175 | 6238 | |
|
6176 | 6239 | |
|
6177 | 6240 | @pyqtSignature("") |
|
6178 | 6241 | def on_unitPcancelbut_clicked(self): |
|
6179 | 6242 | """ |
|
6180 | 6243 | Slot documentation goes here. |
|
6181 | 6244 | """ |
|
6182 | 6245 | self.create = False |
|
6183 | 6246 | self.close() |
|
6184 | 6247 | |
|
6185 | 6248 | def loadTotalList(self): |
|
6186 | 6249 | self.comboInputBox.clear() |
|
6187 | 6250 | for i in self.getfromWindowList: |
|
6188 | 6251 | |
|
6189 | 6252 | name = i.getElementName() |
|
6190 | 6253 | if name == 'Project': |
|
6191 | 6254 | id = i.id |
|
6192 | 6255 | name = i.name |
|
6193 | 6256 | if self.dataTypeProject == 'Voltage': |
|
6194 | 6257 | self.comboTypeBox.clear() |
|
6195 | 6258 | self.comboTypeBox.addItem("Voltage") |
|
6196 | 6259 | |
|
6197 | 6260 | if self.dataTypeProject == 'Spectra': |
|
6198 | 6261 | self.comboTypeBox.clear() |
|
6199 | 6262 | self.comboTypeBox.addItem("Spectra") |
|
6200 | 6263 | self.comboTypeBox.addItem("Correlation") |
|
6201 | 6264 | if self.dataTypeProject == 'Fits': |
|
6202 | 6265 | self.comboTypeBox.clear() |
|
6203 | 6266 | self.comboTypeBox.addItem("SpectraHeis") |
|
6204 | 6267 | |
|
6205 | 6268 | |
|
6206 | 6269 | if name == 'ProcUnit': |
|
6207 | 6270 | id = int(i.id) - 1 |
|
6208 | 6271 | name = i.datatype |
|
6209 | 6272 | if name == 'Voltage': |
|
6210 | 6273 | self.comboTypeBox.clear() |
|
6211 | 6274 | self.comboTypeBox.addItem("Spectra") |
|
6212 | 6275 | self.comboTypeBox.addItem("SpectraHeis") |
|
6213 | 6276 | self.comboTypeBox.addItem("Correlation") |
|
6214 | 6277 | if name == 'Spectra': |
|
6215 | 6278 | self.comboTypeBox.clear() |
|
6216 | 6279 | self.comboTypeBox.addItem("Spectra") |
|
6217 | 6280 | self.comboTypeBox.addItem("SpectraHeis") |
|
6218 | 6281 | self.comboTypeBox.addItem("Correlation") |
|
6219 | 6282 | if name == 'SpectraHeis': |
|
6220 | 6283 | self.comboTypeBox.clear() |
|
6221 | 6284 | self.comboTypeBox.addItem("SpectraHeis") |
|
6222 | 6285 | |
|
6223 | 6286 | self.comboInputBox.addItem(str(name)) |
|
6224 | 6287 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
6225 | 6288 | |
|
6226 | 6289 | def closeEvent(self, event): |
|
6227 | 6290 | self.closed.emit() |
|
6228 | 6291 | event.accept() |
|
6229 | 6292 | |
|
6230 | 6293 | class Ftp(QMainWindow, Ui_Ftp): |
|
6231 | 6294 | """ |
|
6232 | 6295 | Class documentation goes here. |
|
6233 | 6296 | """ |
|
6234 | 6297 | create = False |
|
6235 | 6298 | closed = pyqtSignal() |
|
6236 | 6299 | server = None |
|
6237 | 6300 | folder = None |
|
6238 | 6301 | username = None |
|
6239 | 6302 | password = None |
|
6240 | 6303 | ftp_wei = None |
|
6241 | 6304 | exp_code = None |
|
6242 | 6305 | sub_exp_code = None |
|
6243 | 6306 | plot_pos = None |
|
6244 | 6307 | |
|
6245 | 6308 | def __init__(self, parent=None): |
|
6246 | 6309 | """ |
|
6247 | 6310 | Constructor |
|
6248 | 6311 | """ |
|
6249 | 6312 | QMainWindow.__init__(self, parent) |
|
6250 | 6313 | self.setupUi(self) |
|
6251 | 6314 | self.setParameter() |
|
6252 | 6315 | |
|
6253 | 6316 | def setParameter(self): |
|
6254 | 6317 | self.setWindowTitle("ROJ-Signal Chain") |
|
6255 | 6318 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
6256 | 6319 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
6257 | 6320 | self.usernameFTP.setToolTip('Example: myusername') |
|
6258 | 6321 | self.passwordFTP.setToolTip('Example: mypass ') |
|
6259 | 6322 | self.weightFTP.setToolTip('Example: 0') |
|
6260 | 6323 | self.expcodeFTP.setToolTip('Example: 0') |
|
6261 | 6324 | self.subexpFTP.setToolTip('Example: 0') |
|
6262 | 6325 | self.plotposFTP.setToolTip('Example: 0') |
|
6263 | 6326 | |
|
6264 | 6327 | def setParmsfromTemporal(self, server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
6265 | 6328 | self.serverFTP.setText(str(server)) |
|
6266 | 6329 | self.folderFTP.setText(str(folder)) |
|
6267 | 6330 | self.usernameFTP.setText(str(username)) |
|
6268 | 6331 | self.passwordFTP.setText(str(password)) |
|
6269 | 6332 | self.weightFTP.setText(str(ftp_wei)) |
|
6270 | 6333 | self.expcodeFTP.setText(str(exp_code)) |
|
6271 | 6334 | self.subexpFTP.setText(str(sub_exp_code)) |
|
6272 | 6335 | self.plotposFTP.setText(str(plot_pos)) |
|
6273 | 6336 | |
|
6274 | 6337 | def getParmsFromFtpWindow(self): |
|
6275 | 6338 | """ |
|
6276 | 6339 | Return Inputs Project: |
|
6277 | 6340 | - server |
|
6278 | 6341 | - folder |
|
6279 | 6342 | - username |
|
6280 | 6343 | - password |
|
6281 | 6344 | - ftp_wei |
|
6282 | 6345 | - exp_code |
|
6283 | 6346 | - sub_exp_code |
|
6284 | 6347 | - plot_pos |
|
6285 | 6348 | """ |
|
6286 | 6349 | name_server_ftp = str(self.serverFTP.text()) |
|
6287 | 6350 | try: |
|
6288 | 6351 | name = str(self.serverFTP.text()) |
|
6289 | 6352 | except: |
|
6290 | 6353 | self.console.clear() |
|
6291 | 6354 | self.console.append("Please Write a FTP Server") |
|
6292 | 6355 | return 0 |
|
6293 | 6356 | |
|
6294 | 6357 | folder_server_ftp = str(self.folderFTP.text()) |
|
6295 | 6358 | try: |
|
6296 | 6359 | folder = str(self.folderFTP.text()) |
|
6297 | 6360 | except: |
|
6298 | 6361 | self.console.clear() |
|
6299 | 6362 | self.console.append("Please Write a Folder") |
|
6300 | 6363 | return 0 |
|
6301 | 6364 | |
|
6302 | 6365 | username_ftp = str(self.usernameFTP.text()) |
|
6303 | 6366 | try: |
|
6304 | 6367 | username = str(self.usernameFTP.text()) |
|
6305 | 6368 | except: |
|
6306 | 6369 | self.console.clear() |
|
6307 | 6370 | self.console.append("Please Write a User Name") |
|
6308 | 6371 | return 0 |
|
6309 | 6372 | |
|
6310 | 6373 | password_ftp = str(self.passwordFTP.text()) |
|
6311 | 6374 | try: |
|
6312 | 6375 | password = str(self.passwordFTP.text()) |
|
6313 | 6376 | except: |
|
6314 | 6377 | self.console.clear() |
|
6315 | 6378 | self.console.append("Please Write a passwordFTP") |
|
6316 | 6379 | return 0 |
|
6317 | 6380 | |
|
6318 | 6381 | ftp_wei = self.weightFTP.text() |
|
6319 | 6382 | if not ftp_wei == "": |
|
6320 | 6383 | try: |
|
6321 | 6384 | ftp_wei = int(self.weightFTP.text()) |
|
6322 | 6385 | except: |
|
6323 | 6386 | self.console.clear() |
|
6324 | 6387 | self.console.append("Please Write a ftp_wei number") |
|
6325 | 6388 | return 0 |
|
6326 | 6389 | |
|
6327 | 6390 | exp_code = self.expcodeFTP.text() |
|
6328 | 6391 | if not exp_code == "": |
|
6329 | 6392 | try: |
|
6330 | 6393 | exp_code = int(self.expcodeFTP.text()) |
|
6331 | 6394 | except: |
|
6332 | 6395 | self.console.clear() |
|
6333 | 6396 | self.console.append("Please Write a exp_code number") |
|
6334 | 6397 | return 0 |
|
6335 | 6398 | |
|
6336 | 6399 | |
|
6337 | 6400 | sub_exp_code = self.subexpFTP.text() |
|
6338 | 6401 | if not sub_exp_code == "": |
|
6339 | 6402 | try: |
|
6340 | 6403 | sub_exp_code = int(self.subexpFTP.text()) |
|
6341 | 6404 | except: |
|
6342 | 6405 | self.console.clear() |
|
6343 | 6406 | self.console.append("Please Write a sub_exp_code number") |
|
6344 | 6407 | return 0 |
|
6345 | 6408 | |
|
6346 | 6409 | plot_pos = self.plotposFTP.text() |
|
6347 | 6410 | if not plot_pos == "": |
|
6348 | 6411 | try: |
|
6349 | 6412 | plot_pos = int(self.plotposFTP.text()) |
|
6350 | 6413 | except: |
|
6351 | 6414 | self.console.clear() |
|
6352 | 6415 | self.console.append("Please Write a plot_pos number") |
|
6353 | 6416 | return 0 |
|
6354 | 6417 | |
|
6355 | 6418 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
6356 | 6419 | |
|
6357 | 6420 | @pyqtSignature("") |
|
6358 | 6421 | def on_ftpOkButton_clicked(self): |
|
6359 | 6422 | server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
6360 | 6423 | self.create = True |
|
6361 | 6424 | self.close() |
|
6362 | 6425 | |
|
6363 | 6426 | @pyqtSignature("") |
|
6364 | 6427 | def on_ftpCancelButton_clicked(self): |
|
6365 | 6428 | self.create = False |
|
6366 | 6429 | self.close() |
|
6367 | 6430 | |
|
6368 | 6431 | def closeEvent(self, event): |
|
6369 | 6432 | self.closed.emit() |
|
6370 | 6433 | event.accept() |
|
6371 | 6434 | |
|
6372 | 6435 | class ftpBuffer(): |
|
6373 | 6436 | server = None |
|
6374 | 6437 | folder = None |
|
6375 | 6438 | username = None |
|
6376 | 6439 | password = None |
|
6377 | 6440 | ftp_wei = None |
|
6378 | 6441 | exp_code = None |
|
6379 | 6442 | sub_exp_code = None |
|
6380 | 6443 | plot_pos = None |
|
6381 | 6444 | create = False |
|
6382 | 6445 | withoutconfig = False |
|
6383 | 6446 | createforView = False |
|
6384 | 6447 | localfolder = None |
|
6385 | 6448 | extension = None |
|
6386 | 6449 | period = None |
|
6387 | 6450 | protocol = None |
|
6388 | 6451 | |
|
6389 | 6452 | def __init__(self): |
|
6390 | 6453 | |
|
6391 | 6454 | self.create = False |
|
6392 | 6455 | self.server = None |
|
6393 | 6456 | self.folder = None |
|
6394 | 6457 | self.username = None |
|
6395 | 6458 | self.password = None |
|
6396 | 6459 | self.ftp_wei = None |
|
6397 | 6460 | self.exp_code = None |
|
6398 | 6461 | self.sub_exp_code = None |
|
6399 | 6462 | self.plot_pos = None |
|
6400 | 6463 | # self.create = False |
|
6401 | 6464 | self.localfolder = None |
|
6402 | 6465 | self.extension = None |
|
6403 | 6466 | self.period = None |
|
6404 | 6467 | self.protocol = None |
|
6405 | 6468 | |
|
6406 | 6469 | def setwithoutconfiguration(self): |
|
6407 | 6470 | |
|
6408 | 6471 | self.create = False |
|
6409 | 6472 | self.server = "jro-app.igp.gob.pe" |
|
6410 | 6473 | self.folder = "/home/wmaster/graficos" |
|
6411 | 6474 | self.username = "wmaster" |
|
6412 | 6475 | self.password = "mst2010vhf" |
|
6413 | 6476 | self.ftp_wei = "0" |
|
6414 | 6477 | self.exp_code = "0" |
|
6415 | 6478 | self.sub_exp_code = "0" |
|
6416 | 6479 | self.plot_pos = "0" |
|
6417 | 6480 | self.withoutconfig = True |
|
6418 | 6481 | self.localfolder = './' |
|
6419 | 6482 | self.extension = '.png' |
|
6420 | 6483 | self.period = '60' |
|
6421 | 6484 | self.protocol = 'ftp' |
|
6422 | 6485 | self.createforView = True |
|
6423 | 6486 | |
|
6424 | 6487 | def save(self, server, folder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos, localfolder='./', extension='.png', period='60', protocol='ftp'): |
|
6425 | 6488 | |
|
6426 | 6489 | self.server = server |
|
6427 | 6490 | self.folder = folder |
|
6428 | 6491 | self.username = username |
|
6429 | 6492 | self.password = password |
|
6430 | 6493 | self.ftp_wei = ftp_wei |
|
6431 | 6494 | self.exp_code = exp_code |
|
6432 | 6495 | self.sub_exp_code = sub_exp_code |
|
6433 | 6496 | self.plot_pos = plot_pos |
|
6434 | 6497 | self.create = True |
|
6435 | 6498 | self.withoutconfig = False |
|
6436 | 6499 | self.createforView = True |
|
6437 | 6500 | self.localfolder = localfolder |
|
6438 | 6501 | |
|
6439 | 6502 | |
|
6440 | 6503 | def recover(self): |
|
6441 | 6504 | |
|
6442 | 6505 | return self.server, self.folder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos |
|
6443 | 6506 | |
|
6444 | 6507 | class ShowMeConsole(QtCore.QObject): |
|
6445 | 6508 | textWritten = QtCore.pyqtSignal(str) |
|
6446 | 6509 | def write (self, text): |
|
6447 | 6510 | self.textWritten.emit(str(text)) |
|
6448 | 6511 | |
|
6449 | 6512 | class PlotManager(): |
|
6450 | 6513 | def __init__(self, queue): |
|
6451 | 6514 | self.queue = queue |
|
6452 | 6515 | self.objPlotDict = {} |
|
6453 | 6516 | |
|
6454 | 6517 | def processIncoming(self): |
|
6455 | 6518 | while self.queue.qsize(): |
|
6456 | 6519 | try: |
|
6457 | 6520 | dataFromQueue = self.queue.get(True) |
|
6458 | 6521 | if dataFromQueue == None: |
|
6459 | 6522 | continue |
|
6460 | 6523 | |
|
6461 | 6524 | dataPlot = dataFromQueue['data'] |
|
6462 | 6525 | kwargs = dataFromQueue['kwargs'] |
|
6463 | 6526 | id = kwargs['id'] |
|
6464 | 6527 | if 'channelList' in kwargs.keys(): |
|
6465 | 6528 | channelList = kwargs['channelList'] |
|
6466 | 6529 | else: |
|
6467 | 6530 | channelList = None |
|
6468 | 6531 | plotname = kwargs.pop('type') |
|
6469 | 6532 | |
|
6470 | 6533 | if not(id in self.objPlotDict.keys()): |
|
6471 | 6534 | className = eval(plotname) |
|
6472 | 6535 | self.objPlotDict[id] = className(id, channelList, dataPlot) |
|
6473 | 6536 | self.objPlotDict[id].show() |
|
6474 | 6537 | |
|
6475 | 6538 | self.objPlotDict[id].run(dataPlot , **kwargs) |
|
6476 | 6539 | |
|
6477 | 6540 | except Queue.Empty: |
|
6478 | 6541 | pass |
|
6479 | 6542 | |
|
6480 | 6543 |
@@ -1,100 +1,100 | |||
|
1 | 1 | import threading |
|
2 | 2 | import Queue |
|
3 | import pickle | |
|
4 | import numpy, os, sys | |
|
3 | from time import sleep | |
|
5 | 4 | |
|
6 | 5 | from schainpy.controller import Project |
|
7 | 6 | from command import * |
|
8 | 7 | |
|
9 | 8 | class ControllerThread(threading.Thread): |
|
10 | 9 | def __init__(self, filename, data_q=None): |
|
11 | 10 | super(ControllerThread, self).__init__() |
|
12 | 11 | self.filename = filename |
|
13 | 12 | self.data_q = data_q |
|
14 | 13 | self.control = {'stop':False,'pause':False} |
|
15 | 14 | |
|
16 | 15 | def stop(self): |
|
17 | 16 | self.control['stop'] = True |
|
18 | 17 | |
|
19 | 18 | def pause(self): |
|
20 | 19 | self.control['pause'] = not(self.control['pause']) |
|
21 | 20 | |
|
22 | 21 | def run(self): |
|
23 | 22 | self.control['stop'] = False |
|
24 | 23 | self.control['pause'] = False |
|
25 | 24 | self.controllerObj = Project(self.control, self.data_q) |
|
26 | 25 | self.controllerObj.readXml(self.filename) |
|
27 | 26 | self.controllerObj.createObjects() |
|
28 | 27 | self.controllerObj.connectObjects() |
|
29 | 28 | self.controllerObj.run() |
|
30 | 29 | |
|
31 | 30 | class CommCtrlProcessThread(threading.Thread): |
|
32 | 31 | """ Implements the threading.Thread interface (start, join, etc.) and |
|
33 | 32 | can be controlled via the cmd_q Queue attribute. Replies are placed in |
|
34 | 33 | the reply_q Queue attribute. |
|
35 | 34 | """ |
|
36 | 35 | def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()): |
|
37 | 36 | super(CommCtrlProcessThread, self).__init__() |
|
38 | 37 | self.cmd_q = cmd_q |
|
39 | 38 | # self.reply_q = reply_q |
|
40 | 39 | |
|
41 | 40 | # self.print_q = Queue.Queue() |
|
42 | 41 | # self.data_q = Queue.Queue() |
|
43 | 42 | |
|
44 | 43 | |
|
45 | 44 | self.alive = threading.Event() |
|
46 | 45 | self.setDaemon(True) |
|
47 | 46 | self.alive.set() |
|
48 | 47 | self.socket = None |
|
49 | 48 | |
|
50 | 49 | self.socketIO = None |
|
51 | 50 | self.mySocket = None |
|
52 | 51 | |
|
53 | 52 | |
|
54 | 53 | self.handlers = { |
|
55 | 54 | ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD, |
|
56 | 55 | ProcessCommand.MESSAGE: self._handle_ioMESSAGE, |
|
57 | 56 | ProcessCommand.DATA: self._handle_ioDATA, |
|
58 | 57 | ProcessCommand.STOP: self._handle_ioSTOP, |
|
59 | 58 | ProcessCommand.PAUSE: self._handle_ioPAUSE |
|
60 | 59 | } |
|
61 | 60 | |
|
62 | 61 | def run(self): |
|
63 | 62 | |
|
64 | 63 | while self.alive.isSet(): |
|
65 | 64 | try: |
|
66 | 65 | cmd = self.cmd_q.get(True, 0.1) |
|
67 | 66 | self.handlers[cmd.type](cmd) |
|
68 | 67 | except Queue.Empty as e: |
|
68 | sleep(0.1) | |
|
69 | 69 | continue |
|
70 | 70 | |
|
71 | 71 | |
|
72 | 72 | def _handle_ioPROCESSTHREAD(self, cmd): |
|
73 | 73 | filename = cmd.data |
|
74 | 74 | self.controllerObj = ControllerThread(filename=filename) |
|
75 | 75 | self.controllerObj.start() |
|
76 | 76 | |
|
77 | 77 | def _handle_ioPAUSE(self, cmd): |
|
78 | 78 | self.controllerObj.pause() |
|
79 | 79 | |
|
80 | 80 | def _handle_ioSTOP(self, cmd): |
|
81 | 81 | self.controllerObj.stop() |
|
82 | 82 | |
|
83 | 83 | def _handle_ioDATA(self, cmd): |
|
84 | 84 | self.reply_q.put(self._success_reply_data(data=cmd.data)) |
|
85 | 85 | |
|
86 | 86 | def _handle_ioMESSAGE(self, cmd): |
|
87 | 87 | self.reply_q.put(self._success_reply_message(data=cmd.data)) |
|
88 | 88 | |
|
89 | 89 | def _success_reply_data(self, data=None): |
|
90 | 90 | return ClientReply(ClientReply.DATA, data) |
|
91 | 91 | |
|
92 | 92 | def _success_reply_message(self, data=None): |
|
93 | 93 | return ClientReply(ClientReply.MESSAGE, data) |
|
94 | 94 | |
|
95 | 95 | def join(self, timeout=None): |
|
96 | 96 | self.alive.clear() |
|
97 | 97 | threading.Thread.join(self, timeout) |
|
98 | 98 | |
|
99 | 99 | |
|
100 | 100 | No newline at end of file |
This diff has been collapsed as it changes many lines, (1298 lines changed) Show them Hide them | |||
@@ -1,1537 +1,311 | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | |
|
3 | 3 | # Form implementation generated from reading ui file '/home/alex/ui/MainWindow_21_02_13_v49.ui' |
|
4 | 4 | # |
|
5 | 5 | # Created: Mon Mar 24 13:28:36 2014 |
|
6 | 6 | # by: PyQt4 UI code generator 4.10 |
|
7 | 7 | # |
|
8 | 8 | # WARNING! All changes made in this file will be lost! |
|
9 | 9 | |
|
10 | 10 | from PyQt4 import QtCore, QtGui |
|
11 | 11 | from windows import * |
|
12 | 12 | |
|
13 | 13 | try: |
|
14 | 14 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
15 | 15 | except AttributeError: |
|
16 | 16 | def _fromUtf8(s): |
|
17 | 17 | return s |
|
18 | 18 | |
|
19 | 19 | try: |
|
20 | 20 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
21 | 21 | def _translate(context, text, disambig): |
|
22 | 22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
23 | 23 | except AttributeError: |
|
24 | 24 | def _translate(context, text, disambig): |
|
25 | 25 | return QtGui.QApplication.translate(context, text, disambig) |
|
26 | 26 | |
|
27 | 27 | import os |
|
28 | 28 | from schainpy.gui.figures import tools |
|
29 | 29 | |
|
30 | 30 | FIGURES_PATH = tools.get_path() |
|
31 | 31 | |
|
32 |
class Ui_ |
|
|
32 | class Ui_EnvWindow(object): | |
|
33 | paused = False | |
|
33 | 34 | |
|
34 | def setupUi(self, MainWindow): | |
|
35 | def restorePauseIcon(self): | |
|
35 | 36 | |
|
36 | MainWindow.setObjectName(_fromUtf8("MainWindow")) | |
|
37 | MainWindow.resize(1203, 711) | |
|
38 | ||
|
39 | self.centralWidget = QtGui.QWidget(MainWindow) | |
|
40 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) | |
|
41 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) | |
|
42 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) | |
|
43 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) | |
|
44 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) | |
|
45 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) | |
|
46 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) | |
|
47 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) | |
|
48 | self.splitter = QtGui.QSplitter(self.splitter_2) | |
|
49 | self.splitter.setOrientation(QtCore.Qt.Vertical) | |
|
50 | self.splitter.setObjectName(_fromUtf8("splitter")) | |
|
51 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) | |
|
52 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) | |
|
53 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) | |
|
54 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) | |
|
55 | ||
|
56 | ||
|
57 | self.tabProject = QtGui.QWidget() | |
|
58 | self.tabProject.setObjectName(_fromUtf8("tabProject")) | |
|
59 | self.gridLayout_15 = QtGui.QGridLayout(self.tabProject) | |
|
60 | self.gridLayout_15.setObjectName(_fromUtf8("gridLayout_15")) | |
|
61 | self.frame = QtGui.QFrame(self.tabProject) | |
|
62 | self.frame.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
63 | self.frame.setFrameShadow(QtGui.QFrame.Raised) | |
|
64 | self.frame.setObjectName(_fromUtf8("frame")) | |
|
65 | self.gridLayout_2 = QtGui.QGridLayout(self.frame) | |
|
66 | self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) | |
|
67 | ||
|
68 | self.label = QtGui.QLabel(self.frame) | |
|
69 | self.label.setObjectName(_fromUtf8("label")) | |
|
70 | self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) | |
|
71 | self.proName = QtGui.QLineEdit(self.frame) | |
|
72 | self.proName.setObjectName(_fromUtf8("proName")) | |
|
73 | self.gridLayout_2.addWidget(self.proName, 0, 1, 1, 8) | |
|
74 | self.label_11 = QtGui.QLabel(self.frame) | |
|
75 | self.label_11.setObjectName(_fromUtf8("label_11")) | |
|
76 | self.gridLayout_2.addWidget(self.label_11, 1, 0, 1, 1) | |
|
77 | self.proComDataType = QtGui.QComboBox(self.frame) | |
|
78 | self.proComDataType.setObjectName(_fromUtf8("proComDataType")) | |
|
79 | self.proComDataType.addItem(_fromUtf8("")) | |
|
80 | self.proComDataType.addItem(_fromUtf8("")) | |
|
81 | self.proComDataType.addItem(_fromUtf8("")) | |
|
82 | self.gridLayout_2.addWidget(self.proComDataType, 1, 1, 1, 5) | |
|
83 | self.proDataType = QtGui.QLineEdit(self.frame) | |
|
84 | self.proDataType.setObjectName(_fromUtf8("proDataType")) | |
|
85 | self.gridLayout_2.addWidget(self.proDataType, 1, 6, 1, 3) | |
|
86 | self.label_15 = QtGui.QLabel(self.frame) | |
|
87 | self.label_15.setObjectName(_fromUtf8("label_15")) | |
|
88 | self.gridLayout_2.addWidget(self.label_15, 2, 0, 1, 1) | |
|
89 | self.proToolPath = QtGui.QToolButton(self.frame) | |
|
90 | self.proToolPath.setObjectName(_fromUtf8("proToolPath")) | |
|
91 | self.gridLayout_2.addWidget(self.proToolPath, 2, 1, 1, 1) | |
|
92 | self.proDataPath = QtGui.QLineEdit(self.frame) | |
|
93 | self.proDataPath.setObjectName(_fromUtf8("proDataPath")) | |
|
94 | self.gridLayout_2.addWidget(self.proDataPath, 2, 2, 1, 7) | |
|
95 | self.label_23 = QtGui.QLabel(self.frame) | |
|
96 | self.label_23.setObjectName(_fromUtf8("label_23")) | |
|
97 | self.gridLayout_2.addWidget(self.label_23, 3, 0, 1, 1) | |
|
98 | self.proComReadMode = QtGui.QComboBox(self.frame) | |
|
99 | self.proComReadMode.setObjectName(_fromUtf8("proComReadMode")) | |
|
100 | self.proComReadMode.addItem(_fromUtf8("")) | |
|
101 | self.proComReadMode.addItem(_fromUtf8("")) | |
|
102 | self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 2) | |
|
103 | self.label_33 = QtGui.QLabel(self.frame) | |
|
104 | self.label_33.setObjectName(_fromUtf8("label_33")) | |
|
105 | self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 2) | |
|
106 | self.proDelay = QtGui.QLineEdit(self.frame) | |
|
107 | self.proDelay.setObjectName(_fromUtf8("proDelay")) | |
|
108 | self.gridLayout_2.addWidget(self.proDelay, 3, 8, 1, 1) | |
|
109 | self.label_32 = QtGui.QLabel(self.frame) | |
|
110 | self.label_32.setObjectName(_fromUtf8("label_32")) | |
|
111 | self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1) | |
|
112 | self.proComWalk = QtGui.QComboBox(self.frame) | |
|
113 | self.proComWalk.setObjectName(_fromUtf8("proComWalk")) | |
|
114 | self.proComWalk.addItem(_fromUtf8("")) | |
|
115 | self.proComWalk.addItem(_fromUtf8("")) | |
|
116 | self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 8) | |
|
117 | self.proLoadButton = QtGui.QPushButton(self.frame) | |
|
118 | self.proLoadButton.setObjectName(_fromUtf8("proLoadButton")) | |
|
119 | self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9) | |
|
120 | self.label_10 = QtGui.QLabel(self.frame) | |
|
121 | self.label_10.setObjectName(_fromUtf8("label_10")) | |
|
122 | self.gridLayout_2.addWidget(self.label_10, 3, 3, 1, 1) | |
|
123 | self.proSet = QtGui.QLineEdit(self.frame) | |
|
124 | self.proSet.setObjectName(_fromUtf8("proSet")) | |
|
125 | self.gridLayout_2.addWidget(self.proSet, 3, 4, 1, 1) | |
|
126 | self.gridLayout_15.addWidget(self.frame, 0, 0, 1, 1) | |
|
127 | self.frame_2 = QtGui.QFrame(self.tabProject) | |
|
128 | self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
129 | self.frame_2.setFrameShadow(QtGui.QFrame.Raised) | |
|
130 | self.frame_2.setObjectName(_fromUtf8("frame_2")) | |
|
131 | self.gridLayout_10 = QtGui.QGridLayout(self.frame_2) | |
|
132 | self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) | |
|
133 | self.label_27 = QtGui.QLabel(self.frame_2) | |
|
134 | self.label_27.setObjectName(_fromUtf8("label_27")) | |
|
135 | self.gridLayout_10.addWidget(self.label_27, 0, 0, 1, 1) | |
|
136 | self.proComStartDate = QtGui.QComboBox(self.frame_2) | |
|
137 | self.proComStartDate.setObjectName(_fromUtf8("proComStartDate")) | |
|
138 | self.gridLayout_10.addWidget(self.proComStartDate, 0, 1, 1, 1) | |
|
139 | self.label_28 = QtGui.QLabel(self.frame_2) | |
|
140 | self.label_28.setObjectName(_fromUtf8("label_28")) | |
|
141 | self.gridLayout_10.addWidget(self.label_28, 1, 0, 1, 1) | |
|
142 | self.proComEndDate = QtGui.QComboBox(self.frame_2) | |
|
143 | self.proComEndDate.setObjectName(_fromUtf8("proComEndDate")) | |
|
144 | self.gridLayout_10.addWidget(self.proComEndDate, 1, 1, 1, 1) | |
|
145 | self.label_2 = QtGui.QLabel(self.frame_2) | |
|
146 | self.label_2.setObjectName(_fromUtf8("label_2")) | |
|
147 | self.gridLayout_10.addWidget(self.label_2, 2, 0, 1, 1) | |
|
148 | self.proStartTime = QtGui.QTimeEdit(self.frame_2) | |
|
149 | self.proStartTime.setObjectName(_fromUtf8("proStartTime")) | |
|
150 | self.gridLayout_10.addWidget(self.proStartTime, 2, 1, 1, 1) | |
|
151 | self.label_3 = QtGui.QLabel(self.frame_2) | |
|
152 | self.label_3.setObjectName(_fromUtf8("label_3")) | |
|
153 | self.gridLayout_10.addWidget(self.label_3, 3, 0, 1, 1) | |
|
154 | self.proEndTime = QtGui.QTimeEdit(self.frame_2) | |
|
155 | self.proEndTime.setObjectName(_fromUtf8("proEndTime")) | |
|
156 | self.gridLayout_10.addWidget(self.proEndTime, 3, 1, 1, 1) | |
|
157 | self.label_30 = QtGui.QLabel(self.frame_2) | |
|
158 | self.label_30.setObjectName(_fromUtf8("label_30")) | |
|
159 | self.gridLayout_10.addWidget(self.label_30, 4, 0, 1, 1) | |
|
160 | self.proDescription = QtGui.QTextEdit(self.frame_2) | |
|
161 | self.proDescription.setObjectName(_fromUtf8("proDescription")) | |
|
162 | self.gridLayout_10.addWidget(self.proDescription, 4, 1, 1, 1) | |
|
163 | self.gridLayout_15.addWidget(self.frame_2, 1, 0, 1, 1) | |
|
164 | self.frame_3 = QtGui.QFrame(self.tabProject) | |
|
165 | self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
166 | self.frame_3.setFrameShadow(QtGui.QFrame.Raised) | |
|
167 | self.frame_3.setObjectName(_fromUtf8("frame_3")) | |
|
168 | self.gridLayout_14 = QtGui.QGridLayout(self.frame_3) | |
|
169 | self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14")) | |
|
170 | self.proOk = QtGui.QPushButton(self.frame_3) | |
|
171 | self.proOk.setObjectName(_fromUtf8("proOk")) | |
|
172 | self.gridLayout_14.addWidget(self.proOk, 0, 0, 1, 1) | |
|
173 | self.proClear = QtGui.QPushButton(self.frame_3) | |
|
174 | self.proClear.setObjectName(_fromUtf8("proClear")) | |
|
175 | self.gridLayout_14.addWidget(self.proClear, 0, 1, 1, 1) | |
|
176 | self.gridLayout_15.addWidget(self.frame_3, 2, 0, 1, 1) | |
|
177 | self.tabWidgetProject.addTab(self.tabProject, _fromUtf8("")) | |
|
178 | self.tabVoltage = QtGui.QWidget() | |
|
179 | self.tabVoltage.setObjectName(_fromUtf8("tabVoltage")) | |
|
180 | self.gridLayout_3 = QtGui.QGridLayout(self.tabVoltage) | |
|
181 | self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) | |
|
182 | self.frame_4 = QtGui.QFrame(self.tabVoltage) | |
|
183 | self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
184 | self.frame_4.setFrameShadow(QtGui.QFrame.Raised) | |
|
185 | self.frame_4.setObjectName(_fromUtf8("frame_4")) | |
|
186 | self.gridLayout_17 = QtGui.QGridLayout(self.frame_4) | |
|
187 | self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) | |
|
188 | self.volOpOk = QtGui.QPushButton(self.frame_4) | |
|
189 | self.volOpOk.setObjectName(_fromUtf8("volOpOk")) | |
|
190 | self.gridLayout_17.addWidget(self.volOpOk, 0, 0, 1, 1) | |
|
191 | self.volGraphClear = QtGui.QPushButton(self.frame_4) | |
|
192 | self.volGraphClear.setObjectName(_fromUtf8("volGraphClear")) | |
|
193 | self.gridLayout_17.addWidget(self.volGraphClear, 0, 1, 1, 1) | |
|
194 | self.gridLayout_3.addWidget(self.frame_4, 1, 1, 1, 1) | |
|
195 | self.tabWidgetVoltage = QtGui.QTabWidget(self.tabVoltage) | |
|
196 | self.tabWidgetVoltage.setObjectName(_fromUtf8("tabWidgetVoltage")) | |
|
197 | self.tabopVoltage = QtGui.QWidget() | |
|
198 | self.tabopVoltage.setObjectName(_fromUtf8("tabopVoltage")) | |
|
199 | self.gridLayout = QtGui.QGridLayout(self.tabopVoltage) | |
|
200 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) | |
|
201 | self.volOpHeights = QtGui.QLineEdit(self.tabopVoltage) | |
|
202 | self.volOpHeights.setObjectName(_fromUtf8("volOpHeights")) | |
|
203 | self.gridLayout.addWidget(self.volOpHeights, 4, 4, 1, 1) | |
|
204 | self.volOpComHeights = QtGui.QComboBox(self.tabopVoltage) | |
|
205 | self.volOpComHeights.setObjectName(_fromUtf8("volOpComHeights")) | |
|
206 | self.volOpComHeights.addItem(_fromUtf8("")) | |
|
207 | self.volOpComHeights.addItem(_fromUtf8("")) | |
|
208 | self.gridLayout.addWidget(self.volOpComHeights, 4, 0, 1, 3) | |
|
209 | self.volOpComChannels = QtGui.QComboBox(self.tabopVoltage) | |
|
210 | self.volOpComChannels.setObjectName(_fromUtf8("volOpComChannels")) | |
|
211 | self.volOpComChannels.addItem(_fromUtf8("")) | |
|
212 | self.volOpComChannels.addItem(_fromUtf8("")) | |
|
213 | self.gridLayout.addWidget(self.volOpComChannels, 2, 0, 1, 3) | |
|
214 | self.volOpCebProfile = QtGui.QCheckBox(self.tabopVoltage) | |
|
215 | self.volOpCebProfile.setObjectName(_fromUtf8("volOpCebProfile")) | |
|
216 | self.gridLayout.addWidget(self.volOpCebProfile, 6, 0, 1, 3) | |
|
217 | self.volOpComProfile = QtGui.QComboBox(self.tabopVoltage) | |
|
218 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) | |
|
219 | self.volOpComProfile.addItem(_fromUtf8("")) | |
|
220 | self.volOpComProfile.addItem(_fromUtf8("")) | |
|
221 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) | |
|
222 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) | |
|
223 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) | |
|
224 | self.gridLayout.addWidget(self.volOpCebDecodification, 8, 0, 1, 3) | |
|
225 | self.volOpCebCohInt = QtGui.QCheckBox(self.tabopVoltage) | |
|
226 | self.volOpCebCohInt.setObjectName(_fromUtf8("volOpCebCohInt")) | |
|
227 | self.gridLayout.addWidget(self.volOpCebCohInt, 11, 0, 1, 3) | |
|
228 | self.volOpProfile = QtGui.QLineEdit(self.tabopVoltage) | |
|
229 | self.volOpProfile.setObjectName(_fromUtf8("volOpProfile")) | |
|
230 | self.gridLayout.addWidget(self.volOpProfile, 7, 4, 1, 1) | |
|
231 | self.volOpFilter = QtGui.QLineEdit(self.tabopVoltage) | |
|
232 | self.volOpFilter.setObjectName(_fromUtf8("volOpFilter")) | |
|
233 | self.gridLayout.addWidget(self.volOpFilter, 5, 4, 1, 1) | |
|
234 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
235 | self.gridLayout.addItem(spacerItem, 6, 4, 1, 1) | |
|
236 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
237 | self.gridLayout.addItem(spacerItem1, 8, 4, 1, 1) | |
|
238 | spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
239 | self.gridLayout.addItem(spacerItem2, 3, 4, 1, 1) | |
|
240 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) | |
|
241 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) | |
|
242 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) | |
|
243 | self.label_4 = QtGui.QLabel(self.tabopVoltage) | |
|
244 | self.label_4.setObjectName(_fromUtf8("label_4")) | |
|
245 | self.gridLayout.addWidget(self.label_4, 9, 2, 1, 1) | |
|
246 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) | |
|
247 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) | |
|
248 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) | |
|
249 | self.volOpCebHeights = QtGui.QCheckBox(self.tabopVoltage) | |
|
250 | self.volOpCebHeights.setObjectName(_fromUtf8("volOpCebHeights")) | |
|
251 | self.gridLayout.addWidget(self.volOpCebHeights, 3, 0, 1, 3) | |
|
252 | self.volOpCebFilter = QtGui.QCheckBox(self.tabopVoltage) | |
|
253 | self.volOpCebFilter.setObjectName(_fromUtf8("volOpCebFilter")) | |
|
254 | self.gridLayout.addWidget(self.volOpCebFilter, 5, 0, 1, 3) | |
|
255 | self.volOpRadarfrequency = QtGui.QLineEdit(self.tabopVoltage) | |
|
256 | self.volOpRadarfrequency.setObjectName(_fromUtf8("volOpRadarfrequency")) | |
|
257 | self.gridLayout.addWidget(self.volOpRadarfrequency, 0, 4, 1, 1) | |
|
258 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) | |
|
259 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) | |
|
260 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) | |
|
261 | self.label_5 = QtGui.QLabel(self.tabopVoltage) | |
|
262 | self.label_5.setObjectName(_fromUtf8("label_5")) | |
|
263 | self.gridLayout.addWidget(self.label_5, 10, 2, 1, 1) | |
|
264 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
265 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) | |
|
266 | self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage) | |
|
267 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) | |
|
268 | self.gridLayout.addWidget(self.volOpCohInt, 11, 4, 1, 1) | |
|
269 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) | |
|
270 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) | |
|
271 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
272 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
273 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
274 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
275 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
276 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
277 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
278 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
279 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
280 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
281 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
282 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
283 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
284 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) | |
|
285 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) | |
|
286 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) | |
|
287 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
288 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
289 | self.gridLayout.addWidget(self.volOpComMode, 10, 4, 1, 1) | |
|
290 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) | |
|
291 | self.tabgraphVoltage = QtGui.QWidget() | |
|
292 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) | |
|
293 | self.gridLayout_6 = QtGui.QGridLayout(self.tabgraphVoltage) | |
|
294 | self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) | |
|
295 | spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
296 | self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) | |
|
297 | self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
298 | self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) | |
|
299 | self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) | |
|
300 | self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
301 | self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) | |
|
302 | self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) | |
|
303 | self.volGraphToolPath = QtGui.QToolButton(self.tabgraphVoltage) | |
|
304 | self.volGraphToolPath.setObjectName(_fromUtf8("volGraphToolPath")) | |
|
305 | self.gridLayout_6.addWidget(self.volGraphToolPath, 1, 5, 1, 2) | |
|
306 | self.volGraphPath = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
307 | self.volGraphPath.setObjectName(_fromUtf8("volGraphPath")) | |
|
308 | self.gridLayout_6.addWidget(self.volGraphPath, 1, 1, 1, 4) | |
|
309 | self.label_14 = QtGui.QLabel(self.tabgraphVoltage) | |
|
310 | self.label_14.setObjectName(_fromUtf8("label_14")) | |
|
311 | self.gridLayout_6.addWidget(self.label_14, 6, 0, 1, 1) | |
|
312 | spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
313 | self.gridLayout_6.addItem(spacerItem5, 3, 3, 1, 1) | |
|
314 | self.label_8 = QtGui.QLabel(self.tabgraphVoltage) | |
|
315 | self.label_8.setObjectName(_fromUtf8("label_8")) | |
|
316 | self.gridLayout_6.addWidget(self.label_8, 8, 0, 1, 1) | |
|
317 | self.label_49 = QtGui.QLabel(self.tabgraphVoltage) | |
|
318 | self.label_49.setObjectName(_fromUtf8("label_49")) | |
|
319 | self.gridLayout_6.addWidget(self.label_49, 4, 3, 1, 1) | |
|
320 | self.label_51 = QtGui.QLabel(self.tabgraphVoltage) | |
|
321 | self.label_51.setObjectName(_fromUtf8("label_51")) | |
|
322 | self.gridLayout_6.addWidget(self.label_51, 9, 0, 1, 1) | |
|
323 | self.volGraphCebshow = QtGui.QCheckBox(self.tabgraphVoltage) | |
|
324 | self.volGraphCebshow.setText(_fromUtf8("")) | |
|
325 | self.volGraphCebshow.setObjectName(_fromUtf8("volGraphCebshow")) | |
|
326 | self.gridLayout_6.addWidget(self.volGraphCebshow, 6, 3, 1, 1) | |
|
327 | self.label_12 = QtGui.QLabel(self.tabgraphVoltage) | |
|
328 | self.label_12.setObjectName(_fromUtf8("label_12")) | |
|
329 | self.gridLayout_6.addWidget(self.label_12, 1, 0, 1, 1) | |
|
330 | self.label_13 = QtGui.QLabel(self.tabgraphVoltage) | |
|
331 | self.label_13.setObjectName(_fromUtf8("label_13")) | |
|
332 | self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) | |
|
333 | self.label_52 = QtGui.QLabel(self.tabgraphVoltage) | |
|
334 | self.label_52.setObjectName(_fromUtf8("label_52")) | |
|
335 | self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) | |
|
336 | spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
337 | self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) | |
|
338 | spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
339 | self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) | |
|
340 | self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
341 | self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) | |
|
342 | self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) | |
|
343 | self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) | |
|
344 | self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) | |
|
345 | self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) | |
|
346 | self.label_50 = QtGui.QLabel(self.tabgraphVoltage) | |
|
347 | self.label_50.setObjectName(_fromUtf8("label_50")) | |
|
348 | self.gridLayout_6.addWidget(self.label_50, 4, 4, 1, 1) | |
|
349 | self.volGraphCebSave = QtGui.QCheckBox(self.tabgraphVoltage) | |
|
350 | self.volGraphCebSave.setText(_fromUtf8("")) | |
|
351 | self.volGraphCebSave.setObjectName(_fromUtf8("volGraphCebSave")) | |
|
352 | self.gridLayout_6.addWidget(self.volGraphCebSave, 6, 4, 1, 1) | |
|
353 | self.tabWidgetVoltage.addTab(self.tabgraphVoltage, _fromUtf8("")) | |
|
354 | self.taboutputVoltage = QtGui.QWidget() | |
|
355 | self.taboutputVoltage.setObjectName(_fromUtf8("taboutputVoltage")) | |
|
356 | self.gridLayout_12 = QtGui.QGridLayout(self.taboutputVoltage) | |
|
357 | self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) | |
|
358 | self.label_36 = QtGui.QLabel(self.taboutputVoltage) | |
|
359 | self.label_36.setObjectName(_fromUtf8("label_36")) | |
|
360 | self.gridLayout_12.addWidget(self.label_36, 0, 0, 1, 1) | |
|
361 | self.label_37 = QtGui.QLabel(self.taboutputVoltage) | |
|
362 | self.label_37.setObjectName(_fromUtf8("label_37")) | |
|
363 | self.gridLayout_12.addWidget(self.label_37, 1, 0, 1, 1) | |
|
364 | self.volOutputPath = QtGui.QLineEdit(self.taboutputVoltage) | |
|
365 | self.volOutputPath.setObjectName(_fromUtf8("volOutputPath")) | |
|
366 | self.gridLayout_12.addWidget(self.volOutputPath, 1, 2, 1, 1) | |
|
367 | self.volOutputToolPath = QtGui.QToolButton(self.taboutputVoltage) | |
|
368 | self.volOutputToolPath.setObjectName(_fromUtf8("volOutputToolPath")) | |
|
369 | self.gridLayout_12.addWidget(self.volOutputToolPath, 1, 3, 1, 1) | |
|
370 | self.volOutputComData = QtGui.QComboBox(self.taboutputVoltage) | |
|
371 | self.volOutputComData.setObjectName(_fromUtf8("volOutputComData")) | |
|
372 | self.volOutputComData.addItem(_fromUtf8("")) | |
|
373 | self.gridLayout_12.addWidget(self.volOutputComData, 0, 2, 1, 2) | |
|
374 | spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
375 | self.gridLayout_12.addItem(spacerItem8, 5, 2, 1, 1) | |
|
376 | self.volOutputblocksperfile = QtGui.QLineEdit(self.taboutputVoltage) | |
|
377 | self.volOutputblocksperfile.setObjectName(_fromUtf8("volOutputblocksperfile")) | |
|
378 | self.gridLayout_12.addWidget(self.volOutputblocksperfile, 3, 2, 1, 1) | |
|
379 | self.label_7 = QtGui.QLabel(self.taboutputVoltage) | |
|
380 | self.label_7.setObjectName(_fromUtf8("label_7")) | |
|
381 | self.gridLayout_12.addWidget(self.label_7, 3, 0, 1, 1) | |
|
382 | self.label_35 = QtGui.QLabel(self.taboutputVoltage) | |
|
383 | self.label_35.setObjectName(_fromUtf8("label_35")) | |
|
384 | self.gridLayout_12.addWidget(self.label_35, 4, 0, 1, 1) | |
|
385 | self.volOutputprofilesperblock = QtGui.QLineEdit(self.taboutputVoltage) | |
|
386 | self.volOutputprofilesperblock.setObjectName(_fromUtf8("volOutputprofilesperblock")) | |
|
387 | self.gridLayout_12.addWidget(self.volOutputprofilesperblock, 4, 2, 1, 1) | |
|
388 | self.tabWidgetVoltage.addTab(self.taboutputVoltage, _fromUtf8("")) | |
|
389 | self.gridLayout_3.addWidget(self.tabWidgetVoltage, 0, 1, 1, 1) | |
|
390 | self.tabWidgetProject.addTab(self.tabVoltage, _fromUtf8("")) | |
|
391 | self.tabSpectra = QtGui.QWidget() | |
|
392 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) | |
|
393 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) | |
|
394 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) | |
|
395 | self.frame_5 = QtGui.QFrame(self.tabSpectra) | |
|
396 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
397 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) | |
|
398 | self.frame_5.setObjectName(_fromUtf8("frame_5")) | |
|
399 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) | |
|
400 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) | |
|
401 | self.specOpOk = QtGui.QPushButton(self.frame_5) | |
|
402 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) | |
|
403 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) | |
|
404 | self.specGraphClear = QtGui.QPushButton(self.frame_5) | |
|
405 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) | |
|
406 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) | |
|
407 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) | |
|
408 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) | |
|
409 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) | |
|
410 | self.tabopSpectra = QtGui.QWidget() | |
|
411 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) | |
|
412 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) | |
|
413 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) | |
|
414 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) | |
|
415 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) | |
|
416 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2) | |
|
417 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) | |
|
418 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) | |
|
419 | self.specOpComChannel.addItem(_fromUtf8("")) | |
|
420 | self.specOpComChannel.addItem(_fromUtf8("")) | |
|
421 | self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2) | |
|
422 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) | |
|
423 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) | |
|
424 | self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2) | |
|
425 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) | |
|
426 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) | |
|
427 | self.specOpComHeights.addItem(_fromUtf8("")) | |
|
428 | self.specOpComHeights.addItem(_fromUtf8("")) | |
|
429 | self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2) | |
|
430 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) | |
|
431 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) | |
|
432 | self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2) | |
|
433 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) | |
|
434 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) | |
|
435 | self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2) | |
|
436 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) | |
|
437 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) | |
|
438 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2) | |
|
439 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) | |
|
440 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) | |
|
441 | self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1) | |
|
442 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) | |
|
443 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) | |
|
444 | self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1) | |
|
445 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) | |
|
446 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) | |
|
447 | self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2) | |
|
448 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) | |
|
449 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) | |
|
450 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2) | |
|
451 | self.label_31 = QtGui.QLabel(self.tabopSpectra) | |
|
452 | self.label_31.setObjectName(_fromUtf8("label_31")) | |
|
453 | self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2) | |
|
454 | self.label_26 = QtGui.QLabel(self.tabopSpectra) | |
|
455 | self.label_26.setObjectName(_fromUtf8("label_26")) | |
|
456 | self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2) | |
|
457 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) | |
|
458 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) | |
|
459 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1) | |
|
460 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) | |
|
461 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) | |
|
462 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
|
463 | self.specOpCobIncInt.addItem(_fromUtf8("")) | |
|
464 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2) | |
|
465 | spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
466 | self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) | |
|
467 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) | |
|
468 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) | |
|
469 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2) | |
|
470 | spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
471 | self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) | |
|
472 | spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
473 | self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) | |
|
474 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) | |
|
475 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) | |
|
476 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) | |
|
477 | spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
478 | self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) | |
|
479 | self.label_21 = QtGui.QLabel(self.tabopSpectra) | |
|
480 | self.label_21.setObjectName(_fromUtf8("label_21")) | |
|
481 | self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) | |
|
482 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) | |
|
483 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) | |
|
484 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2) | |
|
485 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) | |
|
486 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) | |
|
487 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) | |
|
488 | spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
489 | self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) | |
|
490 | self.label_70 = QtGui.QLabel(self.tabopSpectra) | |
|
491 | self.label_70.setObjectName(_fromUtf8("label_70")) | |
|
492 | self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) | |
|
493 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) | |
|
494 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) | |
|
495 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1) | |
|
496 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) | |
|
497 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) | |
|
498 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2) | |
|
499 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) | |
|
500 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) | |
|
501 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
|
502 | self.specOpComRemoveDC.addItem(_fromUtf8("")) | |
|
503 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2) | |
|
504 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) | |
|
505 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) | |
|
506 | self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) | |
|
507 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) | |
|
508 | self.tabgraphSpectra = QtGui.QWidget() | |
|
509 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) | |
|
510 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) | |
|
511 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) | |
|
512 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) | |
|
513 | self.label_44.setObjectName(_fromUtf8("label_44")) | |
|
514 | self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) | |
|
515 | spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
516 | self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) | |
|
517 | self.label_20 = QtGui.QLabel(self.tabgraphSpectra) | |
|
518 | self.label_20.setObjectName(_fromUtf8("label_20")) | |
|
519 | self.gridLayout_9.addWidget(self.label_20, 21, 0, 1, 1) | |
|
520 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
521 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) | |
|
522 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) | |
|
523 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 4, 1, 1) | |
|
524 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
525 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) | |
|
526 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, 20, 1, 1, 7) | |
|
527 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
528 | self.specGraphSaveSpectra.setText(_fromUtf8("")) | |
|
529 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) | |
|
530 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 4, 1, 1) | |
|
531 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
532 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) | |
|
533 | self.gridLayout_9.addWidget(self.specGgraphChannelList, 15, 1, 1, 7) | |
|
534 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) | |
|
535 | self.label_25.setObjectName(_fromUtf8("label_25")) | |
|
536 | self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) | |
|
537 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
538 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) | |
|
539 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, 21, 1, 1, 7) | |
|
540 | spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
541 | self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) | |
|
542 | spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
543 | self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) | |
|
544 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) | |
|
545 | self.label_42.setObjectName(_fromUtf8("label_42")) | |
|
546 | self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) | |
|
547 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) | |
|
548 | self.label_16.setObjectName(_fromUtf8("label_16")) | |
|
549 | self.gridLayout_9.addWidget(self.label_16, 18, 0, 1, 1) | |
|
550 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) | |
|
551 | self.label_17.setObjectName(_fromUtf8("label_17")) | |
|
552 | self.gridLayout_9.addWidget(self.label_17, 19, 0, 1, 1) | |
|
553 | self.label_18 = QtGui.QLabel(self.tabgraphSpectra) | |
|
554 | self.label_18.setObjectName(_fromUtf8("label_18")) | |
|
555 | self.gridLayout_9.addWidget(self.label_18, 20, 0, 1, 1) | |
|
556 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
557 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) | |
|
558 | self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 1, 1, 7) | |
|
559 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
560 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) | |
|
561 | self.gridLayout_9.addWidget(self.specGgraphHeight, 18, 1, 1, 7) | |
|
562 | spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
563 | self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) | |
|
564 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) | |
|
565 | self.label_24.setObjectName(_fromUtf8("label_24")) | |
|
566 | self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) | |
|
567 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
568 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) | |
|
569 | self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) | |
|
570 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
571 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) | |
|
572 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, 19, 1, 1, 7) | |
|
573 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) | |
|
574 | self.label_46.setObjectName(_fromUtf8("label_46")) | |
|
575 | self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) | |
|
576 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) | |
|
577 | self.label_22.setObjectName(_fromUtf8("label_22")) | |
|
578 | self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) | |
|
579 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
580 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) | |
|
581 | self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) | |
|
582 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) | |
|
583 | self.label_41.setObjectName(_fromUtf8("label_41")) | |
|
584 | self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) | |
|
585 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) | |
|
586 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) | |
|
587 | self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) | |
|
588 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) | |
|
589 | self.label_6.setObjectName(_fromUtf8("label_6")) | |
|
590 | self.gridLayout_9.addWidget(self.label_6, 15, 0, 1, 1) | |
|
591 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) | |
|
592 | self.label_40.setObjectName(_fromUtf8("label_40")) | |
|
593 | self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) | |
|
594 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
595 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) | |
|
596 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) | |
|
597 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 2, 1, 1) | |
|
598 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
599 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) | |
|
600 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) | |
|
601 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 2, 1, 1) | |
|
602 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
603 | self.specGraphCebRTIplot.setText(_fromUtf8("")) | |
|
604 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) | |
|
605 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 2, 1, 1) | |
|
606 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
607 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) | |
|
608 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) | |
|
609 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 2, 1, 1) | |
|
610 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
611 | self.specGraphPowerprofile.setText(_fromUtf8("")) | |
|
612 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) | |
|
613 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 2, 1, 1) | |
|
614 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
615 | self.specGraphSaveCross.setText(_fromUtf8("")) | |
|
616 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) | |
|
617 | self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 4, 1, 1) | |
|
618 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
619 | self.specGraphftpSpectra.setText(_fromUtf8("")) | |
|
620 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) | |
|
621 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 6, 1, 1) | |
|
622 | spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
623 | self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) | |
|
624 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
625 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) | |
|
626 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) | |
|
627 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 4, 1, 1) | |
|
628 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
629 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) | |
|
630 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) | |
|
631 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 4, 1, 1) | |
|
632 | spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
633 | self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) | |
|
634 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
635 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) | |
|
636 | self.gridLayout_9.addWidget(self.specGgraphftpratio, 23, 1, 1, 7) | |
|
637 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) | |
|
638 | self.label_43.setObjectName(_fromUtf8("label_43")) | |
|
639 | self.gridLayout_9.addWidget(self.label_43, 3, 2, 2, 1) | |
|
640 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
641 | self.specGraphftpCross.setText(_fromUtf8("")) | |
|
642 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) | |
|
643 | self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 6, 1, 1) | |
|
644 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) | |
|
645 | self.label_29.setObjectName(_fromUtf8("label_29")) | |
|
646 | self.gridLayout_9.addWidget(self.label_29, 23, 0, 1, 1) | |
|
647 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) | |
|
648 | self.label_47.setObjectName(_fromUtf8("label_47")) | |
|
649 | self.gridLayout_9.addWidget(self.label_47, 3, 4, 2, 1) | |
|
650 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
651 | self.specGraphftpRTIplot.setText(_fromUtf8("")) | |
|
652 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) | |
|
653 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 6, 1, 1) | |
|
654 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
655 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) | |
|
656 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) | |
|
657 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 6, 1, 1) | |
|
658 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
659 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) | |
|
660 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) | |
|
661 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 6, 1, 1) | |
|
662 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) | |
|
663 | self.label_19.setObjectName(_fromUtf8("label_19")) | |
|
664 | self.gridLayout_9.addWidget(self.label_19, 3, 6, 2, 2) | |
|
665 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
666 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) | |
|
667 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) | |
|
668 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 4, 1, 1) | |
|
669 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) | |
|
670 | self.label_45.setObjectName(_fromUtf8("label_45")) | |
|
671 | self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) | |
|
672 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
673 | self.specGraphftpRTInoise.setText(_fromUtf8("")) | |
|
674 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) | |
|
675 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 6, 1, 1) | |
|
676 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) | |
|
677 | self.specGraphCebRTInoise.setText(_fromUtf8("")) | |
|
678 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) | |
|
679 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 2, 1, 1) | |
|
680 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) | |
|
681 | self.label_48.setObjectName(_fromUtf8("label_48")) | |
|
682 | self.gridLayout_9.addWidget(self.label_48, 22, 0, 1, 1) | |
|
683 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) | |
|
684 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) | |
|
685 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, 22, 1, 1, 7) | |
|
686 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) | |
|
687 | self.taboutputSpectra = QtGui.QWidget() | |
|
688 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) | |
|
689 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) | |
|
690 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) | |
|
691 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) | |
|
692 | self.label_39.setObjectName(_fromUtf8("label_39")) | |
|
693 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) | |
|
694 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) | |
|
695 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) | |
|
696 | self.specOutputComData.addItem(_fromUtf8("")) | |
|
697 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) | |
|
698 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) | |
|
699 | self.label_34.setObjectName(_fromUtf8("label_34")) | |
|
700 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) | |
|
701 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) | |
|
702 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) | |
|
703 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) | |
|
704 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
705 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) | |
|
706 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) | |
|
707 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) | |
|
708 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) | |
|
709 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) | |
|
710 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) | |
|
711 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) | |
|
712 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) | |
|
713 | self.label_9.setObjectName(_fromUtf8("label_9")) | |
|
714 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) | |
|
715 | self.label_38 = QtGui.QLabel(self.taboutputSpectra) | |
|
716 | self.label_38.setObjectName(_fromUtf8("label_38")) | |
|
717 | self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) | |
|
718 | self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) | |
|
719 | self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) | |
|
720 | self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) | |
|
721 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) | |
|
722 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) | |
|
723 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) | |
|
724 | self.tabSpectraHeis = QtGui.QWidget() | |
|
725 | self.tabSpectraHeis.setObjectName(_fromUtf8("tabSpectraHeis")) | |
|
726 | self.gridLayout_23 = QtGui.QGridLayout(self.tabSpectraHeis) | |
|
727 | self.gridLayout_23.setObjectName(_fromUtf8("gridLayout_23")) | |
|
728 | self.frame_6 = QtGui.QFrame(self.tabSpectraHeis) | |
|
729 | self.frame_6.setFrameShape(QtGui.QFrame.StyledPanel) | |
|
730 | self.frame_6.setFrameShadow(QtGui.QFrame.Raised) | |
|
731 | self.frame_6.setObjectName(_fromUtf8("frame_6")) | |
|
732 | self.gridLayout_22 = QtGui.QGridLayout(self.frame_6) | |
|
733 | self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) | |
|
734 | self.specHeisGraphClear = QtGui.QPushButton(self.frame_6) | |
|
735 | self.specHeisGraphClear.setObjectName(_fromUtf8("specHeisGraphClear")) | |
|
736 | self.gridLayout_22.addWidget(self.specHeisGraphClear, 0, 1, 1, 1) | |
|
737 | self.specHeisOpOk = QtGui.QPushButton(self.frame_6) | |
|
738 | self.specHeisOpOk.setObjectName(_fromUtf8("specHeisOpOk")) | |
|
739 | self.gridLayout_22.addWidget(self.specHeisOpOk, 0, 0, 1, 1) | |
|
740 | self.gridLayout_23.addWidget(self.frame_6, 1, 0, 1, 1) | |
|
741 | self.tabWidgetSpectraHeis = QtGui.QTabWidget(self.tabSpectraHeis) | |
|
742 | self.tabWidgetSpectraHeis.setObjectName(_fromUtf8("tabWidgetSpectraHeis")) | |
|
743 | self.tabopSpectraHeis = QtGui.QWidget() | |
|
744 | self.tabopSpectraHeis.setObjectName(_fromUtf8("tabopSpectraHeis")) | |
|
745 | self.gridLayout_21 = QtGui.QGridLayout(self.tabopSpectraHeis) | |
|
746 | self.gridLayout_21.setObjectName(_fromUtf8("gridLayout_21")) | |
|
747 | spacerItem21 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
748 | self.gridLayout_21.addItem(spacerItem21, 0, 1, 1, 1) | |
|
749 | self.specHeisOpCobIncInt = QtGui.QComboBox(self.tabopSpectraHeis) | |
|
750 | self.specHeisOpCobIncInt.setObjectName(_fromUtf8("specHeisOpCobIncInt")) | |
|
751 | self.specHeisOpCobIncInt.addItem(_fromUtf8("")) | |
|
752 | self.gridLayout_21.addWidget(self.specHeisOpCobIncInt, 1, 0, 1, 1) | |
|
753 | self.specHeisOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectraHeis) | |
|
754 | self.specHeisOpCebIncoherent.setObjectName(_fromUtf8("specHeisOpCebIncoherent")) | |
|
755 | self.gridLayout_21.addWidget(self.specHeisOpCebIncoherent, 0, 0, 1, 1) | |
|
756 | self.specHeisOpIncoherent = QtGui.QLineEdit(self.tabopSpectraHeis) | |
|
757 | self.specHeisOpIncoherent.setObjectName(_fromUtf8("specHeisOpIncoherent")) | |
|
758 | self.gridLayout_21.addWidget(self.specHeisOpIncoherent, 1, 1, 1, 1) | |
|
759 | spacerItem22 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
760 | self.gridLayout_21.addItem(spacerItem22, 2, 0, 1, 1) | |
|
761 | self.tabWidgetSpectraHeis.addTab(self.tabopSpectraHeis, _fromUtf8("")) | |
|
762 | self.tabgraphSpectraHeis = QtGui.QWidget() | |
|
763 | self.tabgraphSpectraHeis.setObjectName(_fromUtf8("tabgraphSpectraHeis")) | |
|
764 | self.gridLayout_20 = QtGui.QGridLayout(self.tabgraphSpectraHeis) | |
|
765 | self.gridLayout_20.setObjectName(_fromUtf8("gridLayout_20")) | |
|
766 | self.label_54 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
767 | self.label_54.setObjectName(_fromUtf8("label_54")) | |
|
768 | self.gridLayout_20.addWidget(self.label_54, 1, 0, 1, 1) | |
|
769 | self.specHeisGraphToolPath = QtGui.QToolButton(self.tabgraphSpectraHeis) | |
|
770 | self.specHeisGraphToolPath.setObjectName(_fromUtf8("specHeisGraphToolPath")) | |
|
771 | self.gridLayout_20.addWidget(self.specHeisGraphToolPath, 0, 6, 1, 1) | |
|
772 | self.specHeisGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
773 | self.specHeisGraphCebRTIplot.setText(_fromUtf8("")) | |
|
774 | self.specHeisGraphCebRTIplot.setObjectName(_fromUtf8("specHeisGraphCebRTIplot")) | |
|
775 | self.gridLayout_20.addWidget(self.specHeisGraphCebRTIplot, 4, 2, 1, 1) | |
|
776 | self.label_62 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
777 | self.label_62.setObjectName(_fromUtf8("label_62")) | |
|
778 | self.gridLayout_20.addWidget(self.label_62, 7, 0, 1, 1) | |
|
779 | self.label_63 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
780 | self.label_63.setObjectName(_fromUtf8("label_63")) | |
|
781 | self.gridLayout_20.addWidget(self.label_63, 8, 0, 1, 1) | |
|
782 | self.label_64 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
783 | self.label_64.setObjectName(_fromUtf8("label_64")) | |
|
784 | self.gridLayout_20.addWidget(self.label_64, 9, 0, 1, 1) | |
|
785 | self.label_65 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
786 | self.label_65.setObjectName(_fromUtf8("label_65")) | |
|
787 | self.gridLayout_20.addWidget(self.label_65, 10, 0, 1, 1) | |
|
788 | spacerItem23 = QtGui.QSpacerItem(134, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
789 | self.gridLayout_20.addItem(spacerItem23, 11, 0, 1, 2) | |
|
790 | self.specHeisGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
791 | self.specHeisGgraphftpratio.setObjectName(_fromUtf8("specHeisGgraphftpratio")) | |
|
792 | self.gridLayout_20.addWidget(self.specHeisGgraphftpratio, 10, 1, 1, 6) | |
|
793 | self.specHeisGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
794 | self.specHeisGraphftpRTIplot.setText(_fromUtf8("")) | |
|
795 | self.specHeisGraphftpRTIplot.setObjectName(_fromUtf8("specHeisGraphftpRTIplot")) | |
|
796 | self.gridLayout_20.addWidget(self.specHeisGraphftpRTIplot, 4, 6, 1, 1) | |
|
797 | self.specHeisGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
798 | self.specHeisGgraphTminTmax.setObjectName(_fromUtf8("specHeisGgraphTminTmax")) | |
|
799 | self.gridLayout_20.addWidget(self.specHeisGgraphTminTmax, 8, 1, 1, 6) | |
|
800 | self.label_60 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
801 | self.label_60.setObjectName(_fromUtf8("label_60")) | |
|
802 | self.gridLayout_20.addWidget(self.label_60, 5, 0, 1, 1) | |
|
803 | self.label_61 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
804 | self.label_61.setObjectName(_fromUtf8("label_61")) | |
|
805 | self.gridLayout_20.addWidget(self.label_61, 6, 0, 1, 1) | |
|
806 | self.specHeisGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
807 | self.specHeisGraphPrefix.setObjectName(_fromUtf8("specHeisGraphPrefix")) | |
|
808 | self.gridLayout_20.addWidget(self.specHeisGraphPrefix, 1, 1, 1, 6) | |
|
809 | self.label_56 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
810 | self.label_56.setObjectName(_fromUtf8("label_56")) | |
|
811 | self.gridLayout_20.addWidget(self.label_56, 2, 4, 1, 1) | |
|
812 | self.label_57 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
813 | self.label_57.setObjectName(_fromUtf8("label_57")) | |
|
814 | self.gridLayout_20.addWidget(self.label_57, 2, 6, 1, 1) | |
|
815 | self.label_58 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
816 | self.label_58.setObjectName(_fromUtf8("label_58")) | |
|
817 | self.gridLayout_20.addWidget(self.label_58, 3, 0, 1, 1) | |
|
818 | self.specHeisGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
819 | self.specHeisGraphCebSpectraplot.setText(_fromUtf8("")) | |
|
820 | self.specHeisGraphCebSpectraplot.setObjectName(_fromUtf8("specHeisGraphCebSpectraplot")) | |
|
821 | self.gridLayout_20.addWidget(self.specHeisGraphCebSpectraplot, 3, 2, 1, 1) | |
|
822 | self.specHeisGgraphYminYmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
823 | self.specHeisGgraphYminYmax.setObjectName(_fromUtf8("specHeisGgraphYminYmax")) | |
|
824 | self.gridLayout_20.addWidget(self.specHeisGgraphYminYmax, 7, 1, 1, 6) | |
|
825 | self.label_53 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
826 | self.label_53.setObjectName(_fromUtf8("label_53")) | |
|
827 | self.gridLayout_20.addWidget(self.label_53, 0, 0, 1, 1) | |
|
828 | self.label_55 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
829 | self.label_55.setObjectName(_fromUtf8("label_55")) | |
|
830 | self.gridLayout_20.addWidget(self.label_55, 2, 2, 1, 1) | |
|
831 | self.specHeisGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
832 | self.specHeisGraphSaveRTIplot.setText(_fromUtf8("")) | |
|
833 | self.specHeisGraphSaveRTIplot.setObjectName(_fromUtf8("specHeisGraphSaveRTIplot")) | |
|
834 | self.gridLayout_20.addWidget(self.specHeisGraphSaveRTIplot, 4, 4, 1, 1) | |
|
835 | spacerItem24 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
836 | self.gridLayout_20.addItem(spacerItem24, 2, 3, 1, 1) | |
|
837 | self.specHeisGgraphXminXmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
838 | self.specHeisGgraphXminXmax.setObjectName(_fromUtf8("specHeisGgraphXminXmax")) | |
|
839 | self.gridLayout_20.addWidget(self.specHeisGgraphXminXmax, 6, 1, 1, 6) | |
|
840 | self.specHeisGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
841 | self.specHeisGgraphChannelList.setObjectName(_fromUtf8("specHeisGgraphChannelList")) | |
|
842 | self.gridLayout_20.addWidget(self.specHeisGgraphChannelList, 5, 1, 1, 6) | |
|
843 | self.specHeisGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
844 | self.specHeisGgraphTimeRange.setObjectName(_fromUtf8("specHeisGgraphTimeRange")) | |
|
845 | self.gridLayout_20.addWidget(self.specHeisGgraphTimeRange, 9, 1, 1, 6) | |
|
846 | spacerItem25 = QtGui.QSpacerItem(106, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
847 | self.gridLayout_20.addItem(spacerItem25, 11, 3, 1, 3) | |
|
848 | self.specHeisGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
849 | self.specHeisGraphSaveSpectra.setText(_fromUtf8("")) | |
|
850 | self.specHeisGraphSaveSpectra.setObjectName(_fromUtf8("specHeisGraphSaveSpectra")) | |
|
851 | self.gridLayout_20.addWidget(self.specHeisGraphSaveSpectra, 3, 4, 1, 1) | |
|
852 | self.specHeisGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) | |
|
853 | self.specHeisGraphftpSpectra.setText(_fromUtf8("")) | |
|
854 | self.specHeisGraphftpSpectra.setObjectName(_fromUtf8("specHeisGraphftpSpectra")) | |
|
855 | self.gridLayout_20.addWidget(self.specHeisGraphftpSpectra, 3, 6, 1, 1) | |
|
856 | self.label_59 = QtGui.QLabel(self.tabgraphSpectraHeis) | |
|
857 | self.label_59.setObjectName(_fromUtf8("label_59")) | |
|
858 | self.gridLayout_20.addWidget(self.label_59, 4, 0, 1, 1) | |
|
859 | spacerItem26 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) | |
|
860 | self.gridLayout_20.addItem(spacerItem26, 2, 5, 1, 1) | |
|
861 | self.specHeisGraphPath = QtGui.QLineEdit(self.tabgraphSpectraHeis) | |
|
862 | self.specHeisGraphPath.setObjectName(_fromUtf8("specHeisGraphPath")) | |
|
863 | self.gridLayout_20.addWidget(self.specHeisGraphPath, 0, 1, 1, 5) | |
|
864 | self.tabWidgetSpectraHeis.addTab(self.tabgraphSpectraHeis, _fromUtf8("")) | |
|
865 | self.taboutputSpectraHeis = QtGui.QWidget() | |
|
866 | self.taboutputSpectraHeis.setObjectName(_fromUtf8("taboutputSpectraHeis")) | |
|
867 | self.gridLayout_19 = QtGui.QGridLayout(self.taboutputSpectraHeis) | |
|
868 | self.gridLayout_19.setObjectName(_fromUtf8("gridLayout_19")) | |
|
869 | self.label_67 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
870 | self.label_67.setObjectName(_fromUtf8("label_67")) | |
|
871 | self.gridLayout_19.addWidget(self.label_67, 1, 0, 1, 1) | |
|
872 | self.label_68 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
873 | self.label_68.setObjectName(_fromUtf8("label_68")) | |
|
874 | self.gridLayout_19.addWidget(self.label_68, 2, 0, 1, 2) | |
|
875 | self.label_66 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
876 | self.label_66.setObjectName(_fromUtf8("label_66")) | |
|
877 | self.gridLayout_19.addWidget(self.label_66, 0, 0, 1, 1) | |
|
878 | spacerItem27 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) | |
|
879 | self.gridLayout_19.addItem(spacerItem27, 4, 0, 1, 1) | |
|
880 | self.specHeisOutputToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) | |
|
881 | self.specHeisOutputToolPath.setObjectName(_fromUtf8("specHeisOutputToolPath")) | |
|
882 | self.gridLayout_19.addWidget(self.specHeisOutputToolPath, 1, 4, 1, 1) | |
|
883 | self.specHeisOutputPath = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
884 | self.specHeisOutputPath.setObjectName(_fromUtf8("specHeisOutputPath")) | |
|
885 | self.gridLayout_19.addWidget(self.specHeisOutputPath, 1, 3, 1, 1) | |
|
886 | self.specHeisOutputComdata = QtGui.QComboBox(self.taboutputSpectraHeis) | |
|
887 | self.specHeisOutputComdata.setObjectName(_fromUtf8("specHeisOutputComdata")) | |
|
888 | self.specHeisOutputComdata.addItem(_fromUtf8("")) | |
|
889 | self.gridLayout_19.addWidget(self.specHeisOutputComdata, 0, 3, 1, 2) | |
|
890 | self.label_69 = QtGui.QLabel(self.taboutputSpectraHeis) | |
|
891 | self.label_69.setObjectName(_fromUtf8("label_69")) | |
|
892 | self.gridLayout_19.addWidget(self.label_69, 3, 0, 1, 2) | |
|
893 | self.specHeisOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
894 | self.specHeisOutputblocksperfile.setObjectName(_fromUtf8("specHeisOutputblocksperfile")) | |
|
895 | self.gridLayout_19.addWidget(self.specHeisOutputblocksperfile, 2, 3, 1, 1) | |
|
896 | self.specHeisOutputMetada = QtGui.QLineEdit(self.taboutputSpectraHeis) | |
|
897 | self.specHeisOutputMetada.setObjectName(_fromUtf8("specHeisOutputMetada")) | |
|
898 | self.gridLayout_19.addWidget(self.specHeisOutputMetada, 3, 3, 1, 1) | |
|
899 | self.specHeisOutputMetadaToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) | |
|
900 | self.specHeisOutputMetadaToolPath.setObjectName(_fromUtf8("specHeisOutputMetadaToolPath")) | |
|
901 | self.gridLayout_19.addWidget(self.specHeisOutputMetadaToolPath, 3, 4, 1, 1) | |
|
902 | self.tabWidgetSpectraHeis.addTab(self.taboutputSpectraHeis, _fromUtf8("")) | |
|
903 | self.gridLayout_23.addWidget(self.tabWidgetSpectraHeis, 0, 0, 1, 1) | |
|
904 | self.tabWidgetProject.addTab(self.tabSpectraHeis, _fromUtf8("")) | |
|
905 | self.tabCorrelation = QtGui.QWidget() | |
|
906 | self.tabCorrelation.setObjectName(_fromUtf8("tabCorrelation")) | |
|
907 | self.gridLayout_13 = QtGui.QGridLayout(self.tabCorrelation) | |
|
908 | self.gridLayout_13.setObjectName(_fromUtf8("gridLayout_13")) | |
|
909 | self.tabWidget_2 = QtGui.QTabWidget(self.tabCorrelation) | |
|
910 | self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2")) | |
|
911 | self.tabopCorrelation = QtGui.QWidget() | |
|
912 | self.tabopCorrelation.setObjectName(_fromUtf8("tabopCorrelation")) | |
|
913 | self.tabWidget_2.addTab(self.tabopCorrelation, _fromUtf8("")) | |
|
914 | self.tabopCorrelation1 = QtGui.QWidget() | |
|
915 | self.tabopCorrelation1.setObjectName(_fromUtf8("tabopCorrelation1")) | |
|
916 | self.tabWidget_2.addTab(self.tabopCorrelation1, _fromUtf8("")) | |
|
917 | self.gridLayout_13.addWidget(self.tabWidget_2, 0, 0, 1, 1) | |
|
918 | self.tabWidgetProject.addTab(self.tabCorrelation, _fromUtf8("")) | |
|
919 | ||
|
920 | ||
|
921 | self.tabConsole = QtGui.QTabWidget(self.splitter) | |
|
922 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) | |
|
923 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) | |
|
924 | self.tab_5 = QtGui.QWidget() | |
|
925 | self.tab_5.setObjectName(_fromUtf8("tab_5")) | |
|
926 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) | |
|
927 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) | |
|
928 | self.console = QtGui.QTextEdit(self.tab_5) | |
|
929 | self.console.setObjectName(_fromUtf8("console")) | |
|
930 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) | |
|
931 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) | |
|
932 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) | |
|
933 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) | |
|
934 | self.tabProjectProperty = QtGui.QWidget() | |
|
935 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) | |
|
936 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) | |
|
937 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) | |
|
938 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) | |
|
939 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) | |
|
940 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) | |
|
941 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) | |
|
942 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) | |
|
943 | MainWindow.setCentralWidget(self.centralWidget) | |
|
944 | self.toolBar = QtGui.QToolBar(MainWindow) | |
|
945 | self.toolBar.setObjectName(_fromUtf8("toolBar")) | |
|
946 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) | |
|
947 | self.menuBar = QtGui.QMenuBar(MainWindow) | |
|
948 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) | |
|
949 | self.menuBar.setObjectName(_fromUtf8("menuBar")) | |
|
950 | self.menuProject = QtGui.QMenu(self.menuBar) | |
|
951 | self.menuProject.setObjectName(_fromUtf8("menuProject")) | |
|
952 | self.menuRun = QtGui.QMenu(self.menuBar) | |
|
953 | self.menuRun.setObjectName(_fromUtf8("menuRun")) | |
|
954 | self.menuOptions = QtGui.QMenu(self.menuBar) | |
|
955 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) | |
|
956 | self.menuHelp = QtGui.QMenu(self.menuBar) | |
|
957 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) | |
|
958 | MainWindow.setMenuBar(self.menuBar) | |
|
959 | self.actionOpen = QtGui.QAction(MainWindow) | |
|
960 | ||
|
961 | iconOpen = QtGui.QIcon() | |
|
962 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
963 | ||
|
964 | iconCreate = QtGui.QIcon() | |
|
965 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
966 | ||
|
967 | iconSave = QtGui.QIcon() | |
|
968 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
969 | ||
|
970 | iconStart = QtGui.QIcon() | |
|
971 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
972 | ||
|
973 | iconStop = QtGui.QIcon() | |
|
974 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
975 | ||
|
976 | iconPause = QtGui.QIcon() | |
|
977 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
978 | ||
|
979 | iconAddPU = QtGui.QIcon() | |
|
980 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
981 | ||
|
982 | self.actionOpen.setIcon(iconOpen) | |
|
983 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) | |
|
984 | self.actionCreate = QtGui.QAction(MainWindow) | |
|
985 | self.actionCreate.setIcon(iconCreate) | |
|
986 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) | |
|
987 | self.actionSave = QtGui.QAction(MainWindow) | |
|
988 | self.actionSave.setIcon(iconSave) | |
|
989 | self.actionSave.setObjectName(_fromUtf8("actionSave")) | |
|
990 | self.actionClose = QtGui.QAction(MainWindow) | |
|
991 | self.actionClose.setObjectName(_fromUtf8("actionClose")) | |
|
992 | self.actionStart = QtGui.QAction(MainWindow) | |
|
993 | self.actionStart.setIcon(iconStart) | |
|
994 | self.actionStart.setObjectName(_fromUtf8("actionStart")) | |
|
995 | self.actionPause = QtGui.QAction(MainWindow) | |
|
996 | self.actionPause.setIcon(iconPause) | |
|
997 | self.actionPause.setObjectName(_fromUtf8("actionPause")) | |
|
998 | self.actionStop = QtGui.QAction(MainWindow) | |
|
999 | self.actionStop.setIcon(iconStop) | |
|
1000 | self.actionStop.setObjectName(_fromUtf8("actionStop")) | |
|
1001 | self.actionAbout = QtGui.QAction(MainWindow) | |
|
1002 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) | |
|
1003 | self.actionOpenToolbar = QtGui.QAction(MainWindow) | |
|
1004 | self.actionOpenToolbar.setIcon(iconOpen) | |
|
1005 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) | |
|
1006 | self.actionCreateToolbar = QtGui.QAction(MainWindow) | |
|
1007 | self.actionCreateToolbar.setIcon(iconCreate) | |
|
1008 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) | |
|
1009 | self.actionSaveToolbar = QtGui.QAction(MainWindow) | |
|
1010 | self.actionSaveToolbar.setIcon(iconSave) | |
|
1011 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) | |
|
1012 | self.actionStarToolbar = QtGui.QAction(MainWindow) | |
|
1013 | self.actionStarToolbar.setIcon(iconStart) | |
|
1014 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) | |
|
1015 | self.actionStopToolbar = QtGui.QAction(MainWindow) | |
|
1016 | self.actionStopToolbar.setIcon(iconStop) | |
|
1017 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) | |
|
1018 | self.actionPauseToolbar = QtGui.QAction(MainWindow) | |
|
1019 | self.actionPause.setIcon(iconPause) | |
|
1020 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1021 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) | |
|
1022 | self.actionAddPU = QtGui.QAction(MainWindow) | |
|
1023 | self.actionAddPU.setIcon(iconAddPU) | |
|
1024 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) | |
|
1025 | self.actionFTP = QtGui.QAction(MainWindow) | |
|
1026 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) | |
|
1027 | self.toolBar.addAction(self.actionOpenToolbar) | |
|
1028 | self.toolBar.addSeparator() | |
|
1029 | self.toolBar.addAction(self.actionCreateToolbar) | |
|
1030 | self.toolBar.addSeparator() | |
|
1031 | self.toolBar.addAction(self.actionAddPU) | |
|
1032 | self.toolBar.addSeparator() | |
|
1033 | self.toolBar.addAction(self.actionSaveToolbar) | |
|
1034 | self.toolBar.addSeparator() | |
|
1035 | self.toolBar.addAction(self.actionStarToolbar) | |
|
1036 | self.toolBar.addSeparator() | |
|
1037 | self.toolBar.addAction(self.actionPauseToolbar) | |
|
1038 | self.toolBar.addSeparator() | |
|
1039 | self.toolBar.addAction(self.actionStopToolbar) | |
|
1040 | self.toolBar.addSeparator() | |
|
1041 | self.a=1 | |
|
1042 | self.actionPauseToolbar.triggered.connect(self.changeIcon) | |
|
1043 | ||
|
1044 | ||
|
1045 | self.menuProject.addAction(self.actionOpen) | |
|
1046 | self.menuProject.addAction(self.actionCreate) | |
|
1047 | self.menuProject.addAction(self.actionSave) | |
|
1048 | self.menuProject.addAction(self.actionClose) | |
|
1049 | self.menuRun.addAction(self.actionStart) | |
|
1050 | self.menuRun.addAction(self.actionPause) | |
|
1051 | self.menuRun.addAction(self.actionStop) | |
|
1052 | self.menuOptions.addAction(self.actionFTP) | |
|
1053 | self.menuHelp.addAction(self.actionAbout) | |
|
1054 | self.menuBar.addAction(self.menuProject.menuAction()) | |
|
1055 | self.menuBar.addAction(self.menuRun.menuAction()) | |
|
1056 | self.menuBar.addAction(self.menuOptions.menuAction()) | |
|
1057 | self.menuBar.addAction(self.menuHelp.menuAction()) | |
|
1058 | ||
|
1059 | self.retranslateUi(MainWindow) | |
|
1060 | self.tabWidgetProject.setCurrentIndex(0) | |
|
1061 | self.tabWidgetVoltage.setCurrentIndex(0) | |
|
1062 | self.tabWidgetSpectra.setCurrentIndex(0) | |
|
1063 | self.tabWidgetSpectraHeis.setCurrentIndex(0) | |
|
1064 | self.tabWidget_2.setCurrentIndex(0) | |
|
1065 | self.tabConsole.setCurrentIndex(0) | |
|
1066 | self.tabWidget.setCurrentIndex(0) | |
|
1067 | QtCore.QMetaObject.connectSlotsByName(MainWindow) | |
|
1068 | ||
|
1069 | def changeIcon(self): | |
|
1070 | ||
|
1071 | if self.a==1: | |
|
1072 | iconPauseRed = QtGui.QIcon() | |
|
1073 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
1074 | self.actionPauseToolbar.setIcon(iconPauseRed) | |
|
1075 | self.a+=1 | |
|
1076 | return 0 | |
|
1077 | if self.a==2: | |
|
1078 | iconPause = QtGui.QIcon() | |
|
1079 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
1080 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1081 | self.a-=1 | |
|
1082 | return 0 | |
|
37 | iconPause = QtGui.QIcon() | |
|
38 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
|
39 | self.actionPauseToolbar.setIcon(iconPause) | |
|
1083 | 40 | |
|
1084 | def retranslateUi(self, MainWindow): | |
|
41 | self.paused = False | |
|
42 | ||
|
43 | def changePauseIcon(self): | |
|
1085 | 44 | |
|
1086 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) | |
|
1087 | self.label.setText(_translate("MainWindow", "Project Name :", None)) | |
|
1088 | self.label_11.setText(_translate("MainWindow", "DataType :", None)) | |
|
1089 | self.proComDataType.setItemText(0, _translate("MainWindow", "Voltage", None)) | |
|
1090 | self.proComDataType.setItemText(1, _translate("MainWindow", "Spectra", None)) | |
|
1091 | self.proComDataType.setItemText(2, _translate("MainWindow", "Fits", None)) | |
|
1092 | self.label_15.setText(_translate("MainWindow", "DataPath :", None)) | |
|
1093 | self.proToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1094 | self.label_23.setText(_translate("MainWindow", "Read Mode:", None)) | |
|
1095 | self.proComReadMode.setItemText(0, _translate("MainWindow", "Offline", None)) | |
|
1096 | self.proComReadMode.setItemText(1, _translate("MainWindow", "Online", None)) | |
|
1097 | self.label_33.setText(_translate("MainWindow", "Delay:", None)) | |
|
1098 | self.label_32.setText(_translate("MainWindow", "Walk :", None)) | |
|
1099 | self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None)) | |
|
1100 | self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None)) | |
|
1101 | self.proLoadButton.setText(_translate("MainWindow", "Load", None)) | |
|
1102 | self.label_10.setText(_translate("MainWindow", "Set:", None)) | |
|
1103 | self.label_27.setText(_translate("MainWindow", "Star Date:", None)) | |
|
1104 | self.label_28.setText(_translate("MainWindow", "End Date:", None)) | |
|
1105 | self.label_2.setText(_translate("MainWindow", "Start Time:", None)) | |
|
1106 | self.label_3.setText(_translate("MainWindow", "End Time:", None)) | |
|
1107 | self.label_30.setText(_translate("MainWindow", "Description:", None)) | |
|
1108 | self.proOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1109 | self.proClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1110 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabProject), _translate("MainWindow", "Project", None)) | |
|
1111 | self.volOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1112 | self.volGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1113 | self.volOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1114 | self.volOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1115 | self.volOpComChannels.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1116 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1117 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) | |
|
1118 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) | |
|
1119 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range List", None)) | |
|
1120 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) | |
|
1121 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) | |
|
1122 | self.label_4.setText(_translate("MainWindow", "Code:", None)) | |
|
1123 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) | |
|
1124 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
|
1125 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) | |
|
1126 | self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) | |
|
1127 | self.label_5.setText(_translate("MainWindow", "Mode:", None)) | |
|
1128 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Barker 3", None)) | |
|
1129 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 4", None)) | |
|
1130 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 5", None)) | |
|
1131 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 7", None)) | |
|
1132 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 11", None)) | |
|
1133 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 13", None)) | |
|
1134 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 3 + Comp.", None)) | |
|
1135 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 4 + Comp.", None)) | |
|
1136 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 5 + Comp.", None)) | |
|
1137 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 7 + Comp.", None)) | |
|
1138 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 11+ Comp.", None)) | |
|
1139 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 13+ Comp.", None)) | |
|
1140 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Default", None)) | |
|
1141 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) | |
|
1142 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Freq 1", None)) | |
|
1143 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) | |
|
1144 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1145 | self.label_14.setText(_translate("MainWindow", "Scope", None)) | |
|
1146 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) | |
|
1147 | self.label_49.setText(_translate("MainWindow", "Show", None)) | |
|
1148 | self.label_51.setText(_translate("MainWindow", "Freq/Vel", None)) | |
|
1149 | self.label_12.setText(_translate("MainWindow", "Path :", None)) | |
|
1150 | self.label_13.setText(_translate("MainWindow", "Prefix:", None)) | |
|
1151 | self.label_52.setText(_translate("MainWindow", "Height range", None)) | |
|
1152 | self.label_50.setText(_translate("MainWindow", "Save", None)) | |
|
1153 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) | |
|
1154 | self.label_36.setText(_translate("MainWindow", "Type:", None)) | |
|
1155 | self.label_37.setText(_translate("MainWindow", "Path:", None)) | |
|
1156 | self.volOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1157 | self.volOutputComData.setItemText(0, _translate("MainWindow", ".rawdata", None)) | |
|
1158 | self.label_7.setText(_translate("MainWindow", "Blocks per File : ", None)) | |
|
1159 | self.label_35.setText(_translate("MainWindow", "Profiles per Block: ", None)) | |
|
1160 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.taboutputVoltage), _translate("MainWindow", "Output", None)) | |
|
1161 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabVoltage), _translate("MainWindow", "Voltage", None)) | |
|
1162 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1163 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1164 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None)) | |
|
1165 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1166 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1167 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) | |
|
1168 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) | |
|
1169 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None)) | |
|
1170 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) | |
|
1171 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None)) | |
|
1172 | self.label_31.setText(_translate("MainWindow", "x-y pairs", None)) | |
|
1173 | self.label_26.setText(_translate("MainWindow", "nFFTPoints", None)) | |
|
1174 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None)) | |
|
1175 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
|
1176 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None)) | |
|
1177 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) | |
|
1178 | self.label_21.setText(_translate("MainWindow", "Profiles", None)) | |
|
1179 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None)) | |
|
1180 | self.label_70.setText(_translate("MainWindow", "IppFactor", None)) | |
|
1181 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None)) | |
|
1182 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) | |
|
1183 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) | |
|
1184 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) | |
|
1185 | self.label_44.setText(_translate("MainWindow", "Coherence Map", None)) | |
|
1186 | self.label_20.setText(_translate("MainWindow", "Tmin, Tmax:", None)) | |
|
1187 | self.label_25.setText(_translate("MainWindow", "Prefix", None)) | |
|
1188 | self.label_42.setText(_translate("MainWindow", "RTI Plot", None)) | |
|
1189 | self.label_16.setText(_translate("MainWindow", "Height range", None)) | |
|
1190 | self.label_17.setText(_translate("MainWindow", "dB range", None)) | |
|
1191 | self.label_18.setText(_translate("MainWindow", "Magnitud ", None)) | |
|
1192 | self.label_24.setText(_translate("MainWindow", "Path", None)) | |
|
1193 | self.label_46.setText(_translate("MainWindow", "Power Profile", None)) | |
|
1194 | self.label_22.setText(_translate("MainWindow", "Freq/Vel:", None)) | |
|
1195 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None)) | |
|
1196 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1197 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) | |
|
1198 | self.label_40.setText(_translate("MainWindow", "Spectra Plot", None)) | |
|
1199 | self.label_43.setText(_translate("MainWindow", "Show", None)) | |
|
1200 | self.label_29.setText(_translate("MainWindow", "Wr Period:", None)) | |
|
1201 | self.label_47.setText(_translate("MainWindow", "Save", None)) | |
|
1202 | self.label_19.setText(_translate("MainWindow", "ftp", None)) | |
|
1203 | self.label_45.setText(_translate("MainWindow", "Noise", None)) | |
|
1204 | self.label_48.setText(_translate("MainWindow", "Time Range:", None)) | |
|
1205 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) | |
|
1206 | self.label_39.setText(_translate("MainWindow", "Type:", None)) | |
|
1207 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) | |
|
1208 | self.label_34.setText(_translate("MainWindow", "Path:", None)) | |
|
1209 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1210 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) | |
|
1211 | self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) | |
|
1212 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) | |
|
1213 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) | |
|
1214 | self.specHeisGraphClear.setText(_translate("MainWindow", "Clear", None)) | |
|
1215 | self.specHeisOpOk.setText(_translate("MainWindow", "Ok", None)) | |
|
1216 | self.specHeisOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) | |
|
1217 | self.specHeisOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Intergration", None)) | |
|
1218 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabopSpectraHeis), _translate("MainWindow", "Operation", None)) | |
|
1219 | self.label_54.setText(_translate("MainWindow", "Prefix", None)) | |
|
1220 | self.specHeisGraphToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1221 | self.label_62.setText(_translate("MainWindow", "ymin - ymax", None)) | |
|
1222 | self.label_63.setText(_translate("MainWindow", "Tmin - Tmax:", None)) | |
|
1223 | self.label_64.setText(_translate("MainWindow", "Time Range:", None)) | |
|
1224 | self.label_65.setText(_translate("MainWindow", "Wr Period", None)) | |
|
1225 | self.label_60.setText(_translate("MainWindow", "Channel List:", None)) | |
|
1226 | self.label_61.setText(_translate("MainWindow", "xmin - xmax", None)) | |
|
1227 | self.label_56.setText(_translate("MainWindow", "Save", None)) | |
|
1228 | self.label_57.setText(_translate("MainWindow", "ftp", None)) | |
|
1229 | self.label_58.setText(_translate("MainWindow", "Spectra Plot", None)) | |
|
1230 | self.label_53.setText(_translate("MainWindow", "Path", None)) | |
|
1231 | self.label_55.setText(_translate("MainWindow", "Show", None)) | |
|
1232 | self.label_59.setText(_translate("MainWindow", "RTI PLot", None)) | |
|
1233 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabgraphSpectraHeis), _translate("MainWindow", "Graphics", None)) | |
|
1234 | self.label_67.setText(_translate("MainWindow", "Path:", None)) | |
|
1235 | self.label_68.setText(_translate("MainWindow", "Blocks per File:", None)) | |
|
1236 | self.label_66.setText(_translate("MainWindow", "Type:", None)) | |
|
1237 | self.specHeisOutputToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1238 | self.specHeisOutputComdata.setItemText(0, _translate("MainWindow", ".fits", None)) | |
|
1239 | self.label_69.setText(_translate("MainWindow", "Metada", None)) | |
|
1240 | self.specHeisOutputMetadaToolPath.setText(_translate("MainWindow", "...", None)) | |
|
1241 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.taboutputSpectraHeis), _translate("MainWindow", "Output", None)) | |
|
1242 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectraHeis), _translate("MainWindow", "SpectraHeis", None)) | |
|
1243 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation), _translate("MainWindow", "Operation", None)) | |
|
1244 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation1), _translate("MainWindow", "Graphics", None)) | |
|
1245 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabCorrelation), _translate("MainWindow", "Correlation", None)) | |
|
1246 | ||
|
1247 | ||
|
1248 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) | |
|
1249 | ||
|
1250 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) | |
|
1251 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) | |
|
1252 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) | |
|
1253 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) | |
|
1254 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) | |
|
1255 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) | |
|
1256 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) | |
|
1257 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) | |
|
1258 | self.actionSave.setText(_translate("MainWindow", "Save", None)) | |
|
1259 | self.actionClose.setText(_translate("MainWindow", "Close", None)) | |
|
1260 | self.actionStart.setText(_translate("MainWindow", "Start", None)) | |
|
1261 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) | |
|
1262 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) | |
|
1263 | self.actionAbout.setText(_translate("MainWindow", "About", None)) | |
|
1264 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) | |
|
1265 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open Project", None)) | |
|
1266 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) | |
|
1267 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create αΉroject", None)) | |
|
1268 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) | |
|
1269 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save Project", None)) | |
|
1270 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) | |
|
1271 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) | |
|
1272 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) | |
|
1273 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) | |
|
1274 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) | |
|
1275 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) | |
|
1276 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) | |
|
1277 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) | |
|
1278 | ||
|
1279 | ||
|
1280 | class Ui_EnvWindow(object): | |
|
1281 | ||
|
1282 | def changeIcon(self): | |
|
1283 | ||
|
1284 | if self.a==1: | |
|
45 | if self.paused == False: | |
|
1285 | 46 | iconPauseRed = QtGui.QIcon() |
|
1286 | 47 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1287 | 48 | self.actionPauseToolbar.setIcon(iconPauseRed) |
|
1288 |
self. |
|
|
49 | self.paused = True | |
|
1289 | 50 | return 0 |
|
1290 | if self.a==2: | |
|
51 | ||
|
52 | if self.paused: | |
|
1291 | 53 | iconPause = QtGui.QIcon() |
|
1292 | 54 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1293 | 55 | self.actionPauseToolbar.setIcon(iconPause) |
|
1294 |
self. |
|
|
56 | self.paused = False | |
|
1295 | 57 | return 0 |
|
1296 | 58 | |
|
1297 | 59 | def setupUi(self, MainWindow): |
|
1298 | 60 | |
|
1299 | 61 | MainWindow.setObjectName(_fromUtf8("MainWindow")) |
|
1300 | 62 | MainWindow.resize(1203, 711) |
|
1301 | 63 | |
|
1302 | 64 | self.centralWidget = QtGui.QWidget(MainWindow) |
|
1303 | 65 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) |
|
1304 | 66 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) |
|
1305 | 67 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) |
|
1306 | 68 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) |
|
1307 | 69 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) |
|
1308 | 70 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) |
|
1309 | 71 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) |
|
1310 | 72 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) |
|
1311 | 73 | self.splitter = QtGui.QSplitter(self.splitter_2) |
|
1312 | 74 | self.splitter.setOrientation(QtCore.Qt.Vertical) |
|
1313 | 75 | self.splitter.setObjectName(_fromUtf8("splitter")) |
|
1314 | 76 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) |
|
1315 | 77 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) |
|
1316 | 78 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
|
1317 | 79 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) |
|
1318 | 80 | |
|
1319 | 81 | self.tabConsole = QtGui.QTabWidget(self.splitter) |
|
1320 | 82 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) |
|
1321 | 83 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) |
|
1322 | 84 | self.tab_5 = QtGui.QWidget() |
|
1323 | 85 | self.tab_5.setObjectName(_fromUtf8("tab_5")) |
|
1324 | 86 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) |
|
1325 | 87 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) |
|
1326 | 88 | self.console = QtGui.QTextEdit(self.tab_5) |
|
1327 | 89 | self.console.setObjectName(_fromUtf8("console")) |
|
1328 | 90 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) |
|
1329 | 91 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) |
|
1330 | 92 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) |
|
1331 | 93 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) |
|
1332 | 94 | self.tabProjectProperty = QtGui.QWidget() |
|
1333 | 95 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) |
|
1334 | 96 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) |
|
1335 | 97 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) |
|
1336 | 98 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) |
|
1337 | 99 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) |
|
1338 | 100 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) |
|
1339 | 101 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) |
|
1340 | 102 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) |
|
1341 | 103 | |
|
1342 | 104 | MainWindow.setCentralWidget(self.centralWidget) |
|
1343 | 105 | self.toolBar = QtGui.QToolBar(MainWindow) |
|
1344 | 106 | self.toolBar.setObjectName(_fromUtf8("toolBar")) |
|
1345 | 107 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
1346 | 108 | |
|
1347 | 109 | self.menuBar = QtGui.QMenuBar(MainWindow) |
|
1348 | 110 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) |
|
1349 | 111 | self.menuBar.setObjectName(_fromUtf8("menuBar")) |
|
1350 | 112 | self.menuProject = QtGui.QMenu(self.menuBar) |
|
1351 | 113 | self.menuProject.setObjectName(_fromUtf8("menuProject")) |
|
1352 | 114 | self.menuRun = QtGui.QMenu(self.menuBar) |
|
1353 | 115 | self.menuRun.setObjectName(_fromUtf8("menuRun")) |
|
1354 | 116 | self.menuOptions = QtGui.QMenu(self.menuBar) |
|
1355 | 117 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) |
|
1356 | 118 | self.menuHelp = QtGui.QMenu(self.menuBar) |
|
1357 | 119 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) |
|
1358 | 120 | MainWindow.setMenuBar(self.menuBar) |
|
1359 | 121 | |
|
1360 | 122 | iconOpen = QtGui.QIcon() |
|
1361 | 123 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1362 | 124 | iconCreate = QtGui.QIcon() |
|
1363 | 125 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1364 | 126 | iconSave = QtGui.QIcon() |
|
1365 | 127 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1366 | 128 | iconStart = QtGui.QIcon() |
|
1367 | 129 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1368 | 130 | iconStop = QtGui.QIcon() |
|
1369 | 131 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1370 | 132 | iconPause = QtGui.QIcon() |
|
1371 | 133 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1372 | 134 | iconAddPU = QtGui.QIcon() |
|
1373 | 135 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
1374 | 136 | |
|
1375 | 137 | self.actionOpen = QtGui.QAction(MainWindow) |
|
1376 | 138 | self.actionOpen.setIcon(iconOpen) |
|
1377 | 139 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) |
|
1378 | 140 | self.actionCreate = QtGui.QAction(MainWindow) |
|
1379 | 141 | self.actionCreate.setIcon(iconCreate) |
|
1380 | 142 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) |
|
1381 | 143 | self.actionSave = QtGui.QAction(MainWindow) |
|
1382 | 144 | self.actionSave.setIcon(iconSave) |
|
1383 | 145 | self.actionSave.setObjectName(_fromUtf8("actionSave")) |
|
1384 | 146 | self.actionClose = QtGui.QAction(MainWindow) |
|
1385 | 147 | self.actionClose.setObjectName(_fromUtf8("actionClose")) |
|
1386 | 148 | self.actionStart = QtGui.QAction(MainWindow) |
|
1387 | 149 | self.actionStart.setIcon(iconStart) |
|
1388 | 150 | self.actionStart.setObjectName(_fromUtf8("actionStart")) |
|
1389 | 151 | self.actionPause = QtGui.QAction(MainWindow) |
|
1390 | 152 | self.actionPause.setIcon(iconPause) |
|
1391 | 153 | self.actionPause.setObjectName(_fromUtf8("actionPause")) |
|
1392 | 154 | self.actionStop = QtGui.QAction(MainWindow) |
|
1393 | 155 | self.actionStop.setIcon(iconStop) |
|
1394 | 156 | self.actionStop.setObjectName(_fromUtf8("actionStop")) |
|
1395 | 157 | self.actionAbout = QtGui.QAction(MainWindow) |
|
1396 | 158 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) |
|
1397 | 159 | self.actionOpenToolbar = QtGui.QAction(MainWindow) |
|
1398 | 160 | self.actionOpenToolbar.setIcon(iconOpen) |
|
1399 | 161 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) |
|
1400 | 162 | self.actionCreateToolbar = QtGui.QAction(MainWindow) |
|
1401 | 163 | self.actionCreateToolbar.setIcon(iconCreate) |
|
1402 | 164 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) |
|
1403 | 165 | self.actionSaveToolbar = QtGui.QAction(MainWindow) |
|
1404 | 166 | self.actionSaveToolbar.setIcon(iconSave) |
|
1405 | 167 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) |
|
1406 | 168 | self.actionStarToolbar = QtGui.QAction(MainWindow) |
|
1407 | 169 | self.actionStarToolbar.setIcon(iconStart) |
|
1408 | 170 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) |
|
1409 | 171 | self.actionStopToolbar = QtGui.QAction(MainWindow) |
|
1410 | 172 | self.actionStopToolbar.setIcon(iconStop) |
|
1411 | 173 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) |
|
1412 | 174 | self.actionPauseToolbar = QtGui.QAction(MainWindow) |
|
1413 | 175 | self.actionPause.setIcon(iconPause) |
|
1414 | 176 | self.actionPauseToolbar.setIcon(iconPause) |
|
1415 | 177 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) |
|
1416 | 178 | self.actionAddPU = QtGui.QAction(MainWindow) |
|
1417 | 179 | self.actionAddPU.setIcon(iconAddPU) |
|
1418 | 180 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) |
|
1419 | 181 | self.actionFTP = QtGui.QAction(MainWindow) |
|
1420 | 182 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) |
|
1421 | 183 | self.toolBar.addAction(self.actionOpenToolbar) |
|
1422 | 184 | self.toolBar.addSeparator() |
|
1423 | 185 | self.toolBar.addAction(self.actionCreateToolbar) |
|
1424 | 186 | self.toolBar.addSeparator() |
|
1425 | 187 | self.toolBar.addAction(self.actionAddPU) |
|
1426 | 188 | self.toolBar.addSeparator() |
|
1427 | 189 | self.toolBar.addAction(self.actionSaveToolbar) |
|
1428 | 190 | self.toolBar.addSeparator() |
|
1429 | 191 | self.toolBar.addAction(self.actionStarToolbar) |
|
1430 | 192 | self.toolBar.addSeparator() |
|
1431 | 193 | self.toolBar.addAction(self.actionPauseToolbar) |
|
1432 | 194 | self.toolBar.addSeparator() |
|
1433 | 195 | self.toolBar.addAction(self.actionStopToolbar) |
|
1434 | 196 | self.toolBar.addSeparator() |
|
1435 |
|
|
|
1436 | self.actionPauseToolbar.triggered.connect(self.changeIcon) | |
|
197 | ||
|
198 | self.paused=False | |
|
199 | self.actionPause.triggered.connect(self.changePauseIcon) | |
|
200 | self.actionPauseToolbar.triggered.connect(self.changePauseIcon) | |
|
1437 | 201 | |
|
1438 | 202 | self.menuProject.addAction(self.actionOpen) |
|
1439 | 203 | self.menuProject.addAction(self.actionCreate) |
|
1440 | 204 | self.menuProject.addAction(self.actionSave) |
|
1441 | 205 | self.menuProject.addAction(self.actionClose) |
|
1442 | 206 | self.menuRun.addAction(self.actionStart) |
|
1443 | 207 | self.menuRun.addAction(self.actionPause) |
|
1444 | 208 | self.menuRun.addAction(self.actionStop) |
|
1445 | 209 | self.menuOptions.addAction(self.actionFTP) |
|
1446 | 210 | self.menuHelp.addAction(self.actionAbout) |
|
1447 | 211 | self.menuBar.addAction(self.menuProject.menuAction()) |
|
1448 | 212 | self.menuBar.addAction(self.menuRun.menuAction()) |
|
1449 | 213 | self.menuBar.addAction(self.menuOptions.menuAction()) |
|
1450 | 214 | self.menuBar.addAction(self.menuHelp.menuAction()) |
|
1451 | 215 | |
|
1452 | 216 | self.tabConsole.setCurrentIndex(0) |
|
1453 | 217 | self.tabWidget.setCurrentIndex(0) |
|
1454 | 218 | |
|
1455 | 219 | def retranslateUi(self, MainWindow): |
|
1456 | 220 | |
|
1457 | 221 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) |
|
1458 | 222 | |
|
1459 | 223 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) |
|
1460 | 224 | |
|
1461 | 225 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) |
|
1462 | 226 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) |
|
1463 | 227 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) |
|
1464 | 228 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) |
|
1465 | 229 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) |
|
1466 | 230 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) |
|
1467 | 231 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) |
|
1468 | 232 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) |
|
1469 | 233 | self.actionSave.setText(_translate("MainWindow", "Save", None)) |
|
1470 | 234 | self.actionClose.setText(_translate("MainWindow", "Close", None)) |
|
1471 | 235 | self.actionStart.setText(_translate("MainWindow", "Start", None)) |
|
1472 | 236 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) |
|
1473 | 237 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) |
|
1474 | 238 | self.actionAbout.setText(_translate("MainWindow", "About", None)) |
|
1475 | 239 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) |
|
1476 |
self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open |
|
|
240 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open a project", None)) | |
|
1477 | 241 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) |
|
1478 |
self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create |
|
|
242 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create a new project", None)) | |
|
1479 | 243 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) |
|
1480 |
self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save |
|
|
244 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save a project", None)) | |
|
1481 | 245 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) |
|
1482 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) | |
|
246 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start process", None)) | |
|
1483 | 247 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) |
|
1484 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) | |
|
248 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop process", None)) | |
|
1485 | 249 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) |
|
1486 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) | |
|
250 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause process", None)) | |
|
1487 | 251 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) |
|
1488 | 252 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) |
|
1489 |
|
|
|
253 | ||
|
254 | def closeEvent(self, event): | |
|
255 | ||
|
256 | reply = QtGui.QMessageBox.question(self, 'Message', | |
|
257 | "Are you sure to quit?", QtGui.QMessageBox.Yes | | |
|
258 | QtGui.QMessageBox.No, QtGui.QMessageBox.No) | |
|
259 | if reply == QtGui.QMessageBox.Yes: | |
|
260 | event.accept() | |
|
261 | else: | |
|
262 | event.ignore() | |
|
263 | ||
|
1490 | 264 | class Ui_BasicWindow(Ui_EnvWindow, Ui_ProjectTab, Ui_VoltageTab, Ui_SpectraTab, Ui_SpectraHeisTab, Ui_CorrelationTab): |
|
1491 | 265 | |
|
1492 | 266 | def setupUi(self, MainWindow): |
|
1493 | 267 | |
|
1494 | 268 | Ui_EnvWindow.setupUi(self, MainWindow) |
|
1495 | 269 | |
|
1496 | 270 | Ui_ProjectTab.setupUi(self) |
|
1497 | 271 | Ui_VoltageTab.setupUi(self) |
|
1498 | 272 | Ui_SpectraTab.setupUi(self) |
|
1499 | 273 | Ui_SpectraHeisTab.setupUi(self) |
|
1500 | 274 | Ui_CorrelationTab.setupUi(self) |
|
1501 | 275 | |
|
1502 | 276 | self.retranslateUi(MainWindow) |
|
1503 | 277 | |
|
1504 | 278 | QtCore.QMetaObject.connectSlotsByName(MainWindow) |
|
1505 | 279 | |
|
1506 | 280 | def retranslateUi(self, MainWindow): |
|
1507 | 281 | |
|
1508 | 282 | Ui_EnvWindow.retranslateUi(self, MainWindow) |
|
1509 | 283 | |
|
1510 | 284 | Ui_ProjectTab.retranslateUi(self) |
|
1511 | 285 | Ui_VoltageTab.retranslateUi(self) |
|
1512 | 286 | Ui_SpectraTab.retranslateUi(self) |
|
1513 | 287 | Ui_SpectraHeisTab.retranslateUi(self) |
|
1514 | 288 | Ui_CorrelationTab.retranslateUi(self) |
|
1515 | 289 | |
|
1516 | 290 | |
|
1517 |
class Ui_AdvancedWindow(Ui_ |
|
|
291 | class Ui_AdvancedWindow(Ui_EnvWindow): | |
|
1518 | 292 | |
|
1519 | 293 | def setupUi(self, AdvancedWindow): |
|
1520 | 294 | |
|
1521 | 295 | Ui_MainWindow.setupUi(self, AdvancedWindow) |
|
1522 | 296 | |
|
1523 | 297 | def retranslateUi(self, AdvancedWindow): |
|
1524 | 298 | |
|
1525 | 299 | Ui_MainWindow.retranslateUi(self, AdvancedWindow) |
|
1526 | 300 | |
|
1527 | 301 | |
|
1528 | 302 | |
|
1529 | 303 | if __name__ == "__main__": |
|
1530 | 304 | import sys |
|
1531 | 305 | app = QtGui.QApplication(sys.argv) |
|
1532 | 306 | MainWindow = QtGui.QMainWindow() |
|
1533 | 307 | ui = Ui_BasicWindow() |
|
1534 | 308 | ui.setupUi(MainWindow) |
|
1535 | 309 | MainWindow.show() |
|
1536 | 310 | sys.exit(app.exec_()) |
|
1537 | 311 |
@@ -1,936 +1,938 | |||
|
1 | 1 | import numpy |
|
2 | 2 | import math |
|
3 | 3 | |
|
4 | 4 | from jroproc_base import ProcessingUnit, Operation |
|
5 | 5 | from schainpy.model.data.jrodata import Spectra |
|
6 | 6 | from schainpy.model.data.jrodata import hildebrand_sekhon |
|
7 | 7 | |
|
8 | 8 | class SpectraProc(ProcessingUnit): |
|
9 | 9 | |
|
10 | 10 | def __init__(self): |
|
11 | 11 | |
|
12 | 12 | ProcessingUnit.__init__(self) |
|
13 | 13 | |
|
14 | 14 | self.buffer = None |
|
15 | 15 | self.firstdatatime = None |
|
16 | 16 | self.profIndex = 0 |
|
17 | 17 | self.dataOut = Spectra() |
|
18 | 18 | self.id_min = None |
|
19 | 19 | self.id_max = None |
|
20 | 20 | |
|
21 | 21 | def __updateObjFromInput(self): |
|
22 | 22 | |
|
23 | 23 | self.dataOut.timeZone = self.dataIn.timeZone |
|
24 | 24 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
25 | 25 | self.dataOut.errorCount = self.dataIn.errorCount |
|
26 | 26 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
27 | 27 | |
|
28 | 28 | self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy() |
|
29 | 29 | self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy() |
|
30 | 30 | self.dataOut.channelList = self.dataIn.channelList |
|
31 | 31 | self.dataOut.heightList = self.dataIn.heightList |
|
32 | 32 | self.dataOut.dtype = numpy.dtype([('real','<f4'),('imag','<f4')]) |
|
33 | 33 | # self.dataOut.nHeights = self.dataIn.nHeights |
|
34 | 34 | # self.dataOut.nChannels = self.dataIn.nChannels |
|
35 | 35 | self.dataOut.nBaud = self.dataIn.nBaud |
|
36 | 36 | self.dataOut.nCode = self.dataIn.nCode |
|
37 | 37 | self.dataOut.code = self.dataIn.code |
|
38 | 38 | self.dataOut.nProfiles = self.dataOut.nFFTPoints |
|
39 | 39 | # self.dataOut.channelIndexList = self.dataIn.channelIndexList |
|
40 | 40 | self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock |
|
41 | 41 | self.dataOut.utctime = self.firstdatatime |
|
42 | 42 | self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada |
|
43 | 43 | self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip |
|
44 | 44 | # self.dataOut.flagShiftFFT = self.dataIn.flagShiftFFT |
|
45 | 45 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
46 | 46 | self.dataOut.nIncohInt = 1 |
|
47 | 47 | # self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
48 | 48 | self.dataOut.windowOfFilter = self.dataIn.windowOfFilter |
|
49 | 49 | |
|
50 | 50 | # self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt |
|
51 | 51 | self.dataOut.frequency = self.dataIn.frequency |
|
52 | 52 | self.dataOut.realtime = self.dataIn.realtime |
|
53 | 53 | |
|
54 | 54 | self.dataOut.azimuth = self.dataIn.azimuth |
|
55 | 55 | self.dataOut.zenith = self.dataIn.zenith |
|
56 | 56 | |
|
57 | 57 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
58 | 58 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
59 | 59 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
60 | 60 | |
|
61 | 61 | def __getFft(self): |
|
62 | 62 | """ |
|
63 | 63 | Convierte valores de Voltaje a Spectra |
|
64 | 64 | |
|
65 | 65 | Affected: |
|
66 | 66 | self.dataOut.data_spc |
|
67 | 67 | self.dataOut.data_cspc |
|
68 | 68 | self.dataOut.data_dc |
|
69 | 69 | self.dataOut.heightList |
|
70 | 70 | self.profIndex |
|
71 | 71 | self.buffer |
|
72 | 72 | self.dataOut.flagNoData |
|
73 | 73 | """ |
|
74 | 74 | fft_volt = numpy.fft.fft(self.buffer,n=self.dataOut.nFFTPoints,axis=1) |
|
75 | 75 | fft_volt = fft_volt.astype(numpy.dtype('complex')) |
|
76 | 76 | dc = fft_volt[:,0,:] |
|
77 | 77 | |
|
78 | 78 | #calculo de self-spectra |
|
79 | 79 | fft_volt = numpy.fft.fftshift(fft_volt,axes=(1,)) |
|
80 | 80 | spc = fft_volt * numpy.conjugate(fft_volt) |
|
81 | 81 | spc = spc.real |
|
82 | 82 | |
|
83 | 83 | blocksize = 0 |
|
84 | 84 | blocksize += dc.size |
|
85 | 85 | blocksize += spc.size |
|
86 | 86 | |
|
87 | 87 | cspc = None |
|
88 | 88 | pairIndex = 0 |
|
89 | 89 | if self.dataOut.pairsList != None: |
|
90 | 90 | #calculo de cross-spectra |
|
91 | 91 | cspc = numpy.zeros((self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex') |
|
92 | 92 | for pair in self.dataOut.pairsList: |
|
93 | 93 | cspc[pairIndex,:,:] = fft_volt[pair[0],:,:] * numpy.conjugate(fft_volt[pair[1],:,:]) |
|
94 | 94 | pairIndex += 1 |
|
95 | 95 | blocksize += cspc.size |
|
96 | 96 | |
|
97 | 97 | self.dataOut.data_spc = spc |
|
98 | 98 | self.dataOut.data_cspc = cspc |
|
99 | 99 | self.dataOut.data_dc = dc |
|
100 | 100 | self.dataOut.blockSize = blocksize |
|
101 | 101 | self.dataOut.flagShiftFFT = False |
|
102 | 102 | |
|
103 | 103 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None): |
|
104 | 104 | |
|
105 | 105 | self.dataOut.flagNoData = True |
|
106 | 106 | |
|
107 | 107 | if self.dataIn.type == "Spectra": |
|
108 | 108 | self.dataOut.copy(self.dataIn) |
|
109 | 109 | return True |
|
110 | 110 | |
|
111 | 111 | if self.dataIn.type == "Voltage": |
|
112 | 112 | |
|
113 | 113 | if nFFTPoints == None: |
|
114 | 114 | raise ValueError, "This SpectraProc.run() need nFFTPoints input variable" |
|
115 | 115 | |
|
116 | 116 | if nProfiles == None: |
|
117 | 117 | nProfiles = nFFTPoints |
|
118 | 118 | # raise ValueError, "This SpectraProc.run() need nProfiles input variable" |
|
119 | 119 | |
|
120 | 120 | |
|
121 | 121 | if ippFactor == None: |
|
122 | 122 | ippFactor = 1 |
|
123 | 123 | self.dataOut.ippFactor = ippFactor |
|
124 | 124 | |
|
125 | 125 | self.dataOut.nFFTPoints = nFFTPoints |
|
126 | 126 | self.dataOut.pairsList = pairsList |
|
127 | 127 | |
|
128 | 128 | if self.buffer == None: |
|
129 | 129 | self.buffer = numpy.zeros((self.dataIn.nChannels, |
|
130 | 130 | nProfiles, |
|
131 | 131 | self.dataIn.nHeights), |
|
132 | 132 | dtype='complex') |
|
133 | 133 | self.id_min = 0 |
|
134 | 134 | self.id_max = self.dataIn.data.shape[1] |
|
135 | 135 | |
|
136 | 136 | if len(self.dataIn.data.shape) == 2: |
|
137 | 137 | self.buffer[:,self.profIndex,:] = self.dataIn.data.copy() |
|
138 | 138 | self.profIndex += 1 |
|
139 | 139 | else: |
|
140 | 140 | if self.dataIn.data.shape[1] == nProfiles: |
|
141 | 141 | self.buffer = self.dataIn.data.copy() |
|
142 | 142 | self.profIndex = nProfiles |
|
143 | 143 | elif self.dataIn.data.shape[1] < nProfiles: |
|
144 | 144 | self.buffer[:,self.id_min:self.id_max,:] = self.dataIn.data |
|
145 | 145 | self.profIndex += self.dataIn.data.shape[1] |
|
146 | 146 | self.id_min += self.dataIn.data.shape[1] |
|
147 | 147 | self.id_max += self.dataIn.data.shape[1] |
|
148 | 148 | else: |
|
149 | 149 | raise ValueError, "The type object %s has %d profiles, it should be equal to %d profiles"%(self.dataIn.type,self.dataIn.data.shape[1],nProfiles) |
|
150 | 150 | self.dataOut.flagNoData = True |
|
151 | 151 | return 0 |
|
152 | 152 | |
|
153 | 153 | |
|
154 | 154 | if self.firstdatatime == None: |
|
155 | 155 | self.firstdatatime = self.dataIn.utctime |
|
156 | 156 | |
|
157 | 157 | if self.profIndex == nProfiles: |
|
158 | 158 | self.__updateObjFromInput() |
|
159 | 159 | self.__getFft() |
|
160 | 160 | |
|
161 | 161 | self.dataOut.flagNoData = False |
|
162 | 162 | |
|
163 | 163 | self.buffer = None |
|
164 | 164 | self.firstdatatime = None |
|
165 | 165 | self.profIndex = 0 |
|
166 | 166 | |
|
167 | 167 | return True |
|
168 | 168 | |
|
169 | 169 | raise ValueError, "The type object %s is not valid"%(self.dataIn.type) |
|
170 | 170 | |
|
171 | 171 | def selectChannels(self, channelList): |
|
172 | 172 | |
|
173 | 173 | channelIndexList = [] |
|
174 | 174 | |
|
175 | 175 | for channel in channelList: |
|
176 | if channel not in self.dataOut.channelList: | |
|
177 | continue | |
|
176 | 178 | index = self.dataOut.channelList.index(channel) |
|
177 | 179 | channelIndexList.append(index) |
|
178 | 180 | |
|
179 | 181 | self.selectChannelsByIndex(channelIndexList) |
|
180 | 182 | |
|
181 | 183 | def selectChannelsByIndex(self, channelIndexList): |
|
182 | 184 | """ |
|
183 | 185 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
184 | 186 | |
|
185 | 187 | Input: |
|
186 | 188 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
187 | 189 | |
|
188 | 190 | Affected: |
|
189 | 191 | self.dataOut.data_spc |
|
190 | 192 | self.dataOut.channelIndexList |
|
191 | 193 | self.dataOut.nChannels |
|
192 | 194 | |
|
193 | 195 | Return: |
|
194 | 196 | None |
|
195 | 197 | """ |
|
196 | 198 | |
|
197 | 199 | for channelIndex in channelIndexList: |
|
198 | 200 | if channelIndex not in self.dataOut.channelIndexList: |
|
199 | 201 | print channelIndexList |
|
200 | 202 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
201 | 203 | |
|
202 | 204 | # nChannels = len(channelIndexList) |
|
203 | 205 | |
|
204 | 206 | data_spc = self.dataOut.data_spc[channelIndexList,:] |
|
205 | 207 | |
|
206 | 208 | self.dataOut.data_spc = data_spc |
|
207 | 209 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
208 | 210 | # self.dataOut.nChannels = nChannels |
|
209 | 211 | |
|
210 | 212 | return 1 |
|
211 | 213 | |
|
212 | 214 | def selectHeights(self, minHei, maxHei): |
|
213 | 215 | """ |
|
214 | 216 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
215 | 217 | minHei <= height <= maxHei |
|
216 | 218 | |
|
217 | 219 | Input: |
|
218 | 220 | minHei : valor minimo de altura a considerar |
|
219 | 221 | maxHei : valor maximo de altura a considerar |
|
220 | 222 | |
|
221 | 223 | Affected: |
|
222 | 224 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
223 | 225 | |
|
224 | 226 | Return: |
|
225 | 227 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
226 | 228 | """ |
|
227 | 229 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
228 | 230 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
229 | 231 | |
|
230 | 232 | if (maxHei > self.dataOut.heightList[-1]): |
|
231 | 233 | maxHei = self.dataOut.heightList[-1] |
|
232 | 234 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
233 | 235 | |
|
234 | 236 | minIndex = 0 |
|
235 | 237 | maxIndex = 0 |
|
236 | 238 | heights = self.dataOut.heightList |
|
237 | 239 | |
|
238 | 240 | inda = numpy.where(heights >= minHei) |
|
239 | 241 | indb = numpy.where(heights <= maxHei) |
|
240 | 242 | |
|
241 | 243 | try: |
|
242 | 244 | minIndex = inda[0][0] |
|
243 | 245 | except: |
|
244 | 246 | minIndex = 0 |
|
245 | 247 | |
|
246 | 248 | try: |
|
247 | 249 | maxIndex = indb[0][-1] |
|
248 | 250 | except: |
|
249 | 251 | maxIndex = len(heights) |
|
250 | 252 | |
|
251 | 253 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
252 | 254 | |
|
253 | 255 | return 1 |
|
254 | 256 | |
|
255 | 257 | def getBeaconSignal(self, tauindex = 0, channelindex = 0, hei_ref=None): |
|
256 | 258 | newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) |
|
257 | 259 | |
|
258 | 260 | if hei_ref != None: |
|
259 | 261 | newheis = numpy.where(self.dataOut.heightList>hei_ref) |
|
260 | 262 | |
|
261 | 263 | minIndex = min(newheis[0]) |
|
262 | 264 | maxIndex = max(newheis[0]) |
|
263 | 265 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
264 | 266 | heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
265 | 267 | |
|
266 | 268 | # determina indices |
|
267 | 269 | nheis = int(self.dataOut.radarControllerHeaderObj.txB/(self.dataOut.heightList[1]-self.dataOut.heightList[0])) |
|
268 | 270 | avg_dB = 10*numpy.log10(numpy.sum(data_spc[channelindex,:,:],axis=0)) |
|
269 | 271 | beacon_dB = numpy.sort(avg_dB)[-nheis:] |
|
270 | 272 | beacon_heiIndexList = [] |
|
271 | 273 | for val in avg_dB.tolist(): |
|
272 | 274 | if val >= beacon_dB[0]: |
|
273 | 275 | beacon_heiIndexList.append(avg_dB.tolist().index(val)) |
|
274 | 276 | |
|
275 | 277 | #data_spc = data_spc[:,:,beacon_heiIndexList] |
|
276 | 278 | data_cspc = None |
|
277 | 279 | if self.dataOut.data_cspc != None: |
|
278 | 280 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
279 | 281 | #data_cspc = data_cspc[:,:,beacon_heiIndexList] |
|
280 | 282 | |
|
281 | 283 | data_dc = None |
|
282 | 284 | if self.dataOut.data_dc != None: |
|
283 | 285 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
284 | 286 | #data_dc = data_dc[:,beacon_heiIndexList] |
|
285 | 287 | |
|
286 | 288 | self.dataOut.data_spc = data_spc |
|
287 | 289 | self.dataOut.data_cspc = data_cspc |
|
288 | 290 | self.dataOut.data_dc = data_dc |
|
289 | 291 | self.dataOut.heightList = heightList |
|
290 | 292 | self.dataOut.beacon_heiIndexList = beacon_heiIndexList |
|
291 | 293 | |
|
292 | 294 | return 1 |
|
293 | 295 | |
|
294 | 296 | |
|
295 | 297 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
296 | 298 | """ |
|
297 | 299 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
298 | 300 | minIndex <= index <= maxIndex |
|
299 | 301 | |
|
300 | 302 | Input: |
|
301 | 303 | minIndex : valor de indice minimo de altura a considerar |
|
302 | 304 | maxIndex : valor de indice maximo de altura a considerar |
|
303 | 305 | |
|
304 | 306 | Affected: |
|
305 | 307 | self.dataOut.data_spc |
|
306 | 308 | self.dataOut.data_cspc |
|
307 | 309 | self.dataOut.data_dc |
|
308 | 310 | self.dataOut.heightList |
|
309 | 311 | |
|
310 | 312 | Return: |
|
311 | 313 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
312 | 314 | """ |
|
313 | 315 | |
|
314 | 316 | if (minIndex < 0) or (minIndex > maxIndex): |
|
315 | 317 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
316 | 318 | |
|
317 | 319 | if (maxIndex >= self.dataOut.nHeights): |
|
318 | 320 | maxIndex = self.dataOut.nHeights-1 |
|
319 | 321 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
320 | 322 | |
|
321 | 323 | # nHeights = maxIndex - minIndex + 1 |
|
322 | 324 | |
|
323 | 325 | #Spectra |
|
324 | 326 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
325 | 327 | |
|
326 | 328 | data_cspc = None |
|
327 | 329 | if self.dataOut.data_cspc != None: |
|
328 | 330 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
329 | 331 | |
|
330 | 332 | data_dc = None |
|
331 | 333 | if self.dataOut.data_dc != None: |
|
332 | 334 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
333 | 335 | |
|
334 | 336 | self.dataOut.data_spc = data_spc |
|
335 | 337 | self.dataOut.data_cspc = data_cspc |
|
336 | 338 | self.dataOut.data_dc = data_dc |
|
337 | 339 | |
|
338 | 340 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
339 | 341 | |
|
340 | 342 | return 1 |
|
341 | 343 | |
|
342 | 344 | def removeDC(self, mode = 2): |
|
343 | 345 | jspectra = self.dataOut.data_spc |
|
344 | 346 | jcspectra = self.dataOut.data_cspc |
|
345 | 347 | |
|
346 | 348 | |
|
347 | 349 | num_chan = jspectra.shape[0] |
|
348 | 350 | num_hei = jspectra.shape[2] |
|
349 | 351 | |
|
350 | 352 | if jcspectra != None: |
|
351 | 353 | jcspectraExist = True |
|
352 | 354 | num_pairs = jcspectra.shape[0] |
|
353 | 355 | else: jcspectraExist = False |
|
354 | 356 | |
|
355 | 357 | freq_dc = jspectra.shape[1]/2 |
|
356 | 358 | ind_vel = numpy.array([-2,-1,1,2]) + freq_dc |
|
357 | 359 | |
|
358 | 360 | if ind_vel[0]<0: |
|
359 | 361 | ind_vel[range(0,1)] = ind_vel[range(0,1)] + self.num_prof |
|
360 | 362 | |
|
361 | 363 | if mode == 1: |
|
362 | 364 | jspectra[:,freq_dc,:] = (jspectra[:,ind_vel[1],:] + jspectra[:,ind_vel[2],:])/2 #CORRECCION |
|
363 | 365 | |
|
364 | 366 | if jcspectraExist: |
|
365 | 367 | jcspectra[:,freq_dc,:] = (jcspectra[:,ind_vel[1],:] + jcspectra[:,ind_vel[2],:])/2 |
|
366 | 368 | |
|
367 | 369 | if mode == 2: |
|
368 | 370 | |
|
369 | 371 | vel = numpy.array([-2,-1,1,2]) |
|
370 | 372 | xx = numpy.zeros([4,4]) |
|
371 | 373 | |
|
372 | 374 | for fil in range(4): |
|
373 | 375 | xx[fil,:] = vel[fil]**numpy.asarray(range(4)) |
|
374 | 376 | |
|
375 | 377 | xx_inv = numpy.linalg.inv(xx) |
|
376 | 378 | xx_aux = xx_inv[0,:] |
|
377 | 379 | |
|
378 | 380 | for ich in range(num_chan): |
|
379 | 381 | yy = jspectra[ich,ind_vel,:] |
|
380 | 382 | jspectra[ich,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
381 | 383 | |
|
382 | 384 | junkid = jspectra[ich,freq_dc,:]<=0 |
|
383 | 385 | cjunkid = sum(junkid) |
|
384 | 386 | |
|
385 | 387 | if cjunkid.any(): |
|
386 | 388 | jspectra[ich,freq_dc,junkid.nonzero()] = (jspectra[ich,ind_vel[1],junkid] + jspectra[ich,ind_vel[2],junkid])/2 |
|
387 | 389 | |
|
388 | 390 | if jcspectraExist: |
|
389 | 391 | for ip in range(num_pairs): |
|
390 | 392 | yy = jcspectra[ip,ind_vel,:] |
|
391 | 393 | jcspectra[ip,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
392 | 394 | |
|
393 | 395 | |
|
394 | 396 | self.dataOut.data_spc = jspectra |
|
395 | 397 | self.dataOut.data_cspc = jcspectra |
|
396 | 398 | |
|
397 | 399 | return 1 |
|
398 | 400 | |
|
399 | 401 | def removeInterference(self, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None): |
|
400 | 402 | |
|
401 | 403 | jspectra = self.dataOut.data_spc |
|
402 | 404 | jcspectra = self.dataOut.data_cspc |
|
403 | 405 | jnoise = self.dataOut.getNoise() |
|
404 | 406 | num_incoh = self.dataOut.nIncohInt |
|
405 | 407 | |
|
406 | 408 | num_channel = jspectra.shape[0] |
|
407 | 409 | num_prof = jspectra.shape[1] |
|
408 | 410 | num_hei = jspectra.shape[2] |
|
409 | 411 | |
|
410 | 412 | #hei_interf |
|
411 | 413 | if hei_interf == None: |
|
412 | 414 | count_hei = num_hei/2 #Como es entero no importa |
|
413 | 415 | hei_interf = numpy.asmatrix(range(count_hei)) + num_hei - count_hei |
|
414 | 416 | hei_interf = numpy.asarray(hei_interf)[0] |
|
415 | 417 | #nhei_interf |
|
416 | 418 | if (nhei_interf == None): |
|
417 | 419 | nhei_interf = 5 |
|
418 | 420 | if (nhei_interf < 1): |
|
419 | 421 | nhei_interf = 1 |
|
420 | 422 | if (nhei_interf > count_hei): |
|
421 | 423 | nhei_interf = count_hei |
|
422 | 424 | if (offhei_interf == None): |
|
423 | 425 | offhei_interf = 0 |
|
424 | 426 | |
|
425 | 427 | ind_hei = range(num_hei) |
|
426 | 428 | # mask_prof = numpy.asarray(range(num_prof - 2)) + 1 |
|
427 | 429 | # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1 |
|
428 | 430 | mask_prof = numpy.asarray(range(num_prof)) |
|
429 | 431 | num_mask_prof = mask_prof.size |
|
430 | 432 | comp_mask_prof = [0, num_prof/2] |
|
431 | 433 | |
|
432 | 434 | |
|
433 | 435 | #noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal |
|
434 | 436 | if (jnoise.size < num_channel or numpy.isnan(jnoise).any()): |
|
435 | 437 | jnoise = numpy.nan |
|
436 | 438 | noise_exist = jnoise[0] < numpy.Inf |
|
437 | 439 | |
|
438 | 440 | #Subrutina de Remocion de la Interferencia |
|
439 | 441 | for ich in range(num_channel): |
|
440 | 442 | #Se ordena los espectros segun su potencia (menor a mayor) |
|
441 | 443 | power = jspectra[ich,mask_prof,:] |
|
442 | 444 | power = power[:,hei_interf] |
|
443 | 445 | power = power.sum(axis = 0) |
|
444 | 446 | psort = power.ravel().argsort() |
|
445 | 447 | |
|
446 | 448 | #Se estima la interferencia promedio en los Espectros de Potencia empleando |
|
447 | 449 | junkspc_interf = jspectra[ich,:,hei_interf[psort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
448 | 450 | |
|
449 | 451 | if noise_exist: |
|
450 | 452 | # tmp_noise = jnoise[ich] / num_prof |
|
451 | 453 | tmp_noise = jnoise[ich] |
|
452 | 454 | junkspc_interf = junkspc_interf - tmp_noise |
|
453 | 455 | #junkspc_interf[:,comp_mask_prof] = 0 |
|
454 | 456 | |
|
455 | 457 | jspc_interf = junkspc_interf.sum(axis = 0) / nhei_interf |
|
456 | 458 | jspc_interf = jspc_interf.transpose() |
|
457 | 459 | #Calculando el espectro de interferencia promedio |
|
458 | 460 | noiseid = numpy.where(jspc_interf <= tmp_noise/ math.sqrt(num_incoh)) |
|
459 | 461 | noiseid = noiseid[0] |
|
460 | 462 | cnoiseid = noiseid.size |
|
461 | 463 | interfid = numpy.where(jspc_interf > tmp_noise/ math.sqrt(num_incoh)) |
|
462 | 464 | interfid = interfid[0] |
|
463 | 465 | cinterfid = interfid.size |
|
464 | 466 | |
|
465 | 467 | if (cnoiseid > 0): jspc_interf[noiseid] = 0 |
|
466 | 468 | |
|
467 | 469 | #Expandiendo los perfiles a limpiar |
|
468 | 470 | if (cinterfid > 0): |
|
469 | 471 | new_interfid = (numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof)%num_prof |
|
470 | 472 | new_interfid = numpy.asarray(new_interfid) |
|
471 | 473 | new_interfid = {x for x in new_interfid} |
|
472 | 474 | new_interfid = numpy.array(list(new_interfid)) |
|
473 | 475 | new_cinterfid = new_interfid.size |
|
474 | 476 | else: new_cinterfid = 0 |
|
475 | 477 | |
|
476 | 478 | for ip in range(new_cinterfid): |
|
477 | 479 | ind = junkspc_interf[:,new_interfid[ip]].ravel().argsort() |
|
478 | 480 | jspc_interf[new_interfid[ip]] = junkspc_interf[ind[nhei_interf/2],new_interfid[ip]] |
|
479 | 481 | |
|
480 | 482 | |
|
481 | 483 | jspectra[ich,:,ind_hei] = jspectra[ich,:,ind_hei] - jspc_interf #Corregir indices |
|
482 | 484 | |
|
483 | 485 | #Removiendo la interferencia del punto de mayor interferencia |
|
484 | 486 | ListAux = jspc_interf[mask_prof].tolist() |
|
485 | 487 | maxid = ListAux.index(max(ListAux)) |
|
486 | 488 | |
|
487 | 489 | |
|
488 | 490 | if cinterfid > 0: |
|
489 | 491 | for ip in range(cinterfid*(interf == 2) - 1): |
|
490 | 492 | ind = (jspectra[ich,interfid[ip],:] < tmp_noise*(1 + 1/math.sqrt(num_incoh))).nonzero() |
|
491 | 493 | cind = len(ind) |
|
492 | 494 | |
|
493 | 495 | if (cind > 0): |
|
494 | 496 | jspectra[ich,interfid[ip],ind] = tmp_noise*(1 + (numpy.random.uniform(cind) - 0.5)/math.sqrt(num_incoh)) |
|
495 | 497 | |
|
496 | 498 | ind = numpy.array([-2,-1,1,2]) |
|
497 | 499 | xx = numpy.zeros([4,4]) |
|
498 | 500 | |
|
499 | 501 | for id1 in range(4): |
|
500 | 502 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
501 | 503 | |
|
502 | 504 | xx_inv = numpy.linalg.inv(xx) |
|
503 | 505 | xx = xx_inv[:,0] |
|
504 | 506 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
505 | 507 | yy = jspectra[ich,mask_prof[ind],:] |
|
506 | 508 | jspectra[ich,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
507 | 509 | |
|
508 | 510 | |
|
509 | 511 | indAux = (jspectra[ich,:,:] < tmp_noise*(1-1/math.sqrt(num_incoh))).nonzero() |
|
510 | 512 | jspectra[ich,indAux[0],indAux[1]] = tmp_noise * (1 - 1/math.sqrt(num_incoh)) |
|
511 | 513 | |
|
512 | 514 | #Remocion de Interferencia en el Cross Spectra |
|
513 | 515 | if jcspectra == None: return jspectra, jcspectra |
|
514 | 516 | num_pairs = jcspectra.size/(num_prof*num_hei) |
|
515 | 517 | jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei) |
|
516 | 518 | |
|
517 | 519 | for ip in range(num_pairs): |
|
518 | 520 | |
|
519 | 521 | #------------------------------------------- |
|
520 | 522 | |
|
521 | 523 | cspower = numpy.abs(jcspectra[ip,mask_prof,:]) |
|
522 | 524 | cspower = cspower[:,hei_interf] |
|
523 | 525 | cspower = cspower.sum(axis = 0) |
|
524 | 526 | |
|
525 | 527 | cspsort = cspower.ravel().argsort() |
|
526 | 528 | junkcspc_interf = jcspectra[ip,:,hei_interf[cspsort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
527 | 529 | junkcspc_interf = junkcspc_interf.transpose() |
|
528 | 530 | jcspc_interf = junkcspc_interf.sum(axis = 1)/nhei_interf |
|
529 | 531 | |
|
530 | 532 | ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort() |
|
531 | 533 | |
|
532 | 534 | median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
533 | 535 | median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
534 | 536 | junkcspc_interf[comp_mask_prof,:] = numpy.complex(median_real, median_imag) |
|
535 | 537 | |
|
536 | 538 | for iprof in range(num_prof): |
|
537 | 539 | ind = numpy.abs(junkcspc_interf[iprof,:]).ravel().argsort() |
|
538 | 540 | jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf/2]] |
|
539 | 541 | |
|
540 | 542 | #Removiendo la Interferencia |
|
541 | 543 | jcspectra[ip,:,ind_hei] = jcspectra[ip,:,ind_hei] - jcspc_interf |
|
542 | 544 | |
|
543 | 545 | ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist() |
|
544 | 546 | maxid = ListAux.index(max(ListAux)) |
|
545 | 547 | |
|
546 | 548 | ind = numpy.array([-2,-1,1,2]) |
|
547 | 549 | xx = numpy.zeros([4,4]) |
|
548 | 550 | |
|
549 | 551 | for id1 in range(4): |
|
550 | 552 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
551 | 553 | |
|
552 | 554 | xx_inv = numpy.linalg.inv(xx) |
|
553 | 555 | xx = xx_inv[:,0] |
|
554 | 556 | |
|
555 | 557 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
556 | 558 | yy = jcspectra[ip,mask_prof[ind],:] |
|
557 | 559 | jcspectra[ip,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
558 | 560 | |
|
559 | 561 | #Guardar Resultados |
|
560 | 562 | self.dataOut.data_spc = jspectra |
|
561 | 563 | self.dataOut.data_cspc = jcspectra |
|
562 | 564 | |
|
563 | 565 | return 1 |
|
564 | 566 | |
|
565 | 567 | def setRadarFrequency(self, frequency=None): |
|
566 | 568 | if frequency != None: |
|
567 | 569 | self.dataOut.frequency = frequency |
|
568 | 570 | |
|
569 | 571 | return 1 |
|
570 | 572 | |
|
571 | 573 | def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None): |
|
572 | 574 | #validacion de rango |
|
573 | 575 | if minHei == None: |
|
574 | 576 | minHei = self.dataOut.heightList[0] |
|
575 | 577 | |
|
576 | 578 | if maxHei == None: |
|
577 | 579 | maxHei = self.dataOut.heightList[-1] |
|
578 | 580 | |
|
579 | 581 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
580 | 582 | print 'minHei: %.2f is out of the heights range'%(minHei) |
|
581 | 583 | print 'minHei is setting to %.2f'%(self.dataOut.heightList[0]) |
|
582 | 584 | minHei = self.dataOut.heightList[0] |
|
583 | 585 | |
|
584 | 586 | if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei): |
|
585 | 587 | print 'maxHei: %.2f is out of the heights range'%(maxHei) |
|
586 | 588 | print 'maxHei is setting to %.2f'%(self.dataOut.heightList[-1]) |
|
587 | 589 | maxHei = self.dataOut.heightList[-1] |
|
588 | 590 | |
|
589 | 591 | # validacion de velocidades |
|
590 | 592 | velrange = self.dataOut.getVelRange(1) |
|
591 | 593 | |
|
592 | 594 | if minVel == None: |
|
593 | 595 | minVel = velrange[0] |
|
594 | 596 | |
|
595 | 597 | if maxVel == None: |
|
596 | 598 | maxVel = velrange[-1] |
|
597 | 599 | |
|
598 | 600 | if (minVel < velrange[0]) or (minVel > maxVel): |
|
599 | 601 | print 'minVel: %.2f is out of the velocity range'%(minVel) |
|
600 | 602 | print 'minVel is setting to %.2f'%(velrange[0]) |
|
601 | 603 | minVel = velrange[0] |
|
602 | 604 | |
|
603 | 605 | if (maxVel > velrange[-1]) or (maxVel < minVel): |
|
604 | 606 | print 'maxVel: %.2f is out of the velocity range'%(maxVel) |
|
605 | 607 | print 'maxVel is setting to %.2f'%(velrange[-1]) |
|
606 | 608 | maxVel = velrange[-1] |
|
607 | 609 | |
|
608 | 610 | # seleccion de indices para rango |
|
609 | 611 | minIndex = 0 |
|
610 | 612 | maxIndex = 0 |
|
611 | 613 | heights = self.dataOut.heightList |
|
612 | 614 | |
|
613 | 615 | inda = numpy.where(heights >= minHei) |
|
614 | 616 | indb = numpy.where(heights <= maxHei) |
|
615 | 617 | |
|
616 | 618 | try: |
|
617 | 619 | minIndex = inda[0][0] |
|
618 | 620 | except: |
|
619 | 621 | minIndex = 0 |
|
620 | 622 | |
|
621 | 623 | try: |
|
622 | 624 | maxIndex = indb[0][-1] |
|
623 | 625 | except: |
|
624 | 626 | maxIndex = len(heights) |
|
625 | 627 | |
|
626 | 628 | if (minIndex < 0) or (minIndex > maxIndex): |
|
627 | 629 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
628 | 630 | |
|
629 | 631 | if (maxIndex >= self.dataOut.nHeights): |
|
630 | 632 | maxIndex = self.dataOut.nHeights-1 |
|
631 | 633 | |
|
632 | 634 | # seleccion de indices para velocidades |
|
633 | 635 | indminvel = numpy.where(velrange >= minVel) |
|
634 | 636 | indmaxvel = numpy.where(velrange <= maxVel) |
|
635 | 637 | try: |
|
636 | 638 | minIndexVel = indminvel[0][0] |
|
637 | 639 | except: |
|
638 | 640 | minIndexVel = 0 |
|
639 | 641 | |
|
640 | 642 | try: |
|
641 | 643 | maxIndexVel = indmaxvel[0][-1] |
|
642 | 644 | except: |
|
643 | 645 | maxIndexVel = len(velrange) |
|
644 | 646 | |
|
645 | 647 | #seleccion del espectro |
|
646 | 648 | data_spc = self.dataOut.data_spc[:,minIndexVel:maxIndexVel+1,minIndex:maxIndex+1] |
|
647 | 649 | #estimacion de ruido |
|
648 | 650 | noise = numpy.zeros(self.dataOut.nChannels) |
|
649 | 651 | |
|
650 | 652 | for channel in range(self.dataOut.nChannels): |
|
651 | 653 | daux = data_spc[channel,:,:] |
|
652 | 654 | noise[channel] = hildebrand_sekhon(daux, self.dataOut.nIncohInt) |
|
653 | 655 | |
|
654 | 656 | self.dataOut.noise_estimation = noise.copy() |
|
655 | 657 | |
|
656 | 658 | return 1 |
|
657 | 659 | |
|
658 | 660 | class IncohInt(Operation): |
|
659 | 661 | |
|
660 | 662 | |
|
661 | 663 | __profIndex = 0 |
|
662 | 664 | __withOverapping = False |
|
663 | 665 | |
|
664 | 666 | __byTime = False |
|
665 | 667 | __initime = None |
|
666 | 668 | __lastdatatime = None |
|
667 | 669 | __integrationtime = None |
|
668 | 670 | |
|
669 | 671 | __buffer_spc = None |
|
670 | 672 | __buffer_cspc = None |
|
671 | 673 | __buffer_dc = None |
|
672 | 674 | |
|
673 | 675 | __dataReady = False |
|
674 | 676 | |
|
675 | 677 | __timeInterval = None |
|
676 | 678 | |
|
677 | 679 | n = None |
|
678 | 680 | |
|
679 | 681 | |
|
680 | 682 | |
|
681 | 683 | def __init__(self): |
|
682 | 684 | |
|
683 | 685 | Operation.__init__(self) |
|
684 | 686 | # self.isConfig = False |
|
685 | 687 | |
|
686 | 688 | def setup(self, n=None, timeInterval=None, overlapping=False): |
|
687 | 689 | """ |
|
688 | 690 | Set the parameters of the integration class. |
|
689 | 691 | |
|
690 | 692 | Inputs: |
|
691 | 693 | |
|
692 | 694 | n : Number of coherent integrations |
|
693 | 695 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
694 | 696 | overlapping : |
|
695 | 697 | |
|
696 | 698 | """ |
|
697 | 699 | |
|
698 | 700 | self.__initime = None |
|
699 | 701 | self.__lastdatatime = 0 |
|
700 | 702 | self.__buffer_spc = None |
|
701 | 703 | self.__buffer_cspc = None |
|
702 | 704 | self.__buffer_dc = None |
|
703 | 705 | self.__dataReady = False |
|
704 | 706 | |
|
705 | 707 | |
|
706 | 708 | if n == None and timeInterval == None: |
|
707 | 709 | raise ValueError, "n or timeInterval should be specified ..." |
|
708 | 710 | |
|
709 | 711 | if n != None: |
|
710 | 712 | self.n = n |
|
711 | 713 | self.__byTime = False |
|
712 | 714 | else: |
|
713 | 715 | self.__integrationtime = timeInterval #if (type(timeInterval)!=integer) -> change this line |
|
714 | 716 | self.n = 9999 |
|
715 | 717 | self.__byTime = True |
|
716 | 718 | |
|
717 | 719 | if overlapping: |
|
718 | 720 | self.__withOverapping = True |
|
719 | 721 | else: |
|
720 | 722 | self.__withOverapping = False |
|
721 | 723 | self.__buffer_spc = 0 |
|
722 | 724 | self.__buffer_cspc = 0 |
|
723 | 725 | self.__buffer_dc = 0 |
|
724 | 726 | |
|
725 | 727 | self.__profIndex = 0 |
|
726 | 728 | |
|
727 | 729 | def putData(self, data_spc, data_cspc, data_dc): |
|
728 | 730 | |
|
729 | 731 | """ |
|
730 | 732 | Add a profile to the __buffer_spc and increase in one the __profileIndex |
|
731 | 733 | |
|
732 | 734 | """ |
|
733 | 735 | |
|
734 | 736 | if not self.__withOverapping: |
|
735 | 737 | self.__buffer_spc += data_spc |
|
736 | 738 | |
|
737 | 739 | if data_cspc == None: |
|
738 | 740 | self.__buffer_cspc = None |
|
739 | 741 | else: |
|
740 | 742 | self.__buffer_cspc += data_cspc |
|
741 | 743 | |
|
742 | 744 | if data_dc == None: |
|
743 | 745 | self.__buffer_dc = None |
|
744 | 746 | else: |
|
745 | 747 | self.__buffer_dc += data_dc |
|
746 | 748 | |
|
747 | 749 | self.__profIndex += 1 |
|
748 | 750 | return |
|
749 | 751 | |
|
750 | 752 | #Overlapping data |
|
751 | 753 | nChannels, nFFTPoints, nHeis = data_spc.shape |
|
752 | 754 | data_spc = numpy.reshape(data_spc, (1, nChannels, nFFTPoints, nHeis)) |
|
753 | 755 | if data_cspc != None: |
|
754 | 756 | data_cspc = numpy.reshape(data_cspc, (1, -1, nFFTPoints, nHeis)) |
|
755 | 757 | if data_dc != None: |
|
756 | 758 | data_dc = numpy.reshape(data_dc, (1, -1, nHeis)) |
|
757 | 759 | |
|
758 | 760 | #If the buffer is empty then it takes the data value |
|
759 | 761 | if self.__buffer_spc == None: |
|
760 | 762 | self.__buffer_spc = data_spc |
|
761 | 763 | |
|
762 | 764 | if data_cspc == None: |
|
763 | 765 | self.__buffer_cspc = None |
|
764 | 766 | else: |
|
765 | 767 | self.__buffer_cspc += data_cspc |
|
766 | 768 | |
|
767 | 769 | if data_dc == None: |
|
768 | 770 | self.__buffer_dc = None |
|
769 | 771 | else: |
|
770 | 772 | self.__buffer_dc += data_dc |
|
771 | 773 | |
|
772 | 774 | self.__profIndex += 1 |
|
773 | 775 | return |
|
774 | 776 | |
|
775 | 777 | #If the buffer length is lower than n then stakcing the data value |
|
776 | 778 | if self.__profIndex < self.n: |
|
777 | 779 | self.__buffer_spc = numpy.vstack((self.__buffer_spc, data_spc)) |
|
778 | 780 | |
|
779 | 781 | if data_cspc != None: |
|
780 | 782 | self.__buffer_cspc = numpy.vstack((self.__buffer_cspc, data_cspc)) |
|
781 | 783 | |
|
782 | 784 | if data_dc != None: |
|
783 | 785 | self.__buffer_dc = numpy.vstack((self.__buffer_dc, data_dc)) |
|
784 | 786 | |
|
785 | 787 | self.__profIndex += 1 |
|
786 | 788 | return |
|
787 | 789 | |
|
788 | 790 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
789 | 791 | self.__buffer_spc = numpy.roll(self.__buffer_spc, -1, axis=0) |
|
790 | 792 | self.__buffer_spc[self.n-1] = data_spc |
|
791 | 793 | |
|
792 | 794 | if data_cspc != None: |
|
793 | 795 | self.__buffer_cspc = numpy.roll(self.__buffer_cspc, -1, axis=0) |
|
794 | 796 | self.__buffer_cspc[self.n-1] = data_cspc |
|
795 | 797 | |
|
796 | 798 | if data_dc != None: |
|
797 | 799 | self.__buffer_dc = numpy.roll(self.__buffer_dc, -1, axis=0) |
|
798 | 800 | self.__buffer_dc[self.n-1] = data_dc |
|
799 | 801 | |
|
800 | 802 | self.__profIndex = self.n |
|
801 | 803 | return |
|
802 | 804 | |
|
803 | 805 | |
|
804 | 806 | def pushData(self): |
|
805 | 807 | """ |
|
806 | 808 | Return the sum of the last profiles and the profiles used in the sum. |
|
807 | 809 | |
|
808 | 810 | Affected: |
|
809 | 811 | |
|
810 | 812 | self.__profileIndex |
|
811 | 813 | |
|
812 | 814 | """ |
|
813 | 815 | data_spc = None |
|
814 | 816 | data_cspc = None |
|
815 | 817 | data_dc = None |
|
816 | 818 | |
|
817 | 819 | if not self.__withOverapping: |
|
818 | 820 | data_spc = self.__buffer_spc |
|
819 | 821 | data_cspc = self.__buffer_cspc |
|
820 | 822 | data_dc = self.__buffer_dc |
|
821 | 823 | |
|
822 | 824 | n = self.__profIndex |
|
823 | 825 | |
|
824 | 826 | self.__buffer_spc = 0 |
|
825 | 827 | self.__buffer_cspc = 0 |
|
826 | 828 | self.__buffer_dc = 0 |
|
827 | 829 | self.__profIndex = 0 |
|
828 | 830 | |
|
829 | 831 | return data_spc, data_cspc, data_dc, n |
|
830 | 832 | |
|
831 | 833 | #Integration with Overlapping |
|
832 | 834 | data_spc = numpy.sum(self.__buffer_spc, axis=0) |
|
833 | 835 | |
|
834 | 836 | if self.__buffer_cspc != None: |
|
835 | 837 | data_cspc = numpy.sum(self.__buffer_cspc, axis=0) |
|
836 | 838 | |
|
837 | 839 | if self.__buffer_dc != None: |
|
838 | 840 | data_dc = numpy.sum(self.__buffer_dc, axis=0) |
|
839 | 841 | |
|
840 | 842 | n = self.__profIndex |
|
841 | 843 | |
|
842 | 844 | return data_spc, data_cspc, data_dc, n |
|
843 | 845 | |
|
844 | 846 | def byProfiles(self, *args): |
|
845 | 847 | |
|
846 | 848 | self.__dataReady = False |
|
847 | 849 | avgdata_spc = None |
|
848 | 850 | avgdata_cspc = None |
|
849 | 851 | avgdata_dc = None |
|
850 | 852 | # n = None |
|
851 | 853 | |
|
852 | 854 | self.putData(*args) |
|
853 | 855 | |
|
854 | 856 | if self.__profIndex == self.n: |
|
855 | 857 | |
|
856 | 858 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
857 | 859 | self.__dataReady = True |
|
858 | 860 | |
|
859 | 861 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
860 | 862 | |
|
861 | 863 | def byTime(self, datatime, *args): |
|
862 | 864 | |
|
863 | 865 | self.__dataReady = False |
|
864 | 866 | avgdata_spc = None |
|
865 | 867 | avgdata_cspc = None |
|
866 | 868 | avgdata_dc = None |
|
867 | 869 | n = None |
|
868 | 870 | |
|
869 | 871 | self.putData(*args) |
|
870 | 872 | |
|
871 | 873 | if (datatime - self.__initime) >= self.__integrationtime: |
|
872 | 874 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
873 | 875 | self.n = n |
|
874 | 876 | self.__dataReady = True |
|
875 | 877 | |
|
876 | 878 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
877 | 879 | |
|
878 | 880 | def integrate(self, datatime, *args): |
|
879 | 881 | |
|
880 | 882 | if self.__initime == None: |
|
881 | 883 | self.__initime = datatime |
|
882 | 884 | |
|
883 | 885 | if self.__byTime: |
|
884 | 886 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(datatime, *args) |
|
885 | 887 | else: |
|
886 | 888 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args) |
|
887 | 889 | |
|
888 | 890 | self.__lastdatatime = datatime |
|
889 | 891 | |
|
890 | 892 | if avgdata_spc == None: |
|
891 | 893 | return None, None, None, None |
|
892 | 894 | |
|
893 | 895 | avgdatatime = self.__initime |
|
894 | 896 | try: |
|
895 | 897 | self.__timeInterval = (self.__lastdatatime - self.__initime)/(self.n - 1) |
|
896 | 898 | except: |
|
897 | 899 | self.__timeInterval = self.__lastdatatime - self.__initime |
|
898 | 900 | |
|
899 | 901 | deltatime = datatime -self.__lastdatatime |
|
900 | 902 | |
|
901 | 903 | if not self.__withOverapping: |
|
902 | 904 | self.__initime = datatime |
|
903 | 905 | else: |
|
904 | 906 | self.__initime += deltatime |
|
905 | 907 | |
|
906 | 908 | return avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc |
|
907 | 909 | |
|
908 | 910 | def run(self, dataOut, n=None, timeInterval=None, overlapping=False): |
|
909 | 911 | |
|
910 | 912 | if n==1: |
|
911 | 913 | dataOut.flagNoData = False |
|
912 | 914 | return |
|
913 | 915 | |
|
914 | 916 | if not self.isConfig: |
|
915 | 917 | self.setup(n, timeInterval, overlapping) |
|
916 | 918 | self.isConfig = True |
|
917 | 919 | |
|
918 | 920 | avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime, |
|
919 | 921 | dataOut.data_spc, |
|
920 | 922 | dataOut.data_cspc, |
|
921 | 923 | dataOut.data_dc) |
|
922 | 924 | |
|
923 | 925 | # dataOut.timeInterval *= n |
|
924 | 926 | dataOut.flagNoData = True |
|
925 | 927 | |
|
926 | 928 | if self.__dataReady: |
|
927 | 929 | |
|
928 | 930 | dataOut.data_spc = avgdata_spc |
|
929 | 931 | dataOut.data_cspc = avgdata_cspc |
|
930 | 932 | dataOut.data_dc = avgdata_dc |
|
931 | 933 | |
|
932 | 934 | dataOut.nIncohInt *= self.n |
|
933 | 935 | dataOut.utctime = avgdatatime |
|
934 | 936 | #dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt * dataOut.nIncohInt * dataOut.nFFTPoints |
|
935 | 937 | # dataOut.timeInterval = self.__timeInterval*self.n |
|
936 | 938 | dataOut.flagNoData = False |
@@ -1,1034 +1,1043 | |||
|
1 | 1 | import numpy |
|
2 | 2 | |
|
3 | 3 | from jroproc_base import ProcessingUnit, Operation |
|
4 | 4 | from schainpy.model.data.jrodata import Voltage |
|
5 | 5 | |
|
6 | 6 | class VoltageProc(ProcessingUnit): |
|
7 | 7 | |
|
8 | 8 | |
|
9 | 9 | def __init__(self): |
|
10 | 10 | |
|
11 | 11 | ProcessingUnit.__init__(self) |
|
12 | 12 | |
|
13 | 13 | # self.objectDict = {} |
|
14 | 14 | self.dataOut = Voltage() |
|
15 | 15 | self.flip = 1 |
|
16 | 16 | |
|
17 | 17 | def run(self): |
|
18 | 18 | if self.dataIn.type == 'AMISR': |
|
19 | 19 | self.__updateObjFromAmisrInput() |
|
20 | 20 | |
|
21 | 21 | if self.dataIn.type == 'Voltage': |
|
22 | 22 | self.dataOut.copy(self.dataIn) |
|
23 | 23 | |
|
24 | 24 | # self.dataOut.copy(self.dataIn) |
|
25 | 25 | |
|
26 | 26 | def __updateObjFromAmisrInput(self): |
|
27 | 27 | |
|
28 | 28 | self.dataOut.timeZone = self.dataIn.timeZone |
|
29 | 29 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
30 | 30 | self.dataOut.errorCount = self.dataIn.errorCount |
|
31 | 31 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
32 | 32 | |
|
33 | 33 | self.dataOut.flagNoData = self.dataIn.flagNoData |
|
34 | 34 | self.dataOut.data = self.dataIn.data |
|
35 | 35 | self.dataOut.utctime = self.dataIn.utctime |
|
36 | 36 | self.dataOut.channelList = self.dataIn.channelList |
|
37 | 37 | self.dataOut.timeInterval = self.dataIn.timeInterval |
|
38 | 38 | self.dataOut.heightList = self.dataIn.heightList |
|
39 | 39 | self.dataOut.nProfiles = self.dataIn.nProfiles |
|
40 | 40 | |
|
41 | 41 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
42 | 42 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
43 | 43 | self.dataOut.frequency = self.dataIn.frequency |
|
44 | 44 | |
|
45 | 45 | self.dataOut.azimuth = self.dataIn.azimuth |
|
46 | 46 | self.dataOut.zenith = self.dataIn.zenith |
|
47 | 47 | |
|
48 | 48 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
49 | 49 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
50 | 50 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
51 | 51 | # |
|
52 | 52 | # pass# |
|
53 | 53 | # |
|
54 | 54 | # def init(self): |
|
55 | 55 | # |
|
56 | 56 | # |
|
57 | 57 | # if self.dataIn.type == 'AMISR': |
|
58 | 58 | # self.__updateObjFromAmisrInput() |
|
59 | 59 | # |
|
60 | 60 | # if self.dataIn.type == 'Voltage': |
|
61 | 61 | # self.dataOut.copy(self.dataIn) |
|
62 | 62 | # # No necesita copiar en cada init() los atributos de dataIn |
|
63 | 63 | # # la copia deberia hacerse por cada nuevo bloque de datos |
|
64 | 64 | |
|
65 | 65 | def selectChannels(self, channelList): |
|
66 | 66 | |
|
67 | 67 | channelIndexList = [] |
|
68 | 68 | |
|
69 | 69 | for channel in channelList: |
|
70 | if channel not in self.dataOut.channelList: | |
|
71 | continue | |
|
72 | ||
|
70 | 73 | index = self.dataOut.channelList.index(channel) |
|
71 | 74 | channelIndexList.append(index) |
|
72 | 75 | |
|
73 | 76 | self.selectChannelsByIndex(channelIndexList) |
|
74 | 77 | |
|
75 | 78 | def selectChannelsByIndex(self, channelIndexList): |
|
76 | 79 | """ |
|
77 | 80 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
78 | 81 | |
|
79 | 82 | Input: |
|
80 | 83 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
81 | 84 | |
|
82 | 85 | Affected: |
|
83 | 86 | self.dataOut.data |
|
84 | 87 | self.dataOut.channelIndexList |
|
85 | 88 | self.dataOut.nChannels |
|
86 | 89 | self.dataOut.m_ProcessingHeader.totalSpectra |
|
87 | 90 | self.dataOut.systemHeaderObj.numChannels |
|
88 | 91 | self.dataOut.m_ProcessingHeader.blockSize |
|
89 | 92 | |
|
90 | 93 | Return: |
|
91 | 94 | None |
|
92 | 95 | """ |
|
93 | 96 | |
|
94 | 97 | for channelIndex in channelIndexList: |
|
95 | 98 | if channelIndex not in self.dataOut.channelIndexList: |
|
96 | 99 | print channelIndexList |
|
97 | 100 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
98 | 101 | |
|
99 | 102 | # nChannels = len(channelIndexList) |
|
100 | 103 | if self.dataOut.flagDataAsBlock: |
|
101 | 104 | """ |
|
102 | 105 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
103 | 106 | """ |
|
104 | 107 | data = self.dataOut.data[channelIndexList,:,:] |
|
105 | 108 | else: |
|
106 | 109 | data = self.dataOut.data[channelIndexList,:] |
|
107 | 110 | |
|
108 | 111 | self.dataOut.data = data |
|
109 | 112 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
110 | 113 | # self.dataOut.nChannels = nChannels |
|
111 | 114 | |
|
112 | 115 | return 1 |
|
113 | 116 | |
|
114 | 117 | def selectHeights(self, minHei=None, maxHei=None): |
|
115 | 118 | """ |
|
116 | 119 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
117 | 120 | minHei <= height <= maxHei |
|
118 | 121 | |
|
119 | 122 | Input: |
|
120 | 123 | minHei : valor minimo de altura a considerar |
|
121 | 124 | maxHei : valor maximo de altura a considerar |
|
122 | 125 | |
|
123 | 126 | Affected: |
|
124 | 127 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
125 | 128 | |
|
126 | 129 | Return: |
|
127 | 130 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
128 | 131 | """ |
|
129 | 132 | |
|
130 | 133 | if minHei == None: |
|
131 | 134 | minHei = self.dataOut.heightList[0] |
|
132 | 135 | |
|
133 | 136 | if maxHei == None: |
|
134 | 137 | maxHei = self.dataOut.heightList[-1] |
|
135 | 138 | |
|
136 | 139 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
137 | 140 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
138 | 141 | |
|
139 | 142 | |
|
140 | 143 | if (maxHei > self.dataOut.heightList[-1]): |
|
141 | 144 | maxHei = self.dataOut.heightList[-1] |
|
142 | 145 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
143 | 146 | |
|
144 | 147 | minIndex = 0 |
|
145 | 148 | maxIndex = 0 |
|
146 | 149 | heights = self.dataOut.heightList |
|
147 | 150 | |
|
148 | 151 | inda = numpy.where(heights >= minHei) |
|
149 | 152 | indb = numpy.where(heights <= maxHei) |
|
150 | 153 | |
|
151 | 154 | try: |
|
152 | 155 | minIndex = inda[0][0] |
|
153 | 156 | except: |
|
154 | 157 | minIndex = 0 |
|
155 | 158 | |
|
156 | 159 | try: |
|
157 | 160 | maxIndex = indb[0][-1] |
|
158 | 161 | except: |
|
159 | 162 | maxIndex = len(heights) |
|
160 | 163 | |
|
161 | 164 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
162 | 165 | |
|
163 | 166 | return 1 |
|
164 | 167 | |
|
165 | 168 | |
|
166 | 169 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
167 | 170 | """ |
|
168 | 171 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
169 | 172 | minIndex <= index <= maxIndex |
|
170 | 173 | |
|
171 | 174 | Input: |
|
172 | 175 | minIndex : valor de indice minimo de altura a considerar |
|
173 | 176 | maxIndex : valor de indice maximo de altura a considerar |
|
174 | 177 | |
|
175 | 178 | Affected: |
|
176 | 179 | self.dataOut.data |
|
177 | 180 | self.dataOut.heightList |
|
178 | 181 | |
|
179 | 182 | Return: |
|
180 | 183 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
181 | 184 | """ |
|
182 | 185 | |
|
183 | 186 | if (minIndex < 0) or (minIndex > maxIndex): |
|
184 | 187 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
185 | 188 | |
|
186 | 189 | if (maxIndex >= self.dataOut.nHeights): |
|
187 | 190 | maxIndex = self.dataOut.nHeights |
|
188 | 191 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
189 | 192 | |
|
190 | 193 | # nHeights = maxIndex - minIndex + 1 |
|
191 | 194 | |
|
192 | 195 | #voltage |
|
193 | 196 | if self.dataOut.flagDataAsBlock: |
|
194 | 197 | """ |
|
195 | 198 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
196 | 199 | """ |
|
197 | 200 | data = self.dataOut.data[:,minIndex:maxIndex,:] |
|
198 | 201 | else: |
|
199 | 202 | data = self.dataOut.data[:,minIndex:maxIndex] |
|
200 | 203 | |
|
201 | 204 | # firstHeight = self.dataOut.heightList[minIndex] |
|
202 | 205 | |
|
203 | 206 | self.dataOut.data = data |
|
204 | 207 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex] |
|
205 | 208 | |
|
206 | 209 | return 1 |
|
207 | 210 | |
|
208 | 211 | |
|
209 | 212 | def filterByHeights(self, window): |
|
210 | 213 | |
|
211 | 214 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
212 | 215 | |
|
213 | 216 | if window == None: |
|
214 | 217 | window = (self.dataOut.radarControllerHeaderObj.txA/self.dataOut.radarControllerHeaderObj.nBaud) / deltaHeight |
|
215 | 218 | |
|
216 | 219 | newdelta = deltaHeight * window |
|
217 | 220 | r = self.dataOut.nHeights % window |
|
218 | 221 | |
|
219 | 222 | if self.dataOut.flagDataAsBlock: |
|
220 | 223 | """ |
|
221 | 224 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
222 | 225 | """ |
|
223 | 226 | buffer = self.dataOut.data[:, :, 0:self.dataOut.nHeights-r] |
|
224 | 227 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nProfiles,self.dataOut.nHeights/window,window) |
|
225 | 228 | buffer = numpy.sum(buffer,3) |
|
226 | 229 | |
|
227 | 230 | else: |
|
228 | 231 | buffer = self.dataOut.data[:,0:self.dataOut.nHeights-r] |
|
229 | 232 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nHeights/window,window) |
|
230 | 233 | buffer = numpy.sum(buffer,2) |
|
231 | 234 | |
|
232 | 235 | self.dataOut.data = buffer.copy() |
|
233 | 236 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*(self.dataOut.nHeights-r)/window,newdelta) |
|
234 | 237 | self.dataOut.windowOfFilter = window |
|
235 | 238 | |
|
236 | 239 | def setH0(self, h0, deltaHeight = None): |
|
237 | 240 | |
|
238 | 241 | if not deltaHeight: |
|
239 | 242 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
240 | 243 | |
|
241 | 244 | nHeights = self.dataOut.nHeights |
|
242 | 245 | |
|
243 | 246 | newHeiRange = h0 + numpy.arange(nHeights)*deltaHeight |
|
244 | 247 | |
|
245 | 248 | self.dataOut.heightList = newHeiRange |
|
246 | 249 | |
|
247 | 250 | def deFlip(self, channelList = []): |
|
248 | 251 | |
|
249 | 252 | data = self.dataOut.data.copy() |
|
250 | 253 | |
|
251 | 254 | if self.dataOut.flagDataAsBlock: |
|
252 | 255 | flip = self.flip |
|
253 | 256 | profileList = range(self.dataOut.nProfiles) |
|
254 | 257 | |
|
255 | 258 | if channelList == []: |
|
256 | 259 | for thisProfile in profileList: |
|
257 | 260 | data[:,thisProfile,:] = data[:,thisProfile,:]*flip |
|
258 | 261 | flip *= -1.0 |
|
259 | 262 | else: |
|
260 | 263 | for thisChannel in channelList: |
|
264 | if thisChannel not in self.dataOut.channelList: | |
|
265 | continue | |
|
266 | ||
|
261 | 267 | for thisProfile in profileList: |
|
262 | 268 | data[thisChannel,thisProfile,:] = data[thisChannel,thisProfile,:]*flip |
|
263 | 269 | flip *= -1.0 |
|
264 | 270 | |
|
265 | 271 | self.flip = flip |
|
266 | 272 | |
|
267 | 273 | else: |
|
268 | 274 | if channelList == []: |
|
269 | 275 | data[:,:] = data[:,:]*self.flip |
|
270 | 276 | else: |
|
271 | 277 | for thisChannel in channelList: |
|
278 | if thisChannel not in self.dataOut.channelList: | |
|
279 | continue | |
|
280 | ||
|
272 | 281 | data[thisChannel,:] = data[thisChannel,:]*self.flip |
|
273 | 282 | |
|
274 | 283 | self.flip *= -1. |
|
275 | 284 | |
|
276 | 285 | self.dataOut.data = data |
|
277 | 286 | |
|
278 | 287 | def setRadarFrequency(self, frequency=None): |
|
279 | 288 | |
|
280 | 289 | if frequency != None: |
|
281 | 290 | self.dataOut.frequency = frequency |
|
282 | 291 | |
|
283 | 292 | return 1 |
|
284 | 293 | |
|
285 | 294 | class CohInt(Operation): |
|
286 | 295 | |
|
287 | 296 | isConfig = False |
|
288 | 297 | |
|
289 | 298 | __profIndex = 0 |
|
290 | 299 | __withOverapping = False |
|
291 | 300 | |
|
292 | 301 | __byTime = False |
|
293 | 302 | __initime = None |
|
294 | 303 | __lastdatatime = None |
|
295 | 304 | __integrationtime = None |
|
296 | 305 | |
|
297 | 306 | __buffer = None |
|
298 | 307 | |
|
299 | 308 | __dataReady = False |
|
300 | 309 | |
|
301 | 310 | n = None |
|
302 | 311 | |
|
303 | 312 | |
|
304 | 313 | def __init__(self): |
|
305 | 314 | |
|
306 | 315 | Operation.__init__(self) |
|
307 | 316 | |
|
308 | 317 | # self.isConfig = False |
|
309 | 318 | |
|
310 | 319 | def setup(self, n=None, timeInterval=None, overlapping=False, byblock=False): |
|
311 | 320 | """ |
|
312 | 321 | Set the parameters of the integration class. |
|
313 | 322 | |
|
314 | 323 | Inputs: |
|
315 | 324 | |
|
316 | 325 | n : Number of coherent integrations |
|
317 | 326 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
318 | 327 | overlapping : |
|
319 | 328 | |
|
320 | 329 | """ |
|
321 | 330 | |
|
322 | 331 | self.__initime = None |
|
323 | 332 | self.__lastdatatime = 0 |
|
324 | 333 | self.__buffer = None |
|
325 | 334 | self.__dataReady = False |
|
326 | 335 | self.byblock = byblock |
|
327 | 336 | |
|
328 | 337 | if n == None and timeInterval == None: |
|
329 | 338 | raise ValueError, "n or timeInterval should be specified ..." |
|
330 | 339 | |
|
331 | 340 | if n != None: |
|
332 | 341 | self.n = n |
|
333 | 342 | self.__byTime = False |
|
334 | 343 | else: |
|
335 | 344 | self.__integrationtime = timeInterval #* 60. #if (type(timeInterval)!=integer) -> change this line |
|
336 | 345 | self.n = 9999 |
|
337 | 346 | self.__byTime = True |
|
338 | 347 | |
|
339 | 348 | if overlapping: |
|
340 | 349 | self.__withOverapping = True |
|
341 | 350 | self.__buffer = None |
|
342 | 351 | else: |
|
343 | 352 | self.__withOverapping = False |
|
344 | 353 | self.__buffer = 0 |
|
345 | 354 | |
|
346 | 355 | self.__profIndex = 0 |
|
347 | 356 | |
|
348 | 357 | def putData(self, data): |
|
349 | 358 | |
|
350 | 359 | """ |
|
351 | 360 | Add a profile to the __buffer and increase in one the __profileIndex |
|
352 | 361 | |
|
353 | 362 | """ |
|
354 | 363 | |
|
355 | 364 | if not self.__withOverapping: |
|
356 | 365 | self.__buffer += data.copy() |
|
357 | 366 | self.__profIndex += 1 |
|
358 | 367 | return |
|
359 | 368 | |
|
360 | 369 | #Overlapping data |
|
361 | 370 | nChannels, nHeis = data.shape |
|
362 | 371 | data = numpy.reshape(data, (1, nChannels, nHeis)) |
|
363 | 372 | |
|
364 | 373 | #If the buffer is empty then it takes the data value |
|
365 | 374 | if self.__buffer == None: |
|
366 | 375 | self.__buffer = data |
|
367 | 376 | self.__profIndex += 1 |
|
368 | 377 | return |
|
369 | 378 | |
|
370 | 379 | #If the buffer length is lower than n then stakcing the data value |
|
371 | 380 | if self.__profIndex < self.n: |
|
372 | 381 | self.__buffer = numpy.vstack((self.__buffer, data)) |
|
373 | 382 | self.__profIndex += 1 |
|
374 | 383 | return |
|
375 | 384 | |
|
376 | 385 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
377 | 386 | self.__buffer = numpy.roll(self.__buffer, -1, axis=0) |
|
378 | 387 | self.__buffer[self.n-1] = data |
|
379 | 388 | self.__profIndex = self.n |
|
380 | 389 | return |
|
381 | 390 | |
|
382 | 391 | |
|
383 | 392 | def pushData(self): |
|
384 | 393 | """ |
|
385 | 394 | Return the sum of the last profiles and the profiles used in the sum. |
|
386 | 395 | |
|
387 | 396 | Affected: |
|
388 | 397 | |
|
389 | 398 | self.__profileIndex |
|
390 | 399 | |
|
391 | 400 | """ |
|
392 | 401 | |
|
393 | 402 | if not self.__withOverapping: |
|
394 | 403 | data = self.__buffer |
|
395 | 404 | n = self.__profIndex |
|
396 | 405 | |
|
397 | 406 | self.__buffer = 0 |
|
398 | 407 | self.__profIndex = 0 |
|
399 | 408 | |
|
400 | 409 | return data, n |
|
401 | 410 | |
|
402 | 411 | #Integration with Overlapping |
|
403 | 412 | data = numpy.sum(self.__buffer, axis=0) |
|
404 | 413 | n = self.__profIndex |
|
405 | 414 | |
|
406 | 415 | return data, n |
|
407 | 416 | |
|
408 | 417 | def byProfiles(self, data): |
|
409 | 418 | |
|
410 | 419 | self.__dataReady = False |
|
411 | 420 | avgdata = None |
|
412 | 421 | # n = None |
|
413 | 422 | |
|
414 | 423 | self.putData(data) |
|
415 | 424 | |
|
416 | 425 | if self.__profIndex == self.n: |
|
417 | 426 | |
|
418 | 427 | avgdata, n = self.pushData() |
|
419 | 428 | self.__dataReady = True |
|
420 | 429 | |
|
421 | 430 | return avgdata |
|
422 | 431 | |
|
423 | 432 | def byTime(self, data, datatime): |
|
424 | 433 | |
|
425 | 434 | self.__dataReady = False |
|
426 | 435 | avgdata = None |
|
427 | 436 | n = None |
|
428 | 437 | |
|
429 | 438 | self.putData(data) |
|
430 | 439 | |
|
431 | 440 | if (datatime - self.__initime) >= self.__integrationtime: |
|
432 | 441 | avgdata, n = self.pushData() |
|
433 | 442 | self.n = n |
|
434 | 443 | self.__dataReady = True |
|
435 | 444 | |
|
436 | 445 | return avgdata |
|
437 | 446 | |
|
438 | 447 | def integrate(self, data, datatime=None): |
|
439 | 448 | |
|
440 | 449 | if self.__initime == None: |
|
441 | 450 | self.__initime = datatime |
|
442 | 451 | |
|
443 | 452 | if self.__byTime: |
|
444 | 453 | avgdata = self.byTime(data, datatime) |
|
445 | 454 | else: |
|
446 | 455 | avgdata = self.byProfiles(data) |
|
447 | 456 | |
|
448 | 457 | |
|
449 | 458 | self.__lastdatatime = datatime |
|
450 | 459 | |
|
451 | 460 | if avgdata == None: |
|
452 | 461 | return None, None |
|
453 | 462 | |
|
454 | 463 | avgdatatime = self.__initime |
|
455 | 464 | |
|
456 | 465 | deltatime = datatime -self.__lastdatatime |
|
457 | 466 | |
|
458 | 467 | if not self.__withOverapping: |
|
459 | 468 | self.__initime = datatime |
|
460 | 469 | else: |
|
461 | 470 | self.__initime += deltatime |
|
462 | 471 | |
|
463 | 472 | return avgdata, avgdatatime |
|
464 | 473 | |
|
465 | 474 | def integrateByBlock(self, dataOut): |
|
466 | 475 | |
|
467 | 476 | times = int(dataOut.data.shape[1]/self.n) |
|
468 | 477 | avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=numpy.complex) |
|
469 | 478 | |
|
470 | 479 | id_min = 0 |
|
471 | 480 | id_max = self.n |
|
472 | 481 | |
|
473 | 482 | for i in range(times): |
|
474 | 483 | junk = dataOut.data[:,id_min:id_max,:] |
|
475 | 484 | avgdata[:,i,:] = junk.sum(axis=1) |
|
476 | 485 | id_min += self.n |
|
477 | 486 | id_max += self.n |
|
478 | 487 | |
|
479 | 488 | timeInterval = dataOut.ippSeconds*self.n |
|
480 | 489 | avgdatatime = (times - 1) * timeInterval + dataOut.utctime |
|
481 | 490 | self.__dataReady = True |
|
482 | 491 | return avgdata, avgdatatime |
|
483 | 492 | |
|
484 | 493 | def run(self, dataOut, **kwargs): |
|
485 | 494 | |
|
486 | 495 | if not self.isConfig: |
|
487 | 496 | self.setup(**kwargs) |
|
488 | 497 | self.isConfig = True |
|
489 | 498 | |
|
490 | 499 | if dataOut.flagDataAsBlock: |
|
491 | 500 | """ |
|
492 | 501 | Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
493 | 502 | """ |
|
494 | 503 | avgdata, avgdatatime = self.integrateByBlock(dataOut) |
|
495 | 504 | else: |
|
496 | 505 | avgdata, avgdatatime = self.integrate(dataOut.data, dataOut.utctime) |
|
497 | 506 | |
|
498 | 507 | # dataOut.timeInterval *= n |
|
499 | 508 | dataOut.flagNoData = True |
|
500 | 509 | |
|
501 | 510 | if self.__dataReady: |
|
502 | 511 | dataOut.data = avgdata |
|
503 | 512 | dataOut.nCohInt *= self.n |
|
504 | 513 | dataOut.utctime = avgdatatime |
|
505 | 514 | # dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt |
|
506 | 515 | dataOut.flagNoData = False |
|
507 | 516 | |
|
508 | 517 | class Decoder(Operation): |
|
509 | 518 | |
|
510 | 519 | isConfig = False |
|
511 | 520 | __profIndex = 0 |
|
512 | 521 | |
|
513 | 522 | code = None |
|
514 | 523 | |
|
515 | 524 | nCode = None |
|
516 | 525 | nBaud = None |
|
517 | 526 | |
|
518 | 527 | |
|
519 | 528 | def __init__(self): |
|
520 | 529 | |
|
521 | 530 | Operation.__init__(self) |
|
522 | 531 | |
|
523 | 532 | self.times = None |
|
524 | 533 | self.osamp = None |
|
525 | 534 | # self.__setValues = False |
|
526 | 535 | self.isConfig = False |
|
527 | 536 | |
|
528 | 537 | def setup(self, code, osamp, dataOut): |
|
529 | 538 | |
|
530 | 539 | self.__profIndex = 0 |
|
531 | 540 | |
|
532 | 541 | self.code = code |
|
533 | 542 | |
|
534 | 543 | self.nCode = len(code) |
|
535 | 544 | self.nBaud = len(code[0]) |
|
536 | 545 | |
|
537 | 546 | if (osamp != None) and (osamp >1): |
|
538 | 547 | self.osamp = osamp |
|
539 | 548 | self.code = numpy.repeat(code, repeats=self.osamp, axis=1) |
|
540 | 549 | self.nBaud = self.nBaud*self.osamp |
|
541 | 550 | |
|
542 | 551 | self.__nChannels = dataOut.nChannels |
|
543 | 552 | self.__nProfiles = dataOut.nProfiles |
|
544 | 553 | self.__nHeis = dataOut.nHeights |
|
545 | 554 | |
|
546 | 555 | if dataOut.flagDataAsBlock: |
|
547 | 556 | |
|
548 | 557 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
549 | 558 | |
|
550 | 559 | self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) |
|
551 | 560 | |
|
552 | 561 | else: |
|
553 | 562 | |
|
554 | 563 | __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) |
|
555 | 564 | |
|
556 | 565 | __codeBuffer[:,0:self.nBaud] = self.code |
|
557 | 566 | |
|
558 | 567 | self.fft_code = numpy.conj(numpy.fft.fft(__codeBuffer, axis=1)) |
|
559 | 568 | |
|
560 | 569 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
561 | 570 | |
|
562 | 571 | self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) |
|
563 | 572 | |
|
564 | 573 | def convolutionInFreq(self, data): |
|
565 | 574 | |
|
566 | 575 | fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
567 | 576 | |
|
568 | 577 | fft_data = numpy.fft.fft(data, axis=1) |
|
569 | 578 | |
|
570 | 579 | conv = fft_data*fft_code |
|
571 | 580 | |
|
572 | 581 | data = numpy.fft.ifft(conv,axis=1) |
|
573 | 582 | |
|
574 | 583 | datadec = data#[:,:] |
|
575 | 584 | |
|
576 | 585 | return datadec |
|
577 | 586 | |
|
578 | 587 | def convolutionInFreqOpt(self, data): |
|
579 | 588 | |
|
580 | 589 | raise NotImplementedError |
|
581 | 590 | |
|
582 | 591 | # fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
583 | 592 | # |
|
584 | 593 | # data = cfunctions.decoder(fft_code, data) |
|
585 | 594 | # |
|
586 | 595 | # datadec = data#[:,:] |
|
587 | 596 | # |
|
588 | 597 | # return datadec |
|
589 | 598 | |
|
590 | 599 | def convolutionInTime(self, data): |
|
591 | 600 | |
|
592 | 601 | code = self.code[self.__profIndex] |
|
593 | 602 | |
|
594 | 603 | for i in range(self.__nChannels): |
|
595 | 604 | self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='same') |
|
596 | 605 | |
|
597 | 606 | return self.datadecTime |
|
598 | 607 | |
|
599 | 608 | def convolutionByBlockInTime(self, data): |
|
600 | 609 | |
|
601 | 610 | repetitions = self.__nProfiles / self.nCode |
|
602 | 611 | |
|
603 | 612 | junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize)) |
|
604 | 613 | junk = junk.flatten() |
|
605 | 614 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) |
|
606 | 615 | |
|
607 | 616 | for i in range(self.__nChannels): |
|
608 | 617 | for j in range(self.__nProfiles): |
|
609 | 618 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='same') |
|
610 | 619 | |
|
611 | 620 | return self.datadecTime |
|
612 | 621 | |
|
613 | 622 | def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, times=None, osamp=None): |
|
614 | 623 | |
|
615 | 624 | if not self.isConfig: |
|
616 | 625 | |
|
617 | 626 | if code == None: |
|
618 | 627 | code = dataOut.code |
|
619 | 628 | else: |
|
620 | 629 | code = numpy.array(code).reshape(nCode,nBaud) |
|
621 | 630 | |
|
622 | 631 | self.setup(code, osamp, dataOut) |
|
623 | 632 | |
|
624 | 633 | self.isConfig = True |
|
625 | 634 | |
|
626 | 635 | if dataOut.flagDataAsBlock: |
|
627 | 636 | """ |
|
628 | 637 | Decoding when data have been read as block, |
|
629 | 638 | """ |
|
630 | 639 | datadec = self.convolutionByBlockInTime(dataOut.data) |
|
631 | 640 | |
|
632 | 641 | else: |
|
633 | 642 | """ |
|
634 | 643 | Decoding when data have been read profile by profile |
|
635 | 644 | """ |
|
636 | 645 | if mode == 0: |
|
637 | 646 | datadec = self.convolutionInTime(dataOut.data) |
|
638 | 647 | |
|
639 | 648 | if mode == 1: |
|
640 | 649 | datadec = self.convolutionInFreq(dataOut.data) |
|
641 | 650 | |
|
642 | 651 | if mode == 2: |
|
643 | 652 | datadec = self.convolutionInFreqOpt(dataOut.data) |
|
644 | 653 | |
|
645 | 654 | dataOut.code = self.code |
|
646 | 655 | dataOut.nCode = self.nCode |
|
647 | 656 | dataOut.nBaud = self.nBaud |
|
648 | 657 | dataOut.radarControllerHeaderObj.code = self.code |
|
649 | 658 | dataOut.radarControllerHeaderObj.nCode = self.nCode |
|
650 | 659 | dataOut.radarControllerHeaderObj.nBaud = self.nBaud |
|
651 | 660 | |
|
652 | 661 | dataOut.data = datadec |
|
653 | 662 | |
|
654 | 663 | dataOut.heightList = dataOut.heightList[0:self.ndatadec] |
|
655 | 664 | |
|
656 | 665 | dataOut.flagDecodeData = True #asumo q la data esta decodificada |
|
657 | 666 | |
|
658 | 667 | if self.__profIndex == self.nCode-1: |
|
659 | 668 | self.__profIndex = 0 |
|
660 | 669 | return 1 |
|
661 | 670 | |
|
662 | 671 | self.__profIndex += 1 |
|
663 | 672 | |
|
664 | 673 | return 1 |
|
665 | 674 | # dataOut.flagDeflipData = True #asumo q la data no esta sin flip |
|
666 | 675 | |
|
667 | 676 | |
|
668 | 677 | class ProfileConcat(Operation): |
|
669 | 678 | |
|
670 | 679 | isConfig = False |
|
671 | 680 | buffer = None |
|
672 | 681 | |
|
673 | 682 | def __init__(self): |
|
674 | 683 | |
|
675 | 684 | Operation.__init__(self) |
|
676 | 685 | self.profileIndex = 0 |
|
677 | 686 | |
|
678 | 687 | def reset(self): |
|
679 | 688 | self.buffer = numpy.zeros_like(self.buffer) |
|
680 | 689 | self.start_index = 0 |
|
681 | 690 | self.times = 1 |
|
682 | 691 | |
|
683 | 692 | def setup(self, data, m, n=1): |
|
684 | 693 | self.buffer = numpy.zeros((data.shape[0],data.shape[1]*m),dtype=type(data[0,0])) |
|
685 | 694 | self.nHeights = data.nHeights |
|
686 | 695 | self.start_index = 0 |
|
687 | 696 | self.times = 1 |
|
688 | 697 | |
|
689 | 698 | def concat(self, data): |
|
690 | 699 | |
|
691 | 700 | self.buffer[:,self.start_index:self.profiles*self.times] = data.copy() |
|
692 | 701 | self.start_index = self.start_index + self.nHeights |
|
693 | 702 | |
|
694 | 703 | def run(self, dataOut, m): |
|
695 | 704 | |
|
696 | 705 | dataOut.flagNoData = True |
|
697 | 706 | |
|
698 | 707 | if not self.isConfig: |
|
699 | 708 | self.setup(dataOut.data, m, 1) |
|
700 | 709 | self.isConfig = True |
|
701 | 710 | |
|
702 | 711 | if dataOut.flagDataAsBlock: |
|
703 | 712 | |
|
704 | 713 | raise ValueError, "ProfileConcat can only be used when voltage have been read profile by profile, getBlock = False" |
|
705 | 714 | |
|
706 | 715 | else: |
|
707 | 716 | self.concat(dataOut.data) |
|
708 | 717 | self.times += 1 |
|
709 | 718 | if self.times > m: |
|
710 | 719 | dataOut.data = self.buffer |
|
711 | 720 | self.reset() |
|
712 | 721 | dataOut.flagNoData = False |
|
713 | 722 | # se deben actualizar mas propiedades del header y del objeto dataOut, por ejemplo, las alturas |
|
714 | 723 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
715 | 724 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * m |
|
716 | 725 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
717 | 726 | dataOut.ippSeconds *= m |
|
718 | 727 | |
|
719 | 728 | class ProfileSelector(Operation): |
|
720 | 729 | |
|
721 | 730 | profileIndex = None |
|
722 | 731 | # Tamanho total de los perfiles |
|
723 | 732 | nProfiles = None |
|
724 | 733 | |
|
725 | 734 | def __init__(self): |
|
726 | 735 | |
|
727 | 736 | Operation.__init__(self) |
|
728 | 737 | self.profileIndex = 0 |
|
729 | 738 | |
|
730 | 739 | def incIndex(self): |
|
731 | 740 | |
|
732 | 741 | self.profileIndex += 1 |
|
733 | 742 | |
|
734 | 743 | if self.profileIndex >= self.nProfiles: |
|
735 | 744 | self.profileIndex = 0 |
|
736 | 745 | |
|
737 | 746 | def isThisProfileInRange(self, profileIndex, minIndex, maxIndex): |
|
738 | 747 | |
|
739 | 748 | if profileIndex < minIndex: |
|
740 | 749 | return False |
|
741 | 750 | |
|
742 | 751 | if profileIndex > maxIndex: |
|
743 | 752 | return False |
|
744 | 753 | |
|
745 | 754 | return True |
|
746 | 755 | |
|
747 | 756 | def isThisProfileInList(self, profileIndex, profileList): |
|
748 | 757 | |
|
749 | 758 | if profileIndex not in profileList: |
|
750 | 759 | return False |
|
751 | 760 | |
|
752 | 761 | return True |
|
753 | 762 | |
|
754 | 763 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None): |
|
755 | 764 | |
|
756 | 765 | """ |
|
757 | 766 | ProfileSelector: |
|
758 | 767 | |
|
759 | 768 | Inputs: |
|
760 | 769 | profileList : Index of profiles selected. Example: profileList = (0,1,2,7,8) |
|
761 | 770 | |
|
762 | 771 | profileRangeList : Minimum and maximum profile indexes. Example: profileRangeList = (4, 30) |
|
763 | 772 | |
|
764 | 773 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) |
|
765 | 774 | |
|
766 | 775 | """ |
|
767 | 776 | |
|
768 | 777 | dataOut.flagNoData = True |
|
769 | 778 | self.nProfiles = dataOut.nProfiles |
|
770 | 779 | |
|
771 | 780 | if dataOut.flagDataAsBlock: |
|
772 | 781 | """ |
|
773 | 782 | data dimension = [nChannels, nProfiles, nHeis] |
|
774 | 783 | """ |
|
775 | 784 | if profileList != None: |
|
776 | 785 | dataOut.data = dataOut.data[:,profileList,:] |
|
777 | 786 | dataOut.nProfiles = len(profileList) |
|
778 | 787 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
779 | 788 | else: |
|
780 | 789 | minIndex = profileRangeList[0] |
|
781 | 790 | maxIndex = profileRangeList[1] |
|
782 | 791 | |
|
783 | 792 | dataOut.data = dataOut.data[:,minIndex:maxIndex+1,:] |
|
784 | 793 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
785 | 794 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
786 | 795 | |
|
787 | 796 | dataOut.flagNoData = False |
|
788 | 797 | |
|
789 | 798 | return True |
|
790 | 799 | |
|
791 | 800 | else: |
|
792 | 801 | """ |
|
793 | 802 | data dimension = [nChannels, nHeis] |
|
794 | 803 | |
|
795 | 804 | """ |
|
796 | 805 | if profileList != None: |
|
797 | 806 | |
|
798 | 807 | dataOut.nProfiles = len(profileList) |
|
799 | 808 | |
|
800 | 809 | if self.isThisProfileInList(dataOut.profileIndex, profileList): |
|
801 | 810 | dataOut.flagNoData = False |
|
802 | 811 | dataOut.profileIndex = self.profileIndex |
|
803 | 812 | |
|
804 | 813 | self.incIndex() |
|
805 | 814 | return True |
|
806 | 815 | |
|
807 | 816 | |
|
808 | 817 | if profileRangeList != None: |
|
809 | 818 | |
|
810 | 819 | minIndex = profileRangeList[0] |
|
811 | 820 | maxIndex = profileRangeList[1] |
|
812 | 821 | |
|
813 | 822 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
814 | 823 | |
|
815 | 824 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
816 | 825 | dataOut.flagNoData = False |
|
817 | 826 | dataOut.profileIndex = self.profileIndex |
|
818 | 827 | |
|
819 | 828 | self.incIndex() |
|
820 | 829 | return True |
|
821 | 830 | |
|
822 | 831 | if rangeList != None: |
|
823 | 832 | |
|
824 | 833 | nProfiles = 0 |
|
825 | 834 | |
|
826 | 835 | for thisRange in rangeList: |
|
827 | 836 | minIndex = thisRange[0] |
|
828 | 837 | maxIndex = thisRange[1] |
|
829 | 838 | |
|
830 | 839 | nProfiles += maxIndex - minIndex + 1 |
|
831 | 840 | |
|
832 | 841 | dataOut.nProfiles = nProfiles |
|
833 | 842 | |
|
834 | 843 | for thisRange in rangeList: |
|
835 | 844 | |
|
836 | 845 | minIndex = thisRange[0] |
|
837 | 846 | maxIndex = thisRange[1] |
|
838 | 847 | |
|
839 | 848 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
840 | 849 | |
|
841 | 850 | # print "profileIndex = ", dataOut.profileIndex |
|
842 | 851 | |
|
843 | 852 | dataOut.flagNoData = False |
|
844 | 853 | dataOut.profileIndex = self.profileIndex |
|
845 | 854 | |
|
846 | 855 | self.incIndex() |
|
847 | 856 | break |
|
848 | 857 | return True |
|
849 | 858 | |
|
850 | 859 | |
|
851 | 860 | if beam != None: #beam is only for AMISR data |
|
852 | 861 | if self.isThisProfileInList(dataOut.profileIndex, dataOut.beamRangeDict[beam]): |
|
853 | 862 | dataOut.flagNoData = False |
|
854 | 863 | dataOut.profileIndex = self.profileIndex |
|
855 | 864 | |
|
856 | 865 | self.incIndex() |
|
857 | 866 | return 1 |
|
858 | 867 | |
|
859 | 868 | raise ValueError, "ProfileSelector needs profileList or profileRangeList" |
|
860 | 869 | |
|
861 | 870 | return 0 |
|
862 | 871 | |
|
863 | 872 | |
|
864 | 873 | |
|
865 | 874 | class Reshaper(Operation): |
|
866 | 875 | |
|
867 | 876 | def __init__(self): |
|
868 | 877 | |
|
869 | 878 | Operation.__init__(self) |
|
870 | 879 | self.updateNewHeights = True |
|
871 | 880 | |
|
872 | 881 | def run(self, dataOut, shape): |
|
873 | 882 | |
|
874 | 883 | if not dataOut.flagDataAsBlock: |
|
875 | 884 | raise ValueError, "Reshaper can only be used when voltage have been read as Block, getBlock = True" |
|
876 | 885 | |
|
877 | 886 | if len(shape) != 3: |
|
878 | 887 | raise ValueError, "shape len should be equal to 3, (nChannels, nProfiles, nHeis)" |
|
879 | 888 | |
|
880 | 889 | shape_tuple = tuple(shape) |
|
881 | 890 | dataOut.data = numpy.reshape(dataOut.data, shape_tuple) |
|
882 | 891 | dataOut.flagNoData = False |
|
883 | 892 | |
|
884 | 893 | if self.updateNewHeights: |
|
885 | 894 | |
|
886 | 895 | old_nheights = dataOut.nHeights |
|
887 | 896 | new_nheights = dataOut.data.shape[2] |
|
888 | 897 | factor = 1.0*new_nheights / old_nheights |
|
889 | 898 | |
|
890 | 899 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
891 | 900 | |
|
892 | 901 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor |
|
893 | 902 | |
|
894 | 903 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
895 | 904 | |
|
896 | 905 | dataOut.nProfiles = dataOut.data.shape[1] |
|
897 | 906 | |
|
898 | 907 | dataOut.ippSeconds *= factor |
|
899 | 908 | |
|
900 | 909 | import collections |
|
901 | 910 | from scipy.stats import mode |
|
902 | 911 | |
|
903 | 912 | class Synchronize(Operation): |
|
904 | 913 | |
|
905 | 914 | isConfig = False |
|
906 | 915 | __profIndex = 0 |
|
907 | 916 | |
|
908 | 917 | def __init__(self): |
|
909 | 918 | |
|
910 | 919 | Operation.__init__(self) |
|
911 | 920 | # self.isConfig = False |
|
912 | 921 | self.__powBuffer = None |
|
913 | 922 | self.__startIndex = 0 |
|
914 | 923 | self.__pulseFound = False |
|
915 | 924 | |
|
916 | 925 | def __findTxPulse(self, dataOut, channel=0, pulse_with = None): |
|
917 | 926 | |
|
918 | 927 | #Read data |
|
919 | 928 | |
|
920 | 929 | powerdB = dataOut.getPower(channel = channel) |
|
921 | 930 | noisedB = dataOut.getNoise(channel = channel)[0] |
|
922 | 931 | |
|
923 | 932 | self.__powBuffer.extend(powerdB.flatten()) |
|
924 | 933 | |
|
925 | 934 | dataArray = numpy.array(self.__powBuffer) |
|
926 | 935 | |
|
927 | 936 | filteredPower = numpy.correlate(dataArray, dataArray[0:self.__nSamples], "same") |
|
928 | 937 | |
|
929 | 938 | maxValue = numpy.nanmax(filteredPower) |
|
930 | 939 | |
|
931 | 940 | if maxValue < noisedB + 10: |
|
932 | 941 | #No se encuentra ningun pulso de transmision |
|
933 | 942 | return None |
|
934 | 943 | |
|
935 | 944 | maxValuesIndex = numpy.where(filteredPower > maxValue - 0.1*abs(maxValue))[0] |
|
936 | 945 | |
|
937 | 946 | if len(maxValuesIndex) < 2: |
|
938 | 947 | #Solo se encontro un solo pulso de transmision de un baudio, esperando por el siguiente TX |
|
939 | 948 | return None |
|
940 | 949 | |
|
941 | 950 | phasedMaxValuesIndex = maxValuesIndex - self.__nSamples |
|
942 | 951 | |
|
943 | 952 | #Seleccionar solo valores con un espaciamiento de nSamples |
|
944 | 953 | pulseIndex = numpy.intersect1d(maxValuesIndex, phasedMaxValuesIndex) |
|
945 | 954 | |
|
946 | 955 | if len(pulseIndex) < 2: |
|
947 | 956 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
948 | 957 | return None |
|
949 | 958 | |
|
950 | 959 | spacing = pulseIndex[1:] - pulseIndex[:-1] |
|
951 | 960 | |
|
952 | 961 | #remover senales que se distancien menos de 10 unidades o muestras |
|
953 | 962 | #(No deberian existir IPP menor a 10 unidades) |
|
954 | 963 | |
|
955 | 964 | realIndex = numpy.where(spacing > 10 )[0] |
|
956 | 965 | |
|
957 | 966 | if len(realIndex) < 2: |
|
958 | 967 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
959 | 968 | return None |
|
960 | 969 | |
|
961 | 970 | #Eliminar pulsos anchos (deja solo la diferencia entre IPPs) |
|
962 | 971 | realPulseIndex = pulseIndex[realIndex] |
|
963 | 972 | |
|
964 | 973 | period = mode(realPulseIndex[1:] - realPulseIndex[:-1])[0][0] |
|
965 | 974 | |
|
966 | 975 | print "IPP = %d samples" %period |
|
967 | 976 | |
|
968 | 977 | self.__newNSamples = dataOut.nHeights #int(period) |
|
969 | 978 | self.__startIndex = int(realPulseIndex[0]) |
|
970 | 979 | |
|
971 | 980 | return 1 |
|
972 | 981 | |
|
973 | 982 | |
|
974 | 983 | def setup(self, nSamples, nChannels, buffer_size = 4): |
|
975 | 984 | |
|
976 | 985 | self.__powBuffer = collections.deque(numpy.zeros( buffer_size*nSamples,dtype=numpy.float), |
|
977 | 986 | maxlen = buffer_size*nSamples) |
|
978 | 987 | |
|
979 | 988 | bufferList = [] |
|
980 | 989 | |
|
981 | 990 | for i in range(nChannels): |
|
982 | 991 | bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, |
|
983 | 992 | maxlen = buffer_size*nSamples) |
|
984 | 993 | |
|
985 | 994 | bufferList.append(bufferByChannel) |
|
986 | 995 | |
|
987 | 996 | self.__nSamples = nSamples |
|
988 | 997 | self.__nChannels = nChannels |
|
989 | 998 | self.__bufferList = bufferList |
|
990 | 999 | |
|
991 | 1000 | def run(self, dataOut, channel = 0): |
|
992 | 1001 | |
|
993 | 1002 | if not self.isConfig: |
|
994 | 1003 | nSamples = dataOut.nHeights |
|
995 | 1004 | nChannels = dataOut.nChannels |
|
996 | 1005 | self.setup(nSamples, nChannels) |
|
997 | 1006 | self.isConfig = True |
|
998 | 1007 | |
|
999 | 1008 | #Append new data to internal buffer |
|
1000 | 1009 | for thisChannel in range(self.__nChannels): |
|
1001 | 1010 | bufferByChannel = self.__bufferList[thisChannel] |
|
1002 | 1011 | bufferByChannel.extend(dataOut.data[thisChannel]) |
|
1003 | 1012 | |
|
1004 | 1013 | if self.__pulseFound: |
|
1005 | 1014 | self.__startIndex -= self.__nSamples |
|
1006 | 1015 | |
|
1007 | 1016 | #Finding Tx Pulse |
|
1008 | 1017 | if not self.__pulseFound: |
|
1009 | 1018 | indexFound = self.__findTxPulse(dataOut, channel) |
|
1010 | 1019 | |
|
1011 | 1020 | if indexFound == None: |
|
1012 | 1021 | dataOut.flagNoData = True |
|
1013 | 1022 | return |
|
1014 | 1023 | |
|
1015 | 1024 | self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) |
|
1016 | 1025 | self.__pulseFound = True |
|
1017 | 1026 | self.__startIndex = indexFound |
|
1018 | 1027 | |
|
1019 | 1028 | #If pulse was found ... |
|
1020 | 1029 | for thisChannel in range(self.__nChannels): |
|
1021 | 1030 | bufferByChannel = self.__bufferList[thisChannel] |
|
1022 | 1031 | #print self.__startIndex |
|
1023 | 1032 | x = numpy.array(bufferByChannel) |
|
1024 | 1033 | self.__arrayBuffer[thisChannel] = x[self.__startIndex:self.__startIndex+self.__newNSamples] |
|
1025 | 1034 | |
|
1026 | 1035 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
1027 | 1036 | dataOut.heightList = numpy.arange(self.__newNSamples)*deltaHeight |
|
1028 | 1037 | # dataOut.ippSeconds = (self.__newNSamples / deltaHeight)/1e6 |
|
1029 | 1038 | |
|
1030 | 1039 | dataOut.data = self.__arrayBuffer |
|
1031 | 1040 | |
|
1032 | 1041 | self.__startIndex += self.__newNSamples |
|
1033 | 1042 | |
|
1034 | 1043 | return No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now