##// END OF EJS Templates
Last Update
Alexander Valdez -
r330:d095dce0c07d
parent child
Show More
This diff has been collapsed as it changes many lines, (755 lines changed) Show them Hide them
@@ -1,1044 +1,1129
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 Module implementing MainWindow.
4 4 #+++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++#
5 5 """
6 6 import os
7 7 import datetime
8 8
9 9 from PyQt4.QtGui import QMainWindow
10 10 from PyQt4.QtCore import pyqtSignature
11 11 from PyQt4.QtCore import pyqtSignal
12 12 from PyQt4 import QtCore
13 13 from PyQt4 import QtGui
14 14 from timeconversions import Doy2Date
15 15 from modelProperties import treeModel
16 16
17 17 from viewer.ui_unitprocess import Ui_UnitProcess
18 18 from viewer.ui_window import Ui_window
19 19 from viewer.ui_mainwindow import Ui_BasicWindow
20 20 from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
21 21
22 22
23 23 def isRadarFile(file):
24 24
25 25 try:
26 26 year = int(file[1:5])
27 27 doy = int(file[5:8])
28 28 set = int(file[8:11])
29 29 except:
30 30 return 0
31 31
32 32 return 1
33 33
34 34 def isRadarPath(path):
35 35 try:
36 36 year = int(path[1:5])
37 37 doy = int(path[5:8])
38 38 except:
39 39 return 0
40 40
41 41 return 1
42 42
43 43 class BasicWindow(QMainWindow, Ui_BasicWindow):
44 44 __projObjDict = None
45 45 __arbolDict = None
46 46 __upObjDict = None
47 47
48 48 """
49 49 Class documentation goes here.
50 50 #*############VENTANA CUERPO DEL PROGRAMA##############
51 51 """
52 52 def __init__(self, parent = None):
53 53 """
54 54 Constructor
55 55 """
56 56 print "INICIO PROGRAMA "
57 57 QMainWindow.__init__(self, parent)
58 58 self.setupUi(self)
59 59
60 60 self.__projObjDict = {}
61 61 self.__arbolDict = {}
62 62 self.__upObjDict = {}
63
63 self.__opObjDict= {}
64 64 self.indexclick=None
65 65
66 66 self.online=0
67 67 self.datatype=0
68 68 self.dateList=[]
69 69
70 70 self.proObjList=[]
71 71 self.idp=0
72 72 self.namep=0
73 73 self.description=0
74 74 self.namepTree=0
75 75 self.valuep=0
76 76
77 77 self.upObjList= []
78 78 self.upn=0
79 79 self.upName=0
80 80 self.upType=0
81 81 self.uporProObjRecover=0
82 82
83 83 self.readUnitConfObjList=[]
84 84
85 85 self.upObjVolList=[]
86 86 self.upobjSpecList=[]
87 87
88 88 self.operObjList=[]
89 89
90 90 self.configProject=None
91 91 self.configUP=None
92 92
93 93 self.readUnitConfObj=None
94 94 self.procUnitConfObj0=None
95 95 self.opObj10=None
96 96 self.opObj12=None
97 97
98 self.setParam()
98 self.setParam()
99 99
100 #-----------------------------------NEW PROPERTIES------------------------------------------------#
100 #------------------VistadelNombreCompletousandoelpunteroSobrelosbotones---------------------------#
101 101 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
102 102 self.addprojectBtn.setToolTip('Add_New_Project')
103 103 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
104 104
105 #-----------------------------------NEW PROPERTIES------------------------------------------------#
105 #------------------------ManejodeEventosconelmouse------------------------------------------------#
106 106 self.model = QtGui.QStandardItemModel()
107 107 self.treeView.setModel(self.model)
108 108 self.treeView.clicked.connect(self.clickFunctiontree)
109 self.treeView.doubleClicked.connect(self.doubleclickFunctiontree)
109 110 self.treeView.expandAll()
111
112 #self.treeView.setReadOnly(True)
113 self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
114 self.treeView.customContextMenuRequested.connect(self.popup)
110 115 #self.treeView.clicked.connect(self.treefunction1)
111 116
112 117
113 118
114
115
116 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 143 #----------------------------------- MENU_PROJECT--------------------------------------------------#
119 144
120 145 @pyqtSignature("")
121 146 def on_menuFileAbrirObj_triggered(self):
122 147 """
123 148 Abre un archivo de configuracion seleccionado, lee los parametros y
124 149 actualiza los atributos de esta clase; creando los objetos necesarios
125 150 con los parametros leidos desde el archivo.
126 151 """
127 152 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
128 153
129 154 @pyqtSignature("")
130 155 def on_menuFileCrearObj_triggered(self):
131 156 """
132 157 Crea un proyecto nuevo y lo anade a mi diccionario de proyectos
133 158 y habilita la ventana de configuracion del proyecto.
134 159
135 160 """
136 161 self.addProject()
137 162
138 163 @pyqtSignature("")
139 164 def on_menuFileGuardarObj_triggered(self):
140 165 """
141 166 METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO
142 167
143 168 Llama al metodo saveProject.
144 169 """
145 170 # my_id = arbol_selected()
146 171 # filename = savefindow.show()
147 172 # self.saveProject(id, filename)
148 173 print "probsave"
149 174 self.saveProject()
150 175
151 176 @pyqtSignature("")
152 177 def on_menuFileCerrarObj_triggered(self):
153 178 """
154 179 METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR
155 180 Llama al metodo close.
156 181 """
157 182 self.close()
158 183
159 184 #-----------------------------------MENU_RUN----------------------------------------------------#
160 185
161 186 @pyqtSignature("")
162 187 def on_menuRUNStartObj_clicked(self):
163 188 """
164 189 METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN
165 190 Llama al metodo RUN.
166 191 """
167 192 print "Not implemented yet"
168 193
169 194 @pyqtSignature("")
170 195 def on_menuRUNPausaObj_clicked(self):
171 196 """
172 197 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
173 198 Llama al metodo PAUSA.
174 199 """
175 200 print "Not implemented yet"
176 201
177 202 #-----------------------------------MENU_OPTION-------------------------------------------------#
178 203
179 204 @pyqtSignature("")
180 205 def on_menuOptConfigLogfileObj_clicked(self):
181 206 """
182 207 METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog
183 208 Llama al metodo close.
184 209 """
185 210 print "Not implemented yet"
186 211
187 212 @pyqtSignature("")
188 213 def on_menuOptConfigserverObj_clicked(self):
189 214 """
190 215 METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server
191 216 Llama al metodo close.
192 217 """
193 218 print "Not implemented yet"
194 219 #-----------------------------------MENU_HELP-------------------------------------------------------#
195 220
196 221 @pyqtSignature("")
197 222 def on_menuHELPAboutObj_clicked(self):
198 223 """
199 224 METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP
200 225 Llama al metodo close.
201 226 """
202 227 print "Not implemented yet"
203 228
204 229 @pyqtSignature("")
205 230 def on_menuHELPPrfObj_clicked(self):
206 231 """
207 232 METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp
208 233 Llama al metodo close.
209 234 """
210 235 print "Not implemented yet"
211 236
212 237 #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------#
213 238
214 239 @pyqtSignature("")
215 240 def on_actOpenObj_triggered(self):
216 241 """
217 242 METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR
218 243 """
219 244 print "Leer un archivo xml y extraer sus atributos Not implemented yet"
220 245
221 246 @pyqtSignature("")
222 247 def on_actCreateObj_triggered(self):
223 248 """
224 249 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
225 250 Llama al metodo addProject.
226 251 """
227 252 self.addProject()
228 253
229 254 @pyqtSignature("")
230 255 def on_actStopObj_triggered(self):
231 256 """
232 257 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
233 258 Llama al metodo PAUSA.
234 259 """
235 260 print "Not implemented yet"
236 261
237 262 @pyqtSignature("")
238 263 def on_actPlayObj_triggered(self):
239 264 """
240 265 METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA
241 266 Llama al metodo PAUSA.
242 267 """
243 268 print "Not implemented yet"
244 269
245 270 @pyqtSignature("")
246 271 def on_actSaveObj_triggered(self):
247 272 """
248 273 METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE
249 274 Llama al metodo SAVE.
250 275 """
251 276 self.saveProject()
252 277
253 278 #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------#
254 279
255 280 @pyqtSignature("")
256 281 def on_addprojectBtn_clicked(self):
257 282 """
258 283 CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS
259 284 Llama al metodo addProject.
260 285 """
261 286 self.addProject()
287 self.setProjectParam()
262 288
263 289 #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------#
264 290
265 291 @pyqtSignature("int")
266 292 def on_dataTypeCmbBox_activated(self,index):
267 293 """
268 294 Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA
269 295 """
270 296 self.dataFormatTxt.setReadOnly(True)
271 297 if index==0:
272 298 self.datatype='.r'
273 299 elif index==1:
274 300 self.datatype='.pdata'
275 301 else :
276 302 self.datatype=''
277 303 self.dataFormatTxt.setReadOnly(False)
278 304 self.dataFormatTxt.setText(self.datatype)
279 305 self.loadDays()
280 306
281 307 @pyqtSignature("")
282 308 def on_dataPathBrowse_clicked(self):
283 309 """
284 310 OBTENCION DE LA RUTA DE DATOS
285 311 """
286 312 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
287 313 self.dataPathTxt.setText(self.dataPath)
288 314
289 self.startDateCmbBox.clear()
315 self.starDateCmbBox.clear()
290 316 self.endDateCmbBox.clear()
291 317
292 318 if not os.path.exists(self.dataPath):
293 319 self.dataOkBtn.setEnabled(False)
294 320 return
295 321
296 322 self.loadDays()
297 323
298 324 @pyqtSignature("int")
299 325 def on_starDateCmbBox_activated(self, index):
300 326 """
301 327 SELECCION DEL RANGO DE FECHAS -START DATE
302 328 """
303 329 stopIndex = self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
304 330 self.endDateCmbBox.clear()
305 331
306 332 for i in self.dateList[index:]:
307 333 self.endDateCmbBox.addItem(i)
308 334
309 335 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - stopIndex)
310 336
311 337 @pyqtSignature("int")
312 338 def on_endDateCmbBox_activated(self, index):
313 339 """
314 340 SELECCION DEL RANGO DE FECHAS-END DATE
315 341 """
316 342 startIndex=self.starDateCmbBox.currentIndex()
317 343 stopIndex = self.endDateCmbBox.count() - index
318 344 self.starDateCmbBox.clear()
319 345 for i in self.dateList[:len(self.dateList) - stopIndex + 1]:
320 346 self.starDateCmbBox.addItem(i)
321 347 self.starDateCmbBox.setCurrentIndex(startIndex)
322 348
323 349 @pyqtSignature("int")
324 350 def on_readModeCmBox_activated(self, p0):
325 351 """
326 352 SELECCION DEL MODO DE LECTURA ON=1, OFF=0
327 353 """
328 354 if p0==0:
329 355 self.online=0
330 356 elif p0==1:
331 357 self.online=1
332 358
333 359 #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------#
334 360
335 361 @pyqtSignature("")
336 362 def on_dataOkBtn_clicked(self):
337 363 """
338 364 Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml.
339 365 Prepara la configuración del diágrama del Arbol del treeView numero 2
340 366 """
341 print "DATOS DEL PROJECT PATH,DATE,TIME"
342
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
367 print "DATOS DEL PROJECT PATH,DATE,TIME"
347 368
348 369 # print self.projectObj
349 370 # print i
350 371 # print "get",self.__arbolDict.items()
351 372 # print "keys",self.__arbolDict.keys()
352 373
353 374 self.idp += 1
354 375 self.projectObj = Project()
355 print "self.projectObj",self.projectObj
356 376 self.__projObjDict[self.idp] = self.projectObj
357 377
358
359 self.description="Think"
360 id=self.idp
361 name=str(self.nameProjectTxt.text())
362 print "name",name
363 desc=str(self.description)
378 self.description="Think"
379
380 id = self.idp
381 name = str(self.nameProjectTxt.text())
382 desc = str(self.description)
364 383
365 384 self.projectObj.setup(id = id, name=name, description=desc)
366 385 print "self.projectObj.id",self.projectObj.id
367 # print self.projectObj.name
368 # print self.projectObj.description
369
370 datatype=str(self.dataTypeCmbBox.currentText())
371 path=str(self.dataPathTxt.text())
372 online=int(self.online)
373 starDate=str(self.starDateCmbBox.currentText())
374 endDate=str(self.endDateCmbBox.currentText())
375
386
387 #-------AÑADIENDO PARAMETROS A LA UNIDAD DE LECTURA---------#
376 388
377 self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype,
378 path=path,
379 startDate=starDate,
380 endDate=endDate,
381 startTime='06:10:00',
382 endTime='23:59:59',
383 online=online)
384
385 self.readUnitConfObjList.append(self.readUnitConfObj)
386 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype
387
389 datatype = str(self.dataTypeCmbBox.currentText())
390 path = str(self.dataPathTxt.text())
391 online = int(self.online)
392 starDate = str(self.starDateCmbBox.currentText())
393 endDate = str(self.endDateCmbBox.currentText())
394
395
388 396 reloj1=self.startTimeEdit.time()
397 print
398
389 399 reloj2=self.timeEdit_2.time()
400
390 401 print reloj1.hour()
391 402 print reloj1.minute()
392 403 print reloj1.second()
393 404
405 self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype,
406 path = path,
407 startDate = starDate,
408 endDate = endDate,
409 startTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()),
410 endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()),
411 online = online)
412 print self.readUnitConfObj.datatype,"self.readUnitConfObj.datatype"
413
414 self.readUnitConfObjList.append(self.readUnitConfObj)
415
416 #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------#
394 417 self.model_2=treeModel()
395 self.model_2.setParams(name =self.projectObj.name,
396 directorio =path,
397 workspace ="C:\\WorkspaceGUI",
398 remode =str(self.readModeCmBox.currentText()),
399 dataformat =datatype,
400 date =str(starDate)+"-"+str(endDate),
401 initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()),
402 endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()),
403 timezone ="Local" ,
404 Summary ="test de prueba")
418 self.model_2.setParams(name = self.projectObj.name,
419 directorio = path,
420 workspace = "C:\\WorkspaceGUI",
421 remode = str(self.readModeCmBox.currentText()),
422 dataformat = datatype,
423 date = str(starDate)+"-"+str(endDate),
424 initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()),
425 endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()),
426 timezone = "Local" ,
427 Summary = "test de prueba")
405 428
406 429 self.model_2.arbol()
407 430 self.treeView_2.setModel(self.model_2)
408 self.treeView_2.expandAll()
409
431 self.treeView_2.expandAll()
432
433 #--------CREACIÓNDELDIAGRAMADELARBOL------------------------#
410 434 self.parentItem = self.model.invisibleRootItem()
411 435 #self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
412 436 self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp))
413 437
414 438 print self.__arbolDict[self.idp]
415 439 self.parentItem.appendRow(self.__arbolDict[self.idp])
416 440 self.parentItem=self.__arbolDict[self.idp]
441
442 #--------BLOQUEO-------#
417 443 self.tabProject.setEnabled(False)
418 444
419 445
420
421
422 446 #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------#
423 447 @pyqtSignature("")
424 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 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()
431
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
453 self.addUP()
441 454
442 455 def setParam(self):
443 456
444 457 self.tabWidgetProject.setEnabled(False)
445 458 self.tabVoltage.setEnabled(False)
446 459 self.tabSpectra.setEnabled(False)
447 460 self.tabCorrelation.setEnabled(False)
448 461 self.dataPathTxt.setText('C:\data')
449 462 self.nameProjectTxt.setText("Test")
450 463 self.numberChannelopVol.setEnabled(False)
451 464 self.lineHeighProfileTxtopVol.setEnabled(False)
452 465 self.numberIntegration.setEnabled(False)
453 466 self.valuenFFTPointOpSpec.setEnabled(False)
454 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 486 def clickFunctiontree(self,index):
487
457 488 self.indexclick= index.model().itemFromIndex(index)
458 489 print "OPCION CLICK"
459 490 print "ArbolDict",self.indexclick
460 491 print "name:",self.indexclick.text()
461 492 #print self.tabWidgetProject.currentIndex()
462 493
463 #return self.indexclick
494
495
496
497 def doubleclickFunctiontree(self):
464 498 for i in self.__arbolDict:
465 499 if self.__arbolDict[i]==self.indexclick:
466 500 print "INDEXCLICK=ARBOLDICT",i
467 501 if self.__projObjDict.has_key(i)==True:
468 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 542 if self.indexclick.text()=='Voltage':
471 543 self.tabVoltage.setEnabled(True)
472 544 self.tabWidgetProject.setCurrentWidget(self.tabVoltage)
545 # for i in self.__opObjDict[i]
546 # self.OpObj=
473 547
474 548 if self.indexclick.text()=='Spectra':
475 549 self.tabSpectra.setEnabled(True)
476 550 self.tabWidgetProject.setCurrentWidget(self.tabSpectra)
477 551
478 552 if self.indexclick.text()=='Correlation':
479 553 self.tabCorrelation.setEnabled(True)
480 554 self.tabWidgetProject.setCurrentWidget(self.tabCorrelation)
481
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
555
495 556 def addProject(self):
557
496 558 self.tabWidgetProject.setEnabled(True)
559 #---------------KILL-----------------#
560 # self.tabWidgetProject.setTabsClosable(True)
561 # self.tabWidgetProject.tabCloseRequested.connect(self.tabWidgetProject.removeTab)
562 #------------------------------------#
497 563 self.tabWidgetProject.setCurrentWidget(self.tabProject)
498 564 self.tabProject.setEnabled(True)
499 565 #self.tabVoltage.setEnabled(False)
500 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
566 print "HABILITA WIDGET"
520 567
521 568 def existDir(self, var_dir):
522 569 """
523 570 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
524 571 VARIABLE DIRECCION
525 572 """
526 573 if os.path.isdir(var_dir):
527 574 return True
528 575 else:
529 576 self.textEdit.append("Incorrect path:" + str(var_dir))
530 577 return False
531 578
532 579 def searchData(self, path, ext, expLabel='', walk=1):
533 580
534 581 dateList = []
535 582 fileList = []
536 583
537 584 if walk == 0:
538 585 files = os.listdir(path)
539 586 for thisFile in files:
540 587 if not os.path.isfile(thisFile):
541 588 continue
542 589 thisExt = os.path.splitext(thisFile)[-1]
543 590
544 591 if thisExt != ext:
545 592 continue
546 593
547 594 fileList.append(file)
548 595
549 596 for thisFile in fileList:
550 597
551 598 if not isRadarFile(thisFile):
552 599 continue
553 600
554 601 year = int(thisFile[1:5])
555 602 doy = int(thisFile[5:8])
556 603
557 604 date = datetime.date(year,1,1) + datetime.timedelta(doy-1)
558 605 dateformat = date.strftime("%Y/%m/%d")
559 606
560 607 if dateformat not in dateList:
561 608 dateList.append(dateformat)
562 609
563 610 if walk == 1:
564 611
565 612 dirList = os.listdir(path)
566 613 dirList.sort()
567 614
568 615 dateList = []
569 616
570 617 for thisDir in dirList:
571 618
572 619 if not isRadarPath(thisDir):
573 620 continue
574 621
575 622 doypath = os.path.join(path, thisDir, expLabel)
576 623
577 624 files = os.listdir(doypath)
578 625 fileList = []
579 626
580 627 for thisFile in files:
581 628
582 629 if os.path.splitext(thisFile)[-1] != ext:
583 630 continue
584 631
585 632 if not isRadarFile(thisFile):
586 633 continue
587 634
588 635 fileList.append(thisFile)
589 636 break
590 637
591 638 if fileList == []:
592 639 continue
593 640
594 641 year = int(thisDir[1:5])
595 642 doy = int(thisDir[5:8])
596 643
597 644 date = datetime.date(year,1,1) + datetime.timedelta(doy-1)
598 645 dateformat = date.strftime("%Y/%m/%d")
599 646 dateList.append(dateformat)
600 647
601 648 return dateList
602 649
603 650 def loadDays(self):
604 651 """
605 652 METODO PARA CARGAR LOS DIAS
606 653 """
607 654 ext = self.datatype
608 655 path = str(self.dataPathTxt.text())
609 656
610 657 self.starDateCmbBox.clear()
611 658 self.endDateCmbBox.clear()
612 659
613 660 dateList = self.searchData(path, ext=ext)
614 661 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
615 662 self.dateList = dateList
616 663
617 664 for thisDate in dateList:
618 665 self.starDateCmbBox.addItem(thisDate)
619 666 self.endDateCmbBox.addItem(thisDate)
620 667
621 668 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
622 669 self.dataOkBtn.setEnabled(True)
623
624
625 670
626 671 def HourChanged(self):
627 672 #self.hour = self.HourScrollBar.value()
628 673 self.set_time()
629 674
630 675 def MinChanged(self):
631 676 #self.min = self.MinScrollBar.value()
632 677 self.set_time()
633 678
634 679 def SecChanged(self):
635 680 #self.sec = self.SecScrollBar.value()
636 681 self.set_time()
637 682
638 683 def set_time(self):
639 684 self.time.setHMS(self.hour, self.min, self.sec)
640 685 self.startTimeEdit.setTime(self.time)
641 686
642 687 self.timeEdit_2.setTime(self.time)
643 688
644 689
645 690 def addUP(self):
646 691
647 692 self.configUP=UnitProcess(self)
648 693
649 694 for i in self.__arbolDict:
650 695 if self.__arbolDict[i]==self.indexclick:
651 696 print "INDEXCLICK=ARBOLDICT",i
652 697 if self.__projObjDict.has_key(i)==True:
653 698 self.projectObj=self.__projObjDict[int(i)]
654 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 701 self.configUP.dataTypeProject=str(self.dataTypeCmbBox.currentText())
656 702 self.configUP.getfromWindowList.append(self.projectObj)
657 703
658 for i in self.projectObj.procUnitConfObjDict:
659 if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
660 self.upObj=self.projectObj.procUnitConfObjDict[i]
661 self.configUP.getfromWindowList.append(self.upObj)
704 # for i in self.projectObj.procUnitConfObjDict:
705 # if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit':
706 # self.upObj=self.projectObj.procUnitConfObjDict[i]
707 # self.configUP.getfromWindowList.append(self.upObj)
662 708 else:
709 #-----------Añadiendo Unidad de Procesamiento a una Unidad de Procesamiento----#
663 710 self.upObj=self.__upObjDict[i]
664 711 print "self.upObj.id",self.upObj.id
665 712 self.configUP.getfromWindowList.append(self.upObj)
666
667
668
713
669 714 self.configUP.loadTotalList()
670 715 self.configUP.show()
671 #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
672 716 self.configUP.closed.connect(self.createUP)
673
674 717
675
676 718 def createUP(self):
677 719
678 720 print "ADICION DE BRANCH Y ID"
679 721
680 722 if not self.configUP.create:
681 723 return
682 724
683 725 self.uporProObjRecover=self.configUP.getFromWindow
684 726
685 727 self.upType = self.configUP.typeofUP
686 728 for i in self.__arbolDict:
687 729 print self.__arbolDict[i],"VALORES DEL DIC"
688 730 if self.__arbolDict[i]==self.indexclick:
689 731 if self.__projObjDict.has_key(i)==True:
690 732 # print "self.__projObjDict[int(i)]" ,__projObjDict[int(i)]
691 733 self.projectObj=self.__projObjDict[int(i)]
692 734 print self.__projObjDict[int(i)]
693 735
694 736 if self.__upObjDict.has_key(i)==True:
695 737 print "Entro al else"
696 738 print self.__upObjDict.items()
697 739 self.upObj=self.__upObjDict[i]
698 740 getIdProject=self.upObj.id[0]
699 741 print getIdProject
700 742 self.projectObj=self.__projObjDict[int(getIdProject)]
701 743
702 744 datatype=str(self.upType)
703 745 uporprojectObj=self.uporProObjRecover
704 746
705 747 if uporprojectObj.getElementName()=='ProcUnit':
706 748 inputId=uporprojectObj.getId()
707 749 else:
708 750 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
709 751
710 752 print 'uporprojectObj.id:',uporprojectObj.id,'inputId:',inputId
711 753 self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId)
712 754 self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1
713 755 print "PRIMERA UP_VEAMOS",self.__upObjDict.items()
714 756 self.parentItem=self.__arbolDict[uporprojectObj.id]
715 757 #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i]
716 758 self.numbertree=int(self.procUnitConfObj1.getId())-1
717 759 print self.procUnitConfObj1.id," ID DE LA UNIDAD DE PROCESAMIENTO "
718 760 #self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype+"%1").arg(self.numbertree))
761
762
763
719 764 self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree))
720 765 self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id])
721 766 self.parentItem=self.__arbolDict[self.procUnitConfObj1.id]
722 767 # self.loadUp()
723 768 self.treeView.expandAll()
724 769
725 770 def resetopVolt(self):
726 771 self.selecChannelopVolCEB.setChecked(False)
727 772 self.selecHeighopVolCEB.setChecked(False)
728 773 self.coherentIntegrationCEB.setChecked(False)
729 774 self.profileSelecopVolCEB.setChecked(False)
730 775 #self.selecChannelopVolCEB.setEnabled(False)
731 776 self.lineHeighProfileTxtopVol.clear()
732 777 self.lineProfileSelecopVolCEB.clear()
733 778 self.numberChannelopVol.clear()
734 779 self.numberIntegration.clear()
735 780
736 781
737 782 def resetopSpec(self):
738 self.nFFTPointOpSpecCEB.setChecked(False)
739 783
784 self.nFFTPointOpSpecCEB.setChecked(False)
740 785 self.valuenFFTPointOpSpec.clear()
741 786
742 787 def resetgraphSpec(self):
743 788 self.SpectraPlotGraphCEB.setChecked(False)
744 789 self.CrossSpectraPlotGraphceb.setChecked(False)
745 790 self.RTIPlotGraphCEB.setChecked(False)
746 791
747
748 792 def saveProject(self):
749 793 print "entro"
750 794 #filename="C:\WorkspaceGUI\config1.xml"
751 795 for i in self.__arbolDict:
752 796 if self.__arbolDict[i]==self.indexclick:
753 self.projectObj=self.__projObjDict[int(i)]
797 self.projectObj=self.__projObjDict[i]
754 798 print "Encontre project"
755 799 filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml"
756 800 print "Escribo Project"
757 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 1051 class UnitProcess(QMainWindow, Ui_UnitProcess):
761 1052 """
762 1053 Class documentation goes here.
763 1054 """
764 1055 closed=pyqtSignal()
765 1056 create= False
766 1057 def __init__(self, parent = None):
767 1058 """
768 1059 Constructor
769 1060 """
770 1061 QMainWindow.__init__(self, parent)
771 1062 self.setupUi(self)
772 1063 self.getFromWindow=None
773 1064 self.getfromWindowList=[]
774 1065 self.dataTypeProject=None
775 1066
776 1067 self.listUP=None
777 1068
778 1069 @pyqtSignature("")
779 1070 def on_unitPokbut_clicked(self):
780 1071 """
781 1072 Slot documentation goes here.
782 1073 """
783 1074 self.create =True
784 1075 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
785 1076 #self.nameofUP= str(self.nameUptxt.text())
786 1077 self.typeofUP= str(self.comboTypeBox.currentText())
787 1078 self.close()
788 1079
789 1080
790 1081 @pyqtSignature("")
791 1082 def on_unitPcancelbut_clicked(self):
792 1083 """
793 1084 Slot documentation goes here.
794 1085 """
795 # TODO: not implemented yet
796 #raise NotImplementedError
797 1086 self.create=False
798 1087 self.close()
799 1088
800 1089 def loadTotalList(self):
801 1090 self.comboInputBox.clear()
802 1091 for i in self.getfromWindowList:
803 1092
804 1093 name=i.getElementName()
1094 print "name",name
805 1095 if name=='Project':
806 1096 id= i.id
807 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 1104 if self.dataTypeProject=='Spectra':
809 1105 self.comboTypeBox.clear()
810 1106 self.comboTypeBox.addItem("Spectra")
811 1107 self.comboTypeBox.addItem("Correlation")
812 1108
813 1109 if name=='ProcUnit':
814 1110 id=int(i.id)-1
815 1111 name=i.datatype
816 1112 if name == 'Voltage':
817 1113 self.comboTypeBox.clear()
818 1114 self.comboTypeBox.addItem("Spectra")
819 1115 self.comboTypeBox.addItem("Correlation")
820 1116 if name == 'Spectra':
821 1117 self.comboTypeBox.clear()
822 1118 self.comboTypeBox.addItem("Spectra")
823 1119 self.comboTypeBox.addItem("Correlation")
824 1120
825 1121
826 #self.comboInputBox.addItem(str(name))
827 self.comboInputBox.addItem(str(name)+str(id))
1122 self.comboInputBox.addItem(str(name))
1123 #self.comboInputBox.addItem(str(name)+str(id))
828 1124
829 1125 def closeEvent(self, event):
830 1126 self.closed.emit()
831 1127 event.accept()
832
833
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
1128
1129 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now