This diff has been collapsed as it changes many lines, (2033 lines changed) Show them Hide them | |||
@@ -1,1119 +1,517 | |||
|
1 | 1 | # -*- coding: utf-8 -*- |
|
2 | 2 | """ |
|
3 | 3 | Module implementing MainWindow. |
|
4 |
#+++++++++++++ |
|
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
|
5 | @author: AlexanderValdezPortocarrero ñ_ñ | |
|
5 | 6 | """ |
|
6 | import os,sys | |
|
7 | ||
|
8 | ||
|
7 | import os, sys | |
|
9 | 8 | import datetime |
|
10 | ||
|
11 | from PyQt4.QtGui import QMainWindow | |
|
9 | from PyQt4.QtGui import QMainWindow | |
|
12 | 10 | from PyQt4.QtCore import pyqtSignature |
|
13 | 11 | from PyQt4.QtCore import pyqtSignal |
|
14 | 12 | from PyQt4 import QtCore |
|
15 | 13 | from PyQt4 import QtGui |
|
16 | from timeconversions import Doy2Date | |
|
17 | from modelProperties import treeModel | |
|
18 | 14 | |
|
19 | 15 | from viewer.ui_unitprocess import Ui_UnitProcess |
|
20 | 16 | from viewer.ui_window import Ui_window |
|
21 | 17 | from viewer.ui_mainwindow import Ui_BasicWindow |
|
22 | 18 | |
|
23 | print "Nohayproblema" | |
|
24 | pathe = os.path.split(os.getcwd())[0] | |
|
25 | sys.path.append(pathe) | |
|
26 | print "leer", pathe | |
|
27 | ||
|
28 | from controller import * | |
|
29 | 19 | |
|
20 | from modelProperties import treeModel | |
|
30 | 21 | |
|
31 | #from controller import Project,ReadUnitConf,ProcUnitConf,OperationConf,ParameterConf | |
|
22 | path = os.path.split(os.getcwd())[0] | |
|
32 | 23 | |
|
24 | sys.path.append(path) | |
|
33 | 25 | |
|
34 | def isRadarFile(file): | |
|
26 | from controller import * | |
|
35 | 27 | |
|
36 | try: | |
|
37 | year = int(file[1:5]) | |
|
38 |
|
|
|
39 |
|
|
|
40 | except: | |
|
41 |
|
|
|
28 | def isRadarFile(file): | |
|
29 | try: | |
|
30 | year = int(file[1:5]) | |
|
31 | doy = int(file[5:8]) | |
|
32 | set = int(file[8:11]) | |
|
33 | except: | |
|
34 | return 0 | |
|
42 | 35 | |
|
43 | return 1 | |
|
36 | return 1 | |
|
44 | 37 | |
|
45 | 38 | def isRadarPath(path): |
|
46 | try: | |
|
47 | year = int(path[1:5]) | |
|
48 | doy = int(path[5:8]) | |
|
49 | except: | |
|
50 | return 0 | |
|
39 | try: | |
|
40 | year = int(path[1:5]) | |
|
41 | doy = int(path[5:8]) | |
|
42 | except: | |
|
43 | return 0 | |
|
51 | 44 | |
|
52 | return 1 | |
|
53 | ||
|
54 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
|
55 | __projObjDict = None | |
|
56 | __arbolDict = None | |
|
57 | __upObjDict = None | |
|
45 | return 1 | |
|
58 | 46 | |
|
47 | ||
|
48 | class BasicWindow(QMainWindow,Ui_BasicWindow): | |
|
59 | 49 | """ |
|
60 | Class documentation goes here. | |
|
61 | #*############VENTANA CUERPO DEL PROGRAMA############## | |
|
50 | ||
|
62 | 51 | """ |
|
63 |
def __init__(self, |
|
|
64 | """ | |
|
65 | Constructor | |
|
66 |
""" |
|
|
67 | print "INICIO PROGRAMA " | |
|
68 | QMainWindow.__init__(self, parent) | |
|
69 | self.setupUi(self) | |
|
70 | ||
|
71 |
self.__ |
|
|
72 | self.__arbolDict = {} | |
|
73 |
self. |
|
|
74 |
self. |
|
|
75 |
self. |
|
|
76 |
self. |
|
|
77 | ||
|
78 | self.online=0 | |
|
79 | self.datatype=0 | |
|
80 | self.dateList=[] | |
|
81 | ||
|
82 | self.proObjList=[] | |
|
83 | self.idp=0 | |
|
84 | self.namep=0 | |
|
85 | self.description=0 | |
|
86 | self.namepTree=0 | |
|
87 | self.valuep=0 | |
|
88 | ||
|
89 | self.upObjList= [] | |
|
90 | self.upn=0 | |
|
91 | self.upName=0 | |
|
92 | self.upType=0 | |
|
93 | self.uporProObjRecover=0 | |
|
94 | ||
|
95 | self.readUnitConfObjList=[] | |
|
96 | ||
|
97 | self.upObjVolList=[] | |
|
98 | self.upobjSpecList=[] | |
|
99 | ||
|
100 | self.operObjList=[] | |
|
101 | ||
|
102 | self.configProject=None | |
|
103 | self.configUP=None | |
|
104 | ||
|
105 | self.readUnitConfObj=None | |
|
106 | self.procUnitConfObj0=None | |
|
107 | self.opObj10=None | |
|
108 | self.opObj12=None | |
|
109 | ||
|
110 | self.setParam() | |
|
111 | ||
|
112 | #------------------VistadelNombreCompletousandoelpunteroSobrelosbotones---------------------------# | |
|
113 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
|
114 | self.addprojectBtn.setToolTip('Add_New_Project') | |
|
115 | self.addUnitProces.setToolTip('Add_New_Processing_Unit') | |
|
116 | ||
|
117 | #------------------------ManejodeEventosconelmouse------------------------------------------------# | |
|
118 | self.model = QtGui.QStandardItemModel() | |
|
119 | self.treeView.setModel(self.model) | |
|
120 | self.treeView.clicked.connect(self.clickFunctiontree) | |
|
121 | self.treeView.doubleClicked.connect(self.doubleclickFunctiontree) | |
|
122 | self.treeView.expandAll() | |
|
123 | ||
|
124 | #self.treeView.setReadOnly(True) | |
|
125 | self.treeView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
|
126 | self.treeView.customContextMenuRequested.connect(self.popup) | |
|
127 | #self.treeView.clicked.connect(self.treefunction1) | |
|
128 | self.model_2=treeModel() | |
|
129 | ||
|
130 | ||
|
131 | #-----------------------------------BARRA DE MENU-------------------------------------------------# | |
|
132 | ||
|
133 | def popup(self, pos): | |
|
134 | # for i in self.treeView.selectionModel().selection().indexes(): | |
|
135 | # print i.row(), i.column() | |
|
136 | menu = QtGui.QMenu() | |
|
137 | #menu.centralWidget.setObjectName(_fromUtf8("centralWidget")) | |
|
138 | quitAction0 = menu.addAction("Add Branch") | |
|
139 | quitAction1 = menu.addAction("Delete Branch") | |
|
140 | quitAction2 = menu.addAction("Exit") | |
|
141 | #quitAction2 = menu.addAction("Exit") | |
|
142 | print "pos:", pos | |
|
143 | action = menu.exec_(self.mapToGlobal(pos)) | |
|
144 | if action == quitAction0: | |
|
145 | self.addUP() | |
|
146 | ||
|
147 | if action == quitAction1: | |
|
148 | for i in self.__arbolDict: | |
|
149 | if self.__arbolDict[i]==self.indexclick: | |
|
150 | self.arbolItem=self.__arbolDict[i] | |
|
151 | print self.arbolItem | |
|
152 | self.arbolItem.removeRows(self.arbolItem.row(),1) | |
|
153 | if action == quitAction2: | |
|
154 | return | |
|
155 | #----------------------------------- MENU_PROJECT--------------------------------------------------# | |
|
156 | ||
|
157 | @pyqtSignature("") | |
|
158 | def on_menuFileAbrirObj_triggered(self): | |
|
159 | """ | |
|
160 | Abre un archivo de configuracion seleccionado, lee los parametros y | |
|
161 | actualiza los atributos de esta clase; creando los objetos necesarios | |
|
162 | con los parametros leidos desde el archivo. | |
|
163 | """ | |
|
164 | print "Leer un archivo xml y extraer sus atributos Not implemented yet" | |
|
52 | def __init__(self,parent = None): | |
|
53 | """ | |
|
54 | ||
|
55 | """ | |
|
56 | QMainWindow.__init__(self,parent) | |
|
57 | self.setupUi(self) | |
|
58 | self.__projObjDict = {} | |
|
59 | self.__upObjDict = {} | |
|
60 | self.__arbolDict = {} | |
|
61 | self.readUnitConfObjList=[] | |
|
62 | self.operObjList=[] | |
|
63 | self.idp = 0 | |
|
64 | self.online=0 | |
|
65 | self.walk=1 | |
|
66 | self.indexclick=None | |
|
67 | self.setParameter() | |
|
165 | 68 | |
|
166 | 69 | @pyqtSignature("") |
|
167 |
def on_ |
|
|
70 | def on_actionCreate_triggered(self): | |
|
168 | 71 | """ |
|
169 | Crea un proyecto nuevo y lo anade a mi diccionario de proyectos | |
|
170 | y habilita la ventana de configuracion del proyecto. | |
|
171 | ||
|
72 | Slot documentation goes here. | |
|
172 | 73 | """ |
|
173 |
self. |
|
|
174 |
|
|
|
74 | self.setProjectParam() | |
|
75 | ||
|
175 | 76 | @pyqtSignature("") |
|
176 |
def on_ |
|
|
77 | def on_actionSave_triggered(self): | |
|
177 | 78 | """ |
|
178 | METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO | |
|
179 | ||
|
180 | Llama al metodo saveProject. | |
|
79 | Slot documentation goes here. | |
|
181 | 80 | """ |
|
182 | # my_id = arbol_selected() | |
|
183 | # filename = savefindow.show() | |
|
184 | # self.saveProject(id, filename) | |
|
185 | print "probsave" | |
|
186 | self.saveProject() | |
|
81 | self.saveProject() | |
|
187 | 82 | |
|
188 | @pyqtSignature("") | |
|
189 | def on_menuFileCerrarObj_triggered(self): | |
|
83 | def on_actionStart_triggered(self): | |
|
190 | 84 | """ |
|
191 | METODO EJECUTADO CUANDO OCURRE EL EVENTO CERRAR | |
|
192 | Llama al metodo close. | |
|
193 | """ | |
|
194 | self.close() | |
|
195 | ||
|
196 | #-----------------------------------MENU_RUN----------------------------------------------------# | |
|
197 | ||
|
198 | @pyqtSignature("") | |
|
199 | def on_menuRUNStartObj_clicked(self): | |
|
200 | 85 |
|
|
201 | METODO EJECUTADO CUANDO OCURRE EL EVENTO RUN | |
|
202 | Llama al metodo RUN. | |
|
203 | """ | |
|
204 | ||
|
205 | print "Leyendo el archivo XML" | |
|
206 | for i in self.__arbolDict: | |
|
207 | if self.__arbolDict[i]==self.indexclick: | |
|
208 | self.projectObj=self.__projObjDict[i] | |
|
209 | print "Encontre project" | |
|
210 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml" | |
|
211 | self.projectObj.readXml(filename) | |
|
212 | #controllerObj.printattr() | |
|
213 | ||
|
214 | self.projectObj.createObjects() | |
|
215 | self.projectObj.connectObjects() | |
|
216 | self.projectObj.run() | |
|
217 | print "Not implemented yet" | |
|
86 | self.playProject() | |
|
218 | 87 | |
|
219 |
@pyqtSignature("") |
|
|
220 | def on_menuRUNPausaObj_clicked(self): | |
|
221 | """ | |
|
222 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA | |
|
223 | Llama al metodo PAUSA. | |
|
224 | """ | |
|
225 | print "Not implemented yet" | |
|
226 | ||
|
227 | #-----------------------------------MENU_OPTION-------------------------------------------------# | |
|
228 | ||
|
229 | @pyqtSignature("") | |
|
230 | def on_menuOptConfigLogfileObj_clicked(self): | |
|
231 | """ | |
|
232 | METODO EJECUTADO CUANDO OCURRE EL EVENTO ConfigLog | |
|
233 | Llama al metodo close. | |
|
234 | """ | |
|
235 | print "Not implemented yet" | |
|
236 | ||
|
237 | @pyqtSignature("") | |
|
238 | def on_menuOptConfigserverObj_clicked(self): | |
|
88 | @pyqtSignature("") | |
|
89 | def on_actionCreateToolbar_triggered(self): | |
|
239 | 90 | """ |
|
240 | METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server | |
|
241 | Llama al metodo close. | |
|
242 | """ | |
|
243 | print "Not implemented yet" | |
|
244 | #-----------------------------------MENU_HELP-------------------------------------------------------# | |
|
245 | ||
|
246 | @pyqtSignature("") | |
|
247 | def on_menuHELPAboutObj_clicked(self): | |
|
91 | Slot documentation goes here. | |
|
248 | 92 |
|
|
249 | METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP | |
|
250 | Llama al metodo close. | |
|
251 | """ | |
|
252 | print "Not implemented yet" | |
|
253 | ||
|
254 | ||
|
255 | #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------# | |
|
93 | self.setProjectParam() | |
|
256 | 94 | |
|
257 | 95 | @pyqtSignature("") |
|
258 |
def on_act |
|
|
96 | def on_actionSaveToolbar_triggered(self): | |
|
259 | 97 | """ |
|
260 | METODO CARGA UN ARCHIVO DE CONFIGURACION ANTERIOR | |
|
98 | Slot documentation goes here. | |
|
261 | 99 | """ |
|
262 | print "Leer un archivo xml y extraer sus atributos Not implemented yet" | |
|
263 |
|
|
|
100 | self.saveProject() | |
|
101 | ||
|
264 | 102 | @pyqtSignature("") |
|
265 |
def on_act |
|
|
266 | """ | |
|
267 | CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS | |
|
268 | Llama al metodo addProject. | |
|
103 | def on_actionStarToolbar_triggered(self): | |
|
269 | 104 |
|
|
270 | self.addProject() | |
|
271 | ||
|
272 | @pyqtSignature("") | |
|
273 | def on_actStopObj_triggered(self): | |
|
105 | Slot documentation goes here. | |
|
274 | 106 |
|
|
275 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA | |
|
276 | Llama al metodo PAUSA. | |
|
277 | """ | |
|
278 | print "Not implemented yet" | |
|
107 | self.playProject() | |
|
279 | 108 | |
|
280 | @pyqtSignature("") | |
|
281 | def on_actPlayObj_triggered(self): | |
|
282 | """ | |
|
283 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA | |
|
284 | Llama al metodo PAUSA. | |
|
285 | """ | |
|
286 | print "Leyendo el archivo XML" | |
|
287 | for i in self.__arbolDict: | |
|
288 | if self.__arbolDict[i]==self.indexclick: | |
|
289 | self.projectObj=self.__projObjDict[i] | |
|
290 | print "Encontre project" | |
|
291 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml" | |
|
292 | self.projectObj.readXml(filename) | |
|
293 | #controllerObj.printattr() | |
|
294 | 109 | |
|
295 | self.projectObj.createObjects() | |
|
296 | self.projectObj.connectObjects() | |
|
297 | self.projectObj.run() | |
|
298 | print "Not implemented yet" | |
|
299 | ||
|
300 | @pyqtSignature("") | |
|
301 | def on_actSaveObj_triggered(self): | |
|
110 | @pyqtSignature("int") | |
|
111 | def on_proComReadMode_activated(self, p0): | |
|
302 | 112 | """ |
|
303 | METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE | |
|
304 | Llama al metodo SAVE. | |
|
305 | """ | |
|
306 | self.saveProject() | |
|
307 | ||
|
308 | #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------# | |
|
309 | ||
|
310 | @pyqtSignature("") | |
|
311 | def on_addprojectBtn_clicked(self): | |
|
113 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
|
312 | 114 |
|
|
313 | CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS | |
|
314 | Llama al metodo addProject. | |
|
315 | """ | |
|
316 | self.addProject() | |
|
317 | self.setProjectParam() | |
|
318 | ||
|
319 | #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------# | |
|
320 | ||
|
115 | if p0==0: | |
|
116 | self.online=0 | |
|
117 | self.proDelay.setEnabled(False) | |
|
118 | elif p0==1: | |
|
119 | self.online=1 | |
|
120 | self.proDelay.setEnabled(True) | |
|
121 | self.console.clear() | |
|
122 | self.console.append("Choose the type of Walk") | |
|
123 | ||
|
124 | ||
|
125 | ||
|
321 | 126 | @pyqtSignature("int") |
|
322 |
def on_ |
|
|
127 | def on_proComDataType_activated(self,index): | |
|
323 | 128 | """ |
|
324 | Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA | |
|
129 | Voltage or Spectra | |
|
325 | 130 | """ |
|
326 | self.dataFormatTxt.setReadOnly(True) | |
|
327 | 131 | if index==0: |
|
328 | 132 | self.datatype='.r' |
|
329 | 133 | elif index==1: |
|
330 | 134 | self.datatype='.pdata' |
|
331 | else : | |
|
332 | self.datatype='' | |
|
333 | self.dataFormatTxt.setReadOnly(False) | |
|
334 | self.dataFormatTxt.setText(self.datatype) | |
|
335 | self.loadDays() | |
|
135 | ||
|
136 | self.proDataType.setText(self.datatype) | |
|
137 | self.console.clear() | |
|
138 | self.console.append("Choose your DataPath") | |
|
139 | self.console.append("Use the toolpath or Write the path") | |
|
336 | 140 | |
|
141 | @pyqtSignature("int") | |
|
142 | def on_proComWalk_activated(self,index): | |
|
143 | """ | |
|
144 | ||
|
145 | """ | |
|
146 | if index==0: | |
|
147 | self.walk=0 | |
|
148 | elif index==1: | |
|
149 | self.walk=1 | |
|
150 | ||
|
151 | self.console.clear() | |
|
152 | self.console.append("Now, Push the Button Load to charge the date") | |
|
153 | ||
|
337 | 154 | @pyqtSignature("") |
|
338 |
def on_ |
|
|
155 | def on_proToolPath_clicked(self): | |
|
339 | 156 | """ |
|
340 | OBTENCION DE LA RUTA DE DATOS | |
|
157 | Choose your path | |
|
341 | 158 | """ |
|
342 | 159 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
343 |
self. |
|
|
160 | self.proDataPath.setText(self.dataPath) | |
|
344 | 161 | |
|
345 |
self. |
|
|
346 |
self. |
|
|
162 | self.proComStartDate.clear() | |
|
163 | self.proComEndDate.clear() | |
|
347 | 164 | |
|
348 | 165 | if not os.path.exists(self.dataPath): |
|
349 |
self. |
|
|
350 | return | |
|
166 | self.proOk.setEnabled(False) | |
|
167 | self.console.clear() | |
|
168 | self.console.append("Write a correct a path") | |
|
169 | return | |
|
170 | self.console.clear() | |
|
171 | self.console.append("Select the read mode") | |
|
351 | 172 | |
|
352 | self.loadDays() | |
|
353 | 173 | |
|
174 | @pyqtSignature("") | |
|
175 | def on_proLoadButton_clicked(self): | |
|
176 | self.proOk.setEnabled(True) | |
|
177 | self.console.clear() | |
|
178 | self.console.append("You will see the range of date Load") | |
|
179 | self.console.append("First,Don't forget to Choose the Read Mode: OffLine or Online") | |
|
180 | self.console.append("The option Wait is for default 0") | |
|
181 | self.loadDays() | |
|
182 | ||
|
183 | ||
|
354 | 184 | @pyqtSignature("int") |
|
355 |
def on_ |
|
|
185 | def on_proComStartDate_activated(self, index): | |
|
356 | 186 | """ |
|
357 | 187 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
358 | 188 | """ |
|
359 |
stopIndex = self. |
|
|
360 |
self. |
|
|
189 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() | |
|
190 | self.proComEndDate.clear() | |
|
361 | 191 | |
|
362 | 192 | for i in self.dateList[index:]: |
|
363 |
self. |
|
|
193 | self.proComEndDate.addItem(i) | |
|
364 | 194 | |
|
365 |
self. |
|
|
195 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) | |
|
366 | 196 | |
|
367 | 197 | @pyqtSignature("int") |
|
368 |
def on_ |
|
|
198 | def on_proComEndDate_activated(self, index): | |
|
369 | 199 | """ |
|
370 | 200 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
371 | 201 | """ |
|
372 |
startIndex=self. |
|
|
373 |
stopIndex = self. |
|
|
374 |
self. |
|
|
202 | startIndex=self.proComStartDate.currentIndex() | |
|
203 | stopIndex = self.proComEndDate.count() - index | |
|
204 | self.proComStartDate.clear() | |
|
375 | 205 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: |
|
376 |
self. |
|
|
377 |
self. |
|
|
378 | ||
|
379 | @pyqtSignature("int") | |
|
380 | def on_readModeCmBox_activated(self, p0): | |
|
381 | """ | |
|
382 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
|
383 | """ | |
|
384 | if p0==0: | |
|
385 | self.online=0 | |
|
386 | elif p0==1: | |
|
387 | self.online=1 | |
|
388 | ||
|
389 | #---------------PUSHBUTTON_DATA " OKBUTTON "_CONFIGURATION PROJECT--------------------------# | |
|
390 | ||
|
206 | self.proComStartDate.addItem(i) | |
|
207 | self.proComStartDate.setCurrentIndex(startIndex) | |
|
208 | ||
|
391 | 209 | @pyqtSignature("") |
|
392 |
def on_ |
|
|
210 | def on_proOk_clicked(self): | |
|
393 | 211 | """ |
|
394 | 212 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
395 | 213 | Prepara la configuración del diágrama del Arbol del treeView numero 2 |
|
396 |
""" |
|
|
397 | print "DATOS DEL PROJECT PATH,DATE,TIME" | |
|
398 | ||
|
399 |
|
|
|
400 | # print i | |
|
401 | # print "get",self.__arbolDict.items() | |
|
402 | # print "keys",self.__arbolDict.keys() | |
|
403 | ||
|
404 | self.idp += 1 | |
|
405 | self.projectObj = Project() | |
|
406 | self.__projObjDict[self.idp] = self.projectObj | |
|
407 | ||
|
408 | self.description="Think" | |
|
409 | ||
|
410 | id = self.idp | |
|
411 | name = str(self.nameProjectTxt.text()) | |
|
412 | desc = str(self.description) | |
|
413 | ||
|
214 | """ | |
|
215 | self.console.clear() | |
|
216 | self.idp +=1 | |
|
217 | self.projectObj= Project () | |
|
218 | self.__projObjDict[self.idp]=self.projectObj | |
|
219 | ||
|
220 | id = self.idp | |
|
221 | name = str(self.proName.text()) | |
|
222 | desc=str(self.proDescription.toPlainText()) | |
|
414 | 223 | self.projectObj.setup(id = id, name=name, description=desc) |
|
415 | print "self.projectObj.id",self.projectObj.id | |
|
416 | ||
|
417 | #-------AÑADIENDO PARAMETROS A LA UNIDAD DE LECTURA---------# | |
|
418 | ||
|
419 | datatype = str(self.dataTypeCmbBox.currentText()) | |
|
420 | path = str(self.dataPathTxt.text()) | |
|
224 | datatype = str(self.proComDataType.currentText()) | |
|
225 | path = str(self.proDataPath.text()) | |
|
226 | #path='C://data3' | |
|
421 | 227 | online = int(self.online) |
|
422 | starDate = str(self.starDateCmbBox.currentText()) | |
|
423 |
|
|
|
228 | walk = int(self.walk) | |
|
229 | starDate = str(self.proComStartDate.currentText()) | |
|
230 | endDate = str(self.proComEndDate.currentText()) | |
|
231 | reloj1=self.proStartTime.time() | |
|
232 | reloj2=self.proEndTime.time() | |
|
424 | 233 | |
|
425 | ||
|
426 | reloj1=self.startTimeEdit.time() | |
|
427 | ||
|
428 | ||
|
429 | reloj2=self.endTimeEdit.time() | |
|
430 | ||
|
431 | print reloj1.hour() | |
|
432 | print reloj1.minute() | |
|
433 | print reloj1.second() | |
|
434 | ||
|
435 | 234 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype, |
|
436 | path = path, | |
|
437 |
startDate = |
|
|
438 | endDate = endDate, | |
|
439 |
startTime |
|
|
440 |
endTime |
|
|
441 |
online |
|
|
442 | print self.readUnitConfObj.datatype,"self.readUnitConfObj.datatype" | |
|
443 | ||
|
444 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
|
445 | ||
|
446 | #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------# | |
|
447 | #self.model_2=treeModel() | |
|
448 | self.model_2=treeModel() | |
|
449 | self.model_2.setParams(name = self.projectObj.name, | |
|
450 | directorio = path, | |
|
451 | workspace = "C:\\WorkspaceGUI", | |
|
452 | remode = str(self.readModeCmBox.currentText()), | |
|
453 | dataformat = datatype, | |
|
454 | date = str(starDate)+"-"+str(endDate), | |
|
455 | initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
|
456 | endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
|
457 | timezone = "Local" , | |
|
458 | Summary = "test de prueba") | |
|
459 | ||
|
460 | self.model_2.arbol() | |
|
461 | self.model_2.showtree() | |
|
462 | self.treeView_2.setModel(self.model_2) | |
|
463 | self.treeView_2.expandAll() | |
|
464 | ||
|
465 | #--------CREACIÓNDELDIAGRAMADELARBOL------------------------# | |
|
466 | self.parentItem = self.model.invisibleRootItem() | |
|
467 | #self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) | |
|
468 | self.__arbolDict[self.idp] = QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) | |
|
469 | ||
|
470 | print self.__arbolDict[self.idp] | |
|
235 | path = path, | |
|
236 | startDate = starDate, | |
|
237 | endDate = endDate, | |
|
238 | startTime= str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
|
239 | endTime= str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
|
240 | online= online, | |
|
241 | walk= walk) | |
|
242 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
|
243 | ||
|
244 | #Project Explorer | |
|
245 | self.parentItem=self.model.invisibleRootItem() | |
|
246 | self.__arbolDict[self.idp] =QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) | |
|
471 | 247 | self.parentItem.appendRow(self.__arbolDict[self.idp]) |
|
472 | 248 | self.parentItem=self.__arbolDict[self.idp] |
|
473 | ||
|
474 | #--------BLOQUEO-------# | |
|
475 | self.tabProject.setEnabled(False) | |
|
476 | ||
|
477 | ||
|
478 | #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------# | |
|
479 | @pyqtSignature("") | |
|
480 | def on_addUnitProces_clicked(self): | |
|
481 | """ | |
|
482 | CREAR PROCESSING UNIT ,añade unidad de procesamiento, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO | |
|
483 | Llama al metodo addUP. | |
|
484 | """ | |
|
485 | self.addUP() | |
|
486 | ||
|
487 | def setParam(self): | |
|
488 | ||
|
489 | self.tabWidgetProject.setEnabled(False) | |
|
490 | self.tabVoltage.setEnabled(False) | |
|
491 | self.tabSpectra.setEnabled(False) | |
|
492 | self.tabCorrelation.setEnabled(False) | |
|
493 | self.dataPathTxt.setText('C:\data2') | |
|
494 | self.nameProjectTxt.setText("Test") | |
|
495 | self.numberChannelopVol.setEnabled(False) | |
|
496 | self.lineFilteropVolCEB.setEnabled(False) | |
|
497 | self.lineHeighProfileTxtopVol.setEnabled(False) | |
|
498 | self.numberIntegration.setEnabled(False) | |
|
499 | self.valuenFFTPointOpSpec.setEnabled(False) | |
|
500 | self.lineProfileSelecopVolCEB.setEnabled(False) | |
|
501 | self.valueSelecChOpVol.setEnabled(False) | |
|
502 | self.valueSelecHeigOpVol.setEnabled(False) | |
|
503 | self.profileSelecOpVol.setEnabled(False) | |
|
504 | self.decodeCcob.setEnabled(False) | |
|
505 | self.decodeMcob.setEnabled(False) | |
|
506 | ||
|
507 | self.wiWineTxtGraphicsVol.setEnabled(False) | |
|
508 | self.channelLisstTxtVol.setEnabled(False) | |
|
509 | self.xminTxtVol.setEnabled(False) | |
|
510 | self.yminTxtVol.setEnabled(False) | |
|
511 | ||
|
512 | self.setDisableAllSpecop() | |
|
513 | self.setDisableAllElementSpecGraph() | |
|
514 | # self.winTitleGraphSpec.setEnabled(False) | |
|
515 | # self.channelListgraphSpec.setEnabled(False) | |
|
516 | # self.xminGraphSpec.setEnabled(False) | |
|
517 | # self.yminGraphSpec.setEnabled(False) | |
|
518 | # self.zminGraphSpec.setEnabled(False) | |
|
519 | # self.timeRangeGraphSpec.setEnabled(False) | |
|
520 | # self.dataPathTxtSpec.setEnabled(False) | |
|
521 | # self.dataPrefixGraphSpec.setEnabled(False) | |
|
522 | ||
|
523 | def setProjectParam(self): | |
|
524 | self.nameProjectTxt.setText("Test") | |
|
525 | self.dataPathTxt.setText('C:\data2') | |
|
526 | self.dataTypeCmbBox.clear() | |
|
527 | self.dataTypeCmbBox.addItem("Voltage") | |
|
528 | self.dataTypeCmbBox.addItem("Spectra") | |
|
529 | startTime="00:00:00" | |
|
530 | endTime="23:59:59" | |
|
531 | starlist=startTime.split(":") | |
|
532 | endlist=endTime.split(":") | |
|
533 | print starlist[0],starlist[1],starlist[2] | |
|
534 | print endlist[0],endlist[1],endlist[2] | |
|
535 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
|
536 | self.startTimeEdit.setTime(self.time) | |
|
537 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
|
538 | self.endTimeEdit.setTime(self.time) | |
|
539 | ||
|
540 | def clickFunctiontree(self,index): | |
|
541 | ||
|
542 | self.indexclick= index.model().itemFromIndex(index) | |
|
543 | print "OPCION CLICK" | |
|
544 | print "ArbolDict",self.indexclick | |
|
545 | print "name:",self.indexclick.text() | |
|
546 | #print self.tabWidgetProject.currentIndex() | |
|
547 | ||
|
548 | ||
|
549 | ||
|
550 | ||
|
551 | def doubleclickFunctiontree(self): | |
|
552 | for i in self.__arbolDict: | |
|
553 | if self.__arbolDict[i]==self.indexclick: | |
|
554 | print "INDEXCLICK=ARBOLDICT",i | |
|
555 | if self.__projObjDict.has_key(i)==True: | |
|
556 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
557 | self.nameProjectTxt.setText(str(self.__projObjDict[i].name)) | |
|
558 | self.dataTypeCmbBox.clear() | |
|
559 | self.dataTypeCmbBox.addItem(str(self.readUnitConfObjList[i-1].datatype)) | |
|
560 | print str(self.readUnitConfObjList[i-1].path) | |
|
561 | self.dataPathTxt.setText(str(self.readUnitConfObjList[i-1].path)) | |
|
562 | self.starDateCmbBox.clear() | |
|
563 | self.endDateCmbBox.clear() | |
|
564 | self.starDateCmbBox.addItem(str(self.readUnitConfObjList[i-1].startDate)) | |
|
565 | self.endDateCmbBox.addItem(str(self.readUnitConfObjList[i-1].endDate)) | |
|
566 | startTime=self.readUnitConfObjList[i-1].startTime | |
|
567 | endTime=self.readUnitConfObjList[i-1].endTime | |
|
568 | starlist=startTime.split(":") | |
|
569 | endlist=endTime.split(":") | |
|
570 | print starlist[0],starlist[1],starlist[2] | |
|
571 | print endlist[0],endlist[1],endlist[2] | |
|
572 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
|
573 | self.startTimeEdit.setTime(self.time) | |
|
574 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
|
575 | self.endTimeEdit.setTime(self.time) | |
|
576 | ||
|
577 | #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------# | |
|
578 | # self.model_2=treeModel() | |
|
579 | # self.model_2.setParams(name = str(self.__projObjDict[i].name), | |
|
580 | # directorio = str(self.readUnitConfObjList[i-1].path), | |
|
581 | # workspace = "C:\\WorkspaceGUI", | |
|
582 | # remode = str(self.readModeCmBox.currentText()), | |
|
583 | # dataformat = "Voltage", | |
|
584 | # date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate), | |
|
585 | # initTime = str(starlist[0]) +":"+str(starlist[1])+":"+ str(starlist[2]), | |
|
586 | # endTime = str(endlist[0]) +":"+str(endlist[1])+":"+ str(endlist[2]), | |
|
587 | # timezone = "Local" , | |
|
588 | # Summary = "test de prueba") | |
|
589 | # | |
|
590 | # self.model_2.arbol() | |
|
591 | # self.model_2.showtree() | |
|
592 | # self.treeView_2.setModel(self.model_2) | |
|
593 | # self.treeView_2.expandAll() | |
|
594 | ||
|
595 | #self.dataPathTxt.setText(str(self.__projObjDict[i].addReadUnit.path())) | |
|
596 | ||
|
597 | if self.indexclick.text()=='Voltage': | |
|
598 | self.tabVoltage.setEnabled(True) | |
|
599 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
|
600 | # for i in self.__opObjDict[i] | |
|
601 | # self.OpObj= | |
|
602 | ||
|
603 | if self.indexclick.text()=='Spectra': | |
|
604 | self.tabSpectra.setEnabled(True) | |
|
605 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
|
606 | ||
|
607 | ||
|
608 | if self.indexclick.text()=='Correlation': | |
|
609 | self.tabCorrelation.setEnabled(True) | |
|
610 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) | |
|
611 | ||
|
612 | def addProject(self): | |
|
613 | ||
|
614 | self.tabWidgetProject.setEnabled(True) | |
|
615 | #---------------KILL-----------------# | |
|
616 | # self.tabWidgetProject.setTabsClosable(True) | |
|
617 | # self.tabWidgetProject.tabCloseRequested.connect(self.tabWidgetProject.removeTab) | |
|
618 | #------------------------------------# | |
|
619 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
620 | self.tabProject.setEnabled(True) | |
|
621 | #self.tabVoltage.setEnabled(False) | |
|
622 | print "HABILITA WIDGET" | |
|
623 | ||
|
624 | def existDir(self, var_dir): | |
|
625 | """ | |
|
626 | METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR | |
|
627 | VARIABLE DIRECCION | |
|
628 | """ | |
|
629 | if os.path.isdir(var_dir): | |
|
630 | return True | |
|
631 | else: | |
|
632 | self.textEdit.append("Incorrect path:" + str(var_dir)) | |
|
633 | return False | |
|
634 | ||
|
635 | def searchData(self, path, ext, expLabel='', walk=1): | |
|
636 | ||
|
637 | dateList = [] | |
|
638 | fileList = [] | |
|
639 | ||
|
640 | if walk == 0: | |
|
641 | files = os.listdir(path) | |
|
642 | for thisFile in files: | |
|
643 | if not os.path.isfile(thisFile): | |
|
644 | continue | |
|
645 | thisExt = os.path.splitext(thisFile)[-1] | |
|
646 | ||
|
647 | if thisExt != ext: | |
|
648 | continue | |
|
649 | ||
|
650 | fileList.append(file) | |
|
651 | ||
|
652 | for thisFile in fileList: | |
|
653 | ||
|
654 | if not isRadarFile(thisFile): | |
|
655 | continue | |
|
656 | ||
|
657 | year = int(thisFile[1:5]) | |
|
658 | doy = int(thisFile[5:8]) | |
|
659 | ||
|
660 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
|
661 | dateformat = date.strftime("%Y/%m/%d") | |
|
662 | ||
|
663 | if dateformat not in dateList: | |
|
664 | dateList.append(dateformat) | |
|
665 | ||
|
666 | if walk == 1: | |
|
667 | ||
|
668 | dirList = os.listdir(path) | |
|
669 | dirList.sort() | |
|
670 | ||
|
671 | dateList = [] | |
|
672 | ||
|
673 | for thisDir in dirList: | |
|
674 | ||
|
675 | if not isRadarPath(thisDir): | |
|
676 | continue | |
|
677 | ||
|
678 | doypath = os.path.join(path, thisDir, expLabel) | |
|
679 | ||
|
680 | files = os.listdir(doypath) | |
|
681 | fileList = [] | |
|
682 | ||
|
683 | for thisFile in files: | |
|
684 | ||
|
685 | if os.path.splitext(thisFile)[-1] != ext: | |
|
686 | continue | |
|
687 | ||
|
688 | if not isRadarFile(thisFile): | |
|
689 | continue | |
|
690 | ||
|
691 | fileList.append(thisFile) | |
|
692 | break | |
|
693 | ||
|
694 | if fileList == []: | |
|
695 | continue | |
|
696 | ||
|
697 | year = int(thisDir[1:5]) | |
|
698 | doy = int(thisDir[5:8]) | |
|
699 | ||
|
700 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
|
701 | dateformat = date.strftime("%Y/%m/%d") | |
|
702 | dateList.append(dateformat) | |
|
703 | ||
|
704 | return dateList | |
|
705 | ||
|
706 | def loadDays(self): | |
|
707 | """ | |
|
708 | METODO PARA CARGAR LOS DIAS | |
|
709 | """ | |
|
710 | ext = self.datatype | |
|
711 | path = str(self.dataPathTxt.text()) | |
|
712 | ||
|
713 | self.starDateCmbBox.clear() | |
|
714 | self.endDateCmbBox.clear() | |
|
715 | ||
|
716 | dateList = self.searchData(path, ext=ext) | |
|
717 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) | |
|
718 | self.dateList = dateList | |
|
719 | ||
|
720 | for thisDate in dateList: | |
|
721 | self.starDateCmbBox.addItem(thisDate) | |
|
722 | self.endDateCmbBox.addItem(thisDate) | |
|
723 | ||
|
724 | self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) | |
|
725 | self.dataOkBtn.setEnabled(True) | |
|
726 | ||
|
727 | def HourChanged(self): | |
|
728 | #self.hour = self.HourScrollBar.value() | |
|
729 | self.set_time() | |
|
730 | ||
|
731 | def MinChanged(self): | |
|
732 | #self.min = self.MinScrollBar.value() | |
|
733 | self.set_time() | |
|
734 | ||
|
735 | def SecChanged(self): | |
|
736 | #self.sec = self.SecScrollBar.value() | |
|
737 | self.set_time() | |
|
738 | ||
|
739 | def set_time(self): | |
|
740 | self.time.setHMS(self.hour, self.min, self.sec) | |
|
741 | self.startTimeEdit.setTime(self.time) | |
|
742 | ||
|
743 | self.endTimeEdit.setTime(self.time) | |
|
744 | ||
|
745 | ||
|
746 | def addUP(self): | |
|
747 | ||
|
748 | self.configUP=UnitProcess(self) | |
|
749 | ||
|
750 | for i in self.__arbolDict: | |
|
751 | if self.__arbolDict[i]==self.indexclick: | |
|
752 | print "INDEXCLICK=ARBOLDICT",i | |
|
753 | if self.__projObjDict.has_key(i)==True: | |
|
754 | self.projectObj=self.__projObjDict[int(i)] | |
|
755 | print "self.projectObj.id",self.projectObj.id | |
|
756 | #-----------Añadiendo Tipo de dato y Projecto a la Clase UnitProcess que abre la ventana de selección----# | |
|
757 | self.configUP.dataTypeProject=str(self.dataTypeCmbBox.currentText()) | |
|
758 | self.configUP.getfromWindowList.append(self.projectObj) | |
|
759 | ||
|
760 | # for i in self.projectObj.procUnitConfObjDict: | |
|
761 | # if self.projectObj.procUnitConfObjDict[i].getElementName()=='ProcUnit': | |
|
762 | # self.upObj=self.projectObj.procUnitConfObjDict[i] | |
|
763 | # self.configUP.getfromWindowList.append(self.upObj) | |
|
764 | else: | |
|
765 | #-----------Añadiendo Unidad de Procesamiento a una Unidad de Procesamiento----# | |
|
766 | self.upObj=self.__upObjDict[i] | |
|
767 | print "self.upObj.id",self.upObj.id | |
|
768 | self.configUP.getfromWindowList.append(self.upObj) | |
|
769 | ||
|
770 | self.configUP.loadTotalList() | |
|
771 | self.configUP.show() | |
|
772 | self.configUP.closed.connect(self.createUP) | |
|
773 | ||
|
774 | def createUP(self): | |
|
775 | ||
|
776 | print "ADICION DE BRANCH Y ID" | |
|
777 | ||
|
778 | if not self.configUP.create: | |
|
779 | return | |
|
780 | ||
|
781 | self.uporProObjRecover=self.configUP.getFromWindow | |
|
782 | ||
|
783 | self.upType = self.configUP.typeofUP | |
|
784 | for i in self.__arbolDict: | |
|
785 | print self.__arbolDict[i],"VALORES DEL DIC" | |
|
786 | if self.__arbolDict[i]==self.indexclick: | |
|
787 | if self.__projObjDict.has_key(i)==True: | |
|
788 | # print "self.__projObjDict[int(i)]" ,__projObjDict[int(i)] | |
|
789 | self.projectObj=self.__projObjDict[int(i)] | |
|
790 | print self.__projObjDict[int(i)] | |
|
791 | ||
|
792 | if self.__upObjDict.has_key(i)==True: | |
|
793 | print "Entro al else" | |
|
794 | print self.__upObjDict.items() | |
|
795 | self.upObj=self.__upObjDict[i] | |
|
796 | getIdProject=self.upObj.id[0] | |
|
797 | print getIdProject | |
|
798 | self.projectObj=self.__projObjDict[int(getIdProject)] | |
|
799 | ||
|
800 | datatype=str(self.upType) | |
|
801 | uporprojectObj=self.uporProObjRecover | |
|
802 | ||
|
803 | if uporprojectObj.getElementName()=='ProcUnit': | |
|
804 | inputId=uporprojectObj.getId() | |
|
805 | else: | |
|
806 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() | |
|
807 | ||
|
808 | print 'uporprojectObj.id:',uporprojectObj.id,'inputId:',inputId | |
|
809 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
|
810 | self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1 | |
|
811 | print "PRIMERA UP_VEAMOS",self.__upObjDict.items() | |
|
812 | self.parentItem=self.__arbolDict[uporprojectObj.id] | |
|
813 | #print "i","self.__arbolDict[i]",i ,self.__arbolDict[i] | |
|
814 | self.numbertree=int(self.procUnitConfObj1.getId())-1 | |
|
815 | print self.procUnitConfObj1.id," ID DE LA UNIDAD DE PROCESAMIENTO " | |
|
816 | #self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype+"%1").arg(self.numbertree)) | |
|
817 | ||
|
818 | ||
|
819 | ||
|
820 | self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree)) | |
|
821 | self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) | |
|
822 | self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] | |
|
823 | # self.loadUp() | |
|
824 | self.treeView.expandAll() | |
|
825 | ||
|
826 | def resetopVolt(self): | |
|
827 | self.selecChannelopVolCEB.setChecked(False) | |
|
828 | self.selecHeighopVolCEB.setChecked(False) | |
|
829 | self.coherentIntegrationCEB.setChecked(False) | |
|
830 | self.profileSelecopVolCEB.setChecked(False) | |
|
831 | self.FilterCEB.setChecked(False) | |
|
832 | ||
|
833 | #self.selecChannelopVolCEB.setEnabled(False) | |
|
834 | self.lineHeighProfileTxtopVol.clear() | |
|
835 | self.lineProfileSelecopVolCEB.clear() | |
|
836 | self.numberChannelopVol.clear() | |
|
837 | self.numberIntegration.clear() | |
|
838 | self.lineFilteropVolCEB.clear() | |
|
839 | ||
|
840 | def resetopSpec(self): | |
|
841 | ||
|
842 | self.nFFTPointOpSpecCEB.setChecked(False) | |
|
843 | self.valuenFFTPointOpSpec.clear() | |
|
844 | ||
|
845 | def resetgraphSpec(self): | |
|
846 | self.SpectraPlotGraphCEB.setChecked(False) | |
|
847 | self.CrossSpectraPlotGraphceb.setChecked(False) | |
|
848 | self.RTIPlotGraphCEB.setChecked(False) | |
|
849 | ||
|
850 | def saveProject(self): | |
|
851 | print "entro" | |
|
852 | #filename="C:\WorkspaceGUI\config1.xml" | |
|
853 | for i in self.__arbolDict: | |
|
854 | if self.__arbolDict[i]==self.indexclick: | |
|
855 | self.projectObj=self.__projObjDict[i] | |
|
856 | print "Encontre project" | |
|
857 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.id)+".xml" | |
|
858 | print "Escribo Project" | |
|
859 | self.projectObj.writeXml(filename) | |
|
860 | ||
|
861 | # -----------------OPCIONES DE CONFIGURACION VOLTAGE---------------------------# | |
|
862 | ||
|
863 | @pyqtSignature("") | |
|
864 | def on_dataGraphicsVolPathBrowse_clicked(self): | |
|
865 | """ | |
|
866 | OBTENCION DE LA RUTA DE DATOS | |
|
867 | """ | |
|
868 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
|
869 | self.dataPathtxtGraphicsVol.setText(self.dataPath) | |
|
870 | ||
|
871 | if not os.path.exists(self.dataPath): | |
|
872 | self.dataGraphVolOkBtn.setEnabled(False) | |
|
873 | return | |
|
249 | ||
|
250 | #Project Properties | |
|
251 | self.model_2=treeModel() | |
|
252 | self.model_2.setParams(name = self.projectObj.name, | |
|
253 | directorio = path, | |
|
254 | workspace = "C:\\WorkspaceGUI", | |
|
255 | remode = str(self.proComReadMode.currentText()), | |
|
256 | dataformat = datatype, | |
|
257 | date = str(starDate)+"-"+str(endDate), | |
|
258 | initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
|
259 | endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
|
260 | timezone = "Local" , | |
|
261 | Summary = desc) | |
|
874 | 262 | |
|
875 | # -----------------VENTANA CONFIGURACION DE VOLTAGE---------------------------# | |
|
263 | self.treeProjectProperties.setModel(self.model_2) | |
|
264 | self.treeProjectProperties.expandAll() | |
|
265 | ||
|
266 | #Disable tabProject after finish the creation | |
|
267 | #self.tabProject.setEnabled(False) | |
|
268 | self.console.clear() | |
|
269 | self.console.append("Now you can add a Unit Processing") | |
|
270 | self.console.append("If you want to save your project") | |
|
271 | self.console.append("click on your project name in the Tree Project Explorer") | |
|
272 | #----------------Voltage Operation-------------------# | |
|
876 | 273 | |
|
877 | 274 | @pyqtSignature("int") |
|
878 |
def on_ |
|
|
275 | def on_volOpCebChannels_stateChanged(self, p0): | |
|
879 | 276 | """ |
|
880 | 277 | Check Box habilita operaciones de Selecci�n de Canales |
|
881 | 278 | """ |
|
882 | 279 | if p0==2: |
|
883 |
self. |
|
|
884 |
self.v |
|
|
885 | print " Ingresa seleccion de Canales" | |
|
280 | self.volOpComChannels.setEnabled(True) | |
|
281 | self.volOpChannel.setEnabled(True) | |
|
282 | ||
|
886 | 283 | if p0==0: |
|
887 |
self. |
|
|
888 |
self.v |
|
|
889 | print " deshabilitado" | |
|
284 | self.volOpComChannels.setEnabled(False) | |
|
285 | self.volOpChannel.setEnabled(False) | |
|
286 | ||
|
890 | 287 | |
|
891 | 288 | @pyqtSignature("int") |
|
892 |
def on_ |
|
|
289 | def on_volOpCebHeights_stateChanged(self, p0): | |
|
893 | 290 | """ |
|
894 | 291 | Check Box habilita operaciones de Selecci�n de Alturas |
|
895 | 292 | """ |
|
896 | 293 | if p0==2: |
|
897 |
self. |
|
|
898 |
self.v |
|
|
899 | print " Select Type of Profile" | |
|
294 | self.volOpHeights.setEnabled(True) | |
|
295 | self.volOpComHeights.setEnabled(True) | |
|
296 | ||
|
900 | 297 | if p0==0: |
|
901 |
self. |
|
|
902 |
self.v |
|
|
903 | print " deshabilitado" | |
|
904 | ||
|
298 | self.volOpHeights.setEnabled(False) | |
|
299 | self.volOpComHeights.setEnabled(False) | |
|
905 | 300 | |
|
906 | 301 | @pyqtSignature("int") |
|
907 |
def on_ |
|
|
302 | def on_volOpCebFilter_stateChanged(self, p0): | |
|
908 | 303 | """ |
|
909 | 304 | Name='Decoder', optype='other' |
|
910 | 305 | """ |
|
911 | 306 | if p0==2: |
|
912 |
self. |
|
|
913 | print " Select Type of Profile" | |
|
307 | self.volOpFilter.setEnabled(True) | |
|
308 | ||
|
914 | 309 | if p0==0: |
|
915 |
self. |
|
|
916 | print " deshabilitado" | |
|
917 | ||
|
310 | self.volOpFilter.setEnabled(False) | |
|
311 | ||
|
918 | 312 | @pyqtSignature("int") |
|
919 |
def on_profile |
|
|
313 | def on_volOpCebProfile_stateChanged(self, p0): | |
|
920 | 314 | """ |
|
921 | 315 | Check Box habilita ingreso del rango de Perfiles |
|
922 | 316 | """ |
|
923 | 317 | if p0==2: |
|
924 |
self. |
|
|
925 |
self.profile |
|
|
926 | print " Select Type of Profile" | |
|
318 | self.volOpComProfile.setEnabled(True) | |
|
319 | self.volOpProfile.setEnabled(True) | |
|
320 | ||
|
927 | 321 | if p0==0: |
|
928 |
self. |
|
|
929 |
self.profile |
|
|
930 | print " deshabilitado" | |
|
931 | ||
|
932 | ||
|
322 | self.volOpComProfile.setEnabled(False) | |
|
323 | self.volOpProfile.setEnabled(False) | |
|
324 | ||
|
933 | 325 | @pyqtSignature("int") |
|
934 |
def on_ |
|
|
326 | def on_volOpCebDecodification_stateChanged(self, p0): | |
|
935 | 327 | """ |
|
936 | Check Box habilita ingresode del numero de Integraciones a realizar | |
|
328 | Check Box habilita | |
|
937 | 329 | """ |
|
938 | 330 | if p0==2: |
|
939 |
self. |
|
|
940 |
self. |
|
|
941 | print "Choose number of Cohint" | |
|
331 | self.volOpComCode.setEnabled(True) | |
|
332 | self.volOpComMode.setEnabled(True) | |
|
333 | ||
|
942 | 334 | if p0==0: |
|
943 | print " deshabilitado" | |
|
944 |
self. |
|
|
945 | self.decodeMcob.setEnabled(False) | |
|
335 | self.volOpComCode.setEnabled(False) | |
|
336 | self.volOpComMode.setEnabled(False) | |
|
946 | 337 | |
|
947 | 338 | |
|
948 | 339 | @pyqtSignature("int") |
|
949 |
def on_ |
|
|
340 | def on_volOpCebCohInt_stateChanged(self, p0): | |
|
950 | 341 | """ |
|
951 | 342 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
952 | 343 | """ |
|
953 | 344 | if p0==2: |
|
954 |
self. |
|
|
955 | print "Choose number of Cohint" | |
|
345 | self.volOpCohInt.setEnabled(True) | |
|
956 | 346 | if p0==0: |
|
957 | print " deshabilitado" | |
|
958 | self.numberIntegration.setEnabled(False) | |
|
347 | self.volOpCohInt.setEnabled(False) | |
|
348 | ||
|
959 | 349 | |
|
960 | #-----------------------VOL_PUSHBUTTON_ACCEPT_OPERATION----------------------------# | |
|
961 | ||
|
350 | ||
|
351 | ||
|
962 | 352 | @pyqtSignature("") |
|
963 |
def on_ |
|
|
353 | def on_volOpOk_clicked(self): | |
|
964 | 354 | """ |
|
965 | 355 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES A�ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
966 | 356 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
967 | 357 | """ |
|
968 | 358 | for i in self.__arbolDict: |
|
969 | 359 | if self.__arbolDict[i]==self.indexclick: |
|
970 | print "INDEXCLICK=ARBOLDICT",i | |
|
971 | 360 | if self.__upObjDict.has_key(i)==True: |
|
972 | 361 | self.upObj=self.__upObjDict[i] |
|
973 | print self.__upObjDict[i].name | |
|
974 | print "TamañodeupObjDict",len(self.__upObjDict) | |
|
975 | # if len(self.__upObjDict)>=1 and len(self.__upObjDict)> self.b: | |
|
976 | 362 | |
|
977 |
if self. |
|
|
978 |
if self.v |
|
|
363 | if self.volOpCebChannels.isChecked(): | |
|
364 | if self.volOpComChannels.currentIndex()== 0: | |
|
979 | 365 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
980 | 366 | self.operObjList.append(opObj10) |
|
981 |
value=self. |
|
|
367 | value=self.volOpChannel.text() | |
|
982 | 368 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
983 | 369 | else: |
|
984 | 370 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
985 | 371 | self.operObjList.append(opObj10) |
|
986 |
value=self. |
|
|
372 | value=self.volOpChannel.text() | |
|
987 | 373 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
988 | print "channel" | |
|
989 | 374 | |
|
990 |
if self. |
|
|
991 |
if self.v |
|
|
375 | if self.volOpCebHeights.isChecked(): | |
|
376 | if self.volOpComHeights.currentIndex()== 0: | |
|
992 | 377 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
993 |
value=self. |
|
|
378 | value=self.volOpHeights.text() | |
|
994 | 379 | valueList=value.split(',') |
|
995 | 380 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
996 | 381 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
997 | 382 | else: |
|
998 | 383 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
999 |
value=self. |
|
|
384 | value=self.volOpHeights.text() | |
|
1000 | 385 | valueList=value.split(',') |
|
1001 | 386 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
1002 | 387 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
1003 | ||
|
1004 | print "height" | |
|
1005 | 388 | |
|
1006 |
if self. |
|
|
389 | if self.volOpCebFilter.isChecked(): | |
|
1007 | 390 | opObj10=self.upObj.addOperation(name='filterByHeights') |
|
1008 |
value=self. |
|
|
391 | value=self.volOpFilter.text() | |
|
1009 | 392 | opObj10.addParameter(name='window', value=value, format='int') |
|
1010 | print "filter" | |
|
1011 | ||
|
1012 | if self.profileSelecopVolCEB.isChecked(): | |
|
1013 | obj10=self.upObj.addOperation(name='ProfileSelector', optype='other') | |
|
1014 | if self.profileSelecOpVol.currentIndex()== 0: | |
|
393 | ||
|
394 | if self.volOpCebProfile.isChecked(): | |
|
395 | opObj10=self.upObj.addOperation(name='ProfileSelector', optype='other') | |
|
396 | if self.volOpComProfile.currentIndex()== 0: | |
|
1015 | 397 | self.operObjList.append(opObj10) |
|
1016 |
value=self. |
|
|
1017 | obj10.addParameter(name='profileList', value=value, format='intlist') | |
|
398 | value=self.volOpProfile.text() | |
|
399 | opObj10.addParameter(name='profileList', value=value, format='intlist') | |
|
1018 | 400 | else: |
|
1019 | 401 | self.operObjList.append(opObj10) |
|
1020 |
value=self. |
|
|
1021 | obj10.addParameter(name='profileRangeList', value=value, format='intlist') | |
|
1022 | print "profile" | |
|
1023 | ||
|
1024 | if self.decodeCEB.isChecked(): | |
|
1025 | opObj10=self.upObj.addOperation(name='Decoder') | |
|
1026 | if self.decodeCcob.currentIndex()==0: | |
|
402 | value=self.volOpProfile.text() | |
|
403 | opObj10.addParameter(name='profileRangeList', value=value, format='intlist') | |
|
404 | ||
|
405 | if self.volOpCebDecodification.isChecked(): | |
|
406 | opObj10=self.upObj.addOperation(name='Decoder', optype='other') | |
|
407 | if self.volOpComCode.currentIndex()==0: | |
|
1027 | 408 | opObj10.addParameter(name='code', value='1,1,-1,-1,-1,1', format='floatlist') |
|
1028 | 409 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1029 | 410 | opObj10.addParameter(name='nBaud', value='3', format='int') |
|
1030 |
if self. |
|
|
411 | if self.volOpComCode.currentIndex()==1: | |
|
1031 | 412 | opObj10.addParameter(name='code', value='1,1,−1,1,-1,-1,1,-1', format='floatlist') |
|
1032 | 413 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1033 | 414 | opObj10.addParameter(name='nBaud', value='4', format='int') |
|
1034 |
if self. |
|
|
415 | if self.volOpComCode.currentIndex()==2: | |
|
1035 | 416 | opObj10.addParameter(name='code', value='1,1,1,−1,1,-1,-1,-1,1,-1', format='floatlist') |
|
1036 | 417 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1037 | 418 | opObj10.addParameter(name='nBaud', value='5', format='int') |
|
1038 |
if self. |
|
|
419 | if self.volOpComCode.currentIndex()==3: | |
|
1039 | 420 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,1,−1,-1,-1,-1,1,1,-1,1', format='floatlist') |
|
1040 | 421 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1041 | 422 | opObj10.addParameter(name='nBaud', value='7', format='int') |
|
1042 |
if self. |
|
|
423 | if self.volOpComCode.currentIndex()==4: | |
|
1043 | 424 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,−1,1,−1,−1,1,−1,-1 ,-1 ,-1 ,1 ,1 ,1 ,-1 ,1 ,1 ,-1 ,1', format='floatlist') |
|
1044 | 425 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1045 | 426 | opObj10.addParameter(name='nBaud', value='11', format='int') |
|
1046 |
if self. |
|
|
427 | if self.volOpComCode.currentIndex()==5: | |
|
1047 | 428 | opObj10.addParameter(name='code', value='1,1,1,1,1,−1,−1,1,1,−1,1,−1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1', format='floatlist') |
|
1048 | 429 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
1049 | 430 | opObj10.addParameter(name='nBaud', value='13', format='int') |
|
1050 | 431 | |
|
1051 |
if self. |
|
|
432 | if self.volOpComMode.currentIndex()==0: | |
|
1052 | 433 | opObj10.addParameter(name='mode', value='0', format='int') |
|
1053 | 434 | |
|
1054 |
if self. |
|
|
435 | if self.volOpComMode.currentIndex()==1: | |
|
1055 | 436 | opObj10.addParameter(name='mode', value='1', format='int') |
|
1056 | 437 | |
|
1057 |
if self. |
|
|
438 | if self.volOpComMode.currentIndex()==2: | |
|
1058 | 439 | opObj10.addParameter(name='mode', value='2', format='int') |
|
1059 | 440 | |
|
1060 |
if self. |
|
|
441 | if self.volOpCebCohInt.isChecked(): | |
|
1061 | 442 | opObj10=self.upObj.addOperation(name='CohInt', optype='other') |
|
1062 | print opObj10.id | |
|
1063 | 443 | self.operObjList.append(opObj10) |
|
1064 |
value=self. |
|
|
444 | value=self.volOpCohInt.text() | |
|
1065 | 445 | opObj10.addParameter(name='n', value=value, format='int') |
|
1066 | print "Coherent" | |
|
1067 | ||
|
446 | #self.tabopVoltage.setEnabled(False) | |
|
447 | self.console.clear() | |
|
448 | self.console.append("If you want to save your project") | |
|
449 | self.console.append("click on your project name in the Tree Project Explorer") | |
|
1068 | 450 | |
|
1069 | # print "TamañodeupObjDict",len(self.__upObjDict) | |
|
1070 | # self.b=len(self.__upObjDict) | |
|
1071 | # print "self.b", self.b | |
|
1072 | # self.model_2.properties_projecto("estaesunaprueba") | |
|
1073 | # anadir=self.model_2.properties_projecto("estaesunaprueba") | |
|
1074 | # self.model_2.addProjectproperties(anadir) | |
|
1075 | # self.model_2.showtree() | |
|
1076 | # self.treeView_2.setModel(self.model_2) | |
|
1077 | # self.treeView_2.expandAll() | |
|
1078 | # else: | |
|
1079 | # print"It doesn't works" | |
|
1080 | ||
|
1081 | # self.o | |
|
1082 | ||
|
1083 | ||
|
1084 | # -----------------VENTANA CONFIGURACION GRAPH VOLTAGE---------------------------# | |
|
1085 | ||
|
451 | #----------------Voltage Graph-------------------# | |
|
1086 | 452 | @pyqtSignature("int") |
|
1087 | def on_dataTypeSelecVol_activated(self,index): | |
|
453 | def on_volGraphCebSave_stateChanged(self, p0): | |
|
1088 | 454 | """ |
|
1089 | Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA | |
|
455 | Check Box habilita ingresode del numero de Integraciones a realizar | |
|
456 | """ | |
|
457 | if p0==2: | |
|
458 | self.volGraphPath.setEnabled(True) | |
|
459 | self.volGraphPrefix.setEnabled(True) | |
|
460 | self.volGraphToolPath.setEnabled(True) | |
|
461 | ||
|
462 | if p0==0: | |
|
463 | self.volGraphPath.setEnabled(False) | |
|
464 | self.volGraphPrefix.setEnabled(False) | |
|
465 | self.volGraphToolPath.setEnabled(False) | |
|
466 | ||
|
467 | @pyqtSignature("") | |
|
468 | def on_volGraphToolPath_clicked(self): | |
|
469 | """ | |
|
470 | Donde se guardan los DATOS | |
|
1090 | 471 | """ |
|
472 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
|
473 | self.volGraphPath.setText(self.dataPath) | |
|
1091 | 474 | |
|
1092 | if index==0: | |
|
1093 |
self. |
|
|
1094 | self.channelLisstTxtVol.setEnabled(True) | |
|
1095 | self.xminTxtVol.setEnabled(True) | |
|
1096 | self.yminTxtVol.setEnabled(True) | |
|
475 | if not os.path.exists(self.dataPath): | |
|
476 | self.volGraphOk.setEnabled(False) | |
|
477 | return | |
|
1097 | 478 | |
|
479 | ||
|
480 | @pyqtSignature("int") | |
|
481 | def on_volGraphComType_activated(self,index): | |
|
482 | """ | |
|
483 | Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA | |
|
484 | """ | |
|
485 | if index==0: | |
|
486 | self.volGraphIdFigure.setEnabled(False) | |
|
487 | self.volGraphWintitle.setEnabled(False) | |
|
488 | self.volGraphChannelList.setEnabled(False) | |
|
489 | self.volGraphxrange.setEnabled(False) | |
|
490 | self.volGraphyrange.setEnabled(False) | |
|
491 | if index==1: | |
|
492 | self.volGraphIdFigure.setEnabled(True) | |
|
493 | self.volGraphWintitle.setEnabled(True) | |
|
494 | self.volGraphChannelList.setEnabled(True) | |
|
495 | self.volGraphxrange.setEnabled(True) | |
|
496 | self.volGraphyrange.setEnabled(True) | |
|
497 | ||
|
1098 | 498 | @pyqtSignature(" ") |
|
1099 |
def on_ |
|
|
499 | def on_volGraphOk_clicked(self): | |
|
1100 | 500 | """ |
|
1101 | 501 | GRAPH |
|
1102 | 502 | """ |
|
1103 | 503 | for i in self.__arbolDict: |
|
1104 | 504 | if self.__arbolDict[i]==self.indexclick: |
|
1105 | print "INDEXCLICK=ARBOLDICT",i | |
|
1106 | 505 | if self.__upObjDict.has_key(i)==True: |
|
1107 | 506 | self.upObj=self.__upObjDict[i] |
|
1108 | print self.__upObjDict[i].name | |
|
1109 | ||
|
1110 | if self.valueSelecChOpVol.currentIndex()==0: | |
|
507 | ||
|
508 | if self.volGraphComType.currentIndex()==1: | |
|
1111 | 509 | opObj10=self.upObj.addOperation(name='Scope', optype='other') |
|
1112 | 510 | self.operObjList.append(opObj10) |
|
1113 |
wintitle=self. |
|
|
1114 |
channelList=self. |
|
|
1115 |
xvalue= self. |
|
|
1116 |
yvalue= self. |
|
|
511 | wintitle=self.volGraphWintitle.text() | |
|
512 | channelList=self.volGraphChannelList.text() | |
|
513 | xvalue= self.volGraphxrange.text() | |
|
514 | yvalue= self.volGraphxrange.text() | |
|
1117 | 515 | |
|
1118 | 516 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') |
|
1119 | 517 | opObj10.addParameter(name='channelList', value=channelList, format='int') |
@@ -1124,305 +522,743 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1124 | 522 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1125 | 523 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1126 | 524 | |
|
1127 |
if self. |
|
|
525 | if self.volGraphCebSave.isChecked(): | |
|
1128 | 526 | opObj10.addParameter(name='save', value='1', format='int') |
|
1129 |
opObj10.addParameter(name='figpath', value= self. |
|
|
1130 |
opObj10.addParameter(name='figfile', value= self. |
|
|
1131 | ||
|
1132 | ||
|
1133 | ||
|
1134 | #-------------------------VENTANA DE CONFIGURACION SPECTRA------------------------# | |
|
1135 | ||
|
527 | opObj10.addParameter(name='figpath', value= self.volGraphPath.text()) | |
|
528 | opObj10.addParameter(name='figfile', value= self.volGraphPrefix.text()) | |
|
529 | self.tabgraphVoltage.setEnabled(False) | |
|
530 | self.console.clear() | |
|
531 | self.console.append("If you want to save your project") | |
|
532 | self.console.append("click on your project name in the Tree Project Explorer") | |
|
533 | ||
|
534 | #------Spectra operation--------# | |
|
1136 | 535 | @pyqtSignature("int") |
|
1137 |
def on_ |
|
|
536 | def on_specOpCebnFFTpoints_stateChanged(self, p0): | |
|
1138 | 537 | """ |
|
1139 | 538 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
1140 | 539 | """ |
|
1141 | 540 | if p0==2: |
|
1142 |
self. |
|
|
1143 | print " nFFTPoint" | |
|
541 | self.specOpnFFTpoints.setEnabled(True) | |
|
542 | self.specOppairsList.setEnabled(True) | |
|
1144 | 543 | if p0==0: |
|
1145 | print " deshabilitado" | |
|
1146 |
self. |
|
|
1147 |
|
|
|
544 | self.specOpnFFTpoints.setEnabled(False) | |
|
545 | self.specOppairsList.setEnabled(False) | |
|
546 | ||
|
1148 | 547 | @pyqtSignature("int") |
|
1149 |
def on_ |
|
|
548 | def on_specOpCebChannel_stateChanged(self, p0): | |
|
1150 | 549 | """ |
|
1151 | 550 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
1152 | 551 | """ |
|
1153 | 552 | if p0==2: |
|
1154 |
self. |
|
|
1155 |
self.s |
|
|
1156 | print "selectHeights" | |
|
553 | self.specOpChannel.setEnabled(True) | |
|
554 | self.specOpComChannel.setEnabled(True) | |
|
1157 | 555 | if p0==0: |
|
1158 | print " deshabilitado" | |
|
1159 |
self. |
|
|
1160 | self.selecHeiopSpec.setEnabled(False) | |
|
1161 | ||
|
556 | self.specOpChannel.setEnabled(False) | |
|
557 | self.specOpComChannel.setEnabled(False) | |
|
558 | ||
|
1162 | 559 | @pyqtSignature("int") |
|
1163 |
def on_s |
|
|
560 | def on_specOpCebHeights_stateChanged(self, p0): | |
|
1164 | 561 | """ |
|
1165 | 562 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
1166 | 563 | """ |
|
1167 | 564 | if p0==2: |
|
1168 |
self. |
|
|
1169 |
self. |
|
|
1170 | print "selectChannel" | |
|
565 | self.specOpComHeights.setEnabled(True) | |
|
566 | self.specOpHeights.setEnabled(True) | |
|
1171 | 567 | if p0==0: |
|
1172 | print " deshabilitado" | |
|
1173 |
self. |
|
|
1174 | self.numberChannelopSpec.setEnabled(False) | |
|
568 | self.specOpComHeights.setEnabled(False) | |
|
569 | self.specOpHeights.setEnabled(False) | |
|
570 | ||
|
1175 | 571 | |
|
1176 | 572 | @pyqtSignature("int") |
|
1177 |
def on_ |
|
|
573 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
|
1178 | 574 | """ |
|
1179 | 575 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
1180 | 576 | """ |
|
1181 | 577 | if p0==2: |
|
1182 |
self. |
|
|
1183 | ||
|
1184 | print "selectIncohInt" | |
|
578 | self.specOpIncoherent.setEnabled(True) | |
|
1185 | 579 | if p0==0: |
|
1186 | print " deshabilitado" | |
|
1187 | self.valueIncohIntOpSpec.setEnabled(False) | |
|
580 | self.specOpIncoherent.setEnabled(False) | |
|
1188 | 581 | |
|
1189 | 582 | @pyqtSignature("int") |
|
1190 |
def on_ |
|
|
583 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
|
1191 | 584 | """ |
|
1192 | 585 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
1193 | 586 | """ |
|
1194 | 587 | if p0==2: |
|
1195 |
self. |
|
|
1196 | ||
|
1197 | print "removedcOpSpecCEB" | |
|
588 | self.specOpRemoveDC.setEnabled(True) | |
|
1198 | 589 | if p0==0: |
|
1199 | print " deshabilitado" | |
|
1200 | self.valueremoveDCOpSpec.setEnabled(False) | |
|
1201 | ||
|
1202 | ||
|
1203 | def setDisableAllSpecop(self): | |
|
1204 | self.valuenFFTPointOpSpec.setEnabled(False) | |
|
1205 | self.valueSelecChOpHei.setEnabled(False) | |
|
1206 | self.selecHeiopSpec.setEnabled(False) | |
|
1207 | self.numberChannelopSpec.setEnabled(False) | |
|
1208 | self.valueSelecChOpSpec.setEnabled(False) | |
|
1209 | self.valueIncohIntOpSpec.setEnabled(False) | |
|
1210 | self.valueremoveDCOpSpec.setEnabled(False) | |
|
1211 | #-----------------------SPEC_PUSHBUTTON_ACCEPT_OPERATION----------------------------# | |
|
1212 | ||
|
1213 | ||
|
1214 | ||
|
1215 | ||
|
590 | self.specOpRemoveDC.setEnabled(False) | |
|
591 | ||
|
1216 | 592 | @pyqtSignature("") |
|
1217 |
def on_ |
|
|
593 | def on_specOpOk_clicked(self): | |
|
1218 | 594 | """ |
|
1219 | 595 | AÑADE OPERACION SPECTRA |
|
1220 | 596 | """ |
|
1221 | print "AÑADEOPERACIONSPECTRA" | |
|
1222 | 597 | for i in self.__arbolDict: |
|
1223 | 598 | if self.__arbolDict[i]==self.indexclick: |
|
1224 | print "INDEXCLICK=ARBOLDICT",i | |
|
1225 | 599 | if self.__upObjDict.has_key(i)==True: |
|
1226 | 600 | self.upObj=self.__upObjDict[i] |
|
1227 | print self.__upObjDict[i].name | |
|
1228 | # self.operObjList.append(opObj10) | |
|
1229 | ||
|
1230 | if self.nFFTPointOpSpecCEB.isChecked(): | |
|
1231 | value=self.valuenFFTPointOpSpec.text() | |
|
1232 |
self.upObj.addParameter(name=' |
|
|
1233 | print "nFFTpoints" | |
|
1234 | ||
|
601 | # self.operObjList.append(opObj10) | |
|
602 | if self.specOpCebnFFTpoints.isChecked(): | |
|
603 | value1=self.specOpnFFTpoints.text() | |
|
604 | value2=self.specOppairsList.text() | |
|
605 | self.upObj.addParameter(name='nFFTPoints',value=value1,format='int') | |
|
606 | self.upObj.addParameter(name='pairsList', value=value2, format='pairslist') | |
|
1235 | 607 | |
|
1236 |
if self. |
|
|
1237 |
if self. |
|
|
608 | if self.specOpCebHeights.isChecked(): | |
|
609 | if self.specOpComHeights.currentIndex()== 0: | |
|
1238 | 610 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
1239 |
value=self.s |
|
|
611 | value=self.specOpHeights.text() | |
|
1240 | 612 | valueList=value.split(',') |
|
1241 | 613 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
1242 | 614 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
1243 | 615 | else: |
|
1244 | 616 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
1245 |
value=self.s |
|
|
617 | value=self.specOpHeights.text() | |
|
1246 | 618 | valueList=value.split(',') |
|
1247 | 619 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
1248 | 620 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
1249 | 621 | |
|
1250 |
if self.s |
|
|
1251 |
if self. |
|
|
622 | if self.specOpCebChannel.isChecked(): | |
|
623 | if self.specOpComChannel.currentIndex()== 0: | |
|
1252 | 624 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
1253 | 625 | self.operObjList.append(opObj10) |
|
1254 |
value=self. |
|
|
626 | value=self.specOpChannel.text() | |
|
1255 | 627 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
1256 | 628 | else: |
|
1257 | 629 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
1258 | 630 | self.operObjList.append(opObj10) |
|
1259 |
value=self. |
|
|
1260 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
|
1261 | print "channel" | |
|
631 | value=self.specOpChannel.text() | |
|
632 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
|
1262 | 633 | |
|
1263 |
if self. |
|
|
634 | if self.specOpCebIncoherent.isChecked(): | |
|
1264 | 635 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') |
|
1265 | 636 | self.operObjList.append(opObj10) |
|
1266 |
value=self. |
|
|
637 | value=self.specOpIncoherent.text() | |
|
1267 | 638 | opObj10.addParameter(name='n', value=value, format='float') |
|
1268 | 639 | |
|
1269 |
if self. |
|
|
640 | if self.specOpCebRemoveDC.isChecked(): | |
|
1270 | 641 | opObj10=self.upObj.addOperation(name='removeDC') |
|
1271 |
value=self. |
|
|
1272 | opObj10.addParameter(name='mode', value=value,format='int') | |
|
1273 | ||
|
1274 | ||
|
1275 | #---------------------VENTANA DE CONFIGURACION GRAPH SPECTRA------------------# | |
|
642 | value=self.specOpRemoveDC.text() | |
|
643 | opObj10.addParameter(name='mode', value=value,format='int') | |
|
644 | ||
|
645 | ||
|
646 | self.tabopSpectra.setEnabled(False) | |
|
647 | self.console.clear() | |
|
648 | self.console.append("If you want to save your project") | |
|
649 | self.console.append("click on your project name in the Tree Project Explorer") | |
|
650 | ||
|
651 | ||
|
652 | #------Spectra Graph--------# | |
|
1276 | 653 | @pyqtSignature("int") |
|
1277 |
def on_ |
|
|
1278 | self.setClearAllElementGraph() | |
|
1279 | self.setEnableAllElementGraph() | |
|
654 | def on_specGraphComType_activated(self,index): | |
|
1280 | 655 | if index==0: |
|
1281 | self.timeRangeGraphSpec.setEnabled(False) | |
|
656 | print "return" | |
|
657 | ||
|
1282 | 658 | if index==1: |
|
1283 |
self. |
|
|
659 | self.setspecGraph() | |
|
660 | self.specGraphTimeRange.setEnabled(False) | |
|
661 | ||
|
1284 | 662 | if index==2: |
|
1285 |
self. |
|
|
663 | self.setspecGraph() | |
|
664 | self.specGraphTimeRange.setEnabled(False) | |
|
665 | ||
|
1286 | 666 | if index==3: |
|
1287 |
self. |
|
|
1288 | ||
|
667 | self.setspecGraph() | |
|
668 | ||
|
669 | ||
|
670 | if index==4: | |
|
671 | self.setspecGraph() | |
|
672 | self.specGraphTimeRange.setEnabled(False) | |
|
1289 | 673 | |
|
674 | if index==5: | |
|
675 | self.setspecGraph() | |
|
676 | ||
|
677 | if index==6: | |
|
678 | self.setspecGraph() | |
|
679 | self.specGgraphzrange.setEnabled(False) | |
|
680 | ||
|
1290 | 681 | @pyqtSignature("int") |
|
1291 |
def on_s |
|
|
682 | def on_specGraphCebSave_stateChanged(self, p0): | |
|
1292 | 683 | """ |
|
1293 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
|
1294 | 684 | """ |
|
1295 | 685 | if p0==2: |
|
1296 |
self. |
|
|
1297 |
self. |
|
|
1298 | print " nFFTPoint" | |
|
686 | self.specGraphPath.setEnabled(True) | |
|
687 | self.specGraphPrefix.setEnabled(True) | |
|
688 | self.specGraphToolPath.setEnabled(True) | |
|
1299 | 689 | if p0==0: |
|
1300 | print " deshabilitado" | |
|
1301 |
self. |
|
|
1302 |
s |
|
|
1303 | ||
|
690 | self.specGraphPath.setEnabled(False) | |
|
691 | self.specGraphPrefix.setEnabled(False) | |
|
692 | slef.specGraphToolPath.setEnabled(False) | |
|
693 | @pyqtSignature("") | |
|
694 | def on_specGraphToolPath_clicked(self): | |
|
695 | """ | |
|
696 | """ | |
|
697 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
|
698 | self.specGraphPath.setText(self.savePath) | |
|
699 | if not os.path.exists(self.savePath): | |
|
700 | self.console.clear() | |
|
701 | self.console.append("Write a correct a path") | |
|
702 | return | |
|
1304 | 703 | |
|
1305 | 704 | @pyqtSignature("") |
|
1306 |
def on_ |
|
|
705 | def on_specGraphOk_clicked(self): | |
|
1307 | 706 | |
|
1308 | print "AÑADEOPERACIONSPECTRA" | |
|
1309 | ||
|
1310 | 707 | for i in self.__arbolDict: |
|
1311 | 708 | if self.__arbolDict[i]==self.indexclick: |
|
1312 | print "INDEXCLICK=ARBOLDICT",i | |
|
1313 | 709 | if self.__upObjDict.has_key(i)==True: |
|
1314 | 710 | self.upObj=self.__upObjDict[i] |
|
1315 | print self.__upObjDict[i].name | |
|
1316 | ||
|
1317 | if self.dataTypeSelectorCmb.currentIndex()==0: | |
|
711 | ||
|
712 | if self.specGraphComType.currentIndex()==1: | |
|
1318 | 713 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') |
|
1319 | opObj10.addParameter(name='idfigure', value='1', format='int') | |
|
1320 | self.properSpecGraph(opObj10) | |
|
714 | self.properSpecGraph(opObj10) | |
|
1321 | 715 | |
|
1322 |
if self. |
|
|
716 | if self.specGraphComType.currentIndex()==2: | |
|
1323 | 717 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') |
|
1324 | 718 | self.properSpecGraph(opObj10) |
|
1325 | 719 | opObj10.addParameter(name='power_cmap', value='jet', format='str') |
|
1326 | 720 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1327 | 721 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1328 | 722 | |
|
1329 |
if self. |
|
|
723 | if self.specGraphComType.currentIndex()==3: | |
|
1330 | 724 | opObj10=self.upObj.addOperation(name='RTIPlot',optype='other') |
|
1331 |
self.properSpecGraph(opObj10) |
|
|
725 | self.properSpecGraph(opObj10) | |
|
726 | value =self.specGraphTimeRange.text() | |
|
727 | opObj10.addParameter(name='timerange', value=value, format='int') | |
|
1332 | 728 | |
|
1333 |
if self. |
|
|
729 | if self.specGraphComType.currentIndex()==4: | |
|
1334 | 730 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') |
|
1335 | 731 | self.properSpecGraph(opObj10) |
|
1336 | 732 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1337 | 733 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1338 | 734 | |
|
1339 |
if self. |
|
|
735 | if self.specGraphComType.currentIndex()==5: | |
|
1340 | 736 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') |
|
1341 | 737 | self.properSpecGraph(opObj10) |
|
1342 | self.setDisableAllElementSpecGraph() | |
|
1343 |
|
|
|
1344 | ||
|
1345 | @pyqtSignature("") | |
|
1346 | def on_dataGraphSpecCancelBtn_clicked(self): | |
|
1347 | print "alexvaldez" | |
|
1348 | ||
|
738 | self.specGgraphzrange.setEnabled(False) | |
|
739 | ||
|
740 | if self.specGraphComType.currentIndex()==6: | |
|
741 | opObj10=self.upObj.addOperation(name='ProfilePlot',optype='other') | |
|
742 | self.properSpecGraph(opObj10) | |
|
743 | self.specGgraphzrange.setEnabled(False) | |
|
744 | ||
|
745 | ||
|
746 | #self.tabgraphSpectra.setEnabled(False) | |
|
747 | self.specGraphComType.setEnabled(False) | |
|
748 | self.console.clear() | |
|
749 | self.console.append("If you want to save your project") | |
|
750 | self.console.append("click on your project name in the Tree Project Explorer") | |
|
751 | ||
|
752 | @pyqtSignature("") | |
|
753 | def on_specGraphClear_clicked(self): | |
|
754 | self.clearspecGraph() | |
|
755 | ||
|
1349 | 756 | def properSpecGraph(self,opObj10): |
|
1350 | print opObj10.id | |
|
757 | ||
|
1351 | 758 | self.operObjList.append(opObj10) |
|
1352 |
wintitle=self. |
|
|
759 | wintitle=self.specGraphWinTitle.text() | |
|
1353 | 760 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') |
|
1354 |
idfigure=self. |
|
|
1355 | opObj10.addParameter(name='idfigure', value=idfigure, format='int') | |
|
1356 | ||
|
761 | idfigure=self.specGraphIdFigure.text() | |
|
1357 | 762 | |
|
1358 | channelList=self.channelListgraphSpec.text() | |
|
1359 | if self.channelListgraphSpec.isModified(): | |
|
763 | opObj10.addParameter(name='idfigure', value=idfigure, format='int') | |
|
764 | ||
|
765 | channelList=self.specGraphChannelList.text() | |
|
766 | if self.specGraphChannelList.isModified(): | |
|
1360 | 767 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
1361 | 768 | |
|
1362 |
xvalue= self. |
|
|
1363 |
if self. |
|
|
769 | xvalue= self.specGgraphxrange.text() | |
|
770 | if self.specGgraphxrange.isModified(): | |
|
1364 | 771 | xvalueList=xvalue.split(',') |
|
1365 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |
|
1366 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |
|
1367 | else: | |
|
1368 | print "cambio" | |
|
1369 | yvalue= self.yminGraphSpec.text() | |
|
1370 | if self.yminGraphSpec.isModified(): | |
|
772 | try: | |
|
773 | value=int(xvalueList[0]) | |
|
774 | value=int(xvalueList[1]) | |
|
775 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |
|
776 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |
|
777 | except: | |
|
778 | return 0 | |
|
779 | ||
|
780 | yvalue= self.specGgraphyrange.text() | |
|
781 | if self.specGgraphyrange.isModified(): | |
|
1371 | 782 | yvalueList=yvalue.split(",") |
|
1372 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |
|
1373 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |
|
1374 | else: | |
|
1375 | print "cambio" | |
|
1376 | zvalue= self.zminGraphSpec.text() | |
|
1377 | if self.zminGraphSpec.isModified(): | |
|
1378 | zvalueList=zvalue.split(",") | |
|
1379 | if opObj10.name=="RTIfromNoise": | |
|
1380 | print "No_z" | |
|
1381 | else: | |
|
1382 | if self.zminGraphSpec.isModified(): | |
|
1383 | zvalueList=zvalue.split(",") | |
|
1384 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |
|
1385 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |
|
1386 |
opObj10.addParameter(name=' |
|
|
1387 | ||
|
1388 |
|
|
|
1389 |
|
|
|
783 | try: | |
|
784 | value=int(yvalueList[0]) | |
|
785 | value=int(yvalueList[1]) | |
|
786 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |
|
787 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |
|
788 | except: | |
|
789 | return 0 | |
|
790 | ||
|
791 | zvalue= self.specGgraphzrange.text() | |
|
792 | if self.specGgraphzrange.isModified(): | |
|
793 | zvalueList=zvalue.split(",") | |
|
794 | try: | |
|
795 | value=int(zvalueList[0]) | |
|
796 | value=int(zvalueList[1]) | |
|
797 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |
|
798 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |
|
799 | except: | |
|
800 | return 0 | |
|
801 | ||
|
1390 | 802 | |
|
1391 |
if self.s |
|
|
1392 |
opObj10.addParameter(name='save', value='1', format=' |
|
|
1393 |
opObj10.addParameter(name='figpath', value= self. |
|
|
1394 |
opObj10.addParameter(name='figfile', value= self. |
|
|
803 | if self.specGraphCebSave.isChecked(): | |
|
804 | opObj10.addParameter(name='save', value='1', format='bool') | |
|
805 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |
|
806 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |
|
807 | ||
|
808 | ||
|
809 | def setspecGraph(self): | |
|
810 | self.specGraphIdFigure.setEnabled(True) | |
|
811 | self.specGraphWinTitle.setEnabled(True) | |
|
812 | self.specGraphChannelList.setEnabled(True) | |
|
813 | self.specGgraphxrange.setEnabled(True) | |
|
814 | self.specGgraphyrange.setEnabled(True) | |
|
815 | self.specGgraphzrange.setEnabled(True) | |
|
816 | self.specGraphTimeRange.setEnabled(True) | |
|
817 | # self.specGraphPath.setEnabled(True) | |
|
818 | # self.specGraphToolPath.setEnabled(True) | |
|
819 | # self.specGraphPrefix.setEnabled(True) | |
|
820 | def clearspecGraph(self): | |
|
821 | self.specGraphComType.setEnabled(True) | |
|
822 | self.specGraphComType.setCurrentIndex(0) | |
|
823 | self.specGraphIdFigure.clear() | |
|
824 | self.specGraphWinTitle.clear() | |
|
825 | self.specGraphChannelList.clear() | |
|
826 | self.specGgraphxrange.clear() | |
|
827 | self.specGgraphyrange.clear() | |
|
828 | self.specGgraphzrange.clear() | |
|
829 | self.specGraphTimeRange.clear() | |
|
830 | ||
|
831 | def playProject(self): | |
|
832 | ||
|
833 | for i in self.__arbolDict: | |
|
834 | if self.__arbolDict[i]==self.indexclick: | |
|
835 | self.projectObj=self.__projObjDict[i] | |
|
836 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" | |
|
837 | self.projectObj.readXml(filename) | |
|
838 | #controllerObj.printattr() | |
|
839 | ||
|
840 | self.projectObj.createObjects() | |
|
841 | self.projectObj.connectObjects() | |
|
842 | self.projectObj.run() | |
|
843 | self.console.clear() | |
|
844 | self.console.append("Please Wait...") | |
|
845 | ||
|
846 | ||
|
847 | def saveProject(self): | |
|
848 | ||
|
849 | for i in self.__arbolDict: | |
|
850 | if self.__arbolDict[i]==self.indexclick: | |
|
851 | self.projectObj=self.__projObjDict[i] | |
|
852 | filename="C:\WorkspaceGUI\config"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" | |
|
853 | self.projectObj.writeXml(filename) | |
|
854 | self.console.clear() | |
|
855 | self.console.append("Now, you can push the icon Start in the toolbar or push start in menu run") | |
|
856 | ||
|
857 | ||
|
858 | def clickFunction(self,index): | |
|
859 | self.indexclick= index.model().itemFromIndex(index) | |
|
860 | ||
|
861 | def doubleclickFunction(self): | |
|
862 | for i in self.__arbolDict: | |
|
863 | if self.__arbolDict[i]==self.indexclick: | |
|
864 | if self.__projObjDict.has_key(i)==True: | |
|
865 | self.proName.setText(str(self.__projObjDict[i].name)) | |
|
866 | self.proDataPath.setText(str(self.readUnitConfObjList[i-1].path)) | |
|
867 | self.model_2=treeModel() | |
|
868 | self.model_2.setParams(name = str(self.__projObjDict[i].name), | |
|
869 | directorio = str(self.readUnitConfObjList[i-1].path), | |
|
870 | workspace = "C:\\WorkspaceGUI", | |
|
871 | remode = "off Line", | |
|
872 | dataformat = self.readUnitConfObjList[i-1].datatype, | |
|
873 | date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate), | |
|
874 | initTime = str(self.readUnitConfObjList[i-1].startTime), | |
|
875 | endTime = str(self.readUnitConfObjList[i-1].endTime), | |
|
876 | timezone = "Local" , | |
|
877 | Summary = str(self.__projObjDict[i].description)) | |
|
878 | self.treeProjectProperties.setModel(self.model_2) | |
|
879 | self.treeProjectProperties.expandAll() | |
|
880 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
881 | ||
|
882 | if self.indexclick.text()=='Voltage': | |
|
883 | self.tabVoltage.setEnabled(True) | |
|
884 | self.tabSpectra.setEnabled(False) | |
|
885 | self.tabCorrelation.setEnabled(False) | |
|
886 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
|
887 | ||
|
888 | self.volOpComChannels.setEnabled(False) | |
|
889 | self.volOpComHeights.setEnabled(False) | |
|
890 | self.volOpFilter.setEnabled(False) | |
|
891 | self.volOpComProfile.setEnabled(False) | |
|
892 | self.volOpComCode.setEnabled(False) | |
|
893 | self.volOpCohInt.setEnabled(False) | |
|
894 | self.volOpChannel.clear() | |
|
895 | self.volOpHeights.clear() | |
|
896 | self.volOpProfile.clear() | |
|
897 | self.volOpFilter.clear() | |
|
898 | ||
|
899 | self.volOpChannel.setEnabled(False) | |
|
900 | self.volOpHeights.setEnabled(False) | |
|
901 | self.volOpProfile.setEnabled(False) | |
|
902 | self.volOpCebHeights.clearFocus() | |
|
903 | # self.volOpCebChannels.clear() | |
|
904 | # self.volOpCebHeights.clear() | |
|
905 | # self.volOpCebFilter.clear() | |
|
906 | # self.volOpCebProfile.clear() | |
|
907 | # self.volOpCebDecodification.clear() | |
|
908 | # self.volOpCebCohInt.clear() | |
|
909 | ||
|
910 | ||
|
911 | if self.indexclick.text()=='Spectra': | |
|
912 | self.tabSpectra.setEnabled(True) | |
|
913 | self.tabVoltage.setEnabled(False) | |
|
914 | self.tabCorrelation.setEnabled(False) | |
|
915 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
|
916 | ||
|
917 | if self.indexclick.text()=='Correlation': | |
|
918 | self.tabCorrelation.setEnabled(True) | |
|
919 | self.tabVoltage.setEnabled(False) | |
|
920 | self.tabSpectra.setEnabled(False) | |
|
921 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) | |
|
922 | ||
|
923 | def popup(self, pos): | |
|
924 | ||
|
925 | menu = QtGui.QMenu() | |
|
926 | quitAction0 = menu.addAction("AddNewProject") | |
|
927 | quitAction1 = menu.addAction("AddNewProcessingUnit") | |
|
928 | quitAction2 = menu.addAction("Exit") | |
|
929 | #quitAction2 = menu.addAction("Exit") | |
|
930 | action = menu.exec_(self.mapToGlobal(pos)) | |
|
931 | if action == quitAction0: | |
|
932 | self.setProjectParam() | |
|
933 | if action == quitAction1: | |
|
934 | self.addPU() | |
|
935 | self.console.clear() | |
|
936 | self.console.append("Please, Choose the type of Processing Unit") | |
|
937 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
|
938 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
|
939 | if action == quitAction2: | |
|
940 | return | |
|
941 | ||
|
942 | def setProjectParam(self): | |
|
943 | self.tabWidgetProject.setEnabled(True) | |
|
944 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
945 | self.tabProject.setEnabled(True) | |
|
946 | ||
|
947 | self.proName.clear() | |
|
948 | self.proDataPath.clear() | |
|
949 | self.proComDataType.clear() | |
|
950 | self.proComDataType.addItem("Voltage") | |
|
951 | self.proComDataType.addItem("Spectra") | |
|
952 | startTime="00:00:00" | |
|
953 | endTime="23:59:59" | |
|
954 | starlist=startTime.split(":") | |
|
955 | endlist=endTime.split(":") | |
|
956 | ||
|
957 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
|
958 | self.proStartTime.setTime(self.time) | |
|
959 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
|
960 | self.proEndTime.setTime(self.time) | |
|
961 | self.proDescription.clear() | |
|
962 | ||
|
963 | self.console.clear() | |
|
964 | self.console.append("Please, Write a name Project") | |
|
965 | self.console.append("Introduce Project Parameters") | |
|
966 | self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
|
967 | ||
|
968 | ||
|
969 | def addPU(self): | |
|
970 | self.configUP=UnitProcess(self) | |
|
971 | for i in self.__arbolDict: | |
|
972 | if self.__arbolDict[i]==self.indexclick: | |
|
973 | if self.__projObjDict.has_key(i)==True: | |
|
974 | self.projectObj=self.__projObjDict[int(i)] | |
|
975 | self.configUP.dataTypeProject=str(self.proComDataType.currentText()) | |
|
976 | self.configUP.getfromWindowList.append(self.projectObj) | |
|
977 | else: | |
|
978 | self.upObj=self.__upObjDict[i] | |
|
979 | self.configUP.getfromWindowList.append(self.upObj) | |
|
980 | ||
|
981 | self.configUP.loadTotalList() | |
|
982 | self.configUP.show() | |
|
983 | self.configUP.closed.connect(self.createUP) | |
|
984 | ||
|
985 | def createUP(self): | |
|
986 | ||
|
987 | if not self.configUP.create: | |
|
988 | return | |
|
989 | ||
|
990 | self.uporProObjRecover=self.configUP.getFromWindow | |
|
991 | ||
|
992 | self.upType = self.configUP.typeofUP | |
|
993 | for i in self.__arbolDict: | |
|
994 | if self.__arbolDict[i]==self.indexclick: | |
|
995 | if self.__projObjDict.has_key(i)==True: | |
|
996 | self.projectObj=self.__projObjDict[int(i)] | |
|
997 | ||
|
998 | if self.__upObjDict.has_key(i)==True: | |
|
999 | self.upObj=self.__upObjDict[i] | |
|
1000 | getIdProject=self.upObj.id[0] | |
|
1001 | self.projectObj=self.__projObjDict[int(getIdProject)] | |
|
1002 | ||
|
1003 | datatype=str(self.upType) | |
|
1004 | uporprojectObj=self.uporProObjRecover | |
|
1395 | 1005 | |
|
1006 | if uporprojectObj.getElementName()=='ProcUnit': | |
|
1007 | inputId=uporprojectObj.getId() | |
|
1008 | self.console.clear() | |
|
1009 | self.console.append("Double Clik on the Processing Unit to enable the tab") | |
|
1010 | self.console.append("Before Add other Processing Unit complete the tab") | |
|
1011 | else: | |
|
1012 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() | |
|
1013 | self.console.clear() | |
|
1014 | self.console.append("Double Clik on the Processing Unit to enable the tab") | |
|
1015 | self.console.append("Before Add other Project or Processing Unit complete the tab") | |
|
1016 | ||
|
1017 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
|
1018 | self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1 | |
|
1019 | self.parentItem=self.__arbolDict[uporprojectObj.id] | |
|
1020 | self.numbertree=int(self.procUnitConfObj1.getId())-1 | |
|
1021 | self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree)) | |
|
1022 | self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) | |
|
1023 | self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] | |
|
1024 | self.treeProjectExplorer.expandAll() | |
|
1396 | 1025 | |
|
1397 | def setClearAllElementGraph(self): | |
|
1398 | self.winTitleGraphSpec.clear() | |
|
1399 | self.channelListgraphSpec.clear() | |
|
1400 | self.xminGraphSpec.clear() | |
|
1401 | self.yminGraphSpec.clear() | |
|
1402 | self.zminGraphSpec.clear() | |
|
1403 | self.timeRangeGraphSpec.clear() | |
|
1404 | self.dataPathTxtSpec.clear() | |
|
1405 | self.dataPrefixGraphSpec.clear() | |
|
1026 | ||
|
1027 | def searchData(self,path,ext,walk,expLabel=''): | |
|
1028 | dateList=[] | |
|
1029 | fileList=[] | |
|
1030 | if walk== 0: | |
|
1031 | files= os.listdir(path) | |
|
1032 | for thisFile in files: | |
|
1033 | if not os.path.isfile(thisFile): | |
|
1034 | continue | |
|
1035 | thisExt = os.path.splitext(thisFile)[-1] | |
|
1036 | ||
|
1037 | if thisExt != ext: | |
|
1038 | continue | |
|
1039 | ||
|
1040 | fileList.append(file) | |
|
1041 | ||
|
1042 | for thisFile in fileList: | |
|
1043 | ||
|
1044 | if not isRadarFile(thisFile): | |
|
1045 | self.console.clear() | |
|
1046 | self.console.append("Please, Choose the Correct Path") | |
|
1047 | self.proOk.setEnabled(False) | |
|
1048 | continue | |
|
1049 | ||
|
1050 | year = int(thisFile[1:5]) | |
|
1051 | doy = int(thisFile[5:8]) | |
|
1052 | ||
|
1053 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
|
1054 | dateformat = date.strftime("%Y/%m/%d") | |
|
1055 | ||
|
1056 | if dateformat not in dateList: | |
|
1057 | dateList.append(dateformat) | |
|
1058 | ||
|
1059 | if walk == 1: | |
|
1060 | ||
|
1061 | dirList = os.listdir(path) | |
|
1062 | dirList.sort() | |
|
1063 | ||
|
1064 | dateList = [] | |
|
1406 | 1065 | |
|
1407 | def setDisableAllElementSpecGraph(self): | |
|
1408 | self.winTitleGraphSpec.setEnabled(False) | |
|
1409 | self.channelListgraphSpec.setEnabled(False) | |
|
1410 | self.xminGraphSpec.setEnabled(False) | |
|
1411 | self.yminGraphSpec.setEnabled(False) | |
|
1412 |
self. |
|
|
1413 | self.timeRangeGraphSpec.setEnabled(False) | |
|
1414 | self.dataPathTxtSpec.setEnabled(False) | |
|
1415 | self.dataPrefixGraphSpec.setEnabled(False) | |
|
1416 |
|
|
|
1417 | def setEnableAllElementGraph(self): | |
|
1418 | self.winTitleGraphSpec.setEnabled(True) | |
|
1419 | self.channelListgraphSpec.setEnabled(True) | |
|
1420 | self.xminGraphSpec.setEnabled(True) | |
|
1421 | self.yminGraphSpec.setEnabled(True) | |
|
1422 | self.zminGraphSpec.setEnabled(True) | |
|
1423 | self.timeRangeGraphSpec.setEnabled(True) | |
|
1424 | # | |
|
1066 | for thisDir in dirList: | |
|
1067 | ||
|
1068 | if not isRadarPath(thisDir): | |
|
1069 | self.console.clear() | |
|
1070 | self.console.append("Please, Choose the Correct Path") | |
|
1071 | self.proOk.setEnabled(False) | |
|
1072 | continue | |
|
1073 | ||
|
1074 | doypath = os.path.join(path, thisDir, expLabel) | |
|
1075 | ||
|
1076 | files = os.listdir(doypath) | |
|
1077 | fileList = [] | |
|
1078 | ||
|
1079 | for thisFile in files: | |
|
1080 | ||
|
1081 | if os.path.splitext(thisFile)[-1] != ext: | |
|
1082 | continue | |
|
1083 | ||
|
1084 | if not isRadarFile(thisFile): | |
|
1085 | self.proOk.setEnabled(False) | |
|
1086 | self.console.clear() | |
|
1087 | self.console.append("Please, Choose the Correct Path") | |
|
1088 | continue | |
|
1089 | ||
|
1090 | fileList.append(thisFile) | |
|
1091 | break | |
|
1092 | ||
|
1093 | if fileList == []: | |
|
1094 | continue | |
|
1095 | ||
|
1096 | year = int(thisDir[1:5]) | |
|
1097 | doy = int(thisDir[5:8]) | |
|
1098 | ||
|
1099 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
|
1100 | dateformat = date.strftime("%Y/%m/%d") | |
|
1101 | dateList.append(dateformat) | |
|
1102 | ||
|
1103 | return dateList | |
|
1104 | ||
|
1105 | def loadDays(self): | |
|
1106 | """ | |
|
1107 | Method to loads day | |
|
1108 | """ | |
|
1109 | ext=str(self.proDataType.text()) | |
|
1110 | try: | |
|
1111 | punto = str(ext[1:2]) | |
|
1112 | ext=self.datatype | |
|
1113 | except: | |
|
1114 | self.console.clear() | |
|
1115 | self.console.append("Please, Choose DataType") | |
|
1116 | return 0 | |
|
1117 | ||
|
1118 | #-------------------------# | |
|
1119 | walk= self.walk | |
|
1120 | ||
|
1121 | path=str(self.proDataPath.text()) | |
|
1122 | self.proComStartDate.clear() | |
|
1123 | self.proComEndDate.clear() | |
|
1124 | #Load List to select start day and end day.(QComboBox) | |
|
1125 | dateList=self.searchData(path,ext=ext,walk=walk) | |
|
1126 | self.dateList=dateList | |
|
1127 | for thisDate in dateList: | |
|
1128 | self.proComStartDate.addItem(thisDate) | |
|
1129 | self.proComEndDate.addItem(thisDate) | |
|
1130 | self.proComEndDate.setCurrentIndex(self.proComStartDate.count()-1) | |
|
1131 | ||
|
1132 | def setParameter(self): | |
|
1133 | self.setWindowTitle("ROJ-Signal Chain") | |
|
1134 | self.setWindowIcon(QtGui.QIcon("figure/adn.jpg")) | |
|
1135 | self.tabWidgetProject.setEnabled(False) | |
|
1136 | self.tabVoltage.setEnabled(False) | |
|
1137 | self.tabSpectra.setEnabled(False) | |
|
1138 | self.tabCorrelation.setEnabled(False) | |
|
1139 | ||
|
1140 | self.proName.clear() | |
|
1141 | self.proDataPath.setText('C:\Rawdata') | |
|
1142 | self.console.append("Welcome to Signal Chain please Create a New Project") | |
|
1143 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
|
1144 | self.time =QtCore.QTime() | |
|
1145 | self.hour =0 | |
|
1146 | self.min =0 | |
|
1147 | self.sec =0 | |
|
1148 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
|
1149 | startTime="00:00:00" | |
|
1150 | endTime="23:59:59" | |
|
1151 | starlist=startTime.split(":") | |
|
1152 | endlist=endTime.split(":") | |
|
1153 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
|
1154 | self.proStartTime.setTime(self.time) | |
|
1155 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
|
1156 | self.proEndTime.setTime(self.time) | |
|
1157 | self.proOk.setEnabled(False) | |
|
1158 | #set model Project Explorer | |
|
1159 | self.model = QtGui.QStandardItemModel() | |
|
1160 | self.model.setHorizontalHeaderLabels(("Project Explorer",)) | |
|
1161 | layout = QtGui.QVBoxLayout() | |
|
1162 | layout.addWidget(self.treeProjectExplorer) | |
|
1163 | self.treeProjectExplorer.setModel(self.model) | |
|
1164 | self.treeProjectExplorer.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
|
1165 | self.treeProjectExplorer.customContextMenuRequested.connect(self.popup) | |
|
1166 | self.treeProjectExplorer.clicked.connect(self.clickFunction) | |
|
1167 | ||
|
1168 | self.treeProjectExplorer.doubleClicked.connect(self.doubleclickFunction) | |
|
1169 | self.treeProjectExplorer.expandAll() | |
|
1170 | #set model Project Properties | |
|
1171 | ||
|
1172 | self.model_2=treeModel() | |
|
1173 | self.model_2.showtree() | |
|
1174 | self.treeProjectProperties.setModel(self.model_2) | |
|
1175 | self.treeProjectProperties.expandAll() | |
|
1176 | #set Project | |
|
1177 | self.proDelay.setEnabled(False) | |
|
1178 | ||
|
1179 | #set Operation Voltage | |
|
1180 | self.volOpComChannels.setEnabled(False) | |
|
1181 | self.volOpComHeights.setEnabled(False) | |
|
1182 | self.volOpFilter.setEnabled(False) | |
|
1183 | self.volOpComProfile.setEnabled(False) | |
|
1184 | self.volOpComCode.setEnabled(False) | |
|
1185 | self.volOpCohInt.setEnabled(False) | |
|
1186 | ||
|
1187 | self.volOpChannel.setEnabled(False) | |
|
1188 | self.volOpHeights.setEnabled(False) | |
|
1189 | self.volOpProfile.setEnabled(False) | |
|
1190 | self.volOpComMode.setEnabled(False) | |
|
1191 | ||
|
1192 | self.volGraphPath.setEnabled(False) | |
|
1193 | self.volGraphPrefix.setEnabled(False) | |
|
1194 | self.volGraphToolPath.setEnabled(False) | |
|
1195 | ||
|
1196 | #set Graph Voltage | |
|
1197 | self.volGraphIdFigure.setEnabled(False) | |
|
1198 | self.volGraphWintitle.setEnabled(False) | |
|
1199 | self.volGraphChannelList.setEnabled(False) | |
|
1200 | self.volGraphxrange.setEnabled(False) | |
|
1201 | self.volGraphyrange.setEnabled(False) | |
|
1202 | #set Operation Spectra | |
|
1203 | self.specOpnFFTpoints.setEnabled(False) | |
|
1204 | self.specOppairsList.setEnabled(False) | |
|
1205 | self.specOpComChannel.setEnabled(False) | |
|
1206 | self.specOpComHeights.setEnabled(False) | |
|
1207 | self.specOpIncoherent.setEnabled(False) | |
|
1208 | self.specOpRemoveDC .setEnabled(False) | |
|
1209 | self.specOpRemoveInterference.setEnabled(False) | |
|
1210 | ||
|
1211 | self.specOpChannel.setEnabled(False) | |
|
1212 | self.specOpHeights.setEnabled(False) | |
|
1213 | #set Graph Spectra | |
|
1214 | self.specGraphIdFigure.setEnabled(False) | |
|
1215 | self.specGraphWinTitle.setEnabled(False) | |
|
1216 | self.specGraphChannelList.setEnabled(False) | |
|
1217 | self.specGgraphxrange.setEnabled(False) | |
|
1218 | self.specGgraphyrange.setEnabled(False) | |
|
1219 | self.specGgraphzrange.setEnabled(False) | |
|
1220 | self.specGraphTimeRange.setEnabled(False) | |
|
1221 | self.specGraphPath.setEnabled(False) | |
|
1222 | self.specGraphToolPath.setEnabled(False) | |
|
1223 | self.specGraphPrefix.setEnabled(False) | |
|
1224 | ||
|
1225 | ||
|
1226 | #tool tip gui | |
|
1227 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
|
1228 | self.treeProjectExplorer.setToolTip('Right clik to add Project or Unit Process') | |
|
1229 | #tool tip gui project | |
|
1230 | self.proComWalk.setToolTip('Search 0: Search in format .r or pdata ,Search 1 : Search in D2009123004') | |
|
1231 | self.proComWalk.setCurrentIndex(1) | |
|
1232 | #tool tip gui volOp | |
|
1233 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
|
1234 | self.volOpHeights.setToolTip('Example: 90,180') | |
|
1235 | self.volOpFilter.setToolTip('Example: 3') | |
|
1236 | self.volOpProfile.setToolTip('Example:0,125 ') | |
|
1237 | self.volOpCohInt.setToolTip('Example: 100') | |
|
1238 | self.volOpOk.setToolTip('If you have finish, please Ok ') | |
|
1239 | #tool tip gui volGraph | |
|
1240 | self.volGraphIdFigure.setToolTip('Example: 1') | |
|
1241 | self.volGraphxrange.setToolTip('Example: 10,150') | |
|
1242 | self.volGraphyrange.setToolTip('Example: 20,180') | |
|
1243 | self.volGraphOk.setToolTip('If you have finish, please Ok ') | |
|
1244 | #tool tip gui specOp | |
|
1245 | self.specOpnFFTpoints.setToolTip('Example: 100') | |
|
1246 | self.specOpIncoherent.setToolTip('Example: 150') | |
|
1247 | self.specOpRemoveDC .setToolTip('Example: 1') | |
|
1248 | ||
|
1425 | 1249 | |
|
1250 | self.specOpChannel.setToolTip('Example: 1,2,3,4,5') | |
|
1251 | self.specOpHeights.setToolTip('Example: 90,180') | |
|
1252 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
|
1253 | #tool tip gui specGraph | |
|
1254 | self.specGraphIdFigure.setToolTip('Example: 2') | |
|
1255 | self.specGraphWinTitle.setToolTip('Example: Myplot') | |
|
1256 | self.specGraphChannelList.setToolTip('Example: Myplot') | |
|
1257 | self.specGgraphxrange.setToolTip('Example: 10,150') | |
|
1258 | self.specGgraphyrange.setToolTip('Example: 20,160') | |
|
1259 | self.specGgraphzrange.setToolTip('Example: 30,170') | |
|
1260 | ||
|
1261 | self.specGraphPrefix.setToolTip('Example: figure') | |
|
1426 | 1262 | |
|
1427 | 1263 | |
|
1428 | 1264 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
@@ -1468,16 +1304,13 class UnitProcess(QMainWindow, Ui_UnitProcess): | |||
|
1468 | 1304 | for i in self.getfromWindowList: |
|
1469 | 1305 | |
|
1470 | 1306 | name=i.getElementName() |
|
1471 | print "name",name | |
|
1472 | 1307 | if name=='Project': |
|
1473 | 1308 | id= i.id |
|
1474 | 1309 | name=i.name |
|
1475 | print "tipodeproyecto",self.dataTypeProject | |
|
1476 | 1310 | if self.dataTypeProject=='Voltage': |
|
1477 | 1311 | self.comboTypeBox.clear() |
|
1478 | 1312 | self.comboTypeBox.addItem("Voltage") |
|
1479 | self.comboTypeBox.addItem("Spectra") | |
|
1480 | self.comboTypeBox.addItem("Correlation") | |
|
1313 | ||
|
1481 | 1314 | if self.dataTypeProject=='Spectra': |
|
1482 | 1315 | self.comboTypeBox.clear() |
|
1483 | 1316 | self.comboTypeBox.addItem("Spectra") |
@@ -1501,6 +1334,4 class UnitProcess(QMainWindow, Ui_UnitProcess): | |||
|
1501 | 1334 | |
|
1502 | 1335 | def closeEvent(self, event): |
|
1503 | 1336 | self.closed.emit() |
|
1504 |
event.accept() |
|
|
1505 | ||
|
1506 | No newline at end of file | |
|
1337 | event.accept() No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now