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