This diff has been collapsed as it changes many lines, (2033 lines changed) Show them Hide them | |||||
@@ -1,1119 +1,517 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | Module implementing MainWindow. |
|
3 | Module implementing MainWindow. | |
4 |
#+++++++++++++ |
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
|
5 | @author: AlexanderValdezPortocarrero ñ_ñ | |||
5 | """ |
|
6 | """ | |
6 | import os,sys |
|
7 | import os, sys | |
7 |
|
||||
8 |
|
||||
9 | import datetime |
|
8 | import datetime | |
10 |
|
9 | from PyQt4.QtGui import QMainWindow | ||
11 | from PyQt4.QtGui import QMainWindow |
|
|||
12 | from PyQt4.QtCore import pyqtSignature |
|
10 | from PyQt4.QtCore import pyqtSignature | |
13 | from PyQt4.QtCore import pyqtSignal |
|
11 | from PyQt4.QtCore import pyqtSignal | |
14 | from PyQt4 import QtCore |
|
12 | from PyQt4 import QtCore | |
15 | from PyQt4 import QtGui |
|
13 | from PyQt4 import QtGui | |
16 | from timeconversions import Doy2Date |
|
|||
17 | from modelProperties import treeModel |
|
|||
18 |
|
14 | |||
19 | from viewer.ui_unitprocess import Ui_UnitProcess |
|
15 | from viewer.ui_unitprocess import Ui_UnitProcess | |
20 | from viewer.ui_window import Ui_window |
|
16 | from viewer.ui_window import Ui_window | |
21 | from viewer.ui_mainwindow import Ui_BasicWindow |
|
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: |
|
28 | def isRadarFile(file): | |
37 | year = int(file[1:5]) |
|
29 | try: | |
38 |
|
|
30 | year = int(file[1:5]) | |
39 |
|
|
31 | doy = int(file[5:8]) | |
40 | except: |
|
32 | set = int(file[8:11]) | |
41 |
|
|
33 | except: | |
|
34 | return 0 | |||
42 |
|
35 | |||
43 | return 1 |
|
36 | return 1 | |
44 |
|
37 | |||
45 | def isRadarPath(path): |
|
38 | def isRadarPath(path): | |
46 | try: |
|
39 | try: | |
47 | year = int(path[1:5]) |
|
40 | year = int(path[1:5]) | |
48 | doy = int(path[5:8]) |
|
41 | doy = int(path[5:8]) | |
49 | except: |
|
42 | except: | |
50 | return 0 |
|
43 | return 0 | |
51 |
|
44 | |||
52 | return 1 |
|
45 | return 1 | |
53 |
|
||||
54 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
|||
55 | __projObjDict = None |
|
|||
56 | __arbolDict = None |
|
|||
57 | __upObjDict = None |
|
|||
58 |
|
46 | |||
|
47 | ||||
|
48 | class BasicWindow(QMainWindow,Ui_BasicWindow): | |||
59 | """ |
|
49 | """ | |
60 | Class documentation goes here. |
|
50 | ||
61 | #*############VENTANA CUERPO DEL PROGRAMA############## |
|
|||
62 | """ |
|
51 | """ | |
63 |
def __init__(self, |
|
52 | def __init__(self,parent = None): | |
64 | """ |
|
53 | """ | |
65 | Constructor |
|
54 | ||
66 |
""" |
|
55 | """ | |
67 | print "INICIO PROGRAMA " |
|
56 | QMainWindow.__init__(self,parent) | |
68 | QMainWindow.__init__(self, parent) |
|
57 | self.setupUi(self) | |
69 | self.setupUi(self) |
|
58 | self.__projObjDict = {} | |
70 |
|
59 | self.__upObjDict = {} | ||
71 |
self.__ |
|
60 | self.__arbolDict = {} | |
72 | self.__arbolDict = {} |
|
61 | self.readUnitConfObjList=[] | |
73 |
self. |
|
62 | self.operObjList=[] | |
74 |
self. |
|
63 | self.idp = 0 | |
75 |
self. |
|
64 | self.online=0 | |
76 |
self. |
|
65 | self.walk=1 | |
77 |
|
66 | self.indexclick=None | ||
78 | self.online=0 |
|
67 | self.setParameter() | |
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" |
|
|||
165 |
|
68 | |||
166 | @pyqtSignature("") |
|
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 |
|
72 | Slot documentation goes here. | |
170 | y habilita la ventana de configuracion del proyecto. |
|
|||
171 |
|
||||
172 | """ |
|
73 | """ | |
173 |
self. |
|
74 | self.setProjectParam() | |
174 |
|
|
75 | ||
175 | @pyqtSignature("") |
|
76 | @pyqtSignature("") | |
176 |
def on_ |
|
77 | def on_actionSave_triggered(self): | |
177 | """ |
|
78 | """ | |
178 | METODO EJECUTADO CUANDO OCURRE EL EVENTO GUARDAR PROJECTO |
|
79 | Slot documentation goes here. | |
179 |
|
||||
180 | Llama al metodo saveProject. |
|
|||
181 | """ |
|
80 | """ | |
182 | # my_id = arbol_selected() |
|
81 | self.saveProject() | |
183 | # filename = savefindow.show() |
|
|||
184 | # self.saveProject(id, filename) |
|
|||
185 | print "probsave" |
|
|||
186 | self.saveProject() |
|
|||
187 |
|
82 | |||
188 | @pyqtSignature("") |
|
83 | def on_actionStart_triggered(self): | |
189 | def on_menuFileCerrarObj_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 |
|
86 | self.playProject() | |
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" |
|
|||
218 |
|
87 | |||
219 |
@pyqtSignature("") |
|
88 | @pyqtSignature("") | |
220 | def on_menuRUNPausaObj_clicked(self): |
|
89 | def on_actionCreateToolbar_triggered(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): |
|
|||
239 | """ |
|
90 | """ | |
240 | METODO EJECUTADO CUANDO OCURRE EL EVENTO Config Server |
|
91 | Slot documentation goes here. | |
241 | Llama al metodo close. |
|
|||
242 | """ |
|
|||
243 | print "Not implemented yet" |
|
|||
244 | #-----------------------------------MENU_HELP-------------------------------------------------------# |
|
|||
245 |
|
||||
246 | @pyqtSignature("") |
|
|||
247 | def on_menuHELPAboutObj_clicked(self): |
|
|||
248 |
|
|
92 | """ | |
249 | METODO EJECUTADO CUANDO OCURRE EL EVENTO HELP |
|
93 | self.setProjectParam() | |
250 | Llama al metodo close. |
|
|||
251 | """ |
|
|||
252 | print "Not implemented yet" |
|
|||
253 |
|
||||
254 |
|
||||
255 | #-----------------------------------BARRA DE HERRAMIENTAS----------------------------------------# |
|
|||
256 |
|
94 | |||
257 | @pyqtSignature("") |
|
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" |
|
100 | self.saveProject() | |
263 |
|
|
101 | ||
264 | @pyqtSignature("") |
|
102 | @pyqtSignature("") | |
265 |
def on_act |
|
103 | def on_actionStarToolbar_triggered(self): | |
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. |
|
|||
269 |
|
|
104 | """ | |
270 | self.addProject() |
|
105 | Slot documentation goes here. | |
271 |
|
||||
272 | @pyqtSignature("") |
|
|||
273 | def on_actStopObj_triggered(self): |
|
|||
274 |
|
|
106 | """ | |
275 | METODO EJECUTADO CUANDO OCURRE EL EVENTO PAUSA |
|
107 | self.playProject() | |
276 | Llama al metodo PAUSA. |
|
|||
277 | """ |
|
|||
278 | print "Not implemented yet" |
|
|||
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() |
|
110 | @pyqtSignature("int") | |
296 | self.projectObj.connectObjects() |
|
111 | def on_proComReadMode_activated(self, p0): | |
297 | self.projectObj.run() |
|
|||
298 | print "Not implemented yet" |
|
|||
299 |
|
||||
300 | @pyqtSignature("") |
|
|||
301 | def on_actSaveObj_triggered(self): |
|
|||
302 | """ |
|
112 | """ | |
303 | METODO EJECUTADO CUANDO OCURRE EL EVENTO SAVE |
|
113 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
304 | Llama al metodo SAVE. |
|
|||
305 | """ |
|
|||
306 | self.saveProject() |
|
|||
307 |
|
||||
308 | #-----------------------------------PUSHBUTTON_CREATE PROJECT----------------------------------# |
|
|||
309 |
|
||||
310 | @pyqtSignature("") |
|
|||
311 | def on_addprojectBtn_clicked(self): |
|
|||
312 |
|
|
114 | """ | |
313 | CREAR PROJECT ,ANADE UN NUEVO PROYECTO, LLAMA AL MÉTODO QUE CONTIENE LAS OPERACION DE CREACION DE PROYECTOS |
|
115 | if p0==0: | |
314 | Llama al metodo addProject. |
|
116 | self.online=0 | |
315 | """ |
|
117 | self.proDelay.setEnabled(False) | |
316 | self.addProject() |
|
118 | elif p0==1: | |
317 | self.setProjectParam() |
|
119 | self.online=1 | |
318 |
|
120 | self.proDelay.setEnabled(True) | ||
319 | #------------------------------------VENTANA CONFIGURACION PROJECT----------------------------# |
|
121 | self.console.clear() | |
320 |
|
122 | self.console.append("Choose the type of Walk") | ||
|
123 | ||||
|
124 | ||||
|
125 | ||||
321 | @pyqtSignature("int") |
|
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 | if index==0: |
|
131 | if index==0: | |
328 | self.datatype='.r' |
|
132 | self.datatype='.r' | |
329 | elif index==1: |
|
133 | elif index==1: | |
330 | self.datatype='.pdata' |
|
134 | self.datatype='.pdata' | |
331 | else : |
|
135 | ||
332 | self.datatype='' |
|
136 | self.proDataType.setText(self.datatype) | |
333 | self.dataFormatTxt.setReadOnly(False) |
|
137 | self.console.clear() | |
334 | self.dataFormatTxt.setText(self.datatype) |
|
138 | self.console.append("Choose your DataPath") | |
335 | self.loadDays() |
|
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 | @pyqtSignature("") |
|
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 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
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. |
|
162 | self.proComStartDate.clear() | |
346 |
self. |
|
163 | self.proComEndDate.clear() | |
347 |
|
164 | |||
348 | if not os.path.exists(self.dataPath): |
|
165 | if not os.path.exists(self.dataPath): | |
349 |
self. |
|
166 | self.proOk.setEnabled(False) | |
350 | return |
|
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 | @pyqtSignature("int") |
|
184 | @pyqtSignature("int") | |
355 |
def on_ |
|
185 | def on_proComStartDate_activated(self, index): | |
356 | """ |
|
186 | """ | |
357 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
187 | SELECCION DEL RANGO DE FECHAS -START DATE | |
358 | """ |
|
188 | """ | |
359 |
stopIndex = self. |
|
189 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() | |
360 |
self. |
|
190 | self.proComEndDate.clear() | |
361 |
|
191 | |||
362 | for i in self.dateList[index:]: |
|
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 | @pyqtSignature("int") |
|
197 | @pyqtSignature("int") | |
368 |
def on_ |
|
198 | def on_proComEndDate_activated(self, index): | |
369 | """ |
|
199 | """ | |
370 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
200 | SELECCION DEL RANGO DE FECHAS-END DATE | |
371 | """ |
|
201 | """ | |
372 |
startIndex=self. |
|
202 | startIndex=self.proComStartDate.currentIndex() | |
373 |
stopIndex = self. |
|
203 | stopIndex = self.proComEndDate.count() - index | |
374 |
self. |
|
204 | self.proComStartDate.clear() | |
375 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: |
|
205 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: | |
376 |
self. |
|
206 | self.proComStartDate.addItem(i) | |
377 |
self. |
|
207 | self.proComStartDate.setCurrentIndex(startIndex) | |
378 |
|
208 | |||
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 |
|
||||
391 | @pyqtSignature("") |
|
209 | @pyqtSignature("") | |
392 |
def on_ |
|
210 | def on_proOk_clicked(self): | |
393 | """ |
|
211 | """ | |
394 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
212 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
395 | Prepara la configuración del diágrama del Arbol del treeView numero 2 |
|
213 | Prepara la configuración del diágrama del Arbol del treeView numero 2 | |
396 |
""" |
|
214 | """ | |
397 | print "DATOS DEL PROJECT PATH,DATE,TIME" |
|
215 | self.console.clear() | |
398 |
|
216 | self.idp +=1 | ||
399 |
|
|
217 | self.projectObj= Project () | |
400 | # print i |
|
218 | self.__projObjDict[self.idp]=self.projectObj | |
401 | # print "get",self.__arbolDict.items() |
|
219 | ||
402 | # print "keys",self.__arbolDict.keys() |
|
220 | id = self.idp | |
403 |
|
221 | name = str(self.proName.text()) | ||
404 | self.idp += 1 |
|
222 | desc=str(self.proDescription.toPlainText()) | |
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 |
|
||||
414 | self.projectObj.setup(id = id, name=name, description=desc) |
|
223 | self.projectObj.setup(id = id, name=name, description=desc) | |
415 | print "self.projectObj.id",self.projectObj.id |
|
224 | datatype = str(self.proComDataType.currentText()) | |
416 |
|
225 | path = str(self.proDataPath.text()) | ||
417 | #-------AÑADIENDO PARAMETROS A LA UNIDAD DE LECTURA---------# |
|
226 | #path='C://data3' | |
418 |
|
||||
419 | datatype = str(self.dataTypeCmbBox.currentText()) |
|
|||
420 | path = str(self.dataPathTxt.text()) |
|
|||
421 | online = int(self.online) |
|
227 | online = int(self.online) | |
422 | starDate = str(self.starDateCmbBox.currentText()) |
|
228 | walk = int(self.walk) | |
423 |
|
|
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 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype, |
|
234 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype, | |
436 | path = path, |
|
235 | path = path, | |
437 |
startDate = |
|
236 | startDate = starDate, | |
438 | endDate = endDate, |
|
237 | endDate = endDate, | |
439 |
startTime |
|
238 | startTime= str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
440 |
endTime |
|
239 | endTime= str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
441 |
online |
|
240 | online= online, | |
442 | print self.readUnitConfObj.datatype,"self.readUnitConfObj.datatype" |
|
241 | walk= walk) | |
443 |
|
242 | self.readUnitConfObjList.append(self.readUnitConfObj) | ||
444 | self.readUnitConfObjList.append(self.readUnitConfObj) |
|
243 | ||
445 |
|
244 | #Project Explorer | ||
446 | #--------VISUALIZACION EN LA VENTANA PROJECT PROPERTIES-----------------# |
|
245 | self.parentItem=self.model.invisibleRootItem() | |
447 | #self.model_2=treeModel() |
|
246 | self.__arbolDict[self.idp] =QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) | |
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] |
|
|||
471 | self.parentItem.appendRow(self.__arbolDict[self.idp]) |
|
247 | self.parentItem.appendRow(self.__arbolDict[self.idp]) | |
472 | self.parentItem=self.__arbolDict[self.idp] |
|
248 | self.parentItem=self.__arbolDict[self.idp] | |
473 |
|
249 | |||
474 | #--------BLOQUEO-------# |
|
250 | #Project Properties | |
475 | self.tabProject.setEnabled(False) |
|
251 | self.model_2=treeModel() | |
476 |
|
252 | self.model_2.setParams(name = self.projectObj.name, | ||
477 |
|
253 | directorio = path, | ||
478 | #-----------------PUSHBUTTON_ADD_PROCESSING UNIT PROJECT------------------# |
|
254 | workspace = "C:\\WorkspaceGUI", | |
479 | @pyqtSignature("") |
|
255 | remode = str(self.proComReadMode.currentText()), | |
480 | def on_addUnitProces_clicked(self): |
|
256 | dataformat = datatype, | |
481 | """ |
|
257 | date = str(starDate)+"-"+str(endDate), | |
482 | CREAR PROCESSING UNIT ,añade unidad de procesamiento, LLAMA AL MÉTODO addUP QUE CONTIENE LAS OPERACION DE CREACION DE UNIDADES DE PROCESAMIENTO |
|
258 | initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
483 | Llama al metodo addUP. |
|
259 | endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
484 | """ |
|
260 | timezone = "Local" , | |
485 | self.addUP() |
|
261 | Summary = desc) | |
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 |
|
|||
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 | @pyqtSignature("int") |
|
274 | @pyqtSignature("int") | |
878 |
def on_ |
|
275 | def on_volOpCebChannels_stateChanged(self, p0): | |
879 | """ |
|
276 | """ | |
880 | Check Box habilita operaciones de Selecci�n de Canales |
|
277 | Check Box habilita operaciones de Selecci�n de Canales | |
881 | """ |
|
278 | """ | |
882 | if p0==2: |
|
279 | if p0==2: | |
883 |
self. |
|
280 | self.volOpComChannels.setEnabled(True) | |
884 |
self.v |
|
281 | self.volOpChannel.setEnabled(True) | |
885 | print " Ingresa seleccion de Canales" |
|
282 | ||
886 | if p0==0: |
|
283 | if p0==0: | |
887 |
self. |
|
284 | self.volOpComChannels.setEnabled(False) | |
888 |
self.v |
|
285 | self.volOpChannel.setEnabled(False) | |
889 | print " deshabilitado" |
|
286 | ||
890 |
|
287 | |||
891 | @pyqtSignature("int") |
|
288 | @pyqtSignature("int") | |
892 |
def on_ |
|
289 | def on_volOpCebHeights_stateChanged(self, p0): | |
893 | """ |
|
290 | """ | |
894 | Check Box habilita operaciones de Selecci�n de Alturas |
|
291 | Check Box habilita operaciones de Selecci�n de Alturas | |
895 | """ |
|
292 | """ | |
896 | if p0==2: |
|
293 | if p0==2: | |
897 |
self. |
|
294 | self.volOpHeights.setEnabled(True) | |
898 |
self.v |
|
295 | self.volOpComHeights.setEnabled(True) | |
899 | print " Select Type of Profile" |
|
296 | ||
900 | if p0==0: |
|
297 | if p0==0: | |
901 |
self. |
|
298 | self.volOpHeights.setEnabled(False) | |
902 |
self.v |
|
299 | self.volOpComHeights.setEnabled(False) | |
903 | print " deshabilitado" |
|
|||
904 |
|
||||
905 |
|
300 | |||
906 | @pyqtSignature("int") |
|
301 | @pyqtSignature("int") | |
907 |
def on_ |
|
302 | def on_volOpCebFilter_stateChanged(self, p0): | |
908 | """ |
|
303 | """ | |
909 | Name='Decoder', optype='other' |
|
304 | Name='Decoder', optype='other' | |
910 | """ |
|
305 | """ | |
911 | if p0==2: |
|
306 | if p0==2: | |
912 |
self. |
|
307 | self.volOpFilter.setEnabled(True) | |
913 | print " Select Type of Profile" |
|
308 | ||
914 | if p0==0: |
|
309 | if p0==0: | |
915 |
self. |
|
310 | self.volOpFilter.setEnabled(False) | |
916 | print " deshabilitado" |
|
311 | ||
917 |
|
||||
918 | @pyqtSignature("int") |
|
312 | @pyqtSignature("int") | |
919 |
def on_profile |
|
313 | def on_volOpCebProfile_stateChanged(self, p0): | |
920 | """ |
|
314 | """ | |
921 | Check Box habilita ingreso del rango de Perfiles |
|
315 | Check Box habilita ingreso del rango de Perfiles | |
922 | """ |
|
316 | """ | |
923 | if p0==2: |
|
317 | if p0==2: | |
924 |
self. |
|
318 | self.volOpComProfile.setEnabled(True) | |
925 |
self.profile |
|
319 | self.volOpProfile.setEnabled(True) | |
926 | print " Select Type of Profile" |
|
320 | ||
927 | if p0==0: |
|
321 | if p0==0: | |
928 |
self. |
|
322 | self.volOpComProfile.setEnabled(False) | |
929 |
self.profile |
|
323 | self.volOpProfile.setEnabled(False) | |
930 | print " deshabilitado" |
|
324 | ||
931 |
|
||||
932 |
|
||||
933 | @pyqtSignature("int") |
|
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 | if p0==2: |
|
330 | if p0==2: | |
939 |
self. |
|
331 | self.volOpComCode.setEnabled(True) | |
940 |
self. |
|
332 | self.volOpComMode.setEnabled(True) | |
941 | print "Choose number of Cohint" |
|
333 | ||
942 | if p0==0: |
|
334 | if p0==0: | |
943 | print " deshabilitado" |
|
335 | self.volOpComCode.setEnabled(False) | |
944 |
self. |
|
336 | self.volOpComMode.setEnabled(False) | |
945 | self.decodeMcob.setEnabled(False) |
|
|||
946 |
|
337 | |||
947 |
|
338 | |||
948 | @pyqtSignature("int") |
|
339 | @pyqtSignature("int") | |
949 |
def on_ |
|
340 | def on_volOpCebCohInt_stateChanged(self, p0): | |
950 | """ |
|
341 | """ | |
951 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
342 | Check Box habilita ingresode del numero de Integraciones a realizar | |
952 | """ |
|
343 | """ | |
953 | if p0==2: |
|
344 | if p0==2: | |
954 |
self. |
|
345 | self.volOpCohInt.setEnabled(True) | |
955 | print "Choose number of Cohint" |
|
|||
956 | if p0==0: |
|
346 | if p0==0: | |
957 | print " deshabilitado" |
|
347 | self.volOpCohInt.setEnabled(False) | |
958 | self.numberIntegration.setEnabled(False) |
|
348 | ||
959 |
|
349 | |||
960 | #-----------------------VOL_PUSHBUTTON_ACCEPT_OPERATION----------------------------# |
|
350 | ||
961 |
|
351 | |||
962 | @pyqtSignature("") |
|
352 | @pyqtSignature("") | |
963 |
def on_ |
|
353 | def on_volOpOk_clicked(self): | |
964 | """ |
|
354 | """ | |
965 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES A�ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
355 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES A�ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
966 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
356 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
967 | """ |
|
357 | """ | |
968 | for i in self.__arbolDict: |
|
358 | for i in self.__arbolDict: | |
969 | if self.__arbolDict[i]==self.indexclick: |
|
359 | if self.__arbolDict[i]==self.indexclick: | |
970 | print "INDEXCLICK=ARBOLDICT",i |
|
|||
971 | if self.__upObjDict.has_key(i)==True: |
|
360 | if self.__upObjDict.has_key(i)==True: | |
972 | self.upObj=self.__upObjDict[i] |
|
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. |
|
363 | if self.volOpCebChannels.isChecked(): | |
978 |
if self.v |
|
364 | if self.volOpComChannels.currentIndex()== 0: | |
979 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
365 | opObj10=self.upObj.addOperation(name="selectChannels") | |
980 | self.operObjList.append(opObj10) |
|
366 | self.operObjList.append(opObj10) | |
981 |
value=self. |
|
367 | value=self.volOpChannel.text() | |
982 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
368 | opObj10.addParameter(name='channelList', value=value, format='intlist') | |
983 | else: |
|
369 | else: | |
984 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
370 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") | |
985 | self.operObjList.append(opObj10) |
|
371 | self.operObjList.append(opObj10) | |
986 |
value=self. |
|
372 | value=self.volOpChannel.text() | |
987 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
373 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
988 | print "channel" |
|
|||
989 |
|
374 | |||
990 |
if self. |
|
375 | if self.volOpCebHeights.isChecked(): | |
991 |
if self.v |
|
376 | if self.volOpComHeights.currentIndex()== 0: | |
992 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
377 | opObj10=self.upObj.addOperation(name='selectHeights') | |
993 |
value=self. |
|
378 | value=self.volOpHeights.text() | |
994 | valueList=value.split(',') |
|
379 | valueList=value.split(',') | |
995 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
380 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') | |
996 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
381 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') | |
997 | else: |
|
382 | else: | |
998 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
383 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') | |
999 |
value=self. |
|
384 | value=self.volOpHeights.text() | |
1000 | valueList=value.split(',') |
|
385 | valueList=value.split(',') | |
1001 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
386 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') | |
1002 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
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 | opObj10=self.upObj.addOperation(name='filterByHeights') |
|
390 | opObj10=self.upObj.addOperation(name='filterByHeights') | |
1008 |
value=self. |
|
391 | value=self.volOpFilter.text() | |
1009 | opObj10.addParameter(name='window', value=value, format='int') |
|
392 | opObj10.addParameter(name='window', value=value, format='int') | |
1010 | print "filter" |
|
393 | ||
1011 |
|
394 | if self.volOpCebProfile.isChecked(): | ||
1012 | if self.profileSelecopVolCEB.isChecked(): |
|
395 | opObj10=self.upObj.addOperation(name='ProfileSelector', optype='other') | |
1013 | obj10=self.upObj.addOperation(name='ProfileSelector', optype='other') |
|
396 | if self.volOpComProfile.currentIndex()== 0: | |
1014 | if self.profileSelecOpVol.currentIndex()== 0: |
|
|||
1015 | self.operObjList.append(opObj10) |
|
397 | self.operObjList.append(opObj10) | |
1016 |
value=self. |
|
398 | value=self.volOpProfile.text() | |
1017 | obj10.addParameter(name='profileList', value=value, format='intlist') |
|
399 | opObj10.addParameter(name='profileList', value=value, format='intlist') | |
1018 | else: |
|
400 | else: | |
1019 | self.operObjList.append(opObj10) |
|
401 | self.operObjList.append(opObj10) | |
1020 |
value=self. |
|
402 | value=self.volOpProfile.text() | |
1021 | obj10.addParameter(name='profileRangeList', value=value, format='intlist') |
|
403 | opObj10.addParameter(name='profileRangeList', value=value, format='intlist') | |
1022 | print "profile" |
|
404 | ||
1023 |
|
405 | if self.volOpCebDecodification.isChecked(): | ||
1024 | if self.decodeCEB.isChecked(): |
|
406 | opObj10=self.upObj.addOperation(name='Decoder', optype='other') | |
1025 | opObj10=self.upObj.addOperation(name='Decoder') |
|
407 | if self.volOpComCode.currentIndex()==0: | |
1026 | if self.decodeCcob.currentIndex()==0: |
|
|||
1027 | opObj10.addParameter(name='code', value='1,1,-1,-1,-1,1', format='floatlist') |
|
408 | opObj10.addParameter(name='code', value='1,1,-1,-1,-1,1', format='floatlist') | |
1028 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
409 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1029 | opObj10.addParameter(name='nBaud', value='3', format='int') |
|
410 | opObj10.addParameter(name='nBaud', value='3', format='int') | |
1030 |
if self. |
|
411 | if self.volOpComCode.currentIndex()==1: | |
1031 | opObj10.addParameter(name='code', value='1,1,−1,1,-1,-1,1,-1', format='floatlist') |
|
412 | opObj10.addParameter(name='code', value='1,1,−1,1,-1,-1,1,-1', format='floatlist') | |
1032 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
413 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1033 | opObj10.addParameter(name='nBaud', value='4', format='int') |
|
414 | opObj10.addParameter(name='nBaud', value='4', format='int') | |
1034 |
if self. |
|
415 | if self.volOpComCode.currentIndex()==2: | |
1035 | opObj10.addParameter(name='code', value='1,1,1,−1,1,-1,-1,-1,1,-1', format='floatlist') |
|
416 | opObj10.addParameter(name='code', value='1,1,1,−1,1,-1,-1,-1,1,-1', format='floatlist') | |
1036 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
417 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1037 | opObj10.addParameter(name='nBaud', value='5', format='int') |
|
418 | opObj10.addParameter(name='nBaud', value='5', format='int') | |
1038 |
if self. |
|
419 | if self.volOpComCode.currentIndex()==3: | |
1039 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,1,−1,-1,-1,-1,1,1,-1,1', format='floatlist') |
|
420 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,1,−1,-1,-1,-1,1,1,-1,1', format='floatlist') | |
1040 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
421 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1041 | opObj10.addParameter(name='nBaud', value='7', format='int') |
|
422 | opObj10.addParameter(name='nBaud', value='7', format='int') | |
1042 |
if self. |
|
423 | if self.volOpComCode.currentIndex()==4: | |
1043 | 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') |
|
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 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
425 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1045 | opObj10.addParameter(name='nBaud', value='11', format='int') |
|
426 | opObj10.addParameter(name='nBaud', value='11', format='int') | |
1046 |
if self. |
|
427 | if self.volOpComCode.currentIndex()==5: | |
1047 | 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') |
|
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 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
429 | opObj10.addParameter(name='nCode', value='2', format='int') | |
1049 | opObj10.addParameter(name='nBaud', value='13', format='int') |
|
430 | opObj10.addParameter(name='nBaud', value='13', format='int') | |
1050 |
|
431 | |||
1051 |
if self. |
|
432 | if self.volOpComMode.currentIndex()==0: | |
1052 | opObj10.addParameter(name='mode', value='0', format='int') |
|
433 | opObj10.addParameter(name='mode', value='0', format='int') | |
1053 |
|
434 | |||
1054 |
if self. |
|
435 | if self.volOpComMode.currentIndex()==1: | |
1055 | opObj10.addParameter(name='mode', value='1', format='int') |
|
436 | opObj10.addParameter(name='mode', value='1', format='int') | |
1056 |
|
437 | |||
1057 |
if self. |
|
438 | if self.volOpComMode.currentIndex()==2: | |
1058 | opObj10.addParameter(name='mode', value='2', format='int') |
|
439 | opObj10.addParameter(name='mode', value='2', format='int') | |
1059 |
|
440 | |||
1060 |
if self. |
|
441 | if self.volOpCebCohInt.isChecked(): | |
1061 | opObj10=self.upObj.addOperation(name='CohInt', optype='other') |
|
442 | opObj10=self.upObj.addOperation(name='CohInt', optype='other') | |
1062 | print opObj10.id |
|
|||
1063 | self.operObjList.append(opObj10) |
|
443 | self.operObjList.append(opObj10) | |
1064 |
value=self. |
|
444 | value=self.volOpCohInt.text() | |
1065 | opObj10.addParameter(name='n', value=value, format='int') |
|
445 | opObj10.addParameter(name='n', value=value, format='int') | |
1066 | print "Coherent" |
|
446 | #self.tabopVoltage.setEnabled(False) | |
1067 |
|
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) |
|
451 | #----------------Voltage Graph-------------------# | |
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 |
|
||||
1086 | @pyqtSignature("int") |
|
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: |
|
475 | if not os.path.exists(self.dataPath): | |
1093 |
self. |
|
476 | self.volGraphOk.setEnabled(False) | |
1094 | self.channelLisstTxtVol.setEnabled(True) |
|
477 | return | |
1095 | self.xminTxtVol.setEnabled(True) |
|
|||
1096 | self.yminTxtVol.setEnabled(True) |
|
|||
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 | @pyqtSignature(" ") |
|
498 | @pyqtSignature(" ") | |
1099 |
def on_ |
|
499 | def on_volGraphOk_clicked(self): | |
1100 | """ |
|
500 | """ | |
1101 | GRAPH |
|
501 | GRAPH | |
1102 | """ |
|
502 | """ | |
1103 | for i in self.__arbolDict: |
|
503 | for i in self.__arbolDict: | |
1104 | if self.__arbolDict[i]==self.indexclick: |
|
504 | if self.__arbolDict[i]==self.indexclick: | |
1105 | print "INDEXCLICK=ARBOLDICT",i |
|
|||
1106 | if self.__upObjDict.has_key(i)==True: |
|
505 | if self.__upObjDict.has_key(i)==True: | |
1107 | self.upObj=self.__upObjDict[i] |
|
506 | self.upObj=self.__upObjDict[i] | |
1108 | print self.__upObjDict[i].name |
|
507 | ||
1109 |
|
508 | if self.volGraphComType.currentIndex()==1: | ||
1110 | if self.valueSelecChOpVol.currentIndex()==0: |
|
|||
1111 | opObj10=self.upObj.addOperation(name='Scope', optype='other') |
|
509 | opObj10=self.upObj.addOperation(name='Scope', optype='other') | |
1112 | self.operObjList.append(opObj10) |
|
510 | self.operObjList.append(opObj10) | |
1113 |
wintitle=self. |
|
511 | wintitle=self.volGraphWintitle.text() | |
1114 |
channelList=self. |
|
512 | channelList=self.volGraphChannelList.text() | |
1115 |
xvalue= self. |
|
513 | xvalue= self.volGraphxrange.text() | |
1116 |
yvalue= self. |
|
514 | yvalue= self.volGraphxrange.text() | |
1117 |
|
515 | |||
1118 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') |
|
516 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') | |
1119 | opObj10.addParameter(name='channelList', value=channelList, format='int') |
|
517 | opObj10.addParameter(name='channelList', value=channelList, format='int') | |
@@ -1124,305 +522,743 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||||
1124 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
522 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |
1125 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
523 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |
1126 |
|
524 | |||
1127 |
if self. |
|
525 | if self.volGraphCebSave.isChecked(): | |
1128 | opObj10.addParameter(name='save', value='1', format='int') |
|
526 | opObj10.addParameter(name='save', value='1', format='int') | |
1129 |
opObj10.addParameter(name='figpath', value= self. |
|
527 | opObj10.addParameter(name='figpath', value= self.volGraphPath.text()) | |
1130 |
opObj10.addParameter(name='figfile', value= self. |
|
528 | opObj10.addParameter(name='figfile', value= self.volGraphPrefix.text()) | |
1131 |
|
529 | self.tabgraphVoltage.setEnabled(False) | ||
1132 |
|
530 | self.console.clear() | ||
1133 |
|
531 | self.console.append("If you want to save your project") | ||
1134 | #-------------------------VENTANA DE CONFIGURACION SPECTRA------------------------# |
|
532 | self.console.append("click on your project name in the Tree Project Explorer") | |
1135 |
|
533 | |||
|
534 | #------Spectra operation--------# | |||
1136 | @pyqtSignature("int") |
|
535 | @pyqtSignature("int") | |
1137 |
def on_ |
|
536 | def on_specOpCebnFFTpoints_stateChanged(self, p0): | |
1138 | """ |
|
537 | """ | |
1139 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
538 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
1140 | """ |
|
539 | """ | |
1141 | if p0==2: |
|
540 | if p0==2: | |
1142 |
self. |
|
541 | self.specOpnFFTpoints.setEnabled(True) | |
1143 | print " nFFTPoint" |
|
542 | self.specOppairsList.setEnabled(True) | |
1144 | if p0==0: |
|
543 | if p0==0: | |
1145 | print " deshabilitado" |
|
544 | self.specOpnFFTpoints.setEnabled(False) | |
1146 |
self. |
|
545 | self.specOppairsList.setEnabled(False) | |
1147 |
|
|
546 | ||
1148 | @pyqtSignature("int") |
|
547 | @pyqtSignature("int") | |
1149 |
def on_ |
|
548 | def on_specOpCebChannel_stateChanged(self, p0): | |
1150 | """ |
|
549 | """ | |
1151 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
550 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
1152 | """ |
|
551 | """ | |
1153 | if p0==2: |
|
552 | if p0==2: | |
1154 |
self. |
|
553 | self.specOpChannel.setEnabled(True) | |
1155 |
self.s |
|
554 | self.specOpComChannel.setEnabled(True) | |
1156 | print "selectHeights" |
|
|||
1157 | if p0==0: |
|
555 | if p0==0: | |
1158 | print " deshabilitado" |
|
556 | self.specOpChannel.setEnabled(False) | |
1159 |
self. |
|
557 | self.specOpComChannel.setEnabled(False) | |
1160 | self.selecHeiopSpec.setEnabled(False) |
|
558 | ||
1161 |
|
||||
1162 | @pyqtSignature("int") |
|
559 | @pyqtSignature("int") | |
1163 |
def on_s |
|
560 | def on_specOpCebHeights_stateChanged(self, p0): | |
1164 | """ |
|
561 | """ | |
1165 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
562 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
1166 | """ |
|
563 | """ | |
1167 | if p0==2: |
|
564 | if p0==2: | |
1168 |
self. |
|
565 | self.specOpComHeights.setEnabled(True) | |
1169 |
self. |
|
566 | self.specOpHeights.setEnabled(True) | |
1170 | print "selectChannel" |
|
|||
1171 | if p0==0: |
|
567 | if p0==0: | |
1172 | print " deshabilitado" |
|
568 | self.specOpComHeights.setEnabled(False) | |
1173 |
self. |
|
569 | self.specOpHeights.setEnabled(False) | |
1174 | self.numberChannelopSpec.setEnabled(False) |
|
570 | ||
1175 |
|
571 | |||
1176 | @pyqtSignature("int") |
|
572 | @pyqtSignature("int") | |
1177 |
def on_ |
|
573 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1178 | """ |
|
574 | """ | |
1179 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
575 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
1180 | """ |
|
576 | """ | |
1181 | if p0==2: |
|
577 | if p0==2: | |
1182 |
self. |
|
578 | self.specOpIncoherent.setEnabled(True) | |
1183 |
|
||||
1184 | print "selectIncohInt" |
|
|||
1185 | if p0==0: |
|
579 | if p0==0: | |
1186 | print " deshabilitado" |
|
580 | self.specOpIncoherent.setEnabled(False) | |
1187 | self.valueIncohIntOpSpec.setEnabled(False) |
|
|||
1188 |
|
581 | |||
1189 | @pyqtSignature("int") |
|
582 | @pyqtSignature("int") | |
1190 |
def on_ |
|
583 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1191 | """ |
|
584 | """ | |
1192 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
585 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
1193 | """ |
|
586 | """ | |
1194 | if p0==2: |
|
587 | if p0==2: | |
1195 |
self. |
|
588 | self.specOpRemoveDC.setEnabled(True) | |
1196 |
|
||||
1197 | print "removedcOpSpecCEB" |
|
|||
1198 | if p0==0: |
|
589 | if p0==0: | |
1199 | print " deshabilitado" |
|
590 | self.specOpRemoveDC.setEnabled(False) | |
1200 | self.valueremoveDCOpSpec.setEnabled(False) |
|
591 | ||
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 |
|
||||
1216 | @pyqtSignature("") |
|
592 | @pyqtSignature("") | |
1217 |
def on_ |
|
593 | def on_specOpOk_clicked(self): | |
1218 | """ |
|
594 | """ | |
1219 | AÑADE OPERACION SPECTRA |
|
595 | AÑADE OPERACION SPECTRA | |
1220 | """ |
|
596 | """ | |
1221 | print "AÑADEOPERACIONSPECTRA" |
|
|||
1222 | for i in self.__arbolDict: |
|
597 | for i in self.__arbolDict: | |
1223 | if self.__arbolDict[i]==self.indexclick: |
|
598 | if self.__arbolDict[i]==self.indexclick: | |
1224 | print "INDEXCLICK=ARBOLDICT",i |
|
|||
1225 | if self.__upObjDict.has_key(i)==True: |
|
599 | if self.__upObjDict.has_key(i)==True: | |
1226 | self.upObj=self.__upObjDict[i] |
|
600 | self.upObj=self.__upObjDict[i] | |
1227 | print self.__upObjDict[i].name |
|
601 | # self.operObjList.append(opObj10) | |
1228 | # self.operObjList.append(opObj10) |
|
602 | if self.specOpCebnFFTpoints.isChecked(): | |
1229 |
|
603 | value1=self.specOpnFFTpoints.text() | ||
1230 | if self.nFFTPointOpSpecCEB.isChecked(): |
|
604 | value2=self.specOppairsList.text() | |
1231 | value=self.valuenFFTPointOpSpec.text() |
|
605 | self.upObj.addParameter(name='nFFTPoints',value=value1,format='int') | |
1232 |
self.upObj.addParameter(name=' |
|
606 | self.upObj.addParameter(name='pairsList', value=value2, format='pairslist') | |
1233 | print "nFFTpoints" |
|
|||
1234 |
|
||||
1235 |
|
607 | |||
1236 |
if self. |
|
608 | if self.specOpCebHeights.isChecked(): | |
1237 |
if self. |
|
609 | if self.specOpComHeights.currentIndex()== 0: | |
1238 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
610 | opObj10=self.upObj.addOperation(name='selectHeights') | |
1239 |
value=self.s |
|
611 | value=self.specOpHeights.text() | |
1240 | valueList=value.split(',') |
|
612 | valueList=value.split(',') | |
1241 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
613 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') | |
1242 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
614 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') | |
1243 | else: |
|
615 | else: | |
1244 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
616 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') | |
1245 |
value=self.s |
|
617 | value=self.specOpHeights.text() | |
1246 | valueList=value.split(',') |
|
618 | valueList=value.split(',') | |
1247 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
619 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') | |
1248 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
620 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') | |
1249 |
|
621 | |||
1250 |
if self.s |
|
622 | if self.specOpCebChannel.isChecked(): | |
1251 |
if self. |
|
623 | if self.specOpComChannel.currentIndex()== 0: | |
1252 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
624 | opObj10=self.upObj.addOperation(name="selectChannels") | |
1253 | self.operObjList.append(opObj10) |
|
625 | self.operObjList.append(opObj10) | |
1254 |
value=self. |
|
626 | value=self.specOpChannel.text() | |
1255 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
627 | opObj10.addParameter(name='channelList', value=value, format='intlist') | |
1256 | else: |
|
628 | else: | |
1257 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
629 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") | |
1258 | self.operObjList.append(opObj10) |
|
630 | self.operObjList.append(opObj10) | |
1259 |
value=self. |
|
631 | value=self.specOpChannel.text() | |
1260 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
632 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
1261 | print "channel" |
|
|||
1262 |
|
633 | |||
1263 |
if self. |
|
634 | if self.specOpCebIncoherent.isChecked(): | |
1264 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') |
|
635 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') | |
1265 | self.operObjList.append(opObj10) |
|
636 | self.operObjList.append(opObj10) | |
1266 |
value=self. |
|
637 | value=self.specOpIncoherent.text() | |
1267 | opObj10.addParameter(name='n', value=value, format='float') |
|
638 | opObj10.addParameter(name='n', value=value, format='float') | |
1268 |
|
639 | |||
1269 |
if self. |
|
640 | if self.specOpCebRemoveDC.isChecked(): | |
1270 | opObj10=self.upObj.addOperation(name='removeDC') |
|
641 | opObj10=self.upObj.addOperation(name='removeDC') | |
1271 |
value=self. |
|
642 | value=self.specOpRemoveDC.text() | |
1272 | opObj10.addParameter(name='mode', value=value,format='int') |
|
643 | opObj10.addParameter(name='mode', value=value,format='int') | |
1273 |
|
644 | |||
1274 |
|
645 | |||
1275 | #---------------------VENTANA DE CONFIGURACION GRAPH SPECTRA------------------# |
|
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 | @pyqtSignature("int") |
|
653 | @pyqtSignature("int") | |
1277 |
def on_ |
|
654 | def on_specGraphComType_activated(self,index): | |
1278 | self.setClearAllElementGraph() |
|
|||
1279 | self.setEnableAllElementGraph() |
|
|||
1280 | if index==0: |
|
655 | if index==0: | |
1281 | self.timeRangeGraphSpec.setEnabled(False) |
|
656 | print "return" | |
|
657 | ||||
1282 | if index==1: |
|
658 | if index==1: | |
1283 |
self. |
|
659 | self.setspecGraph() | |
|
660 | self.specGraphTimeRange.setEnabled(False) | |||
|
661 | ||||
1284 | if index==2: |
|
662 | if index==2: | |
1285 |
self. |
|
663 | self.setspecGraph() | |
|
664 | self.specGraphTimeRange.setEnabled(False) | |||
|
665 | ||||
1286 | if index==3: |
|
666 | if index==3: | |
1287 |
self. |
|
667 | self.setspecGraph() | |
1288 |
|
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 | @pyqtSignature("int") |
|
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 | if p0==2: |
|
685 | if p0==2: | |
1296 |
self. |
|
686 | self.specGraphPath.setEnabled(True) | |
1297 |
self. |
|
687 | self.specGraphPrefix.setEnabled(True) | |
1298 | print " nFFTPoint" |
|
688 | self.specGraphToolPath.setEnabled(True) | |
1299 | if p0==0: |
|
689 | if p0==0: | |
1300 | print " deshabilitado" |
|
690 | self.specGraphPath.setEnabled(False) | |
1301 |
self. |
|
691 | self.specGraphPrefix.setEnabled(False) | |
1302 |
s |
|
692 | slef.specGraphToolPath.setEnabled(False) | |
1303 |
|
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 | @pyqtSignature("") |
|
704 | @pyqtSignature("") | |
1306 |
def on_ |
|
705 | def on_specGraphOk_clicked(self): | |
1307 |
|
706 | |||
1308 | print "AÑADEOPERACIONSPECTRA" |
|
|||
1309 |
|
||||
1310 | for i in self.__arbolDict: |
|
707 | for i in self.__arbolDict: | |
1311 | if self.__arbolDict[i]==self.indexclick: |
|
708 | if self.__arbolDict[i]==self.indexclick: | |
1312 | print "INDEXCLICK=ARBOLDICT",i |
|
|||
1313 | if self.__upObjDict.has_key(i)==True: |
|
709 | if self.__upObjDict.has_key(i)==True: | |
1314 | self.upObj=self.__upObjDict[i] |
|
710 | self.upObj=self.__upObjDict[i] | |
1315 | print self.__upObjDict[i].name |
|
711 | ||
1316 |
|
712 | if self.specGraphComType.currentIndex()==1: | ||
1317 | if self.dataTypeSelectorCmb.currentIndex()==0: |
|
|||
1318 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') |
|
713 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') | |
1319 | opObj10.addParameter(name='idfigure', value='1', format='int') |
|
714 | self.properSpecGraph(opObj10) | |
1320 | self.properSpecGraph(opObj10) |
|
|||
1321 |
|
715 | |||
1322 |
if self. |
|
716 | if self.specGraphComType.currentIndex()==2: | |
1323 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') |
|
717 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') | |
1324 | self.properSpecGraph(opObj10) |
|
718 | self.properSpecGraph(opObj10) | |
1325 | opObj10.addParameter(name='power_cmap', value='jet', format='str') |
|
719 | opObj10.addParameter(name='power_cmap', value='jet', format='str') | |
1326 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
720 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') | |
1327 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
721 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1328 |
|
722 | |||
1329 |
if self. |
|
723 | if self.specGraphComType.currentIndex()==3: | |
1330 | opObj10=self.upObj.addOperation(name='RTIPlot',optype='other') |
|
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 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') |
|
730 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') | |
1335 | self.properSpecGraph(opObj10) |
|
731 | self.properSpecGraph(opObj10) | |
1336 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
732 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') | |
1337 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
733 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1338 |
|
734 | |||
1339 |
if self. |
|
735 | if self.specGraphComType.currentIndex()==5: | |
1340 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') |
|
736 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') | |
1341 | self.properSpecGraph(opObj10) |
|
737 | self.properSpecGraph(opObj10) | |
1342 | self.setDisableAllElementSpecGraph() |
|
738 | self.specGgraphzrange.setEnabled(False) | |
1343 |
|
|
739 | ||
1344 |
|
740 | if self.specGraphComType.currentIndex()==6: | ||
1345 | @pyqtSignature("") |
|
741 | opObj10=self.upObj.addOperation(name='ProfilePlot',optype='other') | |
1346 | def on_dataGraphSpecCancelBtn_clicked(self): |
|
742 | self.properSpecGraph(opObj10) | |
1347 | print "alexvaldez" |
|
743 | self.specGgraphzrange.setEnabled(False) | |
1348 |
|
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 | def properSpecGraph(self,opObj10): |
|
756 | def properSpecGraph(self,opObj10): | |
1350 | print opObj10.id |
|
757 | ||
1351 | self.operObjList.append(opObj10) |
|
758 | self.operObjList.append(opObj10) | |
1352 |
wintitle=self. |
|
759 | wintitle=self.specGraphWinTitle.text() | |
1353 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') |
|
760 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') | |
1354 |
idfigure=self. |
|
761 | idfigure=self.specGraphIdFigure.text() | |
1355 | opObj10.addParameter(name='idfigure', value=idfigure, format='int') |
|
|||
1356 |
|
||||
1357 |
|
762 | |||
1358 | channelList=self.channelListgraphSpec.text() |
|
763 | opObj10.addParameter(name='idfigure', value=idfigure, format='int') | |
1359 | if self.channelListgraphSpec.isModified(): |
|
764 | ||
|
765 | channelList=self.specGraphChannelList.text() | |||
|
766 | if self.specGraphChannelList.isModified(): | |||
1360 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
767 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |
1361 |
|
768 | |||
1362 |
xvalue= self. |
|
769 | xvalue= self.specGgraphxrange.text() | |
1363 |
if self. |
|
770 | if self.specGgraphxrange.isModified(): | |
1364 | xvalueList=xvalue.split(',') |
|
771 | xvalueList=xvalue.split(',') | |
1365 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
772 | try: | |
1366 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
773 | value=int(xvalueList[0]) | |
1367 | else: |
|
774 | value=int(xvalueList[1]) | |
1368 | print "cambio" |
|
775 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |
1369 | yvalue= self.yminGraphSpec.text() |
|
776 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |
1370 | if self.yminGraphSpec.isModified(): |
|
777 | except: | |
|
778 | return 0 | |||
|
779 | ||||
|
780 | yvalue= self.specGgraphyrange.text() | |||
|
781 | if self.specGgraphyrange.isModified(): | |||
1371 | yvalueList=yvalue.split(",") |
|
782 | yvalueList=yvalue.split(",") | |
1372 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
783 | try: | |
1373 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
784 | value=int(yvalueList[0]) | |
1374 | else: |
|
785 | value=int(yvalueList[1]) | |
1375 | print "cambio" |
|
786 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |
1376 | zvalue= self.zminGraphSpec.text() |
|
787 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |
1377 | if self.zminGraphSpec.isModified(): |
|
788 | except: | |
1378 | zvalueList=zvalue.split(",") |
|
789 | return 0 | |
1379 | if opObj10.name=="RTIfromNoise": |
|
790 | ||
1380 | print "No_z" |
|
791 | zvalue= self.specGgraphzrange.text() | |
1381 | else: |
|
792 | if self.specGgraphzrange.isModified(): | |
1382 | if self.zminGraphSpec.isModified(): |
|
793 | zvalueList=zvalue.split(",") | |
1383 | zvalueList=zvalue.split(",") |
|
794 | try: | |
1384 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
795 | value=int(zvalueList[0]) | |
1385 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
796 | value=int(zvalueList[1]) | |
1386 |
opObj10.addParameter(name=' |
|
797 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |
1387 |
|
798 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | ||
1388 |
|
|
799 | except: | |
1389 |
|
|
800 | return 0 | |
|
801 | ||||
1390 |
|
802 | |||
1391 |
if self.s |
|
803 | if self.specGraphCebSave.isChecked(): | |
1392 |
opObj10.addParameter(name='save', value='1', format=' |
|
804 | opObj10.addParameter(name='save', value='1', format='bool') | |
1393 |
opObj10.addParameter(name='figpath', value= self. |
|
805 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |
1394 |
opObj10.addParameter(name='figfile', value= self. |
|
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): |
|
1026 | ||
1398 | self.winTitleGraphSpec.clear() |
|
1027 | def searchData(self,path,ext,walk,expLabel=''): | |
1399 | self.channelListgraphSpec.clear() |
|
1028 | dateList=[] | |
1400 | self.xminGraphSpec.clear() |
|
1029 | fileList=[] | |
1401 | self.yminGraphSpec.clear() |
|
1030 | if walk== 0: | |
1402 | self.zminGraphSpec.clear() |
|
1031 | files= os.listdir(path) | |
1403 | self.timeRangeGraphSpec.clear() |
|
1032 | for thisFile in files: | |
1404 | self.dataPathTxtSpec.clear() |
|
1033 | if not os.path.isfile(thisFile): | |
1405 | self.dataPrefixGraphSpec.clear() |
|
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): |
|
1066 | for thisDir in dirList: | |
1408 | self.winTitleGraphSpec.setEnabled(False) |
|
1067 | ||
1409 | self.channelListgraphSpec.setEnabled(False) |
|
1068 | if not isRadarPath(thisDir): | |
1410 | self.xminGraphSpec.setEnabled(False) |
|
1069 | self.console.clear() | |
1411 | self.yminGraphSpec.setEnabled(False) |
|
1070 | self.console.append("Please, Choose the Correct Path") | |
1412 |
self. |
|
1071 | self.proOk.setEnabled(False) | |
1413 | self.timeRangeGraphSpec.setEnabled(False) |
|
1072 | continue | |
1414 | self.dataPathTxtSpec.setEnabled(False) |
|
1073 | ||
1415 | self.dataPrefixGraphSpec.setEnabled(False) |
|
1074 | doypath = os.path.join(path, thisDir, expLabel) | |
1416 |
|
|
1075 | ||
1417 | def setEnableAllElementGraph(self): |
|
1076 | files = os.listdir(doypath) | |
1418 | self.winTitleGraphSpec.setEnabled(True) |
|
1077 | fileList = [] | |
1419 | self.channelListgraphSpec.setEnabled(True) |
|
1078 | ||
1420 | self.xminGraphSpec.setEnabled(True) |
|
1079 | for thisFile in files: | |
1421 | self.yminGraphSpec.setEnabled(True) |
|
1080 | ||
1422 | self.zminGraphSpec.setEnabled(True) |
|
1081 | if os.path.splitext(thisFile)[-1] != ext: | |
1423 | self.timeRangeGraphSpec.setEnabled(True) |
|
1082 | continue | |
1424 | # |
|
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 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
|
1264 | class UnitProcess(QMainWindow, Ui_UnitProcess): | |
@@ -1468,16 +1304,13 class UnitProcess(QMainWindow, Ui_UnitProcess): | |||||
1468 | for i in self.getfromWindowList: |
|
1304 | for i in self.getfromWindowList: | |
1469 |
|
1305 | |||
1470 | name=i.getElementName() |
|
1306 | name=i.getElementName() | |
1471 | print "name",name |
|
|||
1472 | if name=='Project': |
|
1307 | if name=='Project': | |
1473 | id= i.id |
|
1308 | id= i.id | |
1474 | name=i.name |
|
1309 | name=i.name | |
1475 | print "tipodeproyecto",self.dataTypeProject |
|
|||
1476 | if self.dataTypeProject=='Voltage': |
|
1310 | if self.dataTypeProject=='Voltage': | |
1477 | self.comboTypeBox.clear() |
|
1311 | self.comboTypeBox.clear() | |
1478 | self.comboTypeBox.addItem("Voltage") |
|
1312 | self.comboTypeBox.addItem("Voltage") | |
1479 | self.comboTypeBox.addItem("Spectra") |
|
1313 | ||
1480 | self.comboTypeBox.addItem("Correlation") |
|
|||
1481 | if self.dataTypeProject=='Spectra': |
|
1314 | if self.dataTypeProject=='Spectra': | |
1482 | self.comboTypeBox.clear() |
|
1315 | self.comboTypeBox.clear() | |
1483 | self.comboTypeBox.addItem("Spectra") |
|
1316 | self.comboTypeBox.addItem("Spectra") | |
@@ -1501,6 +1334,4 class UnitProcess(QMainWindow, Ui_UnitProcess): | |||||
1501 |
|
1334 | |||
1502 | def closeEvent(self, event): |
|
1335 | def closeEvent(self, event): | |
1503 | self.closed.emit() |
|
1336 | self.closed.emit() | |
1504 |
event.accept() |
|
1337 | event.accept() No newline at end of file | |
1505 |
|
||||
1506 | No newline at end of file |
|
General Comments 0
You need to be logged in to leave comments.
Login now