##// END OF EJS Templates
SCHAIN GUI:...
Miguel Valdez -
r637:bd043f195012
parent child
Show More
@@ -1,5676 +1,5719
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 numpy
10 10 import Queue
11 11
12 12 from collections import OrderedDict
13 13 from os.path import expanduser
14 14 from time import sleep
15 # from gevent import sleep
16
15 17 import ast
16 18
17 19 from PyQt4.QtGui import QMainWindow
18 20 from PyQt4.QtCore import pyqtSignature
19 21 from PyQt4.QtCore import pyqtSignal
20 22 from PyQt4 import QtCore
21 23 from PyQt4 import QtGui
24 # from PyQt4.QtCore import QThread
25 # from PyQt4.QtCore import QObject, SIGNAL
22 26
23 27 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
24 28 from schainpy.gui.viewer.ui_ftp import Ui_Ftp
25 29 from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow
26 from schainpy.controller import Project, ControllerThread
30 from schainpy.controller_api import ControllerThread
31 from schainpy.controller import Project
27 32
28 33 from propertiesViewModel import TreeModel, PropertyBuffer
29 34 from parametersModel import ProjectParms
30 35
31 36 from schainpy.gui.figures import tools
32 37
33 38 FIGURES_PATH = tools.get_path()
34 39 TEMPORAL_FILE = ".temp.xml"
35 40
36 41 def isRadarFile(file):
37 try:
38 year = int(file[1:5])
39 doy = int(file[5:8])
40 set = int(file[8:11])
41 except:
42 return 0
43
44 return 1
42 try:
43 year = int(file[1:5])
44 doy = int(file[5:8])
45 set = int(file[8:11])
46 except:
47 return 0
48
49 return 1
45 50
46 51 def isRadarPath(path):
47 try:
48 year = int(path[1:5])
49 doy = int(path[5:8])
50 except:
51 return 0
52
53 return 1
52 try:
53 year = int(path[1:5])
54 doy = int(path[5:8])
55 except:
56 return 0
57
58 return 1
54 59
55 60 class BasicWindow(QMainWindow, Ui_BasicWindow):
56 61 """
57 62 """
58 63 def __init__(self, parent=None):
59 64 """
60 65
61 66 """
62 67 QMainWindow.__init__(self, parent)
63 68 self.setupUi(self)
64 69 self.__puObjDict = {}
65 70 self.__itemTreeDict = {}
66 71 self.readUnitConfObjList = []
67 72 self.operObjList = []
68 73 self.projecObjView = None
69 74 self.idProject = 0
70 75 # self.idImag = 0
71 76
72 77 self.idImagscope = 0
73 78 self.idImagspectra = 0
74 79 self.idImagcross = 0
75 80 self.idImagrti = 0
76 81 self.idImagcoherence = 0
77 82 self.idImagpower = 0
78 83 self.idImagrtinoise = 0
79 84 self.idImagspectraHeis = 0
80 85 self.idImagrtiHeis = 0
81 86
82 87 self.dataPath = None
83 88 self.online = 0
84 89 self.walk = 0
85 90 self.create = False
86 91 self.selectedItemTree = None
87 self.controllerObj = None
92 self.controllerThread = None
88 93 # self.commCtrlPThread = None
89 94 # self.create_figure()
90 95 self.temporalFTP = ftpBuffer()
91 96 self.projectProperCaracteristica = []
92 97 self.projectProperPrincipal = []
93 98 self.projectProperDescripcion = []
94 99 self.volProperCaracteristica = []
95 100 self.volProperPrincipal = []
96 101 self.volProperDescripcion = []
97 102 self.specProperCaracteristica = []
98 103 self.specProperPrincipal = []
99 104 self.specProperDescripcion = []
100 105
101 106 self.specHeisProperCaracteristica = []
102 107 self.specHeisProperPrincipal = []
103 108 self.specHeisProperDescripcion = []
104 109
105 110 # self.pathWorkSpace = './'
106 111
107 112 self.__projectObjDict = {}
108 113 self.__operationObjDict = {}
109 114
110 115 self.__puLocalFolder2FTP = {}
111 self.__initialized = False
116 self.__enable = False
112 117
113 118 # self.create_comm()
114 119 self.create_updating_timer()
115 self.setParameter()
120 self.setGUIStatus()
116 121
117 122 @pyqtSignature("")
118 123 def on_actionOpen_triggered(self):
119 124 """
120 125 Slot documentation goes here.
121 126 """
122 127 self.openProject()
123 128
124 129 @pyqtSignature("")
125 130 def on_actionCreate_triggered(self):
126 131 """
127 132 Slot documentation goes here.
128 133 """
129 134 self.setInputsProject_View()
130 135 self.create = True
131 136
132 137 @pyqtSignature("")
133 138 def on_actionSave_triggered(self):
134 139 """
135 140 Slot documentation goes here.
136 141 """
137 142 self.saveProject()
138 143
139 144 @pyqtSignature("")
140 145 def on_actionClose_triggered(self):
141 146 """
142 147 Slot documentation goes here.
143 148 """
144 149 self.close()
145 150
146 151 @pyqtSignature("")
147 152 def on_actionStart_triggered(self):
148 153 """
149 154 """
150 155 self.playProject()
151 156
152 157 @pyqtSignature("")
153 158 def on_actionPause_triggered(self):
154 159 """
155 160 """
156 161 self.pauseProject()
157 162
158 163 @pyqtSignature("")
159 164 def on_actionStop_triggered(self):
160 165 """
161 166 """
162 167 self.stopProject()
163 168
164 169 @pyqtSignature("")
165 170 def on_actionFTP_triggered(self):
166 171 """
167 172 """
168 173 self.configFTPWindowObj = Ftp(self)
169 174
170 175 if not self.temporalFTP.create:
171 176 self.temporalFTP.setwithoutconfiguration()
172 177
173 178 self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server,
174 179 self.temporalFTP.remotefolder,
175 180 self.temporalFTP.username,
176 181 self.temporalFTP.password,
177 182 self.temporalFTP.ftp_wei,
178 183 self.temporalFTP.exp_code,
179 184 self.temporalFTP.sub_exp_code,
180 185 self.temporalFTP.plot_pos)
181 186
182 187 self.configFTPWindowObj.show()
183 188 self.configFTPWindowObj.closed.connect(self.createFTPConfig)
184 189
185 190 def createFTPConfig(self):
186 191
187 192 if not self.configFTPWindowObj.create:
188 193 self.console.clear()
189 194 self.console.append("There is no FTP configuration")
190 195 return
191 196
192 197 self.console.append("Push Ok in Spectra view to Add FTP Configuration")
193 198
194 199 server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow()
195 200 self.temporalFTP.save(server=server,
196 201 remotefolder=remotefolder,
197 202 username=username,
198 203 password=password,
199 204 ftp_wei=ftp_wei,
200 205 exp_code=exp_code,
201 206 sub_exp_code=sub_exp_code,
202 207 plot_pos=plot_pos)
203 208
204 209 @pyqtSignature("")
205 210 def on_actionOpenToolbar_triggered(self):
206 211 """
207 212 Slot documentation goes here.
208 213 """
209 214 self.openProject()
210 215
211 216 @pyqtSignature("")
212 217 def on_actionCreateToolbar_triggered(self):
213 218 """
214 219 Slot documentation goes here.
215 220 """
216 221 self.setInputsProject_View()
217 222 self.create = True
218 223
219 224 @pyqtSignature("")
220 225 def on_actionAddPU_triggered(self):
221 226 if len(self.__projectObjDict) == 0:
222 227 outputstr = "First Create a Project then add Processing Unit"
223 228 self.console.clear()
224 229 self.console.append(outputstr)
225 230 return 0
226 231 else:
227 232 self.addPUWindow()
228 233 self.console.clear()
229 234 self.console.append("Please, Choose the type of Processing Unit")
230 235 self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage")
231 236 self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation")
232 237 self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis")
233 238
234 239
235 240 @pyqtSignature("")
236 241 def on_actionSaveToolbar_triggered(self):
237 242 """
238 243 Slot documentation goes here.
239 244 """
240 245 self.saveProject()
241 246
242 247 @pyqtSignature("")
243 248 def on_actionStarToolbar_triggered(self):
244 249 """
245 250 Slot documentation goes here.
246 251 """
247 252 self.playProject()
248 253
249 254 @pyqtSignature("")
250 255 def on_actionPauseToolbar_triggered(self):
251 256
252 257 self.pauseProject()
253 258
254 259 @pyqtSignature("")
255 260 def on_actionStopToolbar_triggered(self):
256 261 """
257 262 Slot documentation goes here.
258 263 """
259 264 self.stopProject()
260 265
261 266 @pyqtSignature("int")
262 267 def on_proComReadMode_activated(self, index):
263 268 """
264 269 SELECCION DEL MODO DE LECTURA ON=1, OFF=0
265 270 """
266 271 if index == 0:
267 272 self.online = 0
268 273 self.proDelay.setText("0")
269 274 self.proSet.setText("")
270 275 self.proSet.setEnabled(False)
271 276 self.proDelay.setEnabled(False)
272 277 elif index == 1:
273 278 self.online = 1
274 self.proSet.setText(" ")
279 self.proSet.setText("")
275 280 self.proDelay.setText("5")
276 281 self.proSet.setEnabled(True)
277 self.proDelay.setEnabled(True)
282 self.proDelay.setEnabled(True)
278 283
279 284 @pyqtSignature("int")
280 285 def on_proComDataType_activated(self, index):
281 286 """
282 287 Voltage or Spectra
283 288 """
284 289 self.labelSet.show()
285 290 self.proSet.show()
286 291
292 self.labExpLabel.show()
293 self.proExpLabel.show()
294
287 295 self.labelIPPKm.hide()
288 296 self.proIPPKm.hide()
289 297
290 298 if index == 0:
291 299 extension = '.r'
292 300 elif index == 1:
293 301 extension = '.pdata'
294 302 elif index == 2:
295 303 extension = '.fits'
296 304 elif index == 3:
297 305 extension = '.hdf5'
298 306
299 self.labelSet.hide()
300 self.proSet.hide()
301 307 self.labelIPPKm.show()
302 308 self.proIPPKm.show()
303 309
310 self.labelSet.hide()
311 self.proSet.hide()
312
313 self.labExpLabel.hide()
314 self.proExpLabel.hide()
315
304 316 self.proDataType.setText(extension)
305 317
306 318 @pyqtSignature("int")
307 319 def on_proComWalk_activated(self, index):
308 320 """
309 321
310 322 """
311 323 if index == 0:
312 324 self.walk = 0
313 325 elif index == 1:
314 326 self.walk = 1
315 327
316 328 @pyqtSignature("")
317 329 def on_proToolPath_clicked(self):
318 330 """
319 331 Choose your path
320 332 """
321 333
322 334 current_dpath = './'
323 335 if self.dataPath:
324 336 current_dpath = self.dataPath
325 337
326 338 datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly))
327 339
328 340 #If it was canceled
329 341 if not datapath:
330 342 return
331 343
332 344 #If any change was done
333 345 if datapath == self.dataPath:
334 346 return
335 347
336 348 self.proDataPath.setText(datapath)
337 349
338 350 self.actionStart.setEnabled(False)
339 351 self.actionStarToolbar.setEnabled(False)
340 352 self.proOk.setEnabled(False)
341 353
342 354 self.proComStartDate.clear()
343 355 self.proComEndDate.clear()
344 356
345 357 if not os.path.exists(datapath):
346 358
347 359 self.console.clear()
348 self.console.append("Write a correct a path")
360 self.console.append("Write a valid path")
349 361 return
350 362
351 363 self.dataPath = datapath
352 364
353 365 self.console.clear()
354 366 self.console.append("Select the read mode and press 'load button'")
355 367
356 368
357 369 @pyqtSignature("")
358 370 def on_proLoadButton_clicked(self):
359 371
360 372 self.console.clear()
361 373
362 374 parameter_list = self.checkInputsProject()
363 375
364 376 if not parameter_list[0]:
365 377 return
366 378
367 parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set = parameter_list
379 parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list
368 380
369 381 if read_mode == "Offline":
370 382 self.proComStartDate.clear()
371 383 self.proComEndDate.clear()
372 384 self.proComStartDate.setEnabled(True)
373 385 self.proComEndDate.setEnabled(True)
374 386 self.proStartTime.setEnabled(True)
375 387 self.proEndTime.setEnabled(True)
376 388 self.frame_2.setEnabled(True)
377 389
378 390 if read_mode == "Online":
379 self.proComStartDate.addItem("2000/01/30")
380 self.proComEndDate.addItem("2016/12/31")
391 self.proComStartDate.addItem("1960/01/30")
392 self.proComEndDate.addItem("2018/12/31")
381 393 self.proComStartDate.setEnabled(False)
382 394 self.proComEndDate.setEnabled(False)
383 395 self.proStartTime.setEnabled(False)
384 396 self.proEndTime.setEnabled(False)
385 397 self.frame_2.setEnabled(True)
386 398
387 self.loadDays(data_path, ext, walk)
399 self.loadDays(data_path, ext, walk, expLabel)
388 400
389 401 @pyqtSignature("int")
390 402 def on_proComStartDate_activated(self, index):
391 403 """
392 404 SELECCION DEL RANGO DE FECHAS -START DATE
393 405 """
394 406 stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1
395 407
396 408 self.proComEndDate.clear()
397 409 for i in self.dateList[index:]:
398 410 self.proComEndDate.addItem(i)
399 411
400 412 if self.proComEndDate.count() - stopIndex - 1 >= 0:
401 413 self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1)
402 414 else:
403 415 self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1)
404 416
405 417 @pyqtSignature("int")
406 418 def on_proComEndDate_activated(self, index):
407 419 """
408 420 SELECCION DEL RANGO DE FECHAS-END DATE
409 421 """
410 422 pass
411 423
412 424 @pyqtSignature("")
413 425 def on_proOk_clicked(self):
414 426 """
415 427 Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml.
416 428 Prepara la configuración del diágrama del Arbol del treeView numero 2
417 429 """
418 430
419 431 self.actionStart.setEnabled(False)
420 432 self.actionStarToolbar.setEnabled(False)
421 433
422 434 if self.create:
423 435
424 436 projectId = self.__getNewProjectId()
425 437
426 438 if not projectId:
427 439 return 0
428 440
429 441 projectObjView = self.createProjectView(projectId)
430 442
431 443 if not projectObjView:
432 444 return 0
433 445
434 446 readUnitObj = self.createReadUnitView(projectObjView)
435 447
436 448 if not readUnitObj:
437 449 return 0
438 450
439 451 else:
440 452 projectObjView = self.updateProjectView()
441 453
442 454 if not projectObjView:
443 455 return 0
444 456
445 457 projectId = projectObjView.getId()
446 458 idReadUnit = projectObjView.getReadUnitId()
447 459 readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit)
448 460
449 461 if not readUnitObj:
450 462 return 0
451 463
452 464 self.__itemTreeDict[projectId].setText(projectObjView.name)
453 465 # Project Properties
454 466 self.refreshProjectProperties(projectObjView)
455 467 # Disable tabProject after finish the creation
456 468
457 469 self.actionStart.setEnabled(True)
458 470 self.actionStarToolbar.setEnabled(True)
459 471 self.console.clear()
460 472 self.console.append("The project parameters were validated")
461 473
462 474 return 1
463 475
464 476 @pyqtSignature("")
465 477 def on_proClear_clicked(self):
466 478
467 479 self.console.clear()
468 480
469 481 @pyqtSignature("int")
470 482 def on_volOpCebChannels_stateChanged(self, p0):
471 483 """
472 484 Check Box habilita operaciones de Seleccin de Canales
473 485 """
474 486 if p0 == 2:
475 487 self.volOpComChannels.setEnabled(True)
476 488 self.volOpChannel.setEnabled(True)
477 489
478 490 if p0 == 0:
479 491 self.volOpComChannels.setEnabled(False)
480 492 self.volOpChannel.setEnabled(False)
481 493 self.volOpChannel.clear()
482 494
483 495 @pyqtSignature("int")
484 496 def on_volOpCebHeights_stateChanged(self, p0):
485 497 """
486 498 Check Box habilita operaciones de Seleccin de Alturas
487 499 """
488 500 if p0 == 2:
489 501 self.volOpHeights.setEnabled(True)
490 502 self.volOpComHeights.setEnabled(True)
491 503
492 504 if p0 == 0:
493 505 self.volOpHeights.setEnabled(False)
494 506 self.volOpHeights.clear()
495 507 self.volOpComHeights.setEnabled(False)
496 508
497 509 @pyqtSignature("int")
498 510 def on_volOpCebFilter_stateChanged(self, p0):
499 511 """
500 512 Name='Decoder', optype='other'
501 513 """
502 514 if p0 == 2:
503 515 self.volOpFilter.setEnabled(True)
504 516
505 517 if p0 == 0:
506 518 self.volOpFilter.setEnabled(False)
507 519 self.volOpFilter.clear()
508 520
509 521 @pyqtSignature("int")
510 522 def on_volOpCebProfile_stateChanged(self, p0):
511 523 """
512 524 Check Box habilita ingreso del rango de Perfiles
513 525 """
514 526 if p0 == 2:
515 527 self.volOpComProfile.setEnabled(True)
516 528 self.volOpProfile.setEnabled(True)
517 529
518 530 if p0 == 0:
519 531 self.volOpComProfile.setEnabled(False)
520 532 self.volOpProfile.setEnabled(False)
521 533 self.volOpProfile.clear()
522 534
523 535 @pyqtSignature("int")
524 536 def on_volOpComProfile_activated(self, index):
525 537 """
526 538 Check Box habilita ingreso del rango de Perfiles
527 539 """
528 540 #Profile List
529 541 if index == 0:
530 542 self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7')
531 543
532 544 #Profile Range
533 545 if index == 1:
534 546 self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7')
535 547
536 548 #Profile Range List
537 549 if index == 2:
538 550 self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)')
539 551
540 552 @pyqtSignature("int")
541 553 def on_volOpCebDecodification_stateChanged(self, p0):
542 554 """
543 555 Check Box habilita
544 556 """
545 557 if p0 == 2:
546 558 self.volOpComCode.setEnabled(True)
547 559 self.volOpComMode.setEnabled(True)
548 560 if p0 == 0:
549 561 self.volOpComCode.setEnabled(False)
550 562 self.volOpComMode.setEnabled(False)
551 563
552 564 @pyqtSignature("int")
553 565 def on_volOpComCode_activated(self, index):
554 566 """
555 567 Check Box habilita ingreso
556 568 """
557 569 if index == 13:
558 570 self.volOpCode.setEnabled(True)
559 571 else:
560 572 self.volOpCode.setEnabled(False)
561 573
562 574 if index == 0:
563 575 code = ''
564 576 self.volOpCode.setText(str(code))
565 577 return
566 578
567 579 if index == 1:
568 580 code = '(1,1,-1)'
569 581 nCode = '1'
570 582 nBaud = '3'
571 583 if index == 2:
572 584 code = '(1,1,-1,1)'
573 585 nCode = '1'
574 586 nBaud = '4'
575 587 if index == 3:
576 588 code = '(1,1,1,-1,1)'
577 589 nCode = '1'
578 590 nBaud = '5'
579 591 if index == 4:
580 592 code = '(1,1,1,-1,-1,1,-1)'
581 593 nCode = '1'
582 594 nBaud = '7'
583 595 if index == 5:
584 596 code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)'
585 597 nCode = '1'
586 598 nBaud = '11'
587 599 if index == 6:
588 600 code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)'
589 601 nCode = '1'
590 602 nBaud = '13'
591 603 if index == 7:
592 604 code = '(1,1,-1,-1,-1,1)'
593 605 nCode = '2'
594 606 nBaud = '3'
595 607 if index == 8:
596 608 code = '(1,1,-1,1,-1,-1,1,-1)'
597 609 nCode = '2'
598 610 nBaud = '4'
599 611 if index == 9:
600 612 code = '(1,1,1,-1,1,-1,-1,-1,1,-1)'
601 613 nCode = '2'
602 614 nBaud = '5'
603 615 if index == 10:
604 616 code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)'
605 617 nCode = '2'
606 618 nBaud = '7'
607 619 if index == 11:
608 620 code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)'
609 621 nCode = '2'
610 622 nBaud = '11'
611 623 if index == 12:
612 624 code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1)'
613 625 nCode = '2'
614 626 nBaud = '13'
615 627
616 628 code = ast.literal_eval(code)
617 629 nCode = int(nCode)
618 630 nBaud = int(nBaud)
619 631
620 632 code = numpy.asarray(code).reshape((nCode, nBaud)).tolist()
621 633
622 634 self.volOpCode.setText(str(code))
623 635
624 636 @pyqtSignature("int")
625 637 def on_volOpCebFlip_stateChanged(self, p0):
626 638 """
627 639 Check Box habilita ingresode del numero de Integraciones a realizar
628 640 """
629 641 if p0 == 2:
630 642 self.volOpFlip.setEnabled(True)
631 643 if p0 == 0:
632 644 self.volOpFlip.setEnabled(False)
633 645 self.volOpFlip.clear()
634 646
635 647 @pyqtSignature("int")
636 648 def on_volOpCebCohInt_stateChanged(self, p0):
637 649 """
638 650 Check Box habilita ingresode del numero de Integraciones a realizar
639 651 """
640 652 if p0 == 2:
641 653 self.volOpCohInt.setEnabled(True)
642 654 if p0 == 0:
643 655 self.volOpCohInt.setEnabled(False)
644 656 self.volOpCohInt.clear()
645 657
646 658 @pyqtSignature("int")
647 659 def on_volOpCebRadarfrequency_stateChanged(self, p0):
648 660 """
649 661 Check Box habilita ingresode del numero de Integraciones a realizar
650 662 """
651 663 if p0 == 2:
652 664 self.volOpRadarfrequency.setEnabled(True)
653 665 if p0 == 0:
654 666 self.volOpRadarfrequency.clear()
655 667 self.volOpRadarfrequency.setEnabled(False)
656 668
657 669 @pyqtSignature("")
658 670 def on_volOutputToolPath_clicked(self):
659 671 dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
660 672 self.volOutputPath.setText(dirOutPath)
661 673
662 674 @pyqtSignature("")
663 675 def on_specOutputToolPath_clicked(self):
664 676 dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
665 677 self.specOutputPath.setText(dirOutPath)
666 678
667 679 @pyqtSignature("")
668 680 def on_specHeisOutputToolPath_clicked(self):
669 681 dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
670 682 self.specHeisOutputPath.setText(dirOutPath)
671 683
672 684 @pyqtSignature("")
673 685 def on_specHeisOutputMetadaToolPath_clicked(self):
674 686
675 687 filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)")))
676 688 self.specHeisOutputMetada.setText(filename)
677 689
678 690 @pyqtSignature("")
679 691 def on_volOpOk_clicked(self):
680 692 """
681 693 BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO
682 694 PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML
683 695 """
684 696
685 697 checkPath = False
686 698
687 699 self.actionSaveToolbar.setEnabled(False)
688 700 self.actionStarToolbar.setEnabled(False)
689 701
690 702 puObj = self.getSelectedItemObj()
691 703 puObj.removeOperations()
692 704
693 705 if self.volOpCebRadarfrequency.isChecked():
694 706 value = str(self.volOpRadarfrequency.text())
695 707 format = 'float'
696 708 name_operation = 'setRadarFrequency'
697 709 name_parameter = 'frequency'
698 710 if not value == "":
699 711 try:
700 712 radarfreq = float(self.volOpRadarfrequency.text())*1e6
701 713 except:
702 714 self.console.clear()
703 715 self.console.append("Write the parameter Radar Frequency type float")
704 716 return 0
705 717 opObj = puObj.addOperation(name=name_operation)
706 718 opObj.addParameter(name=name_parameter, value=radarfreq, format=format)
707 719
708 720 if self.volOpCebChannels.isChecked():
709 721 value = str(self.volOpChannel.text())
710 722
711 723 if value == "":
712 724 print "Please fill channel list"
713 725 return 0
714 726
715 727 format = 'intlist'
716 728 if self.volOpComChannels.currentIndex() == 0:
717 729 name_operation = "selectChannels"
718 730 name_parameter = 'channelList'
719 731 else:
720 732 name_operation = "selectChannelsByIndex"
721 733 name_parameter = 'channelIndexList'
722 734
723 735 opObj = puObj.addOperation(name=name_operation)
724 736 opObj.addParameter(name=name_parameter, value=value, format=format)
725 737
726 738 if self.volOpCebHeights.isChecked():
727 739 value = str(self.volOpHeights.text())
728 740
729 741 if value == "":
730 742 print "Please fill height range"
731 743 return 0
732 744
733 745 valueList = value.split(',')
734 746 format = 'float'
735 747 if self.volOpComHeights.currentIndex() == 0:
736 748 name_operation = 'selectHeights'
737 749 name_parameter1 = 'minHei'
738 750 name_parameter2 = 'maxHei'
739 751 else:
740 752 name_operation = 'selectHeightsByIndex'
741 753 name_parameter1 = 'minIndex'
742 754 name_parameter2 = 'maxIndex'
743 755
744 756 opObj = puObj.addOperation(name=name_operation)
745 757 opObj.addParameter(name=name_parameter1, value=valueList[0], format=format)
746 758 opObj.addParameter(name=name_parameter2, value=valueList[1], format=format)
747 759
748 760 if self.volOpCebFilter.isChecked():
749 761 value = str(self.volOpFilter.text())
750 762 if value == "":
751 763 print "Please fill filter value"
752 764 return 0
753 765
754 766 format = 'int'
755 767 name_operation = 'filterByHeights'
756 768 name_parameter = 'window'
757 769 opObj = puObj.addOperation(name=name_operation)
758 770 opObj.addParameter(name=name_parameter, value=value, format=format)
759 771
760 772 if self.volOpCebProfile.isChecked():
761 773 value = str(self.volOpProfile.text())
762 774
763 775 if value == "":
764 776 print "Please fill profile value"
765 777 return 0
766 778
767 779 format = 'intlist'
768 780 optype = 'other'
769 781 name_operation = 'ProfileSelector'
770 782 if self.volOpComProfile.currentIndex() == 0:
771 783 name_parameter = 'profileList'
772 784 if self.volOpComProfile.currentIndex() == 1:
773 785 name_parameter = 'profileRangeList'
774 786 if self.volOpComProfile.currentIndex() == 2:
775 787 name_parameter = 'rangeList'
776 788
777 789 opObj = puObj.addOperation(name='ProfileSelector', optype='other')
778 790 opObj.addParameter(name=name_parameter, value=value, format=format)
779 791
780 792 if self.volOpCebDecodification.isChecked():
781 793
782 794 if self.volOpComMode.currentIndex() == 0:
783 795 mode = '0'
784 796 if self.volOpComMode.currentIndex() == 1:
785 797 mode = '1'
786 798 if self.volOpComMode.currentIndex() == 2:
787 799 mode = '2'
788 800
789 801 if self.volOpComCode.currentIndex() == 0:
790 802 opObj = puObj.addOperation(name='Decoder', optype='other')
791 803 opObj.addParameter(name='mode', value=mode, format='int')
792 804 else:
793 805 #User defined
794 806 code = str(self.volOpCode.text())
795 807 try:
796 808 code_tmp = ast.literal_eval(code)
797 809 except:
798 810 code_tmp = []
799 811
800 812 if len(code_tmp) < 1:
801 813 self.console.append("Please fill the code value")
802 814 return 0
803 815
804 816 if len(code_tmp) == 1 or type(code_tmp[0]) != int:
805 817 nBaud = len(code_tmp[0])
806 818 nCode = len(code_tmp)
807 819 else:
808 820 nBaud = len(code_tmp)
809 821 nCode = 1
810 822
811 823 opObj = puObj.addOperation(name='Decoder', optype='other')
812 824
813 825 code = code.replace("(", "")
814 826 code = code.replace(")", "")
815 827 code = code.replace("[", "")
816 828 code = code.replace("]", "")
817 829 opObj.addParameter(name='code', value=code, format='intlist')
818 830 opObj.addParameter(name='nCode', value=nCode, format='int')
819 831 opObj.addParameter(name='nBaud', value=nBaud, format='int')
820 832 opObj.addParameter(name='mode', value=mode, format='int')
821 833
822 834 if self.volOpCebFlip.isChecked():
823 835 name_operation = 'deFlip'
824 836 optype = 'self'
825 837 value = str(self.volOpFlip.text())
826 838 name_parameter = 'channelList'
827 839 format = 'intlist'
828 840
829 841 opObj = puObj.addOperation(name=name_operation, optype=optype)
830 842 if value:
831 843 opObj.addParameter(name=name_parameter, value=value, format=format)
832 844
833 845 if self.volOpCebCohInt.isChecked():
834 846 name_operation = 'CohInt'
835 847 optype = 'other'
836 848 value = str(self.volOpCohInt.text())
837 849
838 850 if value == "":
839 851 print "Please fill number of coherent integrations"
840 852 return 0
841 853
842 854 name_parameter = 'n'
843 855 format = 'float'
844 856
845 857 opObj = puObj.addOperation(name=name_operation, optype=optype)
846 858 opObj.addParameter(name=name_parameter, value=value, format=format)
847 859
848 860 if self.volGraphCebshow.isChecked():
849 861 name_operation = 'Scope'
850 862 optype = 'other'
851 863 name_parameter = 'type'
852 864 value = 'Scope'
853 865 if self.idImagscope == 0:
854 866 self.idImagscope = 100
855 867 else:
856 868 self.idImagscope = self.idImagscope + 1
857 869
858 870 name_parameter1 = 'id'
859 871 value1 = int(self.idImagscope)
860 872 format1 = 'int'
861 873 format = 'str'
862 874
863 875 opObj = puObj.addOperation(name=name_operation, optype=optype)
864 876 # opObj.addParameter(name=name_parameter, value=value, format=format)
865 877 opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1)
866 878
867 879 channelList = str(self.volGraphChannelList.text()).replace(" ","")
868 880 xvalue = str(self.volGraphfreqrange.text()).replace(" ","")
869 881 yvalue = str(self.volGraphHeightrange.text()).replace(" ","")
870 882
871 883 if channelList:
872 884 opObj.addParameter(name='channelList', value=channelList, format='intlist')
873 885
874 886 if xvalue:
875 887 xvalueList = xvalue.split(',')
876 888 try:
877 889 value0 = float(xvalueList[0])
878 890 value1 = float(xvalueList[1])
879 891 except:
880 892 return 0
881 893 opObj.addParameter(name='xmin', value=value0, format='float')
882 894 opObj.addParameter(name='xmax', value=value1, format='float')
883 895
884 896
885 897 if not yvalue == "":
886 898 yvalueList = yvalue.split(",")
887 899 try:
888 900 value0 = int(yvalueList[0])
889 901 value1 = int(yvalueList[1])
890 902 except:
891 903 return 0
892 904
893 905 opObj.addParameter(name='ymin', value=value0, format='int')
894 906 opObj.addParameter(name='ymax', value=value1, format='int')
895 907
896 908 if self.volGraphCebSave.isChecked():
897 909 checkPath = True
898 910 opObj.addParameter(name='save', value='1', format='int')
899 911 opObj.addParameter(name='figpath', value=self.volGraphPath.text(), format='str')
900 912 value = str(self.volGraphPrefix.text()).replace(" ","")
901 913 if value:
902 914 opObj.addParameter(name='figfile', value=value, format='str')
903 915
904 916 localfolder = None
905 917 if checkPath:
906 918 localfolder = str(self.volGraphPath.text())
907 919 if localfolder == '':
908 920 self.console.clear()
909 921 self.console.append("Graphic path should be defined")
910 922 return 0
911 923
912 924 # if something happend
913 925 parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage')
914 926 if parms_ok:
915 927 name_operation = 'VoltageWriter'
916 928 optype = 'other'
917 929 name_parameter1 = 'path'
918 930 name_parameter2 = 'blocksPerFile'
919 931 name_parameter3 = 'profilesPerBlock'
920 932 value1 = output_path
921 933 value2 = blocksperfile
922 934 value3 = profilesperblock
923 935 format = "int"
924 936 opObj = puObj.addOperation(name=name_operation, optype=optype)
925 937 opObj.addParameter(name=name_parameter1, value=value1)
926 938 opObj.addParameter(name=name_parameter2, value=value2, format=format)
927 939 opObj.addParameter(name=name_parameter3, value=value3, format=format)
928 940
929 941 self.console.clear()
930 942 try:
931 943 self.refreshPUProperties(puObj)
932 944 except:
933 945 self.console.append("Check input parameters")
934 946 return 0
935 947
936 948 self.console.append("If you want to save your project")
937 949 self.console.append("click on your project name in the Tree Project Explorer")
938 950
939 951 self.actionSaveToolbar.setEnabled(True)
940 952 self.actionStarToolbar.setEnabled(True)
941 953
942 954 return 1
943 955
944 956 """
945 957 Voltage Graph
946 958 """
947 959 @pyqtSignature("int")
948 960 def on_volGraphCebSave_stateChanged(self, p0):
949 961 """
950 962 Check Box habilita ingresode del numero de Integraciones a realizar
951 963 """
952 964 if p0 == 2:
953 965 self.volGraphPath.setEnabled(True)
954 966 self.volGraphPrefix.setEnabled(True)
955 967 self.volGraphToolPath.setEnabled(True)
956 968
957 969 if p0 == 0:
958 970 self.volGraphPath.setEnabled(False)
959 971 self.volGraphPrefix.setEnabled(False)
960 972 self.volGraphToolPath.setEnabled(False)
961 973
962 974 @pyqtSignature("")
963 975 def on_volGraphToolPath_clicked(self):
964 976 """
965 977 Donde se guardan los DATOS
966 978 """
967 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
968 self.volGraphPath.setText(self.dataPath)
979 save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
980 self.volGraphPath.setText(save_path)
969 981
970 # if not os.path.exists(self.dataPath):
971 # self.volGraphOk.setEnabled(False)
972 # return
982 if not os.path.exists(save_path):
983 self.console.clear()
984 self.console.append("Set a valid path")
985 self.volGraphOk.setEnabled(False)
986 return
973 987
974 988 @pyqtSignature("int")
975 989 def on_volGraphCebshow_stateChanged(self, p0):
976 990 """
977 991 Check Box habilita ingresode del numero de Integraciones a realizar
978 992 """
979 993 if p0 == 0:
980 994
981 995 self.volGraphChannelList.setEnabled(False)
982 996 self.volGraphfreqrange.setEnabled(False)
983 997 self.volGraphHeightrange.setEnabled(False)
984 998 if p0 == 2:
985 999
986 1000 self.volGraphChannelList.setEnabled(True)
987 1001 self.volGraphfreqrange.setEnabled(True)
988 1002 self.volGraphHeightrange.setEnabled(True)
989 1003
990 1004 """
991 1005 Spectra operation
992 1006 """
993 1007 @pyqtSignature("int")
994 1008 def on_specOpCebRadarfrequency_stateChanged(self, p0):
995 1009 """
996 1010 Check Box habilita ingresode del numero de Integraciones a realizar
997 1011 """
998 1012 if p0 == 2:
999 1013 self.specOpRadarfrequency.setEnabled(True)
1000 1014 if p0 == 0:
1001 1015 self.specOpRadarfrequency.clear()
1002 1016 self.specOpRadarfrequency.setEnabled(False)
1003 1017
1004 1018
1005 1019 @pyqtSignature("int")
1006 1020 def on_specOpCebCrossSpectra_stateChanged(self, p0):
1007 1021 """
1008 1022 Habilita la opcion de aadir el parmetro CrossSpectra a la Unidad de Procesamiento .
1009 1023 """
1010 1024 if p0 == 2:
1011 1025 # self.specOpnFFTpoints.setEnabled(True)
1012 1026 self.specOppairsList.setEnabled(True)
1013 1027 if p0 == 0:
1014 1028 # self.specOpnFFTpoints.setEnabled(False)
1015 1029 self.specOppairsList.setEnabled(False)
1016 1030
1017 1031 @pyqtSignature("int")
1018 1032 def on_specOpCebChannel_stateChanged(self, p0):
1019 1033 """
1020 1034 Habilita la opcion de aadir el parmetro numero de Canales a la Unidad de Procesamiento .
1021 1035 """
1022 1036 if p0 == 2:
1023 1037 self.specOpChannel.setEnabled(True)
1024 1038 self.specOpComChannel.setEnabled(True)
1025 1039 if p0 == 0:
1026 1040 self.specOpChannel.setEnabled(False)
1027 1041 self.specOpComChannel.setEnabled(False)
1028 1042
1029 1043 @pyqtSignature("int")
1030 1044 def on_specOpCebHeights_stateChanged(self, p0):
1031 1045 """
1032 1046 Habilita la opcion de aadir el parmetro de alturas a la Unidad de Procesamiento .
1033 1047 """
1034 1048 if p0 == 2:
1035 1049 self.specOpComHeights.setEnabled(True)
1036 1050 self.specOpHeights.setEnabled(True)
1037 1051 if p0 == 0:
1038 1052 self.specOpComHeights.setEnabled(False)
1039 1053 self.specOpHeights.setEnabled(False)
1040 1054
1041 1055
1042 1056 @pyqtSignature("int")
1043 1057 def on_specOpCebIncoherent_stateChanged(self, p0):
1044 1058 """
1045 1059 Habilita la opcion de aadir el parmetro integraciones incoherentes a la Unidad de Procesamiento .
1046 1060 """
1047 1061 if p0 == 2:
1048 1062 self.specOpIncoherent.setEnabled(True)
1049 1063 if p0 == 0:
1050 1064 self.specOpIncoherent.setEnabled(False)
1051 1065
1052 1066 @pyqtSignature("int")
1053 1067 def on_specOpCebRemoveDC_stateChanged(self, p0):
1054 1068 """
1055 1069 Habilita la opcion de aadir el parmetro remover DC a la Unidad de Procesamiento .
1056 1070 """
1057 1071 if p0 == 2:
1058 1072 self.specOpComRemoveDC.setEnabled(True)
1059 1073 if p0 == 0:
1060 1074 self.specOpComRemoveDC.setEnabled(False)
1061 1075
1062 1076 @pyqtSignature("int")
1063 1077 def on_specOpCebgetNoise_stateChanged(self, p0):
1064 1078 """
1065 1079 Habilita la opcion de aadir la estimacion de ruido a la Unidad de Procesamiento .
1066 1080 """
1067 1081 if p0 == 2:
1068 1082 self.specOpgetNoise.setEnabled(True)
1069 1083
1070 1084 if p0 == 0:
1071 1085 self.specOpgetNoise.setEnabled(False)
1072 1086
1073 1087 @pyqtSignature("")
1074 1088 def on_specOpOk_clicked(self):
1075 1089 """
1076 1090 AÑADE OPERACION SPECTRA
1077 1091 """
1078 1092
1079 1093 addFTP = False
1080 1094 checkPath = False
1081 1095
1082 1096 self.actionSaveToolbar.setEnabled(False)
1083 1097 self.actionStarToolbar.setEnabled(False)
1084 1098
1085 1099 projectObj = self.getSelectedProjectObj()
1086 1100 puObj = self.getSelectedItemObj()
1087 1101
1088 1102 puObj.removeOperations()
1089 1103
1090 1104 if self.specOpCebRadarfrequency.isChecked():
1091 1105 value = self.specOpRadarfrequency.text()
1092 1106 format = 'float'
1093 1107 name_operation = 'setRadarFrequency'
1094 1108 name_parameter = 'frequency'
1095 1109 if not value == "":
1096 1110 try:
1097 1111 radarfreq = float(self.specOpRadarfrequency.text())*1e6
1098 1112 except:
1099 1113 self.console.clear()
1100 1114 self.console.append("Write the parameter Radar Frequency type float")
1101 1115 return 0
1102 1116 opObj = puObj.addOperation(name=name_operation)
1103 1117 opObj.addParameter(name=name_parameter, value=radarfreq, format=format)
1104 1118
1105 1119 inputId = puObj.getInputId()
1106 1120 inputPuObj = projectObj.getProcUnitObj(inputId)
1107 1121
1108 1122 if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP':
1109 1123
1110 1124 try:
1111 1125 value = int(self.specOpnFFTpoints.text())
1112 1126 puObj.addParameter(name='nFFTPoints', value=value, format='int')
1113 1127 except:
1114 1128 self.console.clear()
1115 1129 self.console.append("Please write the number of FFT")
1116 1130 return 0
1117 1131
1118 1132 try:
1119 1133 value1 = int(self.specOpProfiles.text())
1120 1134 puObj.addParameter(name='nProfiles', value=value1, format='int')
1121 1135 except:
1122 1136 self.console.append("Please Write the number of Profiles")
1123 1137
1124 1138 try:
1125 1139 value2 = int(self.specOpippFactor.text())
1126 1140 puObj.addParameter(name='ippFactor' , value=value2 , format='int')
1127 1141 except:
1128 1142 self.console.append("Please Write the Number of IppFactor")
1129 1143
1130 1144
1131 1145 if self.specOpCebCrossSpectra.isChecked():
1132 1146 name_parameter = 'pairsList'
1133 1147 format = 'pairslist'
1134 1148 value2 = self.specOppairsList.text()
1135 1149
1136 1150 if value2 == "":
1137 1151 print "Please fill the pairs list field"
1138 1152 return 0
1139 1153
1140 1154 puObj.addParameter(name=name_parameter, value=value2, format=format)
1141 1155
1142 1156 if self.specOpCebHeights.isChecked():
1143 1157 value = str(self.specOpHeights.text())
1144 1158
1145 1159 if value == "":
1146 1160 print "Please fill height range"
1147 1161 return 0
1148 1162
1149 1163 valueList = value.split(',')
1150 1164 format = 'float'
1151 1165 value0 = valueList[0]
1152 1166 value1 = valueList[1]
1153 1167
1154 1168 if self.specOpComHeights.currentIndex() == 0:
1155 1169 name_operation = 'selectHeights'
1156 1170 name_parameter1 = 'minHei'
1157 1171 name_parameter2 = 'maxHei'
1158 1172 else:
1159 1173 name_operation = 'selectHeightsByIndex'
1160 1174 name_parameter1 = 'minIndex'
1161 1175 name_parameter2 = 'maxIndex'
1162 1176 opObj = puObj.addOperation(name=name_operation)
1163 1177 opObj.addParameter(name=name_parameter1, value=value0, format=format)
1164 1178 opObj.addParameter(name=name_parameter2, value=value1, format=format)
1165 1179
1166 1180 if self.specOpCebChannel.isChecked():
1167 1181 value = str(self.specOpChannel.text())
1168 1182
1169 1183 if value == "":
1170 1184 print "Please fill channel list"
1171 1185 return 0
1172 1186
1173 1187 format = 'intlist'
1174 1188 if self.specOpComChannel.currentIndex() == 0:
1175 1189 name_operation = "selectChannels"
1176 1190 name_parameter = 'channelList'
1177 1191 else:
1178 1192 name_operation = "selectChannelsByIndex"
1179 1193 name_parameter = 'channelIndexList'
1180 1194
1181 1195 opObj = puObj.addOperation(name=name_operation)
1182 1196 opObj.addParameter(name=name_parameter, value=value, format=format)
1183 1197
1184 1198 if self.specOpCebIncoherent.isChecked():
1185 1199 value = str(self.specOpIncoherent.text())
1186 1200
1187 1201 if value == "":
1188 1202 print "Please fill Incoherent integration value"
1189 1203 return 0
1190 1204
1191 1205 name_operation = 'IncohInt'
1192 1206 optype = 'other'
1193 1207 if self.specOpCobIncInt.currentIndex() == 0:
1194 1208 name_parameter = 'timeInterval'
1195 1209 format = 'float'
1196 1210 else:
1197 1211 name_parameter = 'n'
1198 1212 format = 'float'
1199 1213
1200 1214 opObj = puObj.addOperation(name=name_operation, optype=optype)
1201 1215 opObj.addParameter(name=name_parameter, value=value, format=format)
1202 1216
1203 1217 if self.specOpCebRemoveDC.isChecked():
1204 1218 name_operation = 'removeDC'
1205 1219 name_parameter = 'mode'
1206 1220 format = 'int'
1207 1221 if self.specOpComRemoveDC.currentIndex() == 0:
1208 1222 value = 1
1209 1223 else:
1210 1224 value = 2
1211 1225 opObj = puObj.addOperation(name=name_operation)
1212 1226 opObj.addParameter(name=name_parameter, value=value, format=format)
1213 1227
1214 1228 if self.specOpCebRemoveInt.isChecked():
1215 1229 name_operation = 'removeInterference'
1216 1230 opObj = puObj.addOperation(name=name_operation)
1217 1231
1218 1232
1219 1233 if self.specOpCebgetNoise.isChecked():
1220 1234 value = self.specOpgetNoise.text()
1221 1235 valueList = value.split(',')
1222 1236 format = 'float'
1223 1237 name_operation = "getNoise"
1224 1238 opObj = puObj.addOperation(name=name_operation)
1225 1239
1226 1240 if not value == '':
1227 1241 valueList = value.split(',')
1228 1242 length = len(valueList)
1229 1243 if length == 1:
1230 1244 try:
1231 1245 value1 = float(valueList[0])
1232 1246 except:
1233 1247 self.console.clear()
1234 1248 self.console.append("Please Write correct parameter Get Noise")
1235 1249 return 0
1236 1250 name1 = 'minHei'
1237 1251 opObj.addParameter(name=name1, value=value1, format=format)
1238 1252 elif length == 2:
1239 1253 try:
1240 1254 value1 = float(valueList[0])
1241 1255 value2 = float(valueList[1])
1242 1256 except:
1243 1257 self.console.clear()
1244 1258 self.console.append("Please Write corrects parameter Get Noise")
1245 1259 return 0
1246 1260 name1 = 'minHei'
1247 1261 name2 = 'maxHei'
1248 1262 opObj.addParameter(name=name1, value=value1, format=format)
1249 1263 opObj.addParameter(name=name2, value=value2, format=format)
1250 1264
1251 1265 elif length == 3:
1252 1266 try:
1253 1267 value1 = float(valueList[0])
1254 1268 value2 = float(valueList[1])
1255 1269 value3 = float(valueList[2])
1256 1270 except:
1257 1271 self.console.clear()
1258 1272 self.console.append("Please Write corrects parameter Get Noise")
1259 1273 return 0
1260 1274 name1 = 'minHei'
1261 1275 name2 = 'maxHei'
1262 1276 name3 = 'minVel'
1263 1277 opObj.addParameter(name=name1, value=value1, format=format)
1264 1278 opObj.addParameter(name=name2, value=value2, format=format)
1265 1279 opObj.addParameter(name=name3, value=value3, format=format)
1266 1280
1267 1281 elif length == 4:
1268 1282 try:
1269 1283 value1 = float(valueList[0])
1270 1284 value2 = float(valueList[1])
1271 1285 value3 = float(valueList[2])
1272 1286 value4 = float(valueList[3])
1273 1287 except:
1274 1288 self.console.clear()
1275 1289 self.console.append("Please Write corrects parameter Get Noise")
1276 1290 return 0
1277 1291 name1 = 'minHei'
1278 1292 name2 = 'maxHei'
1279 1293 name3 = 'minVel'
1280 1294 name4 = 'maxVel'
1281 1295 opObj.addParameter(name=name1, value=value1, format=format)
1282 1296 opObj.addParameter(name=name2, value=value2, format=format)
1283 1297 opObj.addParameter(name=name3, value=value3, format=format)
1284 1298 opObj.addParameter(name=name4, value=value4, format=format)
1285 1299
1286 1300 elif length > 4:
1287 1301 self.console.clear()
1288 1302 self.console.append("Get Noise Operation only accepts 4 parameters")
1289 1303 return 0
1290 1304
1291 1305 channelList = str(self.specGgraphChannelList.text()).replace(" ","")
1292 1306 vel_range = str(self.specGgraphFreq.text()).replace(" ","")
1293 1307 hei_range = str(self.specGgraphHeight.text()).replace(" ","")
1294 1308 db_range = str(self.specGgraphDbsrange.text()).replace(" ","")
1295 1309
1296 1310 trange = str(self.specGgraphTminTmax.text()).replace(" ","")
1297 1311 magrange = str(self.specGgraphmagnitud.text()).replace(" ","")
1298 1312 phaserange = str(self.specGgraphPhase.text()).replace(" ","")
1299 1313 # timerange = str(self.specGgraphTimeRange.text()).replace(" ","")
1300 1314
1301 1315 figpath = str(self.specGraphPath.text())
1302 1316 figfile = str(self.specGraphPrefix.text()).replace(" ","")
1303 1317 try:
1304 1318 wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ",""))
1305 1319 except:
1306 1320 wrperiod = None
1307 1321
1308 1322 #-----Spectra Plot-----
1309 1323 if self.specGraphCebSpectraplot.isChecked():
1310 1324
1311 1325 opObj = puObj.addOperation(name='SpectraPlot', optype='other')
1312 1326 opObj.addParameter(name='id', value=opObj.id, format='int')
1313 1327
1314 1328 if not channelList == '':
1315 1329 opObj.addParameter(name='channelList', value=channelList, format='intlist')
1316 1330
1317 1331 if not vel_range == '':
1318 1332 xvalueList = vel_range.split(',')
1319 1333 try:
1320 1334 value1 = float(xvalueList[0])
1321 1335 value2 = float(xvalueList[1])
1322 1336 except:
1323 1337 self.console.clear()
1324 1338 self.console.append("Invalid velocity/frequency range")
1325 1339 return 0
1326 1340
1327 1341 opObj.addParameter(name='xmin', value=value1, format='float')
1328 1342 opObj.addParameter(name='xmax', value=value2, format='float')
1329 1343
1330 1344 if not hei_range == '':
1331 1345 yvalueList = hei_range.split(",")
1332 1346 try:
1333 1347 value1 = float(yvalueList[0])
1334 1348 value2 = float(yvalueList[1])
1335 1349 except:
1336 1350 self.console.clear()
1337 1351 self.console.append("Invalid height range")
1338 1352 return 0
1339 1353
1340 1354 opObj.addParameter(name='ymin', value=value1, format='float')
1341 1355 opObj.addParameter(name='ymax', value=value2, format='float')
1342 1356
1343 1357 if not db_range == '':
1344 1358 zvalueList = db_range.split(",")
1345 1359 try:
1346 1360 value1 = float(zvalueList[0])
1347 1361 value2 = float(zvalueList[1])
1348 1362 except:
1349 1363 self.console.clear()
1350 1364 self.console.append("Invalid db range")
1351 1365 return 0
1352 1366
1353 1367 opObj.addParameter(name='zmin', value=value1, format='float')
1354 1368 opObj.addParameter(name='zmax', value=value2, format='float')
1355 1369
1356 1370 if self.specGraphSaveSpectra.isChecked():
1357 1371 checkPath = True
1358 1372 opObj.addParameter(name='save', value=1 , format='bool')
1359 1373 opObj.addParameter(name='figpath', value=figpath, format='str')
1360 1374 if figfile:
1361 1375 opObj.addParameter(name='figfile', value=figfile, format='str')
1362 1376 if wrperiod:
1363 1377 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1364 1378
1365 1379 if self.specGraphftpSpectra.isChecked():
1366 1380 opObj.addParameter(name='ftp', value='1', format='int')
1367 1381 self.addFTPConf2Operation(puObj, opObj)
1368 1382 addFTP = True
1369 1383
1370 1384 if self.specGraphCebCrossSpectraplot.isChecked():
1371 1385
1372 1386 opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other')
1373 1387 # opObj.addParameter(name='power_cmap', value='jet', format='str')
1374 1388 # opObj.addParameter(name='coherence_cmap', value='jet', format='str')
1375 1389 # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str')
1376 1390 opObj.addParameter(name='id', value=opObj.id, format='int')
1377 1391
1378 1392 if not vel_range == '':
1379 1393 xvalueList = vel_range.split(',')
1380 1394 try:
1381 1395 value1 = float(xvalueList[0])
1382 1396 value2 = float(xvalueList[1])
1383 1397 except:
1384 1398 self.console.clear()
1385 1399 self.console.append("Invalid velocity/frequency range")
1386 1400 return 0
1387 1401
1388 1402 opObj.addParameter(name='xmin', value=value1, format='float')
1389 1403 opObj.addParameter(name='xmax', value=value2, format='float')
1390 1404
1391 1405 if not hei_range == '':
1392 1406 yvalueList = hei_range.split(",")
1393 1407 try:
1394 1408 value1 = float(yvalueList[0])
1395 1409 value2 = float(yvalueList[1])
1396 1410 except:
1397 1411 self.console.clear()
1398 1412 self.console.append("Invalid height range")
1399 1413 return 0
1400 1414
1401 1415 opObj.addParameter(name='ymin', value=value1, format='float')
1402 1416 opObj.addParameter(name='ymax', value=value2, format='float')
1403 1417
1404 1418 if not db_range == '':
1405 1419 zvalueList = db_range.split(",")
1406 1420 try:
1407 1421 value1 = float(zvalueList[0])
1408 1422 value2 = float(zvalueList[1])
1409 1423 except:
1410 1424 self.console.clear()
1411 1425 self.console.append("Invalid db range")
1412 1426 return 0
1413 1427
1414 1428 opObj.addParameter(name='zmin', value=value1, format='float')
1415 1429 opObj.addParameter(name='zmax', value=value2, format='float')
1416 1430
1417 1431 if not magrange == '':
1418 1432 zvalueList = magrange.split(",")
1419 1433 try:
1420 1434 value1 = float(zvalueList[0])
1421 1435 value2 = float(zvalueList[1])
1422 1436 except:
1423 1437 self.console.clear()
1424 1438 self.console.append("Invalid magnitude range")
1425 1439 return 0
1426 1440
1427 1441 opObj.addParameter(name='coh_min', value=value1, format='float')
1428 1442 opObj.addParameter(name='coh_max', value=value2, format='float')
1429 1443
1430 1444 if not phaserange == '':
1431 1445 zvalueList = phaserange.split(",")
1432 1446 try:
1433 1447 value1 = float(zvalueList[0])
1434 1448 value2 = float(zvalueList[1])
1435 1449 except:
1436 1450 self.console.clear()
1437 1451 self.console.append("Invalid phase range")
1438 1452 return 0
1439 1453
1440 1454 opObj.addParameter(name='phase_min', value=value1, format='float')
1441 1455 opObj.addParameter(name='phase_max', value=value2, format='float')
1442 1456
1443 1457 if self.specGraphSaveCross.isChecked():
1444 1458 checkPath = True
1445 1459 opObj.addParameter(name='save', value='1', format='bool')
1446 1460 opObj.addParameter(name='figpath', value=figpath, format='str')
1447 1461 if figfile:
1448 1462 opObj.addParameter(name='figfile', value=figfile, format='str')
1449 1463 if wrperiod:
1450 1464 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1451 1465
1452 1466 if self.specGraphftpCross.isChecked():
1453 1467 opObj.addParameter(name='ftp', value='1', format='int')
1454 1468 self.addFTPConf2Operation(puObj, opObj)
1455 1469 addFTP = True
1456 1470
1457 1471 if self.specGraphCebRTIplot.isChecked():
1458 1472
1459 1473 opObj = puObj.addOperation(name='RTIPlot', optype='other')
1460 1474 opObj.addParameter(name='id', value=opObj.id, format='int')
1461 1475
1462 1476 if not channelList == '':
1463 1477 opObj.addParameter(name='channelList', value=channelList, format='intlist')
1464 1478
1465 1479 if not trange == '':
1466 1480 xvalueList = trange.split(',')
1467 1481 try:
1468 1482 value1 = float(xvalueList[0])
1469 1483 value2 = float(xvalueList[1])
1470 1484 except:
1471 1485 self.console.clear()
1472 1486 self.console.append("Invalid time range")
1473 1487 return 0
1474 1488
1475 1489 opObj.addParameter(name='xmin', value=value1, format='float')
1476 1490 opObj.addParameter(name='xmax', value=value2, format='float')
1477 1491
1478 1492 # if not timerange == '':
1479 1493 # try:
1480 1494 # timerange = float(timerange)
1481 1495 # except:
1482 1496 # self.console.clear()
1483 1497 # self.console.append("Invalid time range")
1484 1498 # return 0
1485 1499 #
1486 1500 # opObj.addParameter(name='timerange', value=timerange, format='float')
1487 1501
1488 1502 if not hei_range == '':
1489 1503 yvalueList = hei_range.split(",")
1490 1504 try:
1491 1505 value1 = float(yvalueList[0])
1492 1506 value2 = float(yvalueList[1])
1493 1507 except:
1494 1508 self.console.clear()
1495 1509 self.console.append("Invalid height range")
1496 1510 return 0
1497 1511
1498 1512 opObj.addParameter(name='ymin', value=value1, format='float')
1499 1513 opObj.addParameter(name='ymax', value=value2, format='float')
1500 1514
1501 1515 if not db_range == '':
1502 1516 zvalueList = db_range.split(",")
1503 1517 try:
1504 1518 value1 = float(zvalueList[0])
1505 1519 value2 = float(zvalueList[1])
1506 1520 except:
1507 1521 self.console.clear()
1508 1522 self.console.append("Invalid db range")
1509 1523 return 0
1510 1524
1511 1525 opObj.addParameter(name='zmin', value=value1, format='float')
1512 1526 opObj.addParameter(name='zmax', value=value2, format='float')
1513 1527
1514 1528 if self.specGraphSaveRTIplot.isChecked():
1515 1529 checkPath = True
1516 1530 opObj.addParameter(name='save', value='1', format='bool')
1517 1531 opObj.addParameter(name='figpath', value=figpath, format='str')
1518 1532 if figfile:
1519 1533 opObj.addParameter(name='figfile', value=value, format='str')
1520 1534 if wrperiod:
1521 1535 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1522 1536
1523 1537 if self.specGraphftpRTIplot.isChecked():
1524 1538 opObj.addParameter(name='ftp', value='1', format='int')
1525 1539 self.addFTPConf2Operation(puObj, opObj)
1526 1540 addFTP = True
1527 1541
1528 1542 if self.specGraphCebCoherencmap.isChecked():
1529 1543
1530 1544 opObj = puObj.addOperation(name='CoherenceMap', optype='other')
1531 1545 # opObj.addParameter(name=name_parameter, value=value, format=format)
1532 1546 # opObj.addParameter(name='coherence_cmap', value='jet', format='str')
1533 1547 # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str')
1534 1548 opObj.addParameter(name='id', value=opObj.id, format='int')
1535 1549
1536 1550 # if not timerange == '':
1537 1551 # try:
1538 1552 # timerange = int(timerange)
1539 1553 # except:
1540 1554 # self.console.clear()
1541 1555 # self.console.append("Invalid time range")
1542 1556 # return 0
1543 1557 #
1544 1558 # opObj.addParameter(name='timerange', value=timerange, format='int')
1545 1559
1546 1560 if not trange == '':
1547 1561 xvalueList = trange.split(',')
1548 1562 try:
1549 1563 value1 = float(xvalueList[0])
1550 1564 value2 = float(xvalueList[1])
1551 1565 except:
1552 1566 self.console.clear()
1553 1567 self.console.append("Invalid time range")
1554 1568 return 0
1555 1569
1556 1570 opObj.addParameter(name='xmin', value=value1, format='float')
1557 1571 opObj.addParameter(name='xmax', value=value2, format='float')
1558 1572
1559 1573 if not hei_range == '':
1560 1574 yvalueList = hei_range.split(",")
1561 1575 try:
1562 1576 value1 = float(yvalueList[0])
1563 1577 value2 = float(yvalueList[1])
1564 1578 except:
1565 1579 self.console.clear()
1566 1580 self.console.append("Invalid height range")
1567 1581 return 0
1568 1582
1569 1583 opObj.addParameter(name='ymin', value=value1, format='float')
1570 1584 opObj.addParameter(name='ymax', value=value2, format='float')
1571 1585
1572 1586 if not magrange == '':
1573 1587 zvalueList = magrange.split(",")
1574 1588 try:
1575 1589 value1 = float(zvalueList[0])
1576 1590 value2 = float(zvalueList[1])
1577 1591 except:
1578 1592 self.console.clear()
1579 1593 self.console.append("Invalid magnitude range")
1580 1594 return 0
1581 1595
1582 1596 opObj.addParameter(name='zmin', value=value1, format='float')
1583 1597 opObj.addParameter(name='zmax', value=value2, format='float')
1584 1598
1585 1599 if not phaserange == '':
1586 1600 zvalueList = phaserange.split(",")
1587 1601 try:
1588 1602 value1 = float(zvalueList[0])
1589 1603 value2 = float(zvalueList[1])
1590 1604 except:
1591 1605 self.console.clear()
1592 1606 self.console.append("Invalid phase range")
1593 1607 return 0
1594 1608
1595 1609 opObj.addParameter(name='phase_min', value=value1, format='float')
1596 1610 opObj.addParameter(name='phase_max', value=value2, format='float')
1597 1611
1598 1612 if self.specGraphSaveCoherencemap.isChecked():
1599 1613 checkPath = True
1600 1614 opObj.addParameter(name='save', value='1', format='bool')
1601 1615 opObj.addParameter(name='figpath', value=figpath, format='str')
1602 1616 if figfile:
1603 1617 opObj.addParameter(name='figfile', value=value, format='str')
1604 1618 if wrperiod:
1605 1619 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1606 1620
1607 1621 if self.specGraphftpCoherencemap.isChecked():
1608 1622 opObj.addParameter(name='ftp', value='1', format='int')
1609 1623 self.addFTPConf2Operation(puObj, opObj)
1610 1624 addFTP = True
1611 1625
1612 1626 if self.specGraphPowerprofile.isChecked():
1613 1627
1614 1628 opObj = puObj.addOperation(name='PowerProfilePlot', optype='other')
1615 1629 opObj.addParameter(name='id', value=opObj.id, format='int')
1616 1630
1617 1631 if not channelList == '':
1618 1632 opObj.addParameter(name='channelList', value=channelList, format='intlist')
1619 1633
1620 1634 if not db_range == '':
1621 1635 xvalueList = db_range.split(',')
1622 1636 try:
1623 1637 value1 = float(xvalueList[0])
1624 1638 value2 = float(xvalueList[1])
1625 1639 except:
1626 1640 self.console.clear()
1627 1641 self.console.append("Invalid db range")
1628 1642 return 0
1629 1643
1630 1644 opObj.addParameter(name='xmin', value=value1, format='float')
1631 1645 opObj.addParameter(name='xmax', value=value2, format='float')
1632 1646
1633 1647 if not hei_range == '':
1634 1648 yvalueList = hei_range.split(",")
1635 1649 try:
1636 1650 value1 = float(yvalueList[0])
1637 1651 value2 = float(yvalueList[1])
1638 1652 except:
1639 1653 self.console.clear()
1640 1654 self.console.append("Invalid height range")
1641 1655 return 0
1642 1656
1643 1657 opObj.addParameter(name='ymin', value=value1, format='float')
1644 1658 opObj.addParameter(name='ymax', value=value2, format='float')
1645 1659
1646 1660 if self.specGraphSavePowerprofile.isChecked():
1647 1661 checkPath = True
1648 1662 opObj.addParameter(name='save', value='1', format='bool')
1649 1663 opObj.addParameter(name='figpath', value=figpath, format='str')
1650 1664 if figfile:
1651 1665 opObj.addParameter(name='figfile', value=value, format='str')
1652 1666 if wrperiod:
1653 1667 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1654 1668
1655 1669 if self.specGraphftpPowerprofile.isChecked():
1656 1670 opObj.addParameter(name='ftp', value='1', format='int')
1657 1671 self.addFTPConf2Operation(puObj, opObj)
1658 1672 addFTP = True
1659 1673 # rti noise
1660 1674
1661 1675 if self.specGraphCebRTInoise.isChecked():
1662 1676
1663 1677 opObj = puObj.addOperation(name='Noise', optype='other')
1664 1678 opObj.addParameter(name='id', value=opObj.id, format='int')
1665 1679
1666 1680 if not channelList == '':
1667 1681 opObj.addParameter(name='channelList', value=channelList, format='intlist')
1668 1682
1669 1683 # if not timerange == '':
1670 1684 # try:
1671 1685 # timerange = float(timerange)
1672 1686 # except:
1673 1687 # self.console.clear()
1674 1688 # self.console.append("Invalid time range")
1675 1689 # return 0
1676 1690 #
1677 1691 # opObj.addParameter(name='timerange', value=timerange, format='float')
1678 1692
1679 1693 if not trange == '':
1680 1694 xvalueList = trange.split(',')
1681 1695 try:
1682 1696 value1 = float(xvalueList[0])
1683 1697 value2 = float(xvalueList[1])
1684 1698 except:
1685 1699 self.console.clear()
1686 1700 self.console.append("Invalid time range")
1687 1701 return 0
1688 1702
1689 1703 opObj.addParameter(name='xmin', value=value1, format='float')
1690 1704 opObj.addParameter(name='xmax', value=value2, format='float')
1691 1705
1692 1706 if not db_range == '':
1693 1707 yvalueList = db_range.split(",")
1694 1708 try:
1695 1709 value1 = float(yvalueList[0])
1696 1710 value2 = float(yvalueList[1])
1697 1711 except:
1698 1712 self.console.clear()
1699 1713 self.console.append("Invalid db range")
1700 1714 return 0
1701 1715
1702 1716 opObj.addParameter(name='ymin', value=value1, format='float')
1703 1717 opObj.addParameter(name='ymax', value=value2, format='float')
1704 1718
1705 1719 if self.specGraphSaveRTInoise.isChecked():
1706 1720 checkPath = True
1707 1721 opObj.addParameter(name='save', value='1', format='bool')
1708 1722 opObj.addParameter(name='figpath', value=figpath, format='str')
1709 1723 if figfile:
1710 1724 opObj.addParameter(name='figfile', value=value, format='str')
1711 1725 if wrperiod:
1712 1726 opObj.addParameter(name='wr_period', value=wrperiod,format='int')
1713 1727
1714 1728 # test_ftp
1715 1729 if self.specGraphftpRTInoise.isChecked():
1716 1730 opObj.addParameter(name='ftp', value='1', format='int')
1717 1731 self.addFTPConf2Operation(puObj, opObj)
1718 1732 addFTP = True
1719 1733
1720 1734 if checkPath:
1721 1735 if not figpath:
1722 1736 self.console.clear()
1723 1737 self.console.append("Graphic path should be defined")
1724 1738 return 0
1725 1739
1726 1740 if addFTP and not figpath:
1727 1741 self.console.clear()
1728 1742 self.console.append("You have to save the plots before sending them to FTP Server")
1729 1743 return 0
1730 1744
1731 1745 # if something happend
1732 1746 parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra')
1733 1747 if parms_ok:
1734 1748 opObj = puObj.addOperation(name='SpectraWriter', optype='other')
1735 1749 opObj.addParameter(name='path', value=output_path)
1736 1750 opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int')
1737 opObj.addParameter(name='profilesPerBlock', value=profilesperblock, format='int')
1738 1751
1739 1752 self.console.clear()
1740 1753 try:
1741 1754 self.refreshPUProperties(puObj)
1742 1755 except:
1743 1756 self.console.append("Check input parameters")
1744 1757 return 0
1745 1758
1746 1759 self.console.append("If you want to save your project")
1747 1760 self.console.append("click on your project name in the Tree Project Explorer")
1748 1761
1749 1762 self.actionSaveToolbar.setEnabled(True)
1750 1763 self.actionStarToolbar.setEnabled(True)
1751 1764
1752 1765 return 1
1753 1766
1754 1767 """
1755 1768 Spectra Graph
1756 1769 """
1757 1770 @pyqtSignature("int")
1758 1771 def on_specGraphCebSpectraplot_stateChanged(self, p0):
1759 1772
1760 1773 self.__checkSpecGraphFilters()
1761 1774
1762 1775
1763 1776 @pyqtSignature("int")
1764 1777 def on_specGraphCebCrossSpectraplot_stateChanged(self, p0):
1765 1778
1766 1779 self.__checkSpecGraphFilters()
1767 1780
1768 1781 @pyqtSignature("int")
1769 1782 def on_specGraphCebRTIplot_stateChanged(self, p0):
1770 1783
1771 1784 self.__checkSpecGraphFilters()
1772 1785
1773 1786
1774 1787 @pyqtSignature("int")
1775 1788 def on_specGraphCebRTInoise_stateChanged(self, p0):
1776 1789
1777 1790 self.__checkSpecGraphFilters()
1778 1791
1779 1792
1780 1793 @pyqtSignature("int")
1781 1794 def on_specGraphCebCoherencmap_stateChanged(self, p0):
1782 1795
1783 1796 self.__checkSpecGraphFilters()
1784 1797
1785 1798 @pyqtSignature("int")
1786 1799 def on_specGraphPowerprofile_stateChanged(self, p0):
1787 1800
1788 1801 self.__checkSpecGraphFilters()
1789 1802
1790 1803 @pyqtSignature("int")
1791 1804 def on_specGraphPhase_stateChanged(self, p0):
1792 1805
1793 1806 self.__checkSpecGraphFilters()
1794 1807
1795 1808 @pyqtSignature("int")
1796 1809 def on_specGraphSaveSpectra_stateChanged(self, p0):
1797 1810 """
1798 1811 """
1799 1812 self.__checkSpecGraphSaving()
1800 1813
1801 1814 @pyqtSignature("int")
1802 1815 def on_specGraphSaveCross_stateChanged(self, p0):
1803 1816
1804 1817 self.__checkSpecGraphSaving()
1805 1818
1806 1819 @pyqtSignature("int")
1807 1820 def on_specGraphSaveRTIplot_stateChanged(self, p0):
1808 1821
1809 1822 self.__checkSpecGraphSaving()
1810 1823
1811 1824 @pyqtSignature("int")
1812 1825 def on_specGraphSaveRTInoise_stateChanged(self, p0):
1813 1826
1814 1827 self.__checkSpecGraphSaving()
1815 1828
1816 1829 @pyqtSignature("int")
1817 1830 def on_specGraphSaveCoherencemap_stateChanged(self, p0):
1818 1831
1819 1832 self.__checkSpecGraphSaving()
1820 1833
1821 1834 @pyqtSignature("int")
1822 1835 def on_specGraphSavePowerprofile_stateChanged(self, p0):
1823 1836
1824 1837 self.__checkSpecGraphSaving()
1825 1838
1826 1839 @pyqtSignature("int")
1827 1840 def on_specGraphftpSpectra_stateChanged(self, p0):
1828 1841 """
1829 1842 """
1830 1843 self.__checkSpecGraphFTP()
1831 1844
1832 1845
1833 1846 @pyqtSignature("int")
1834 1847 def on_specGraphftpCross_stateChanged(self, p0):
1835 1848
1836 1849 self.__checkSpecGraphFTP()
1837 1850
1838 1851 @pyqtSignature("int")
1839 1852 def on_specGraphftpRTIplot_stateChanged(self, p0):
1840 1853
1841 1854 self.__checkSpecGraphFTP()
1842 1855
1843 1856 @pyqtSignature("int")
1844 1857 def on_specGraphftpRTInoise_stateChanged(self, p0):
1845 1858
1846 1859 self.__checkSpecGraphFTP()
1847 1860
1848 1861 @pyqtSignature("int")
1849 1862 def on_specGraphftpCoherencemap_stateChanged(self, p0):
1850 1863
1851 1864 self.__checkSpecGraphFTP()
1852 1865
1853 1866 @pyqtSignature("int")
1854 1867 def on_specGraphftpPowerprofile_stateChanged(self, p0):
1855 1868
1856 1869 self.__checkSpecGraphFTP()
1857 1870
1858 1871 @pyqtSignature("")
1859 1872 def on_specGraphToolPath_clicked(self):
1860 1873 """
1861 1874 """
1862 self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
1863 self.specGraphPath.setText(self.savePath)
1864 if not os.path.exists(self.savePath):
1875 save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
1876 self.specGraphPath.setText(save_path)
1877 if not os.path.exists(save_path):
1865 1878 self.console.clear()
1866 self.console.append("Write a correct a path")
1879 self.console.append("Write a valid path")
1867 1880 return
1868 1881
1869 1882 @pyqtSignature("")
1870 1883 def on_specGraphClear_clicked(self):
1871 1884 return
1872 1885
1873 1886 @pyqtSignature("")
1874 1887 def on_specHeisGraphToolPath_clicked(self):
1875 1888 """
1876 1889 """
1877 self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
1878 self.specHeisGraphPath.setText(self.savePath)
1879 if not os.path.exists(self.savePath):
1890 save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
1891 self.specHeisGraphPath.setText(save_path)
1892 if not os.path.exists(save_path):
1880 1893 self.console.clear()
1881 self.console.append("Write a correct a path")
1894 self.console.append("Write a valid path")
1882 1895 return
1883 1896
1884 1897 @pyqtSignature("int")
1885 1898 def on_specHeisOpCebIncoherent_stateChanged(self, p0):
1886 1899 """
1887 1900 Habilita la opcion de aadir el parmetro integraciones incoherentes a la Unidad de Procesamiento .
1888 1901 """
1889 1902 if p0 == 2:
1890 1903 self.specHeisOpIncoherent.setEnabled(True)
1891 1904 self.specHeisOpCobIncInt.setEnabled(True)
1892 1905 if p0 == 0:
1893 1906 self.specHeisOpIncoherent.setEnabled(False)
1894 1907 self.specHeisOpCobIncInt.setEnabled(False)
1895 1908
1896 1909 @pyqtSignature("")
1897 1910 def on_specHeisOpOk_clicked(self):
1898 1911 """
1899 1912 AÑADE OPERACION SPECTRAHEIS
1900 1913 """
1901 1914 addFTP = False
1902 1915 checkPath = False
1903 1916
1904 1917 self.actionSaveToolbar.setEnabled(False)
1905 1918 self.actionStarToolbar.setEnabled(False)
1906 1919
1907 1920 puObj = self.getSelectedItemObj()
1908 1921 puObj.removeOperations()
1909 1922
1910 1923 if self.specHeisOpCebIncoherent.isChecked():
1911 1924 value = self.specHeisOpIncoherent.text()
1912 1925 name_operation = 'IncohInt4SpectraHeis'
1913 1926 optype = 'other'
1914 1927 if self.specOpCobIncInt.currentIndex() == 0:
1915 1928 name_parameter = 'timeInterval'
1916 1929 format = 'float'
1917 1930 opObj = puObj.addOperation(name=name_operation, optype=optype)
1918 1931 opObj.addParameter(name=name_parameter, value=value, format=format)
1919 1932
1920 1933 # ---- Spectra Plot-----
1921 1934 if self.specHeisGraphCebSpectraplot.isChecked():
1922 1935 name_operation = 'SpectraHeisScope'
1923 1936 optype = 'other'
1924 1937 name_parameter = 'type'
1925 1938 value = 'SpectraHeisScope'
1926 1939 format = 'str'
1927 1940 if self.idImagspectraHeis == 0:
1928 1941 self.idImagspectraHeis = 800
1929 1942 else:
1930 1943 self.idImagspectraHeis = self.idImagspectraHeis + 1
1931 1944 name_parameter1 = 'id'
1932 1945 value1 = int(self.idImagspectraHeis)
1933 1946 format1 = 'int'
1934 1947
1935 1948 format = 'str'
1936 1949
1937 1950 channelList = self.specHeisGgraphChannelList.text()
1938 1951 xvalue = self.specHeisGgraphXminXmax.text()
1939 1952 yvalue = self.specHeisGgraphYminYmax.text()
1940 1953 opObj = puObj.addOperation(name=name_operation, optype=optype)
1941 1954 # opObj.addParameter(name=name_parameter, value=value, format=format)
1942 1955 opObj.addParameter(name=name_parameter1, value=value1, format=format1)
1943 1956
1944 1957 if not channelList == '':
1945 1958 name_parameter = 'channelList'
1946 1959 format = 'intlist'
1947 1960 opObj.addParameter(name=name_parameter, value=channelList, format=format)
1948 1961
1949 1962 if not xvalue == '':
1950 1963 xvalueList = xvalue.split(',')
1951 1964 try:
1952 1965 value1 = float(xvalueList[0])
1953 1966 value2 = float(xvalueList[1])
1954 1967 except:
1955 1968 self.console.clear()
1956 1969 self.console.append("Please Write corrects parameter xmin-xmax")
1957 1970 return 0
1958 1971 name1 = 'xmin'
1959 1972 name2 = 'xmax'
1960 1973 format = 'float'
1961 1974 opObj.addParameter(name=name1, value=value1, format=format)
1962 1975 opObj.addParameter(name=name2, value=value2, format=format)
1963 1976 #------specHeisGgraphYmin-Ymax---
1964 1977 if not yvalue == '':
1965 1978 yvalueList = yvalue.split(",")
1966 1979 try:
1967 1980 value1 = float(yvalueList[0])
1968 1981 value2 = float(yvalueList[1])
1969 1982 except:
1970 1983 self.console.clear()
1971 1984 self.console.append("Please Write corrects parameter Ymix-Ymax")
1972 1985 return 0
1973 1986 name1 = 'ymin'
1974 1987 name2 = 'ymax'
1975 1988 format = 'float'
1976 1989 opObj.addParameter(name=name1, value=value1, format=format)
1977 1990 opObj.addParameter(name=name2, value=value2, format=format)
1978 1991
1979 1992 if self.specHeisGraphSaveSpectra.isChecked():
1980 1993 checkPath = True
1981 1994 name_parameter1 = 'save'
1982 1995 name_parameter2 = 'figpath'
1983 1996 name_parameter3 = 'figfile'
1984 1997 value1 = '1'
1985 1998 value2 = self.specHeisGraphPath.text()
1986 1999 value3 = self.specHeisGraphPrefix.text()
1987 2000 format1 = 'bool'
1988 2001 format2 = 'str'
1989 2002 opObj.addParameter(name=name_parameter1, value=value1 , format=format1)
1990 2003 opObj.addParameter(name=name_parameter2, value=value2, format=format2)
1991 2004 if not value3 == "":
1992 2005 try:
1993 2006 value3 = str(self.specHeisGraphPrefix.text())
1994 2007 except:
1995 2008 self.console.clear()
1996 2009 self.console.append("Please Write prefix")
1997 2010 return 0
1998 2011 opObj.addParameter(name='figfile', value=self.specHeisGraphPrefix.text(), format='str')
1999 2012
2000 2013 # opObj.addParameter(name=name_parameter3, value=value3, format=format2)
2001 2014 # opObj.addParameter(name='wr_period', value='5',format='int')
2002 2015
2003 2016 if self.specHeisGraphftpSpectra.isChecked():
2004 2017 opObj.addParameter(name='ftp', value='1', format='int')
2005 2018 self.addFTPConf2Operation(puObj, opObj)
2006 2019 addFTP = True
2007 2020
2008 2021 if self.specHeisGraphCebRTIplot.isChecked():
2009 2022 name_operation = 'RTIfromSpectraHeis'
2010 2023 optype = 'other'
2011 2024 name_parameter = 'type'
2012 2025 value = 'RTIfromSpectraHeis'
2013 2026 format = 'str'
2014 2027
2015 2028 if self.idImagrtiHeis == 0:
2016 2029 self.idImagrtiHeis = 900
2017 2030 else:
2018 2031 self.idImagrtiHeis = self.idImagrtiHeis + 1
2019 2032
2020 2033 name_parameter1 = 'id'
2021 2034 value1 = int(self.idImagrtiHeis)
2022 2035 format1 = 'int'
2023 2036
2024 2037 format = 'str'
2025 2038
2026 2039 opObj = puObj.addOperation(name=name_operation, optype=optype)
2027 2040 # opObj.addParameter(name=name_parameter, value=value, format=format)
2028 2041 opObj.addParameter(name=name_parameter1, value=value1, format=format1)
2029 2042
2030 2043 channelList = self.specHeisGgraphChannelList.text()
2031 2044 xvalue = self.specHeisGgraphTminTmax.text()
2032 2045 yvalue = self.specHeisGgraphYminYmax.text()
2033 2046 timerange = self.specHeisGgraphTimeRange.text()
2034 2047
2035 2048 if not channelList == '':
2036 2049 opObj.addParameter(name='channelList', value=channelList, format='intlist')
2037 2050
2038 2051 if not xvalue == '':
2039 2052 xvalueList = xvalue.split(',')
2040 2053 try:
2041 2054 value = float(xvalueList[0])
2042 2055 value = float(xvalueList[1])
2043 2056 except:
2044 2057 return 0
2045 2058 format = 'float'
2046 2059 opObj.addParameter(name='xmin', value=xvalueList[0], format=format)
2047 2060 opObj.addParameter(name='xmax', value=xvalueList[1], format=format)
2048 2061
2049 2062 if not timerange == '':
2050 2063 format = 'int'
2051 2064 try:
2052 2065 timerange = int(timerange)
2053 2066 except:
2054 2067 return 0
2055 2068 opObj.addParameter(name='timerange', value=timerange, format=format)
2056 2069
2057 2070
2058 2071 if not yvalue == '':
2059 2072 yvalueList = yvalue.split(",")
2060 2073 try:
2061 2074 value = float(yvalueList[0])
2062 2075 value = float(yvalueList[1])
2063 2076 except:
2064 2077 return 0
2065 2078 format = 'float'
2066 2079 opObj.addParameter(name='ymin', value=yvalueList[0], format=format)
2067 2080 opObj.addParameter(name='ymax', value=yvalueList[1], format=format)
2068 2081
2069 2082 if self.specHeisGraphSaveRTIplot.isChecked():
2070 2083 checkPath = True
2071 2084 opObj.addParameter(name='save', value='1', format='bool')
2072 2085 opObj.addParameter(name='figpath', value=self.specHeisGraphPath.text(), format='str')
2073 2086 value = self.specHeisGraphPrefix.text()
2074 2087 if not value == "":
2075 2088 try:
2076 2089 value = str(self.specHeisGraphPrefix.text())
2077 2090 except:
2078 2091 self.console.clear()
2079 2092 self.console.append("Please Write prefix")
2080 2093 return 0
2081 2094 opObj.addParameter(name='figfile', value=value, format='str')
2082 2095
2083 2096 # test_ftp
2084 2097 if self.specHeisGraphftpRTIplot.isChecked():
2085 2098 opObj.addParameter(name='ftp', value='1', format='int')
2086 2099 self.addFTPConf2Operation(puObj, opObj)
2087 2100 addFTP = True
2088 2101
2089 2102 localfolder = None
2090 2103 if checkPath:
2091 2104 localfolder = str(self.specGraphPath.text())
2092 2105 if localfolder == '':
2093 2106 self.console.clear()
2094 2107 self.console.append("Graphic path should be defined")
2095 2108 return 0
2096 2109
2097 2110 if addFTP and not localfolder:
2098 self.console.clear()
2099 self.console.append("You have to save the plots before sending them to FTP Server")
2100 return 0
2111 self.console.clear()
2112 self.console.append("You should save plots before send them to FTP Server")
2113 return 0
2101 2114
2102 2115 # if something happened
2103 2116 parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis')
2104 2117 if parms_ok:
2105 2118 name_operation = 'FitsWriter'
2106 2119 optype = 'other'
2107 2120 name_parameter1 = 'path'
2108 2121 name_parameter2 = 'dataBlocksPerFile'
2109 2122 name_parameter3 = 'metadatafile'
2110 2123 value1 = output_path
2111 2124 value2 = blocksperfile
2112 2125 value3 = metada
2113 2126 format2 = "int"
2114 2127 format3 = "str"
2115 2128 opObj = puObj.addOperation(name=name_operation, optype=optype)
2116 2129 opObj.addParameter(name=name_parameter1, value=value1)
2117 2130 opObj.addParameter(name=name_parameter2, value=value2, format=format2)
2118 2131 opObj.addParameter(name=name_parameter3, value=value3, format=format3)
2119 2132
2120 2133 self.console.clear()
2121 2134 try:
2122 2135 self.refreshPUProperties(puObj)
2123 2136 except:
2124 2137 self.console.append("Check input parameters")
2125 2138 return 0
2126 2139
2127 2140 self.console.append("Click on save icon ff you want to save your project")
2128 2141
2129 2142 self.actionSaveToolbar.setEnabled(True)
2130 2143 self.actionStarToolbar.setEnabled(True)
2131 2144
2132 2145 return 1
2133 2146 @pyqtSignature("int")
2134 2147 def on_specHeisGraphCebSpectraplot_stateChanged(self, p0):
2135 2148
2136 2149 if p0 == 2:
2137 2150 self.specHeisGgraphChannelList.setEnabled(True)
2138 2151 self.specHeisGgraphXminXmax.setEnabled(True)
2139 2152 self.specHeisGgraphYminYmax.setEnabled(True)
2140 2153 if p0 == 0:
2141 2154 self.specHeisGgraphXminXmax.setEnabled(False)
2142 2155 self.specHeisGgraphYminYmax.setEnabled(False)
2143 2156
2144 2157 @pyqtSignature("int")
2145 2158 def on_specHeisGraphCebRTIplot_stateChanged(self, p0):
2146 2159
2147 2160 if p0 == 2:
2148 2161 self.specHeisGgraphChannelList.setEnabled(True)
2149 2162 self.specHeisGgraphTminTmax.setEnabled(True)
2150 2163 self.specHeisGgraphYminYmax.setEnabled(True)
2151 2164 self.specHeisGgraphTimeRange.setEnabled(True)
2152 2165
2153 2166 if p0 == 0:
2154 2167 self.specHeisGgraphTminTmax.setEnabled(False)
2155 2168 self.specHeisGgraphYminYmax.setEnabled(False)
2156 2169 self.specHeisGgraphTimeRange.setEnabled(False)
2157 2170
2158 2171 @pyqtSignature("int")
2159 2172 def on_specHeisGraphSaveSpectra_stateChanged(self, p0):
2160 2173 """
2161 2174 """
2162 2175 if p0 == 2:
2163 2176 self.specHeisGraphPath.setEnabled(True)
2164 2177 self.specHeisGraphPrefix.setEnabled(True)
2165 2178 self.specHeisGraphToolPath.setEnabled(True)
2166 2179 if p0 == 0:
2167 2180 self.specHeisGraphPath.setEnabled(False)
2168 2181 self.specHeisGraphPrefix.setEnabled(False)
2169 2182 self.specHeisGraphToolPath.setEnabled(False)
2170 2183
2171 2184 @pyqtSignature("int")
2172 2185 def on_specHeisGraphSaveRTIplot_stateChanged(self, p0):
2173 2186 if p0 == 2:
2174 2187 self.specHeisGraphPath.setEnabled(True)
2175 2188 self.specHeisGraphPrefix.setEnabled(True)
2176 2189 self.specHeisGraphToolPath.setEnabled(True)
2177 2190
2178 2191 @pyqtSignature("int")
2179 2192 def on_specHeisGraphftpSpectra_stateChanged(self, p0):
2180 2193 """
2181 2194 """
2182 2195 if p0 == 2:
2183 2196 self.specHeisGgraphftpratio.setEnabled(True)
2184 2197
2185 2198 if p0 == 0:
2186 2199 self.specHeisGgraphftpratio.setEnabled(False)
2187 2200
2188 2201 @pyqtSignature("int")
2189 2202 def on_specHeisGraphftpRTIplot_stateChanged(self, p0):
2190 2203 if p0 == 2:
2191 2204 self.specHeisGgraphftpratio.setEnabled(True)
2192 2205
2193 2206 @pyqtSignature("")
2194 2207 def on_specHeisGraphClear_clicked(self):
2195 2208 pass
2196 2209
2197 2210 def __checkSpecGraphSaving(self):
2198 2211
2199 2212 enable = False
2200 2213
2201 2214 if self.specGraphSaveSpectra.checkState():
2202 2215 enable = True
2203 2216
2204 2217 if self.specGraphSaveCross.checkState():
2205 2218 enable = True
2206 2219
2207 2220 if self.specGraphSaveRTIplot.checkState():
2208 2221 enable = True
2209 2222
2210 2223 if self.specGraphSaveCoherencemap.checkState():
2211 2224 enable = True
2212 2225
2213 2226 if self.specGraphSavePowerprofile.checkState():
2214 2227 enable = True
2215 2228
2216 2229 if self.specGraphSaveRTInoise.checkState():
2217 2230 enable = True
2218 2231
2219 2232 self.specGraphPath.setEnabled(enable)
2220 2233 self.specGraphPrefix.setEnabled(enable)
2221 2234 self.specGraphToolPath.setEnabled(enable)
2222 2235
2223 2236 self.specGgraphftpratio.setEnabled(enable)
2224 2237
2225 2238 def __checkSpecGraphFTP(self):
2226 2239
2227 2240 enable = False
2228 2241
2229 2242 if self.specGraphftpSpectra.checkState():
2230 2243 enable = True
2231 2244
2232 2245 if self.specGraphftpCross.checkState():
2233 2246 enable = True
2234 2247
2235 2248 if self.specGraphftpRTIplot.checkState():
2236 2249 enable = True
2237 2250
2238 2251 if self.specGraphftpCoherencemap.checkState():
2239 2252 enable = True
2240 2253
2241 2254 if self.specGraphftpPowerprofile.checkState():
2242 2255 enable = True
2243 2256
2244 2257 if self.specGraphftpRTInoise.checkState():
2245 2258 enable = True
2246 2259
2247 2260 # self.specGgraphftpratio.setEnabled(enable)
2248 2261
2249 2262 def __checkSpecGraphFilters(self):
2250 2263
2251 2264 freq = False
2252 2265 height = False
2253 2266 db = False
2254 2267 time = False
2255 2268 magnitud = False
2256 2269 phase = False
2257 2270 channelList = False
2258 2271
2259 2272 if self.specGraphCebSpectraplot.checkState():
2260 2273 freq = True
2261 2274 height = True
2262 2275 db = True
2263 2276 channelList = True
2264 2277
2265 2278 if self.specGraphCebCrossSpectraplot.checkState():
2266 2279 freq = True
2267 2280 height = True
2268 2281 db = True
2269 2282 magnitud = True
2270 2283 phase = True
2271 2284
2272 2285 if self.specGraphCebRTIplot.checkState():
2273 2286 height = True
2274 2287 db = True
2275 2288 time = True
2276 2289 channelList = True
2277 2290
2278 2291 if self.specGraphCebCoherencmap.checkState():
2279 2292 height = True
2280 2293 time = True
2281 2294 magnitud = True
2282 2295 phase = True
2283 2296
2284 2297 if self.specGraphPowerprofile.checkState():
2285 2298 height = True
2286 2299 db = True
2287 2300 channelList = True
2288 2301
2289 2302 if self.specGraphCebRTInoise.checkState():
2290 2303 db = True
2291 2304 time = True
2292 2305 channelList = True
2293 2306
2294 2307
2295 2308 self.specGgraphFreq.setEnabled(freq)
2296 2309 self.specGgraphHeight.setEnabled(height)
2297 2310 self.specGgraphDbsrange.setEnabled(db)
2298 2311 self.specGgraphTminTmax.setEnabled(time)
2299 2312
2300 2313 self.specGgraphmagnitud.setEnabled(magnitud)
2301 2314 self.specGgraphPhase.setEnabled(phase)
2302 2315 self.specGgraphChannelList.setEnabled(channelList)
2303 2316
2304 2317 def __getParmsFromProjectWindow(self):
2305 2318 """
2306 2319 Check Inputs Project:
2307 2320 - project_name
2308 2321 - datatype
2309 2322 - ext
2310 2323 - data_path
2311 2324 - readmode
2312 2325 - delay
2313 2326 - set
2314 2327 - walk
2315 2328 """
2316 2329 parms_ok = True
2317 2330
2318 2331 project_name = str(self.proName.text())
2319 2332
2320 2333 if project_name == '' or project_name == None:
2321 2334 outputstr = "Enter a project Name"
2322 2335 self.console.append(outputstr)
2323 2336 parms_ok = False
2324 2337 project_name = None
2325 2338
2326 2339 description = str(self.proDescription.toPlainText())
2327 2340
2328 2341 datatype = str(self.proComDataType.currentText())
2329 2342
2330 2343 ext = str(self.proDataType.text())
2331 2344
2332 2345 dpath = str(self.proDataPath.text())
2333 2346
2334 2347 if dpath == '':
2335 2348 outputstr = 'Datapath is empty'
2336 2349 self.console.append(outputstr)
2337 2350 parms_ok = False
2338 2351 dpath = None
2339 2352
2340 2353 if dpath != None:
2341 2354 if not os.path.isdir(dpath):
2342 2355 outputstr = 'Datapath (%s) does not exist' % dpath
2343 2356 self.console.append(outputstr)
2344 2357 parms_ok = False
2345 2358 dpath = None
2346 2359
2347 2360 online = int(self.proComReadMode.currentIndex())
2348 2361
2349 2362 delay = None
2350 2363 if online==1:
2351 2364 try:
2352 2365 delay = int(str(self.proDelay.text()))
2353 2366 except:
2354 2367 outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text())
2355 2368 self.console.append(outputstr)
2356 2369 parms_ok = False
2357 2370
2358 2371
2359 2372 set = None
2360 2373 value = str(self.proSet.text())
2361 2374 try:
2362 2375 set = int(value)
2363 2376 except:
2364 2377 pass
2365 2378
2366 2379 ippKm = None
2367 2380
2368 2381 value = str(self.proIPPKm.text())
2369 2382
2370 2383 try:
2371 2384 ippKm = float(value)
2372 2385 except:
2373 2386 if datatype=="USRP":
2374 2387 outputstr = 'IPP value (%s) must be a float number' % str(self.proIPPKm.text())
2375 2388 self.console.append(outputstr)
2376 2389 parms_ok = False
2377 2390
2378 2391 walk = int(self.proComWalk.currentIndex())
2392 expLabel = str(self.proExpLabel.text())
2379 2393
2380 2394 startDate = str(self.proComStartDate.currentText())
2381 2395 endDate = str(self.proComEndDate.currentText())
2382 2396
2383 2397 # startDateList = startDate.split("/")
2384 2398 # endDateList = endDate.split("/")
2385 2399 #
2386 2400 # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2]))
2387 2401 # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2]))
2388 2402
2389 2403 startTime = self.proStartTime.time()
2390 2404 endTime = self.proEndTime.time()
2391 2405
2392 2406 startTime = str(startTime.toString("H:m:s"))
2393 2407 endTime = str(endTime.toString("H:m:s"))
2394 2408
2395 2409 projectParms = ProjectParms()
2396 2410
2397 2411 projectParms.name = project_name
2398 2412 projectParms.description = description
2399 2413 projectParms.datatype = datatype
2400 2414 projectParms.ext = ext
2401 2415 projectParms.dpath = dpath
2402 2416 projectParms.online = online
2403 2417 projectParms.startDate = startDate
2404 2418 projectParms.endDate = endDate
2405 2419 projectParms.startTime = startTime
2406 2420 projectParms.endTime = endTime
2407 projectParms.delay=delay
2408 projectParms.walk=walk
2409 projectParms.set=set
2410 projectParms.ippKm=ippKm
2411 projectParms.parmsOk=parms_ok
2421 projectParms.delay = delay
2422 projectParms.walk = walk
2423 projectParms.expLabel = expLabel
2424 projectParms.set = set
2425 projectParms.ippKm = ippKm
2426 projectParms.parmsOk = parms_ok
2412 2427
2413 2428 return projectParms
2414 2429
2415 2430
2416 2431 def __getParmsFromProjectObj(self, projectObjView):
2417 2432
2418 2433 parms_ok = True
2419 2434
2420 2435 project_name, description = projectObjView.name, projectObjView.description
2421 2436
2422 2437 readUnitObj = projectObjView.getReadUnitObj()
2423 2438 datatype = readUnitObj.datatype
2424 2439
2425 2440 operationObj = readUnitObj.getOperationObj(name='run')
2426 2441
2427 2442 dpath = operationObj.getParameterValue(parameterName='path')
2428 2443 startDate = operationObj.getParameterValue(parameterName='startDate')
2429 2444 endDate = operationObj.getParameterValue(parameterName='endDate')
2430 2445
2431 2446 startDate = startDate.strftime("%Y/%m/%d")
2432 2447 endDate = endDate.strftime("%Y/%m/%d")
2433 2448
2434 2449 startTime = operationObj.getParameterValue(parameterName='startTime')
2435 2450 endTime = operationObj.getParameterValue(parameterName='endTime')
2436 2451
2437 2452 startTime = startTime.strftime("%H:%M:%S")
2438 2453 endTime = endTime.strftime("%H:%M:%S")
2439 2454
2440 2455 online = 0
2441 2456 try:
2442 2457 online = operationObj.getParameterValue(parameterName='online')
2443 2458 except:
2444 2459 pass
2445 2460
2446 2461 delay = ''
2447 2462 try:
2448 2463 delay = operationObj.getParameterValue(parameterName='delay')
2449 2464 except:
2450 2465 pass
2451 2466
2452 2467 walk = 0
2453 2468 try:
2454 2469 walk = operationObj.getParameterValue(parameterName='walk')
2455 2470 except:
2456 2471 pass
2457 2472
2458 2473 set = ''
2459 2474 try:
2460 2475 set = operationObj.getParameterValue(parameterName='set')
2461 2476 except:
2462 2477 pass
2463 2478
2479 expLabel = ''
2480 try:
2481 expLabel = operationObj.getParameterValue(parameterName='expLabel')
2482 except:
2483 pass
2484
2464 2485 ippKm = ''
2465 2486 if datatype.lower() == 'usrp':
2466 2487 try:
2467 2488 ippKm = operationObj.getParameterValue(parameterName='ippKm')
2468 2489 except:
2469 2490 pass
2470 2491
2471 2492 projectParms = ProjectParms()
2472 2493
2473 2494 projectParms.name = project_name
2474 2495 projectParms.description = description
2475 2496 projectParms.datatype = datatype
2476 2497 projectParms.ext = None
2477 2498 projectParms.dpath = dpath
2478 2499 projectParms.online = online
2479 2500 projectParms.startDate = startDate
2480 2501 projectParms.endDate = endDate
2481 2502 projectParms.startTime = startTime
2482 2503 projectParms.endTime = endTime
2483 2504 projectParms.delay=delay
2484 2505 projectParms.walk=walk
2485 2506 projectParms.set=set
2486 2507 projectParms.ippKm=ippKm
2508 projectParms.expLabel = expLabel
2487 2509 projectParms.parmsOk=parms_ok
2488 2510
2489 2511 return projectParms
2490 2512
2491 def refreshProjectWindow2(self, projectObjView):
2513 def refreshProjectWindow(self, projectObjView):
2492 2514
2493 2515 projectParms = self.__getParmsFromProjectObj(projectObjView)
2494 2516
2495 2517 index = projectParms.getDatatypeIndex()
2496 2518
2497 2519 self.proName.setText(projectParms.name)
2498 2520 self.proDescription.clear()
2499 2521 self.proDescription.append(projectParms.description)
2500 2522
2501 2523 self.on_proComDataType_activated(index=index)
2502 2524 self.proDataPath.setText(projectParms.dpath)
2503 2525 self.proComDataType.setCurrentIndex(index)
2504 2526 self.proComReadMode.setCurrentIndex(projectParms.online)
2505 2527 self.proDelay.setText(str(projectParms.delay))
2506 2528 self.proSet.setText(str(projectParms.set))
2507 2529 self.proIPPKm.setText(str(projectParms.ippKm))
2508 2530 self.proComWalk.setCurrentIndex(projectParms.walk)
2531 self.proExpLabel.setText(str(projectParms.expLabel).strip())
2509 2532
2510 2533 dateList = self.loadDays(data_path = projectParms.dpath,
2511 2534 ext = projectParms.getExt(),
2512 2535 walk = projectParms.walk,
2513 2536 expLabel = projectParms.expLabel)
2514 2537
2515 2538 try:
2516 2539 startDateIndex = dateList.index(projectParms.startDate)
2517 2540 except:
2518 2541 startDateIndex = 0
2519 2542
2520 2543 try:
2521 2544 endDateIndex = dateList.index(projectParms.endDate)
2522 2545 except:
2523 2546 endDateIndex = int(self.proComEndDate.count()-1)
2524 2547
2525 2548 self.proComStartDate.setCurrentIndex(startDateIndex)
2526 2549 self.proComEndDate.setCurrentIndex(endDateIndex)
2527 2550
2528 2551 startlist = projectParms.startTime.split(":")
2529 2552 endlist = projectParms.endTime.split(":")
2530 2553
2531 2554 self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2]))
2532 2555 self.proStartTime.setTime(self.time)
2533 2556
2534 2557 self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2]))
2535 2558 self.proEndTime.setTime(self.time)
2536 2559
2537 2560
2538 2561 def __refreshVoltageWindow(self, puObj):
2539 2562
2540 2563 opObj = puObj.getOperationObj(name='setRadarFrequency')
2541 2564 if opObj == None:
2542 2565 self.volOpRadarfrequency.clear()
2543 2566 self.volOpCebRadarfrequency.setCheckState(0)
2544 2567 else:
2545 2568 value = opObj.getParameterValue(parameterName='frequency')
2546 2569 value = str(float(value)/1e6)
2547 2570 self.volOpRadarfrequency.setText(value)
2548 2571 self.volOpRadarfrequency.setEnabled(True)
2549 2572 self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked)
2550 2573
2551 2574 opObj = puObj.getOperationObj(name="selectChannels")
2552 2575
2553 2576 if opObj == None:
2554 2577 opObj = puObj.getOperationObj(name="selectChannelsByIndex")
2555 2578
2556 2579 if opObj == None:
2557 2580 self.volOpChannel.clear()
2558 2581 self.volOpCebChannels.setCheckState(0)
2559 2582 else:
2560 2583 channelEnabled = False
2561 2584 try:
2562 2585 value = opObj.getParameterValue(parameterName='channelList')
2563 2586 value = str(value)[1:-1]
2564 2587 channelEnabled = True
2565 2588 channelMode = 0
2566 2589 except:
2567 2590 pass
2568 2591 try:
2569 2592 value = opObj.getParameterValue(parameterName='channelIndexList')
2570 2593 value = str(value)[1:-1]
2571 2594 channelEnabled = True
2572 2595 channelMode = 1
2573 2596 except:
2574 2597 pass
2575 2598
2576 2599 if channelEnabled:
2577 2600 self.volOpChannel.setText(value)
2578 2601 self.volOpChannel.setEnabled(True)
2579 2602 self.volOpCebChannels.setCheckState(QtCore.Qt.Checked)
2580 2603 self.volOpComChannels.setCurrentIndex(channelMode)
2581 2604
2582 2605 opObj = puObj.getOperationObj(name="selectHeights")
2583 2606 if opObj == None:
2584 2607 self.volOpHeights.clear()
2585 2608 self.volOpCebHeights.setCheckState(0)
2586 2609 else:
2587 2610 value1 = int(opObj.getParameterValue(parameterName='minHei'))
2588 2611 value1 = str(value1)
2589 2612 value2 = int(opObj.getParameterValue(parameterName='maxHei'))
2590 2613 value2 = str(value2)
2591 2614 value = value1 + "," + value2
2592 2615 self.volOpHeights.setText(value)
2593 2616 self.volOpHeights.setEnabled(True)
2594 2617 self.volOpCebHeights.setCheckState(QtCore.Qt.Checked)
2595 2618
2596 2619 opObj = puObj.getOperationObj(name="filterByHeights")
2597 2620 if opObj == None:
2598 2621 self.volOpFilter.clear()
2599 2622 self.volOpCebFilter.setCheckState(0)
2600 2623 else:
2601 2624 value = opObj.getParameterValue(parameterName='window')
2602 2625 value = str(value)
2603 2626 self.volOpFilter.setText(value)
2604 2627 self.volOpFilter.setEnabled(True)
2605 2628 self.volOpCebFilter.setCheckState(QtCore.Qt.Checked)
2606 2629
2607 2630 opObj = puObj.getOperationObj(name="ProfileSelector")
2608 2631 if opObj == None:
2609 2632 self.volOpProfile.clear()
2610 2633 self.volOpCebProfile.setCheckState(0)
2611 2634 else:
2612 2635 for parmObj in opObj.getParameterObjList():
2613 2636
2614 2637 if parmObj.name == "profileList":
2615 2638 value = parmObj.getValue()
2616 2639 value = str(value)[1:-1]
2617 2640 self.volOpProfile.setText(value)
2618 2641 self.volOpProfile.setEnabled(True)
2619 2642 self.volOpCebProfile.setCheckState(QtCore.Qt.Checked)
2620 2643 self.volOpComProfile.setCurrentIndex(0)
2621 2644
2622 2645 if parmObj.name == "profileRangeList":
2623 2646 value = parmObj.getValue()
2624 2647 value = str(value)[1:-1]
2625 2648 self.volOpProfile.setText(value)
2626 2649 self.volOpProfile.setEnabled(True)
2627 2650 self.volOpCebProfile.setCheckState(QtCore.Qt.Checked)
2628 2651 self.volOpComProfile.setCurrentIndex(1)
2629 2652
2630 2653 if parmObj.name == "rangeList":
2631 2654 value = parmObj.getValue()
2632 2655 value = str(value)[1:-1]
2633 2656 self.volOpProfile.setText(value)
2634 2657 self.volOpProfile.setEnabled(True)
2635 2658 self.volOpCebProfile.setCheckState(QtCore.Qt.Checked)
2636 2659 self.volOpComProfile.setCurrentIndex(2)
2637 2660
2638 2661 opObj = puObj.getOperationObj(name="Decoder")
2639 2662 self.volOpCode.setText("")
2640 2663 if opObj == None:
2641 2664 self.volOpCebDecodification.setCheckState(0)
2642 2665 else:
2643 2666 self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked)
2644 2667
2645 2668 parmObj = opObj.getParameterObj('code')
2646 2669
2647 2670 if parmObj == None:
2648 2671 self.volOpComCode.setCurrentIndex(0)
2649 2672 else:
2650 2673
2651 2674 parmObj1 = opObj.getParameterObj('nCode')
2652 2675 parmObj2 = opObj.getParameterObj('nBaud')
2653 2676
2654 2677 if parmObj1 == None or parmObj2 == None:
2655 2678 self.volOpComCode.setCurrentIndex(0)
2656 2679 else:
2657 2680 code = ast.literal_eval(str(parmObj.getValue()))
2658 2681 nCode = parmObj1.getValue()
2659 2682 nBaud = parmObj2.getValue()
2660 2683
2661 2684 code = numpy.asarray(code).reshape((nCode, nBaud)).tolist()
2662 2685
2663 2686 #User defined by default
2664 2687 self.volOpComCode.setCurrentIndex(13)
2665 2688 self.volOpCode.setText(str(code))
2666 2689
2667 2690 if nCode == 1:
2668 2691 if nBaud == 3:
2669 2692 self.volOpComCode.setCurrentIndex(1)
2670 2693 if nBaud == 4:
2671 2694 self.volOpComCode.setCurrentIndex(2)
2672 2695 if nBaud == 5:
2673 2696 self.volOpComCode.setCurrentIndex(3)
2674 2697 if nBaud == 7:
2675 2698 self.volOpComCode.setCurrentIndex(4)
2676 2699 if nBaud == 11:
2677 2700 self.volOpComCode.setCurrentIndex(5)
2678 2701 if nBaud == 13:
2679 2702 self.volOpComCode.setCurrentIndex(6)
2680 2703
2681 2704 if nCode == 2:
2682 2705 if nBaud == 3:
2683 2706 self.volOpComCode.setCurrentIndex(7)
2684 2707 if nBaud == 4:
2685 2708 self.volOpComCode.setCurrentIndex(8)
2686 2709 if nBaud == 5:
2687 2710 self.volOpComCode.setCurrentIndex(9)
2688 2711 if nBaud == 7:
2689 2712 self.volOpComCode.setCurrentIndex(10)
2690 2713 if nBaud == 11:
2691 2714 self.volOpComCode.setCurrentIndex(11)
2692 2715 if nBaud == 13:
2693 2716 self.volOpComCode.setCurrentIndex(12)
2694 2717
2695 2718
2696 2719 opObj = puObj.getOperationObj(name="deFlip")
2697 2720 if opObj == None:
2698 2721 self.volOpFlip.clear()
2699 2722 self.volOpFlip.setEnabled(False)
2700 2723 self.volOpCebFlip.setCheckState(0)
2701 2724 else:
2702 2725 try:
2703 2726 value = opObj.getParameterValue(parameterName='channelList')
2704 2727 value = str(value)[1:-1]
2705 2728 except:
2706 2729 value = ""
2707 2730
2708 2731 self.volOpFlip.setText(value)
2709 2732 self.volOpFlip.setEnabled(True)
2710 2733 self.volOpCebFlip.setCheckState(QtCore.Qt.Checked)
2711 2734
2712 2735 opObj = puObj.getOperationObj(name="CohInt")
2713 2736 if opObj == None:
2714 2737 self.volOpCohInt.clear()
2715 2738 self.volOpCebCohInt.setCheckState(0)
2716 2739 else:
2717 2740 value = opObj.getParameterValue(parameterName='n')
2718 2741 self.volOpCohInt.setText(str(value))
2719 2742 self.volOpCohInt.setEnabled(True)
2720 2743 self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked)
2721 2744
2722 2745 opObj = puObj.getOperationObj(name='Scope')
2723 2746 if opObj == None:
2724 2747 self.volGraphCebshow.setCheckState(0)
2725 2748 else:
2726 2749 self.volGraphCebshow.setCheckState(QtCore.Qt.Checked)
2727 2750
2728 2751 parmObj = opObj.getParameterObj(parameterName='channelList')
2729 2752
2730 2753 if parmObj == None:
2731 2754 self.volGraphChannelList.clear()
2732 2755 else:
2733 2756 value = parmObj.getValue()
2734 2757 value = str(value)
2735 2758 self.volGraphChannelList.setText(value)
2736 2759 self.volOpProfile.setEnabled(True)
2737 2760
2738 2761 parmObj1 = opObj.getParameterObj(parameterName='xmin')
2739 2762 parmObj2 = opObj.getParameterObj(parameterName='xmax')
2740 2763
2741 2764 if parmObj1 == None or parmObj2 ==None:
2742 2765 self.volGraphfreqrange.clear()
2743 2766 else:
2744 2767 value1 = parmObj1.getValue()
2745 2768 value1 = str(value1)
2746 2769 value2 = parmObj2.getValue()
2747 2770 value2 = str(value2)
2748 2771 value = value1 + "," + value2
2749 2772 self.volGraphfreqrange.setText(value)
2750 2773
2751 2774 parmObj1 = opObj.getParameterObj(parameterName='ymin')
2752 2775 parmObj2 = opObj.getParameterObj(parameterName='ymax')
2753 2776
2754 2777 if parmObj1 == None or parmObj2 ==None:
2755 2778 self.volGraphHeightrange.clear()
2756 2779 else:
2757 2780 value1 = parmObj1.getValue()
2758 2781 value1 = str(value1)
2759 2782 value2 = parmObj2.getValue()
2760 2783 value2 = str(value2)
2761 2784 value = value1 + "," + value2
2762 2785 value2 = str(value2)
2763 2786 self.volGraphHeightrange.setText(value)
2764 2787
2765 2788 parmObj = opObj.getParameterObj(parameterName='save')
2766 2789
2767 2790 if parmObj == None:
2768 2791 self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked)
2769 2792 else:
2770 2793 value = parmObj.getValue()
2771 2794 if int(value):
2772 2795 self.volGraphCebSave.setCheckState(QtCore.Qt.Checked)
2773 2796 else:
2774 2797 self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked)
2775 2798
2776 2799 parmObj = opObj.getParameterObj(parameterName='figpath')
2777 2800 if parmObj == None:
2778 2801 self.volGraphPath.clear()
2779 2802 else:
2780 2803 value = parmObj.getValue()
2781 2804 path = str(value)
2782 2805 self.volGraphPath.setText(path)
2783 2806
2784 2807 parmObj = opObj.getParameterObj(parameterName='figfile')
2785 2808 if parmObj == None:
2786 2809 self.volGraphPrefix.clear()
2787 2810 else:
2788 2811 value = parmObj.getValue()
2789 2812 figfile = str(value)
2790 2813 self.volGraphPrefix.setText(figfile)
2791 2814
2792 2815 # outputVoltageWrite
2793 2816 opObj = puObj.getOperationObj(name='VoltageWriter')
2794 2817
2795 2818 if opObj == None:
2796 2819 self.volOutputPath.clear()
2797 2820 self.volOutputblocksperfile.clear()
2798 2821 self.volOutputprofilesperblock.clear()
2799 2822 else:
2800 2823 parmObj = opObj.getParameterObj(parameterName='path')
2801 2824 if parmObj == None:
2802 2825 self.volOutputPath.clear()
2803 2826 else:
2804 2827 value = parmObj.getValue()
2805 2828 path = str(value)
2806 2829 self.volOutputPath.setText(path)
2807 2830
2808 2831 parmObj = opObj.getParameterObj(parameterName='blocksPerFile')
2809 2832 if parmObj == None:
2810 2833 self.volOutputblocksperfile.clear()
2811 2834 else:
2812 2835 value = parmObj.getValue()
2813 2836 blocksperfile = str(value)
2814 2837 self.volOutputblocksperfile.setText(blocksperfile)
2815 2838
2816 2839 parmObj = opObj.getParameterObj(parameterName='profilesPerBlock')
2817 2840 if parmObj == None:
2818 2841 self.volOutputprofilesperblock.clear()
2819 2842 else:
2820 2843 value = parmObj.getValue()
2821 2844 profilesPerBlock = str(value)
2822 2845 self.volOutputprofilesperblock.setText(profilesPerBlock)
2823 2846
2824 2847 return
2825 2848
2826 2849 def __refreshSpectraWindow(self, puObj):
2827 2850
2828 2851 inputId = puObj.getInputId()
2829 2852 inputPUObj = self.__puObjDict[inputId]
2830 2853
2831 2854 if inputPUObj.datatype == 'Voltage':
2832 2855 self.specOpnFFTpoints.setEnabled(True)
2833 2856 self.specOpProfiles.setEnabled(True)
2834 2857 self.specOpippFactor.setEnabled(True)
2835 2858 else:
2836 2859 self.specOpnFFTpoints.setEnabled(False)
2837 2860 self.specOpProfiles.setEnabled(False)
2838 2861 self.specOpippFactor.setEnabled(False)
2839 2862
2840 2863 opObj = puObj.getOperationObj(name='setRadarFrequency')
2841 2864 if opObj == None:
2842 2865 self.specOpRadarfrequency.clear()
2843 2866 self.specOpCebRadarfrequency.setCheckState(0)
2844 2867 else:
2845 2868 value = opObj.getParameterValue(parameterName='frequency')
2846 2869 value = str(float(value)/1e6)
2847 2870 self.specOpRadarfrequency.setText(value)
2848 2871 self.specOpRadarfrequency.setEnabled(True)
2849 2872 self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked)
2850 2873
2851 2874 opObj = puObj.getOperationObj(name="run")
2852 2875 if opObj == None:
2853 2876 self.specOpnFFTpoints.clear()
2854 2877 self.specOpProfiles.clear()
2855 2878 self.specOpippFactor.clear()
2856 2879 else:
2857 2880 parmObj = opObj.getParameterObj(parameterName='nFFTPoints')
2858 2881 if parmObj == None:
2859 2882 self.specOpnFFTpoints.clear()
2860 2883 else:
2861 2884 self.specOpnFFTpoints.setEnabled(True)
2862 2885 value = opObj.getParameterValue(parameterName='nFFTPoints')
2863 2886 self.specOpnFFTpoints.setText(str(value))
2864 2887
2865 2888 parmObj = opObj.getParameterObj(parameterName='nProfiles')
2866 2889 if parmObj == None:
2867 2890 self.specOpProfiles.clear()
2868 2891 else:
2869 2892 self.specOpProfiles.setEnabled(True)
2870 2893 value = opObj.getParameterValue(parameterName='nProfiles')
2871 2894 self.specOpProfiles.setText(str(value))
2872 2895
2873 2896 parmObj = opObj.getParameterObj(parameterName='ippFactor')
2874 2897 if parmObj == None:
2875 2898 self.specOpippFactor.clear()
2876 2899 else:
2877 2900 self.specOpippFactor.setEnabled(True)
2878 2901 value = opObj.getParameterValue(parameterName='ippFactor')
2879 2902 self.specOpippFactor.setText(str(value))
2880 2903
2881 2904 opObj = puObj.getOperationObj(name="run")
2882 2905 if opObj == None:
2883 2906 self.specOppairsList.clear()
2884 2907 self.specOpCebCrossSpectra.setCheckState(0)
2885 2908 else:
2886 2909 parmObj = opObj.getParameterObj(parameterName='pairsList')
2887 2910 if parmObj == None:
2888 2911 self.specOppairsList.clear()
2889 2912 self.specOpCebCrossSpectra.setCheckState(0)
2890 2913 else:
2891 2914 value = opObj.getParameterValue(parameterName='pairsList')
2892 2915 value = str(value)[1:-1]
2893 2916 self.specOppairsList.setText(str(value))
2894 2917 self.specOppairsList.setEnabled(True)
2895 2918 self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked)
2896 2919
2897 2920 opObj = puObj.getOperationObj(name="selectChannels")
2898 2921
2899 2922 if opObj == None:
2900 2923 opObj = puObj.getOperationObj(name="selectChannelsByIndex")
2901 2924
2902 2925 if opObj == None:
2903 2926 self.specOpChannel.clear()
2904 2927 self.specOpCebChannel.setCheckState(0)
2905 2928 else:
2906 2929 channelEnabled = False
2907 2930 try:
2908 2931 value = opObj.getParameterValue(parameterName='channelList')
2909 2932 value = str(value)[1:-1]
2910 2933 channelEnabled = True
2911 2934 channelMode = 0
2912 2935 except:
2913 2936 pass
2914 2937 try:
2915 2938 value = opObj.getParameterValue(parameterName='channelIndexList')
2916 2939 value = str(value)[1:-1]
2917 2940 channelEnabled = True
2918 2941 channelMode = 1
2919 2942 except:
2920 2943 pass
2921 2944
2922 2945 if channelEnabled:
2923 2946 self.specOpChannel.setText(value)
2924 2947 self.specOpChannel.setEnabled(True)
2925 2948 self.specOpCebChannel.setCheckState(QtCore.Qt.Checked)
2926 2949 self.specOpComChannel.setCurrentIndex(channelMode)
2927 2950
2928 2951 opObj = puObj.getOperationObj(name="selectHeights")
2929 2952 if opObj == None:
2930 2953 self.specOpHeights.clear()
2931 2954 self.specOpCebHeights.setCheckState(0)
2932 2955 else:
2933 2956 value1 = int(opObj.getParameterValue(parameterName='minHei'))
2934 2957 value1 = str(value1)
2935 2958 value2 = int(opObj.getParameterValue(parameterName='maxHei'))
2936 2959 value2 = str(value2)
2937 2960 value = value1 + "," + value2
2938 2961 self.specOpHeights.setText(value)
2939 2962 self.specOpHeights.setEnabled(True)
2940 2963 self.specOpCebHeights.setCheckState(QtCore.Qt.Checked)
2941 2964
2942 2965 opObj = puObj.getOperationObj(name="IncohInt")
2943 2966 if opObj == None:
2944 2967 self.specOpIncoherent.clear()
2945 2968 self.specOpCebIncoherent.setCheckState(0)
2946 2969 else:
2947 2970 for parmObj in opObj.getParameterObjList():
2948 2971 if parmObj.name == 'timeInterval':
2949 2972 value = opObj.getParameterValue(parameterName='timeInterval')
2950 2973 value = float(value)
2951 2974 self.specOpIncoherent.setText(str(value))
2952 2975 self.specOpIncoherent.setEnabled(True)
2953 2976 self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked)
2954 2977 self.specOpCobIncInt.setCurrentIndex(0)
2955 2978
2956 2979 if parmObj.name == 'n':
2957 2980 value = opObj.getParameterValue(parameterName='n')
2958 2981 value = float(value)
2959 2982 self.specOpIncoherent.setText(str(value))
2960 2983 self.specOpIncoherent.setEnabled(True)
2961 2984 self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked)
2962 2985 self.specOpCobIncInt.setCurrentIndex(1)
2963 2986
2964 2987 opObj = puObj.getOperationObj(name="removeDC")
2965 2988 if opObj == None:
2966 2989 self.specOpCebRemoveDC.setCheckState(0)
2967 2990 else:
2968 2991 self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked)
2969 2992 value = opObj.getParameterValue(parameterName='mode')
2970 2993 if value == 1:
2971 2994 self.specOpComRemoveDC.setCurrentIndex(0)
2972 2995 elif value == 2:
2973 2996 self.specOpComRemoveDC.setCurrentIndex(1)
2974 2997
2975 2998 opObj = puObj.getOperationObj(name="removeInterference")
2976 2999 if opObj == None:
2977 3000 self.specOpCebRemoveInt.setCheckState(0)
2978 3001 else:
2979 3002 self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked)
2980 3003
2981 3004 opObj = puObj.getOperationObj(name='getNoise')
2982 3005 if opObj == None:
2983 3006 self.specOpCebgetNoise.setCheckState(0)
2984 3007 self.specOpgetNoise.clear()
2985 3008 else:
2986 3009 self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked)
2987 3010 parmObj = opObj.getParameterObj(parameterName='minHei')
2988 3011 if parmObj == None:
2989 3012 self.specOpgetNoise.clear()
2990 3013 value1 = None
2991 3014 else:
2992 3015 value1 = opObj.getParameterValue(parameterName='minHei')
2993 3016 value1 = str(value1)
2994 3017 parmObj = opObj.getParameterObj(parameterName='maxHei')
2995 3018 if parmObj == None:
2996 3019 value2 = None
2997 3020 value = value1
2998 3021 self.specOpgetNoise.setText(value)
2999 3022 self.specOpgetNoise.setEnabled(True)
3000 3023 else:
3001 3024 value2 = opObj.getParameterValue(parameterName='maxHei')
3002 3025 value2 = str(value2)
3003 3026 parmObj = opObj.getParameterObj(parameterName='minVel')
3004 3027 if parmObj == None:
3005 3028 value3 = None
3006 3029 value = value1 + "," + value2
3007 3030 self.specOpgetNoise.setText(value)
3008 3031 self.specOpgetNoise.setEnabled(True)
3009 3032 else:
3010 3033 value3 = opObj.getParameterValue(parameterName='minVel')
3011 3034 value3 = str(value3)
3012 3035 parmObj = opObj.getParameterObj(parameterName='maxVel')
3013 3036 if parmObj == None:
3014 3037 value4 = None
3015 3038 value = value1 + "," + value2 + "," + value3
3016 3039 self.specOpgetNoise.setText(value)
3017 3040 self.specOpgetNoise.setEnabled(True)
3018 3041 else:
3019 3042 value4 = opObj.getParameterValue(parameterName='maxVel')
3020 3043 value4 = str(value4)
3021 3044 value = value1 + "," + value2 + "," + value3 + ',' + value4
3022 3045 self.specOpgetNoise.setText(value)
3023 3046 self.specOpgetNoise.setEnabled(True)
3024 3047
3025 3048 self.specGraphPath.clear()
3026 3049 self.specGraphPrefix.clear()
3027 3050 self.specGgraphFreq.clear()
3028 3051 self.specGgraphHeight.clear()
3029 3052 self.specGgraphDbsrange.clear()
3030 3053 self.specGgraphmagnitud.clear()
3031 3054 self.specGgraphPhase.clear()
3032 3055 self.specGgraphChannelList.clear()
3033 3056 self.specGgraphTminTmax.clear()
3034 3057 self.specGgraphTimeRange.clear()
3035 3058 self.specGgraphftpratio.clear()
3036 3059
3037 3060 opObj = puObj.getOperationObj(name='SpectraPlot')
3038 3061
3039 3062 if opObj == None:
3040 3063 self.specGraphCebSpectraplot.setCheckState(0)
3041 3064 self.specGraphSaveSpectra.setCheckState(0)
3042 3065 self.specGraphftpSpectra.setCheckState(0)
3043 3066 else:
3044 3067 operationSpectraPlot = "Enable"
3045 3068 self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked)
3046 3069 parmObj = opObj.getParameterObj(parameterName='channelList')
3047 3070 if parmObj == None:
3048 3071 self.specGgraphChannelList.clear()
3049 3072 else:
3050 3073 value = opObj.getParameterValue(parameterName='channelList')
3051 3074 channelListSpectraPlot = str(value)[1:-1]
3052 3075 self.specGgraphChannelList.setText(channelListSpectraPlot)
3053 3076 self.specGgraphChannelList.setEnabled(True)
3054 3077
3055 3078 parmObj = opObj.getParameterObj(parameterName='xmin')
3056 3079 if parmObj == None:
3057 3080 self.specGgraphFreq.clear()
3058 3081 else:
3059 3082 value1 = opObj.getParameterValue(parameterName='xmin')
3060 3083 value1 = str(value1)
3061 3084 value2 = opObj.getParameterValue(parameterName='xmax')
3062 3085 value2 = str(value2)
3063 3086 value = value1 + "," + value2
3064 3087 self.specGgraphFreq.setText(value)
3065 3088 self.specGgraphFreq.setEnabled(True)
3066 3089
3067 3090 parmObj = opObj.getParameterObj(parameterName='ymin')
3068 3091 if parmObj == None:
3069 3092 self.specGgraphHeight.clear()
3070 3093 else:
3071 3094 value1 = opObj.getParameterValue(parameterName='ymin')
3072 3095 value1 = str(value1)
3073 3096 value2 = opObj.getParameterValue(parameterName='ymax')
3074 3097 value2 = str(value2)
3075 3098 value = value1 + "," + value2
3076 3099 self.specGgraphHeight.setText(value)
3077 3100 self.specGgraphHeight.setEnabled(True)
3078 3101
3079 3102 parmObj = opObj.getParameterObj(parameterName='zmin')
3080 3103 if parmObj == None:
3081 3104 self.specGgraphDbsrange.clear()
3082 3105 else:
3083 3106 value1 = opObj.getParameterValue(parameterName='zmin')
3084 3107 value1 = str(value1)
3085 3108 value2 = opObj.getParameterValue(parameterName='zmax')
3086 3109 value2 = str(value2)
3087 3110 value = value1 + "," + value2
3088 3111 self.specGgraphDbsrange.setText(value)
3089 3112 self.specGgraphDbsrange.setEnabled(True)
3090 3113
3091 3114 parmObj = opObj.getParameterObj(parameterName="save")
3092 3115 if parmObj == None:
3093 3116 self.specGraphSaveSpectra.setCheckState(0)
3094 3117 else:
3095 3118 self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked)
3096 3119
3097 3120 parmObj = opObj.getParameterObj(parameterName="ftp")
3098 3121 if parmObj == None:
3099 3122 self.specGraphftpSpectra.setCheckState(0)
3100 3123 else:
3101 3124 self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked)
3102 3125
3103 3126 parmObj = opObj.getParameterObj(parameterName="figpath")
3104 3127 if parmObj:
3105 3128 value = parmObj.getValue()
3106 3129 self.specGraphPath.setText(value)
3107 3130
3108 3131 parmObj = opObj.getParameterObj(parameterName="wr_period")
3109 3132 if parmObj:
3110 3133 value = parmObj.getValue()
3111 3134 self.specGgraphftpratio.setText(str(value))
3112 3135
3113 3136 opObj = puObj.getOperationObj(name='CrossSpectraPlot')
3114 3137
3115 3138 if opObj == None:
3116 3139 self.specGraphCebCrossSpectraplot.setCheckState(0)
3117 3140 self.specGraphSaveCross.setCheckState(0)
3118 3141 self.specGraphftpCross.setCheckState(0)
3119 3142 else:
3120 3143 operationCrossSpectraPlot = "Enable"
3121 3144 self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked)
3122 3145 parmObj = opObj.getParameterObj(parameterName='xmin')
3123 3146 if parmObj == None:
3124 3147 self.specGgraphFreq.clear()
3125 3148 else:
3126 3149 value1 = opObj.getParameterValue(parameterName='xmin')
3127 3150 value1 = str(value1)
3128 3151 value2 = opObj.getParameterValue(parameterName='xmax')
3129 3152 value2 = str(value2)
3130 3153 value = value1 + "," + value2
3131 3154 self.specGgraphFreq.setText(value)
3132 3155 self.specGgraphFreq.setEnabled(True)
3133 3156
3134 3157 parmObj = opObj.getParameterObj(parameterName='ymin')
3135 3158 if parmObj == None:
3136 3159 self.specGgraphHeight.clear()
3137 3160 else:
3138 3161 value1 = opObj.getParameterValue(parameterName='ymin')
3139 3162 value1 = str(value1)
3140 3163 value2 = opObj.getParameterValue(parameterName='ymax')
3141 3164 value2 = str(value2)
3142 3165 value = value1 + "," + value2
3143 3166 self.specGgraphHeight.setText(value)
3144 3167 self.specGgraphHeight.setEnabled(True)
3145 3168
3146 3169 parmObj = opObj.getParameterObj(parameterName='zmin')
3147 3170 if parmObj == None:
3148 3171 self.specGgraphDbsrange.clear()
3149 3172 else:
3150 3173 value1 = opObj.getParameterValue(parameterName='zmin')
3151 3174 value1 = str(value1)
3152 3175 value2 = opObj.getParameterValue(parameterName='zmax')
3153 3176 value2 = str(value2)
3154 3177 value = value1 + "," + value2
3155 3178 self.specGgraphDbsrange.setText(value)
3156 3179 self.specGgraphDbsrange.setEnabled(True)
3157 3180
3158 3181 parmObj = opObj.getParameterObj(parameterName='coh_min')
3159 3182 if parmObj == None:
3160 3183 self.specGgraphmagnitud.clear()
3161 3184 else:
3162 3185 value1 = opObj.getParameterValue(parameterName='coh_min')
3163 3186 value1 = str(value1)
3164 3187 value2 = opObj.getParameterValue(parameterName='coh_max')
3165 3188 value2 = str(value2)
3166 3189 value = value1 + "," + value2
3167 3190 self.specGgraphmagnitud.setText(value)
3168 3191 self.specGgraphmagnitud.setEnabled(True)
3169 3192
3170 3193 parmObj = opObj.getParameterObj(parameterName='phase_min')
3171 3194 if parmObj == None:
3172 3195 self.specGgraphPhase.clear()
3173 3196 else:
3174 3197 value1 = opObj.getParameterValue(parameterName='phase_min')
3175 3198 value1 = str(value1)
3176 3199 value2 = opObj.getParameterValue(parameterName='phase_max')
3177 3200 value2 = str(value2)
3178 3201 value = value1 + "," + value2
3179 3202 self.specGgraphPhase.setText(value)
3180 3203 self.specGgraphPhase.setEnabled(True)
3181 3204
3182 3205 parmObj = opObj.getParameterObj(parameterName="save")
3183 3206 if parmObj == None:
3184 3207 self.specGraphSaveCross.setCheckState(0)
3185 3208 else:
3186 3209 self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked)
3187 3210
3188 3211 parmObj = opObj.getParameterObj(parameterName="ftp")
3189 3212 if parmObj == None:
3190 3213 self.specGraphftpCross.setCheckState(0)
3191 3214 else:
3192 3215 self.specGraphftpCross.setCheckState(QtCore.Qt.Checked)
3193 3216
3194 3217 parmObj = opObj.getParameterObj(parameterName="figpath")
3195 3218 if parmObj:
3196 3219 value = parmObj.getValue()
3197 3220 self.specGraphPath.setText(value)
3198 3221
3199 3222 parmObj = opObj.getParameterObj(parameterName="wr_period")
3200 3223 if parmObj:
3201 3224 value = parmObj.getValue()
3202 3225 self.specGgraphftpratio.setText(str(value))
3203 3226
3204 3227 opObj = puObj.getOperationObj(name='RTIPlot')
3205 3228
3206 3229 if opObj == None:
3207 3230 self.specGraphCebRTIplot.setCheckState(0)
3208 3231 self.specGraphSaveRTIplot.setCheckState(0)
3209 3232 self.specGraphftpRTIplot.setCheckState(0)
3210 3233 else:
3211 3234 self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked)
3212 3235 parmObj = opObj.getParameterObj(parameterName='channelList')
3213 3236 if parmObj == None:
3214 3237 self.specGgraphChannelList.clear()
3215 3238 else:
3216 3239 value = opObj.getParameterValue(parameterName='channelList')
3217 3240 channelListRTIPlot = str(value)[1:-1]
3218 3241 self.specGgraphChannelList.setText(channelListRTIPlot)
3219 3242 self.specGgraphChannelList.setEnabled(True)
3220 3243
3221 3244 parmObj = opObj.getParameterObj(parameterName='xmin')
3222 3245 if parmObj == None:
3223 3246 self.specGgraphTminTmax.clear()
3224 3247 else:
3225 3248 value1 = opObj.getParameterValue(parameterName='xmin')
3226 3249 value1 = str(value1)
3227 3250 value2 = opObj.getParameterValue(parameterName='xmax')
3228 3251 value2 = str(value2)
3229 3252 value = value1 + "," + value2
3230 3253 self.specGgraphTminTmax.setText(value)
3231 3254 self.specGgraphTminTmax.setEnabled(True)
3232 3255
3233 3256 parmObj = opObj.getParameterObj(parameterName='timerange')
3234 3257 if parmObj == None:
3235 3258 self.specGgraphTimeRange.clear()
3236 3259 else:
3237 3260 value1 = opObj.getParameterValue(parameterName='timerange')
3238 3261 value1 = str(value1)
3239 3262 self.specGgraphTimeRange.setText(value1)
3240 3263 self.specGgraphTimeRange.setEnabled(True)
3241 3264
3242 3265 parmObj = opObj.getParameterObj(parameterName='ymin')
3243 3266 if parmObj == None:
3244 3267 self.specGgraphHeight.clear()
3245 3268 else:
3246 3269 value1 = opObj.getParameterValue(parameterName='ymin')
3247 3270 value1 = str(value1)
3248 3271 value2 = opObj.getParameterValue(parameterName='ymax')
3249 3272 value2 = str(value2)
3250 3273 value = value1 + "," + value2
3251 3274 self.specGgraphHeight.setText(value)
3252 3275 self.specGgraphHeight.setEnabled(True)
3253 3276
3254 3277 parmObj = opObj.getParameterObj(parameterName='zmin')
3255 3278 if parmObj == None:
3256 3279 self.specGgraphDbsrange.clear()
3257 3280 else:
3258 3281 value1 = opObj.getParameterValue(parameterName='zmin')
3259 3282 value1 = str(value1)
3260 3283 value2 = opObj.getParameterValue(parameterName='zmax')
3261 3284 value2 = str(value2)
3262 3285 value = value1 + "," + value2
3263 3286 self.specGgraphDbsrange.setText(value)
3264 3287 self.specGgraphDbsrange.setEnabled(True)
3265 3288
3266 3289 parmObj = opObj.getParameterObj(parameterName="save")
3267 3290 if parmObj == None:
3268 3291 self.specGraphSaveRTIplot.setCheckState(0)
3269 3292 else:
3270 3293 self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked)
3271 3294
3272 3295 parmObj = opObj.getParameterObj(parameterName="ftp")
3273 3296 if parmObj == None:
3274 3297 self.specGraphftpRTIplot.setCheckState(0)
3275 3298 else:
3276 3299 self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked)
3277 3300
3278 3301 parmObj = opObj.getParameterObj(parameterName="figpath")
3279 3302 if parmObj:
3280 3303 value = parmObj.getValue()
3281 3304 self.specGraphPath.setText(value)
3282 3305
3283 3306 parmObj = opObj.getParameterObj(parameterName="wr_period")
3284 3307 if parmObj:
3285 3308 value = parmObj.getValue()
3286 3309 self.specGgraphftpratio.setText(str(value))
3287 3310
3288 3311 opObj = puObj.getOperationObj(name='CoherenceMap')
3289 3312
3290 3313 if opObj == None:
3291 3314 self.specGraphCebCoherencmap.setCheckState(0)
3292 3315 self.specGraphSaveCoherencemap.setCheckState(0)
3293 3316 self.specGraphftpCoherencemap.setCheckState(0)
3294 3317 else:
3295 3318 operationCoherenceMap = "Enable"
3296 3319 self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked)
3297 3320 parmObj = opObj.getParameterObj(parameterName='xmin')
3298 3321 if parmObj == None:
3299 3322 self.specGgraphTminTmax.clear()
3300 3323 else:
3301 3324 value1 = opObj.getParameterValue(parameterName='xmin')
3302 3325 value1 = str(value1)
3303 3326 value2 = opObj.getParameterValue(parameterName='xmax')
3304 3327 value2 = str(value2)
3305 3328 value = value1 + "," + value2
3306 3329 self.specGgraphTminTmax.setText(value)
3307 3330 self.specGgraphTminTmax.setEnabled(True)
3308 3331
3309 3332 parmObj = opObj.getParameterObj(parameterName='timerange')
3310 3333 if parmObj == None:
3311 3334 self.specGgraphTimeRange.clear()
3312 3335 else:
3313 3336 value1 = opObj.getParameterValue(parameterName='timerange')
3314 3337 value1 = str(value1)
3315 3338 self.specGgraphTimeRange.setText(value1)
3316 3339 self.specGgraphTimeRange.setEnabled(True)
3317 3340
3318 3341 parmObj = opObj.getParameterObj(parameterName='ymin')
3319 3342 if parmObj == None:
3320 3343 self.specGgraphHeight.clear()
3321 3344 else:
3322 3345 value1 = opObj.getParameterValue(parameterName='ymin')
3323 3346 value1 = str(value1)
3324 3347 value2 = opObj.getParameterValue(parameterName='ymax')
3325 3348 value2 = str(value2)
3326 3349 value = value1 + "," + value2
3327 3350 self.specGgraphHeight.setText(value)
3328 3351 self.specGgraphHeight.setEnabled(True)
3329 3352
3330 3353 parmObj = opObj.getParameterObj(parameterName='zmin')
3331 3354 if parmObj == None:
3332 3355 self.specGgraphmagnitud.clear()
3333 3356 else:
3334 3357 value1 = opObj.getParameterValue(parameterName='zmin')
3335 3358 value1 = str(value1)
3336 3359 value2 = opObj.getParameterValue(parameterName='zmax')
3337 3360 value2 = str(value2)
3338 3361 value = value1 + "," + value2
3339 3362 self.specGgraphmagnitud.setText(value)
3340 3363 self.specGgraphmagnitud.setEnabled(True)
3341 3364
3342 3365 parmObj = opObj.getParameterObj(parameterName='coh_min')
3343 3366 if parmObj == None:
3344 3367 self.specGgraphmagnitud.clear()
3345 3368 else:
3346 3369 value1 = opObj.getParameterValue(parameterName='coh_min')
3347 3370 value1 = str(value1)
3348 3371 value2 = opObj.getParameterValue(parameterName='coh_max')
3349 3372 value2 = str(value2)
3350 3373 value = value1 + "," + value2
3351 3374 self.specGgraphmagnitud.setText(value)
3352 3375 self.specGgraphmagnitud.setEnabled(True)
3353 3376
3354 3377 parmObj = opObj.getParameterObj(parameterName='phase_min')
3355 3378 if parmObj == None:
3356 3379 self.specGgraphPhase.clear()
3357 3380 else:
3358 3381 value1 = opObj.getParameterValue(parameterName='phase_min')
3359 3382 value1 = str(value1)
3360 3383 value2 = opObj.getParameterValue(parameterName='phase_max')
3361 3384 value2 = str(value2)
3362 3385 value = value1 + "," + value2
3363 3386 self.specGgraphPhase.setText(value)
3364 3387 self.specGgraphPhase.setEnabled(True)
3365 3388
3366 3389 parmObj = opObj.getParameterObj(parameterName="save")
3367 3390 if parmObj == None:
3368 3391 self.specGraphSaveCoherencemap.setCheckState(0)
3369 3392 else:
3370 3393 self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked)
3371 3394
3372 3395 parmObj = opObj.getParameterObj(parameterName="ftp")
3373 3396 if parmObj == None:
3374 3397 self.specGraphftpCoherencemap.setCheckState(0)
3375 3398 else:
3376 3399 self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked)
3377 3400
3378 3401 parmObj = opObj.getParameterObj(parameterName="figpath")
3379 3402 if parmObj:
3380 3403 value = parmObj.getValue()
3381 3404 self.specGraphPath.setText(value)
3382 3405
3383 3406 parmObj = opObj.getParameterObj(parameterName="wr_period")
3384 3407 if parmObj:
3385 3408 value = parmObj.getValue()
3386 3409 self.specGgraphftpratio.setText(str(value))
3387 3410
3388 3411 opObj = puObj.getOperationObj(name='PowerProfilePlot')
3389 3412
3390 3413 if opObj == None:
3391 3414 self.specGraphPowerprofile.setCheckState(0)
3392 3415 self.specGraphSavePowerprofile.setCheckState(0)
3393 3416 self.specGraphftpPowerprofile.setCheckState(0)
3394 3417 operationPowerProfilePlot = "Disabled"
3395 3418 channelList = None
3396 3419 freq_vel = None
3397 3420 heightsrange = None
3398 3421 else:
3399 3422 operationPowerProfilePlot = "Enable"
3400 3423 self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked)
3401 3424 parmObj = opObj.getParameterObj(parameterName='xmin')
3402 3425 if parmObj == None:
3403 3426 self.specGgraphDbsrange.clear()
3404 3427 else:
3405 3428 value1 = opObj.getParameterValue(parameterName='xmin')
3406 3429 value1 = str(value1)
3407 3430 value2 = opObj.getParameterValue(parameterName='xmax')
3408 3431 value2 = str(value2)
3409 3432 value = value1 + "," + value2
3410 3433 self.specGgraphDbsrange.setText(value)
3411 3434 self.specGgraphDbsrange.setEnabled(True)
3412 3435
3413 3436 parmObj = opObj.getParameterObj(parameterName='ymin')
3414 3437 if parmObj == None:
3415 3438 self.specGgraphHeight.clear()
3416 3439 else:
3417 3440 value1 = opObj.getParameterValue(parameterName='ymin')
3418 3441 value1 = str(value1)
3419 3442 value2 = opObj.getParameterValue(parameterName='ymax')
3420 3443 value2 = str(value2)
3421 3444 value = value1 + "," + value2
3422 3445 self.specGgraphHeight.setText(value)
3423 3446 self.specGgraphHeight.setEnabled(True)
3424 3447
3425 3448 parmObj = opObj.getParameterObj(parameterName="save")
3426 3449 if parmObj == None:
3427 3450 self.specGraphSavePowerprofile.setCheckState(0)
3428 3451 else:
3429 3452 self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked)
3430 3453
3431 3454 parmObj = opObj.getParameterObj(parameterName="ftp")
3432 3455 if parmObj == None:
3433 3456 self.specGraphftpPowerprofile.setCheckState(0)
3434 3457 else:
3435 3458 self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked)
3436 3459
3437 3460 parmObj = opObj.getParameterObj(parameterName="figpath")
3438 3461 if parmObj:
3439 3462 value = parmObj.getValue()
3440 3463 self.specGraphPath.setText(value)
3441 3464
3442 3465 parmObj = opObj.getParameterObj(parameterName="wr_period")
3443 3466 if parmObj:
3444 3467 value = parmObj.getValue()
3445 3468 self.specGgraphftpratio.setText(str(value))
3446 3469
3447 3470 opObj = puObj.getOperationObj(name='Noise')
3448 3471
3449 3472 if opObj == None:
3450 3473 self.specGraphCebRTInoise.setCheckState(0)
3451 3474 self.specGraphSaveRTInoise.setCheckState(0)
3452 3475 self.specGraphftpRTInoise.setCheckState(0)
3453 3476 else:
3454 3477 self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked)
3455 3478 parmObj = opObj.getParameterObj(parameterName='channelList')
3456 3479 if parmObj == None:
3457 3480 self.specGgraphChannelList.clear()
3458 3481 else:
3459 3482 value = opObj.getParameterValue(parameterName='channelList')
3460 3483 channelListRTINoise = str(value)[1:-1]
3461 3484 self.specGgraphChannelList.setText(channelListRTINoise)
3462 3485 self.specGgraphChannelList.setEnabled(True)
3463 3486
3464 3487 parmObj = opObj.getParameterObj(parameterName='xmin')
3465 3488 if parmObj == None:
3466 3489 self.specGgraphTminTmax.clear()
3467 3490 else:
3468 3491 value1 = opObj.getParameterValue(parameterName='xmin')
3469 3492 value1 = str(value1)
3470 3493 value2 = opObj.getParameterValue(parameterName='xmax')
3471 3494 value2 = str(value2)
3472 3495 value = value1 + "," + value2
3473 3496 self.specGgraphTminTmax.setText(value)
3474 3497 self.specGgraphTminTmax.setEnabled(True)
3475 3498
3476 3499 parmObj = opObj.getParameterObj(parameterName='timerange')
3477 3500 if parmObj == None:
3478 3501 self.specGgraphTimeRange.clear()
3479 3502 else:
3480 3503 value1 = opObj.getParameterValue(parameterName='timerange')
3481 3504 value1 = str(value1)
3482 3505 self.specGgraphTimeRange.setText(value1)
3483 3506 self.specGgraphTimeRange.setEnabled(True)
3484 3507
3485 3508
3486 3509 parmObj = opObj.getParameterObj(parameterName='ymin')
3487 3510 if parmObj == None:
3488 3511 self.specGgraphDbsrange.clear()
3489 3512 else:
3490 3513 value1 = opObj.getParameterValue(parameterName='ymin')
3491 3514 value1 = str(value1)
3492 3515 value2 = opObj.getParameterValue(parameterName='ymax')
3493 3516 value2 = str(value2)
3494 3517 value = value1 + "," + value2
3495 3518 self.specGgraphDbsrange.setText(value)
3496 3519 self.specGgraphDbsrange.setEnabled(True)
3497 3520
3498 3521 parmObj = opObj.getParameterObj(parameterName="save")
3499 3522 if parmObj == None:
3500 3523 self.specGraphSaveRTInoise.setCheckState(0)
3501 3524 else:
3502 3525 self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked)
3503 3526
3504 3527 parmObj = opObj.getParameterObj(parameterName="ftp")
3505 3528 if parmObj == None:
3506 3529 self.specGraphftpRTInoise.setCheckState(0)
3507 3530 else:
3508 3531 self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked)
3509 3532
3510 3533 parmObj = opObj.getParameterObj(parameterName="figpath")
3511 3534 if parmObj:
3512 3535 value = parmObj.getValue()
3513 3536 self.specGraphPath.setText(value)
3514 3537
3515 3538 parmObj = opObj.getParameterObj(parameterName="wr_period")
3516 3539 if parmObj:
3517 3540 value = parmObj.getValue()
3518 3541 self.specGgraphftpratio.setText(str(value))
3519 3542
3520 3543 opObj = puObj.getOperationObj(name='SpectraWriter')
3521 3544 if opObj == None:
3522 3545 self.specOutputPath.clear()
3523 3546 self.specOutputblocksperfile.clear()
3524 self.specOutputprofileperblock.clear()
3525 3547 else:
3526 3548 value = opObj.getParameterObj(parameterName='path')
3527 3549 if value == None:
3528 3550 self.specOutputPath.clear()
3529 3551 else:
3530 3552 value = opObj.getParameterValue(parameterName='path')
3531 3553 path = str(value)
3532 3554 self.specOutputPath.setText(path)
3533 3555 value = opObj.getParameterObj(parameterName='blocksPerFile')
3534 3556 if value == None:
3535 3557 self.specOutputblocksperfile.clear()
3536 3558 else:
3537 3559 value = opObj.getParameterValue(parameterName='blocksPerFile')
3538 3560 blocksperfile = str(value)
3539 3561 self.specOutputblocksperfile.setText(blocksperfile)
3540 value = opObj.getParameterObj(parameterName='profilesPerBlock')
3541 if value == None:
3542 self.specOutputprofileperblock.clear()
3543 else:
3544 value = opObj.getParameterValue(parameterName='profilesPerBlock')
3545 profilesPerBlock = str(value)
3546 self.specOutputprofileperblock.setText(profilesPerBlock)
3547 3562
3548 3563 return
3549 3564
3550 3565 def __refreshSpectraHeisWindow(self, puObj):
3551 3566
3552 3567 opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis")
3553 3568 if opObj == None:
3554 3569 self.specHeisOpIncoherent.clear()
3555 3570 self.specHeisOpCebIncoherent.setCheckState(0)
3556 3571 else:
3557 3572 for parmObj in opObj.getParameterObjList():
3558 3573 if parmObj.name == 'timeInterval':
3559 3574 value = opObj.getParameterValue(parameterName='timeInterval')
3560 3575 value = float(value)
3561 3576 self.specHeisOpIncoherent.setText(str(value))
3562 3577 self.specHeisOpIncoherent.setEnabled(True)
3563 3578 self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked)
3564 3579 self.specHeisOpCobIncInt.setCurrentIndex(0)
3565 3580
3566 3581 # SpectraHeis Graph
3567 3582
3568 3583 self.specHeisGgraphXminXmax.clear()
3569 3584 self.specHeisGgraphYminYmax.clear()
3570 3585
3571 3586 self.specHeisGgraphChannelList.clear()
3572 3587 self.specHeisGgraphTminTmax.clear()
3573 3588 self.specHeisGgraphTimeRange.clear()
3574 3589 self.specHeisGgraphftpratio.clear()
3575 3590
3576 3591 opObj = puObj.getOperationObj(name='SpectraHeisScope')
3577 3592 if opObj == None:
3578 3593 self.specHeisGraphCebSpectraplot.setCheckState(0)
3579 3594 self.specHeisGraphSaveSpectra.setCheckState(0)
3580 3595 self.specHeisGraphftpSpectra.setCheckState(0)
3581 3596 else:
3582 3597 operationSpectraHeisScope = "Enable"
3583 3598 self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked)
3584 3599
3585 3600 parmObj = opObj.getParameterObj(parameterName='channelList')
3586 3601 if parmObj == None:
3587 3602 self.specHeisGgraphChannelList.clear()
3588 3603 else:
3589 3604 value = opObj.getParameterValue(parameterName='channelList')
3590 3605 channelListSpectraHeisScope = str(value)[1:-1]
3591 3606 self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope)
3592 3607 self.specHeisGgraphChannelList.setEnabled(True)
3593 3608
3594 3609 parmObj = opObj.getParameterObj(parameterName='xmin')
3595 3610 if parmObj == None:
3596 3611 self.specHeisGgraphXminXmax.clear()
3597 3612 else:
3598 3613 value1 = opObj.getParameterValue(parameterName='xmin')
3599 3614 value1 = str(value1)
3600 3615 value2 = opObj.getParameterValue(parameterName='xmax')
3601 3616 value2 = str(value2)
3602 3617 value = value1 + "," + value2
3603 3618 self.specHeisGgraphXminXmax.setText(value)
3604 3619 self.specHeisGgraphXminXmax.setEnabled(True)
3605 3620
3606 3621 parmObj = opObj.getParameterObj(parameterName='ymin')
3607 3622 if parmObj == None:
3608 3623 self.specHeisGgraphYminYmax.clear()
3609 3624 else:
3610 3625 value1 = opObj.getParameterValue(parameterName='ymin')
3611 3626 value1 = str(value1)
3612 3627 value2 = opObj.getParameterValue(parameterName='ymax')
3613 3628 value2 = str(value2)
3614 3629 value = value1 + "," + value2
3615 3630 self.specHeisGgraphYminYmax.setText(value)
3616 3631 self.specHeisGgraphYminYmax.setEnabled(True)
3617 3632
3618 3633 parmObj = opObj.getParameterObj(parameterName="save")
3619 3634 if parmObj == None:
3620 3635 self.specHeisGraphSaveSpectra.setCheckState(0)
3621 3636 else:
3622 3637 self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked)
3623 3638
3624 3639 parmObj = opObj.getParameterObj(parameterName="ftp")
3625 3640 if parmObj == None:
3626 3641 self.specHeisGraphftpSpectra.setCheckState(0)
3627 3642 else:
3628 3643 self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked)
3629 3644
3630 3645 parmObj = opObj.getParameterObj(parameterName="figpath")
3631 3646 if parmObj:
3632 3647 value = parmObj.getValue()
3633 3648 self.specHeisGraphPath.setText(value)
3634 3649
3635 3650 parmObj = opObj.getParameterObj(parameterName="wr_period")
3636 3651 if parmObj:
3637 3652 value = parmObj.getValue()
3638 3653 self.specHeisGgraphftpratio.setText(str(value))
3639 3654
3640 3655 opObj = puObj.getOperationObj(name='RTIfromSpectraHeis')
3641 3656
3642 3657 if opObj == None:
3643 3658 self.specHeisGraphCebRTIplot.setCheckState(0)
3644 3659 self.specHeisGraphSaveRTIplot.setCheckState(0)
3645 3660 self.specHeisGraphftpRTIplot.setCheckState(0)
3646 3661 else:
3647 3662 self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked)
3648 3663 parmObj = opObj.getParameterObj(parameterName='channelList')
3649 3664 if parmObj == None:
3650 3665 self.specHeisGgraphChannelList.clear()
3651 3666 else:
3652 3667 value = opObj.getParameterValue(parameterName='channelList')
3653 3668 channelListRTIPlot = str(value)[1:-1]
3654 3669 self.specGgraphChannelList.setText(channelListRTIPlot)
3655 3670 self.specGgraphChannelList.setEnabled(True)
3656 3671
3657 3672 parmObj = opObj.getParameterObj(parameterName='xmin')
3658 3673 if parmObj == None:
3659 3674 self.specHeisGgraphTminTmax.clear()
3660 3675 else:
3661 3676 value1 = opObj.getParameterValue(parameterName='xmin')
3662 3677 value1 = str(value1)
3663 3678 value2 = opObj.getParameterValue(parameterName='xmax')
3664 3679 value2 = str(value2)
3665 3680 value = value1 + "," + value2
3666 3681 self.specHeisGgraphTminTmax.setText(value)
3667 3682 self.specHeisGgraphTminTmax.setEnabled(True)
3668 3683
3669 3684 parmObj = opObj.getParameterObj(parameterName='timerange')
3670 3685 if parmObj == None:
3671 3686 self.specGgraphTimeRange.clear()
3672 3687 else:
3673 3688 value1 = opObj.getParameterValue(parameterName='timerange')
3674 3689 value1 = str(value1)
3675 3690 self.specHeisGgraphTimeRange.setText(value1)
3676 3691 self.specHeisGgraphTimeRange.setEnabled(True)
3677 3692
3678 3693 parmObj = opObj.getParameterObj(parameterName='ymin')
3679 3694 if parmObj == None:
3680 3695 self.specHeisGgraphYminYmax.clear()
3681 3696 else:
3682 3697 value1 = opObj.getParameterValue(parameterName='ymin')
3683 3698 value1 = str(value1)
3684 3699 value2 = opObj.getParameterValue(parameterName='ymax')
3685 3700 value2 = str(value2)
3686 3701 value = value1 + "," + value2
3687 3702 self.specHeisGgraphYminYmax.setText(value)
3688 3703 self.specHeisGgraphYminYmax.setEnabled(True)
3689 3704
3690 3705 parmObj = opObj.getParameterObj(parameterName="save")
3691 3706 if parmObj == None:
3692 3707 self.specHeisGraphSaveRTIplot.setCheckState(0)
3693 3708 else:
3694 3709 self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked)
3695 3710
3696 3711 parmObj = opObj.getParameterObj(parameterName="ftp")
3697 3712 if parmObj == None:
3698 3713 self.specHeisGraphftpRTIplot.setCheckState(0)
3699 3714 else:
3700 3715 self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked)
3701 3716
3702 3717 parmObj = opObj.getParameterObj(parameterName="figpath")
3703 3718 if parmObj:
3704 3719 value = parmObj.getValue()
3705 3720 self.specHeisGraphPath.setText(value)
3706 3721
3707 3722 parmObj = opObj.getParameterObj(parameterName="wr_period")
3708 3723 if parmObj:
3709 3724 value = parmObj.getValue()
3710 3725 self.specHeisGgraphftpratio.setText(str(value))
3711 3726
3712 3727 # outputSpectraHeisWrite
3713 3728 opObj = puObj.getOperationObj(name='FitsWriter')
3714 3729 if opObj == None:
3715 3730 self.specHeisOutputPath.clear()
3716 3731 self.specHeisOutputblocksperfile.clear()
3717 3732 self.specHeisOutputMetada.clear()
3718 3733 else:
3719 3734 value = opObj.getParameterObj(parameterName='path')
3720 3735 if value == None:
3721 3736 self.specHeisOutputPath.clear()
3722 3737 else:
3723 3738 value = opObj.getParameterValue(parameterName='path')
3724 3739 path = str(value)
3725 3740 self.specHeisOutputPath.setText(path)
3726 3741 value = opObj.getParameterObj(parameterName='dataBlocksPerFile')
3727 3742 if value == None:
3728 3743 self.specHeisOutputblocksperfile.clear()
3729 3744 else:
3730 3745 value = opObj.getParameterValue(parameterName='dataBlocksPerFile')
3731 3746 blocksperfile = str(value)
3732 3747 self.specHeisOutputblocksperfile.setText(blocksperfile)
3733 3748 value = opObj.getParameterObj(parameterName='metadatafile')
3734 3749 if value == None:
3735 3750 self.specHeisOutputMetada.clear()
3736 3751 else:
3737 3752 value = opObj.getParameterValue(parameterName='metadatafile')
3738 3753 metada = str(value)
3739 3754 self.specHeisOutputMetada.setText(metada)
3740 3755
3741 3756 return
3742 3757
3743 3758 def __refreshCorrelationWindow(self, puObj):
3744 3759 pass
3745 3760
3746 3761 def refreshPUWindow(self, puObj):
3747 3762
3748 3763 if puObj.datatype == 'Voltage':
3749 3764 self.__refreshVoltageWindow(puObj)
3750 3765
3751 3766 if puObj.datatype == 'Spectra':
3752 3767 self.__refreshSpectraWindow(puObj)
3753 3768
3754 3769 if puObj.datatype == 'SpectraHeis':
3755 3770 self.__refreshSpectraHeisWindow(puObj)
3756 3771
3757 3772 def refreshProjectProperties(self, projectObjView):
3758 3773
3759 3774 propertyBuffObj = PropertyBuffer()
3760 3775 name = projectObjView.name
3761 3776
3762 3777 propertyBuffObj.append("Properties", "Name", projectObjView.name),
3763 3778 propertyBuffObj.append("Properties", "Description", projectObjView.description)
3764 3779 propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace)
3765 3780
3766 3781 readUnitObj = projectObjView.getReadUnitObj()
3767 3782 runOperationObj = readUnitObj.getOperationObj(name='run')
3768 3783
3769 3784 for thisParmObj in runOperationObj.getParameterObjList():
3770 3785 propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue()))
3771 3786
3772 3787 propertiesModel = propertyBuffObj.getPropertyModel()
3773 3788
3774 3789 self.treeProjectProperties.setModel(propertiesModel)
3775 3790 self.treeProjectProperties.expandAll()
3776 3791 self.treeProjectProperties.resizeColumnToContents(0)
3777 3792 self.treeProjectProperties.resizeColumnToContents(1)
3778 3793
3779 3794 def refreshPUProperties(self, puObjView):
3780 3795
3781 3796 ############ FTP CONFIG ################################
3782 3797 #Deleting FTP Conf. This processing unit have not got any
3783 3798 #FTP configuration by default
3784 3799 if puObjView.id in self.__puLocalFolder2FTP.keys():
3785 3800 self.__puLocalFolder2FTP.pop(puObjView.id)
3786 3801 ########################################################
3787 3802
3788 3803 propertyBuffObj = PropertyBuffer()
3789 3804
3790 3805 for thisOp in puObjView.getOperationObjList():
3791 3806
3792 3807 operationName = thisOp.name
3793 3808
3794 3809 if operationName == 'run':
3795 3810 operationName = 'Properties'
3796 3811
3797 3812 else:
3798 3813 if not thisOp.getParameterObjList():
3799 3814 propertyBuffObj.append(operationName, '--', '--')
3800 3815 continue
3801 3816
3802 3817 for thisParmObj in thisOp.getParameterObjList():
3803 3818 propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue()))
3804 3819
3805 3820 ############ FTP CONFIG ################################
3806 3821 if thisParmObj.name == "ftp_wei" and thisParmObj.getValue():
3807 3822 value = thisParmObj.getValue()
3808 3823 self.temporalFTP.ftp_wei = value
3809 3824
3810 3825 if thisParmObj.name == "exp_code" and thisParmObj.getValue():
3811 3826 value = thisParmObj.getValue()
3812 3827 self.temporalFTP.exp_code = value
3813 3828
3814 3829 if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue():
3815 3830 value = thisParmObj.getValue()
3816 3831 self.temporalFTP.sub_exp_code = value
3817 3832
3818 3833 if thisParmObj.name == "plot_pos" and thisParmObj.getValue():
3819 3834 value = thisParmObj.getValue()
3820 3835 self.temporalFTP.plot_pos = value
3821 3836
3822 3837 if thisParmObj.name == 'ftp' and thisParmObj.getValue():
3823 3838 figpathObj = thisOp.getParameterObj('figpath')
3824 3839 if figpathObj:
3825 3840 self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue()
3826 3841
3827 3842 ########################################################
3828 3843
3829 3844 propertiesModel = propertyBuffObj.getPropertyModel()
3830 3845
3831 3846 self.treeProjectProperties.setModel(propertiesModel)
3832 3847 self.treeProjectProperties.expandAll()
3833 3848 self.treeProjectProperties.resizeColumnToContents(0)
3834 3849 self.treeProjectProperties.resizeColumnToContents(1)
3835 3850
3836 3851 def refreshGraphicsId(self):
3837 3852
3838 3853 projectObj = self.getSelectedProjectObj()
3839 3854
3840 3855 for idPU, puObj in projectObj.procUnitConfObjDict.items():
3841 3856
3842 3857 for opObj in puObj.getOperationObjList():
3843 3858
3844 3859 if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'):
3845 3860 continue
3846 3861
3847 3862 opObj.changeParameter(name='id', value=opObj.id, format='int')
3848 3863
3849 3864 def on_click(self, index):
3850 3865
3851 3866 self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index)
3852 3867
3853 3868 projectObjView = self.getSelectedProjectObj()
3854 3869
3855 3870 if not projectObjView:
3856 3871 return
3857 3872
3858 3873 self.create = False
3859 3874 selectedObjView = self.getSelectedItemObj()
3860 3875
3861 3876 #A project has been selected
3862 3877 if projectObjView == selectedObjView:
3863 3878
3864 self.refreshProjectWindow2(projectObjView)
3879 self.refreshProjectWindow(projectObjView)
3865 3880 self.refreshProjectProperties(projectObjView)
3866 3881
3867 3882 self.tabProject.setEnabled(True)
3868 3883 self.tabVoltage.setEnabled(False)
3869 3884 self.tabSpectra.setEnabled(False)
3870 3885 self.tabCorrelation.setEnabled(False)
3871 3886 self.tabSpectraHeis.setEnabled(False)
3872 3887 self.tabWidgetProject.setCurrentWidget(self.tabProject)
3873 3888
3874 3889 return
3875 3890
3876 3891 #A processing unit has been selected
3877 3892 voltEnable = False
3878 3893 specEnable = False
3879 3894 corrEnable = False
3880 3895 specHeisEnable = False
3881 3896 tabSelected = self.tabProject
3882 3897
3883 3898 puObj = selectedObjView
3884 3899
3885 3900 self.refreshPUWindow(puObj)
3886 3901 self.refreshPUProperties(puObj)
3887 3902 self.showtabPUCreated(puObj.datatype)
3888 3903
3889 3904 def on_right_click(self, pos):
3890 3905
3891 3906 self.menu = QtGui.QMenu()
3892 3907 quitAction0 = self.menu.addAction("Create a New Project")
3893 3908 quitAction1 = self.menu.addAction("Create a New Processing Unit")
3894 3909 quitAction2 = self.menu.addAction("Delete Item")
3895 3910 quitAction3 = self.menu.addAction("Quit")
3896 3911
3897 3912 if len(self.__itemTreeDict) == 0:
3898 3913 quitAction2.setEnabled(False)
3899 3914 else:
3900 3915 quitAction2.setEnabled(True)
3901 3916
3902 3917 action = self.menu.exec_(self.mapToGlobal(pos))
3903 3918
3904 3919 if action == quitAction0:
3905 3920 self. setInputsProject_View()
3906 3921 self.create = True
3907 3922
3908 3923 if action == quitAction1:
3909 3924 if len(self.__projectObjDict) == 0:
3910 3925 outputstr = "You need to create a Project before adding a Processing Unit"
3911 3926 self.console.clear()
3912 3927 self.console.append(outputstr)
3913 3928 return 0
3914 3929 else:
3915 3930 self.addPUWindow()
3916 3931 self.console.clear()
3917 3932 self.console.append("Please, Choose the type of Processing Unit")
3918 3933 # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage")
3919 3934 # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation")
3920 3935 # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis")
3921 3936
3922 3937 if action == quitAction2:
3923 3938 index = self.selectedItemTree
3924 3939 try:
3925 3940 index.parent()
3926 3941 except:
3927 3942 self.console.append('Please first select a Project or Processing Unit')
3928 3943 return 0
3929 3944 # print index.parent(),index
3930 3945 if index.parent() == None:
3931 3946 self.projectExplorerModel.removeRow(index.row())
3932 3947 else:
3933 3948 index.parent().removeRow(index.row())
3934 3949 self.removeItemTreeFromProject()
3935 3950 self.console.clear()
3936 3951 # for i in self.projectExplorerTree.selectionModel().selection().indexes():
3937 3952 # print i.row()
3938 3953
3939 3954 if action == quitAction3:
3940 3955 self.close()
3941 3956 return 0
3942
3943 def create_updating_timer(self):
3944 self.comm_data_timer = QtCore.QTimer(self)
3945 self.comm_data_timer.timeout.connect(self.on_comm_updating_timer)
3946 self.comm_data_timer.start(1000)
3947 3957
3948 3958 def createProjectView(self, id):
3949 3959
3950 3960 # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow()
3951 3961 id = str(id)
3952 3962 projectParms = self.__getParmsFromProjectWindow()
3953 3963
3954 3964 if not projectParms.isValid():
3955 3965 return None
3956 3966
3957 3967 projectObjView = Project()
3958 3968 projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description)
3959 3969
3960 3970 self.__projectObjDict[id] = projectObjView
3961 3971 self.addProject2ProjectExplorer(id=id, name=projectObjView.name)
3962 3972
3963 3973 self.create = False
3964 3974
3965 3975 return projectObjView
3966 3976
3967 3977 def updateProjectView(self):
3968 3978
3969 3979 # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow()
3970 3980
3971 3981 projectParms = self.__getParmsFromProjectWindow()
3972 3982
3973 3983 if not projectParms.isValid():
3974 3984 return None
3975 3985
3976 3986 projectObjView = self.getSelectedProjectObj()
3977 3987 projectObjView.update(name=projectParms.name, description=projectParms.description)
3978 3988
3979 3989 return projectObjView
3980 3990
3981 3991 def createReadUnitView(self, projectObjView):
3982 3992
3983 3993 # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow()
3984 3994
3985 3995 projectParms = self.__getParmsFromProjectWindow()
3986 3996
3987 3997 if not projectParms.isValid():
3988 3998 return None
3989 3999
3990 4000 if projectParms.datatype in ("Voltage", "Spectra", "Fits"):
3991 4001 readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype,
3992 4002 path=projectParms.dpath,
3993 4003 startDate=projectParms.startDate,
3994 4004 endDate=projectParms.endDate,
3995 4005 startTime=projectParms.startTime,
3996 4006 endTime=projectParms.endTime,
3997 4007 online=projectParms.online,
3998 4008 walk=projectParms.walk
3999 4009 )
4000 4010
4001 4011 if projectParms.set:
4002 4012 readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int")
4003 4013
4004 4014 if projectParms.delay:
4005 4015 readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int")
4006
4016
4017 if projectParms.expLabel:
4018 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4019
4007 4020 if projectParms.datatype == "USRP":
4008 4021 readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype,
4009 4022 path=projectParms.dpath,
4010 4023 startDate=projectParms.startDate,
4011 4024 endDate=projectParms.endDate,
4012 4025 startTime=projectParms.startTime,
4013 4026 endTime=projectParms.endTime,
4014 4027 online=projectParms.online,
4015 4028 ippKm=projectParms.ippKm
4016 4029 )
4017 4030
4018 4031 if projectParms.delay:
4019 4032 readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int")
4020 4033
4021 4034 return readUnitConfObj
4022 4035
4023 4036 def updateReadUnitView(self, projectObjView, idReadUnit):
4024 4037
4025 4038 # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow()
4026 4039
4027 4040 readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit)
4028 4041
4029 4042 projectParms = self.__getParmsFromProjectWindow()
4030 4043
4031 4044 if not projectParms.isValid():
4032 4045 return None
4033 4046
4034 4047 if projectParms.datatype in ["Voltage", "Spectra", "Fits"]:
4035 4048 readUnitConfObj.update(datatype=projectParms.datatype,
4036 4049 path=projectParms.dpath,
4037 4050 startDate=projectParms.startDate,
4038 4051 endDate=projectParms.endDate,
4039 4052 startTime=projectParms.startTime,
4040 4053 endTime=projectParms.endTime,
4041 4054 online=projectParms.online,
4042 4055 walk=projectParms.walk
4043 4056 )
4044 4057 if projectParms.set:
4045 4058 readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int")
4046 4059
4047 4060 if projectParms.delay:
4048 4061 readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int")
4062
4063 if projectParms.expLabel:
4064 readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel)
4049 4065
4050 4066 if projectParms.datatype == "USRP":
4051 4067 readUnitConfObj.update(datatype=projectParms.datatype,
4052 4068 path=projectParms.dpath,
4053 4069 startDate=projectParms.startDate,
4054 4070 endDate=projectParms.endDate,
4055 4071 startTime=projectParms.startTime,
4056 4072 endTime=projectParms.endTime,
4057 4073 online=projectParms.online,
4058 4074 ippKm=projectParms.ippKm
4059 4075 )
4060 4076
4061 4077 if projectParms.delay:
4062 4078 readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int")
4063 4079
4064 4080 return readUnitConfObj
4065 4081
4066 4082 def createProcUnitView(self, projectObjView, datatype, inputId):
4067 4083
4068 4084 procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId)
4069 4085
4070 4086 self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj
4071 4087
4072 4088 return procUnitConfObj
4073 4089
4074 4090 def updateProcUnitView(self, id):
4075 4091
4076 4092 procUnitConfObj = projectObjView.getProcUnitObj(id)
4077 4093 procUnitConfObj.removeOperations()
4078 4094
4079 4095 return procUnitConfObj
4080 4096
4081 4097 def addPUWindow(self):
4082 4098
4083 4099 self.configUPWindowObj = UnitProcessWindow(self)
4084 4100 fatherObj = self.getSelectedItemObj()
4085 4101 try:
4086 4102 fatherObj.getElementName()
4087 4103 except:
4088 4104 self.console.append("First left click on Project or Processing Unit")
4089 4105 return 0
4090 4106
4091 4107 if fatherObj.getElementName() == 'Project':
4092 4108 readUnitConfObj = fatherObj.getReadUnitObj()
4093 4109 self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype)
4094 4110
4095 4111 self.configUPWindowObj.getfromWindowList.append(fatherObj)
4096 4112 self.configUPWindowObj.loadTotalList()
4097 4113 self.configUPWindowObj.show()
4098 4114 self.configUPWindowObj.closed.connect(self.createPUWindow)
4099 4115
4100 4116 def createPUWindow(self):
4101 4117
4102 4118 if not self.configUPWindowObj.create:
4103 4119 return
4104 4120
4105 4121 fatherObj = self.configUPWindowObj.getFromWindow
4106 4122 datatype = self.configUPWindowObj.typeofUP
4107 4123
4108 4124 if fatherObj.getElementName() == 'Project':
4109 4125 inputId = fatherObj.getReadUnitId()
4110 4126 projectObjView = fatherObj
4111 4127 else:
4112 4128 inputId = fatherObj.getId()
4113 4129 projectObjView = self.getSelectedProjectObj()
4114 4130
4115 4131 puObj = self.createProcUnitView(projectObjView, datatype, inputId)
4116 4132
4117 4133 self.addPU2ProjectExplorer(puObj)
4118 4134
4119 4135 self.showtabPUCreated(datatype)
4120 4136
4121 4137 self.clearPUWindow(datatype)
4122 4138
4123 4139 self.showPUinitView()
4124 4140
4125 4141 def addFTPConf2Operation(self, puObj, opObj):
4126 4142
4127 4143 if not self.temporalFTP.create:
4128 4144 self.temporalFTP.setwithoutconfiguration()
4129 4145
4130 4146 # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str')
4131 4147 # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str')
4132 4148 # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str')
4133 4149 # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str')
4134 4150
4135 4151 if self.temporalFTP.ftp_wei:
4136 4152 opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int')
4137 4153 if self.temporalFTP.exp_code:
4138 4154 opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int')
4139 4155 if self.temporalFTP.sub_exp_code:
4140 4156 opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int')
4141 4157 if self.temporalFTP.plot_pos:
4142 4158 opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int')
4143 4159
4144 def __checkFTPProcUnit(self, projectObj, localfolder):
4145
4146 puId = None
4147 puObj = None
4148
4149 for thisPuId, thisPuObj in projectObj.procUnitItems():
4150
4151 if not thisPuObj.name == "SendToServer":
4152 continue
4153
4154 opObj = thisPuObj.getOperationObj(name='run')
4155
4156 parmObj = opObj.getParameterObj('localfolder')
4157
4158 #localfolder parameter should always be set, if it is not set then ProcUnit should be removed
4159 if not parmObj:
4160 projectObj.removeProcUnit(thisPuId)
4161 continue
4162
4163 thisLocalfolder = parmObj.getValue()
4164
4165 if localfolder != thisLocalfolder:
4166 continue
4167
4168 puId = thisPuId
4169 puObj = thisPuObj
4170 break
4171
4172 return puObj
4160 # def __checkFTPProcUnit(self, projectObj, localfolder):
4161 #
4162 # puId = None
4163 # puObj = None
4164 #
4165 # for thisPuId, thisPuObj in projectObj.procUnitItems():
4166 #
4167 # if not thisPuObj.name == "SendToServer":
4168 # continue
4169 #
4170 # opObj = thisPuObj.getOperationObj(name='run')
4171 #
4172 # parmObj = opObj.getParameterObj('localfolder')
4173 #
4174 # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed
4175 # if not parmObj:
4176 # projectObj.removeProcUnit(thisPuId)
4177 # continue
4178 #
4179 # thisLocalfolder = parmObj.getValue()
4180 #
4181 # if localfolder != thisLocalfolder:
4182 # continue
4183 #
4184 # puId = thisPuId
4185 # puObj = thisPuObj
4186 # break
4187 #
4188 # return puObj
4173 4189
4174 4190 def createFTPProcUnitView(self):
4175 4191
4176 4192 if not self.temporalFTP.create:
4177 4193 self.temporalFTP.setwithoutconfiguration()
4178 4194
4179 4195 projectObj = self.getSelectedProjectObj()
4180 4196
4181 4197 self.removeAllFTPProcUnitView(projectObj)
4182 4198
4183 4199 if not self.__puLocalFolder2FTP:
4184 4200 return
4185 4201
4186 folderList = ""
4187
4188 for localfolder in self.__puLocalFolder2FTP.values():
4189 folderList += str(localfolder) + ","
4202 folderList = ",".join(self.__puLocalFolder2FTP.values())
4190 4203
4191 4204 procUnitConfObj = projectObj.addProcUnit(name="SendToServer")
4192 4205
4193 4206 procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str')
4194 4207 procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str')
4195 4208 procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str')
4196 4209 procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list')
4197 4210 procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str')
4198 4211 procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str')
4199 4212 procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int')
4200 4213 procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str')
4201 4214
4202 4215 procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int')
4203 4216 procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int')
4204 4217 procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int')
4205 4218 procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int')
4206 4219
4207 4220 self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj
4208 4221
4209 4222 def removeAllFTPProcUnitView(self, projectObj):
4210 4223
4211 4224 for thisPuId, thisPuObj in projectObj.procUnitItems():
4212 4225
4213 4226 if not thisPuObj.name == "SendToServer":
4214 4227 continue
4215 4228
4216 4229 projectObj.removeProcUnit(thisPuId)
4217 4230
4218 4231 if thisPuId not in self.__puObjDict.keys():
4219 4232 continue
4220 4233
4221 4234 self.__puObjDict.pop(thisPuId)
4222 4235
4223 4236 def showPUinitView(self):
4224 4237
4225 4238 self.propertiesModel = TreeModel()
4226 4239 self.propertiesModel.initPUVoltageView()
4227 4240 self.treeProjectProperties.setModel(self.propertiesModel)
4228 4241 self.treeProjectProperties.expandAll()
4229 4242 self.treeProjectProperties.allColumnsShowFocus()
4230 4243 self.treeProjectProperties.resizeColumnToContents(1)
4231 4244
4232 4245 def saveFTPFromOpObj(self, operationObj):
4233 4246
4234 4247 if operationObj.name != "SendByFTP":
4235 4248 return
4236 4249
4237 4250 server = operationObj.getParameterValue("server")
4238 4251 username = operationObj.getParameterValue("username")
4239 4252 password = operationObj.getParameterValue("password")
4240 4253 localfolder = operationObj.getParameterValue("localfolder")
4241 4254 remotefolder = operationObj.getParameterValue("remotefolder")
4242 4255 ext = operationObj.getParameterValue("ext")
4243 4256 period = operationObj.getParameterValue("period")
4244 4257
4245 4258 self.temporalFTP.save(server=server,
4246 4259 remotefolder=remotefolder,
4247 4260 username=username,
4248 4261 password=password,
4249 4262 localfolder=localfolder,
4250 4263 extension=ext)
4251 4264
4252 4265 return
4253 4266
4254 4267 def saveFTPFromProcUnitObj(self, puObj):
4255 4268
4256 4269 opObj = puObj.getOperationObj(name="run")
4257 4270
4258 4271 parmObj = opObj.getParameterObj(parameterName="server")
4259 4272 if parmObj == None:
4260 4273 server = 'jro-app.igp.gob.pe'
4261 4274 else:
4262 4275 server = parmObj.getValue()
4263 4276
4264 4277 parmObj = opObj.getParameterObj(parameterName="remotefolder")
4265 4278 if parmObj == None:
4266 4279 remotefolder = '/home/wmaster/graficos'
4267 4280 else:
4268 4281 remotefolder = parmObj.getValue()
4269 4282
4270 4283 parmObj = opObj.getParameterObj(parameterName="username")
4271 4284 if parmObj == None:
4272 4285 username = 'wmaster'
4273 4286 else:
4274 4287 username = parmObj.getValue()
4275 4288
4276 4289 parmObj = opObj.getParameterObj(parameterName="password")
4277 4290 if parmObj == None:
4278 4291 password = 'mst2010vhf'
4279 4292 else:
4280 4293 password = parmObj.getValue()
4281 4294
4282 4295 parmObj = opObj.getParameterObj(parameterName="ftp_wei")
4283 4296 if parmObj == None:
4284 4297 ftp_wei = 0
4285 4298 else:
4286 4299 ftp_wei = parmObj.getValue()
4287 4300
4288 4301 parmObj = opObj.getParameterObj(parameterName="exp_code")
4289 4302 if parmObj == None:
4290 4303 exp_code = 0
4291 4304 else:
4292 4305 exp_code = parmObj.getValue()
4293 4306
4294 4307 parmObj = opObj.getParameterObj(parameterName="sub_exp_code")
4295 4308 if parmObj == None:
4296 4309 sub_exp_code = 0
4297 4310 else:
4298 4311 sub_exp_code = parmObj.getValue()
4299 4312
4300 4313 parmObj = opObj.getParameterObj(parameterName="plot_pos")
4301 4314 if parmObj == None:
4302 4315 plot_pos = 0
4303 4316 else:
4304 4317 plot_pos = parmObj.getValue()
4305 4318
4306 4319 parmObj = opObj.getParameterObj(parameterName="localfolder")
4307 4320 if parmObj == None:
4308 4321 localfolder = None
4309 4322 else:
4310 4323 localfolder = parmObj.getValue()
4311 4324
4312 4325 parmObj = opObj.getParameterObj(parameterName="ext")
4313 4326 if parmObj == None:
4314 4327 extension = '.png'
4315 4328 else:
4316 4329 extension = parmObj.getValue()
4317 4330
4318 4331 self.temporalFTP.save(server=server,
4319 4332 remotefolder=remotefolder,
4320 4333 username=username,
4321 4334 password=password,
4322 4335 ftp_wei=ftp_wei,
4323 4336 exp_code=exp_code,
4324 4337 sub_exp_code=sub_exp_code,
4325 4338 plot_pos=plot_pos,
4326 4339 localfolder=localfolder,
4327 4340 extension=extension)
4328 4341
4329 4342 def addProject2ProjectExplorer(self, id, name):
4330 4343
4331 4344 itemTree = QtGui.QStandardItem(QtCore.QString(str(name)))
4332 4345
4333 4346 parentItem = self.projectExplorerModel.invisibleRootItem()
4334 4347 parentItem.appendRow(itemTree)
4335 4348
4336 4349 self.projectExplorerTree.setCurrentIndex(itemTree.index())
4337 4350
4338 4351 self.selectedItemTree = itemTree
4339 4352
4340 4353 self.__itemTreeDict[id] = itemTree
4341 4354
4342 4355 def addPU2ProjectExplorer(self, puObj):
4343 4356
4344 4357 id, name = puObj.id, puObj.datatype
4345 4358
4346 4359 itemTree = QtGui.QStandardItem(QtCore.QString(str(name)))
4347 4360
4348 4361 parentItem = self.selectedItemTree
4349 4362 parentItem.appendRow(itemTree)
4350 4363 self.projectExplorerTree.expandAll()
4351 4364
4352 4365 self.projectExplorerTree.setCurrentIndex(itemTree.index())
4353 4366
4354 4367 self.selectedItemTree = itemTree
4355 4368
4356 4369 self.__itemTreeDict[id] = itemTree
4357 4370
4358 4371 def addPU2PELoadXML(self, puObj):
4359 4372
4360 4373 id, name, inputId = puObj.id, puObj.datatype, puObj.inputId
4361 4374
4362 4375 itemTree = QtGui.QStandardItem(QtCore.QString(str(name)))
4363 4376
4364 4377 if self.__itemTreeDict.has_key(inputId):
4365 4378 parentItem = self.__itemTreeDict[inputId]
4366 4379 else:
4367 4380 #If parent is a Reader object
4368 4381 parentItem = self.__itemTreeDict[id[:-1]]
4369 4382
4370 4383 parentItem.appendRow(itemTree)
4371 4384 self.projectExplorerTree.expandAll()
4372 4385 parentItem = itemTree
4373 4386 self.projectExplorerTree.setCurrentIndex(parentItem.index())
4374 4387
4375 4388 self.__itemTreeDict[id] = itemTree
4376 4389 self.selectedItemTree = itemTree
4377 4390
4378 4391 def getSelectedProjectObj(self):
4379 4392 """
4380 4393 Return the current project object selected. If a processing unit is
4381 4394 actually selected this function returns associated project.
4382 4395
4383 4396 None if any project or processing unit is selected
4384 4397 """
4385 4398 for key in self.__itemTreeDict.keys():
4386 4399 if self.__itemTreeDict[key] != self.selectedItemTree:
4387 4400 continue
4388 4401
4389 4402 if self.__projectObjDict.has_key(key):
4390 4403 projectObj = self.__projectObjDict[key]
4391 4404 return projectObj
4392 4405
4393 4406 puObj = self.__puObjDict[key]
4394 4407
4395 4408 if puObj.parentId == None:
4396 4409 projectId = puObj.getId()[0]
4397 4410 else:
4398 4411 projectId = puObj.parentId
4399 4412
4400 4413 projectObj = self.__projectObjDict[projectId]
4401 4414 return projectObj
4402 4415
4403 4416 return None
4404 4417
4405 4418 def getSelectedItemObj(self):
4406 4419 """
4407 4420 Return the current project or processing unit object selected
4408 4421
4409 4422 None if any project or processing unit is selected
4410 4423 """
4411 4424 for key in self.__itemTreeDict.keys():
4412 4425 if self.__itemTreeDict[key] != self.selectedItemTree:
4413 4426 continue
4414 4427
4415 4428 if self.__projectObjDict.has_key(key) == True:
4416 4429 fatherObj = self.__projectObjDict[key]
4417 4430 else:
4418 4431 fatherObj = self.__puObjDict[key]
4419 4432
4420 4433 return fatherObj
4421 4434
4422 4435 return None
4423 4436
4424 4437 def _WarningWindow(self, text, information):
4425 4438
4426 4439 msgBox = QtGui.QMessageBox()
4427 4440 msgBox.setText(text)
4428 4441 msgBox.setInformativeText(information)
4429 4442 msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel)
4430 4443 msgBox.setDefaultButton(QtGui.QMessageBox.Ok)
4431 4444 ret = msgBox.exec_()
4432 4445
4433 4446 answer = False
4434 4447
4435 4448 if ret == QtGui.QMessageBox.Ok:
4436 4449 answer = True
4437 4450
4438 4451 return answer
4439 4452
4440 4453 def __getNewProjectId(self):
4441 4454
4442 4455 loadProject = False
4443 4456
4444 4457 for thisId in range(1,10):
4445 4458 newId = str(thisId)
4446 4459 if newId in self.__projectObjDict.keys():
4447 4460 continue
4448 4461
4449 4462 loadProject = True
4450 4463 projectId = newId
4451 4464 break
4452 4465
4453 4466 if not loadProject:
4454 4467 self.console.clear()
4455 4468 self.console.append("The maximum number of projects has been loaded, a new project can not be loaded")
4456 4469 return None
4457 4470
4458 4471 return projectId
4459 4472
4460 4473 def openProject(self):
4461 4474
4462 4475 self.actionStart.setEnabled(False)
4463 4476 self.actionStarToolbar.setEnabled(False)
4464 4477
4465 4478 self.create = False
4466 4479 self.frame_2.setEnabled(True)
4467 4480
4468 4481 # print self.dir
4469 4482 filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)")))
4470 4483
4471 4484 projectObjLoad = Project()
4472 4485
4473 4486 try:
4474 4487 projectObjLoad.readXml(filename)
4475 4488 except:
4476 4489 self.console.clear()
4477 4490 self.console.append("The selected xml file could not be loaded ...")
4478 4491 return 0
4479 4492
4480 self.refreshProjectWindow2(projectObjLoad)
4493 self.refreshProjectWindow(projectObjLoad)
4481 4494 self.refreshProjectProperties(projectObjLoad)
4482 4495
4483 4496 projectId = projectObjLoad.id
4484 4497
4485 4498 if projectId in self.__projectObjDict.keys():
4486 4499
4487 4500 # answer = self._WarningWindow("You already have a project loaded with the same Id",
4488 4501 # "Do you want to load the file anyway?")
4489 4502 # if not answer:
4490 4503 # return
4491 4504
4492 4505 projectId = self.__getNewProjectId()
4493 4506
4494 4507 if not projectId:
4495 4508 return
4496 4509
4497 4510 projectObjLoad.updateId(projectId)
4498 4511
4499 4512 self.__projectObjDict[projectId] = projectObjLoad
4500 4513
4501 4514 self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name)
4502 4515
4503 4516 self.tabWidgetProject.setEnabled(True)
4504 4517 self.tabWidgetProject.setCurrentWidget(self.tabProject)
4505 4518 # Disable tabProject after finish the creation
4506 4519 self.tabProject.setEnabled(True)
4507 4520 puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0]))
4508 4521
4509 4522 for puId, puObj in puObjorderList.items():
4510 4523
4511 4524 self.__puObjDict[puId] = puObj
4512 4525
4513 4526 if puObj.name == "SendToServer":
4514 4527 self.saveFTPFromProcUnitObj(puObj)
4515 4528
4516 4529 ############## COMPATIBLE WITH OLD VERSIONS ################
4517 4530 operationObj = puObj.getOperationObj("SendByFTP")
4518 4531
4519 4532 if operationObj:
4520 4533 self.saveFTPFromOpObj(operationObj)
4521 4534 ############################################################
4522 4535
4523 4536 if puObj.inputId == '0':
4524 4537 continue
4525 4538
4526 4539 self.addPU2PELoadXML(puObj)
4527 4540
4528 4541 self.refreshPUWindow(puObj)
4529 4542 self.refreshPUProperties(puObj)
4530 4543 self.showtabPUCreated(datatype=puObj.datatype)
4531 4544
4532 4545 self.console.clear()
4533 4546 self.console.append("The selected xml file has been loaded successfully")
4534 4547
4535 4548 self.actionStart.setEnabled(True)
4536 4549 self.actionStarToolbar.setEnabled(True)
4537
4550
4551 def create_updating_timer(self):
4552 self.comm_data_timer = QtCore.QTimer(self)
4553 self.comm_data_timer.timeout.connect(self.on_comm_updating_timer)
4554 self.comm_data_timer.start(1000)
4555
4538 4556 def on_comm_updating_timer(self):
4539 4557 # Verifica si algun proceso ha sido inicializado y sigue ejecutandose
4540
4541 if not self.__initialized:
4558 # Si el proceso se ha parado actualizar el GUI (stopProject)
4559 if not self.__enable:
4542 4560 return
4543
4544 if not self.controllerObj.isAlive():
4561
4562 if self.controllerThread.isFinished():
4545 4563 self.stopProject()
4546
4564
4565 # def jobStartedFromThread(self, success):
4566 #
4567 # self.console.clear()
4568 # self.console.append("Job started")
4569 #
4570 # def jobFinishedFromThread(self, success):
4571 #
4572 # self.stopProject()
4573
4547 4574 def playProject(self, ext=".xml", save=1):
4548 4575
4549 4576 # self.console.clear()
4550 4577 projectObj = self.getSelectedProjectObj()
4551 4578
4552 4579 if not projectObj:
4553 4580 print "Please select a project before pressing PLAY button"
4554 4581 return
4555 4582
4556 4583 if save:
4557 4584 filename = self.saveProject()
4558 4585 if filename == None:
4559 4586 self.console.append("Process did not initialize.")
4560 4587 return
4561 4588 else:
4562 4589 filename = TEMPORAL_FILE
4563 4590 projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) )
4564 4591
4565 4592 self.actionStart.setEnabled(False)
4566 4593 self.actionPause.setEnabled(True)
4567 4594 self.actionStop.setEnabled(True)
4568 4595
4569 4596 self.actionStarToolbar.setEnabled(False)
4570 4597 self.actionPauseToolbar.setEnabled(True)
4571 4598 self.actionStopToolbar.setEnabled(True)
4572 4599
4573 4600 self.console.append("Please Wait...")
4574 4601
4575 self.controllerObj = ControllerThread(filename)
4576 self.controllerObj.start()
4602 self.controllerThread = ControllerThread(filename)
4603
4604 # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread )
4605 # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread )
4606
4607 self.controllerThread.start()
4577 4608 sleep(0.5)
4578 self.__initialized = True
4609 self.__enable = True
4579 4610
4580 4611 def stopProject(self):
4581 4612
4582 self.__initialized = False
4613 self.__enable = False
4583 4614
4584 4615 # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True))
4585 self.controllerObj.stop()
4616 self.controllerThread.stop()
4586 4617
4618 while self.controllerThread.isRunning():
4619 sleep(0.5)
4620
4587 4621 self.actionStart.setEnabled(True)
4588 4622 self.actionPause.setEnabled(False)
4589 4623 self.actionStop.setEnabled(False)
4590 4624
4591 4625 self.actionStarToolbar.setEnabled(True)
4592 4626 self.actionPauseToolbar.setEnabled(False)
4593 4627 self.actionStopToolbar.setEnabled(False)
4594 4628
4595 4629 self.restorePauseIcon()
4596 4630
4597 4631 def pauseProject(self):
4598 4632
4599 4633 # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True))
4600 self.controllerObj.pause()
4634 self.controllerThread.pause()
4601 4635
4602 4636 self.actionStart.setEnabled(False)
4603 4637 self.actionPause.setEnabled(True)
4604 4638 self.actionStop.setEnabled(True)
4605 4639
4606 4640 self.actionStarToolbar.setEnabled(False)
4607 4641 self.actionPauseToolbar.setEnabled(True)
4608 4642 self.actionStopToolbar.setEnabled(True)
4609 4643
4610 4644 def saveProject(self, filename=None):
4611 4645
4612 4646 self.actionStart.setEnabled(False)
4613 4647 self.actionStarToolbar.setEnabled(False)
4614 4648
4615 4649 projectObj = self.getSelectedProjectObj()
4616 4650 self.refreshGraphicsId()
4617 4651
4618 4652 sts = True
4619 4653 selectedItemObj = self.getSelectedItemObj()
4620 4654
4621 4655 #A Processing Unit has been selected
4622 4656 if projectObj == selectedItemObj:
4623 4657 if not self.on_proOk_clicked():
4624 4658 return None
4625 4659
4626 4660 #A Processing Unit has been selected
4627 4661 if projectObj != selectedItemObj:
4628 4662 puObj = selectedItemObj
4629 4663
4630 4664 if puObj.name == 'VoltageProc':
4631 4665 sts = self.on_volOpOk_clicked()
4632 4666 if puObj.name == 'SpectraProc':
4633 4667 sts = self.on_specOpOk_clicked()
4634 4668 if puObj.name == 'SpectraHeisProc':
4635 4669 sts = self.on_specHeisOpOk_clicked()
4636 4670
4637 4671 if not sts:
4638 4672 return None
4639 4673
4640 4674 self.createFTPProcUnitView()
4641 4675
4642 4676 if not filename:
4643 4677 filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') )
4644 4678
4645 4679 projectObj.writeXml(filename)
4646 4680 self.console.append("Now, you can press Start button")
4647 4681
4648 4682 self.actionStart.setEnabled(True)
4649 4683 self.actionStarToolbar.setEnabled(True)
4650 4684
4651 4685 return filename
4652 4686
4653 4687 def removeItemTreeFromProject(self):
4654 4688 """
4655 4689 Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol
4656 4690 """
4657 4691 for key in self.__itemTreeDict.keys():
4658 4692
4659 4693 #Check again because an item can delete multiple items (childs)
4660 4694 if key not in self.__itemTreeDict.keys():
4661 4695 continue
4662 4696
4663 4697 if self.__itemTreeDict[key] != self.selectedItemTree:
4664 4698 continue
4665 4699
4666 4700 if self.__projectObjDict.has_key(key) == True:
4667 4701
4668 4702 del self.__projectObjDict[key]
4669 4703 del self.__itemTreeDict[key]
4670 4704
4671 4705 else:
4672 4706 puObj = self.__puObjDict[key]
4673 4707 idProjectParent = puObj.parentId
4674 4708 projectObj = self.__projectObjDict[idProjectParent]
4675 4709
4676 4710 del self.__puObjDict[key]
4677 4711 del self.__itemTreeDict[key]
4678 4712 del projectObj.procUnitConfObjDict[key]
4679 4713
4680 4714 for key in projectObj.procUnitConfObjDict.keys():
4681 4715 if projectObj.procUnitConfObjDict[key].inputId != puObj.getId():
4682 4716 continue
4683 4717 del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()]
4684 4718 del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()]
4685 4719 del projectObj.procUnitConfObjDict[key]
4686 4720 # print projectObj.procUnitConfObjDict
4687 4721 # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict
4688 4722
4689 4723 def setInputsProject_View(self):
4690 4724
4691 4725 self.tabWidgetProject.setEnabled(True)
4692 4726 self.tabWidgetProject.setCurrentWidget(self.tabProject)
4693 4727 self.tabProject.setEnabled(True)
4694 4728 self.frame_2.setEnabled(False)
4695 4729 self.proName.clear()
4696 4730 self.proName.setFocus()
4697 4731 self.proName.setSelection(0, 0)
4698 4732 self.proName.setCursorPosition(0)
4699 4733 self.proDataType.setText('.r')
4700 4734 self.proDataPath.clear()
4701 4735 self.proComDataType.clear()
4702 4736 self.proComDataType.addItem("Voltage")
4703 4737 self.proComDataType.addItem("Spectra")
4704 4738 self.proComDataType.addItem("Fits")
4705 4739 self.proComDataType.addItem("USRP")
4706 4740
4707 4741 self.proComStartDate.clear()
4708 4742 self.proComEndDate.clear()
4709 4743
4710 4744 startTime = "00:00:00"
4711 4745 endTime = "23:59:59"
4712 4746 starlist = startTime.split(":")
4713 4747 endlist = endTime.split(":")
4714 4748 self.proDelay.setText("60")
4715 4749 self.proSet.setText("")
4716 4750
4717 4751 self.labelSet.show()
4718 4752 self.proSet.show()
4719 4753
4720 4754 self.labelIPPKm.hide()
4721 4755 self.proIPPKm.hide()
4722 4756
4723 4757 self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2]))
4724 4758 self.proStartTime.setTime(self.time)
4725 4759 self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2]))
4726 4760 self.proEndTime.setTime(self.time)
4727 4761 self.proDescription.clear()
4728 4762 self.proOk.setEnabled(False)
4729 4763 # self.console.append("Please, Write a name Project")
4730 4764 # self.console.append("Introduce Project Parameters")DC
4731 4765 # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)")
4732 4766
4733 4767 def clearPUWindow(self, datatype):
4734 4768
4735 4769 projectObjView = self.getSelectedProjectObj()
4736 4770
4737 4771 if not projectObjView:
4738 4772 return
4739 4773
4740 4774 puObj = self.getSelectedItemObj()
4741 4775 inputId = puObj.getInputId()
4742 4776 inputPUObj = projectObjView.getProcUnitObj(inputId)
4743 4777
4744 4778 if datatype == 'Voltage':
4745 4779 self.volOpComChannels.setEnabled(False)
4746 4780 self.volOpComHeights.setEnabled(False)
4747 4781 self.volOpFilter.setEnabled(False)
4748 4782 self.volOpComProfile.setEnabled(False)
4749 4783 self.volOpComCode.setEnabled(False)
4750 4784 self.volOpCohInt.setEnabled(False)
4751 4785 self.volOpChannel.setEnabled(False)
4752 4786 self.volOpHeights.setEnabled(False)
4753 4787 self.volOpProfile.setEnabled(False)
4754 4788 self.volOpRadarfrequency.setEnabled(False)
4755 4789 self.volOpCebChannels.setCheckState(0)
4756 4790 self.volOpCebRadarfrequency.setCheckState(0)
4757 4791 self.volOpCebHeights.setCheckState(0)
4758 4792 self.volOpCebFilter.setCheckState(0)
4759 4793 self.volOpCebProfile.setCheckState(0)
4760 4794 self.volOpCebDecodification.setCheckState(0)
4761 4795 self.volOpCebCohInt.setCheckState(0)
4762 4796
4763 4797 self.volOpChannel.clear()
4764 4798 self.volOpHeights.clear()
4765 4799 self.volOpProfile.clear()
4766 4800 self.volOpFilter.clear()
4767 4801 self.volOpCohInt.clear()
4768 4802 self.volOpRadarfrequency.clear()
4769 4803
4770 4804 if datatype == 'Spectra':
4771 4805
4772 4806 if inputPUObj.datatype == 'Spectra':
4773 4807 self.specOpnFFTpoints.setEnabled(False)
4774 4808 self.specOpProfiles.setEnabled(False)
4775 4809 self.specOpippFactor.setEnabled(False)
4776 4810 else:
4777 4811 self.specOpnFFTpoints.setEnabled(True)
4778 4812 self.specOpProfiles.setEnabled(True)
4779 4813 self.specOpippFactor.setEnabled(True)
4780 4814
4781 4815 self.specOpCebCrossSpectra.setCheckState(0)
4782 4816 self.specOpCebChannel.setCheckState(0)
4783 4817 self.specOpCebHeights.setCheckState(0)
4784 4818 self.specOpCebIncoherent.setCheckState(0)
4785 4819 self.specOpCebRemoveDC.setCheckState(0)
4786 4820 self.specOpCebRemoveInt.setCheckState(0)
4787 4821 self.specOpCebgetNoise.setCheckState(0)
4788 4822 self.specOpCebRadarfrequency.setCheckState(0)
4789 4823
4790 4824 self.specOpRadarfrequency.setEnabled(False)
4791 4825 self.specOppairsList.setEnabled(False)
4792 4826 self.specOpChannel.setEnabled(False)
4793 4827 self.specOpHeights.setEnabled(False)
4794 4828 self.specOpIncoherent.setEnabled(False)
4795 4829 self.specOpgetNoise.setEnabled(False)
4796 4830
4797 4831 self.specOpRadarfrequency.clear()
4798 4832 self.specOpnFFTpoints.clear()
4799 4833 self.specOpProfiles.clear()
4800 4834 self.specOpippFactor.clear
4801 4835 self.specOppairsList.clear()
4802 4836 self.specOpChannel.clear()
4803 4837 self.specOpHeights.clear()
4804 4838 self.specOpIncoherent.clear()
4805 4839 self.specOpgetNoise.clear()
4806 4840
4807 4841 self.specGraphCebSpectraplot.setCheckState(0)
4808 4842 self.specGraphCebCrossSpectraplot.setCheckState(0)
4809 4843 self.specGraphCebRTIplot.setCheckState(0)
4810 4844 self.specGraphCebRTInoise.setCheckState(0)
4811 4845 self.specGraphCebCoherencmap.setCheckState(0)
4812 4846 self.specGraphPowerprofile.setCheckState(0)
4813 4847
4814 4848 self.specGraphSaveSpectra.setCheckState(0)
4815 4849 self.specGraphSaveCross.setCheckState(0)
4816 4850 self.specGraphSaveRTIplot.setCheckState(0)
4817 4851 self.specGraphSaveRTInoise.setCheckState(0)
4818 4852 self.specGraphSaveCoherencemap.setCheckState(0)
4819 4853 self.specGraphSavePowerprofile.setCheckState(0)
4820 4854
4821 4855 self.specGraphftpRTIplot.setCheckState(0)
4822 4856 self.specGraphftpRTInoise.setCheckState(0)
4823 4857 self.specGraphftpCoherencemap.setCheckState(0)
4824 4858
4825 4859 self.specGraphPath.clear()
4826 4860 self.specGraphPrefix.clear()
4827 4861
4828 4862 self.specGgraphftpratio.clear()
4829 4863
4830 4864 self.specGgraphChannelList.clear()
4831 4865 self.specGgraphFreq.clear()
4832 4866 self.specGgraphHeight.clear()
4833 4867 self.specGgraphDbsrange.clear()
4834 4868 self.specGgraphmagnitud.clear()
4835 4869 self.specGgraphTminTmax.clear()
4836 4870 self.specGgraphTimeRange.clear()
4837 4871
4838 4872 if datatype == 'SpectraHeis':
4839 4873 self.specHeisOpCebIncoherent.setCheckState(0)
4840 4874 self.specHeisOpIncoherent.setEnabled(False)
4841 4875 self.specHeisOpIncoherent.clear()
4842 4876
4843 4877 self.specHeisGraphCebSpectraplot.setCheckState(0)
4844 4878 self.specHeisGraphCebRTIplot.setCheckState(0)
4845 4879
4846 4880 self.specHeisGraphSaveSpectra.setCheckState(0)
4847 4881 self.specHeisGraphSaveRTIplot.setCheckState(0)
4848 4882
4849 4883 self.specHeisGraphftpSpectra.setCheckState(0)
4850 4884 self.specHeisGraphftpRTIplot.setCheckState(0)
4851 4885
4852 4886 self.specHeisGraphPath.clear()
4853 4887 self.specHeisGraphPrefix.clear()
4854 4888 self.specHeisGgraphChannelList.clear()
4855 4889 self.specHeisGgraphXminXmax.clear()
4856 4890 self.specHeisGgraphYminYmax.clear()
4857 4891 self.specHeisGgraphTminTmax.clear()
4858 4892 self.specHeisGgraphTimeRange.clear()
4859 4893 self.specHeisGgraphftpratio.clear()
4860 4894
4861 4895 def showtabPUCreated(self, datatype):
4862 4896
4863 4897 if datatype == "Voltage":
4864 4898 self.tabVoltage.setEnabled(True)
4865 4899 self.tabProject.setEnabled(False)
4866 4900 self.tabSpectra.setEnabled(False)
4867 4901 self.tabCorrelation.setEnabled(False)
4868 4902 self.tabSpectraHeis.setEnabled(False)
4869 4903 self.tabWidgetProject.setCurrentWidget(self.tabVoltage)
4870 4904
4871 4905 if datatype == "Spectra":
4872 4906 self.tabVoltage.setEnabled(False)
4873 4907 self.tabProject.setEnabled(False)
4874 4908 self.tabSpectra.setEnabled(True)
4875 4909 self.tabCorrelation.setEnabled(False)
4876 4910 self.tabSpectraHeis.setEnabled(False)
4877 4911 self.tabWidgetProject.setCurrentWidget(self.tabSpectra)
4878 4912
4879 4913 if datatype == "SpectraHeis":
4880 4914 self.tabVoltage.setEnabled(False)
4881 4915 self.tabProject.setEnabled(False)
4882 4916 self.tabSpectra.setEnabled(False)
4883 4917 self.tabCorrelation.setEnabled(False)
4884 4918 self.tabSpectraHeis.setEnabled(True)
4885 4919 self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis)
4886 4920
4887 4921 def checkInputsProject(self):
4888 4922 """
4889 4923 Check Inputs Project:
4890 4924 - project_name
4891 4925 - datatype
4892 4926 - ext
4893 4927 - data_path
4894 4928 - readmode
4895 4929 - delay
4896 4930 - set
4897 4931 - walk
4898 4932 """
4899 4933 parms_ok = True
4900 4934 project_name = str(self.proName.text())
4901 4935 if project_name == '' or project_name == None:
4902 4936 outputstr = "Enter the Project Name"
4903 4937 self.console.append(outputstr)
4904 4938 parms_ok = False
4905 4939 project_name = None
4906 4940
4907 4941 datatype = str(self.proComDataType.currentText())
4908 4942 if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']):
4909 4943 outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype
4910 4944 self.console.append(outputstr)
4911 4945 parms_ok = False
4912 4946 datatype = None
4913 4947
4914 4948 ext = str(self.proDataType.text())
4915 4949 if not(ext in ['.r', '.pdata', '.fits', '.hdf5']):
4916 4950 outputstr = "extension files must be .r , .pdata, .fits or .hdf5"
4917 4951 self.console.append(outputstr)
4918 4952 parms_ok = False
4919 4953 ext = None
4920 4954
4921 4955 data_path = str(self.proDataPath.text())
4922 4956
4923 4957 if data_path == '':
4924 4958 outputstr = 'Datapath is empty'
4925 4959 self.console.append(outputstr)
4926 4960 parms_ok = False
4927 4961 data_path = None
4928 4962
4929 4963 if data_path != None:
4930 4964 if not os.path.isdir(data_path):
4931 4965 outputstr = 'Datapath:%s does not exists' % data_path
4932 4966 self.console.append(outputstr)
4933 4967 parms_ok = False
4934 4968 data_path = None
4935 4969
4936 4970 read_mode = str(self.proComReadMode.currentText())
4937 4971 if not(read_mode in ['Online', 'Offline']):
4938 4972 outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode
4939 4973 self.console.append(outputstr)
4940 4974 parms_ok = False
4941 4975 read_mode = None
4942 4976
4943 try:
4944 delay = int(str(self.proDelay.text()))
4945 except:
4946 outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text())
4947 self.console.append(outputstr)
4948 # parms_ok = False
4949 delay = None
4977 delay = None
4978 if read_mode == "Online":
4979 parms_ok = False
4980 try:
4981 delay = int(str(self.proDelay.text()))
4982 parms_ok = True
4983 except:
4984 outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text())
4985 self.console.append(outputstr)
4950 4986
4951 4987 try:
4952 4988 set = int(str(self.proSet.text()))
4953 4989 except:
4954 4990 # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text())
4955 4991 # self.console.append(outputstr)
4956 4992 # parms_ok = False
4957 4993 set = None
4958 4994
4959 walk = self.proComWalk.currentIndex()
4995 walk = int(self.proComWalk.currentIndex())
4996 expLabel = str(self.proExpLabel.text())
4960 4997
4961 return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set
4998 return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel
4962 4999
4963 5000 def checkInputsPUSave(self, datatype):
4964 5001 """
4965 5002 Check Inputs Spectra Save:
4966 5003 - path
4967 5004 - blocks Per File
4968 5005 - sufix
4969 5006 - dataformat
4970 5007 """
4971 5008 parms_ok = True
4972 5009
4973 5010 if datatype == "Voltage":
4974 5011 output_path = str(self.volOutputPath.text())
4975 5012 blocksperfile = str(self.volOutputblocksperfile.text())
4976 5013 profilesperblock = str(self.volOutputprofilesperblock.text())
4977 5014
4978 5015 if datatype == "Spectra":
4979 5016 output_path = str(self.specOutputPath.text())
4980 5017 blocksperfile = str(self.specOutputblocksperfile.text())
4981 profilesperblock = str(self.specOutputprofileperblock.text())
5018 profilesperblock = 0
4982 5019
4983 5020 if datatype == "SpectraHeis":
4984 5021 output_path = str(self.specHeisOutputPath.text())
4985 5022 blocksperfile = str(self.specHeisOutputblocksperfile.text())
4986 5023 metada = str(self.specHeisOutputMetada.text())
4987 5024
4988 5025 if output_path == '':
4989 5026 outputstr = 'Outputpath is empty'
4990 5027 self.console.append(outputstr)
4991 5028 parms_ok = False
4992 5029 data_path = None
4993 5030
4994 5031 if output_path != None:
4995 5032 if not os.path.exists(output_path):
4996 5033 outputstr = 'OutputPath:%s does not exists' % output_path
4997 5034 self.console.append(outputstr)
4998 5035 parms_ok = False
4999 5036 output_path = None
5000 5037
5001 5038
5002 5039 try:
5003 5040 profilesperblock = int(profilesperblock)
5004 5041 except:
5005 5042 if datatype == "Voltage":
5006 5043 outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text())
5007 5044 self.console.append(outputstr)
5008 5045 parms_ok = False
5009 5046 profilesperblock = None
5010
5011 elif datatype == "Spectra":
5012 outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.specOutputprofileperblock.text())
5013 self.console.append(outputstr)
5014 parms_ok = False
5015 profilesperblock = None
5016 5047
5017 5048 try:
5018 5049 blocksperfile = int(blocksperfile)
5019 5050 except:
5020 5051 if datatype == "Voltage":
5021 5052 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text())
5022 5053 elif datatype == "Spectra":
5023 5054 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text())
5024 5055 elif datatype == "SpectraHeis":
5025 5056 outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text())
5026 5057
5027 5058 self.console.append(outputstr)
5028 5059 parms_ok = False
5029 5060 blocksperfile = None
5030 5061
5031 5062 if datatype == "SpectraHeis":
5032 5063 if metada == '':
5033 5064 outputstr = 'Choose metada file'
5034 5065 self.console.append(outputstr)
5035 5066 parms_ok = False
5036 5067 if metada != None:
5037 5068 if not os.path.isfile(metada):
5038 5069 outputstr = 'Metadata:%s does not exists' % metada
5039 5070 self.console.append(outputstr)
5040 5071 parms_ok = False
5041 5072 output_path = None
5042 5073
5043 5074 if datatype == "Voltage":
5044 5075 return parms_ok, output_path, blocksperfile, profilesperblock
5045 5076
5046 5077
5047 5078 if datatype == "Spectra":
5048 5079 return parms_ok, output_path, blocksperfile, profilesperblock
5049 5080
5050 5081
5051 5082 if datatype == "SpectraHeis":
5052 5083 return parms_ok, output_path, blocksperfile, metada
5053 5084
5054 5085 def findDatafiles(self, data_path, ext, walk, expLabel=''):
5055 5086
5056 5087 dateList = []
5057 5088 fileList = []
5058 5089
5059 5090 if ext == ".r":
5060 5091 from schainpy.model.io.jroIO_base import JRODataReader
5061 5092
5062 5093 readerObj = JRODataReader()
5063 5094 dateList = readerObj.findDatafiles(path=data_path,
5064 5095 expLabel=expLabel,
5065 5096 ext=ext,
5066 5097 walk=walk)
5067 5098
5068 5099 if ext == ".pdata":
5069 5100 from schainpy.model.io.jroIO_base import JRODataReader
5070 5101
5071 5102 readerObj = JRODataReader()
5072 5103 dateList = readerObj.findDatafiles(path=data_path,
5073 5104 expLabel=expLabel,
5074 5105 ext=ext,
5075 5106 walk=walk)
5076 5107
5077 5108 if ext == ".fits":
5078 5109 from schainpy.model.io.jroIO_base import JRODataReader
5079 5110
5080 5111 readerObj = JRODataReader()
5081 5112 dateList = readerObj.findDatafiles(path=data_path,
5082 5113 expLabel=expLabel,
5083 5114 ext=ext,
5084 5115 walk=walk)
5085 5116
5086 5117 if ext == ".hdf5":
5087 5118 from schainpy.model.io.jroIO_usrp import USRPReader
5088 5119
5089 5120 readerObj = USRPReader()
5090 5121 dateList = readerObj.findDatafiles(path=data_path)
5091 5122
5092 5123 return dateList
5093 5124
5094 5125 def loadDays(self, data_path, ext, walk, expLabel=''):
5095 5126 """
5096 5127 Method to loads day
5097 5128 """
5098 5129 self.proOk.setEnabled(False)
5099 5130 self.proComStartDate.clear()
5100 5131 self.proComEndDate.clear()
5101 5132
5102 5133 self.dateList = []
5103 5134
5104 5135 if not os.path.isdir(data_path):
5105 5136 return
5106 5137
5138 self.dataPath = data_path
5139
5107 5140 dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel)
5108 5141
5109 5142 if not dateList:
5110 5143 # self.console.clear()
5111 outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext)
5144 outputstr = "The path %s has no files with extension *%s" % (data_path, ext)
5112 5145 self.console.append(outputstr)
5113 5146 return
5114 5147
5115 5148 dateStrList = []
5116 5149 for thisDate in dateList:
5117 5150 dateStr = thisDate.strftime("%Y/%m/%d")
5118 5151
5119 5152 self.proComStartDate.addItem(dateStr)
5120 5153 self.proComEndDate.addItem(dateStr)
5121 5154 dateStrList.append(dateStr)
5122 5155
5123 5156 self.proComStartDate.setCurrentIndex(0)
5124 5157 self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1)
5125 5158
5126 5159 self.dateList = dateStrList
5127 5160 self.proOk.setEnabled(True)
5128 5161
5162 self.console.clear()
5163 self.console.append("Successful load")
5164
5129 5165 return self.dateList
5130 5166
5131 5167 def setWorkSpaceGUI(self, pathWorkSpace=None):
5132 5168
5133 5169 if pathWorkSpace == None:
5134 5170 home = os.path.expanduser("~")
5135 5171 pathWorkSpace = os.path.join(home,'schain_workspace')
5136 5172
5137 5173 self.pathWorkSpace = pathWorkSpace
5138 5174
5139 5175 """
5140 5176 Comandos Usados en Console
5141 5177 """
5142 5178 def __del__(self):
5143 5179 sys.stdout = sys.__stdout__
5144 5180 sys.stderr = sys.__stderr__
5145 5181
5146 5182 def normalOutputWritten(self, text):
5147 5183 color_black = QtGui.QColor(0,0,0)
5148 5184 self.console.setTextColor(color_black)
5149 5185 self.console.append(text)
5150 5186
5151 5187 def errorOutputWritten(self, text):
5152 5188 color_red = QtGui.QColor(255,0,0)
5153 5189 color_black = QtGui.QColor(0,0,0)
5154 5190
5155 5191 self.console.setTextColor(color_red)
5156 5192 self.console.append(text)
5157 5193 self.console.setTextColor(color_black)
5158 5194
5159 def setParameter(self):
5195 def setGUIStatus(self):
5160 5196
5161 5197 self.setWindowTitle("ROJ-Signal Chain")
5162 5198 self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") ))
5163 5199
5164 5200 self.tabWidgetProject.setEnabled(False)
5165 5201 self.tabVoltage.setEnabled(False)
5166 5202 self.tabSpectra.setEnabled(False)
5167 5203 self.tabCorrelation.setEnabled(False)
5168 5204 self.frame_2.setEnabled(False)
5169 5205
5170 5206 self.actionCreate.setShortcut('Ctrl+N')
5171 5207 self.actionOpen.setShortcut('Ctrl+O')
5172 5208 self.actionSave.setShortcut('Ctrl+S')
5173 5209 self.actionClose.setShortcut('Ctrl+X')
5174 5210
5175 5211 self.actionStart.setShortcut('Ctrl+1')
5176 5212 self.actionPause.setShortcut('Ctrl+2')
5177 5213 self.actionStop.setShortcut('Ctrl+3')
5178 5214
5179 5215 self.actionFTP.setShortcut('Ctrl+F')
5180 5216
5181 5217 self.actionStart.setEnabled(False)
5182 5218 self.actionPause.setEnabled(False)
5183 5219 self.actionStop.setEnabled(False)
5184 5220
5185 5221 self.actionStarToolbar.setEnabled(False)
5186 5222 self.actionPauseToolbar.setEnabled(False)
5187 5223 self.actionStopToolbar.setEnabled(False)
5188 5224
5189 5225 self.proName.clear()
5190 5226 self.proDataPath.setText('')
5191 5227 self.console.setReadOnly(True)
5192 5228 self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one")
5193 5229 self.proStartTime.setDisplayFormat("hh:mm:ss")
5194 5230 self.proDataType.setEnabled(False)
5195 5231 self.time = QtCore.QTime()
5196 5232 self.hour = 0
5197 5233 self.min = 0
5198 5234 self.sec = 0
5199 5235 self.proEndTime.setDisplayFormat("hh:mm:ss")
5200 5236 startTime = "00:00:00"
5201 5237 endTime = "23:59:59"
5202 5238 starlist = startTime.split(":")
5203 5239 endlist = endTime.split(":")
5204 5240 self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2]))
5205 5241 self.proStartTime.setTime(self.time)
5206 5242 self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2]))
5207 5243 self.proEndTime.setTime(self.time)
5208 5244 self.proOk.setEnabled(False)
5209 5245 # set model Project Explorer
5210 5246 self.projectExplorerModel = QtGui.QStandardItemModel()
5211 5247 self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",))
5212 5248 layout = QtGui.QVBoxLayout()
5213 5249 layout.addWidget(self.projectExplorerTree)
5214 5250 self.projectExplorerTree.setModel(self.projectExplorerModel)
5215 5251 self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
5216 5252 self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click)
5217 5253 self.projectExplorerTree.clicked.connect(self.on_click)
5218 5254 self.projectExplorerTree.expandAll()
5219 5255 # set model Project Properties
5220 5256
5221 5257 self.propertiesModel = TreeModel()
5222 5258 self.propertiesModel.initProjectView()
5223 5259 self.treeProjectProperties.setModel(self.propertiesModel)
5224 5260 self.treeProjectProperties.expandAll()
5225 5261 self.treeProjectProperties.allColumnsShowFocus()
5226 5262 self.treeProjectProperties.resizeColumnToContents(1)
5227 5263
5228 5264 # set Project
5265 self.proExpLabel.setEnabled(True)
5229 5266 self.proDelay.setEnabled(False)
5230 self.proSet.setEnabled(False)
5267 self.proSet.setEnabled(True)
5231 5268 self.proDataType.setReadOnly(True)
5232 5269
5233 5270 # set Operation Voltage
5234 5271 self.volOpComChannels.setEnabled(False)
5235 5272 self.volOpComHeights.setEnabled(False)
5236 5273 self.volOpFilter.setEnabled(False)
5237 5274 self.volOpComProfile.setEnabled(False)
5238 5275 self.volOpComCode.setEnabled(False)
5239 5276 self.volOpFlip.setEnabled(False)
5240 5277 self.volOpCohInt.setEnabled(False)
5241 5278 self.volOpRadarfrequency.setEnabled(False)
5242 5279
5243 5280 self.volOpChannel.setEnabled(False)
5244 5281 self.volOpHeights.setEnabled(False)
5245 5282 self.volOpProfile.setEnabled(False)
5246 5283 self.volOpComMode.setEnabled(False)
5247 5284
5248 5285 self.volGraphPath.setEnabled(False)
5249 5286 self.volGraphPrefix.setEnabled(False)
5250 5287 self.volGraphToolPath.setEnabled(False)
5251 5288
5252 5289 # set Graph Voltage
5253 5290 self.volGraphChannelList.setEnabled(False)
5254 5291 self.volGraphfreqrange.setEnabled(False)
5255 5292 self.volGraphHeightrange.setEnabled(False)
5256 5293
5257 5294 # set Operation Spectra
5258 5295 self.specOpnFFTpoints.setEnabled(False)
5259 5296 self.specOpProfiles.setEnabled(False)
5260 5297 self.specOpippFactor.setEnabled(False)
5261 5298 self.specOppairsList.setEnabled(False)
5262 5299 self.specOpComChannel.setEnabled(False)
5263 5300 self.specOpComHeights.setEnabled(False)
5264 5301 self.specOpIncoherent.setEnabled(False)
5265 5302 self.specOpgetNoise.setEnabled(False)
5266 5303 self.specOpRadarfrequency.setEnabled(False)
5267 5304
5268 5305
5269 5306 self.specOpChannel.setEnabled(False)
5270 5307 self.specOpHeights.setEnabled(False)
5271 5308 # set Graph Spectra
5272 5309 self.specGgraphChannelList.setEnabled(False)
5273 5310 self.specGgraphFreq.setEnabled(False)
5274 5311 self.specGgraphHeight.setEnabled(False)
5275 5312 self.specGgraphDbsrange.setEnabled(False)
5276 5313 self.specGgraphmagnitud.setEnabled(False)
5277 5314 self.specGgraphTminTmax.setEnabled(False)
5278 5315 self.specGgraphTimeRange.setEnabled(False)
5279 5316 self.specGraphPath.setEnabled(False)
5280 5317 self.specGraphToolPath.setEnabled(False)
5281 5318 self.specGraphPrefix.setEnabled(False)
5282 5319
5283 5320 self.specGgraphftpratio.setEnabled(False)
5284 5321 # set Operation SpectraHeis
5285 5322 self.specHeisOpIncoherent.setEnabled(False)
5286 5323 self.specHeisOpCobIncInt.setEnabled(False)
5287 5324 # set Graph SpectraHeis
5288 5325 self.specHeisGgraphChannelList.setEnabled(False)
5289 5326 self.specHeisGgraphXminXmax.setEnabled(False)
5290 5327 self.specHeisGgraphYminYmax.setEnabled(False)
5291 5328 self.specHeisGgraphTminTmax.setEnabled(False)
5292 5329 self.specHeisGgraphTimeRange.setEnabled(False)
5293 5330 self.specHeisGgraphftpratio.setEnabled(False)
5294 5331 self.specHeisGraphPath.setEnabled(False)
5295 5332 self.specHeisGraphPrefix.setEnabled(False)
5296 5333 self.specHeisGraphToolPath.setEnabled(False)
5297 5334
5298 5335
5299 5336 # tool tip gui
5300 5337 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
5301 5338 self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process')
5302 5339 # tool tip gui project
5303 5340 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>')
5304 5341 self.proComWalk.setCurrentIndex(0)
5305 5342 # tool tip gui volOp
5306 5343 self.volOpChannel.setToolTip('Example: 1,2,3,4,5')
5307 5344 self.volOpHeights.setToolTip('Example: 90,180')
5308 5345 self.volOpFilter.setToolTip('Example: 2')
5309 5346 self.volOpProfile.setToolTip('Example:0,127')
5310 5347 self.volOpCohInt.setToolTip('Example: 128')
5311 5348 self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3')
5312 5349 self.volOpOk.setToolTip('If you have finished, please Ok ')
5313 5350 # tool tip gui volGraph
5314 5351 self.volGraphfreqrange.setToolTip('Height range. Example: 50,100')
5315 5352 self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000')
5316 5353 # tool tip gui specOp
5317 5354 self.specOpnFFTpoints.setToolTip('Example: 128')
5318 5355 self.specOpProfiles.setToolTip('Example: 128')
5319 5356 self.specOpippFactor.setToolTip('Example:1.0')
5320 5357 self.specOpIncoherent.setToolTip('Example: 10')
5321 5358 self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)')
5322 5359
5323 5360 self.specOpChannel.setToolTip('Example: 0,1,2,3')
5324 5361 self.specOpHeights.setToolTip('Example: 90,180')
5325 5362 self.specOppairsList.setToolTip('Example: (0,1),(2,3)')
5326 5363 # tool tip gui specGraph
5327 5364
5328 5365 self.specGgraphChannelList.setToolTip('Example: 0,3,4')
5329 5366 self.specGgraphFreq.setToolTip('Example: -20,20')
5330 5367 self.specGgraphHeight.setToolTip('Example: 100,400')
5331 5368 self.specGgraphDbsrange.setToolTip('Example: 30,170')
5332 5369
5333 5370 self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME')
5334 5371
5372 self.labelSet.show()
5373 self.proSet.show()
5374
5375 self.labelIPPKm.hide()
5376 self.proIPPKm.hide()
5377
5335 5378 sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten)
5336 5379 # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten)
5337 5380
5338 5381
5339 5382 class UnitProcessWindow(QMainWindow, Ui_UnitProcess):
5340 5383 """
5341 5384 Class documentation goes here.
5342 5385 """
5343 5386 closed = pyqtSignal()
5344 5387 create = False
5345 5388
5346 5389 def __init__(self, parent=None):
5347 5390 """
5348 5391 Constructor
5349 5392 """
5350 5393 QMainWindow.__init__(self, parent)
5351 5394 self.setupUi(self)
5352 5395 self.getFromWindow = None
5353 5396 self.getfromWindowList = []
5354 5397 self.dataTypeProject = None
5355 5398
5356 5399 self.listUP = None
5357 5400
5358 5401 @pyqtSignature("")
5359 5402 def on_unitPokbut_clicked(self):
5360 5403 """
5361 5404 Slot documentation goes here.
5362 5405 """
5363 5406 self.create = True
5364 5407 self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())]
5365 5408 # self.nameofUP= str(self.nameUptxt.text())
5366 5409 self.typeofUP = str(self.comboTypeBox.currentText())
5367 5410 self.close()
5368 5411
5369 5412
5370 5413 @pyqtSignature("")
5371 5414 def on_unitPcancelbut_clicked(self):
5372 5415 """
5373 5416 Slot documentation goes here.
5374 5417 """
5375 5418 self.create = False
5376 5419 self.close()
5377 5420
5378 5421 def loadTotalList(self):
5379 5422 self.comboInputBox.clear()
5380 5423 for i in self.getfromWindowList:
5381 5424
5382 5425 name = i.getElementName()
5383 5426 if name == 'Project':
5384 5427 id = i.id
5385 5428 name = i.name
5386 5429 if self.dataTypeProject == 'Voltage':
5387 5430 self.comboTypeBox.clear()
5388 5431 self.comboTypeBox.addItem("Voltage")
5389 5432
5390 5433 if self.dataTypeProject == 'Spectra':
5391 5434 self.comboTypeBox.clear()
5392 5435 self.comboTypeBox.addItem("Spectra")
5393 5436 self.comboTypeBox.addItem("Correlation")
5394 5437 if self.dataTypeProject == 'Fits':
5395 5438 self.comboTypeBox.clear()
5396 5439 self.comboTypeBox.addItem("SpectraHeis")
5397 5440
5398 5441
5399 5442 if name == 'ProcUnit':
5400 5443 id = int(i.id) - 1
5401 5444 name = i.datatype
5402 5445 if name == 'Voltage':
5403 5446 self.comboTypeBox.clear()
5404 5447 self.comboTypeBox.addItem("Spectra")
5405 5448 self.comboTypeBox.addItem("SpectraHeis")
5406 5449 self.comboTypeBox.addItem("Correlation")
5407 5450 if name == 'Spectra':
5408 5451 self.comboTypeBox.clear()
5409 5452 self.comboTypeBox.addItem("Spectra")
5410 5453 self.comboTypeBox.addItem("SpectraHeis")
5411 5454 self.comboTypeBox.addItem("Correlation")
5412 5455 if name == 'SpectraHeis':
5413 5456 self.comboTypeBox.clear()
5414 5457 self.comboTypeBox.addItem("SpectraHeis")
5415 5458
5416 5459 self.comboInputBox.addItem(str(name))
5417 5460 # self.comboInputBox.addItem(str(name)+str(id))
5418 5461
5419 5462 def closeEvent(self, event):
5420 5463 self.closed.emit()
5421 5464 event.accept()
5422 5465
5423 5466 class Ftp(QMainWindow, Ui_Ftp):
5424 5467 """
5425 5468 Class documentation goes here.
5426 5469 """
5427 5470 create = False
5428 5471 closed = pyqtSignal()
5429 5472 server = None
5430 5473 remotefolder = None
5431 5474 username = None
5432 5475 password = None
5433 5476 ftp_wei = None
5434 5477 exp_code = None
5435 5478 sub_exp_code = None
5436 5479 plot_pos = None
5437 5480
5438 5481 def __init__(self, parent=None):
5439 5482 """
5440 5483 Constructor
5441 5484 """
5442 5485 QMainWindow.__init__(self, parent)
5443 5486 self.setupUi(self)
5444 self.setParameter()
5487 self.setGUIStatus()
5445 5488
5446 def setParameter(self):
5489 def setGUIStatus(self):
5447 5490 self.setWindowTitle("ROJ-Signal Chain")
5448 5491 self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe')
5449 5492 self.folderFTP.setToolTip('Example: /home/wmaster/graficos')
5450 5493 self.usernameFTP.setToolTip('Example: myusername')
5451 5494 self.passwordFTP.setToolTip('Example: mypass ')
5452 5495 self.weightFTP.setToolTip('Example: 0')
5453 5496 self.expcodeFTP.setToolTip('Example: 0')
5454 5497 self.subexpFTP.setToolTip('Example: 0')
5455 5498 self.plotposFTP.setToolTip('Example: 0')
5456 5499
5457 5500 def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos):
5458 5501 self.serverFTP.setText(str(server))
5459 5502 self.folderFTP.setText(str(remotefolder))
5460 5503 self.usernameFTP.setText(str(username))
5461 5504 self.passwordFTP.setText(str(password))
5462 5505 self.weightFTP.setText(str(ftp_wei))
5463 5506 self.expcodeFTP.setText(str(exp_code))
5464 5507 self.subexpFTP.setText(str(sub_exp_code))
5465 5508 self.plotposFTP.setText(str(plot_pos))
5466 5509
5467 5510 def getParmsFromFtpWindow(self):
5468 5511 """
5469 5512 Return Inputs Project:
5470 5513 - server
5471 5514 - remotefolder
5472 5515 - username
5473 5516 - password
5474 5517 - ftp_wei
5475 5518 - exp_code
5476 5519 - sub_exp_code
5477 5520 - plot_pos
5478 5521 """
5479 5522 name_server_ftp = str(self.serverFTP.text())
5480 5523 if not name_server_ftp:
5481 5524 self.console.clear()
5482 5525 self.console.append("Please Write a FTP Server")
5483 5526 return 0
5484 5527
5485 5528 folder_server_ftp = str(self.folderFTP.text())
5486 5529 if not folder_server_ftp:
5487 5530 self.console.clear()
5488 5531 self.console.append("Please Write a Folder")
5489 5532 return 0
5490 5533
5491 5534 username_ftp = str(self.usernameFTP.text())
5492 5535 if not username_ftp:
5493 5536 self.console.clear()
5494 5537 self.console.append("Please Write a User Name")
5495 5538 return 0
5496 5539
5497 5540 password_ftp = str(self.passwordFTP.text())
5498 5541 if not password_ftp:
5499 5542 self.console.clear()
5500 5543 self.console.append("Please Write a passwordFTP")
5501 5544 return 0
5502 5545
5503 5546 ftp_wei = str(self.weightFTP.text())
5504 5547 if not ftp_wei == "":
5505 5548 try:
5506 5549 ftp_wei = int(self.weightFTP.text())
5507 5550 except:
5508 5551 self.console.clear()
5509 5552 self.console.append("Please Write a ftp_wei number")
5510 5553 return 0
5511 5554
5512 5555 exp_code = str(self.expcodeFTP.text())
5513 5556 if not exp_code == "":
5514 5557 try:
5515 5558 exp_code = int(self.expcodeFTP.text())
5516 5559 except:
5517 5560 self.console.clear()
5518 5561 self.console.append("Please Write a exp_code number")
5519 5562 return 0
5520 5563
5521 5564
5522 5565 sub_exp_code = str(self.subexpFTP.text())
5523 5566 if not sub_exp_code == "":
5524 5567 try:
5525 5568 sub_exp_code = int(self.subexpFTP.text())
5526 5569 except:
5527 5570 self.console.clear()
5528 5571 self.console.append("Please Write a sub_exp_code number")
5529 5572 return 0
5530 5573
5531 5574 plot_pos = str(self.plotposFTP.text())
5532 5575 if not plot_pos == "":
5533 5576 try:
5534 5577 plot_pos = int(self.plotposFTP.text())
5535 5578 except:
5536 5579 self.console.clear()
5537 5580 self.console.append("Please Write a plot_pos number")
5538 5581 return 0
5539 5582
5540 5583 return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos
5541 5584
5542 5585 @pyqtSignature("")
5543 5586 def on_ftpOkButton_clicked(self):
5544 5587 server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow()
5545 5588 self.create = True
5546 5589 self.close()
5547 5590
5548 5591 @pyqtSignature("")
5549 5592 def on_ftpCancelButton_clicked(self):
5550 5593 self.create = False
5551 5594 self.close()
5552 5595
5553 5596 def closeEvent(self, event):
5554 5597 self.closed.emit()
5555 5598 event.accept()
5556 5599
5557 5600 class ftpBuffer():
5558 5601
5559 5602 server = None
5560 5603 remotefolder = None
5561 5604 username = None
5562 5605 password = None
5563 5606 ftp_wei = None
5564 5607 exp_code = None
5565 5608 sub_exp_code = None
5566 5609 plot_pos = None
5567 5610 create = False
5568 5611 withoutconfig = False
5569 5612 createforView = False
5570 5613 localfolder = None
5571 5614 extension = None
5572 5615 period = None
5573 5616 protocol = None
5574 5617
5575 5618 def __init__(self):
5576 5619
5577 5620 self.create = False
5578 5621 self.server = None
5579 5622 self.remotefolder = None
5580 5623 self.username = None
5581 5624 self.password = None
5582 5625 self.ftp_wei = None
5583 5626 self.exp_code = None
5584 5627 self.sub_exp_code = None
5585 5628 self.plot_pos = None
5586 5629 # self.create = False
5587 5630 self.localfolder = None
5588 5631 self.extension = None
5589 5632 self.period = None
5590 5633 self.protocol = None
5591 5634
5592 5635 def setwithoutconfiguration(self):
5593 5636
5594 5637 self.create = False
5595 5638 self.server = "jro-app.igp.gob.pe"
5596 5639 self.remotefolder = "/home/wmaster/graficos"
5597 5640 self.username = "wmaster"
5598 5641 self.password = "mst2010vhf"
5599 5642 self.withoutconfig = True
5600 5643 self.localfolder = './'
5601 5644 self.extension = '.png'
5602 5645 self.period = 60
5603 5646 self.protocol = 'ftp'
5604 5647 self.createforView = True
5605 5648
5606 5649 if not self.ftp_wei:
5607 5650 self.ftp_wei = 0
5608 5651
5609 5652 if not self.exp_code:
5610 5653 self.exp_code = 0
5611 5654
5612 5655 if not self.sub_exp_code:
5613 5656 self.sub_exp_code = 0
5614 5657
5615 5658 if not self.plot_pos:
5616 5659 self.plot_pos = 0
5617 5660
5618 5661 def save(self, server, remotefolder, username, password, ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, localfolder='./', extension='.png', period=60, protocol='ftp'):
5619 5662
5620 5663 self.server = server
5621 5664 self.remotefolder = remotefolder
5622 5665 self.username = username
5623 5666 self.password = password
5624 5667 self.ftp_wei = ftp_wei
5625 5668 self.exp_code = exp_code
5626 5669 self.sub_exp_code = sub_exp_code
5627 5670 self.plot_pos = plot_pos
5628 5671 self.create = True
5629 5672 self.withoutconfig = False
5630 5673 self.createforView = True
5631 5674 self.localfolder = localfolder
5632 5675 self.extension = extension
5633 5676 self.period = period
5634 5677 self.protocol = protocol
5635 5678
5636 5679 def recover(self):
5637 5680
5638 5681 return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol
5639 5682
5640 5683 class ShowMeConsole(QtCore.QObject):
5641 5684 textWritten = QtCore.pyqtSignal(str)
5642 5685 def write (self, text):
5643 5686 self.textWritten.emit(str(text))
5644 5687
5645 5688 class PlotManager():
5646 5689 def __init__(self, queue):
5647 5690 self.queue = queue
5648 5691 self.objPlotDict = {}
5649 5692
5650 5693 def processIncoming(self):
5651 5694 while self.queue.qsize():
5652 5695 try:
5653 5696 dataFromQueue = self.queue.get(True)
5654 5697 if dataFromQueue == None:
5655 5698 continue
5656 5699
5657 5700 dataPlot = dataFromQueue['data']
5658 5701 kwargs = dataFromQueue['kwargs']
5659 5702 id = kwargs['id']
5660 5703 if 'channelList' in kwargs.keys():
5661 5704 channelList = kwargs['channelList']
5662 5705 else:
5663 5706 channelList = None
5664 5707 plotname = kwargs.pop('type')
5665 5708
5666 5709 if not(id in self.objPlotDict.keys()):
5667 5710 className = eval(plotname)
5668 5711 self.objPlotDict[id] = className(id, channelList, dataPlot)
5669 5712 self.objPlotDict[id].show()
5670 5713
5671 5714 self.objPlotDict[id].run(dataPlot , **kwargs)
5672 5715
5673 5716 except Queue.Empty:
5674 5717 pass
5675 5718
5676 5719
@@ -1,93 +1,94
1 1 """
2 2 Classes to save parameters from Windows.
3 3
4 4 -Project window
5 5 -Voltage window
6 6 -Spectra window
7 7 -SpectraHeis window
8 8 -Correlation window
9 9
10 10 """
11 11
12 12 class ProjectParms():
13 13
14 14 parmsOk = False
15 15 name = None
16 16 description = None
17 17 datatype = None
18 18 ext = None
19 19 dpath = None
20 20 startDate = None
21 21 endDate = None
22 22 startTime = None
23 23 endTime = None
24 24 online = None
25 25 delay = None
26 26 walk = None
27 27 expLabel = None
28 28 set = None
29 29 ippKm = None
30 30
31 31 def __init__(self):
32 32
33 33 self.parmsOk = True
34 34 self.description = ''
35 35 self.expLabel = ''
36 36 self.set = ''
37 37 self.ippKm = ''
38 38 self.walk = None
39 39 self.delay = ''
40 40
41 41 def getDatatypeIndex(self):
42 42
43 43 indexDatatype = None
44 44
45 45 if 'voltage' in self.datatype.lower():
46 46 indexDatatype = 0
47 47 if 'spectra' in self.datatype.lower():
48 48 indexDatatype = 1
49 49 if 'fits' in self.datatype.lower():
50 50 indexDatatype = 2
51 51 if 'usrp' in self.datatype.lower():
52 52 indexDatatype = 3
53 53
54 54 return indexDatatype
55 55
56 56 def getExt(self):
57 57
58 58 ext = None
59 59
60 60 if self.datatype.lower() == 'voltage':
61 61 ext = '.r'
62 62 if self.datatype.lower() == 'spectra':
63 63 ext = '.pdata'
64 64 if self.datatype.lower() == 'fits':
65 65 ext = '.fits'
66 66 if self.datatype.lower() == 'usrp':
67 67 ext = '.hdf5'
68 68
69 69 return ext
70 70
71 71 def set(self, project_name, datatype, ext, dpath, online,
72 72 startDate=None, endDate=None, startTime=None, endTime=None,
73 delay=None, walk=None, set=None, ippKm=None, parmsOk=True):
73 delay=None, walk=None, set=None, ippKm=None, parmsOk=True, expLabel=''):
74 74
75 75 name = project_name
76 76 datatype = datatype
77 77 ext = ext
78 78 dpath = dpath
79 79 startDate = startDate
80 80 endDate = endDate
81 81 startTime = startTime
82 82 endTime = endTime
83 83 online = online
84 84 delay = delay
85 85 walk = walk
86 86 set = set
87 87 ippKm = ippKm
88 expLabel = expLabel
88 89
89 90 self.parmsOk = parmsOk
90 91
91 92 def isValid(self):
92 93
93 94 return self.parmsOk No newline at end of file
@@ -1,94 +1,94
1 1 # -*- coding: utf-8 -*-
2 2
3 3 # Form implementation generated from reading ui file '/home/roj-idl71/SignalChain/initwindowv2.ui'
4 4 #
5 5 # Created: Wed Mar 6 15:32:39 2013
6 6 # by: PyQt4 UI code generator 4.8.6
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
12 12 try:
13 13 _fromUtf8 = QtCore.QString.fromUtf8
14 14 except AttributeError:
15 15 _fromUtf8 = lambda s: s
16 16
17 17 import os
18 18 from schainpy.gui.figures import tools
19 19
20 INITIAL_MSG = "Signal Chain GUI - v2.1.4"
20 INITIAL_MSG = "Signal Chain GUI - v2.1.5"
21 21 FIGURES_PATH = tools.get_path()
22 22
23 23 class Ui_InitWindow(object):
24 24 def setupUi(self, Dialog):
25 25 Dialog.setObjectName(_fromUtf8("Dialog"))
26 26 Dialog.resize(652, 496)
27 27 Dialog.setWindowTitle(QtGui.QApplication.translate("Dialog", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
28 28 self.gridLayout = QtGui.QGridLayout(Dialog)
29 29 self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
30 30 self.verticalLayout_3 = QtGui.QVBoxLayout()
31 31 self.verticalLayout_3.setObjectName(_fromUtf8("verticalLayout_3"))
32 32 self.verticalLayout_4 = QtGui.QVBoxLayout()
33 33 self.verticalLayout_4.setObjectName(_fromUtf8("verticalLayout_4"))
34 34 self.label_3 = QtGui.QLabel(Dialog)
35 35 font = QtGui.QFont()
36 36 font.setFamily(_fromUtf8("Cambria"))
37 37 font.setPointSize(22)
38 38 font.setBold(False)
39 39 font.setWeight(50)
40 40 self.label_3.setFont(font)
41 41 self.label_3.setText(QtGui.QApplication.translate("Dialog", INITIAL_MSG, None, QtGui.QApplication.UnicodeUTF8))
42 42 self.label_3.setObjectName(_fromUtf8("label_3"))
43 43 self.verticalLayout_4.addWidget(self.label_3)
44 44 self.line_2 = QtGui.QFrame(Dialog)
45 45 self.line_2.setFrameShape(QtGui.QFrame.HLine)
46 46 self.line_2.setFrameShadow(QtGui.QFrame.Sunken)
47 47 self.line_2.setObjectName(_fromUtf8("line_2"))
48 48 self.verticalLayout_4.addWidget(self.line_2)
49 49 self.label_4 = QtGui.QLabel(Dialog)
50 50 self.label_4.setText(_fromUtf8(""))
51 51 self.label_4.setPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"w.jpg") )))
52 52 self.label_4.setScaledContents(True)
53 53 self.label_4.setObjectName(_fromUtf8("label_4"))
54 54 self.verticalLayout_4.addWidget(self.label_4)
55 55 self.verticalLayout_3.addLayout(self.verticalLayout_4)
56 56 self.horizontalLayout_3 = QtGui.QHBoxLayout()
57 57 self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
58 58 self.horizontalLayout_4 = QtGui.QHBoxLayout()
59 59 self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
60 60 spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
61 61 self.horizontalLayout_4.addItem(spacerItem)
62 62 self.ExitBtn = QtGui.QPushButton(Dialog)
63 63 self.ExitBtn.setText(QtGui.QApplication.translate("Dialog", "Exit", None, QtGui.QApplication.UnicodeUTF8))
64 64 self.ExitBtn.setObjectName(_fromUtf8("ExitBtn"))
65 65 self.horizontalLayout_4.addWidget(self.ExitBtn)
66 66 self.ContinueBtn = QtGui.QPushButton(Dialog)
67 67 self.ContinueBtn.setText(QtGui.QApplication.translate("Dialog", "Continue", None, QtGui.QApplication.UnicodeUTF8))
68 68 self.ContinueBtn.setObjectName(_fromUtf8("ContinueBtn"))
69 69 self.horizontalLayout_4.addWidget(self.ContinueBtn)
70 70 spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
71 71 self.horizontalLayout_4.addItem(spacerItem1)
72 72 self.horizontalLayout_3.addLayout(self.horizontalLayout_4)
73 73 self.verticalLayout_3.addLayout(self.horizontalLayout_3)
74 74 self.gridLayout.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
75 75
76 76 self.retranslateUi(Dialog)
77 77 QtCore.QMetaObject.connectSlotsByName(Dialog)
78 78
79 79 def retranslateUi(self, Dialog):
80 80 pass
81 81
82 82
83 83 if __name__ == "__main__":
84 84 import sys
85 85 app = QtGui.QApplication(sys.argv)
86 86 Dialog = QtGui.QDialog()
87 87 ui = Ui_InitWindow()
88 88 ui.setupUi(Dialog)
89 89 Dialog.show()
90 90 sys.exit(app.exec_())
91 91
92 92
93 93
94 94
@@ -1,182 +1,195
1 1
2 2 from PyQt4 import QtCore, QtGui
3 3
4 4 try:
5 5 _fromUtf8 = QtCore.QString.fromUtf8
6 6 except AttributeError:
7 7 def _fromUtf8(s):
8 8 return s
9 9
10 10 try:
11 11 _encoding = QtGui.QApplication.UnicodeUTF8
12 12 def _translate(context, text, disambig):
13 13 return QtGui.QApplication.translate(context, text, disambig, _encoding)
14 14 except AttributeError:
15 15 def _translate(context, text, disambig):
16 16 return QtGui.QApplication.translate(context, text, disambig)
17 17
18 18 class Ui_ProjectTab(object):
19 19
20 20 def setupUi(self):
21 21
22 22 self.tabProject = QtGui.QWidget()
23 23 self.tabProject.setObjectName(_fromUtf8("tabProject"))
24 24 self.gridLayout_15 = QtGui.QGridLayout(self.tabProject)
25 25 self.gridLayout_15.setObjectName(_fromUtf8("gridLayout_15"))
26 26 self.frame = QtGui.QFrame(self.tabProject)
27 27 self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
28 28 self.frame.setFrameShadow(QtGui.QFrame.Raised)
29 29 self.frame.setObjectName(_fromUtf8("frame"))
30 30 self.gridLayout_2 = QtGui.QGridLayout(self.frame)
31 31 self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
32 32 self.label = QtGui.QLabel(self.frame)
33 33 self.label.setObjectName(_fromUtf8("label"))
34 34 self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
35 35 self.proName = QtGui.QLineEdit(self.frame)
36 36 self.proName.setObjectName(_fromUtf8("proName"))
37 37 self.gridLayout_2.addWidget(self.proName, 0, 1, 1, 8)
38 38 self.label_11 = QtGui.QLabel(self.frame)
39 39 self.label_11.setObjectName(_fromUtf8("label_11"))
40 40 self.gridLayout_2.addWidget(self.label_11, 1, 0, 1, 1)
41 41 self.proComDataType = QtGui.QComboBox(self.frame)
42 42 self.proComDataType.setObjectName(_fromUtf8("proComDataType"))
43 43 self.proComDataType.addItem(_fromUtf8(""))
44 44 self.proComDataType.addItem(_fromUtf8(""))
45 45 self.proComDataType.addItem(_fromUtf8(""))
46 46 self.proComDataType.addItem(_fromUtf8(""))
47 47 self.gridLayout_2.addWidget(self.proComDataType, 1, 1, 1, 5)
48 48 self.proDataType = QtGui.QLineEdit(self.frame)
49 49 self.proDataType.setObjectName(_fromUtf8("proDataType"))
50 50 self.gridLayout_2.addWidget(self.proDataType, 1, 6, 1, 3)
51 51 self.label_15 = QtGui.QLabel(self.frame)
52 52 self.label_15.setObjectName(_fromUtf8("label_15"))
53 53 self.gridLayout_2.addWidget(self.label_15, 2, 0, 1, 1)
54 54 self.proToolPath = QtGui.QToolButton(self.frame)
55 55 self.proToolPath.setObjectName(_fromUtf8("proToolPath"))
56 56 self.gridLayout_2.addWidget(self.proToolPath, 2, 1, 1, 1)
57 57 self.proDataPath = QtGui.QLineEdit(self.frame)
58 58 self.proDataPath.setObjectName(_fromUtf8("proDataPath"))
59 59 self.gridLayout_2.addWidget(self.proDataPath, 2, 2, 1, 7)
60 60 self.label_23 = QtGui.QLabel(self.frame)
61 61 self.label_23.setObjectName(_fromUtf8("label_23"))
62 62 self.gridLayout_2.addWidget(self.label_23, 3, 0, 1, 1)
63 63 self.proComReadMode = QtGui.QComboBox(self.frame)
64 64 self.proComReadMode.setObjectName(_fromUtf8("proComReadMode"))
65 65 self.proComReadMode.addItem(_fromUtf8("------"))
66 66 self.proComReadMode.addItem(_fromUtf8(""))
67 67 self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 4)
68 68 self.label_33 = QtGui.QLabel(self.frame)
69 69 self.label_33.setObjectName(_fromUtf8("label_33"))
70 70 self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 1)
71
71 72 self.proDelay = QtGui.QLineEdit(self.frame)
72 73 self.proDelay.setObjectName(_fromUtf8("proDelay"))
73 74 self.gridLayout_2.addWidget(self.proDelay, 3, 6, 1, 1)
75
74 76 self.label_32 = QtGui.QLabel(self.frame)
75 77 self.label_32.setObjectName(_fromUtf8("label_32"))
76 78 self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1)
79
77 80 self.proComWalk = QtGui.QComboBox(self.frame)
78 81 self.proComWalk.setObjectName(_fromUtf8("proComWalk"))
79 82 self.proComWalk.addItem(_fromUtf8(""))
80 83 self.proComWalk.addItem(_fromUtf8(""))
81 self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 8)
84 self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 4)
85
86 self.labExpLabel = QtGui.QLabel(self.frame)
87 self.labExpLabel.setObjectName(_fromUtf8("labExpLabel"))
88 self.gridLayout_2.addWidget(self.labExpLabel, 4, 5, 1, 1)
89
90 self.proExpLabel = QtGui.QLineEdit(self.frame)
91 self.proExpLabel.setObjectName(_fromUtf8("proExpLabel"))
92 self.gridLayout_2.addWidget(self.proExpLabel, 4, 6, 1, 1)
93
82 94 self.proLoadButton = QtGui.QPushButton(self.frame)
83 95 self.proLoadButton.setObjectName(_fromUtf8("proLoadButton"))
84 96 self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9)
85 97 self.labelSet = QtGui.QLabel(self.frame)
86 98 self.labelSet.setObjectName(_fromUtf8("labelSet"))
87 99 self.gridLayout_2.addWidget(self.labelSet, 3, 7, 1, 1)
88 100 self.proSet = QtGui.QLineEdit(self.frame)
89 101 self.proSet.setObjectName(_fromUtf8("proSet"))
90 102 self.gridLayout_2.addWidget(self.proSet, 3, 8, 1, 1)
91 103 self.labelIPPKm = QtGui.QLabel(self.frame)
92 104 self.labelIPPKm.setObjectName(_fromUtf8("labelIPPKm"))
93 105 self.gridLayout_2.addWidget(self.labelIPPKm, 3, 7, 1, 1)
94 106 self.proIPPKm = QtGui.QLineEdit(self.frame)
95 107 self.proIPPKm.setObjectName(_fromUtf8("proIPPKm"))
96 108 self.gridLayout_2.addWidget(self.proIPPKm, 3, 8, 1, 1)
97 109
98 110
99 111 self.gridLayout_15.addWidget(self.frame, 0, 0, 1, 1)
100 112 self.frame_2 = QtGui.QFrame(self.tabProject)
101 113 self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
102 114 self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
103 115 self.frame_2.setObjectName(_fromUtf8("frame_2"))
104 116 self.gridLayout_10 = QtGui.QGridLayout(self.frame_2)
105 117 self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10"))
106 118 self.label_27 = QtGui.QLabel(self.frame_2)
107 119 self.label_27.setObjectName(_fromUtf8("label_27"))
108 120 self.gridLayout_10.addWidget(self.label_27, 0, 0, 1, 1)
109 121 self.proComStartDate = QtGui.QComboBox(self.frame_2)
110 122 self.proComStartDate.setObjectName(_fromUtf8("proComStartDate"))
111 123 self.gridLayout_10.addWidget(self.proComStartDate, 0, 1, 1, 1)
112 124 self.label_28 = QtGui.QLabel(self.frame_2)
113 125 self.label_28.setObjectName(_fromUtf8("label_28"))
114 126 self.gridLayout_10.addWidget(self.label_28, 1, 0, 1, 1)
115 127 self.proComEndDate = QtGui.QComboBox(self.frame_2)
116 128 self.proComEndDate.setObjectName(_fromUtf8("proComEndDate"))
117 129 self.gridLayout_10.addWidget(self.proComEndDate, 1, 1, 1, 1)
118 130 self.label_2 = QtGui.QLabel(self.frame_2)
119 131 self.label_2.setObjectName(_fromUtf8("label_2"))
120 132 self.gridLayout_10.addWidget(self.label_2, 2, 0, 1, 1)
121 133 self.proStartTime = QtGui.QTimeEdit(self.frame_2)
122 134 self.proStartTime.setObjectName(_fromUtf8("proStartTime"))
123 135 self.gridLayout_10.addWidget(self.proStartTime, 2, 1, 1, 1)
124 136 self.label_3 = QtGui.QLabel(self.frame_2)
125 137 self.label_3.setObjectName(_fromUtf8("label_3"))
126 138 self.gridLayout_10.addWidget(self.label_3, 3, 0, 1, 1)
127 139 self.proEndTime = QtGui.QTimeEdit(self.frame_2)
128 140 self.proEndTime.setObjectName(_fromUtf8("proEndTime"))
129 141 self.gridLayout_10.addWidget(self.proEndTime, 3, 1, 1, 1)
130 142 self.label_30 = QtGui.QLabel(self.frame_2)
131 143 self.label_30.setObjectName(_fromUtf8("label_30"))
132 144 self.gridLayout_10.addWidget(self.label_30, 4, 0, 1, 1)
133 145 self.proDescription = QtGui.QTextEdit(self.frame_2)
134 146 self.proDescription.setObjectName(_fromUtf8("proDescription"))
135 147 self.gridLayout_10.addWidget(self.proDescription, 4, 1, 1, 1)
136 148 self.gridLayout_15.addWidget(self.frame_2, 1, 0, 1, 1)
137 149 self.frame_3 = QtGui.QFrame(self.tabProject)
138 150 self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel)
139 151 self.frame_3.setFrameShadow(QtGui.QFrame.Raised)
140 152 self.frame_3.setObjectName(_fromUtf8("frame_3"))
141 153 self.gridLayout_14 = QtGui.QGridLayout(self.frame_3)
142 154 self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14"))
143 155 self.proOk = QtGui.QPushButton(self.frame_3)
144 156 self.proOk.setObjectName(_fromUtf8("proOk"))
145 157 self.gridLayout_14.addWidget(self.proOk, 0, 0, 1, 1)
146 158 self.proClear = QtGui.QPushButton(self.frame_3)
147 159 self.proClear.setObjectName(_fromUtf8("proClear"))
148 160 self.gridLayout_14.addWidget(self.proClear, 0, 1, 1, 1)
149 161 self.gridLayout_15.addWidget(self.frame_3, 2, 0, 1, 1)
150 162
151 163 self.tabWidgetProject.addTab(self.tabProject, _fromUtf8(""))
152 164
153 165 def retranslateUi(self):
154 166
155 167 self.label.setText(_translate("MainWindow", "Project Name :", None))
156 168 self.label_11.setText(_translate("MainWindow", "DataType :", None))
157 169 self.proComDataType.setItemText(0, _translate("MainWindow", "Voltage", None))
158 170 self.proComDataType.setItemText(1, _translate("MainWindow", "Spectra", None))
159 171 self.proComDataType.setItemText(2, _translate("MainWindow", "Fits", None))
160 172 self.proComDataType.setItemText(3, _translate("MainWindow", "USRP", None))
161 173 self.label_15.setText(_translate("MainWindow", "DataPath :", None))
162 174 self.proToolPath.setText(_translate("MainWindow", "...", None))
163 175 self.label_23.setText(_translate("MainWindow", "Read Mode:", None))
164 176 self.proComReadMode.setItemText(0, _translate("MainWindow", "Offline", None))
165 177 self.proComReadMode.setItemText(1, _translate("MainWindow", "Online", None))
166 178 self.label_33.setText(_translate("MainWindow", "Delay:", None))
179 self.labExpLabel.setText(_translate("MainWindow", "Exp Label:", None))
167 180 self.label_32.setText(_translate("MainWindow", "Walk :", None))
168 181 self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None))
169 182 self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None))
170 183 self.proLoadButton.setText(_translate("MainWindow", "Load", None))
171 184 self.labelSet.setText(_translate("MainWindow", "Set:", None))
172 185 self.labelIPPKm.setText(_translate("MainWindow", "IPP (km):", None))
173 186 self.label_27.setText(_translate("MainWindow", "Star Date:", None))
174 187 self.label_28.setText(_translate("MainWindow", "End Date:", None))
175 188 self.label_2.setText(_translate("MainWindow", "Start Time:", None))
176 189 self.label_3.setText(_translate("MainWindow", "End Time:", None))
177 190 self.label_30.setText(_translate("MainWindow", "Description:", None))
178 191 self.proOk.setText(_translate("MainWindow", "Ok", None))
179 192 self.proClear.setText(_translate("MainWindow", "Clear", None))
180 193
181 194 self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabProject), _translate("MainWindow", "Project", None))
182 195 No newline at end of file
@@ -1,451 +1,456
1 1 from PyQt4 import QtCore, QtGui
2 2
3 3 try:
4 4 _fromUtf8 = QtCore.QString.fromUtf8
5 5 except AttributeError:
6 6 def _fromUtf8(s):
7 7 return s
8 8
9 9 try:
10 10 _encoding = QtGui.QApplication.UnicodeUTF8
11 11 def _translate(context, text, disambig):
12 12 return QtGui.QApplication.translate(context, text, disambig, _encoding)
13 13 except AttributeError:
14 14 def _translate(context, text, disambig):
15 15 return QtGui.QApplication.translate(context, text, disambig)
16 16
17 17 class Ui_SpectraTab(object):
18 18
19 19 def setupUi(self):
20 20
21 21 self.tabSpectra = QtGui.QWidget()
22 22 self.tabSpectra.setObjectName(_fromUtf8("tabSpectra"))
23 23 self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra)
24 24 self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7"))
25 25 self.frame_5 = QtGui.QFrame(self.tabSpectra)
26 26 self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel)
27 27 self.frame_5.setFrameShadow(QtGui.QFrame.Raised)
28 28 self.frame_5.setObjectName(_fromUtf8("frame_5"))
29 29 self.gridLayout_18 = QtGui.QGridLayout(self.frame_5)
30 30 self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18"))
31 31 self.specOpOk = QtGui.QPushButton(self.frame_5)
32 32 self.specOpOk.setObjectName(_fromUtf8("specOpOk"))
33 33 self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1)
34 34 self.specGraphClear = QtGui.QPushButton(self.frame_5)
35 35 self.specGraphClear.setObjectName(_fromUtf8("specGraphClear"))
36 36 self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1)
37 37 self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1)
38 38 self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra)
39 39 self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra"))
40 40 self.tabopSpectra = QtGui.QWidget()
41 41 self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra"))
42 42 self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra)
43 43 self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5"))
44 44 self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra)
45 45 self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra"))
46 46 self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2)
47 47 self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra)
48 48 self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel"))
49 49 self.specOpComChannel.addItem(_fromUtf8(""))
50 50 self.specOpComChannel.addItem(_fromUtf8(""))
51 51 self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2)
52 52 self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra)
53 53 self.specOpChannel.setObjectName(_fromUtf8("specOpChannel"))
54 54 self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2)
55 55 self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra)
56 56 self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights"))
57 57 self.specOpComHeights.addItem(_fromUtf8(""))
58 58 self.specOpComHeights.addItem(_fromUtf8(""))
59 59 self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2)
60 60 self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra)
61 61 self.specOpHeights.setObjectName(_fromUtf8("specOpHeights"))
62 62 self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2)
63 63 self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra)
64 64 self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent"))
65 65 self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2)
66 66 self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra)
67 67 self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC"))
68 68 self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2)
69 69 self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra)
70 70 self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights"))
71 71 self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1)
72 72 self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra)
73 73 self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel"))
74 74 self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1)
75 75 self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra)
76 76 self.specOppairsList.setObjectName(_fromUtf8("specOppairsList"))
77 77 self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2)
78 78 self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra)
79 79 self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints"))
80 80 self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2)
81 81 self.label_31 = QtGui.QLabel(self.tabopSpectra)
82 82 self.label_31.setObjectName(_fromUtf8("label_31"))
83 83 self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2)
84 84 self.label_26 = QtGui.QLabel(self.tabopSpectra)
85 85 self.label_26.setObjectName(_fromUtf8("label_26"))
86 86 self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2)
87 87 self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra)
88 88 self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent"))
89 89 self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1)
90 90 self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra)
91 91 self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt"))
92 92 self.specOpCobIncInt.addItem(_fromUtf8(""))
93 93 self.specOpCobIncInt.addItem(_fromUtf8(""))
94 94 self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2)
95 95 spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
96 96 self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1)
97 97 self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra)
98 98 self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency"))
99 99 self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2)
100 100 spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
101 101 self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1)
102 102 spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
103 103 self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1)
104 104 self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra)
105 105 self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency"))
106 106 self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2)
107
107 108 spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
108 109 self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1)
110
109 111 self.label_21 = QtGui.QLabel(self.tabopSpectra)
110 112 self.label_21.setObjectName(_fromUtf8("label_21"))
111 113 self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1)
112 114 self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra)
113 115 self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles"))
114 116 self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2)
115 117 self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra)
116 118 self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt"))
117 119 self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1)
120
118 121 spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
119 122 self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1)
123
120 124 self.label_70 = QtGui.QLabel(self.tabopSpectra)
121 125 self.label_70.setObjectName(_fromUtf8("label_70"))
122 126 self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1)
123 127 self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra)
124 128 self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise"))
125 129 self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1)
126 130 self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra)
127 131 self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor"))
128 132 self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2)
129 133 self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra)
130 134 self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC"))
131 135 self.specOpComRemoveDC.addItem(_fromUtf8(""))
132 136 self.specOpComRemoveDC.addItem(_fromUtf8(""))
133 137 self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2)
134 138 self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra)
135 139 self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise"))
136 140 self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2)
137 141 self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8(""))
138 142
143 ################################################################
144 ################################################################
139 145
140 146 self.tabgraphSpectra = QtGui.QWidget()
141 147 self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra"))
142 148 self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra)
143 149 self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9"))
144 150
145 spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
146 self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1)
151 # spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
152 # self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1)
153 xi = 0
147 154
148 155 self.label_24 = QtGui.QLabel(self.tabgraphSpectra)
149 156 self.label_24.setObjectName(_fromUtf8("label_24"))
150 self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1)
157 self.gridLayout_9.addWidget(self.label_24, xi, 0, 1, 1)
151 158
152 159 self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra)
153 160 self.specGraphPath.setObjectName(_fromUtf8("specGraphPath"))
154 self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6)
161 self.gridLayout_9.addWidget(self.specGraphPath, xi, 1, 1, 6)
155 162
156 163 self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra)
157 164 self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath"))
158 self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1)
165 self.gridLayout_9.addWidget(self.specGraphToolPath, xi, 7, 1, 1)
159 166
160 167 self.label_25 = QtGui.QLabel(self.tabgraphSpectra)
161 168 self.label_25.setObjectName(_fromUtf8("label_25"))
162 self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1)
169 self.gridLayout_9.addWidget(self.label_25, xi+1, 0, 1, 1)
163 170 self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra)
164 171 self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix"))
165 self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7)
172 self.gridLayout_9.addWidget(self.specGraphPrefix, xi+1, 1, 1, 7)
166 173
174 xi = 2
167 175
168 176 self.label_40 = QtGui.QLabel(self.tabgraphSpectra)
169 177 self.label_40.setObjectName(_fromUtf8("label_40"))
170 self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1)
178 self.gridLayout_9.addWidget(self.label_40, xi+1, 0, 1, 1)
171 179 self.label_41 = QtGui.QLabel(self.tabgraphSpectra)
172 180 self.label_41.setObjectName(_fromUtf8("label_41"))
173 self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1)
181 self.gridLayout_9.addWidget(self.label_41, xi+2, 0, 1, 1)
174 182 self.label_42 = QtGui.QLabel(self.tabgraphSpectra)
175 183 self.label_42.setObjectName(_fromUtf8("label_42"))
176 self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1)
184 self.gridLayout_9.addWidget(self.label_42, xi+3, 0, 1, 1)
177 185 self.label_44 = QtGui.QLabel(self.tabgraphSpectra)
178 186 self.label_44.setObjectName(_fromUtf8("label_44"))
179 self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1)
187 self.gridLayout_9.addWidget(self.label_44, xi+4, 0, 1, 1)
180 188 self.label_46 = QtGui.QLabel(self.tabgraphSpectra)
181 189 self.label_46.setObjectName(_fromUtf8("label_46"))
182 self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1)
190 self.gridLayout_9.addWidget(self.label_46, xi+5, 0, 1, 1)
183 191 self.label_45 = QtGui.QLabel(self.tabgraphSpectra)
184 192 self.label_45.setObjectName(_fromUtf8("label_45"))
185 self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1)
193 self.gridLayout_9.addWidget(self.label_45, xi+6, 0, 1, 1)
186 194
187 195 self.label_43 = QtGui.QLabel(self.tabgraphSpectra)
188 196 self.label_43.setObjectName(_fromUtf8("label_43"))
189 self.gridLayout_9.addWidget(self.label_43, 3, 3, 2, 1)
197 self.gridLayout_9.addWidget(self.label_43, xi, 3, 1, 1)
190 198 self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra)
191 199 self.specGraphCebSpectraplot.setText(_fromUtf8(""))
192 200 self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot"))
193 self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 3, 1, 1)
201 self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, xi+1, 3, 1, 1)
194 202 self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra)
195 203 self.specGraphCebCrossSpectraplot.setText(_fromUtf8(""))
196 204 self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot"))
197 self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 3, 1, 1)
205 self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, xi+2, 3, 1, 1)
198 206 self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra)
199 207 self.specGraphCebRTIplot.setText(_fromUtf8(""))
200 208 self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot"))
201 self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 3, 1, 1)
209 self.gridLayout_9.addWidget(self.specGraphCebRTIplot, xi+3, 3, 1, 1)
202 210 self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra)
203 211 self.specGraphCebCoherencmap.setText(_fromUtf8(""))
204 212 self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap"))
205 self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 3, 1, 1)
213 self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, xi+4, 3, 1, 1)
206 214 self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra)
207 215 self.specGraphPowerprofile.setText(_fromUtf8(""))
208 216 self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile"))
209 self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 3, 1, 1)
217 self.gridLayout_9.addWidget(self.specGraphPowerprofile, xi+5, 3, 1, 1)
210 218 self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra)
211 219 self.specGraphCebRTInoise.setText(_fromUtf8(""))
212 220 self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise"))
213 self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 3, 1, 1)
221 self.gridLayout_9.addWidget(self.specGraphCebRTInoise, xi+6, 3, 1, 1)
214 222
215 223 # spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
216 224 # self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1)
217 225
218 226 self.label_47 = QtGui.QLabel(self.tabgraphSpectra)
219 227 self.label_47.setObjectName(_fromUtf8("label_47"))
220 self.gridLayout_9.addWidget(self.label_47, 3, 5, 2, 1)
228 self.gridLayout_9.addWidget(self.label_47, xi, 5, 1, 1)
221 229 self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra)
222 230 self.specGraphSaveSpectra.setText(_fromUtf8(""))
223 231 self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra"))
224 self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 5, 1, 1)
232 self.gridLayout_9.addWidget(self.specGraphSaveSpectra, xi+1, 5, 1, 1)
225 233 self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra)
226 234 self.specGraphSaveCross.setText(_fromUtf8(""))
227 235 self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross"))
228 self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 5, 1, 1)
236 self.gridLayout_9.addWidget(self.specGraphSaveCross, xi+2, 5, 1, 1)
229 237 self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra)
230 238 self.specGraphSaveRTIplot.setText(_fromUtf8(""))
231 239 self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot"))
232 self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 5, 1, 1)
240 self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, xi+3, 5, 1, 1)
233 241 self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra)
234 242 self.specGraphSaveCoherencemap.setText(_fromUtf8(""))
235 243 self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap"))
236 self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 5, 1, 1)
244 self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, xi+4, 5, 1, 1)
237 245 self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra)
238 246 self.specGraphSavePowerprofile.setText(_fromUtf8(""))
239 247 self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile"))
240 self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 5, 1, 1)
248 self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, xi+5, 5, 1, 1)
241 249 self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra)
242 250 self.specGraphSaveRTInoise.setText(_fromUtf8(""))
243 251 self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise"))
244 self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 5, 1, 1)
252 self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, xi+6, 5, 1, 1)
245 253
246 254 self.label_19 = QtGui.QLabel(self.tabgraphSpectra)
247 255 self.label_19.setObjectName(_fromUtf8("label_19"))
248 self.gridLayout_9.addWidget(self.label_19, 3, 7, 2, 1)
256 self.gridLayout_9.addWidget(self.label_19, xi, 7, 1, 1)
249 257 self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra)
250 258 self.specGraphftpSpectra.setText(_fromUtf8(""))
251 259 self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra"))
252 self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 7, 1, 1)
260 self.gridLayout_9.addWidget(self.specGraphftpSpectra, xi+1, 7, 1, 1)
253 261 self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra)
254 262 self.specGraphftpCross.setText(_fromUtf8(""))
255 263 self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross"))
256 self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 7, 1, 1)
264 self.gridLayout_9.addWidget(self.specGraphftpCross, xi+2, 7, 1, 1)
257 265 self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra)
258 266 self.specGraphftpRTIplot.setText(_fromUtf8(""))
259 267 self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot"))
260 self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 7, 1, 1)
268 self.gridLayout_9.addWidget(self.specGraphftpRTIplot, xi+3, 7, 1, 1)
261 269 self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra)
262 270 self.specGraphftpCoherencemap.setText(_fromUtf8(""))
263 271 self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap"))
264 self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 7, 1, 1)
272 self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, xi+4, 7, 1, 1)
265 273 self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra)
266 274 self.specGraphftpPowerprofile.setText(_fromUtf8(""))
267 275 self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile"))
268 self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 7, 1, 1)
276 self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, xi+5, 7, 1, 1)
269 277 self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra)
270 278 self.specGraphftpRTInoise.setText(_fromUtf8(""))
271 279 self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise"))
272 self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 7, 1, 1)
280 self.gridLayout_9.addWidget(self.specGraphftpRTInoise, xi+6, 7, 1, 1)
273 281
274 spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
275 self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1)
282 # spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
283 # self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1)
284
285 xi = 11
276 286
277 287 self.label_22 = QtGui.QLabel(self.tabgraphSpectra)
278 288 self.label_22.setObjectName(_fromUtf8("label_22"))
279 self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1)
289 self.gridLayout_9.addWidget(self.label_22, xi, 0, 1, 1)
280 290 self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra)
281 291 self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq"))
282 self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 2, 1, 2)
292 self.gridLayout_9.addWidget(self.specGgraphFreq, xi, 2, 1, 2)
283 293
284 294 self.label_16 = QtGui.QLabel(self.tabgraphSpectra)
285 295 self.label_16.setObjectName(_fromUtf8("label_16"))
286 self.gridLayout_9.addWidget(self.label_16, 17, 0, 1, 1)
296 self.gridLayout_9.addWidget(self.label_16, xi+1, 0, 1, 1)
287 297 self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra)
288 298 self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight"))
289 self.gridLayout_9.addWidget(self.specGgraphHeight, 17, 2, 1, 2)
299 self.gridLayout_9.addWidget(self.specGgraphHeight, xi+1, 2, 1, 2)
290 300
291 301 self.label_17 = QtGui.QLabel(self.tabgraphSpectra)
292 302 self.label_17.setObjectName(_fromUtf8("label_17"))
293 self.gridLayout_9.addWidget(self.label_17, 18, 0, 1, 1)
303 self.gridLayout_9.addWidget(self.label_17, xi+2, 0, 1, 1)
294 304 self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra)
295 305 self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange"))
296 self.gridLayout_9.addWidget(self.specGgraphDbsrange, 18, 2, 1, 2)
306 self.gridLayout_9.addWidget(self.specGgraphDbsrange, xi+2, 2, 1, 2)
297 307
298 308 self.specGraphTminTmaxLabel = QtGui.QLabel(self.tabgraphSpectra)
299 309 self.specGraphTminTmaxLabel.setObjectName(_fromUtf8("specGraphTminTmaxLabel"))
300 self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, 19, 0, 1, 2)
310 self.gridLayout_9.addWidget(self.specGraphTminTmaxLabel, xi+3, 0, 1, 2)
301 311 self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra)
302 312 self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax"))
303 self.gridLayout_9.addWidget(self.specGgraphTminTmax, 19, 2, 1, 2)
313 self.gridLayout_9.addWidget(self.specGgraphTminTmax, xi+3, 2, 1, 2)
304 314
305 315 self.specGraphMagLabel = QtGui.QLabel(self.tabgraphSpectra)
306 316 self.specGraphMagLabel.setObjectName(_fromUtf8("specGraphMagLabel"))
307 self.gridLayout_9.addWidget(self.specGraphMagLabel, 16, 4, 1, 2)
317 self.gridLayout_9.addWidget(self.specGraphMagLabel, xi, 4, 1, 2)
308 318 self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra)
309 319 self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud"))
310 self.gridLayout_9.addWidget(self.specGgraphmagnitud, 16, 6, 1, 2)
320 self.gridLayout_9.addWidget(self.specGgraphmagnitud, xi, 6, 1, 2)
311 321
312 322 self.specGraphPhaseLabel = QtGui.QLabel(self.tabgraphSpectra)
313 323 self.specGraphPhaseLabel.setObjectName(_fromUtf8("specGraphPhaseLabel"))
314 self.gridLayout_9.addWidget(self.specGraphPhaseLabel, 17, 4, 1, 2)
324 self.gridLayout_9.addWidget(self.specGraphPhaseLabel, xi+1, 4, 1, 2)
315 325 self.specGgraphPhase = QtGui.QLineEdit(self.tabgraphSpectra)
316 326 self.specGgraphPhase.setObjectName(_fromUtf8("specGgraphPhase"))
317 self.gridLayout_9.addWidget(self.specGgraphPhase, 17, 6, 1, 2)
327 self.gridLayout_9.addWidget(self.specGgraphPhase, xi+1, 6, 1, 2)
318 328
319 329 self.label_6 = QtGui.QLabel(self.tabgraphSpectra)
320 330 self.label_6.setObjectName(_fromUtf8("label_6"))
321 self.gridLayout_9.addWidget(self.label_6, 18, 4, 1, 1)
331 self.gridLayout_9.addWidget(self.label_6, xi+2, 4, 1, 1)
322 332 self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra)
323 333 self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList"))
324 self.gridLayout_9.addWidget(self.specGgraphChannelList, 18, 6, 1, 2)
334 self.gridLayout_9.addWidget(self.specGgraphChannelList, xi+2, 6, 1, 2)
325 335
326 336 self.label_29 = QtGui.QLabel(self.tabgraphSpectra)
327 337 self.label_29.setObjectName(_fromUtf8("label_29"))
328 self.gridLayout_9.addWidget(self.label_29, 19, 4, 1, 2)
338 self.gridLayout_9.addWidget(self.label_29, xi+3, 4, 1, 2)
329 339 self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra)
330 340 self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio"))
331 self.gridLayout_9.addWidget(self.specGgraphftpratio, 19, 6, 1, 2)
341 self.gridLayout_9.addWidget(self.specGgraphftpratio, xi+3, 6, 1, 2)
332 342
333 343 self.label_48 = QtGui.QLabel(self.tabgraphSpectra)
334 344 self.label_48.setObjectName(_fromUtf8("label_48"))
335 self.gridLayout_9.addWidget(self.label_48, 20, 4, 1, 2)
345 self.gridLayout_9.addWidget(self.label_48, xi+4, 4, 1, 2)
336 346 self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra)
337 347 self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange"))
338 self.gridLayout_9.addWidget(self.specGgraphTimeRange, 20, 6, 1, 2)
339
340 spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
341 self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2)
342 spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
343 self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1)
344 spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
345 self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1)
348 self.gridLayout_9.addWidget(self.specGgraphTimeRange, xi+4, 6, 1, 2)
349
350 # spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
351 # self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2)
352 # spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
353 # self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1)
354 # spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
355 # self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1)
346 356
347 357
348 358
349 359 self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8(""))
350 360 self.taboutputSpectra = QtGui.QWidget()
351 361 self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra"))
352 362 self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra)
353 363 self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11"))
354 364 self.label_39 = QtGui.QLabel(self.taboutputSpectra)
355 365 self.label_39.setObjectName(_fromUtf8("label_39"))
356 366 self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1)
357 367 self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra)
358 368 self.specOutputComData.setObjectName(_fromUtf8("specOutputComData"))
359 369 self.specOutputComData.addItem(_fromUtf8(""))
360 370 self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2)
361 371 self.label_34 = QtGui.QLabel(self.taboutputSpectra)
362 372 self.label_34.setObjectName(_fromUtf8("label_34"))
363 373 self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1)
364 374 self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra)
365 375 self.specOutputPath.setObjectName(_fromUtf8("specOutputPath"))
366 376 self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1)
367 377 spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
368 378 self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1)
369 379 self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra)
370 380 self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath"))
371 381 self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1)
372 382 self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra)
373 383 self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile"))
374 384 self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1)
375 385 self.label_9 = QtGui.QLabel(self.taboutputSpectra)
376 386 self.label_9.setObjectName(_fromUtf8("label_9"))
377 387 self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2)
378 self.label_38 = QtGui.QLabel(self.taboutputSpectra)
379 self.label_38.setObjectName(_fromUtf8("label_38"))
380 self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1)
381 self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra)
382 self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock"))
383 self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1)
388
384 389 self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8(""))
385 390 self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1)
386 391
387 392 self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8(""))
388 393
389 394 self.tabWidgetSpectra.setCurrentIndex(0)
390 395
391 396 def retranslateUi(self):
392 397
393 398 self.specOpOk.setText(_translate("MainWindow", "Ok", None))
394 399 self.specGraphClear.setText(_translate("MainWindow", "Clear", None))
395 400 self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None))
396 401 self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None))
397 402 self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None))
398 403 self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None))
399 404 self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None))
400 405 self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None))
401 406 self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None))
402 407 self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None))
403 408 self.label_31.setText(_translate("MainWindow", "x-y pairs", None))
404 409 self.label_26.setText(_translate("MainWindow", "nFFTPoints", None))
405 410 self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None))
406 411 self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None))
407 412 self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None))
408 413 self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar frequency (MHz)", None))
409 414 self.label_21.setText(_translate("MainWindow", "Profiles", None))
410 415 self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None))
411 416 self.label_70.setText(_translate("MainWindow", "IppFactor", None))
412 417 self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None))
413 418 self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None))
414 419 self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None))
415 420 self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None))
416 421
417 422 self.label_44.setText(_translate("MainWindow", "Coherence Map", None))
418 423 self.specGraphTminTmaxLabel.setText(_translate("MainWindow", "Time range:", None))
419 424 self.label_25.setText(_translate("MainWindow", "Prefix", None))
420 425 self.label_42.setText(_translate("MainWindow", "RTI Plot", None))
421 426 self.label_16.setText(_translate("MainWindow", "Height range", None))
422 427 self.label_17.setText(_translate("MainWindow", "dB range", None))
423 428 self.specGraphMagLabel.setText(_translate("MainWindow", "Coh. Magnitud ", None))
424 429 self.label_24.setText(_translate("MainWindow", "Path", None))
425 430 self.label_46.setText(_translate("MainWindow", "Power Profile", None))
426 431 self.label_22.setText(_translate("MainWindow", "Freq/Vel range:", None))
427 432 self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None))
428 433 self.specGraphToolPath.setText(_translate("MainWindow", "...", None))
429 434 self.label_6.setText(_translate("MainWindow", "Channel List:", None))
430 435 self.label_40.setText(_translate("MainWindow", "Spectra Plot", None))
431 436 self.label_43.setText(_translate("MainWindow", "Show", None))
432 437 self.label_29.setText(_translate("MainWindow", "Writing Period:", None))
433 438 self.label_47.setText(_translate("MainWindow", "Save", None))
434 439 self.label_19.setText(_translate("MainWindow", "Ftp", None))
435 440 self.label_45.setText(_translate("MainWindow", "Noise", None))
436 441 self.label_48.setText(_translate("MainWindow", "Time Range:", None))
437 442 self.specGraphPhaseLabel.setText(_translate("MainWindow", "Coh. Phase:", None))
438 443 self.label_48.hide()
439 444 self.specGgraphTimeRange.hide()
440 445 self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None))
441 446
442 447 self.label_39.setText(_translate("MainWindow", "Type:", None))
443 448 self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None))
444 449 self.label_34.setText(_translate("MainWindow", "Path:", None))
445 450 self.specOutputToolPath.setText(_translate("MainWindow", "...", None))
446 451 self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None))
447 self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None))
452
448 453 self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None))
449 454
450 455 self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None))
451 456 No newline at end of file
@@ -1,125 +0,0
1 import threading
2 import Queue
3 try:
4 from gevent import sleep
5 except:
6 from time import sleep
7
8 from schainpy.controller import Project
9 from command import *
10
11 class ControllerThread(threading.Thread):
12
13 def __init__(self, filename, data_q=None):
14
15 super(ControllerThread, self).__init__()
16 self.setDaemon(True)
17
18 self.filename = filename
19 self.data_q = data_q
20 self.control = {'stop':False,'pause':False}
21
22 def stop(self):
23 self.control['stop'] = True
24
25 def pause(self):
26 self.control['pause'] = not(self.control['pause'])
27
28 def run(self):
29 self.control['stop'] = False
30 self.control['pause'] = False
31 self.controllerObj = Project(self.control, self.data_q)
32 self.controllerObj.readXml(self.filename)
33 self.controllerObj.createObjects()
34 self.controllerObj.connectObjects()
35 self.controllerObj.run()
36
37 class CommCtrlProcessThread(threading.Thread):
38 """ Implements the threading.Thread interface (start, join, etc.) and
39 can be controlled via the cmd_q Queue attribute. Replies are placed in
40 the reply_q Queue attribute.
41 """
42 def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()):
43 super(CommCtrlProcessThread, self).__init__()
44 self.cmd_q = cmd_q
45 # self.reply_q = reply_q
46
47 # self.print_q = Queue.Queue()
48 # self.data_q = Queue.Queue()
49
50
51 self.alive = threading.Event()
52 self.setDaemon(True)
53 self.alive.set()
54 self.socket = None
55
56 self.socketIO = None
57 self.mySocket = None
58
59 self.controllerObj = None
60
61 self.handlers = {
62 ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD,
63 ProcessCommand.MESSAGE: self._handle_ioMESSAGE,
64 ProcessCommand.DATA: self._handle_ioDATA,
65 ProcessCommand.STOP: self._handle_ioSTOP,
66 ProcessCommand.PAUSE: self._handle_ioPAUSE
67 }
68
69 def run(self):
70
71 while self.alive.isSet():
72 try:
73 cmd = self.cmd_q.get(True, 0.1)
74 self.handlers[cmd.type](cmd)
75 except Queue.Empty as e:
76 continue
77
78 def isRunning(self):
79
80 if self.controllerObj == None:
81 return False
82
83 if self.controllerObj.isAlive():
84 return True
85
86 return False
87
88 def _handle_ioPROCESSTHREAD(self, cmd):
89 filename = cmd.data
90 self.controllerObj = ControllerThread(filename=filename)
91 self.controllerObj.start()
92
93 def _handle_ioPAUSE(self, cmd):
94 self.controllerObj.pause()
95
96 def _handle_ioSTOP(self, cmd):
97 self.controllerObj.stop()
98
99 while self.controllerObj.isAlive():
100 self.console.clear()
101 self.console.append("Close graphics before continue...")
102 sleep(0.1)
103
104
105 self.controllerObj.join()
106 # print "Process thread finished"
107
108 def _handle_ioDATA(self, cmd):
109 self.reply_q.put(self._success_reply_data(data=cmd.data))
110
111 def _handle_ioMESSAGE(self, cmd):
112 self.reply_q.put(self._success_reply_message(data=cmd.data))
113
114 def _success_reply_data(self, data=None):
115 return ClientReply(ClientReply.DATA, data)
116
117 def _success_reply_message(self, data=None):
118 return ClientReply(ClientReply.MESSAGE, data)
119
120 def join(self, timeout=None):
121 self.alive.clear()
122 threading.Thread.join(self, timeout)
123
124
125 No newline at end of file
@@ -1,50 +0,0
1 class ProcessCommand(object):
2 """ A command to the client thread.
3 Each command type has its associated data:
4
5 DATA: Data Radar Object
6 MESSAGE: Data String
7 STOP: Event to Stop the process thread
8 PAUSE: Event to Pause the process thread
9 """
10 PROCESS, DATA, MESSAGE, STOP, PAUSE = range(5)
11
12 def __init__(self, type, data=None):
13 self.type = type
14 self.data = data
15
16
17 class ClientCommand(object):
18 """ A command to the client thread.
19 Each command type has its associated data:
20
21 CONNECT: (host, port) tuple
22 SEND: Data string
23 RECEIVE: None
24 CLOSE: None
25 PROCESS: to processing
26 SEND: send a data
27 SENDXML: send xml file
28 """
29 CONNECT, SEND, SENDXML, RECEIVE, CLOSE, PROCESS = range(6)
30
31 def __init__(self, type, data=None):
32 self.type = type
33 self.data = data
34
35
36 class ClientReply(object):
37 """ A reply from the client thread.
38 Each reply type has its associated data:
39
40 ERROR: The error string
41 MESSAGE: Data String
42 DATA: Data
43 SUCCESS: Depends on the command - for RECEIVE it's the received
44 data string, for others None.
45 """
46 ERROR, SUCCESS, MESSAGE, DATA= range(4)
47
48 def __init__(self, type, data=None):
49 self.type = type
50 self.data = data
This diff has been collapsed as it changes many lines, (632 lines changed) Show them Hide them
@@ -1,632 +0,0
1 # -*- coding: utf-8 -*-
2 """
3 Module implementing MainWindow.
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
5 """
6 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignal
9 from PyQt4 import QtCore
10 from PyQt4 import QtGui
11 from timeconversions import Doy2Date
12 from modelProperties import treeModel
13
14 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
15 from schainpy.gui.viewer.ui_window import Ui_window
16 from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow
17
18 from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
19 import os
20
21
22 class BodyMainWindow(QMainWindow, Ui_MainWindow):
23 __projObjDict = {}
24 __arbolDict = {}
25 __upObjDict = {}
26
27 """
28 Class documentation goes here.
29 #*##################VENTANA CUERPO DEL PROGRAMA####################
30 """
31 def __init__(self, parent = None):
32 """
33 Constructor
34 """
35 print "Inicio de Programa Interfaz Gráfica"
36 QMainWindow.__init__(self, parent)
37 self.setupUi(self)
38
39 self.indexclick=None
40
41 self.online=0
42 self.datatype=0
43 self.variableList=[]
44
45 self.proObjList=[]
46 self.idp=0
47 self.namep=0
48 self.description=0
49 self.namepTree=0
50 self.valuep=0
51
52 self.upObjList= []
53 self.upn=0
54 self.upName=0
55 self.upType=0
56 self.uporProObjRecover=0
57
58 self.readUnitConfObjList=[]
59
60 self.upObjVolList=[]
61 self.upobjSpecList=[]
62
63 self.operObjList=[]
64
65 self.configProject=None
66 self.configUP=None
67
68 self.readUnitConfObj=None
69 self.procUnitConfObj0=None
70 self.opObj10=None
71 self.opObj12=None
72
73 self.setParam()
74
75 #-----------------------------------NEW PROPERTIES------------------------------------------------#
76 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
77 self.addprojectBtn.setToolTip('Add_New_Project')
78 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
79
80 #-----------------------------------NEW PROPERTIES------------------------------------------------#
81 self.model = QtGui.QStandardItemModel()
82 self.treeView.setModel(self.model)
83 self.treeView.clicked.connect(self.clickFunctiontree)
84 self.treeView.expandAll()
85 #self.treeView.clicked.connect(self.treefunction1)
86
87 #-----------------------------------BARRA DE MENU-------------------------------------------------#
88
89 #----------------------------------- MENU_PROJECT--------------------------------------------------#
90
91 @pyqtSignature("")
92 def on_menuFileAbrirObj_triggered(self):
93 """
94 Abre un archivo de configuracion seleccionado, lee los parametros y
95 actualiza los atributos de esta clase; creando los objetos necesarios
96 con los parametros leidos desde el archivo.
97 """
98 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
99
100 @pyqtSignature("")
101 def on_menuFileCrearObj_triggered(self):
102 """
103 Crea un proyecto nuevo y lo anade a mi diccionario de proyectos
104 y habilita la ventana de configuracion del proyecto.
105
106 """
107 self.addProject()
108
109 @pyqtSignature("")
110 def on_menuFileGuardarObj_triggered(self):
111 """
112 METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO
113
114 Llama al metodo saveProject.
115 """
116 # my_id = arbol_selected()
117 # filename = savefindow.show()
118 # self.saveProject(id, filename)
119 print "probsave"
120 self.saveProject()
121
122 @pyqtSignature("")
123 def on_menuFileCerrarObj_triggered(self):
124 """
125 METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR
126 Llama al metodo close.
127 """
128 self.close()
129
130 #-----------------------------------MENU_RUN----------------------------------------------------#
131
132 @pyqtSignature("")
133 def on_menuRUNStartObj_clicked(self):
134 """
135 METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN
136 Llama al metodo RUN.
137 """
138 print "Not implemented yet"
139
140 @pyqtSignature("")
141 def on_menuRUNPausaObj_clicked(self):
142 """
143 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
144 Llama al metodo PAUSA.
145 """
146 print "Not implemented yet"
147
148 #-----------------------------------MENU_OPTION-------------------------------------------------#
149
150 @pyqtSignature("")
151 def on_menuOptConfigLogfileObj_clicked(self):
152 """
153 METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog
154 Llama al metodo close.
155 """
156 print "Not implemented yet"
157
158 @pyqtSignature("")
159 def on_menuOptConfigserverObj_clicked(self):
160 """
161 METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server
162 Llama al metodo close.
163 """
164 print "Not implemented yet"
165 #-----------------------------------MENU_HELP-------------------------------------------------------#
166
167 @pyqtSignature("")
168 def on_menuHELPAboutObj_clicked(self):
169 """
170 METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP
171 Llama al metodo close.
172 """
173 print "Not implemented yet"
174
175 @pyqtSignature("")
176 def on_menuHELPPrfObj_clicked(self):
177 """
178 METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp
179 Llama al metodo close.
180 """
181 print "Not implemented yet"
182
183 #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------#
184
185 @pyqtSignature("")
186 def on_actOpenObj_triggered(self):
187 """
188 METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR
189 """
190 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
191
192 @pyqtSignature("")
193 def on_actCreateObj_triggered(self):
194 """
195 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
196 Llama al metodo addProject.
197 """
198 self.addProject()
199
200 @pyqtSignature("")
201 def on_actStopObj_triggered(self):
202 """
203 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
204 Llama al metodo PAUSA.
205 """
206 print "Not implemented yet"
207
208 @pyqtSignature("")
209 def on_actPlayObj_triggered(self):
210 """
211 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
212 Llama al metodo PAUSA.
213 """
214 print "Not implemented yet"
215
216 @pyqtSignature("")
217 def on_actSaveObj_triggered(self):
218 """
219 METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE
220 Llama al metodo SAVE.
221 """
222 self.saveProject()
223
224 #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------#
225
226 @pyqtSignature("")
227 def on_addprojectBtn_clicked(self):
228 """
229 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
230 Llama al metodo addProject.
231 """
232 self.addProject()
233
234 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
235
236 @pyqtSignature("int")
237 def on_dataTypeCmbBox_activated(self,index):
238 """
239 Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA
240 """
241 self.dataFormatTxt.setReadOnly(True)
242 if index==0:
243 self.datatype='Voltage'
244 elif index==1:
245 self.datatype='Spectra'
246 else :
247 self.datatype=''
248 self.dataFormatTxt.setReadOnly(False)
249 self.dataFormatTxt.setText(self.datatype)
250
251 @pyqtSignature("")
252 def on_dataPathBrowse_clicked(self):
253 """
254 OBTENCION DE LA RUTA DE DATOS
255 """
256 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
257 self.dataPathTxt.setText(self.dataPath)
258 self.statusDpath=self.existDir(self.dataPath)
259 self.loadDays()
260
261 @pyqtSignature("int")
262 def on_starDateCmbBox_activated(self, index):
263 """
264 SELECCION DEL RANGO DE FECHAS -START DATE
265 """
266 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
267 self.endDateCmbBox.clear()
268 for i in self.variableList[index:]:
269 self.endDateCmbBox.addItem(i)
270 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
271 self.getsubList()
272
273 @pyqtSignature("int")
274 def on_endDateCmbBox_activated(self, index):
275 """
276 SELECCION DEL RANGO DE FECHAS-END DATE
277 """
278 var_StartDay_index=self.starDateCmbBox.currentIndex()
279 var_end_index = self.endDateCmbBox.count() - index
280 self.starDateCmbBox.clear()
281 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
282 self.starDateCmbBox.addItem(i)
283 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
284 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
285
286 @pyqtSignature("int")
287 def on_readModeCmBox_activated(self, p0):
288 """
289 SELECCION DEL MODO DE LECTURA ON=1, OFF=0
290 """
291 if p0==0:
292 self.online=0
293 elif p0==1:
294 self.online=1
295
296 #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------#
297
298 @pyqtSignature("")
299 def on_dataOkBtn_clicked(self):
300 """
301 Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml.
302 Prepara la configuración del diágrama del Arbol del treeView numero 2
303 """
304 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
305
306 for i in self.__arbolDict:
307 if self.__arbolDict[i]==self.indexclick:
308 self.projectObj=self.__projObjDict[int(i)]
309 # print self.projectObj
310 # print i
311 # print "get",self.__arbolDict.items()
312 # print "keys",self.__arbolDict.keys()
313 self.description="Think"
314 id=i
315 name=str(self.nameProjectTxt.text())
316 desc=str(self.description)
317
318 self.projectObj.setup(id = id, name=name, description=desc)
319 print self.projectObj.id
320 # print self.projectObj.name
321 # print self.projectObj.description
322
323 datatype=str(self.dataTypeCmbBox.currentText())
324 path=str(self.dataPathTxt.text())
325 online=int(self.online)
326 starDate=str(self.starDateCmbBox.currentText())
327 endDate=str(self.endDateCmbBox.currentText())
328
329
330 self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype,
331 path=path,
332 startDate=starDate,
333 endDate=endDate,
334 startTime='06:10:00',
335 endTime='23:59:59',
336 online=online)
337
338 self.readUnitConfObjList.append(self.readUnitConfObj)
339 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
340
341 self.model_2=treeModel()
342 self.model_2.setParams(name=self.projectObj.name+str(self.projectObj.id),
343 directorio=path,
344 workspace="C:\\WorkspaceGUI",
345 remode=str(self.readModeCmBox.currentText()),
346 dataformat=datatype,
347 date=str(starDate)+"-"+str(endDate),
348 initTime='06:10:00',
349 endTime='23:59:59',
350 timezone="Local" ,
351 Summary="test de prueba")
352 self.model_2.arbol()
353 self.treeView_2.setModel(self.model_2)
354 self.treeView_2.expandAll()
355
356 #
357 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
358 @pyqtSignature("")
359 def on_addUnitProces_clicked(self):
360 """
361 CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO
362 Llama al metodo addUP.
363 """
364 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
365 self.addUP()
366
367 #----------------------------BASICO-----------------------------------#
368
369 def getNumberofProject(self):
370 # for i in self.proObjList:
371 # print i
372 return self.proObjList
373 # for i in self.proObjList:
374 # print i
375
376 def setParam(self):
377
378 self.tabWidgetProject.setEnabled(False)
379 self.dataPathTxt.setText('C:\data')
380 self.nameProjectTxt.setText("Test")
381 self.numberChannelopVol.setEnabled(False)
382 self.lineHeighProfileTxtopVol.setEnabled(False)
383 self.numberIntegration.setEnabled(False)
384 self.valuenFFTPointOpSpec.setEnabled(False)
385 self.lineProfileSelecopVolCEB.setEnabled(False)
386
387 def clickFunctiontree(self,index):
388 self.indexclick= index.model().itemFromIndex(index)
389 print self.indexclick
390 return self.indexclick
391 # self.indexclick= index.model().itemFromIndex(index).text()
392 # return self.indexclick
393 # print self.indexclick()
394 # print index.model().itemFromIndex(index)
395 # print self.indexclick
396 # NumofPro=self.indexclick[8:10]
397 # self.valuep=NumofPro
398 # #print self.valuep
399 # NameofPro=self.indexclick[0:7]
400 # self.namepTree=NameofPro
401 # print self.namepTree
402
403 def addProject(self):
404 self.tabWidgetProject.setEnabled(True)
405 print "En este nivel se debe crear el proyecto,id,nombre,desc"
406 #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++#
407
408 self.idp += 1
409 self.projectObj = Project()
410 print self.projectObj
411 self.__projObjDict[self.idp] = self.projectObj
412
413 #++++++++++++++++++Creación del Arbol++++++++++++++++++++#
414 self.parentItem = self.model.invisibleRootItem()
415 name=str(self.nameProjectTxt.text())
416 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp))
417 print self.__arbolDict[self.idp]
418 self.parentItem.appendRow(self.__arbolDict[self.idp])
419 self.parentItem=self.__arbolDict[self.idp]
420
421 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
422
423 def existDir(self, var_dir):
424 """
425 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
426 VARIABLE DIRECCION
427 """
428 if os.path.isdir(var_dir):
429 return True
430 else:
431 self.textEdit.append("Incorrect path:" + str(var_dir))
432 return False
433
434 def loadDays(self):
435 """
436 METODO PARA CARGAR LOS DIAS
437 """
438 self.variableList=[]
439 self.starDateCmbBox.clear()
440 self.endDateCmbBox.clear()
441
442 Dirlist = os.listdir(self.dataPath)
443 Dirlist.sort()
444
445 for a in range(0, len(Dirlist)):
446 fname= Dirlist[a]
447 Doy=fname[5:8]
448 fname = fname[1:5]
449 print fname
450 fecha=Doy2Date(int(fname),int(Doy))
451 fechaList=fecha.change2date()
452 #print fechaList[0]
453 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
454 #+"-"+ fechaList[0]+"-"+fechaList[1]
455
456 #---------------AQUI TIENE QUE SER MODIFICADO--------#
457
458 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
459 for i in range(0, (len(Dirlist))):
460 self.variableList.append(Dirlist[i])
461
462 for i in self.variableList:
463 self.starDateCmbBox.addItem(i)
464 self.endDateCmbBox.addItem(i)
465 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
466
467 self.getsubList()
468 self.dataOkBtn.setEnabled(True)
469
470 def getsubList(self):
471 """
472 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
473 """
474 self.subList=[]
475 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
476 self.subList.append(i)
477
478 def addUP(self):
479
480 self.configUP=UnitProcess(self)
481 for i in self.__arbolDict:
482 if self.__arbolDict[i]==self.indexclick:
483 if self.__projObjDict.has_key(i)==True:
484 self.projectObj=self.__projObjDict[int(i)]
485 print self.projectObj.id
486 self.configUP.getfromWindowList.append(self.projectObj)
487
488
489 for i in self.projectObj.procUnitConfObjDict:
490 if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
491 self.upObj=self.projectObj.procUnitConfObjDict[i]
492 self.configUP.getfromWindowList.append(self.upObj)
493
494
495
496 self.configUP.loadTotalList()
497 self.configUP.show()
498 #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
499 self.configUP.closed.connect(self.createUP)
500
501
502
503 def createUP(self):
504
505 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
506
507 if not self.configUP.create:
508 return
509
510 self.uporProObjRecover=self.configUP.getFromWindow
511
512 self.upType = self.configUP.typeofUP
513 for i in self.__arbolDict:
514 if self.__arbolDict[i]==self.indexclick:
515 self.projectObj=self.__projObjDict[int(i)]
516
517 datatype=str(self.upType)
518 uporprojectObj=self.uporProObjRecover
519
520 if uporprojectObj.getElementName()=='ProcUnit':
521 inputId=uporprojectObj.getId()
522 else:
523 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
524
525 print 'uporprojectObj.id','inputId', uporprojectObj.id,inputId
526 self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId)
527 self.__upObjDict[inputId]= self.procUnitConfObj1
528
529 self.parentItem=self.__arbolDict[uporprojectObj.id]
530 #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i]
531 self.numbertree=int(self.procUnitConfObj1.getId())-1
532 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
533 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
534 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
535 # self.loadUp()
536 self.treeView.expandAll()
537
538 def resetopVolt(self):
539 self.selecChannelopVolCEB.setChecked(False)
540 self.selecHeighopVolCEB.setChecked(False)
541 self.coherentIntegrationCEB.setChecked(False)
542 self.profileSelecopVolCEB.setChecked(False)
543 #self.selecChannelopVolCEB.setEnabled(False)
544 self.lineHeighProfileTxtopVol.clear()
545 self.lineProfileSelecopVolCEB.clear()
546 self.numberChannelopVol.clear()
547 self.numberIntegration.clear()
548
549
550 def resetopSpec(self):
551 self.nFFTPointOpSpecCEB.setChecked(False)
552
553 self.valuenFFTPointOpSpec.clear()
554
555 def resetgraphSpec(self):
556 self.SpectraPlotGraphCEB.setChecked(False)
557 self.CrossSpectraPlotGraphceb.setChecked(False)
558 self.RTIPlotGraphCEB.setChecked(False)
559
560
561 def saveProject(self):
562 print "entro"
563 #filename="C:\WorkspaceGUI\config1.xml"
564 for i in self.__arbolDict:
565 if self.__arbolDict[i]==self.indexclick:
566 self.projectObj=self.__projObjDict[int(i)]
567 print "Encontre project"
568 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
569 print "Escribo Project"
570 self.projectObj.writeXml(filename)
571
572
573 class UnitProcess(QMainWindow, Ui_UnitProcess):
574 """
575 Class documentation goes here.
576 """
577 closed=pyqtSignal()
578 create= False
579 def __init__(self, parent = None):
580 """
581 Constructor
582 """
583 QMainWindow.__init__(self, parent)
584 self.setupUi(self)
585 self.getFromWindow=None
586 self.getfromWindowList=[]
587
588 self.listUP=None
589
590 @pyqtSignature("")
591 def on_unitPokbut_clicked(self):
592 """
593 Slot documentation goes here.
594 """
595 self.create =True
596 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
597 #self.nameofUP= str(self.nameUptxt.text())
598 self.typeofUP= str(self.comboTypeBox.currentText())
599 self.close()
600
601
602 @pyqtSignature("")
603 def on_unitPcancelbut_clicked(self):
604 """
605 Slot documentation goes here.
606 """
607 # TODO: not implemented yet
608 #raise NotImplementedError
609 self.create=False
610 self.close()
611
612 def loadTotalList(self):
613 self.comboInputBox.clear()
614 for i in self.getfromWindowList:
615
616 name=i.getElementName()
617 if name=='Project':
618 id= i.id
619 if name=='ProcUnit':
620 id=int(i.id)-1
621 self.comboInputBox.addItem(str(name)+str(id))
622
623 def closeEvent(self, event):
624 self.closed.emit()
625 event.accept()
626
627
628
629
630
631
632 No newline at end of file
@@ -1,303 +0,0
1 # -*- coding: utf-8 -*-
2 from PyQt4 import QtCore
3 import itertools
4
5 HORIZONTAL_HEADERS = ("Property","Value " )
6
7 HORIZONTAL = ("RAMA :",)
8
9 class treeModel(QtCore.QAbstractItemModel):
10 '''
11 a model to display a few names, ordered by encabezado
12
13 '''
14 def __init__(self ,parent=None):
15 super(treeModel, self).__init__(parent)
16 self.people = []
17 self.initProjectProperties()
18 self.initPUVoltageProperties()
19 self.initPUSpectraProperties()
20 self.initPUSpectraHeisProperties()
21
22 def initProjectProperties(self):
23
24 name=None
25 directorio=None
26 workspace=None
27 remode=None
28 dataformat=None
29 startDate=None
30 endDate=None
31 startTime=None
32 endTime=None
33 delay=None
34 set= None
35 walk=None
36 timezone=None
37 Summary=None
38 description=None
39
40 def initPUVoltageProperties(self):
41 type=None
42 channel=None
43 heights=None
44 filter=None
45 profile=None
46 code=None
47 mode=None
48 coherentintegration=None
49
50 def initPUSpectraProperties(self):
51 type =None
52 nFFTpoints =None
53 ippFactor = None
54 pairsList =None
55 channel =None
56 heights =None
57 incoherentintegration =None
58 removeDC = None
59 removeInterference =None
60 getNoise = None
61 operationSpecPlot=None
62 operationCrossSpecPlot = None
63 operationRTIPlot = None
64 operationCohermap = None
65 operationPowProfilePlot = None
66
67 def initPUSpectraHeisProperties(self):
68 type =None
69 incoherentintegration =None
70 operationSpecHeisPlot=None
71 operationRTIHeisPlot = None
72
73 def initProjectView(self):
74 """
75 Reemplazo del método showtree
76 """
77 HORIZONTAL_HEADERS = ("Property","Value " )
78 HORIZONTAL = ("RAMA :",)
79 self.rootItem = TreeItem(None, "ALL", None)
80 self.parents = {0 : self.rootItem}
81 self.setupModelData()
82
83 def initPUVoltageView(self):
84 HORIZONTAL_HEADERS = ("Operation"," Parameter Value " )
85 HORIZONTAL = ("RAMA :",)
86 self.rootItem = TreeItem(None, "ALL", None)
87 self.parents = {0 : self.rootItem}
88 self.setupModelData()
89
90 def showProjectParms(self,caracteristicaList,principalList,descripcionList):
91 """
92 set2Obje
93 """
94 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
95 person = person_class(caracteristica, principal, descripcion)
96 self.people.append(person)
97 self.rootItem = TreeItem(None, "ALL", None)
98 self.parents = {0 : self.rootItem}
99 self.setupModelData()
100
101 def showPUVoltageParms(self,caracteristicaList,principalList,descripcionList):
102
103 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
104 person = person_class(caracteristica, principal, descripcion)
105 self.people.append(person)
106 self.rootItem = TreeItem(None, "ALL", None)
107 self.parents = {0 : self.rootItem}
108 self.setupModelData()
109
110
111 def showPUSpectraParms(self,caracteristicaList,principalList,descripcionList):
112
113 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
114 person = person_class(caracteristica, principal, descripcion)
115 self.people.append(person)
116 self.rootItem = TreeItem(None, "ALL", None)
117 self.parents = {0 : self.rootItem}
118 self.setupModelData()
119
120 def showPUSpectraHeisParms(self,caracteristicaList,principalList,descripcionList):
121
122 for caracteristica,principal, descripcion in itertools.izip(caracteristicaList,principalList,descripcionList):
123 person = person_class(caracteristica, principal, descripcion)
124 self.people.append(person)
125 self.rootItem = TreeItem(None, "ALL", None)
126 self.parents = {0 : self.rootItem}
127 self.setupModelData()
128
129
130 def columnCount(self, parent=None):
131 if parent and parent.isValid():
132 return parent.internalPointer().columnCount()
133 else:
134 return len(HORIZONTAL_HEADERS)
135
136 def data(self, index, role):
137 if not index.isValid():
138 return QtCore.QVariant()
139
140 item = index.internalPointer()
141 if role == QtCore.Qt.DisplayRole:
142 return item.data(index.column())
143 if role == QtCore.Qt.UserRole:
144 if item:
145 return item.person
146
147 return QtCore.QVariant()
148
149 def headerData(self, column, orientation, role):
150 if (orientation == QtCore.Qt.Horizontal and
151 role == QtCore.Qt.DisplayRole):
152 try:
153 return QtCore.QVariant(HORIZONTAL_HEADERS[column])
154 except IndexError:
155 pass
156
157 return QtCore.QVariant()
158
159 def index(self, row, column, parent):
160 if not self.hasIndex(row, column, parent):
161 return QtCore.QModelIndex()
162
163 if not parent.isValid():
164 parentItem = self.rootItem
165 else:
166 parentItem = parent.internalPointer()
167
168 childItem = parentItem.child(row)
169 if childItem:
170 return self.createIndex(row, column, childItem)
171 else:
172 return QtCore.QModelIndex()
173
174 def parent(self, index):
175 if not index.isValid():
176 return QtCore.QModelIndex()
177
178 childItem = index.internalPointer()
179 if not childItem:
180 return QtCore.QModelIndex()
181
182 parentItem = childItem.parent()
183
184 if parentItem == self.rootItem:
185 return QtCore.QModelIndex()
186
187 return self.createIndex(parentItem.row(), 0, parentItem)
188
189 def rowCount(self, parent=QtCore.QModelIndex()):
190 if parent.column() > 0:
191 return 0
192 if not parent.isValid():
193 p_Item = self.rootItem
194 else:
195 p_Item = parent.internalPointer()
196 return p_Item.childCount()
197
198 def setupModelData(self):
199 for person in self.people:
200 if person.descripcion:
201 encabezado = person.caracteristica
202
203
204 if not self.parents.has_key(encabezado):
205 newparent = TreeItem(None, encabezado, self.rootItem)
206 self.rootItem.appendChild(newparent)
207
208 self.parents[encabezado] = newparent
209
210 parentItem = self.parents[encabezado]
211 newItem = TreeItem(person, "", parentItem)
212 parentItem.appendChild(newItem)
213
214 def searchModel(self, person):
215 '''
216 get the modelIndex for a given appointment
217 '''
218 def searchNode(node):
219 '''
220 a function called recursively, looking at all nodes beneath node
221 '''
222 for child in node.childItems:
223 if person == child.person:
224 index = self.createIndex(child.row(), 0, child)
225 return index
226
227 if child.childCount() > 0:
228 result = searchNode(child)
229 if result:
230 return result
231
232 retarg = searchNode(self.parents[0])
233 #print retarg
234 return retarg
235
236 def find_GivenName(self, principal):
237 app = None
238 for person in self.people:
239 if person.principal == principal:
240 app = person
241 break
242 if app != None:
243 index = self.searchModel(app)
244 return (True, index)
245 return (False, None)
246
247
248 class person_class(object):
249 '''
250 a trivial custom data object
251 '''
252 def __init__(self, caracteristica, principal, descripcion):
253 self.caracteristica = caracteristica
254 self.principal = principal
255 self.descripcion = descripcion
256
257 def __repr__(self):
258 return "PERSON - %s %s"% (self.principal, self.caracteristica)
259
260 class TreeItem(object):
261 '''
262 a python object used to return row/column data, and keep note of
263 it's parents and/or children
264 '''
265 def __init__(self, person, header, parentItem):
266 self.person = person
267 self.parentItem = parentItem
268 self.header = header
269 self.childItems = []
270
271 def appendChild(self, item):
272 self.childItems.append(item)
273
274 def child(self, row):
275 return self.childItems[row]
276
277 def childCount(self):
278 return len(self.childItems)
279
280 def columnCount(self):
281 return 2
282
283 def data(self, column):
284 if self.person == None:
285 if column == 0:
286 return QtCore.QVariant(self.header)
287 if column == 1:
288 return QtCore.QVariant("")
289 else:
290 if column == 0:
291 return QtCore.QVariant(self.person.principal)
292 if column == 1:
293 return QtCore.QVariant(self.person.descripcion)
294 return QtCore.QVariant()
295
296 def parent(self):
297 return self.parentItem
298
299 def row(self):
300 if self.parentItem:
301 return self.parentItem.childItems.index(self)
302 return 0
303 No newline at end of file
@@ -1,38 +0,0
1 import os, sys
2 import getopt
3
4 from schainpy.controller import Project
5
6 class scProcessController():
7 def __init__(self):
8 print "ESTOY EJECUTANDO EL NUEVO PROCESO PERO APARENTEMENTE NO QUIERE"
9 self.setfilename()
10 self.operation()
11
12 def setfilename(self):
13 arglist= ''
14 longarglist=['filename=']
15 optlist,args=getopt.getopt(sys.argv[1:],arglist,longarglist)
16 for opt in optlist:
17 if opt[0]== '--filename':
18 self.filename = opt[1]
19
20 def operation(self):
21 print 'inicia operation'
22 controllerObj = Project()
23 print "Leyendo el archivo XML"
24 #self.filename="C://Users//alex//schain_workspace//Alexander1.xml"
25 controllerObj.readXml(self.filename)
26 #controllerObj.printattr()
27
28 controllerObj.createObjects()
29 controllerObj.connectObjects()
30 controllerObj.run()
31
32
33 def main():
34 a=scProcessController()
35
36
37 if __name__ == "__main__":
38 main() No newline at end of file
@@ -1,427 +0,0
1 """
2 The TIME_CONVERSIONS.py module gathers classes and functions for time system transformations
3 (e.g. between seconds from 1970 to datetime format).
4
5 MODULES CALLED:
6 NUMPY, TIME, DATETIME, CALENDAR
7
8 MODIFICATION HISTORY:
9 Created by Ing. Freddy Galindo (frederickgalindo@gmail.com). ROJ Aug 13, 2009.
10 """
11
12 import numpy as np
13 import time as tm
14 import datetime as dt
15 import calendar as cr
16
17 class Time:
18 """
19 time(year,month,dom,hour,min,secs)
20
21 An object represents a date and time of certain event..
22
23 Parameters
24 ----------
25 YEAR = Number of the desired year. Year must be valid values from the civil calendar.
26 Years B.C.E must be represented as negative integers. Years in the common era are repre-
27 sented as positive integers. In particular, note that there is no year 0 in the civil
28 calendar. 1 B.C.E. (-1) is followed by 1 C.E. (1).
29
30 MONTH = Number of desired month (1=Jan, ..., 12=December).
31
32 DOM = Number of day of the month.
33
34 HOUR = Number of the hour of the day. By default hour=0
35
36 MINS = Number of the minute of the hour. By default min=0
37
38 SECS = Number of the second of the minute. By default secs=0.
39
40 Examples
41 --------
42 time_info = time(2008,9,30,12,30,00)
43
44 time_info = time(2008,9,30)
45 """
46
47 def __init__(self,year=None,month=None,dom=None,hour=0,mins=0,secs=0):
48 # If one the first three inputs are not defined, it takes the current date.
49 date = tm.localtime()
50 if year==None:year=date[0]
51 if month==None:month=date[1]
52 if dom==None:dom=date[2]
53
54 # Converting to arrays
55 year = np.array([year]); month = np.array([month]); dom = np.array([dom])
56 hour = np.array([hour]); mins = np.array([mins]); secs = np.array([secs])
57
58 # Defining time information object.
59 self.year = np.atleast_1d(year)
60 self.month = np.atleast_1d(month)
61 self.dom = np.atleast_1d(dom)
62 self.hour = np.atleast_1d(hour)
63 self.mins = np.atleast_1d(mins)
64 self.secs = np.atleast_1d(secs)
65
66 def change2julday(self):
67 """
68 Converts a datetime to Julian days.
69 """
70
71 # Defining constants
72 greg = 2299171 # incorrect Julian day for Oct, 25, 1582.
73 min_calendar = -4716
74 max_calendar = 5000000
75
76 min_year = np.nanmin(self.year)
77 max_year = np.nanmax(self.year)
78 if (min_year<min_calendar) or (max_year>max_calendar):
79 print "Value of Julian date is out of allowed range"
80 return -1
81
82 noyear = np.sum(self.year==0)
83 if noyear>0:
84 print "There is no year zero in the civil calendar"
85 return -1
86
87 # Knowing if the year is less than 0.
88 bc = self.year<0
89
90 # Knowing if the month is less than March.
91 inJanFeb = self.month<=2
92
93 jy = self.year + bc - inJanFeb
94 jm = self.month + (1 + 12*inJanFeb)
95
96 # Computing Julian days.
97 jul= np.floor(365.25*jy) + np.floor(30.6001*jm) + (self.dom+1720995.0)
98
99 # Test whether to change to Gregorian Calendar
100 if np.min(jul) >= greg:
101 ja = np.int32(0.01*jy)
102 jul = jul + 2 - ja + np.int32(0.25*ja)
103 else:
104 gregchange = np.where(jul >= greg)
105 if gregchange[0].size>0:
106 ja = np.int32(0.01 + jy[gregchange])
107 jy[grechange] = jy[gregchange] + 2 - ja + np.int32(0.25*ja)
108
109 # Determining machine-specific parameters affecting floating-point.
110 eps = 0.0 # Replace this line for a function to get precision.
111 eps = abs(jul)*0.0 > eps
112
113 jul = jul + (self.hour/24. -0.5) + (self.mins/1440.) + (self.secs/86400.) + eps
114
115 return jul[0]
116
117 def change2secs(self):
118 """
119 Converts datetime to number of seconds respect to 1970.
120 """
121
122 year = self.year
123 if year.size>1: year = year[0]
124
125 month = self.month
126 if month.size>1: month = month[0]
127
128 dom = self.dom
129 if dom.size>1: dom = dom[0]
130
131 # Resizing hour, mins and secs if it was necessary.
132 hour = self.hour
133 if hour.size>1:hour = hour[0]
134 if hour.size==1:hour = np.resize(hour,year.size)
135
136 mins = self.mins
137 if mins.size>1:mins = mins[0]
138 if mins.size==1:mins = np.resize(mins,year.size)
139
140 secs = self.secs
141 if secs.size>1:secs = secs[0]
142 if secs.size==1:secs = np.resize(secs,year.size)
143
144 # Using time.mktime to compute seconds respect to 1970.
145 secs1970 = np.zeros(year.size)
146 for ii in np.arange(year.size):
147 secs1970[ii] = tm.mktime((int(year[ii]),int(month[ii]),int(dom[ii]),\
148 int(hour[ii]),int(mins[ii]),int(secs[ii]),0,0,0))
149
150 secs1970 = np.int32(secs1970 - tm.timezone)
151
152 return secs1970
153
154 def change2strdate(self,mode=1):
155 """
156 change2strdate method converts a date and time of certain event to date string. The
157 string format is like localtime (e.g. Fri Oct 9 15:00:19 2009).
158
159 Parameters
160 ----------
161 None.
162
163 Return
164 ------
165
166 Modification History
167 --------------------
168 Created by Freddy R. Galindo, ROJ, 09 October 2009.
169
170 """
171
172 secs = np.atleast_1d(self.change2secs())
173 strdate = []
174 for ii in np.arange(np.size(secs)):
175 secs_tmp = tm.localtime(secs[ii] + tm.timezone)
176 if mode==1:
177 strdate.append(tm.strftime("%d-%b-%Y (%j) %H:%M:%S",secs_tmp))
178 elif mode==2:
179 strdate.append(tm.strftime("%d-%b-%Y (%j)",secs_tmp))
180
181 strdate = np.array(strdate)
182
183 return strdate
184
185
186 class Secs:
187 """
188 secs(secs):
189
190 An object represents the number of seconds respect to 1970.
191
192 Parameters
193 ----------
194
195 SECS = A scalar or array giving the number of seconds respect to 1970.
196
197 Example:
198 --------
199 secs_info = secs(1251241373)
200
201 secs_info = secs([1251241373,1251241383,1251241393])
202 """
203 def __init__(self,secs):
204 self.secs = secs
205
206 def change2julday(self):
207 """
208 Convert seconds from 1970 to Julian days.
209 """
210
211 secs_1970 = time(1970,1,1,0,0,0).change2julday()
212
213 julian = self.secs/86400.0 + secs_1970
214
215 return julian
216
217 def change2time(self):
218 """
219 Converts seconds from 1970 to datetime.
220 """
221
222 secs1970 = np.atleast_1d(self.secs)
223
224 datetime = np.zeros((9,secs1970.size))
225 for ii in np.arange(secs1970.size):
226 tuple = tm.gmtime(secs1970[ii])
227 datetime[0,ii] = tuple[0]
228 datetime[1,ii] = tuple[1]
229 datetime[2,ii] = tuple[2]
230 datetime[3,ii] = tuple[3]
231 datetime[4,ii] = tuple[4]
232 datetime[5,ii] = tuple[5]
233 datetime[6,ii] = tuple[6]
234 datetime[7,ii] = tuple[7]
235 datetime[8,ii] = tuple[8]
236
237 datetime = np.int32(datetime)
238
239 return datetime
240
241
242 class Julian:
243 """
244 julian(julian):
245
246 An object represents julian days.
247
248 Parameters
249 ----------
250
251 JULIAN = A scalar or array giving the julina days.
252
253 Example:
254 --------
255 julian_info = julian(2454740)
256
257 julian_info = julian([2454740,2454760,2454780])
258 """
259 def __init__(self,julian):
260 self.julian = np.atleast_1d(julian)
261
262 def change2time(self):
263 """
264 change2time method converts from julian day to calendar date and time.
265
266 Return
267 ------
268 year = An array giving the year of the desired julian day.
269 month = An array giving the month of the desired julian day.
270 dom = An array giving the day of the desired julian day.
271 hour = An array giving the hour of the desired julian day.
272 mins = An array giving the minute of the desired julian day.
273 secs = An array giving the second of the desired julian day.
274
275 Examples
276 --------
277 >> jd = 2455119.0
278 >> [yy,mo,dd,hh,mi,ss] = TimeTools.julian(jd).change2time()
279 >> print [yy,mo,dd,hh,mi,ss]
280 [2009] [10] [ 14.] [ 12.] [ 0.] [ 0.]
281
282 Modification history
283 --------------------
284 Translated from "Numerical Recipies in C", by William H. Press, Brian P. Flannery,
285 Saul A. Teukolsky, and William T. Vetterling. Cambridge University Press, 1988.
286 Converted to Python by Freddy R. Galindo, ROJ, 06 October 2009.
287 """
288
289 min_julian = -1095
290 max_julian = 1827933925
291 if (np.min(self.julian) < min_julian) or (np.max(self.julian) > max_julian):
292 print 'Value of Julian date is out of allowed range.'
293 return None
294
295 # Beginning of Gregorian calendar
296 igreg = 2299161
297 julLong = np.floor(self.julian + 0.5)
298 minJul = np.min(julLong)
299
300 if (minJul >= igreg):
301 # All are Gregorian
302 jalpha = np.int32(((julLong - 1867216) - 0.25)/36524.25)
303 ja = julLong + 1 + jalpha - np.int32(0.25*jalpha)
304 else:
305 ja = julLong
306 gregChange = np.where(julLong >= igreg)
307 if gregChange[0].size>0:
308 jalpha = np.int32(((julLong[gregChange]-1867216) - 0.25)/36524.25)
309 ja[gregChange] = julLong[gregChange]+1+jalpha-np.int32(0.25*jalpha)
310
311 # clear memory.
312 jalpha = -1
313
314 jb = ja + 1524
315 jc = np.int32(6680. + ((jb-2439870)-122.1)/365.25)
316 jd = np.int32(365.*jc + (0.25*jc))
317 je = np.int32((jb - jd)/30.6001)
318
319 dom = jb - jd - np.int32(30.6001*je)
320 month = je - 1
321 month = ((month - 1) % 12) + 1
322 month = np.atleast_1d(month)
323 year = jc - 4715
324 year = year - (month > 2)*1
325 year = year - (year <= 0)*1
326 year = np.atleast_1d(year)
327
328 # Getting hours, minutes, seconds
329 fraction = self.julian + 0.5 - julLong
330 eps_0 = dom*0.0 + 1.0e-12
331 eps_1 = 1.0e-12*np.abs(julLong)
332 eps = (eps_0>eps_1)*eps_0 + (eps_0<=eps_1)*eps_1
333
334 hour_0 = dom*0 + 23
335 hour_2 = dom*0 + 0
336 hour_1 = np.floor(fraction*24.0 + eps)
337 hour = ((hour_1>hour_0)*23) + ((hour_1<=hour_0)*hour_1)
338 hour = ((hour_1<hour_2)*0) + ((hour_1>=hour_2)*hour_1)
339
340 fraction = fraction - (hour/24.0)
341 mins_0 = dom*0 + 59
342 mins_2 = dom*0 + 0
343 mins_1 = np.floor(fraction*1440.0 + eps)
344 mins = ((mins_1>mins_0)*59) + ((mins_1<=mins_0)*mins_1)
345 mins = ((mins_1<mins_2)*0) + ((mins_1>=mins_2)*mins_1)
346
347 secs_2 = dom*0 + 0
348 secs_1 = (fraction - mins/1440.0)*86400.0
349 secs = ((secs_1<secs_2)*0) + ((secs_1>=secs_2)*secs_1)
350
351 return year, month,dom, hour, mins, secs
352
353 def change2secs(self):
354 """
355 Converts from Julian days to seconds from 1970.
356 """
357
358 jul_1970 = Time(1970,1,1,0,0,0).change2julday()
359
360 secs = np.int32((self.julian - jul_1970)*86400)
361
362 return secs
363
364 def change2lst(self,longitude=-76.8667):
365 """
366 CT2LST converts from local civil time to local mean sideral time
367
368 longitude = The longitude in degrees (east of Greenwich) of the place for which
369 the local sideral time is desired, scalar. The Greenwich mean sideral time (GMST)
370 can be found by setting longitude=0.
371 """
372
373 # Useful constants, see Meus, p. 84
374 c = np.array([280.46061837, 360.98564736629, 0.000387933, 38710000.0])
375 jd2000 = 2451545.0
376 t0 = self.julian - jd2000
377 t = t0/36525.
378
379 # Computing GST in seconds
380 theta = c[0] + (c[1]*t0) + (t**2)*(c[2]-t/c[3])
381
382 # Computing LST in hours
383 lst = (theta + longitude)/15.0
384 neg = np.where(lst < 0.0)
385 if neg[0].size>0:lst[neg] = 24.0 + (lst[neg] % 24)
386 lst = lst % 24.0
387
388 return lst
389
390
391 class date2doy:
392 def __init__(self,year,month,day):
393 self.year = year
394 self.month = month
395 self.day = day
396
397 def change2doy(self):
398 if cr.isleap(self.year) == True:
399 tfactor = 1
400 else:
401 tfactor = 2
402
403 day = self.day
404 month = self.month
405
406 doy = np.floor((275*month)/9.0) - (tfactor*np.floor((month+9)/12.0)) + day - 30
407
408 return np.int32(doy)
409
410
411 class Doy2Date:
412 def __init__(self,year,doy):
413 self.year = year
414 self.doy = doy
415
416 def change2date(self):
417 months = np.arange(12) + 1
418
419 first_dem = date2doy(self.year,months,1)
420 first_dem = first_dem.change2doy()
421
422 imm = np.where((self.doy - first_dem) > 0)
423
424 month = imm[0].size
425 dom = self.doy -first_dem[month - 1] + 1
426
427 return month, dom
@@ -1,58 +0,0
1 # -*- coding: utf-8 -*-
2
3 """
4 Module implementing MainWindow.
5 """
6
7 from PyQt4.QtGui import QMainWindow
8 from PyQt4.QtCore import pyqtSignature
9
10 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
11
12 class UnitProcess(QMainWindow, Ui_UnitProcess):
13 """
14 Class documentation goes here.
15 """
16
17 def __init__(self, parent = None):
18 """
19 Constructor
20 """
21 QMainWindow.__init__(self, parent)
22 self.setupUi(self)
23
24
25 @pyqtSignature("QString")
26 def on_comboInputBox_activated(self, p0):
27 """
28 Slot documentation goes here.
29 """
30 # TODO: not implemented yet
31 raise NotImplementedError
32
33 @pyqtSignature("QString")
34 def on_comboTypeBox_activated(self, p0):
35 """
36 Slot documentation goes here.
37 """
38 # TODO: not implemented yet
39 raise NotImplementedError
40
41
42 @pyqtSignature("")
43 def on_unitPokbut_clicked(self):
44 """
45 Slot documentation goes here.
46 """
47 # TODO: not implemented yet
48 #raise NotImplementedError
49 print "this is suspiscious"
50 print "njdasjdajj"
51
52 @pyqtSignature("")
53 def on_unitPcancelbut_clicked(self):
54 """
55 Slot documentation goes here.
56 """
57 # TODO: not implemented yet
58 raise NotImplementedError
This diff has been collapsed as it changes many lines, (807 lines changed) Show them Hide them
@@ -1,807 +0,0
1 # -*- coding: utf-8 -*-
2 """
3 Module implementing MainWindow.
4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
5 """
6 from PyQt4.QtGui import QMainWindow
7 from PyQt4.QtCore import pyqtSignature
8 from PyQt4.QtCore import pyqtSignal
9 from PyQt4 import QtCore
10 from PyQt4 import QtGui
11 from timeconversions import Doy2Date
12 from modelProperties import treeModel
13 from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess
14 from schainpy.gui.viewer.ui_window import Ui_window
15 from schainpy.gui.viewer.ui_mainwindow import Ui_MainWindow
16 from schainpy.gui.viewer.ui_workspace import Ui_Workspace
17 from schainpy.gui.viewer.ui_initwindow import Ui_InitWindow
18
19 from schainpy.controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
20 import os
21
22 HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " )
23
24 HORIZONTAL = ("RAMA :",)
25
26 class MainWindow(QMainWindow, Ui_MainWindow):
27
28 nop=None
29
30 __projObjDict = {}
31 __arbolDict = {}
32
33 """
34 Class documentation goes here.
35 #*##################VENTANA CUERPO DEL PROGRAMA####################
36 """
37 def __init__(self, parent = None):
38 """
39 Constructor
40 """
41 print "Inicio de Programa Interfaz Gráfica"
42 QMainWindow.__init__(self, parent)
43 self.setupUi(self)
44
45 self.online=0
46 self.datatype=0
47 self.variableList=[]
48
49 self.proObjList=[]
50 self.idp=0
51 self.projectName=0
52 self.description=0
53 self.namepTree=0
54 self.valuep=0
55
56 self.upObjList= []
57 self.upn=0
58 self.upName=0
59 self.upType=0
60 self.uporProObjRecover=0
61
62
63 self.readUnitConfObjList=[]
64
65 self.upObjVolList=[]
66 self.upobjSpecList=[]
67
68
69 self.operObjList=[]
70
71 self.projectWindow=None
72 self.configUP=None
73
74 self.projectObj=None
75 self.readUnitConfObj=None
76 self.procUnitConfObj0=None
77 self.opObj10=None
78 self.opObj12=None
79
80
81 self.setParam()
82
83 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
84 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
85 self.addpBtn.setToolTip('Add_New_Project')
86 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
87
88 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
89 self.model = QtGui.QStandardItemModel()
90 self.treeView.setModel(self.model)
91 self.treeView.clicked.connect(self.clickFunctiontree)
92 self.treeView.expandAll()
93 #self.treeView.clicked.connect(self.treefunction1)
94
95 def getNumberofProject(self):
96 # for i in self.proObjList:
97 # print i
98 return self.proObjList
99 # for i in self.proObjList:
100 # print i
101
102 def setParam(self):
103 self.dataPathTxt.setText('C:\data')
104 self.numberChannelopVol.setEnabled(False)
105 self.lineHeighProfileTxtopVol.setEnabled(False)
106 self.numberIntegration.setEnabled(False)
107 self.valuenFFTPointOpSpec.setEnabled(False)
108 self.lineProfileSelecopVolCEB.setEnabled(False)
109
110
111 def clickFunctiontree(self,index):
112 indexclick= index.model().itemFromIndex(index).text()
113 #print indexclick
114 NumofPro=indexclick[8:10]
115 self.valuep=NumofPro
116 #print self.valuep
117 NameofPro=indexclick[0:7]
118 self.namepTree=NameofPro
119 #print self.namepTree
120
121
122 @pyqtSignature("")
123 def on_addprojectBtn_clicked(self):
124 """
125 Llama al metodo addProject.
126 """
127 print "En este nivel se abre el window"
128
129
130 self.addProject()
131
132 def addProject(self):
133 """
134 Muestra una
135 """
136
137 self.projectWindow = ProjectWindow(self)
138 self.projectWindow.show()
139
140 #Al cerrar la venta de proyecto se ejecutara el metodo createProject
141 self.projectWindow.closed.connect(self.createProject)
142
143 def createProject(self):
144 """
145 Crea un nuevo proyecto del tipo Controller.Project() y lo adiciona al diccionario
146 self.__projectDict.
147 """
148
149 if not self.projectWindow.create:
150 return
151
152 self.projectName = self.projectWindow.name
153 self.description = self.projectWindow.description
154
155 print "En este nivel se debe crear el proyecto,id,nombre,desc"
156 #+++++Creacion del Objeto Controller-XML++++++++++#
157 self.idp += 1
158 self.projectObj = Project()
159
160 id=int(self.idp)
161 name=str(self.projectName)
162 desc=str(self.description)
163
164 self.projectObj.setup(id = id, name=name, description=desc)
165 self.__projObjDict[id] = self.projectObj
166 self.proObjList.append(self.projectObj)
167
168 self.parentItem = self.model.invisibleRootItem()
169 self.__arbolDict[id] = QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp))
170
171 self.parentItem.appendRow(self.__arbolDict[projectObj.id])
172
173 #+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++#
174
175
176 # self.parentItem=self.projectObj.arbol
177 # self.loadProjects()
178
179 print "Porfavor ingrese los parámetros de configuracion del Proyecto"
180
181 def loadProjects(self):
182 self.proConfCmbBox.clear()
183 for i in self.__projObjDict.values():
184 self.proConfCmbBox.addItem("Project"+str(i.id))
185
186 @pyqtSignature("int")
187 def on_dataTypeCmbBox_activated(self,index):
188 self.dataFormatTxt.setReadOnly(True)
189 if index==0:
190 self.datatype='Voltage'
191 elif index==1:
192 self.datatype='Spectra'
193 else :
194 self.datatype=''
195 self.dataFormatTxt.setReadOnly(False)
196 self.dataFormatTxt.setText(self.datatype)
197
198 def existDir(self, var_dir):
199 """
200 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
201 VARIABLE DIRECCION
202 """
203 if os.path.isdir(var_dir):
204 return True
205 else:
206 self.textEdit.append("Incorrect path:" + str(var_dir))
207 return False
208
209 def loadDays(self):
210 """
211 METODO PARA CARGAR LOS DIAS
212 """
213 self.variableList=[]
214 self.starDateCmbBox.clear()
215 self.endDateCmbBox.clear()
216
217 Dirlist = os.listdir(self.dataPath)
218 Dirlist.sort()
219
220 for a in range(0, len(Dirlist)):
221 fname= Dirlist[a]
222 Doy=fname[5:8]
223 fname = fname[1:5]
224 print fname
225 fecha=Doy2Date(int(fname),int(Doy))
226 fechaList=fecha.change2date()
227 #print fechaList[0]
228 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
229 #+"-"+ fechaList[0]+"-"+fechaList[1]
230
231 #---------------AQUI TIENE QUE SER MODIFICADO--------#
232
233 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
234 for i in range(0, (len(Dirlist))):
235 self.variableList.append(Dirlist[i])
236
237 for i in self.variableList:
238 self.starDateCmbBox.addItem(i)
239 self.endDateCmbBox.addItem(i)
240 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
241
242 self.getsubList()
243 self.dataOkBtn.setEnabled(True)
244
245 def getsubList(self):
246 """
247 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
248 """
249 self.subList=[]
250 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
251 self.subList.append(i)
252
253 @pyqtSignature("")
254 def on_dataPathBrowse_clicked(self):
255 """
256 OBTENCION DE LA RUTA DE DATOS
257 """
258 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
259 self.dataPathTxt.setText(self.dataPath)
260 self.statusDpath=self.existDir(self.dataPath)
261 self.loadDays()
262
263 @pyqtSignature("int")
264 def on_starDateCmbBox_activated(self, index):
265 """
266 SELECCION DEL RANGO DE FECHAS -STAR DATE
267 """
268 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
269 self.endDateCmbBox.clear()
270 for i in self.variableList[index:]:
271 self.endDateCmbBox.addItem(i)
272 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
273 self.getsubList()
274
275 @pyqtSignature("int")
276 def on_endDateCmbBox_activated(self, index):
277 """
278 SELECCION DEL RANGO DE FECHAS-END DATE
279 """
280 var_StartDay_index=self.starDateCmbBox.currentIndex()
281 var_end_index = self.endDateCmbBox.count() - index
282 self.starDateCmbBox.clear()
283 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
284 self.starDateCmbBox.addItem(i)
285 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
286 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
287
288 @pyqtSignature("int")
289 def on_readModeCmBox_activated(self, p0):
290 """
291 Slot documentation goes here.
292 """
293 if p0==0:
294 self.online=0
295 elif p0==1:
296 self.online=1
297
298 @pyqtSignature("")
299 def on_dataOkBtn_clicked(self):
300 """
301 Slot documentation goes here.
302 """
303 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
304
305 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
306 datatype=str(self.dataTypeCmbBox.currentText())
307 path=str(self.dataPathTxt.text())
308 online=int(self.online)
309 starDate=str(self.starDateCmbBox.currentText())
310 endDate=str(self.endDateCmbBox.currentText())
311
312
313 self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype,
314 path=path,
315 startDate=starDate,
316 endDate=endDate,
317 startTime='06:10:00',
318 endTime='23:59:59',
319 online=online)
320
321 self.readUnitConfObjList.append(self.readUnitConfObj)
322
323 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
324
325
326 self.model_2=treeModel()
327
328 self.model_2.setParams(name=projectObj.name+str(projectObj.id),
329 directorio=path,
330 workspace="C:\\WorkspaceGUI",
331 remode=str(self.readModeCmBox.currentText()),
332 dataformat=datatype,
333 date=str(starDate)+"-"+str(endDate),
334 initTime='06:10:00',
335 endTime='23:59:59',
336 timezone="Local" ,
337 Summary="test de prueba")
338 self.model_2.arbol()
339 self.treeView_2.setModel(self.model_2)
340 self.treeView_2.expandAll()
341
342
343 @pyqtSignature("")
344 def on_addUnitProces_clicked(self):
345 """
346 Slot documentation goes here.
347 """
348 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
349 # self.procUnitConfObj0 = self.projectObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId())
350 self.showUp()
351
352 def showUp(self):
353
354 self.configUP=UnitProcess(self)
355 for i in self.proObjList:
356 self.configUP.getfromWindowList.append(i)
357 #print i
358 for i in self.upObjList:
359 self.configUP.getfromWindowList.append(i)
360 self.configUP.loadTotalList()
361 self.configUP.show()
362 self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
363 self.configUP.closed.connect(self.createUP)
364
365 def reciveUPparameters(self):
366
367 self.uporProObjRecover,self.upType=self.configUP.almacena()
368
369
370 def createUP(self):
371 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
372 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
373
374 datatype=str(self.upType)
375 uporprojectObj=self.uporProObjRecover
376 #+++++++++++LET FLY+++++++++++#
377 if uporprojectObj.getElementName()=='ProcUnit':
378 inputId=uporprojectObj.getId()
379 elif uporprojectObj.getElementName()=='Project':
380 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
381
382
383 self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId)
384 self.upObjList.append(self.procUnitConfObj1)
385 print inputId
386 print self.procUnitConfObj1.getId()
387 self.parentItem=uporprojectObj.arbol
388 self.numbertree=int(self.procUnitConfObj1.getId())-1
389 self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
390 self.parentItem.appendRow(self.procUnitConfObj1.arbol)
391 self.parentItem=self.procUnitConfObj1.arbol
392 self.loadUp()
393 self.treeView.expandAll()
394
395 def loadUp(self):
396 self.addOpUpselec.clear()
397 self.addOpSpecUpselec.clear()
398 for i in self.upObjList:
399 if i.datatype=='Voltage':
400 self.upObjVolList.append(i)
401 name=i.getElementName()
402 id=int(i.id)-1
403 self.addOpUpselec.addItem(name+str(id))
404 if i.datatype=='Spectra':
405 self.upobjSpecList.append(i)
406 name=i.getElementName()
407 id=int(i.id)-1
408 self.addOpSpecUpselec.addItem(name+str(id))
409
410 self.resetopVolt()
411 self.resetopSpec()
412
413
414 @pyqtSignature("int")
415 def on_selecChannelopVolCEB_stateChanged(self, p0):
416 """
417 Slot documentation goes here.
418 """
419 if p0==2:
420 self.numberChannelopVol.setEnabled(True)
421 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
422 opObj10=upProcessSelect.addOperation(name='selectChannels')
423 print opObj10.id
424 self.operObjList.append(opObj10)
425 print " Ingresa seleccion de Canales"
426 if p0==0:
427 print " deshabilitado"
428
429 @pyqtSignature("int")
430 def on_selecHeighopVolCEB_stateChanged(self, p0):
431 """
432 Slot documentation goes here.
433 """
434 if p0==2:
435 self.lineHeighProfileTxtopVol.setEnabled(True)
436 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
437 opObj10=upProcessSelect.addOperation(name='selectHeights')
438 print opObj10.id
439 self.operObjList.append(opObj10)
440 print " Select Type of Profile"
441 if p0==0:
442 print " deshabilitado"
443
444
445 @pyqtSignature("int")
446 def on_profileSelecopVolCEB_stateChanged(self, p0):
447 """
448 Slot documentation goes here.
449 """
450 if p0==2:
451 self.lineProfileSelecopVolCEB.setEnabled(True)
452 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
453 opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
454 print opObj10.id
455 self.operObjList.append(opObj10)
456 print " Select Type of Profile"
457 if p0==0:
458 print " deshabilitado"
459
460
461 @pyqtSignature("int")
462 def on_coherentIntegrationCEB_stateChanged(self, p0):
463 """
464 Slot documentation goes here.
465 """
466 if p0==2:
467 self.numberIntegration.setEnabled(True)
468 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
469 opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
470 print opObj10.id
471 self.operObjList.append(opObj10)
472 print "Choose number of Cohint"
473 if p0==0:
474 print " deshabilitado"
475 self.numberChannelopVol.setEnabled(False)
476
477 def resetopVolt(self):
478 self.selecChannelopVolCEB.setChecked(False)
479 self.selecHeighopVolCEB.setChecked(False)
480 self.coherentIntegrationCEB.setChecked(False)
481 self.profileSelecopVolCEB.setChecked(False)
482 #self.selecChannelopVolCEB.setEnabled(False)
483 self.lineHeighProfileTxtopVol.clear()
484 self.lineProfileSelecopVolCEB.clear()
485 self.numberChannelopVol.clear()
486 self.numberIntegration.clear()
487
488
489 @pyqtSignature("")
490 def on_dataopVolOkBtn_clicked(self):
491 """
492 Slot documentation goes here.
493 """
494 if self.selecChannelopVolCEB.isChecked():
495 for i in self.operObjList:
496 if i.name=='selectChannels':
497 value=self.numberChannelopVol.text()
498 i.addParameter(name='channelList', value=value, format='intlist')
499
500
501 print "channel"
502
503 if self.selecHeighopVolCEB.isChecked():
504 for i in self.operObjList:
505 if i.name=='selectHeights' :
506 value=self.lineHeighProfileTxtopVol.text()
507 valueList=value.split(',')
508 i.addParameter(name='minHei', value=valueList[0], format='float')
509 i.addParameter(name='maxHei', value=valueList[1], format='float')
510
511 print "height"
512
513
514 if self.selecHeighopVolCEB.isChecked():
515 for i in self.operObjList:
516 if i.name=='ProfileSelector' :
517 value=self.lineProfileSelecopVolCEB.text()
518 i.addParameter(name='ProfileSelector', value=value, format='intlist')
519
520
521
522 if self.coherentIntegrationCEB.isChecked():
523 for i in self.operObjList:
524 if i.name=='CohInt':
525 value=self.numberIntegration.text()
526 i.addParameter(name='n', value=value, format='int')
527
528
529 @pyqtSignature("int")
530 def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
531 """
532 Slot documentation goes here.
533 """
534 if p0==2:
535 self.valuenFFTPointOpSpec.setEnabled(True)
536 print " nFFTPoint"
537 if p0==0:
538 print " deshabilitado"
539
540
541 def resetopSpec(self):
542 self.nFFTPointOpSpecCEB.setChecked(False)
543
544 self.valuenFFTPointOpSpec.clear()
545
546
547 @pyqtSignature("")
548 def on_dataopSpecOkBtn_clicked(self):
549 """
550 Slot documentation goes here.
551 """
552 print "Añadimos operaciones Spectra,nchannels,value,format"
553 if self.nFFTPointOpSpecCEB.isChecked():
554 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
555 value=self.valuenFFTPointOpSpec.text()
556 upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int')
557
558 @pyqtSignature("int")
559 def on_SpectraPlotGraphCEB_stateChanged(self, p0):
560 """
561 Slot documentation goes here.
562 """
563 if p0==2:
564 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
565 opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other')
566 print opObj10.id
567 self.operObjList.append(opObj10)
568
569 if p0==0:
570 print " deshabilitado"
571
572 @pyqtSignature("int")
573 def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
574 """
575 Slot documentation goes here.
576 """
577 if p0==2:
578 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
579 opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other')
580 print opObj10.id
581 self.operObjList.append(opObj10)
582 if p0==0:
583 print " deshabilitado"
584
585 @pyqtSignature("int")
586 def on_RTIPlotGraphCEB_stateChanged(self, p0):
587 """
588 Slot documentation goes here.
589 """
590 if p0==2:
591 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
592 opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other')
593 print opObj10.id
594 self.operObjList.append(opObj10)
595 if p0==0:
596 print " deshabilitado"
597
598
599 def resetgraphSpec(self):
600 self.SpectraPlotGraphCEB.setChecked(False)
601 self.CrossSpectraPlotGraphceb.setChecked(False)
602 self.RTIPlotGraphCEB.setChecked(False)
603
604 @pyqtSignature("")
605 def on_dataGraphSpecOkBtn_clicked(self):
606 """
607 Slot documentation goes here.
608 """
609 print "Graficar Spec op"
610 if self.SpectraPlotGraphCEB.isChecked():
611 for i in self.operObjList:
612 if i.name=='SpectraPlot':
613 i.addParameter(name='idfigure', value='1', format='int')
614 i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
615 i.addParameter(name='zmin', value='40', format='int')
616 i.addParameter(name='zmax', value='90', format='int')
617 i.addParameter(name='showprofile', value='1', format='int')
618
619 if self.CrossSpectraPlotGraphceb.isChecked():
620 for i in self.operObjList:
621 if i.name=='CrossSpectraPlot' :
622 i.addParameter(name='idfigure', value='2', format='int')
623 i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
624 i.addParameter(name='zmin', value='40', format='int')
625 i.addParameter(name='zmax', value='90', format='int')
626
627 if self.RTIPlotGraphCEB.isChecked():
628 for i in self.operObjList:
629 if i.name=='RTIPlot':
630 i.addParameter(name='n', value='2', format='int')
631 i.addParameter(name='overlapping', value='1', format='int')
632
633 @pyqtSignature("")
634 def on_actionguardarObj_triggered(self):
635 """
636 GUARDAR EL ARCHIVO DE CONFIGURACION XML
637 """
638 if self.idp==1:
639 self.valuep=1
640
641 print "Escribiendo el archivo XML"
642 filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml"
643 self.projectObj=self.proObjList[int(self.valuep)-1]
644 self.projectObj.writeXml(filename)
645
646
647 class BasicWindow(MainWindow):
648
649 def __init__(self):
650 pass
651
652 class AdvancedWindow(MainWindow):
653
654 def __init__(self):
655 pass
656
657
658
659 class ProjectWindow(QMainWindow, Ui_window):
660 """
661 Class documentation goes here.
662 """
663 closed = pyqtSignal()
664
665 create = False
666 name = None
667 description = None
668
669
670
671 def __init__(self, parent = None):
672 """
673 Constructor
674 """
675 QMainWindow.__init__(self, parent)
676 self.setupUi(self)
677 self.name=None
678
679 self.proyectNameLine.setText('My_name_is...')
680 self.descriptionTextEdit.setText('Write a description...')
681
682
683 @pyqtSignature("")
684 def on_cancelButton_clicked(self):
685 """
686 Slot documentation goes here.
687 """
688 # TODO: not implemented yet
689 #raise NotImplementedError
690 self.create = False
691 self.close()
692
693 @pyqtSignature("")
694 def on_okButton_clicked(self):
695 """
696 Slot documentation goes here.
697 """
698 #self.almacena()
699 self.create = True
700 self.name = str(self.proyectNameLine.text())
701 self.description = str(self.descriptionTextEdit.toPlainText())
702
703 self.close()
704
705 # @pyqtSignature("")
706 # def on_saveButton_clicked(self):
707 # """
708 # Slot documentation goes here.
709 # """
710 # self.almacena()
711 ## self.close()
712 #
713 # def almacena(self):
714 # #print str(self.proyectNameLine.text())
715 # self.nameproject=str(self.proyectNameLine.text())
716 # self.description=str(self.descriptionTextEdit.toPlainText())
717 # return self.nameproject,self.description
718 #
719 def closeEvent(self, event):
720 self.closed.emit()
721 event.accept()
722
723
724 class UnitProcess(QMainWindow, Ui_UnitProcess):
725 """
726 Class documentation goes here.
727 """
728 closed=pyqtSignal()
729 def __init__(self, parent = None):
730 """
731 Constructor
732 """
733 QMainWindow.__init__(self, parent)
734 self.setupUi(self)
735 self.getFromWindow=None
736 self.getfromWindowList=[]
737
738 self.listUP=None
739
740 def loadTotalList(self):
741 self.comboInputBox.clear()
742 for i in self.getfromWindowList:
743 name=i.getElementName()
744 id= i.id
745 if i.getElementName()=='ProcUnit':
746 id=int(i.id)-1
747 self.comboInputBox.addItem(str(name)+str(id))
748
749 @pyqtSignature("QString")
750 def on_comboInputBox_activated(self, p0):
751 """
752 Slot documentation goes here.
753 """
754
755 # TODO: not implemented yet
756 #raise NotImplementedError
757
758 @pyqtSignature("QString")
759 def on_comboTypeBox_activated(self, p0):
760 """
761 Slot documentation goes here.
762 """
763 # TODO: not implemented yet
764 #raise NotImplementedError
765
766 @pyqtSignature("")
767 def on_unitPokbut_clicked(self):
768 """
769 Slot documentation goes here.
770 """
771 self.close()
772
773 @pyqtSignature("")
774 def on_unitPsavebut_clicked(self):
775 """
776 Slot documentation goes here.
777 """
778
779 print "alex"
780 self.almacena()
781
782 @pyqtSignature("")
783 def on_unitPcancelbut_clicked(self):
784 """
785 Slot documentation goes here.
786 """
787 # TODO: not implemented yet
788 #raise NotImplementedError
789 self.hide()
790
791 def almacena(self):
792 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
793 #self.nameofUP= str(self.nameUptxt.text())
794 self.typeofUP= str(self.comboTypeBox.currentText())
795 return self.getFromWindow,self.typeofUP
796
797 def closeEvent(self, event):
798 self.closed.emit()
799 event.accept()
800
801
802
803
804
805
806
807 No newline at end of file
@@ -1,14 +0,0
1 '''
2 Created on Septembre, 2012
3
4 @author: roj-idl71
5 '''
6 from xml.etree import ElementTree
7 from xml.dom import minidom
8
9 def prettify(elem):
10 """Return a pretty-printed XML string for the Element.
11 """
12 rough_string = ElementTree.tostring(elem, 'utf-8')
13 reparsed = minidom.parseString(rough_string)
14 return reparsed.toprettyxml(indent=" ") No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now