##// END OF EJS Templates
Last update...
Alexander Valdez -
r251:220b5f5f1c4a
parent child
Show More
@@ -1,732 +1,759
1 1 # -*- coding: utf-8 -*-
2 2 """
3 3 Module implementing MainWindow.
4 4 #+++++++++++++++++++++INTERFAZ DE USUARIO V1.1++++++++++++++++++++++++#
5 5 """
6 6 from PyQt4.QtGui import QMainWindow
7 7 from PyQt4.QtCore import pyqtSignature
8 8 from PyQt4.QtCore import pyqtSignal
9 9 from PyQt4 import QtCore
10 10 from PyQt4 import QtGui
11 11 from timeconversions import Doy2Date
12 12 from modelProperties import treeModel
13 13 from viewer.ui_unitprocess import Ui_UnitProcess
14 14 from viewer.ui_window import Ui_window
15 15 from viewer.ui_mainwindow import Ui_MainWindow
16 16 from viewer.ui_workspace import Ui_Workspace
17 17 from viewer.ui_initwindow import Ui_InitWindow
18 18
19 19 from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf
20 20 import os
21 21
22 22 HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " )
23 23
24 24 HORIZONTAL = ("RAMA :",)
25 25
26 26 class MainWindow(QMainWindow, Ui_MainWindow):
27 27 nop=None
28 28 """
29 29 Class documentation goes here.
30 30 #*##################VENTANA CUERPO DEL PROGRAMA####################
31 31 """
32 32 def __init__(self, parent = None):
33 33 """
34 34 Constructor
35 35 """
36 36 print "Inicio de Programa Interfaz GrΓ‘fica"
37 37 QMainWindow.__init__(self, parent)
38 38 self.setupUi(self)
39 39
40 40 self.online=0
41 41 self.datatype=0
42 42 self.variableList=[]
43 43
44 44 self.proObjList=[]
45 45 self.idp=0
46 46 self.namep=0
47 47 self.description=0
48 48 self.namepTree=0
49 49 self.valuep=0
50 50
51 51 self.upObjList= []
52 52 self.upn=0
53 53 self.upName=0
54 54 self.upType=0
55 55 self.uporProObjRecover=0
56 56
57 57
58 58 self.readUnitConfObjList=[]
59 59
60 60 self.upObjVolList=[]
61 61 self.upobjSpecList=[]
62 62
63 63
64 64 self.operObjList=[]
65 65
66 66 self.configProject=None
67 67 self.configUP=None
68 68
69 69 self.controllerObj=None
70 70 self.readUnitConfObj=None
71 71 self.procUnitConfObj0=None
72 72 self.opObj10=None
73 73 self.opObj12=None
74 74
75 75
76 76 self.setParam()
77 77
78 78 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
79 79 QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10))
80 80 self.addpBtn.setToolTip('Add_New_Project')
81 81 self.addUnitProces.setToolTip('Add_New_Processing_Unit')
82 82
83 83 #++++++++++++++++++NEW PROPERTIES+++++++++++++++++#
84 84 self.model = QtGui.QStandardItemModel()
85 85 self.treeView.setModel(self.model)
86 86 self.treeView.clicked.connect(self.clickFunctiontree)
87 87 self.treeView.expandAll()
88 88 #self.treeView.clicked.connect(self.treefunction1)
89 89
90 90 def getNumberofProject(self):
91 91 # for i in self.proObjList:
92 92 # print i
93 93 return self.proObjList
94 94 # for i in self.proObjList:
95 95 # print i
96 96
97 97 def setParam(self):
98 98 self.dataPathTxt.setText('C:\data')
99 99 self.numberChannelopVol.setEnabled(False)
100 100 self.lineHeighProfileTxtopVol.setEnabled(False)
101 101 self.numberIntegration.setEnabled(False)
102 102 self.valuenFFTPointOpSpec.setEnabled(False)
103 self.lineProfileSelecopVolCEB.setEnabled(False)
103 104
104 105
105 106 def clickFunctiontree(self,index):
106 107 indexclick= index.model().itemFromIndex(index).text()
107 108 #print indexclick
108 109 NumofPro=indexclick[8:10]
109 110 self.valuep=NumofPro
110 111 #print self.valuep
111 112 NameofPro=indexclick[0:7]
112 113 self.namepTree=NameofPro
113 114 #print self.namepTree
114 115
115 116
116 117 @pyqtSignature("")
117 118 def on_addpBtn_clicked(self):
118 119 """
119 120 ANADIR UN NUEVO PROYECTO
120 121 """
121 122 print "En este nivel se abre el window"
122 123
123 124
124 125 self.showWindow()
125 126
126 127 def showWindow(self):
127 128 self.configProject=Window(self)
128 129 #self.configProject.closed.connect(self.show)
129 130 self.configProject.show()
130 131 #self.configProject.closed.connect(self.show)
131 132 self.configProject.saveButton.clicked.connect(self.reciveParameters)
132 133 self.configProject.closed.connect(self.createProject)
133 134
134 135 def reciveParameters(self):
135 136 self.namep,self.description =self.configProject.almacena()
136 137
137 138 def createProject(self):
138 139
139 140 print "En este nivel se debe crear el proyecto,id,nombre,desc"
140 141 #+++++Creacion del Objeto Controller-XML++++++++++#
141 142 self.idp += 1
142 143 self.controllerObj = Project()
143 144 id=int(self.idp)
144 145 name=str(self.namep)
145 146 desc=str(self.description)
146 147 self.parentItem=self.model.invisibleRootItem()
147 148 self.controllerObj.arbol=QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp))
148 149 self.controllerObj.setup(id = id, name=name, description=desc)
149 150 self.parentItem.appendRow(self.controllerObj.arbol)
150 151 self.proObjList.append(self.controllerObj)#+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++#
151 152 self.parentItem=self.controllerObj.arbol
152 153 self.loadProjects()
153 154
154 155 print "Porfavor ingrese los parΓ‘metros de configuracion del Proyecto"
155 156
156 157 def loadProjects(self):
157 158 self.proConfCmbBox.clear()
158 159 for i in self.proObjList:
159 160 self.proConfCmbBox.addItem("Project"+str(i.id))
160 161
161 162 @pyqtSignature("int")
162 163 def on_dataTypeCmbBox_activated(self,index):
163 164 self.dataFormatTxt.setReadOnly(True)
164 165 if index==0:
165 166 self.datatype='Voltage'
166 167 elif index==1:
167 168 self.datatype='Spectra'
168 169 else :
169 170 self.datatype=''
170 171 self.dataFormatTxt.setReadOnly(False)
171 172 self.dataFormatTxt.setText(self.datatype)
172 173
173 174 def existDir(self, var_dir):
174 175 """
175 176 METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR
176 177 VARIABLE DIRECCION
177 178 """
178 179 if os.path.isdir(var_dir):
179 180 return True
180 181 else:
181 182 self.textEdit.append("Incorrect path:" + str(var_dir))
182 183 return False
183 184
184 185 def loadDays(self):
185 186 """
186 187 METODO PARA CARGAR LOS DIAS
187 188 """
188 189 self.variableList=[]
189 190 self.starDateCmbBox.clear()
190 191 self.endDateCmbBox.clear()
191 192
192 193 Dirlist = os.listdir(self.dataPath)
193 194 Dirlist.sort()
194 195
195 196 for a in range(0, len(Dirlist)):
196 197 fname= Dirlist[a]
197 198 Doy=fname[5:8]
198 199 fname = fname[1:5]
199 200 print fname
200 201 fecha=Doy2Date(int(fname),int(Doy))
201 202 fechaList=fecha.change2date()
202 203 #print fechaList[0]
203 204 Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1])
204 205 #+"-"+ fechaList[0]+"-"+fechaList[1]
205 206
206 207 #---------------AQUI TIENE QUE SER MODIFICADO--------#
207 208
208 209 #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox)
209 210 for i in range(0, (len(Dirlist))):
210 211 self.variableList.append(Dirlist[i])
211 212
212 213 for i in self.variableList:
213 214 self.starDateCmbBox.addItem(i)
214 215 self.endDateCmbBox.addItem(i)
215 216 self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1)
216 217
217 218 self.getsubList()
218 219 self.dataOkBtn.setEnabled(True)
219 220
220 221 def getsubList(self):
221 222 """
222 223 OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS
223 224 """
224 225 self.subList=[]
225 226 for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]:
226 227 self.subList.append(i)
227 228
228 229 @pyqtSignature("")
229 230 def on_dataPathBrowse_clicked(self):
230 231 """
231 232 OBTENCION DE LA RUTA DE DATOS
232 233 """
233 234 self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly))
234 235 self.dataPathTxt.setText(self.dataPath)
235 236 self.statusDpath=self.existDir(self.dataPath)
236 237 self.loadDays()
237 238
238 239 @pyqtSignature("int")
239 240 def on_starDateCmbBox_activated(self, index):
240 241 """
241 242 SELECCION DEL RANGO DE FECHAS -STAR DATE
242 243 """
243 244 var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex()
244 245 self.endDateCmbBox.clear()
245 246 for i in self.variableList[index:]:
246 247 self.endDateCmbBox.addItem(i)
247 248 self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index)
248 249 self.getsubList()
249 250
250 251 @pyqtSignature("int")
251 252 def on_endDateCmbBox_activated(self, index):
252 253 """
253 254 SELECCION DEL RANGO DE FECHAS-END DATE
254 255 """
255 256 var_StartDay_index=self.starDateCmbBox.currentIndex()
256 257 var_end_index = self.endDateCmbBox.count() - index
257 258 self.starDateCmbBox.clear()
258 259 for i in self.variableList[:len(self.variableList) - var_end_index + 1]:
259 260 self.starDateCmbBox.addItem(i)
260 261 self.starDateCmbBox.setCurrentIndex(var_StartDay_index)
261 262 self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas
262 263
263 264 @pyqtSignature("int")
264 265 def on_readModeCmBox_activated(self, p0):
265 266 """
266 267 Slot documentation goes here.
267 268 """
268 269 if p0==0:
269 270 self.online=0
270 271 elif p0==1:
271 272 self.online=1
272 273
273 274 @pyqtSignature("")
274 275 def on_dataOkBtn_clicked(self):
275 276 """
276 277 Slot documentation goes here.
277 278 """
278 279 print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online"
279 280
280 281 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
281 282 datatype=str(self.dataTypeCmbBox.currentText())
282 283 path=str(self.dataPathTxt.text())
283 284 online=int(self.online)
284 285 starDate=str(self.starDateCmbBox.currentText())
285 286 endDate=str(self.endDateCmbBox.currentText())
286 287
287 288
288 289 self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype,
289 290 path=path,
290 291 startDate=starDate,
291 292 endDate=endDate,
292 293 startTime='06:10:00',
293 294 endTime='23:59:59',
294 295 online=online)
295 296
296 297 self.readUnitConfObjList.append(self.readUnitConfObj)
297 298
298 299 print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online
299 300
300 301
301 302 self.model_2=treeModel()
302 303
303 304 self.model_2.setParams(name=projectObj.name+str(projectObj.id),
304 305 directorio=path,
305 306 workspace="C:\\WorkspaceGUI",
306 307 remode=str(self.readModeCmBox.currentText()),
307 308 dataformat=datatype,
308 309 date=str(starDate)+"-"+str(endDate),
309 310 initTime='06:10:00',
310 311 endTime='23:59:59',
311 312 timezone="Local" ,
312 313 Summary="test de prueba")
313 314 self.model_2.arbol()
314 315 self.treeView_2.setModel(self.model_2)
315 316 self.treeView_2.expandAll()
316 317
317 318
318 319 @pyqtSignature("")
319 320 def on_addUnitProces_clicked(self):
320 321 """
321 322 Slot documentation goes here.
322 323 """
323 324 # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
324 325 # self.procUnitConfObj0 = self.controllerObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId())
325 326 self.showUp()
326 327
327 328 def showUp(self):
328 329
329 330 self.configUP=UnitProcess(self)
330 331 for i in self.proObjList:
331 332 self.configUP.getfromWindowList.append(i)
332 333 #print i
333 334 for i in self.upObjList:
334 335 self.configUP.getfromWindowList.append(i)
335 336 self.configUP.loadTotalList()
336 337 self.configUP.show()
337 338 self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters)
338 339 self.configUP.closed.connect(self.createUP)
339 340
340 341 def reciveUPparameters(self):
341 342
342 343 self.uporProObjRecover,self.upType=self.configUP.almacena()
343 344
344 345
345 346 def createUP(self):
346 347 print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id"
347 348 projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())]
348 349
349 350 datatype=str(self.upType)
350 351 uporprojectObj=self.uporProObjRecover
351 352 #+++++++++++LET FLY+++++++++++#
352 353 if uporprojectObj.getElementName()=='ProcUnit':
353 354 inputId=uporprojectObj.getId()
354 355 elif uporprojectObj.getElementName()=='Project':
355 356 inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId()
356 357
357 358
358 359 self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId)
359 360 self.upObjList.append(self.procUnitConfObj1)
360 361 print inputId
361 362 print self.procUnitConfObj1.getId()
362 363 self.parentItem=uporprojectObj.arbol
363 364 self.numbertree=int(self.procUnitConfObj1.getId())-1
364 365 self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree))
365 366 self.parentItem.appendRow(self.procUnitConfObj1.arbol)
366 367 self.parentItem=self.procUnitConfObj1.arbol
367 368 self.loadUp()
368 369 self.treeView.expandAll()
369 370
370 371 def loadUp(self):
371 372 self.addOpUpselec.clear()
372 373 self.addOpSpecUpselec.clear()
373 374 for i in self.upObjList:
374 375 if i.datatype=='Voltage':
375 376 self.upObjVolList.append(i)
376 377 name=i.getElementName()
377 378 id=int(i.id)-1
378 379 self.addOpUpselec.addItem(name+str(id))
379 380 if i.datatype=='Spectra':
380 381 self.upobjSpecList.append(i)
381 382 name=i.getElementName()
382 383 id=int(i.id)-1
383 384 self.addOpSpecUpselec.addItem(name+str(id))
384 385
385 386 self.resetopVolt()
386 387 self.resetopSpec()
387 388
388 389
389 390 @pyqtSignature("int")
390 391 def on_selecChannelopVolCEB_stateChanged(self, p0):
391 392 """
392 393 Slot documentation goes here.
393 394 """
394 395 if p0==2:
395 396 self.numberChannelopVol.setEnabled(True)
396 397 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
397 398 opObj10=upProcessSelect.addOperation(name='selectChannels')
398 399 print opObj10.id
399 400 self.operObjList.append(opObj10)
400 401 print " Ingresa seleccion de Canales"
401 402 if p0==0:
402 403 print " deshabilitado"
403 404
404 405 @pyqtSignature("int")
405 406 def on_selecHeighopVolCEB_stateChanged(self, p0):
406 407 """
407 408 Slot documentation goes here.
408 409 """
409 410 if p0==2:
410 411 self.lineHeighProfileTxtopVol.setEnabled(True)
411 412 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
412 413 opObj10=upProcessSelect.addOperation(name='selectHeights')
413 414 print opObj10.id
414 415 self.operObjList.append(opObj10)
415 416 print " Select Type of Profile"
416 417 if p0==0:
417 418 print " deshabilitado"
418 419
419 420
421 @pyqtSignature("int")
422 def on_profileSelecopVolCEB_stateChanged(self, p0):
423 """
424 Slot documentation goes here.
425 """
426 if p0==2:
427 self.lineProfileSelecopVolCEB.setEnabled(True)
428 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
429 opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other')
430 print opObj10.id
431 self.operObjList.append(opObj10)
432 print " Select Type of Profile"
433 if p0==0:
434 print " deshabilitado"
435
420 436
421 437 @pyqtSignature("int")
422 438 def on_coherentIntegrationCEB_stateChanged(self, p0):
423 439 """
424 440 Slot documentation goes here.
425 441 """
426 442 if p0==2:
427 443 self.numberIntegration.setEnabled(True)
428 444 upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())]
429 445 opObj10=upProcessSelect.addOperation(name='CohInt', optype='other')
430 446 print opObj10.id
431 447 self.operObjList.append(opObj10)
432 448 print "Choose number of Cohint"
433 449 if p0==0:
434 450 print " deshabilitado"
435 451 self.numberChannelopVol.setEnabled(False)
436 452
437 453 def resetopVolt(self):
438 454 self.selecChannelopVolCEB.setChecked(False)
439 455 self.selecHeighopVolCEB.setChecked(False)
440 456 self.coherentIntegrationCEB.setChecked(False)
441
457 self.profileSelecopVolCEB.setChecked(False)
442 458 #self.selecChannelopVolCEB.setEnabled(False)
443 459 self.lineHeighProfileTxtopVol.clear()
460 self.lineProfileSelecopVolCEB.clear()
444 461 self.numberChannelopVol.clear()
445 462 self.numberIntegration.clear()
446 463
447 464
448 465 @pyqtSignature("")
449 466 def on_dataopVolOkBtn_clicked(self):
450 467 """
451 468 Slot documentation goes here.
452 469 """
453 470 if self.selecChannelopVolCEB.isChecked():
454 471 for i in self.operObjList:
455 472 if i.name=='selectChannels':
456 473 value=self.numberChannelopVol.text()
457 474 i.addParameter(name='channelList', value=value, format='intlist')
458 475
459 476
460 477 print "channel"
461 478
462 479 if self.selecHeighopVolCEB.isChecked():
463 480 for i in self.operObjList:
464 481 if i.name=='selectHeights' :
465 482 value=self.lineHeighProfileTxtopVol.text()
466 483 valueList=value.split(',')
467 i.addParameter(name='minHei', value=value[0], format='float')
468 i.addParameter(name='maxHei', value=value[1], format='float')
484 i.addParameter(name='minHei', value=valueList[0], format='float')
485 i.addParameter(name='maxHei', value=valueList[1], format='float')
469 486
470 487 print "height"
488
489
490 if self.selecHeighopVolCEB.isChecked():
491 for i in self.operObjList:
492 if i.name=='ProfileSelector' :
493 value=self.lineProfileSelecopVolCEB.text()
494 i.addParameter(name='ProfileSelector', value=value, format='intlist')
495
496
497
471 498 if self.coherentIntegrationCEB.isChecked():
472 499 for i in self.operObjList:
473 500 if i.name=='CohInt':
474 501 value=self.numberIntegration.text()
475 502 i.addParameter(name='n', value=value, format='int')
476 503
477 504
478 505 @pyqtSignature("int")
479 506 def on_nFFTPointOpSpecCEB_stateChanged(self, p0):
480 507 """
481 508 Slot documentation goes here.
482 509 """
483 510 if p0==2:
484 511 self.valuenFFTPointOpSpec.setEnabled(True)
485 512 print " nFFTPoint"
486 513 if p0==0:
487 514 print " deshabilitado"
488 515
489 516
490 517 def resetopSpec(self):
491 518 self.nFFTPointOpSpecCEB.setChecked(False)
492 519
493 520 self.valuenFFTPointOpSpec.clear()
494 521
495 522
496 523 @pyqtSignature("")
497 524 def on_dataopSpecOkBtn_clicked(self):
498 525 """
499 526 Slot documentation goes here.
500 527 """
501 528 print "AΓ±adimos operaciones Spectra,nchannels,value,format"
502 529 if self.nFFTPointOpSpecCEB.isChecked():
503 530 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
504 531 value=self.valuenFFTPointOpSpec.text()
505 532 upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int')
506 533
507 534 @pyqtSignature("int")
508 535 def on_SpectraPlotGraphCEB_stateChanged(self, p0):
509 536 """
510 537 Slot documentation goes here.
511 538 """
512 539 if p0==2:
513 540 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
514 541 opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other')
515 542 print opObj10.id
516 543 self.operObjList.append(opObj10)
517 544
518 545 if p0==0:
519 546 print " deshabilitado"
520 547
521 548 @pyqtSignature("int")
522 549 def on_CrossSpectraPlotGraphceb_stateChanged(self, p0):
523 550 """
524 551 Slot documentation goes here.
525 552 """
526 553 if p0==2:
527 554 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
528 555 opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other')
529 556 print opObj10.id
530 557 self.operObjList.append(opObj10)
531 558 if p0==0:
532 559 print " deshabilitado"
533 560
534 561 @pyqtSignature("int")
535 562 def on_RTIPlotGraphCEB_stateChanged(self, p0):
536 563 """
537 564 Slot documentation goes here.
538 565 """
539 566 if p0==2:
540 567 upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())]
541 568 opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other')
542 569 print opObj10.id
543 570 self.operObjList.append(opObj10)
544 571 if p0==0:
545 572 print " deshabilitado"
546 573
547 574
548 575 def resetgraphSpec(self):
549 576 self.SpectraPlotGraphCEB.setChecked(False)
550 577 self.CrossSpectraPlotGraphceb.setChecked(False)
551 578 self.RTIPlotGraphCEB.setChecked(False)
552 579
553 580 @pyqtSignature("")
554 581 def on_dataGraphSpecOkBtn_clicked(self):
555 582 """
556 583 Slot documentation goes here.
557 584 """
558 585 print "Graficar Spec op"
559 586 if self.SpectraPlotGraphCEB.isChecked():
560 587 for i in self.operObjList:
561 588 if i.name=='SpectraPlot':
562 589 i.addParameter(name='idfigure', value='1', format='int')
563 590 i.addParameter(name='wintitle', value='SpectraPlot0', format='str')
564 591 i.addParameter(name='zmin', value='40', format='int')
565 592 i.addParameter(name='zmax', value='90', format='int')
566 593 i.addParameter(name='showprofile', value='1', format='int')
567 594
568 595 if self.CrossSpectraPlotGraphceb.isChecked():
569 596 for i in self.operObjList:
570 597 if i.name=='CrossSpectraPlot' :
571 598 i.addParameter(name='idfigure', value='2', format='int')
572 599 i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str')
573 600 i.addParameter(name='zmin', value='40', format='int')
574 601 i.addParameter(name='zmax', value='90', format='int')
575 602
576 603 if self.RTIPlotGraphCEB.isChecked():
577 604 for i in self.operObjList:
578 605 if i.name=='RTIPlot':
579 606 i.addParameter(name='n', value='2', format='int')
580 607 i.addParameter(name='overlapping', value='1', format='int')
581 608
582 609 @pyqtSignature("")
583 610 def on_actionguardarObj_triggered(self):
584 611 """
585 612 GUARDAR EL ARCHIVO DE CONFIGURACION XML
586 613 """
587 614 if self.idp==1:
588 615 self.valuep=1
589 616
590 617 print "Escribiendo el archivo XML"
591 618 filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml"
592 619 self.controllerObj=self.proObjList[int(self.valuep)-1]
593 620 self.controllerObj.writeXml(filename)
594 621
595 622
596 623 class Window(QMainWindow, Ui_window):
597 624 """
598 625 Class documentation goes here.
599 626 """
600 627 closed=pyqtSignal()
601 628 def __init__(self, parent = None):
602 629 """
603 630 Constructor
604 631 """
605 632 QMainWindow.__init__(self, parent)
606 633 self.setupUi(self)
607 634 self.name=0
608 635 self.nameproject=None
609 636 self.proyectNameLine.setText('My_name_is...')
610 637 self.descriptionTextEdit.setText('Write a description...')
611 638
612 639
613 640 @pyqtSignature("")
614 641 def on_cancelButton_clicked(self):
615 642 """
616 643 Slot documentation goes here.
617 644 """
618 645 # TODO: not implemented yet
619 646 #raise NotImplementedError
620 647
621 648 self.hide()
622 649
623 650 @pyqtSignature("")
624 651 def on_okButton_clicked(self):
625 652 """
626 653 Slot documentation goes here.
627 654 """
628 655 #self.almacena()
629 656 self.close()
630 657
631 658 @pyqtSignature("")
632 659 def on_saveButton_clicked(self):
633 660 """
634 661 Slot documentation goes here.
635 662 """
636 663 self.almacena()
637 664 # self.close()
638 665
639 666 def almacena(self):
640 667 #print str(self.proyectNameLine.text())
641 668 self.nameproject=str(self.proyectNameLine.text())
642 669 self.description=str(self.descriptionTextEdit.toPlainText())
643 670 return self.nameproject,self.description
644 671
645 672 def closeEvent(self, event):
646 673 self.closed.emit()
647 674 event.accept()
648 675
649 676
650 677 class UnitProcess(QMainWindow, Ui_UnitProcess):
651 678 """
652 679 Class documentation goes here.
653 680 """
654 681 closed=pyqtSignal()
655 682 def __init__(self, parent = None):
656 683 """
657 684 Constructor
658 685 """
659 686 QMainWindow.__init__(self, parent)
660 687 self.setupUi(self)
661 688 self.getFromWindow=None
662 689 self.getfromWindowList=[]
663 690
664 691 self.listUP=None
665 692
666 693 def loadTotalList(self):
667 694 self.comboInputBox.clear()
668 695 for i in self.getfromWindowList:
669 696 name=i.getElementName()
670 697 id= i.id
671 698 if i.getElementName()=='ProcUnit':
672 699 id=int(i.id)-1
673 700 self.comboInputBox.addItem(str(name)+str(id))
674 701
675 702 @pyqtSignature("QString")
676 703 def on_comboInputBox_activated(self, p0):
677 704 """
678 705 Slot documentation goes here.
679 706 """
680 707
681 708 # TODO: not implemented yet
682 709 #raise NotImplementedError
683 710
684 711 @pyqtSignature("QString")
685 712 def on_comboTypeBox_activated(self, p0):
686 713 """
687 714 Slot documentation goes here.
688 715 """
689 716 # TODO: not implemented yet
690 717 #raise NotImplementedError
691 718
692 719 @pyqtSignature("")
693 720 def on_unitPokbut_clicked(self):
694 721 """
695 722 Slot documentation goes here.
696 723 """
697 724 self.close()
698 725
699 726 @pyqtSignature("")
700 727 def on_unitPsavebut_clicked(self):
701 728 """
702 729 Slot documentation goes here.
703 730 """
704 731
705 732 print "alex"
706 733 self.almacena()
707 734
708 735 @pyqtSignature("")
709 736 def on_unitPcancelbut_clicked(self):
710 737 """
711 738 Slot documentation goes here.
712 739 """
713 740 # TODO: not implemented yet
714 741 #raise NotImplementedError
715 742 self.hide()
716 743
717 744 def almacena(self):
718 745 self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())]
719 746 #self.nameofUP= str(self.nameUptxt.text())
720 747 self.typeofUP= str(self.comboTypeBox.currentText())
721 748 return self.getFromWindow,self.typeofUP
722 749
723 750 def closeEvent(self, event):
724 751 self.closed.emit()
725 752 event.accept()
726 753
727 754
728 755
729 756
730 757
731 758
732 759 No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now