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