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