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