##// END OF EJS Templates
Last Update
Alexander Valdez -
r330:d095dce0c07d
parent child
Show More
This diff has been collapsed as it changes many lines, (687 lines changed) Show them Hide them
@@ -60,7 +60,7 class BasicWindow(QMainWindow, Ui_BasicWindow):
60 self.__projObjDict = {}
60 self.__projObjDict = {}
61 self.__arbolDict = {}
61 self.__arbolDict = {}
62 self.__upObjDict = {}
62 self.__upObjDict = {}
63
63 self.__opObjDict= {}
64 self.indexclick=None
64 self.indexclick=None
65
65
66 self.online=0
66 self.online=0
@@ -97,24 +97,49 class BasicWindow(QMainWindow, Ui_BasicWindow):
97
97
98 self.setParam()
98 self.setParam()
99
99
100 #-----------------------------------NEW PROPERTIES------------------------------------------------#
100 #------------------VistadelNombreCompletousandoelpunteroSobrelosbotones---------------------------#
101 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
101 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
102 self.addprojectBtn.setToolTip('Add_New_Project')
102 self.addprojectBtn.setToolTip('Add_New_Project')
103 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
103 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
104
104
105 #-----------------------------------NEW PROPERTIES------------------------------------------------#
105 #------------------------ManejodeEventosconelmouse------------------------------------------------#
106 self.model = QtGui.QStandardItemModel()
106 self.model = QtGui.QStandardItemModel()
107 self.treeView.setModel(self.model)
107 self.treeView.setModel(self.model)
108 self.treeView.clicked.connect(self.clickFunctiontree)
108 self.treeView.clicked.connect(self.clickFunctiontree)
109 self.treeView.doubleClicked.connect(self.doubleclickFunctiontree)
109 self.treeView.expandAll()
110 self.treeView.expandAll()
110 #self.treeView.clicked.connect(self.treefunction1)
111
112
111
112 #self.treeView.setReadOnly(True)
113 self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
114 self.treeView.customContextMenuRequested.connect(self.popup)
115 #self.treeView.clicked.connect(self.treefunction1)
113
116
114
117
115
118
116 #-----------------------------------BARRA DE MENU-------------------------------------------------#
119 #-----------------------------------BARRA DE MENU-------------------------------------------------#
117
120
121 def popup(self, pos):
122 # for i in self.treeView.selectionModel().selection().indexes():
123 # print i.row(), i.column()
124 menu = QtGui.QMenu()
125 #menu.centralWidget.setObjectName(_fromUtf8("centralWidget"))
126 quitAction0 = menu.addAction("Add Branch")
127 quitAction1 = menu.addAction("Delete Branch")
128 quitAction2 = menu.addAction("Exit")
129 #quitAction2 = menu.addAction("Exit")
130 print "pos:", pos
131 action = menu.exec_(self.mapToGlobal(pos))
132 if action == quitAction0:
133 self.addUP()
134
135 if action == quitAction1:
136 for i in self.__arbolDict:
137 if self.__arbolDict[i]==self.indexclick:
138 self.arbolItem=self.__arbolDict[i]
139 print self.arbolItem
140 self.arbolItem.removeRows(self.arbolItem.row(),1)
141 if action == quitAction2:
142 return
118 #----------------------------------- MENU_PROJECT--------------------------------------------------#
143 #----------------------------------- MENU_PROJECT--------------------------------------------------#
119
144
120 @pyqtSignature("")
145 @pyqtSignature("")
@@ -259,6 +284,7 class BasicWindow(QMainWindow, Ui_BasicWindow):
259 Llama al metodo addProject.
284 Llama al metodo addProject.
260 """
285 """
261 self.addProject()
286 self.addProject()
287 self.setProjectParam()
262
288
263 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
289 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
264
290
@@ -286,7 +312,7 class BasicWindow(QMainWindow, Ui_BasicWindow):
286 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
312 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
287 self.dataPathTxt.setText(self.dataPath)
313 self.dataPathTxt.setText(self.dataPath)
288
314
289 self.startDateCmbBox.clear()
315 self.starDateCmbBox.clear()
290 self.endDateCmbBox.clear()
316 self.endDateCmbBox.clear()
291
317
292 if not os.path.exists(self.dataPath):
318 if not os.path.exists(self.dataPath):
@@ -340,11 +366,6 class BasicWindow(QMainWindow, Ui_BasicWindow):
340 """
366 """
341 print "DATOS DEL PROJECT PATH,DATE,TIME"
367 print "DATOS DEL PROJECT PATH,DATE,TIME"
342
368
343 # self.model.clear()
344 # self.parentItem = self.model.invisibleRootItem()
345 # self.__arbolDict[i]= QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp))
346 # self.parentItem.appendRow(self.__arbolDict[self.idp
347
348 # print self.projectObj
369 # print self.projectObj
349 # print i
370 # print i
350 # print "get",self.__arbolDict.items()
371 # print "get",self.__arbolDict.items()
@@ -352,20 +373,18 class BasicWindow(QMainWindow, Ui_BasicWindow):
352
373
353 self.idp += 1
374 self.idp += 1
354 self.projectObj = Project()
375 self.projectObj = Project()
355 print "self.projectObj",self.projectObj
356 self.__projObjDict[self.idp] = self.projectObj
376 self.__projObjDict[self.idp] = self.projectObj
357
377
358
359 self.description="Think"
378 self.description="Think"
379
360 id=self.idp
380 id = self.idp
361 name=str(self.nameProjectTxt.text())
381 name = str(self.nameProjectTxt.text())
362 print "name",name
363 desc=str(self.description)
382 desc = str(self.description)
364
383
365 self.projectObj.setup(id = id, name=name, description=desc)
384 self.projectObj.setup(id = id, name=name, description=desc)
366 print "self.projectObj.id",self.projectObj.id
385 print "self.projectObj.id",self.projectObj.id
367 # print self.projectObj.name
386
368 # print self.projectObj.description
387 #-------AΓ‘ADIENDO PARAMETROS A LA UNIDAD DE LECTURA---------#
369
388
370 datatype=str(self.dataTypeCmbBox.currentText())
389 datatype = str(self.dataTypeCmbBox.currentText())
371 path=str(self.dataPathTxt.text())
390 path = str(self.dataPathTxt.text())
@@ -374,23 +393,27 class BasicWindow(QMainWindow, Ui_BasicWindow):
374 endDate=str(self.endDateCmbBox.currentText())
393 endDate = str(self.endDateCmbBox.currentText())
375
394
376
395
396 reloj1=self.startTimeEdit.time()
397 print
398
399 reloj2=self.timeEdit_2.time()
400
401 print reloj1.hour()
402 print reloj1.minute()
403 print reloj1.second()
404
377 self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype,
405 self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype,
378 path=path,
406 path = path,
379 startDate=starDate,
407 startDate = starDate,
380 endDate=endDate,
408 endDate = endDate,
381 startTime='06:10:00',
409 startTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()),
382 endTime='23:59:59',
410 endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()),
383 online=online)
411 online = online)
412 print self.readUnitConfObj.datatype,"self.readUnitConfObj.datatype"
384
413
385 self.readUnitConfObjList.append(self.readUnitConfObj)
414 self.readUnitConfObjList.append(self.readUnitConfObj)
386 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype
387
388 reloj1=self.startTimeEdit.time()
389 reloj2=self.timeEdit_2.time()
390 print reloj1.hour()
391 print reloj1.minute()
392 print reloj1.second()
393
415
416 #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------#
394 self.model_2=treeModel()
417 self.model_2=treeModel()
395 self.model_2.setParams(name =self.projectObj.name,
418 self.model_2.setParams(name = self.projectObj.name,
396 directorio =path,
419 directorio = path,
@@ -407,6 +430,7 class BasicWindow(QMainWindow, Ui_BasicWindow):
407 self.treeView_2.setModel(self.model_2)
430 self.treeView_2.setModel(self.model_2)
408 self.treeView_2.expandAll()
431 self.treeView_2.expandAll()
409
432
433 #--------CREACIΓ“NDELDIAGRAMADELARBOL------------------------#
410 self.parentItem = self.model.invisibleRootItem()
434 self.parentItem = self.model.invisibleRootItem()
411 #self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
435 #self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
412 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
436 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
@@ -414,31 +438,20 class BasicWindow(QMainWindow, Ui_BasicWindow):
414 print self.__arbolDict[self.idp]
438 print self.__arbolDict[self.idp]
415 self.parentItem.appendRow(self.__arbolDict[self.idp])
439 self.parentItem.appendRow(self.__arbolDict[self.idp])
416 self.parentItem=self.__arbolDict[self.idp]
440 self.parentItem=self.__arbolDict[self.idp]
417 self.tabProject.setEnabled(False)
418
419
441
442 #--------BLOQUEO-------#
443 self.tabProject.setEnabled(False)
420
444
421
445
422 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
446 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
423 @pyqtSignature("")
447 @pyqtSignature("")
424 def on_addUnitProces_clicked(self):
448 def on_addUnitProces_clicked(self):
425 """
449 """
426 CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO
450 CREAR PROCESSING UNIT ,añade unidad de procesamiento, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO
427 Llama al metodo addUP.
451 Llama al metodo addUP.
428 """
452 """
429 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
430 self.addUP()
453 self.addUP()
431
454
432
433 #----------------------------BASICO-----------------------------------#
434
435 def getNumberofProject(self):
436 # for i in self.proObjList:
437 # print i
438 return self.proObjList
439 # for i in self.proObjList:
440 # print i
441
442 def setParam(self):
455 def setParam(self):
443
456
444 self.tabWidgetProject.setEnabled(False)
457 self.tabWidgetProject.setEnabled(False)
@@ -453,23 +466,84 class BasicWindow(QMainWindow, Ui_BasicWindow):
453 self.valuenFFTPointOpSpec.setEnabled(False)
466 self.valuenFFTPointOpSpec.setEnabled(False)
454 self.lineProfileSelecopVolCEB.setEnabled(False)
467 self.lineProfileSelecopVolCEB.setEnabled(False)
455
468
469 def setProjectParam(self):
470 self.nameProjectTxt.setText("Test")
471 self.dataPathTxt.setText('C:\data')
472 self.dataTypeCmbBox.clear()
473 self.dataTypeCmbBox.addItem("Voltage")
474 self.dataTypeCmbBox.addItem("Spectra")
475 startTime="00:00:00"
476 endTime="23:59:59"
477 starlist=startTime.split(":")
478 endlist=endTime.split(":")
479 print starlist[0],starlist[1],starlist[2]
480 print endlist[0],endlist[1],endlist[2]
481 self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2]))
482 self.startTimeEdit.setTime(self.time)
483 self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2]))
484 self.timeEdit_2.setTime(self.time)
485
456 def clickFunctiontree(self,index):
486 def clickFunctiontree(self,index):
487
457 self.indexclick= index.model().itemFromIndex(index)
488 self.indexclick= index.model().itemFromIndex(index)
458 print "OPCION CLICK"
489 print "OPCION CLICK"
459 print "ArbolDict",self.indexclick
490 print "ArbolDict",self.indexclick
460 print "name:",self.indexclick.text()
491 print "name:",self.indexclick.text()
461 #print self.tabWidgetProject.currentIndex()
492 #print self.tabWidgetProject.currentIndex()
462
493
463 #return self.indexclick
494
495
496
497 def doubleclickFunctiontree(self):
464 for i in self.__arbolDict:
498 for i in self.__arbolDict:
465 if self.__arbolDict[i]==self.indexclick:
499 if self.__arbolDict[i]==self.indexclick:
466 print "INDEXCLICK=ARBOLDICT",i
500 print "INDEXCLICK=ARBOLDICT",i
467 if self.__projObjDict.has_key(i)==True:
501 if self.__projObjDict.has_key(i)==True:
468 self.tabWidgetProject.setCurrentWidget(self.tabProject)
502 self.tabWidgetProject.setCurrentWidget(self.tabProject)
503 self.nameProjectTxt.setText(str(self.__projObjDict[i].name))
504 self.dataTypeCmbBox.clear()
505 self.dataTypeCmbBox.addItem(str(self.readUnitConfObjList[i-1].datatype))
506 print str(self.readUnitConfObjList[i-1].path)
507 self.dataPathTxt.setText(str(self.readUnitConfObjList[i-1].path))
508 self.starDateCmbBox.clear()
509 self.endDateCmbBox.clear()
510 self.starDateCmbBox.addItem(str(self.readUnitConfObjList[i-1].startDate))
511 self.endDateCmbBox.addItem(str(self.readUnitConfObjList[i-1].endDate))
512 startTime=self.readUnitConfObjList[i-1].startTime
513 endTime=self.readUnitConfObjList[i-1].endTime
514 starlist=startTime.split(":")
515 endlist=endTime.split(":")
516 print starlist[0],starlist[1],starlist[2]
517 print endlist[0],endlist[1],endlist[2]
518 self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2]))
519 self.startTimeEdit.setTime(self.time)
520 self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2]))
521 self.timeEdit_2.setTime(self.time)
522
523 #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------#
524 self.model_2=treeModel()
525 self.model_2.setParams(name = str(self.__projObjDict[i].name),
526 directorio = str(self.readUnitConfObjList[i-1].path),
527 workspace = "C:\\WorkspaceGUI",
528 remode = str(self.readModeCmBox.currentText()),
529 dataformat = "Voltage",
530 date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate),
531 initTime = str(starlist[0]) +":"+str(starlist[1])+":"+ str(starlist[2]),
532 endTime = str(endlist[0]) +":"+str(endlist[1])+":"+ str(endlist[2]),
533 timezone = "Local" ,
534 Summary = "test de prueba")
535
536 self.model_2.arbol()
537 self.treeView_2.setModel(self.model_2)
538 self.treeView_2.expandAll()
539
540 #self.dataPathTxt.setText(str(self.__projObjDict[i].addReadUnit.path()))
469
541
470 if self.indexclick.text()=='Voltage':
542 if self.indexclick.text()=='Voltage':
471 self.tabVoltage.setEnabled(True)
543 self.tabVoltage.setEnabled(True)
472 self.tabWidgetProject.setCurrentWidget(self.tabVoltage)
544 self.tabWidgetProject.setCurrentWidget(self.tabVoltage)
545 # for i in self.__opObjDict[i]
546 # self.OpObj=
473
547
474 if self.indexclick.text()=='Spectra':
548 if self.indexclick.text()=='Spectra':
475 self.tabSpectra.setEnabled(True)
549 self.tabSpectra.setEnabled(True)
@@ -479,44 +553,17 class BasicWindow(QMainWindow, Ui_BasicWindow):
479 self.tabCorrelation.setEnabled(True)
553 self.tabCorrelation.setEnabled(True)
480 self.tabWidgetProject.setCurrentWidget(self.tabCorrelation)
554 self.tabWidgetProject.setCurrentWidget(self.tabCorrelation)
481
555
482
483 # self.indexclick= index.model().itemFromIndex(index).text()
484 # return self.indexclick
485 # print self.indexclick()
486 # print index.model().itemFromIndex(index)
487 # print self.indexclick
488 # NumofPro=self.indexclick[8:10]
489 # self.valuep=NumofPro
490 # #print self.valuep
491 # NameofPro=self.indexclick[0:7]
492 # self.namepTree=NameofPro
493 # print self.namepTree
494
495 def addProject(self):
556 def addProject(self):
557
496 self.tabWidgetProject.setEnabled(True)
558 self.tabWidgetProject.setEnabled(True)
559 #---------------KILL-----------------#
560 # self.tabWidgetProject.setTabsClosable(True)
561 # self.tabWidgetProject.tabCloseRequested.connect(self.tabWidgetProject.removeTab)
562 #------------------------------------#
497 self.tabWidgetProject.setCurrentWidget(self.tabProject)
563 self.tabWidgetProject.setCurrentWidget(self.tabProject)
498 self.tabProject.setEnabled(True)
564 self.tabProject.setEnabled(True)
499 #self.tabVoltage.setEnabled(False)
565 #self.tabVoltage.setEnabled(False)
500 print "HABILITA WIDGET"
566 print "HABILITA WIDGET"
501 #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++#
502
503 # self.idp += 1
504 # self.projectObj = Project()
505 # print self.projectObj
506 # self.__projObjDict[self.idp] = self.projectObj
507 #
508 # #++++++++++++++++++CreaciΓ³n del Arbol++++++++++++++++++++#
509 #
510 # name='Test'
511 #
512 # self.parentItem = self.model.invisibleRootItem()
513 # self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
514 #
515 # print "Nombre del projecto es :",self.__arbolDict[self.idp].setAccessibleText('HOLA')
516 # print self.__arbolDict[self.idp]
517 # self.parentItem.appendRow(self.__arbolDict[self.idp])
518 # self.parentItem=self.__arbolDict[self.idp]
519
520
567
521 def existDir(self, var_dir):
568 def existDir(self, var_dir):
522 """
569 """
@@ -621,8 +668,6 class BasicWindow(QMainWindow, Ui_BasicWindow):
621 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
668 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
622 self.dataOkBtn.setEnabled(True)
669 self.dataOkBtn.setEnabled(True)
623
670
624
625
626 def HourChanged(self):
671 def HourChanged(self):
627 #self.hour = self.HourScrollBar.value()
672 #self.hour = self.HourScrollBar.value()
628 self.set_time()
673 self.set_time()
@@ -652,27 +697,24 class BasicWindow(QMainWindow, Ui_BasicWindow):
652 if self.__projObjDict.has_key(i)==True:
697 if self.__projObjDict.has_key(i)==True:
653 self.projectObj=self.__projObjDict[int(i)]
698 self.projectObj=self.__projObjDict[int(i)]
654 print "self.projectObj.id",self.projectObj.id
699 print "self.projectObj.id",self.projectObj.id
700 #-----------AΓ±adiendo Tipo de dato y Projecto a la Clase UnitProcess que abre la ventana de selecciΓ³n----#
655 self.configUP.dataTypeProject=str(self.dataTypeCmbBox.currentText())
701 self.configUP.dataTypeProject=str(self.dataTypeCmbBox.currentText())
656 self.configUP.getfromWindowList.append(self.projectObj)
702 self.configUP.getfromWindowList.append(self.projectObj)
657
703
658 for i in self.projectObj.procUnitConfObjDict:
704 # for i in self.projectObj.procUnitConfObjDict:
659 if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
705 # if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
660 self.upObj=self.projectObj.procUnitConfObjDict[i]
706 # self.upObj=self.projectObj.procUnitConfObjDict[i]
661 self.configUP.getfromWindowList.append(self.upObj)
707 # self.configUP.getfromWindowList.append(self.upObj)
662 else:
708 else:
709 #-----------AΓ±adiendo Unidad de Procesamiento a una Unidad de Procesamiento----#
663 self.upObj=self.__upObjDict[i]
710 self.upObj=self.__upObjDict[i]
664 print "self.upObj.id",self.upObj.id
711 print "self.upObj.id",self.upObj.id
665 self.configUP.getfromWindowList.append(self.upObj)
712 self.configUP.getfromWindowList.append(self.upObj)
666
713
667
668
669 self.configUP.loadTotalList()
714 self.configUP.loadTotalList()
670 self.configUP.show()
715 self.configUP.show()
671 #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
672 self.configUP.closed.connect(self.createUP)
716 self.configUP.closed.connect(self.createUP)
673
717
674
675
676 def createUP(self):
718 def createUP(self):
677
719
678 print "ADICION DE BRANCH Y ID"
720 print "ADICION DE BRANCH Y ID"
@@ -716,6 +758,9 class BasicWindow(QMainWindow, Ui_BasicWindow):
716 self.numbertree=int(self.procUnitConfObj1.getId())-1
758 self.numbertree=int(self.procUnitConfObj1.getId())-1
717 print self.procUnitConfObj1.id," ID DE LA UNIDAD DE PROCESAMIENTO "
759 print self.procUnitConfObj1.id," ID DE LA UNIDAD DE PROCESAMIENTO "
718 #self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype+"%1").arg(self.numbertree))
760 #self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype+"%1").arg(self.numbertree))
761
762
763
719 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree))
764 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree))
720 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
765 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
721 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
766 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
@@ -735,8 +780,8 class BasicWindow(QMainWindow, Ui_BasicWindow):
735
780
736
781
737 def resetopSpec(self):
782 def resetopSpec(self):
738 self.nFFTPointOpSpecCEB.setChecked(False)
739
783
784 self.nFFTPointOpSpecCEB.setChecked(False)
740 self.valuenFFTPointOpSpec.clear()
785 self.valuenFFTPointOpSpec.clear()
741
786
742 def resetgraphSpec(self):
787 def resetgraphSpec(self):
@@ -744,19 +789,265 class BasicWindow(QMainWindow, Ui_BasicWindow):
744 self.CrossSpectraPlotGraphceb.setChecked(False)
789 self.CrossSpectraPlotGraphceb.setChecked(False)
745 self.RTIPlotGraphCEB.setChecked(False)
790 self.RTIPlotGraphCEB.setChecked(False)
746
791
747
748 def saveProject(self):
792 def saveProject(self):
749 print "entro"
793 print "entro"
750 #filename="C:\WorkspaceGUI\config1.xml"
794 #filename="C:\WorkspaceGUI\config1.xml"
751 for i in self.__arbolDict:
795 for i in self.__arbolDict:
752 if self.__arbolDict[i]==self.indexclick:
796 if self.__arbolDict[i]==self.indexclick:
753 self.projectObj=self.__projObjDict[int(i)]
797 self.projectObj=self.__projObjDict[i]
754 print "Encontre project"
798 print "Encontre project"
755 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
799 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
756 print "Escribo Project"
800 print "Escribo Project"
757 self.projectObj.writeXml(filename)
801 self.projectObj.writeXml(filename)
758
802
759
803
804
805 # -----------------VENTANA CONFIGURACION DE VOLTAGE---------------------------#
806
807 @pyqtSignature("int")
808 def on_selecChannelopVolCEB_stateChanged(self, p0):
809 """
810 Check Box habilita operaciones de SelecciοΏ½n de Canales
811 """
812 if p0==2:
813 self.numberChannelopVol.setEnabled(True)
814 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
815 # opObj10=upProcessSelect.addOperation(name='selectChannels')
816 # print opObj10.id
817 # self.operObjList.append(opObj10)
818 print " Ingresa seleccion de Canales"
819 if p0==0:
820 self.numberChannelopVol.setEnabled(False)
821
822 print " deshabilitado"
823
824 @pyqtSignature("int")
825 def on_selecHeighopVolCEB_stateChanged(self, p0):
826 """
827 Check Box habilita operaciones de SelecciοΏ½n de Alturas
828 """
829 if p0==2:
830 self.lineHeighProfileTxtopVol.setEnabled(True)
831 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
832 # opObj10=upProcessSelect.addOperation(name='selectHeights')
833 # print opObj10.id
834 # self.operObjList.append(opObj10)
835 print " Select Type of Profile"
836 if p0==0:
837 self.lineHeighProfileTxtopVol.setEnabled(False)
838 print " deshabilitado"
839
840
841 @pyqtSignature("int")
842 def on_profileSelecopVolCEB_stateChanged(self, p0):
843 """
844 Check Box habilita ingreso del rango de Perfiles
845 """
846 if p0==2:
847 self.lineProfileSelecopVolCEB.setEnabled(True)
848 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
849 # opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
850 # print opObj10.id
851 # self.operObjList.append(opObj10)
852 print " Select Type of Profile"
853 if p0==0:
854 self.lineProfileSelecopVolCEB.setEnabled(False)
855
856 print " deshabilitado"
857
858
859 @pyqtSignature("int")
860 def on_coherentIntegrationCEB_stateChanged(self, p0):
861 """
862 Check Box habilita ingresode del numero de Integraciones a realizar
863 """
864 if p0==2:
865 self.numberIntegration.setEnabled(True)
866 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
867 # opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
868 # print opObj10.id
869 # self.operObjList.append(opObj10)
870 print "Choose number of Cohint"
871 if p0==0:
872 print " deshabilitado"
873 self.numberIntegration.setEnabled(False)
874
875 #-----------------------PUSHBUTTON_ACCEPT_OPERATION----------------------------#
876
877 @pyqtSignature("")
878 def on_dataopVolOkBtn_clicked(self):
879 """
880 BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO
881 PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML
882 """
883 for i in self.__arbolDict:
884 if self.__arbolDict[i]==self.indexclick:
885 print "INDEXCLICK=ARBOLDICT",i
886 if self.__upObjDict.has_key(i)==True:
887 self.upObj=self.__upObjDict[i]
888 # self.operObjList.append(opObj10)
889
890 if self.selecChannelopVolCEB.isChecked():
891 opObj10=self.upObj.addOperation(name='selectChannels')
892 self.operObjList.append(opObj10)
893 value=self.numberChannelopVol.text()
894 opObj10.addParameter(name='channelList', value=value, format='intlist')
895
896
897 print "channel"
898
899 if self.selecHeighopVolCEB.isChecked():
900 opObj10=self.upObj.addOperation(name='selectHeights')
901 print opObj10.id
902 self.operObjList.append(opObj10)
903 value=self.lineHeighProfileTxtopVol.text()
904 valueList=value.split(',')
905 opObj10.addParameter(name='minHei', value=valueList[0], format='float')
906 opObj10.addParameter(name='maxHei', value=valueList[1], format='float')
907
908 print "height"
909
910
911 if self.selecHeighopVolCEB.isChecked():
912 obj10=self.upObj.addOperation(name='ProfileSelector', optype='other')
913 print opObj10.id
914 self.operObjList.append(opObj10)
915 value=self.lineProfileSelecopVolCEB.text()
916 obj10.addParameter(name='ProfileSelector', value=value, format='intlist')
917
918 # for i in self.operObjList:
919 # if i.name=='ProfileSelector' :
920 # value=self.lineProfileSelecopVolCEB.text()
921 # i.addParameter(name='ProfileSelector', value=value, format='intlist')
922
923 if self.coherentIntegrationCEB.isChecked():
924 opObj10=self.upObj.addOperation(name='CohInt', optype='other')
925 print opObj10.id
926 self.operObjList.append(opObj10)
927 value=self.numberIntegration.text()
928 opObj10.addParameter(name='n', value=value, format='int')
929 # self.__opObjDict[i]==self.operObjList
930
931
932 #-------------------------VENTANA DE CONFIGURACION SPECTRA------------------------#
933
934 @pyqtSignature("int")
935 def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
936 """
937 Habilita la opcion de aοΏ½adir el parοΏ½metro nFFTPoints a la Unidad de Procesamiento .
938 """
939 if p0==2:
940 self.valuenFFTPointOpSpec.setEnabled(True)
941 print " nFFTPoint"
942 if p0==0:
943 print " deshabilitado"
944 self.valuenFFTPointOpSpec.setEnabled(False)
945
946
947
948 @pyqtSignature("")
949 def on_dataopSpecOkBtn_clicked(self):
950 """
951 AοΏ½ade al archivo de configuraciοΏ½n el parοΏ½metros nFFTPoints a la UP.
952 """
953 print "AοΏ½adimos operaciones Spectra,nchannels,value,format"
954
955 for i in self.__arbolDict:
956 if self.__arbolDict[i]==self.indexclick:
957 print "INDEXCLICK=ARBOLDICT",i
958 if self.__upObjDict.has_key(i)==True:
959 self.upObj=self.__upObjDict[i]
960 # self.operObjList.append(opObj10)
961
962 if self.nFFTPointOpSpecCEB.isChecked():
963 value=self.numberChannelopVol.text()
964 self.upObj.addParameter(name='nFFTPoints',value=value,format='int')
965 print "nFFTpoints"
966
967
968
969 #---------------------VENTANA DE CONFIGURACION GRAPH SPECTRA------------------#
970
971 @pyqtSignature("int")
972 def on_SpectraPlotGraphCEB_stateChanged(self, p0):
973 """
974 Habilita la opcion de Ploteo Spectra Plot
975 """
976 if p0==2:
977 print "Habilitado"
978
979 if p0==0:
980 print " deshabilitado"
981
982 @pyqtSignature("int")
983 def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
984 """
985 Habilita la opciοΏ½n de Ploteo CrossSpectra
986 """
987 if p0==2:
988 print "Habilitado"
989 if p0==0:
990 print " deshabilitado"
991
992 @pyqtSignature("int")
993 def on_RTIPlotGraphCEB_stateChanged(self, p0):
994 """
995 Habilita la opciοΏ½n de Plote RTIPlot
996 """
997 if p0==2:
998 print "Habilitado"
999 if p0==0:
1000 print " deshabilitado"
1001
1002 #------------------PUSH_BUTTON_SPECTRA_GRAPH_OK-----------------------------#
1003 @pyqtSignature("")
1004 def on_dataGraphSpecOkBtn_clicked(self):
1005 """
1006 HABILITAR DE ACUERDO A LOS CHECKBOX QUE TIPO DE PLOTEOS SE VAN A REALIZAR MUESTRA Y GRABA LAS IMAGENES.
1007 """
1008 for i in self.__arbolDict:
1009 if self.__arbolDict[i]==self.indexclick:
1010 print "INDEXCLICK=ARBOLDICT",i
1011 if self.__upObjDict.has_key(i)==True:
1012 self.upObj=self.__upObjDict[i]
1013 print "Graficar Spec op"
1014
1015 if self.SpectraPlotGraphCEB_2.isChecked():
1016 opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other')
1017 print opObj10.id
1018 self.operObjList.append(opObj10)
1019 for i in self.operObjList:
1020 if i.name=='SpectraPlot':
1021 i.addParameter(name='idfigure', value='1', format='int')
1022 i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
1023 i.addParameter(name='zmin', value='40', format='int')
1024 i.addParameter(name='zmax', value='90', format='int')
1025 i.addParameter(name='showprofile', value='1', format='int')
1026
1027 if self.CrossSpectraPlotGraphceb.isChecked():
1028 opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other')
1029 print opObj10.id
1030 self.operObjList.append(opObj10)
1031 for i in self.operObjList:
1032 if i.name=='CrossSpectraPlot' :
1033 i.addParameter(name='idfigure', value='2', format='int')
1034 i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
1035 i.addParameter(name='zmin', value='40', format='int')
1036 i.addParameter(name='zmax', value='90', format='int')
1037
1038 if self.RTIPlotGraphCEB.isChecked():
1039 opObj10=self.upObj.addOperation(name='RTIPlot',optype='other')
1040 print opObj10.id
1041 self.operObjList.append(opObj10)
1042 for i in self.operObjList:
1043 if i.name=='RTIPlot':
1044 i.addParameter(name='n', value='2', format='int')
1045 i.addParameter(name='overlapping', value='1', format='int')
1046
1047
1048
1049
1050
760 class UnitProcess(QMainWindow, Ui_UnitProcess):
1051 class UnitProcess(QMainWindow, Ui_UnitProcess):
761 """
1052 """
762 Class documentation goes here.
1053 Class documentation goes here.
@@ -792,8 +1083,6 class UnitProcess(QMainWindow, Ui_UnitProcess):
792 """
1083 """
793 Slot documentation goes here.
1084 Slot documentation goes here.
794 """
1085 """
795 # TODO: not implemented yet
796 #raise NotImplementedError
797 self.create=False
1086 self.create=False
798 self.close()
1087 self.close()
799
1088
@@ -802,9 +1091,16 class UnitProcess(QMainWindow, Ui_UnitProcess):
802 for i in self.getfromWindowList:
1091 for i in self.getfromWindowList:
803
1092
804 name=i.getElementName()
1093 name=i.getElementName()
1094 print "name",name
805 if name=='Project':
1095 if name=='Project':
806 id= i.id
1096 id= i.id
807 name=i.name
1097 name=i.name
1098 print "tipodeproyecto",self.dataTypeProject
1099 if self.dataTypeProject=='Voltage':
1100 self.comboTypeBox.clear()
1101 self.comboTypeBox.addItem("Voltage")
1102 self.comboTypeBox.addItem("Spectra")
1103 self.comboTypeBox.addItem("Correlation")
808 if self.dataTypeProject=='Spectra':
1104 if self.dataTypeProject=='Spectra':
809 self.comboTypeBox.clear()
1105 self.comboTypeBox.clear()
810 self.comboTypeBox.addItem("Spectra")
1106 self.comboTypeBox.addItem("Spectra")
@@ -823,222 +1119,11 class UnitProcess(QMainWindow, Ui_UnitProcess):
823 self.comboTypeBox.addItem("Correlation")
1119 self.comboTypeBox.addItem("Correlation")
824
1120
825
1121
826 #self.comboInputBox.addItem(str(name))
1122 self.comboInputBox.addItem(str(name))
827 self.comboInputBox.addItem(str(name)+str(id))
1123 #self.comboInputBox.addItem(str(name)+str(id))
828
1124
829 def closeEvent(self, event):
1125 def closeEvent(self, event):
830 self.closed.emit()
1126 self.closed.emit()
831 event.accept()
1127 event.accept()
832
1128
833
1129
No newline at end of file
834
835
836
837 #-----------------VENTANA CONFIGURACION DE VOLTAGE---------------------------#
838 #
839 # @pyqtSignature("int")
840 # def on_selecChannelopVolCEB_stateChanged(self, p0):
841 # """
842 # Check Box habilita operaciones de SelecciοΏ½n de Canales
843 # """
844 # if p0==2:
845 # self.numberChannelopVol.setEnabled(True)
846 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
847 # opObj10=upProcessSelect.addOperation(name='selectChannels')
848 # print opObj10.id
849 # self.operObjList.append(opObj10)
850 # print " Ingresa seleccion de Canales"
851 # if p0==0:
852 # print " deshabilitado"
853 #
854 # @pyqtSignature("int")
855 # def on_selecHeighopVolCEB_stateChanged(self, p0):
856 # """
857 # Check Box habilita operaciones de SelecciοΏ½n de Alturas
858 # """
859 # if p0==2:
860 # self.lineHeighProfileTxtopVol.setEnabled(True)
861 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
862 # opObj10=upProcessSelect.addOperation(name='selectHeights')
863 # print opObj10.id
864 # self.operObjList.append(opObj10)
865 # print " Select Type of Profile"
866 # if p0==0:
867 # print " deshabilitado"
868 #
869 #
870 # @pyqtSignature("int")
871 # def on_profileSelecopVolCEB_stateChanged(self, p0):
872 # """
873 # Check Box habilita ingreso del rango de Perfiles
874 # """
875 # if p0==2:
876 # self.lineProfileSelecopVolCEB.setEnabled(True)
877 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
878 # opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
879 # print opObj10.id
880 # self.operObjList.append(opObj10)
881 # print " Select Type of Profile"
882 # if p0==0:
883 # print " deshabilitado"
884 #
885 #
886 # @pyqtSignature("int")
887 # def on_coherentIntegrationCEB_stateChanged(self, p0):
888 # """
889 # Check Box habilita ingresode del numero de Integraciones a realizar
890 # """
891 # if p0==2:
892 # self.numberIntegration.setEnabled(True)
893 # upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
894 # opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
895 # print opObj10.id
896 # self.operObjList.append(opObj10)
897 # print "Choose number of Cohint"
898 # if p0==0:
899 # print " deshabilitado"
900 # self.numberChannelopVol.setEnabled(False)
901 #
902 # #-----------------------PUSHBUTTON_ACCEPT_OPERATION----------------------------#
903 #
904 # @pyqtSignature("")
905 # def on_dataopVolOkBtn_clicked(self):
906 # """
907 # BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO
908 # PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML
909 # """
910 # if self.selecChannelopVolCEB.isChecked():
911 # for i in self.operObjList:
912 # if i.name=='selectChannels':
913 # value=self.numberChannelopVol.text()
914 # i.addParameter(name='channelList', value=value, format='intlist')
915 #
916 #
917 # print "channel"
918 #
919 # if self.selecHeighopVolCEB.isChecked():
920 # for i in self.operObjList:
921 # if i.name=='selectHeights' :
922 # value=self.lineHeighProfileTxtopVol.text()
923 # valueList=value.split(',')
924 # i.addParameter(name='minHei', value=valueList[0], format='float')
925 # i.addParameter(name='maxHei', value=valueList[1], format='float')
926 #
927 # print "height"
928 #
929 #
930 # if self.selecHeighopVolCEB.isChecked():
931 # for i in self.operObjList:
932 # if i.name=='ProfileSelector' :
933 # value=self.lineProfileSelecopVolCEB.text()
934 # i.addParameter(name='ProfileSelector', value=value, format='intlist')
935 #
936 #
937 #
938 # if self.coherentIntegrationCEB.isChecked():
939 # for i in self.operObjList:
940 # if i.name=='CohInt':
941 # value=self.numberIntegration.text()
942 # i.addParameter(name='n', value=value, format='int')
943 #
944 #
945 # #-------------------------VENTANA DE CONFIGURACION SPECTRA------------------------#
946 #
947 # @pyqtSignature("int")
948 # def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
949 # """
950 # Habilita la opcion de aοΏ½adir el parοΏ½metro nFFTPoints a la Unidad de Procesamiento .
951 # """
952 # if p0==2:
953 # self.valuenFFTPointOpSpec.setEnabled(True)
954 # print " nFFTPoint"
955 # if p0==0:
956 # print " deshabilitado"
957 #
958 # #------------------PUSH_BUTTON_SPECTRA_OK------------------------------------#
959 #
960 # @pyqtSignature("")
961 # def on_dataopSpecOkBtn_clicked(self):
962 # """
963 # AοΏ½ade al archivo de configuraciοΏ½n el parοΏ½metros nFFTPoints a la UP.
964 # """
965 # print "AοΏ½adimos operaciones Spectra,nchannels,value,format"
966 # if self.nFFTPointOpSpecCEB.isChecked():
967 # upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
968 # value=self.valuenFFTPointOpSpec.text()
969 # upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int')
970 # #---------------------VENTANA DE CONFIGURACION GRAPH SPECTRA------------------#
971 #
972 # @pyqtSignature("int")
973 # def on_SpectraPlotGraphCEB_stateChanged(self, p0):
974 # """
975 # Habilita la opcion de Ploteo Spectra Plot
976 # """
977 # if p0==2:
978 # upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
979 # opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other')
980 # print opObj10.id
981 # self.operObjList.append(opObj10)
982 #
983 # if p0==0:
984 # print " deshabilitado"
985 #
986 # @pyqtSignature("int")
987 # def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
988 # """
989 # Habilita la opciοΏ½n de Ploteo CrossSpectra
990 # """
991 # if p0==2:
992 # upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
993 # opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other')
994 # print opObj10.id
995 # self.operObjList.append(opObj10)
996 # if p0==0:
997 # print " deshabilitado"
998 #
999 # @pyqtSignature("int")
1000 # def on_RTIPlotGraphCEB_stateChanged(self, p0):
1001 # """
1002 # Habilita la opciοΏ½n de Plote RTIPlot
1003 # """
1004 # if p0==2:
1005 # upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
1006 # opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other')
1007 # print opObj10.id
1008 # self.operObjList.append(opObj10)
1009 # if p0==0:
1010 # print " deshabilitado"
1011 #
1012 # #------------------PUSH_BUTTON_SPECTRA_GRAPH_OK-----------------------------#
1013 # @pyqtSignature("")
1014 # def on_dataGraphSpecOkBtn_clicked(self):
1015 # """
1016 # HABILITAR DE ACUERDO A LOS CHECKBOX QUE TIPO DE PLOTEOS SE VAN A REALIZAR MUESTRA Y GRABA LAS IMAGENES.
1017 # """
1018 # print "Graficar Spec op"
1019 # if self.SpectraPlotGraphCEB.isChecked():
1020 # for i in self.operObjList:
1021 # if i.name=='SpectraPlot':
1022 # i.addParameter(name='idfigure', value='1', format='int')
1023 # i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
1024 # i.addParameter(name='zmin', value='40', format='int')
1025 # i.addParameter(name='zmax', value='90', format='int')
1026 # i.addParameter(name='showprofile', value='1', format='int')
1027 #
1028 # if self.CrossSpectraPlotGraphceb.isChecked():
1029 # for i in self.operObjList:
1030 # if i.name=='CrossSpectraPlot' :
1031 # i.addParameter(name='idfigure', value='2', format='int')
1032 # i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
1033 # i.addParameter(name='zmin', value='40', format='int')
1034 # i.addParameter(name='zmax', value='90', format='int')
1035 #
1036 # if self.RTIPlotGraphCEB.isChecked():
1037 # for i in self.operObjList:
1038 # if i.name=='RTIPlot':
1039 # i.addParameter(name='n', value='2', format='int')
1040 # i.addParameter(name='overlapping', value='1', format='int')
1041 #
1042 #
1043
1044 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now