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