This diff has been collapsed as it changes many lines, (629 lines changed) Show them Hide them | |||
@@ -1,932 +1,633 | |||
|
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 | 14 | from viewer.ui_unitprocess import Ui_UnitProcess |
|
14 | 15 | from viewer.ui_window import Ui_window |
|
15 | 16 | from viewer.ui_mainwindow import Ui_MainWindow |
|
16 | 17 | |
|
17 | 18 | |
|
18 | 19 | from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf |
|
19 | 20 | import os |
|
20 | 21 | |
|
21 | 22 | |
|
22 | class MainWindow(QMainWindow, Ui_MainWindow): | |
|
23 | class BodyMainWindow(QMainWindow, Ui_MainWindow): | |
|
23 | 24 | __projObjDict = {} |
|
24 | 25 | __arbolDict = {} |
|
26 | __upObjDict = {} | |
|
25 | 27 | |
|
26 | 28 | """ |
|
27 | 29 | Class documentation goes here. |
|
28 | 30 | #*##################VENTANA CUERPO DEL PROGRAMA#################### |
|
29 | 31 | """ |
|
30 | def __init__(self, parent = None): | |
|
32 | def __init__(self, parent = None): | |
|
31 | 33 | """ |
|
32 | 34 | Constructor |
|
33 | 35 | """ |
|
34 | 36 | print "Inicio de Programa Interfaz Gráfica" |
|
35 | 37 | QMainWindow.__init__(self, parent) |
|
36 | 38 | self.setupUi(self) |
|
39 | ||
|
40 | self.indexclick=None | |
|
37 | 41 | |
|
38 | 42 | self.online=0 |
|
39 | 43 | self.datatype=0 |
|
40 | 44 | self.variableList=[] |
|
41 | 45 | |
|
42 | 46 | self.proObjList=[] |
|
43 | 47 | self.idp=0 |
|
44 | 48 | self.namep=0 |
|
45 | 49 | self.description=0 |
|
46 | 50 | self.namepTree=0 |
|
47 | 51 | self.valuep=0 |
|
48 | 52 | |
|
49 | 53 | self.upObjList= [] |
|
50 | 54 | self.upn=0 |
|
51 | 55 | self.upName=0 |
|
52 | 56 | self.upType=0 |
|
53 | 57 | self.uporProObjRecover=0 |
|
54 | 58 | |
|
55 | 59 | self.readUnitConfObjList=[] |
|
56 | 60 | |
|
57 | 61 | self.upObjVolList=[] |
|
58 | 62 | self.upobjSpecList=[] |
|
59 | 63 | |
|
60 | 64 | self.operObjList=[] |
|
61 | 65 | |
|
62 | 66 | self.configProject=None |
|
63 | 67 | self.configUP=None |
|
64 |
|
|
|
65 | ||
|
66 | self.controllerObj=None | |
|
68 | ||
|
67 | 69 | self.readUnitConfObj=None |
|
68 | 70 | self.procUnitConfObj0=None |
|
69 | 71 | self.opObj10=None |
|
70 | 72 | self.opObj12=None |
|
71 | 73 | |
|
72 | 74 | self.setParam() |
|
73 | 75 | |
|
74 | 76 | #-----------------------------------NEW PROPERTIES------------------------------------------------# |
|
75 | 77 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
76 | 78 | self.addprojectBtn.setToolTip('Add_New_Project') |
|
77 | 79 | self.addUnitProces.setToolTip('Add_New_Processing_Unit') |
|
78 | 80 | |
|
79 | 81 | #-----------------------------------NEW PROPERTIES------------------------------------------------# |
|
80 | 82 | self.model = QtGui.QStandardItemModel() |
|
81 | 83 | self.treeView.setModel(self.model) |
|
82 | 84 | self.treeView.clicked.connect(self.clickFunctiontree) |
|
83 | 85 | self.treeView.expandAll() |
|
84 | 86 | #self.treeView.clicked.connect(self.treefunction1) |
|
85 | 87 | |
|
86 | 88 | #-----------------------------------BARRA DE MENU-------------------------------------------------# |
|
87 | 89 | |
|
88 | 90 | #----------------------------------- MENU_PROJECT--------------------------------------------------# |
|
89 | 91 | |
|
90 | 92 | @pyqtSignature("") |
|
91 | 93 | def on_menuFileAbrirObj_triggered(self): |
|
92 | 94 | """ |
|
93 | METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR | |
|
95 | Abre un archivo de configuracion seleccionado, lee los parametros y | |
|
96 | actualiza los atributos de esta clase; creando los objetos necesarios | |
|
97 | con los parametros leidos desde el archivo. | |
|
94 | 98 | """ |
|
95 | 99 | print "Leer un archivo xml y extraer sus atributos Not implemented yet" |
|
96 | 100 | |
|
97 | 101 | @pyqtSignature("") |
|
98 | 102 | def on_menuFileCrearObj_triggered(self): |
|
99 | 103 | """ |
|
100 | CREAR PROJECT,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS | |
|
101 | Llama al metodo addProject.. | |
|
104 | Crea un proyecto nuevo y lo anade a mi diccionario de proyectos | |
|
105 | y habilita la ventana de configuracion del proyecto. | |
|
106 | ||
|
102 | 107 | """ |
|
103 | 108 | self.addProject() |
|
104 | 109 | |
|
105 | 110 | @pyqtSignature("") |
|
106 |
def on_menuFileGuardarObj_ |
|
|
111 | def on_menuFileGuardarObj_triggered(self): | |
|
107 | 112 | """ |
|
108 | 113 | METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO |
|
114 | ||
|
109 | 115 | Llama al metodo saveProject. |
|
110 | 116 | """ |
|
117 | # my_id = arbol_selected() | |
|
118 | # filename = savefindow.show() | |
|
119 | # self.saveProject(id, filename) | |
|
120 | print "probsave" | |
|
111 | 121 | self.saveProject() |
|
112 | 122 | |
|
113 | 123 | @pyqtSignature("") |
|
114 |
def on_menuFileCerrarObj_ |
|
|
124 | def on_menuFileCerrarObj_triggered(self): | |
|
115 | 125 | """ |
|
116 | 126 | METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR |
|
117 | 127 | Llama al metodo close. |
|
118 | 128 | """ |
|
119 | 129 | self.close() |
|
120 | 130 | |
|
121 | 131 | #-----------------------------------MENU_RUN----------------------------------------------------# |
|
122 | 132 | |
|
123 | 133 | @pyqtSignature("") |
|
124 | 134 | def on_menuRUNStartObj_clicked(self): |
|
125 | 135 | """ |
|
126 | 136 | METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN |
|
127 | 137 | Llama al metodo RUN. |
|
128 | 138 | """ |
|
129 | 139 | print "Not implemented yet" |
|
130 | 140 | |
|
131 | 141 | @pyqtSignature("") |
|
132 | 142 | def on_menuRUNPausaObj_clicked(self): |
|
133 | 143 | """ |
|
134 | 144 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA |
|
135 | 145 | Llama al metodo PAUSA. |
|
136 | 146 | """ |
|
137 | 147 | print "Not implemented yet" |
|
138 | 148 | |
|
139 | 149 | #-----------------------------------MENU_OPTION-------------------------------------------------# |
|
150 | ||
|
140 | 151 | @pyqtSignature("") |
|
141 | 152 | def on_menuOptConfigLogfileObj_clicked(self): |
|
142 | 153 | """ |
|
143 | 154 | METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog |
|
144 | 155 | Llama al metodo close. |
|
145 | 156 | """ |
|
146 | 157 | print "Not implemented yet" |
|
147 | 158 | |
|
148 | ||
|
149 | 159 | @pyqtSignature("") |
|
150 | 160 | def on_menuOptConfigserverObj_clicked(self): |
|
151 | 161 | """ |
|
152 | 162 | METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server |
|
153 | 163 | Llama al metodo close. |
|
154 | 164 | """ |
|
155 | 165 | print "Not implemented yet" |
|
156 | 166 | #-----------------------------------MENU_HELP-------------------------------------------------------# |
|
167 | ||
|
157 | 168 | @pyqtSignature("") |
|
158 | 169 | def on_menuHELPAboutObj_clicked(self): |
|
159 | 170 | """ |
|
160 | 171 | METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP |
|
161 | 172 | Llama al metodo close. |
|
162 | 173 | """ |
|
163 | 174 | print "Not implemented yet" |
|
164 | 175 | |
|
165 | 176 | @pyqtSignature("") |
|
166 | 177 | def on_menuHELPPrfObj_clicked(self): |
|
167 | 178 | """ |
|
168 | 179 | METODO EJECUTADO CUANDO OCURRE EL EVENTO HElp |
|
169 | 180 | Llama al metodo close. |
|
170 | 181 | """ |
|
171 | 182 | print "Not implemented yet" |
|
172 | 183 | |
|
173 | 184 | #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------# |
|
174 | 185 | |
|
175 | 186 | @pyqtSignature("") |
|
176 | 187 | def on_actOpenObj_triggered(self): |
|
177 | 188 | """ |
|
178 | 189 | METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR |
|
179 | 190 | """ |
|
180 | 191 | print "Leer un archivo xml y extraer sus atributos Not implemented yet" |
|
181 | 192 | |
|
182 | 193 | @pyqtSignature("") |
|
183 | 194 | def on_actCreateObj_triggered(self): |
|
184 | 195 | """ |
|
185 | 196 | CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS |
|
186 | 197 | Llama al metodo addProject. |
|
187 | 198 | """ |
|
188 | 199 | self.addProject() |
|
189 | ||
|
190 | ||
|
200 | ||
|
191 | 201 | @pyqtSignature("") |
|
192 | 202 | def on_actStopObj_triggered(self): |
|
193 | 203 | """ |
|
194 | 204 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA |
|
195 | 205 | Llama al metodo PAUSA. |
|
196 | 206 | """ |
|
197 | 207 | print "Not implemented yet" |
|
198 | 208 | |
|
199 | 209 | @pyqtSignature("") |
|
200 | 210 | def on_actPlayObj_triggered(self): |
|
201 | 211 | """ |
|
202 | 212 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA |
|
203 | 213 | Llama al metodo PAUSA. |
|
204 | 214 | """ |
|
205 | 215 | print "Not implemented yet" |
|
206 | 216 | |
|
207 | 217 | @pyqtSignature("") |
|
208 | 218 | def on_actSaveObj_triggered(self): |
|
209 | 219 | """ |
|
210 | 220 | METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE |
|
211 | 221 | Llama al metodo SAVE. |
|
212 | 222 | """ |
|
213 | 223 | self.saveProject() |
|
214 | 224 | |
|
215 | 225 | #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------# |
|
216 | 226 | |
|
217 | 227 | @pyqtSignature("") |
|
218 | 228 | def on_addprojectBtn_clicked(self): |
|
219 | 229 | """ |
|
220 | 230 | CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS |
|
221 | 231 | Llama al metodo addProject. |
|
222 | 232 | """ |
|
223 | 233 | self.addProject() |
|
224 | 234 | |
|
225 | 235 | #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------# |
|
226 | ||
|
227 | 236 | |
|
228 | 237 | @pyqtSignature("int") |
|
229 | 238 | def on_dataTypeCmbBox_activated(self,index): |
|
230 | 239 | """ |
|
231 | 240 | Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA |
|
232 | 241 | """ |
|
233 | 242 | self.dataFormatTxt.setReadOnly(True) |
|
234 | 243 | if index==0: |
|
235 | 244 | self.datatype='Voltage' |
|
236 | 245 | elif index==1: |
|
237 | 246 | self.datatype='Spectra' |
|
238 | 247 | else : |
|
239 | 248 | self.datatype='' |
|
240 | 249 | self.dataFormatTxt.setReadOnly(False) |
|
241 | 250 | self.dataFormatTxt.setText(self.datatype) |
|
242 | 251 | |
|
243 | 252 | @pyqtSignature("") |
|
244 | 253 | def on_dataPathBrowse_clicked(self): |
|
245 | 254 | """ |
|
246 | 255 | OBTENCION DE LA RUTA DE DATOS |
|
247 | 256 | """ |
|
248 | 257 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
249 | 258 | self.dataPathTxt.setText(self.dataPath) |
|
250 | 259 | self.statusDpath=self.existDir(self.dataPath) |
|
251 | 260 | self.loadDays() |
|
252 | 261 | |
|
253 | 262 | @pyqtSignature("int") |
|
254 | 263 | def on_starDateCmbBox_activated(self, index): |
|
255 | 264 | """ |
|
256 | 265 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
257 | 266 | """ |
|
258 | 267 | var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex() |
|
259 | 268 | self.endDateCmbBox.clear() |
|
260 | 269 | for i in self.variableList[index:]: |
|
261 | 270 | self.endDateCmbBox.addItem(i) |
|
262 | 271 | self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index) |
|
263 | 272 | self.getsubList() |
|
264 | 273 | |
|
265 | 274 | @pyqtSignature("int") |
|
266 | 275 | def on_endDateCmbBox_activated(self, index): |
|
267 | 276 | """ |
|
268 | 277 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
269 | 278 | """ |
|
270 | 279 | var_StartDay_index=self.starDateCmbBox.currentIndex() |
|
271 | 280 | var_end_index = self.endDateCmbBox.count() - index |
|
272 | 281 | self.starDateCmbBox.clear() |
|
273 | 282 | for i in self.variableList[:len(self.variableList) - var_end_index + 1]: |
|
274 | 283 | self.starDateCmbBox.addItem(i) |
|
275 | 284 | self.starDateCmbBox.setCurrentIndex(var_StartDay_index) |
|
276 | 285 | self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas |
|
277 | 286 | |
|
278 | 287 | @pyqtSignature("int") |
|
279 | 288 | def on_readModeCmBox_activated(self, p0): |
|
280 | 289 | """ |
|
281 | 290 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
282 | 291 | """ |
|
283 | 292 | if p0==0: |
|
284 | 293 | self.online=0 |
|
285 | 294 | elif p0==1: |
|
286 | 295 | self.online=1 |
|
287 | 296 | |
|
288 |
|
|
|
297 | #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------# | |
|
289 | 298 | |
|
290 | 299 | @pyqtSignature("") |
|
291 | 300 | def on_dataOkBtn_clicked(self): |
|
292 | 301 | """ |
|
293 | 302 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
294 | 303 | Prepara la configuración del diágrama del Arbol del treeView numero 2 |
|
295 | 304 | """ |
|
296 | 305 | print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online" |
|
297 | ||
|
298 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] | |
|
299 | datatype=str(self.dataTypeCmbBox.currentText()) | |
|
300 | path=str(self.dataPathTxt.text()) | |
|
301 | online=int(self.online) | |
|
302 | starDate=str(self.starDateCmbBox.currentText()) | |
|
303 | endDate=str(self.endDateCmbBox.currentText()) | |
|
306 | ||
|
307 | for i in self.__arbolDict: | |
|
308 | if self.__arbolDict[i]==self.indexclick: | |
|
309 | self.projectObj=self.__projObjDict[int(i)] | |
|
310 | # print self.projectObj | |
|
311 | # print i | |
|
312 | # print "get",self.__arbolDict.items() | |
|
313 | # print "keys",self.__arbolDict.keys() | |
|
314 | self.description="Think" | |
|
315 | id=i | |
|
316 | name=str(self.nameProjectTxt.text()) | |
|
317 | desc=str(self.description) | |
|
318 | ||
|
319 | self.projectObj.setup(id = id, name=name, description=desc) | |
|
320 | print self.projectObj.id | |
|
321 | # print self.projectObj.name | |
|
322 | # print self.projectObj.description | |
|
323 | ||
|
324 | datatype=str(self.dataTypeCmbBox.currentText()) | |
|
325 | path=str(self.dataPathTxt.text()) | |
|
326 | online=int(self.online) | |
|
327 | starDate=str(self.starDateCmbBox.currentText()) | |
|
328 | endDate=str(self.endDateCmbBox.currentText()) | |
|
304 | 329 | |
|
305 | 330 | |
|
306 | self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype, | |
|
307 | path=path, | |
|
308 | startDate=starDate, | |
|
309 | endDate=endDate, | |
|
310 | startTime='06:10:00', | |
|
311 | endTime='23:59:59', | |
|
312 | online=online) | |
|
313 | ||
|
314 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
|
315 | ||
|
316 | print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online | |
|
317 | ||
|
318 | ||
|
319 | self.model_2=treeModel() | |
|
320 | ||
|
321 | self.model_2.setParams(name=projectObj.name+str(projectObj.id), | |
|
322 |
|
|
|
323 | workspace="C:\\WorkspaceGUI", | |
|
324 | remode=str(self.readModeCmBox.currentText()), | |
|
325 |
|
|
|
326 |
|
|
|
327 | initTime='06:10:00', | |
|
328 | endTime='23:59:59', | |
|
329 | timezone="Local" , | |
|
330 | Summary="test de prueba") | |
|
331 | self.model_2.arbol() | |
|
332 | self.treeView_2.setModel(self.model_2) | |
|
333 | self.treeView_2.expandAll() | |
|
334 | ||
|
335 | ||
|
331 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype=datatype, | |
|
332 | path=path, | |
|
333 | startDate=starDate, | |
|
334 | endDate=endDate, | |
|
335 | startTime='06:10:00', | |
|
336 | endTime='23:59:59', | |
|
337 | online=online) | |
|
338 | ||
|
339 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
|
340 | print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online | |
|
341 | ||
|
342 | self.model_2=treeModel() | |
|
343 | self.model_2.setParams(name=self.projectObj.name+str(self.projectObj.id), | |
|
344 | directorio=path, | |
|
345 | workspace="C:\\WorkspaceGUI", | |
|
346 | remode=str(self.readModeCmBox.currentText()), | |
|
347 | dataformat=datatype, | |
|
348 | date=str(starDate)+"-"+str(endDate), | |
|
349 | initTime='06:10:00', | |
|
350 | endTime='23:59:59', | |
|
351 | timezone="Local" , | |
|
352 | Summary="test de prueba") | |
|
353 | self.model_2.arbol() | |
|
354 | self.treeView_2.setModel(self.model_2) | |
|
355 | self.treeView_2.expandAll() | |
|
356 | ||
|
357 | # | |
|
336 | 358 | #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------# |
|
337 | 359 | @pyqtSignature("") |
|
338 | 360 | def on_addUnitProces_clicked(self): |
|
339 | 361 | """ |
|
340 | 362 | CREAR PROCESSING UNI ,ANADE UNA UNIDAD DE PROCESAMIENTO, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO |
|
341 | 363 | Llama al metodo addUP. |
|
342 | 364 | """ |
|
343 | 365 | # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" |
|
344 | # self.procUnitConfObj0 = self.controllerObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId()) | |
|
345 | 366 | self.addUP() |
|
346 | 367 | |
|
347 | ||
|
348 | #-----------------VENTANA CONFIGURACION DE VOLTAGE---------------------------# | |
|
349 | ||
|
350 | @pyqtSignature("int") | |
|
351 | def on_selecChannelopVolCEB_stateChanged(self, p0): | |
|
352 | """ | |
|
353 | Check Box habilita operaciones de Selección de Canales | |
|
354 | """ | |
|
355 | if p0==2: | |
|
356 | self.numberChannelopVol.setEnabled(True) | |
|
357 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
|
358 | opObj10=upProcessSelect.addOperation(name='selectChannels') | |
|
359 | print opObj10.id | |
|
360 | self.operObjList.append(opObj10) | |
|
361 | print " Ingresa seleccion de Canales" | |
|
362 | if p0==0: | |
|
363 | print " deshabilitado" | |
|
364 | ||
|
365 | @pyqtSignature("int") | |
|
366 | def on_selecHeighopVolCEB_stateChanged(self, p0): | |
|
367 | """ | |
|
368 | Check Box habilita operaciones de Selección de Alturas | |
|
369 | """ | |
|
370 | if p0==2: | |
|
371 | self.lineHeighProfileTxtopVol.setEnabled(True) | |
|
372 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
|
373 | opObj10=upProcessSelect.addOperation(name='selectHeights') | |
|
374 | print opObj10.id | |
|
375 | self.operObjList.append(opObj10) | |
|
376 | print " Select Type of Profile" | |
|
377 | if p0==0: | |
|
378 | print " deshabilitado" | |
|
379 | ||
|
380 | ||
|
381 | @pyqtSignature("int") | |
|
382 | def on_profileSelecopVolCEB_stateChanged(self, p0): | |
|
383 | """ | |
|
384 | Check Box habilita ingreso del rango de Perfiles | |
|
385 | """ | |
|
386 | if p0==2: | |
|
387 | self.lineProfileSelecopVolCEB.setEnabled(True) | |
|
388 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
|
389 | opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other') | |
|
390 | print opObj10.id | |
|
391 | self.operObjList.append(opObj10) | |
|
392 | print " Select Type of Profile" | |
|
393 | if p0==0: | |
|
394 | print " deshabilitado" | |
|
395 | ||
|
396 | ||
|
397 | @pyqtSignature("int") | |
|
398 | def on_coherentIntegrationCEB_stateChanged(self, p0): | |
|
399 | """ | |
|
400 | Check Box habilita ingresode del numero de Integraciones a realizar | |
|
401 | """ | |
|
402 | if p0==2: | |
|
403 | self.numberIntegration.setEnabled(True) | |
|
404 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
|
405 | opObj10=upProcessSelect.addOperation(name='CohInt', optype='other') | |
|
406 | print opObj10.id | |
|
407 | self.operObjList.append(opObj10) | |
|
408 | print "Choose number of Cohint" | |
|
409 | if p0==0: | |
|
410 | print " deshabilitado" | |
|
411 | self.numberChannelopVol.setEnabled(False) | |
|
412 | ||
|
413 | #-----------------------PUSHBUTTON_ACCEPT_OPERATION----------------------------# | |
|
414 | ||
|
415 | @pyqtSignature("") | |
|
416 | def on_dataopVolOkBtn_clicked(self): | |
|
417 | """ | |
|
418 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AÑADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
|
419 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
|
420 | """ | |
|
421 | if self.selecChannelopVolCEB.isChecked(): | |
|
422 | for i in self.operObjList: | |
|
423 | if i.name=='selectChannels': | |
|
424 | value=self.numberChannelopVol.text() | |
|
425 | i.addParameter(name='channelList', value=value, format='intlist') | |
|
426 | ||
|
427 | ||
|
428 | print "channel" | |
|
429 | ||
|
430 | if self.selecHeighopVolCEB.isChecked(): | |
|
431 | for i in self.operObjList: | |
|
432 | if i.name=='selectHeights' : | |
|
433 | value=self.lineHeighProfileTxtopVol.text() | |
|
434 | valueList=value.split(',') | |
|
435 | i.addParameter(name='minHei', value=valueList[0], format='float') | |
|
436 | i.addParameter(name='maxHei', value=valueList[1], format='float') | |
|
437 | ||
|
438 | print "height" | |
|
439 | ||
|
440 | ||
|
441 | if self.selecHeighopVolCEB.isChecked(): | |
|
442 | for i in self.operObjList: | |
|
443 | if i.name=='ProfileSelector' : | |
|
444 | value=self.lineProfileSelecopVolCEB.text() | |
|
445 | i.addParameter(name='ProfileSelector', value=value, format='intlist') | |
|
446 | ||
|
447 | ||
|
448 | ||
|
449 | if self.coherentIntegrationCEB.isChecked(): | |
|
450 | for i in self.operObjList: | |
|
451 | if i.name=='CohInt': | |
|
452 | value=self.numberIntegration.text() | |
|
453 | i.addParameter(name='n', value=value, format='int') | |
|
454 | ||
|
455 | ||
|
456 | #-------------------------VENTANA DE CONFIGURACION SPECTRA------------------------# | |
|
457 | ||
|
458 | @pyqtSignature("int") | |
|
459 | def on_nFFTPointOpSpecCEB_stateChanged(self, p0): | |
|
460 | """ | |
|
461 | Habilita la opcion de añadir el parámetro nFFTPoints a la Unidad de Procesamiento . | |
|
462 | """ | |
|
463 | if p0==2: | |
|
464 | self.valuenFFTPointOpSpec.setEnabled(True) | |
|
465 | print " nFFTPoint" | |
|
466 | if p0==0: | |
|
467 | print " deshabilitado" | |
|
468 | ||
|
469 | #------------------PUSH_BUTTON_SPECTRA_OK------------------------------------# | |
|
470 | ||
|
471 | @pyqtSignature("") | |
|
472 | def on_dataopSpecOkBtn_clicked(self): | |
|
473 | """ | |
|
474 | Añade al archivo de configuración el parámetros nFFTPoints a la UP. | |
|
475 | """ | |
|
476 | print "Añadimos operaciones Spectra,nchannels,value,format" | |
|
477 | if self.nFFTPointOpSpecCEB.isChecked(): | |
|
478 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
|
479 | value=self.valuenFFTPointOpSpec.text() | |
|
480 | upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int') | |
|
481 | #---------------------VENTANA DE CONFIGURACION GRAPH SPECTRA------------------# | |
|
482 | ||
|
483 | @pyqtSignature("int") | |
|
484 | def on_SpectraPlotGraphCEB_stateChanged(self, p0): | |
|
485 | """ | |
|
486 | Habilita la opcion de Ploteo Spectra Plot | |
|
487 | """ | |
|
488 | if p0==2: | |
|
489 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
|
490 | opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other') | |
|
491 | print opObj10.id | |
|
492 | self.operObjList.append(opObj10) | |
|
493 | ||
|
494 | if p0==0: | |
|
495 | print " deshabilitado" | |
|
496 | ||
|
497 | @pyqtSignature("int") | |
|
498 | def on_CrossSpectraPlotGraphceb_stateChanged(self, p0): | |
|
499 | """ | |
|
500 | Habilita la opción de Ploteo CrossSpectra | |
|
501 | """ | |
|
502 | if p0==2: | |
|
503 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
|
504 | opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other') | |
|
505 | print opObj10.id | |
|
506 | self.operObjList.append(opObj10) | |
|
507 | if p0==0: | |
|
508 | print " deshabilitado" | |
|
509 | ||
|
510 | @pyqtSignature("int") | |
|
511 | def on_RTIPlotGraphCEB_stateChanged(self, p0): | |
|
512 | """ | |
|
513 | Habilita la opción de Plote RTIPlot | |
|
514 | """ | |
|
515 | if p0==2: | |
|
516 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
|
517 | opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other') | |
|
518 | print opObj10.id | |
|
519 | self.operObjList.append(opObj10) | |
|
520 | if p0==0: | |
|
521 | print " deshabilitado" | |
|
522 | ||
|
523 | #------------------PUSH_BUTTON_SPECTRA_GRAPH_OK-----------------------------# | |
|
524 | @pyqtSignature("") | |
|
525 | def on_dataGraphSpecOkBtn_clicked(self): | |
|
526 | """ | |
|
527 | HABILITAR DE ACUERDO A LOS CHECKBOX QUE TIPO DE PLOTEOS SE VAN A REALIZAR MUESTRA Y GRABA LAS IMAGENES. | |
|
528 | """ | |
|
529 | print "Graficar Spec op" | |
|
530 | if self.SpectraPlotGraphCEB.isChecked(): | |
|
531 | for i in self.operObjList: | |
|
532 | if i.name=='SpectraPlot': | |
|
533 | i.addParameter(name='idfigure', value='1', format='int') | |
|
534 | i.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
|
535 | i.addParameter(name='zmin', value='40', format='int') | |
|
536 | i.addParameter(name='zmax', value='90', format='int') | |
|
537 | i.addParameter(name='showprofile', value='1', format='int') | |
|
538 | ||
|
539 | if self.CrossSpectraPlotGraphceb.isChecked(): | |
|
540 | for i in self.operObjList: | |
|
541 | if i.name=='CrossSpectraPlot' : | |
|
542 | i.addParameter(name='idfigure', value='2', format='int') | |
|
543 | i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
|
544 | i.addParameter(name='zmin', value='40', format='int') | |
|
545 | i.addParameter(name='zmax', value='90', format='int') | |
|
546 | ||
|
547 | if self.RTIPlotGraphCEB.isChecked(): | |
|
548 | for i in self.operObjList: | |
|
549 | if i.name=='RTIPlot': | |
|
550 | i.addParameter(name='n', value='2', format='int') | |
|
551 | i.addParameter(name='overlapping', value='1', format='int') | |
|
552 | ||
|
553 | ||
|
368 | #----------------------------BASICO-----------------------------------# | |
|
369 | ||
|
554 | 370 | def getNumberofProject(self): |
|
555 | 371 | # for i in self.proObjList: |
|
556 | 372 | # print i |
|
557 | 373 | return self.proObjList |
|
558 | 374 | # for i in self.proObjList: |
|
559 | 375 | # print i |
|
560 | 376 | |
|
561 | 377 | def setParam(self): |
|
562 | 378 | |
|
563 | 379 | self.tabWidgetProject.setEnabled(False) |
|
564 | 380 | self.dataPathTxt.setText('C:\data') |
|
565 | 381 | self.nameProjectTxt.setText("Test") |
|
566 | 382 | self.numberChannelopVol.setEnabled(False) |
|
567 | 383 | self.lineHeighProfileTxtopVol.setEnabled(False) |
|
568 | 384 | self.numberIntegration.setEnabled(False) |
|
569 | 385 | self.valuenFFTPointOpSpec.setEnabled(False) |
|
570 | 386 | self.lineProfileSelecopVolCEB.setEnabled(False) |
|
571 | 387 | |
|
572 | ||
|
573 | 388 | def clickFunctiontree(self,index): |
|
574 |
indexclick= index.model().itemFromIndex(index) |
|
|
575 |
|
|
|
576 |
|
|
|
577 | self.valuep=NumofPro | |
|
578 | #print self.valuep | |
|
579 |
|
|
|
580 | self.namepTree=NameofPro | |
|
581 |
|
|
|
389 | self.indexclick= index.model().itemFromIndex(index) | |
|
390 | print self.indexclick | |
|
391 | return self.indexclick | |
|
392 | # self.indexclick= index.model().itemFromIndex(index).text() | |
|
393 | # return self.indexclick | |
|
394 | # print self.indexclick() | |
|
395 | # print index.model().itemFromIndex(index) | |
|
396 | # print self.indexclick | |
|
397 | # NumofPro=self.indexclick[8:10] | |
|
398 | # self.valuep=NumofPro | |
|
399 | # #print self.valuep | |
|
400 | # NameofPro=self.indexclick[0:7] | |
|
401 | # self.namepTree=NameofPro | |
|
402 | # print self.namepTree | |
|
582 | 403 | |
|
583 | 404 | def addProject(self): |
|
584 | 405 | self.tabWidgetProject.setEnabled(True) |
|
585 | 406 | print "En este nivel se debe crear el proyecto,id,nombre,desc" |
|
586 | #+++++Creacion del Objeto Controller-XML++++++++++# | |
|
587 | ||
|
407 | #+++++++++++++++++++Creacion del Objeto Controller-XML+++++++++++++# | |
|
408 | ||
|
588 | 409 | self.idp += 1 |
|
589 | 410 | self.projectObj = Project() |
|
590 | self.description="Think" | |
|
591 | id=int(self.idp) | |
|
592 | name=str(self.nameProjectTxt.text()) | |
|
593 | desc=str(self.description) | |
|
411 | print self.projectObj | |
|
412 | self.__projObjDict[self.idp] = self.projectObj | |
|
594 | 413 | |
|
595 | self.projectObj.setup(id = id, name=name, description=desc) | |
|
596 | self.__projObjDict[id] = self.projectObj | |
|
414 | #++++++++++++++++++Creación del Arbol++++++++++++++++++++# | |
|
597 | 415 | self.parentItem = self.model.invisibleRootItem() |
|
598 | self.__arbolDict[id] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp)) | |
|
599 | self.parentItem.appendRow(self.__arbolDict[self.projectObj.id]) | |
|
600 |
|
|
|
601 | ||
|
602 | #self.configProject=Window(self) | |
|
603 | #self.configProject.closed.connect(self.show) | |
|
604 | #self.configProject.show() | |
|
605 | #self.configProject.closed.connect(self.show) | |
|
606 | # self.configProject.saveButton.clicked.connect(self.reciveParameters) | |
|
607 | #self.configProject.closed.connect(self.createProject) | |
|
608 | ||
|
609 | ||
|
610 | ||
|
611 | ||
|
612 | ||
|
613 | ||
|
614 | ||
|
615 | ||
|
616 | #+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++# | |
|
617 | ||
|
618 | ||
|
619 | # self.parentItem=self.projectObj.arbol | |
|
620 | # self.loadProjects() | |
|
621 | ||
|
622 | print "Porfavor ingrese los parámetros de configuracion del Proyecto" | |
|
623 | ||
|
624 | ||
|
625 | ||
|
626 | ||
|
627 | ||
|
628 | def reciveParameters(self): | |
|
629 | self.namep,self.description =self.configProject.almacena() | |
|
630 | ||
|
631 | def createProject(self): | |
|
632 | ||
|
633 | print "En este nivel se debe crear el proyecto,id,nombre,desc" | |
|
634 | #+++++Creacion del Objeto Controller-XML++++++++++# | |
|
635 | self.idp += 1 | |
|
636 | self.controllerObj = Project() | |
|
637 | id=int(self.idp) | |
|
638 | name=str(self.namep) | |
|
639 | desc=str(self.description) | |
|
640 | self.parentItem=self.model.invisibleRootItem() | |
|
641 | self.controllerObj.arbol=QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp)) | |
|
642 | self.controllerObj.setup(id = id, name=name, description=desc) | |
|
643 | self.parentItem.appendRow(self.controllerObj.arbol) | |
|
644 | self.proObjList.append(self.controllerObj)#+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++# | |
|
645 | self.parentItem=self.controllerObj.arbol | |
|
646 | self.loadProjects() | |
|
416 | name=str(self.nameProjectTxt.text()) | |
|
417 | self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name+" %0").arg(self.idp)) | |
|
418 | print self.__arbolDict[self.idp] | |
|
419 | self.parentItem.appendRow(self.__arbolDict[self.idp]) | |
|
420 | self.parentItem=self.__arbolDict[self.idp] | |
|
647 | 421 | |
|
648 | 422 | print "Porfavor ingrese los parámetros de configuracion del Proyecto" |
|
649 |
|
|
|
650 | def loadProjects(self): | |
|
651 | ||
|
652 | self.proConfCmbBox.clear() | |
|
653 | for i in self.proObjList: | |
|
654 | self.proConfCmbBox.addItem("Project"+str(i.id)) | |
|
655 | ||
|
656 | ||
|
657 | ||
|
423 | ||
|
658 | 424 | def existDir(self, var_dir): |
|
659 | 425 | """ |
|
660 | 426 | METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR |
|
661 | 427 | VARIABLE DIRECCION |
|
662 | 428 | """ |
|
663 | 429 | if os.path.isdir(var_dir): |
|
664 | 430 | return True |
|
665 | 431 | else: |
|
666 | 432 | self.textEdit.append("Incorrect path:" + str(var_dir)) |
|
667 | 433 | return False |
|
668 | 434 | |
|
669 | 435 | def loadDays(self): |
|
670 | 436 | """ |
|
671 | 437 | METODO PARA CARGAR LOS DIAS |
|
672 | 438 | """ |
|
673 | 439 | self.variableList=[] |
|
674 | 440 | self.starDateCmbBox.clear() |
|
675 | 441 | self.endDateCmbBox.clear() |
|
676 | 442 | |
|
677 | 443 | Dirlist = os.listdir(self.dataPath) |
|
678 | 444 | Dirlist.sort() |
|
679 | 445 | |
|
680 | 446 | for a in range(0, len(Dirlist)): |
|
681 | 447 | fname= Dirlist[a] |
|
682 | 448 | Doy=fname[5:8] |
|
683 | 449 | fname = fname[1:5] |
|
684 | 450 | print fname |
|
685 | 451 | fecha=Doy2Date(int(fname),int(Doy)) |
|
686 | 452 | fechaList=fecha.change2date() |
|
687 | 453 | #print fechaList[0] |
|
688 | 454 | Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1]) |
|
689 | 455 | #+"-"+ fechaList[0]+"-"+fechaList[1] |
|
690 | 456 | |
|
691 | 457 | #---------------AQUI TIENE QUE SER MODIFICADO--------# |
|
692 | 458 | |
|
693 | 459 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) |
|
694 | 460 | for i in range(0, (len(Dirlist))): |
|
695 | 461 | self.variableList.append(Dirlist[i]) |
|
696 | 462 | |
|
697 | 463 | for i in self.variableList: |
|
698 | 464 | self.starDateCmbBox.addItem(i) |
|
699 | 465 | self.endDateCmbBox.addItem(i) |
|
700 | 466 | self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) |
|
701 | 467 | |
|
702 | 468 | self.getsubList() |
|
703 | 469 | self.dataOkBtn.setEnabled(True) |
|
704 | 470 | |
|
705 | 471 | def getsubList(self): |
|
706 | 472 | """ |
|
707 | 473 | OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS |
|
708 | 474 | """ |
|
709 | 475 | self.subList=[] |
|
710 | 476 | for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]: |
|
711 | 477 | self.subList.append(i) |
|
712 | 478 | |
|
713 | 479 | def addUP(self): |
|
714 | 480 | |
|
715 | 481 | self.configUP=UnitProcess(self) |
|
716 |
for i in self. |
|
|
717 | self.configUP.getfromWindowList.append(i) | |
|
718 | #print i | |
|
719 | for i in self.upObjList: | |
|
720 | self.configUP.getfromWindowList.append(i) | |
|
482 | for i in self.__arbolDict: | |
|
483 | if self.__arbolDict[i]==self.indexclick: | |
|
484 | if self.__projObjDict.has_key(i)==True: | |
|
485 | self.projectObj=self.__projObjDict[int(i)] | |
|
486 | print self.projectObj.id | |
|
487 | self.configUP.getfromWindowList.append(self.projectObj) | |
|
488 | ||
|
489 | ||
|
490 | for i in self.projectObj.procUnitConfObjDict: | |
|
491 | if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit': | |
|
492 | self.upObj=self.projectObj.procUnitConfObjDict[i] | |
|
493 | self.configUP.getfromWindowList.append(self.upObj) | |
|
494 | ||
|
495 | ||
|
496 | ||
|
721 | 497 | self.configUP.loadTotalList() |
|
722 | 498 | self.configUP.show() |
|
723 | self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) | |
|
499 | #self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) | |
|
724 | 500 | self.configUP.closed.connect(self.createUP) |
|
725 | 501 | |
|
726 | def reciveUPparameters(self): | |
|
727 | ||
|
728 | self.uporProObjRecover,self.upType=self.configUP.almacena() | |
|
729 | ||
|
502 | ||
|
730 | 503 | |
|
731 | 504 | def createUP(self): |
|
505 | ||
|
732 | 506 | print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" |
|
733 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] | |
|
507 | ||
|
508 | if not self.configUP.create: | |
|
509 | return | |
|
510 | ||
|
511 | self.uporProObjRecover=self.configUP.getFromWindow | |
|
512 | ||
|
513 | self.upType = self.configUP.typeofUP | |
|
514 | for i in self.__arbolDict: | |
|
515 | if self.__arbolDict[i]==self.indexclick: | |
|
516 | self.projectObj=self.__projObjDict[int(i)] | |
|
734 | 517 | |
|
735 | 518 | datatype=str(self.upType) |
|
736 | 519 | uporprojectObj=self.uporProObjRecover |
|
737 | #+++++++++++LET FLY+++++++++++# | |
|
520 | ||
|
738 | 521 | if uporprojectObj.getElementName()=='ProcUnit': |
|
739 | inputId=uporprojectObj.getId() | |
|
740 | elif uporprojectObj.getElementName()=='Project': | |
|
522 | inputId=uporprojectObj.getId() | |
|
523 | else: | |
|
741 | 524 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() |
|
742 | ||
|
743 | ||
|
744 | self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
|
745 |
self. |
|
|
746 | print inputId | |
|
747 | print self.procUnitConfObj1.getId() | |
|
748 | self.parentItem=uporprojectObj.arbol | |
|
525 | ||
|
526 | print 'uporprojectObj.id','inputId', uporprojectObj.id,inputId | |
|
527 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
|
528 | self.__upObjDict[inputId]= self.procUnitConfObj1 | |
|
529 | ||
|
530 | self.parentItem=self.__arbolDict[uporprojectObj.id] | |
|
531 | #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i] | |
|
749 | 532 | self.numbertree=int(self.procUnitConfObj1.getId())-1 |
|
750 |
self.procUnitConfObj1. |
|
|
751 |
self.parentItem.appendRow(self.procUnitConfObj1. |
|
|
752 |
self.parentItem=self.procUnitConfObj1. |
|
|
753 |
|
|
|
533 | self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree)) | |
|
534 | self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) | |
|
535 | self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] | |
|
536 | # self.loadUp() | |
|
754 | 537 | self.treeView.expandAll() |
|
755 | ||
|
756 | def loadUp(self): | |
|
757 | self.addOpUpselec.clear() | |
|
758 | self.addOpSpecUpselec.clear() | |
|
759 | for i in self.upObjList: | |
|
760 | if i.datatype=='Voltage': | |
|
761 | self.upObjVolList.append(i) | |
|
762 | name=i.getElementName() | |
|
763 | id=int(i.id)-1 | |
|
764 | self.addOpUpselec.addItem(name+str(id)) | |
|
765 | if i.datatype=='Spectra': | |
|
766 | self.upobjSpecList.append(i) | |
|
767 | name=i.getElementName() | |
|
768 | id=int(i.id)-1 | |
|
769 | self.addOpSpecUpselec.addItem(name+str(id)) | |
|
770 | ||
|
771 | self.resetopVolt() | |
|
772 | self.resetopSpec() | |
|
773 | 538 | |
|
774 | 539 | def resetopVolt(self): |
|
775 | 540 | self.selecChannelopVolCEB.setChecked(False) |
|
776 | 541 | self.selecHeighopVolCEB.setChecked(False) |
|
777 | 542 | self.coherentIntegrationCEB.setChecked(False) |
|
778 | 543 | self.profileSelecopVolCEB.setChecked(False) |
|
779 | 544 | #self.selecChannelopVolCEB.setEnabled(False) |
|
780 | 545 | self.lineHeighProfileTxtopVol.clear() |
|
781 | 546 | self.lineProfileSelecopVolCEB.clear() |
|
782 | 547 | self.numberChannelopVol.clear() |
|
783 | 548 | self.numberIntegration.clear() |
|
784 | 549 | |
|
785 | 550 | |
|
786 | 551 | def resetopSpec(self): |
|
787 | 552 | self.nFFTPointOpSpecCEB.setChecked(False) |
|
788 | 553 | |
|
789 | 554 | self.valuenFFTPointOpSpec.clear() |
|
790 | 555 | |
|
791 | 556 | def resetgraphSpec(self): |
|
792 | 557 | self.SpectraPlotGraphCEB.setChecked(False) |
|
793 | 558 | self.CrossSpectraPlotGraphceb.setChecked(False) |
|
794 | 559 | self.RTIPlotGraphCEB.setChecked(False) |
|
795 | 560 | |
|
796 | 561 | |
|
797 | 562 | def saveProject(self): |
|
798 | if self.idp==1: | |
|
799 | self.valuep=1 | |
|
800 | ||
|
801 | print "Escribiendo el archivo XML" | |
|
802 | filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml" | |
|
803 | self.controllerObj=self.proObjList[int(self.valuep)-1] | |
|
804 | self.controllerObj.writeXml(filename) | |
|
563 | print "entro" | |
|
564 | #filename="C:\WorkspaceGUI\config1.xml" | |
|
565 | for i in self.__arbolDict: | |
|
566 | if self.__arbolDict[i]==self.indexclick: | |
|
567 | self.projectObj=self.__projObjDict[int(i)] | |
|
568 | print "Encontre project" | |
|
569 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml" | |
|
570 | print "Escribo Project" | |
|
571 | self.projectObj.writeXml(filename) | |
|
805 | 572 | |
|
806 | 573 | |
|
807 | ||
|
808 | ||
|
809 | ||
|
810 | class Window(QMainWindow, Ui_window): | |
|
811 | """ | |
|
812 | Class documentation goes here. | |
|
813 | """ | |
|
814 | closed=pyqtSignal() | |
|
815 | def __init__(self, parent = None): | |
|
816 | """ | |
|
817 | Constructor | |
|
818 | """ | |
|
819 | QMainWindow.__init__(self, parent) | |
|
820 | self.setupUi(self) | |
|
821 | self.name=0 | |
|
822 | self.nameproject=None | |
|
823 | self.proyectNameLine.setText('My_name_is...') | |
|
824 | self.descriptionTextEdit.setText('Write a description...') | |
|
825 | ||
|
826 | ||
|
827 | @pyqtSignature("") | |
|
828 | def on_cancelButton_clicked(self): | |
|
829 | """ | |
|
830 | Slot documentation goes here. | |
|
831 | """ | |
|
832 | # TODO: not implemented yet | |
|
833 | #raise NotImplementedError | |
|
834 | ||
|
835 | self.hide() | |
|
836 | ||
|
837 | @pyqtSignature("") | |
|
838 | def on_okButton_clicked(self): | |
|
839 | """ | |
|
840 | Slot documentation goes here. | |
|
841 | """ | |
|
842 | #self.almacena() | |
|
843 | self.close() | |
|
844 | ||
|
845 | @pyqtSignature("") | |
|
846 | def on_saveButton_clicked(self): | |
|
847 | """ | |
|
848 | Slot documentation goes here. | |
|
849 | """ | |
|
850 | self.almacena() | |
|
851 | # self.close() | |
|
852 | ||
|
853 | def almacena(self): | |
|
854 | #print str(self.proyectNameLine.text()) | |
|
855 | self.nameproject=str(self.proyectNameLine.text()) | |
|
856 | self.description=str(self.descriptionTextEdit.toPlainText()) | |
|
857 | return self.nameproject,self.description | |
|
858 | ||
|
859 | def closeEvent(self, event): | |
|
860 | self.closed.emit() | |
|
861 | event.accept() | |
|
862 | ||
|
863 | ||
|
864 | ||
|
865 | #--------------------------------------VENTANA DE CONFIGURACION DE LA UP-----------------------# | |
|
866 | ||
|
867 | 574 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
|
868 | 575 | """ |
|
869 | 576 | Class documentation goes here. |
|
870 | 577 | """ |
|
871 | 578 | closed=pyqtSignal() |
|
579 | create= False | |
|
872 | 580 | def __init__(self, parent = None): |
|
873 | 581 | """ |
|
874 | 582 | Constructor |
|
875 | 583 | """ |
|
876 | 584 | QMainWindow.__init__(self, parent) |
|
877 | 585 | self.setupUi(self) |
|
878 | 586 | self.getFromWindow=None |
|
879 | 587 | self.getfromWindowList=[] |
|
880 | 588 | |
|
881 | 589 | self.listUP=None |
|
882 | 590 | |
|
883 | 591 | @pyqtSignature("") |
|
884 | 592 | def on_unitPokbut_clicked(self): |
|
885 | 593 | """ |
|
886 | 594 | Slot documentation goes here. |
|
887 | 595 | """ |
|
596 | self.create =True | |
|
597 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
|
598 | #self.nameofUP= str(self.nameUptxt.text()) | |
|
599 | self.typeofUP= str(self.comboTypeBox.currentText()) | |
|
888 | 600 | self.close() |
|
889 | ||
|
890 | @pyqtSignature("") | |
|
891 | def on_unitPsavebut_clicked(self): | |
|
892 | """ | |
|
893 | Slot documentation goes here. | |
|
894 | """ | |
|
895 | ||
|
896 | print "alex" | |
|
897 | self.almacena() | |
|
601 | ||
|
898 | 602 | |
|
899 | 603 | @pyqtSignature("") |
|
900 | 604 | def on_unitPcancelbut_clicked(self): |
|
901 | 605 | """ |
|
902 | 606 | Slot documentation goes here. |
|
903 | 607 | """ |
|
904 | 608 | # TODO: not implemented yet |
|
905 | 609 | #raise NotImplementedError |
|
906 |
self. |
|
|
610 | self.create=False | |
|
611 | self.close() | |
|
907 | 612 | |
|
908 | 613 | def loadTotalList(self): |
|
909 | 614 | self.comboInputBox.clear() |
|
910 | 615 | for i in self.getfromWindowList: |
|
616 | ||
|
911 | 617 | name=i.getElementName() |
|
912 | id= i.id | |
|
913 | if i.getElementName()=='ProcUnit': | |
|
618 | if name=='Project': | |
|
619 | id= i.id | |
|
620 | if name=='ProcUnit': | |
|
914 | 621 | id=int(i.id)-1 |
|
915 | self.comboInputBox.addItem(str(name)+str(id)) | |
|
916 | ||
|
917 | def almacena(self): | |
|
918 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
|
919 | #self.nameofUP= str(self.nameUptxt.text()) | |
|
920 | self.typeofUP= str(self.comboTypeBox.currentText()) | |
|
921 | return self.getFromWindow,self.typeofUP | |
|
622 | self.comboInputBox.addItem(str(name)+str(id)) | |
|
922 | 623 | |
|
923 | 624 | def closeEvent(self, event): |
|
924 | 625 | self.closed.emit() |
|
925 | 626 | event.accept() |
|
926 | 627 | |
|
927 | 628 | |
|
928 | 629 | |
|
929 | 630 | |
|
930 | 631 | |
|
931 | 632 | |
|
932 | 633 | No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now