@@ -1,732 +1,759 | |||||
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 | HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " ) |
|
22 | HORIZONTAL_HEADERS = ("ITEM :"," DATOS : " ) | |
23 |
|
23 | |||
24 | HORIZONTAL = ("RAMA :",) |
|
24 | HORIZONTAL = ("RAMA :",) | |
25 |
|
25 | |||
26 | class MainWindow(QMainWindow, Ui_MainWindow): |
|
26 | class MainWindow(QMainWindow, Ui_MainWindow): | |
27 | nop=None |
|
27 | nop=None | |
28 | """ |
|
28 | """ | |
29 | Class documentation goes here. |
|
29 | Class documentation goes here. | |
30 | #*##################VENTANA CUERPO DEL PROGRAMA#################### |
|
30 | #*##################VENTANA CUERPO DEL PROGRAMA#################### | |
31 | """ |
|
31 | """ | |
32 | def __init__(self, parent = None): |
|
32 | def __init__(self, parent = None): | |
33 | """ |
|
33 | """ | |
34 | Constructor |
|
34 | Constructor | |
35 | """ |
|
35 | """ | |
36 | print "Inicio de Programa Interfaz GrΓ‘fica" |
|
36 | print "Inicio de Programa Interfaz GrΓ‘fica" | |
37 | QMainWindow.__init__(self, parent) |
|
37 | QMainWindow.__init__(self, parent) | |
38 | self.setupUi(self) |
|
38 | self.setupUi(self) | |
39 |
|
39 | |||
40 | self.online=0 |
|
40 | self.online=0 | |
41 | self.datatype=0 |
|
41 | self.datatype=0 | |
42 | self.variableList=[] |
|
42 | self.variableList=[] | |
43 |
|
43 | |||
44 | self.proObjList=[] |
|
44 | self.proObjList=[] | |
45 | self.idp=0 |
|
45 | self.idp=0 | |
46 | self.namep=0 |
|
46 | self.namep=0 | |
47 | self.description=0 |
|
47 | self.description=0 | |
48 | self.namepTree=0 |
|
48 | self.namepTree=0 | |
49 | self.valuep=0 |
|
49 | self.valuep=0 | |
50 |
|
50 | |||
51 | self.upObjList= [] |
|
51 | self.upObjList= [] | |
52 | self.upn=0 |
|
52 | self.upn=0 | |
53 | self.upName=0 |
|
53 | self.upName=0 | |
54 | self.upType=0 |
|
54 | self.upType=0 | |
55 | self.uporProObjRecover=0 |
|
55 | self.uporProObjRecover=0 | |
56 |
|
56 | |||
57 |
|
57 | |||
58 | self.readUnitConfObjList=[] |
|
58 | self.readUnitConfObjList=[] | |
59 |
|
59 | |||
60 | self.upObjVolList=[] |
|
60 | self.upObjVolList=[] | |
61 | self.upobjSpecList=[] |
|
61 | self.upobjSpecList=[] | |
62 |
|
62 | |||
63 |
|
63 | |||
64 | self.operObjList=[] |
|
64 | self.operObjList=[] | |
65 |
|
65 | |||
66 | self.configProject=None |
|
66 | self.configProject=None | |
67 | self.configUP=None |
|
67 | self.configUP=None | |
68 |
|
68 | |||
69 | self.controllerObj=None |
|
69 | self.controllerObj=None | |
70 | self.readUnitConfObj=None |
|
70 | self.readUnitConfObj=None | |
71 | self.procUnitConfObj0=None |
|
71 | self.procUnitConfObj0=None | |
72 | self.opObj10=None |
|
72 | self.opObj10=None | |
73 | self.opObj12=None |
|
73 | self.opObj12=None | |
74 |
|
74 | |||
75 |
|
75 | |||
76 | self.setParam() |
|
76 | self.setParam() | |
77 |
|
77 | |||
78 | #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# |
|
78 | #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# | |
79 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
79 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
80 | self.addpBtn.setToolTip('Add_New_Project') |
|
80 | self.addpBtn.setToolTip('Add_New_Project') | |
81 | self.addUnitProces.setToolTip('Add_New_Processing_Unit') |
|
81 | self.addUnitProces.setToolTip('Add_New_Processing_Unit') | |
82 |
|
82 | |||
83 | #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# |
|
83 | #++++++++++++++++++NEW PROPERTIES+++++++++++++++++# | |
84 | self.model = QtGui.QStandardItemModel() |
|
84 | self.model = QtGui.QStandardItemModel() | |
85 | self.treeView.setModel(self.model) |
|
85 | self.treeView.setModel(self.model) | |
86 | self.treeView.clicked.connect(self.clickFunctiontree) |
|
86 | self.treeView.clicked.connect(self.clickFunctiontree) | |
87 | self.treeView.expandAll() |
|
87 | self.treeView.expandAll() | |
88 | #self.treeView.clicked.connect(self.treefunction1) |
|
88 | #self.treeView.clicked.connect(self.treefunction1) | |
89 |
|
89 | |||
90 | def getNumberofProject(self): |
|
90 | def getNumberofProject(self): | |
91 | # for i in self.proObjList: |
|
91 | # for i in self.proObjList: | |
92 | # print i |
|
92 | # print i | |
93 | return self.proObjList |
|
93 | return self.proObjList | |
94 | # for i in self.proObjList: |
|
94 | # for i in self.proObjList: | |
95 | # print i |
|
95 | # print i | |
96 |
|
96 | |||
97 | def setParam(self): |
|
97 | def setParam(self): | |
98 | self.dataPathTxt.setText('C:\data') |
|
98 | self.dataPathTxt.setText('C:\data') | |
99 | self.numberChannelopVol.setEnabled(False) |
|
99 | self.numberChannelopVol.setEnabled(False) | |
100 | self.lineHeighProfileTxtopVol.setEnabled(False) |
|
100 | self.lineHeighProfileTxtopVol.setEnabled(False) | |
101 | self.numberIntegration.setEnabled(False) |
|
101 | self.numberIntegration.setEnabled(False) | |
102 | self.valuenFFTPointOpSpec.setEnabled(False) |
|
102 | self.valuenFFTPointOpSpec.setEnabled(False) | |
|
103 | self.lineProfileSelecopVolCEB.setEnabled(False) | |||
103 |
|
104 | |||
104 |
|
105 | |||
105 | def clickFunctiontree(self,index): |
|
106 | def clickFunctiontree(self,index): | |
106 | indexclick= index.model().itemFromIndex(index).text() |
|
107 | indexclick= index.model().itemFromIndex(index).text() | |
107 | #print indexclick |
|
108 | #print indexclick | |
108 | NumofPro=indexclick[8:10] |
|
109 | NumofPro=indexclick[8:10] | |
109 | self.valuep=NumofPro |
|
110 | self.valuep=NumofPro | |
110 | #print self.valuep |
|
111 | #print self.valuep | |
111 | NameofPro=indexclick[0:7] |
|
112 | NameofPro=indexclick[0:7] | |
112 | self.namepTree=NameofPro |
|
113 | self.namepTree=NameofPro | |
113 | #print self.namepTree |
|
114 | #print self.namepTree | |
114 |
|
115 | |||
115 |
|
116 | |||
116 | @pyqtSignature("") |
|
117 | @pyqtSignature("") | |
117 | def on_addpBtn_clicked(self): |
|
118 | def on_addpBtn_clicked(self): | |
118 | """ |
|
119 | """ | |
119 | ANADIR UN NUEVO PROYECTO |
|
120 | ANADIR UN NUEVO PROYECTO | |
120 | """ |
|
121 | """ | |
121 | print "En este nivel se abre el window" |
|
122 | print "En este nivel se abre el window" | |
122 |
|
123 | |||
123 |
|
124 | |||
124 | self.showWindow() |
|
125 | self.showWindow() | |
125 |
|
126 | |||
126 | def showWindow(self): |
|
127 | def showWindow(self): | |
127 | self.configProject=Window(self) |
|
128 | self.configProject=Window(self) | |
128 | #self.configProject.closed.connect(self.show) |
|
129 | #self.configProject.closed.connect(self.show) | |
129 | self.configProject.show() |
|
130 | self.configProject.show() | |
130 | #self.configProject.closed.connect(self.show) |
|
131 | #self.configProject.closed.connect(self.show) | |
131 | self.configProject.saveButton.clicked.connect(self.reciveParameters) |
|
132 | self.configProject.saveButton.clicked.connect(self.reciveParameters) | |
132 | self.configProject.closed.connect(self.createProject) |
|
133 | self.configProject.closed.connect(self.createProject) | |
133 |
|
134 | |||
134 | def reciveParameters(self): |
|
135 | def reciveParameters(self): | |
135 | self.namep,self.description =self.configProject.almacena() |
|
136 | self.namep,self.description =self.configProject.almacena() | |
136 |
|
137 | |||
137 | def createProject(self): |
|
138 | def createProject(self): | |
138 |
|
139 | |||
139 | print "En este nivel se debe crear el proyecto,id,nombre,desc" |
|
140 | print "En este nivel se debe crear el proyecto,id,nombre,desc" | |
140 | #+++++Creacion del Objeto Controller-XML++++++++++# |
|
141 | #+++++Creacion del Objeto Controller-XML++++++++++# | |
141 | self.idp += 1 |
|
142 | self.idp += 1 | |
142 | self.controllerObj = Project() |
|
143 | self.controllerObj = Project() | |
143 | id=int(self.idp) |
|
144 | id=int(self.idp) | |
144 | name=str(self.namep) |
|
145 | name=str(self.namep) | |
145 | desc=str(self.description) |
|
146 | desc=str(self.description) | |
146 | self.parentItem=self.model.invisibleRootItem() |
|
147 | self.parentItem=self.model.invisibleRootItem() | |
147 | self.controllerObj.arbol=QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp)) |
|
148 | self.controllerObj.arbol=QtGui.QStandardItem(QtCore.QString("Project %0").arg(self.idp)) | |
148 | self.controllerObj.setup(id = id, name=name, description=desc) |
|
149 | self.controllerObj.setup(id = id, name=name, description=desc) | |
149 | self.parentItem.appendRow(self.controllerObj.arbol) |
|
150 | self.parentItem.appendRow(self.controllerObj.arbol) | |
150 | self.proObjList.append(self.controllerObj)#+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++# |
|
151 | self.proObjList.append(self.controllerObj)#+++++++++++++++++++LISTA DE PROYECTO++++++++++++++++++++++++++++# | |
151 | self.parentItem=self.controllerObj.arbol |
|
152 | self.parentItem=self.controllerObj.arbol | |
152 | self.loadProjects() |
|
153 | self.loadProjects() | |
153 |
|
154 | |||
154 | print "Porfavor ingrese los parΓ‘metros de configuracion del Proyecto" |
|
155 | print "Porfavor ingrese los parΓ‘metros de configuracion del Proyecto" | |
155 |
|
156 | |||
156 | def loadProjects(self): |
|
157 | def loadProjects(self): | |
157 | self.proConfCmbBox.clear() |
|
158 | self.proConfCmbBox.clear() | |
158 | for i in self.proObjList: |
|
159 | for i in self.proObjList: | |
159 | self.proConfCmbBox.addItem("Project"+str(i.id)) |
|
160 | self.proConfCmbBox.addItem("Project"+str(i.id)) | |
160 |
|
161 | |||
161 | @pyqtSignature("int") |
|
162 | @pyqtSignature("int") | |
162 | def on_dataTypeCmbBox_activated(self,index): |
|
163 | def on_dataTypeCmbBox_activated(self,index): | |
163 | self.dataFormatTxt.setReadOnly(True) |
|
164 | self.dataFormatTxt.setReadOnly(True) | |
164 | if index==0: |
|
165 | if index==0: | |
165 | self.datatype='Voltage' |
|
166 | self.datatype='Voltage' | |
166 | elif index==1: |
|
167 | elif index==1: | |
167 | self.datatype='Spectra' |
|
168 | self.datatype='Spectra' | |
168 | else : |
|
169 | else : | |
169 | self.datatype='' |
|
170 | self.datatype='' | |
170 | self.dataFormatTxt.setReadOnly(False) |
|
171 | self.dataFormatTxt.setReadOnly(False) | |
171 | self.dataFormatTxt.setText(self.datatype) |
|
172 | self.dataFormatTxt.setText(self.datatype) | |
172 |
|
173 | |||
173 | def existDir(self, var_dir): |
|
174 | def existDir(self, var_dir): | |
174 | """ |
|
175 | """ | |
175 | METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR |
|
176 | METODO PARA VERIFICAR SI LA RUTA EXISTE-VAR_DIR | |
176 | VARIABLE DIRECCION |
|
177 | VARIABLE DIRECCION | |
177 | """ |
|
178 | """ | |
178 | if os.path.isdir(var_dir): |
|
179 | if os.path.isdir(var_dir): | |
179 | return True |
|
180 | return True | |
180 | else: |
|
181 | else: | |
181 | self.textEdit.append("Incorrect path:" + str(var_dir)) |
|
182 | self.textEdit.append("Incorrect path:" + str(var_dir)) | |
182 | return False |
|
183 | return False | |
183 |
|
184 | |||
184 | def loadDays(self): |
|
185 | def loadDays(self): | |
185 | """ |
|
186 | """ | |
186 | METODO PARA CARGAR LOS DIAS |
|
187 | METODO PARA CARGAR LOS DIAS | |
187 | """ |
|
188 | """ | |
188 | self.variableList=[] |
|
189 | self.variableList=[] | |
189 | self.starDateCmbBox.clear() |
|
190 | self.starDateCmbBox.clear() | |
190 | self.endDateCmbBox.clear() |
|
191 | self.endDateCmbBox.clear() | |
191 |
|
192 | |||
192 | Dirlist = os.listdir(self.dataPath) |
|
193 | Dirlist = os.listdir(self.dataPath) | |
193 | Dirlist.sort() |
|
194 | Dirlist.sort() | |
194 |
|
195 | |||
195 | for a in range(0, len(Dirlist)): |
|
196 | for a in range(0, len(Dirlist)): | |
196 | fname= Dirlist[a] |
|
197 | fname= Dirlist[a] | |
197 | Doy=fname[5:8] |
|
198 | Doy=fname[5:8] | |
198 | fname = fname[1:5] |
|
199 | fname = fname[1:5] | |
199 | print fname |
|
200 | print fname | |
200 | fecha=Doy2Date(int(fname),int(Doy)) |
|
201 | fecha=Doy2Date(int(fname),int(Doy)) | |
201 | fechaList=fecha.change2date() |
|
202 | fechaList=fecha.change2date() | |
202 | #print fechaList[0] |
|
203 | #print fechaList[0] | |
203 | Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1]) |
|
204 | Dirlist[a]=fname+"/"+str(fechaList[0])+"/"+str(fechaList[1]) | |
204 | #+"-"+ fechaList[0]+"-"+fechaList[1] |
|
205 | #+"-"+ fechaList[0]+"-"+fechaList[1] | |
205 |
|
206 | |||
206 | #---------------AQUI TIENE QUE SER MODIFICADO--------# |
|
207 | #---------------AQUI TIENE QUE SER MODIFICADO--------# | |
207 |
|
208 | |||
208 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) |
|
209 | #Se cargan las listas para seleccionar StartDay y StopDay (QComboBox) | |
209 | for i in range(0, (len(Dirlist))): |
|
210 | for i in range(0, (len(Dirlist))): | |
210 | self.variableList.append(Dirlist[i]) |
|
211 | self.variableList.append(Dirlist[i]) | |
211 |
|
212 | |||
212 | for i in self.variableList: |
|
213 | for i in self.variableList: | |
213 | self.starDateCmbBox.addItem(i) |
|
214 | self.starDateCmbBox.addItem(i) | |
214 | self.endDateCmbBox.addItem(i) |
|
215 | self.endDateCmbBox.addItem(i) | |
215 | self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) |
|
216 | self.endDateCmbBox.setCurrentIndex(self.starDateCmbBox.count()-1) | |
216 |
|
217 | |||
217 | self.getsubList() |
|
218 | self.getsubList() | |
218 | self.dataOkBtn.setEnabled(True) |
|
219 | self.dataOkBtn.setEnabled(True) | |
219 |
|
220 | |||
220 | def getsubList(self): |
|
221 | def getsubList(self): | |
221 | """ |
|
222 | """ | |
222 | OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS |
|
223 | OBTIENE EL RANDO DE LAS FECHAS SELECCIONADAS | |
223 | """ |
|
224 | """ | |
224 | self.subList=[] |
|
225 | self.subList=[] | |
225 | for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]: |
|
226 | for i in self.variableList[self.starDateCmbBox.currentIndex():self.starDateCmbBox.currentIndex() + self.endDateCmbBox.currentIndex()+1]: | |
226 | self.subList.append(i) |
|
227 | self.subList.append(i) | |
227 |
|
228 | |||
228 | @pyqtSignature("") |
|
229 | @pyqtSignature("") | |
229 | def on_dataPathBrowse_clicked(self): |
|
230 | def on_dataPathBrowse_clicked(self): | |
230 | """ |
|
231 | """ | |
231 | OBTENCION DE LA RUTA DE DATOS |
|
232 | OBTENCION DE LA RUTA DE DATOS | |
232 | """ |
|
233 | """ | |
233 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
234 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
234 | self.dataPathTxt.setText(self.dataPath) |
|
235 | self.dataPathTxt.setText(self.dataPath) | |
235 | self.statusDpath=self.existDir(self.dataPath) |
|
236 | self.statusDpath=self.existDir(self.dataPath) | |
236 | self.loadDays() |
|
237 | self.loadDays() | |
237 |
|
238 | |||
238 | @pyqtSignature("int") |
|
239 | @pyqtSignature("int") | |
239 | def on_starDateCmbBox_activated(self, index): |
|
240 | def on_starDateCmbBox_activated(self, index): | |
240 | """ |
|
241 | """ | |
241 | SELECCION DEL RANGO DE FECHAS -STAR DATE |
|
242 | SELECCION DEL RANGO DE FECHAS -STAR DATE | |
242 | """ |
|
243 | """ | |
243 | var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex() |
|
244 | var_StopDay_index=self.endDateCmbBox.count() - self.endDateCmbBox.currentIndex() | |
244 | self.endDateCmbBox.clear() |
|
245 | self.endDateCmbBox.clear() | |
245 | for i in self.variableList[index:]: |
|
246 | for i in self.variableList[index:]: | |
246 | self.endDateCmbBox.addItem(i) |
|
247 | self.endDateCmbBox.addItem(i) | |
247 | self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index) |
|
248 | self.endDateCmbBox.setCurrentIndex(self.endDateCmbBox.count() - var_StopDay_index) | |
248 | self.getsubList() |
|
249 | self.getsubList() | |
249 |
|
250 | |||
250 | @pyqtSignature("int") |
|
251 | @pyqtSignature("int") | |
251 | def on_endDateCmbBox_activated(self, index): |
|
252 | def on_endDateCmbBox_activated(self, index): | |
252 | """ |
|
253 | """ | |
253 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
254 | SELECCION DEL RANGO DE FECHAS-END DATE | |
254 | """ |
|
255 | """ | |
255 | var_StartDay_index=self.starDateCmbBox.currentIndex() |
|
256 | var_StartDay_index=self.starDateCmbBox.currentIndex() | |
256 | var_end_index = self.endDateCmbBox.count() - index |
|
257 | var_end_index = self.endDateCmbBox.count() - index | |
257 | self.starDateCmbBox.clear() |
|
258 | self.starDateCmbBox.clear() | |
258 | for i in self.variableList[:len(self.variableList) - var_end_index + 1]: |
|
259 | for i in self.variableList[:len(self.variableList) - var_end_index + 1]: | |
259 | self.starDateCmbBox.addItem(i) |
|
260 | self.starDateCmbBox.addItem(i) | |
260 | self.starDateCmbBox.setCurrentIndex(var_StartDay_index) |
|
261 | self.starDateCmbBox.setCurrentIndex(var_StartDay_index) | |
261 | self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas |
|
262 | self.getsubList() #Se carga var_sublist[] con el rango de las fechas seleccionadas | |
262 |
|
263 | |||
263 | @pyqtSignature("int") |
|
264 | @pyqtSignature("int") | |
264 | def on_readModeCmBox_activated(self, p0): |
|
265 | def on_readModeCmBox_activated(self, p0): | |
265 | """ |
|
266 | """ | |
266 | Slot documentation goes here. |
|
267 | Slot documentation goes here. | |
267 | """ |
|
268 | """ | |
268 | if p0==0: |
|
269 | if p0==0: | |
269 | self.online=0 |
|
270 | self.online=0 | |
270 | elif p0==1: |
|
271 | elif p0==1: | |
271 | self.online=1 |
|
272 | self.online=1 | |
272 |
|
273 | |||
273 | @pyqtSignature("") |
|
274 | @pyqtSignature("") | |
274 | def on_dataOkBtn_clicked(self): |
|
275 | def on_dataOkBtn_clicked(self): | |
275 | """ |
|
276 | """ | |
276 | Slot documentation goes here. |
|
277 | Slot documentation goes here. | |
277 | """ |
|
278 | """ | |
278 | print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online" |
|
279 | print "En este nivel se pasa el tipo de dato con el que se trabaja,path,startDate,endDate,startTime,endTime,online" | |
279 |
|
280 | |||
280 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] |
|
281 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] | |
281 | datatype=str(self.dataTypeCmbBox.currentText()) |
|
282 | datatype=str(self.dataTypeCmbBox.currentText()) | |
282 | path=str(self.dataPathTxt.text()) |
|
283 | path=str(self.dataPathTxt.text()) | |
283 | online=int(self.online) |
|
284 | online=int(self.online) | |
284 | starDate=str(self.starDateCmbBox.currentText()) |
|
285 | starDate=str(self.starDateCmbBox.currentText()) | |
285 | endDate=str(self.endDateCmbBox.currentText()) |
|
286 | endDate=str(self.endDateCmbBox.currentText()) | |
286 |
|
287 | |||
287 |
|
288 | |||
288 | self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype, |
|
289 | self.readUnitConfObj = projectObj.addReadUnit(datatype=datatype, | |
289 | path=path, |
|
290 | path=path, | |
290 | startDate=starDate, |
|
291 | startDate=starDate, | |
291 | endDate=endDate, |
|
292 | endDate=endDate, | |
292 | startTime='06:10:00', |
|
293 | startTime='06:10:00', | |
293 | endTime='23:59:59', |
|
294 | endTime='23:59:59', | |
294 | online=online) |
|
295 | online=online) | |
295 |
|
296 | |||
296 | self.readUnitConfObjList.append(self.readUnitConfObj) |
|
297 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
297 |
|
298 | |||
298 | print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online |
|
299 | print "self.readUnitConfObj.getId",self.readUnitConfObj.getId(),datatype,path,starDate,endDate,online | |
299 |
|
300 | |||
300 |
|
301 | |||
301 | self.model_2=treeModel() |
|
302 | self.model_2=treeModel() | |
302 |
|
303 | |||
303 | self.model_2.setParams(name=projectObj.name+str(projectObj.id), |
|
304 | self.model_2.setParams(name=projectObj.name+str(projectObj.id), | |
304 | directorio=path, |
|
305 | directorio=path, | |
305 | workspace="C:\\WorkspaceGUI", |
|
306 | workspace="C:\\WorkspaceGUI", | |
306 | remode=str(self.readModeCmBox.currentText()), |
|
307 | remode=str(self.readModeCmBox.currentText()), | |
307 | dataformat=datatype, |
|
308 | dataformat=datatype, | |
308 | date=str(starDate)+"-"+str(endDate), |
|
309 | date=str(starDate)+"-"+str(endDate), | |
309 | initTime='06:10:00', |
|
310 | initTime='06:10:00', | |
310 | endTime='23:59:59', |
|
311 | endTime='23:59:59', | |
311 | timezone="Local" , |
|
312 | timezone="Local" , | |
312 | Summary="test de prueba") |
|
313 | Summary="test de prueba") | |
313 | self.model_2.arbol() |
|
314 | self.model_2.arbol() | |
314 | self.treeView_2.setModel(self.model_2) |
|
315 | self.treeView_2.setModel(self.model_2) | |
315 | self.treeView_2.expandAll() |
|
316 | self.treeView_2.expandAll() | |
316 |
|
317 | |||
317 |
|
318 | |||
318 | @pyqtSignature("") |
|
319 | @pyqtSignature("") | |
319 | def on_addUnitProces_clicked(self): |
|
320 | def on_addUnitProces_clicked(self): | |
320 | """ |
|
321 | """ | |
321 | Slot documentation goes here. |
|
322 | Slot documentation goes here. | |
322 | """ |
|
323 | """ | |
323 | # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" |
|
324 | # print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" | |
324 | # self.procUnitConfObj0 = self.controllerObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId()) |
|
325 | # self.procUnitConfObj0 = self.controllerObj.addProcUnit(datatype='Voltage', inputId=self.readUnitConfObj.getId()) | |
325 | self.showUp() |
|
326 | self.showUp() | |
326 |
|
327 | |||
327 | def showUp(self): |
|
328 | def showUp(self): | |
328 |
|
329 | |||
329 | self.configUP=UnitProcess(self) |
|
330 | self.configUP=UnitProcess(self) | |
330 | for i in self.proObjList: |
|
331 | for i in self.proObjList: | |
331 | self.configUP.getfromWindowList.append(i) |
|
332 | self.configUP.getfromWindowList.append(i) | |
332 | #print i |
|
333 | #print i | |
333 | for i in self.upObjList: |
|
334 | for i in self.upObjList: | |
334 | self.configUP.getfromWindowList.append(i) |
|
335 | self.configUP.getfromWindowList.append(i) | |
335 | self.configUP.loadTotalList() |
|
336 | self.configUP.loadTotalList() | |
336 | self.configUP.show() |
|
337 | self.configUP.show() | |
337 | self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) |
|
338 | self.configUP.unitPsavebut.clicked.connect(self.reciveUPparameters) | |
338 | self.configUP.closed.connect(self.createUP) |
|
339 | self.configUP.closed.connect(self.createUP) | |
339 |
|
340 | |||
340 | def reciveUPparameters(self): |
|
341 | def reciveUPparameters(self): | |
341 |
|
342 | |||
342 | self.uporProObjRecover,self.upType=self.configUP.almacena() |
|
343 | self.uporProObjRecover,self.upType=self.configUP.almacena() | |
343 |
|
344 | |||
344 |
|
345 | |||
345 | def createUP(self): |
|
346 | def createUP(self): | |
346 | print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" |
|
347 | print "En este nivel se adiciona una rama de procesamiento, y se le concatena con el id" | |
347 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] |
|
348 | projectObj=self.proObjList[int(self.proConfCmbBox.currentIndex())] | |
348 |
|
349 | |||
349 | datatype=str(self.upType) |
|
350 | datatype=str(self.upType) | |
350 | uporprojectObj=self.uporProObjRecover |
|
351 | uporprojectObj=self.uporProObjRecover | |
351 | #+++++++++++LET FLY+++++++++++# |
|
352 | #+++++++++++LET FLY+++++++++++# | |
352 | if uporprojectObj.getElementName()=='ProcUnit': |
|
353 | if uporprojectObj.getElementName()=='ProcUnit': | |
353 | inputId=uporprojectObj.getId() |
|
354 | inputId=uporprojectObj.getId() | |
354 | elif uporprojectObj.getElementName()=='Project': |
|
355 | elif uporprojectObj.getElementName()=='Project': | |
355 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() |
|
356 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() | |
356 |
|
357 | |||
357 |
|
358 | |||
358 | self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId) |
|
359 | self.procUnitConfObj1 = projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
359 | self.upObjList.append(self.procUnitConfObj1) |
|
360 | self.upObjList.append(self.procUnitConfObj1) | |
360 | print inputId |
|
361 | print inputId | |
361 | print self.procUnitConfObj1.getId() |
|
362 | print self.procUnitConfObj1.getId() | |
362 | self.parentItem=uporprojectObj.arbol |
|
363 | self.parentItem=uporprojectObj.arbol | |
363 | self.numbertree=int(self.procUnitConfObj1.getId())-1 |
|
364 | self.numbertree=int(self.procUnitConfObj1.getId())-1 | |
364 | self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree)) |
|
365 | self.procUnitConfObj1.arbol=QtGui.QStandardItem(QtCore.QString(datatype +"%1 ").arg(self.numbertree)) | |
365 | self.parentItem.appendRow(self.procUnitConfObj1.arbol) |
|
366 | self.parentItem.appendRow(self.procUnitConfObj1.arbol) | |
366 | self.parentItem=self.procUnitConfObj1.arbol |
|
367 | self.parentItem=self.procUnitConfObj1.arbol | |
367 | self.loadUp() |
|
368 | self.loadUp() | |
368 | self.treeView.expandAll() |
|
369 | self.treeView.expandAll() | |
369 |
|
370 | |||
370 | def loadUp(self): |
|
371 | def loadUp(self): | |
371 | self.addOpUpselec.clear() |
|
372 | self.addOpUpselec.clear() | |
372 | self.addOpSpecUpselec.clear() |
|
373 | self.addOpSpecUpselec.clear() | |
373 | for i in self.upObjList: |
|
374 | for i in self.upObjList: | |
374 | if i.datatype=='Voltage': |
|
375 | if i.datatype=='Voltage': | |
375 | self.upObjVolList.append(i) |
|
376 | self.upObjVolList.append(i) | |
376 | name=i.getElementName() |
|
377 | name=i.getElementName() | |
377 | id=int(i.id)-1 |
|
378 | id=int(i.id)-1 | |
378 | self.addOpUpselec.addItem(name+str(id)) |
|
379 | self.addOpUpselec.addItem(name+str(id)) | |
379 | if i.datatype=='Spectra': |
|
380 | if i.datatype=='Spectra': | |
380 | self.upobjSpecList.append(i) |
|
381 | self.upobjSpecList.append(i) | |
381 | name=i.getElementName() |
|
382 | name=i.getElementName() | |
382 | id=int(i.id)-1 |
|
383 | id=int(i.id)-1 | |
383 | self.addOpSpecUpselec.addItem(name+str(id)) |
|
384 | self.addOpSpecUpselec.addItem(name+str(id)) | |
384 |
|
385 | |||
385 | self.resetopVolt() |
|
386 | self.resetopVolt() | |
386 | self.resetopSpec() |
|
387 | self.resetopSpec() | |
387 |
|
388 | |||
388 |
|
389 | |||
389 | @pyqtSignature("int") |
|
390 | @pyqtSignature("int") | |
390 | def on_selecChannelopVolCEB_stateChanged(self, p0): |
|
391 | def on_selecChannelopVolCEB_stateChanged(self, p0): | |
391 | """ |
|
392 | """ | |
392 | Slot documentation goes here. |
|
393 | Slot documentation goes here. | |
393 | """ |
|
394 | """ | |
394 | if p0==2: |
|
395 | if p0==2: | |
395 | self.numberChannelopVol.setEnabled(True) |
|
396 | self.numberChannelopVol.setEnabled(True) | |
396 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] |
|
397 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
397 | opObj10=upProcessSelect.addOperation(name='selectChannels') |
|
398 | opObj10=upProcessSelect.addOperation(name='selectChannels') | |
398 | print opObj10.id |
|
399 | print opObj10.id | |
399 | self.operObjList.append(opObj10) |
|
400 | self.operObjList.append(opObj10) | |
400 | print " Ingresa seleccion de Canales" |
|
401 | print " Ingresa seleccion de Canales" | |
401 | if p0==0: |
|
402 | if p0==0: | |
402 | print " deshabilitado" |
|
403 | print " deshabilitado" | |
403 |
|
404 | |||
404 | @pyqtSignature("int") |
|
405 | @pyqtSignature("int") | |
405 | def on_selecHeighopVolCEB_stateChanged(self, p0): |
|
406 | def on_selecHeighopVolCEB_stateChanged(self, p0): | |
406 | """ |
|
407 | """ | |
407 | Slot documentation goes here. |
|
408 | Slot documentation goes here. | |
408 | """ |
|
409 | """ | |
409 | if p0==2: |
|
410 | if p0==2: | |
410 | self.lineHeighProfileTxtopVol.setEnabled(True) |
|
411 | self.lineHeighProfileTxtopVol.setEnabled(True) | |
411 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] |
|
412 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
412 | opObj10=upProcessSelect.addOperation(name='selectHeights') |
|
413 | opObj10=upProcessSelect.addOperation(name='selectHeights') | |
413 | print opObj10.id |
|
414 | print opObj10.id | |
414 | self.operObjList.append(opObj10) |
|
415 | self.operObjList.append(opObj10) | |
415 | print " Select Type of Profile" |
|
416 | print " Select Type of Profile" | |
416 | if p0==0: |
|
417 | if p0==0: | |
417 | print " deshabilitado" |
|
418 | print " deshabilitado" | |
418 |
|
419 | |||
419 |
|
420 | |||
|
421 | @pyqtSignature("int") | |||
|
422 | def on_profileSelecopVolCEB_stateChanged(self, p0): | |||
|
423 | """ | |||
|
424 | Slot documentation goes here. | |||
|
425 | """ | |||
|
426 | if p0==2: | |||
|
427 | self.lineProfileSelecopVolCEB.setEnabled(True) | |||
|
428 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |||
|
429 | opObj10=upProcessSelect.addOperation(name='ProfileSelector', optype='other') | |||
|
430 | print opObj10.id | |||
|
431 | self.operObjList.append(opObj10) | |||
|
432 | print " Select Type of Profile" | |||
|
433 | if p0==0: | |||
|
434 | print " deshabilitado" | |||
|
435 | ||||
420 |
|
436 | |||
421 | @pyqtSignature("int") |
|
437 | @pyqtSignature("int") | |
422 | def on_coherentIntegrationCEB_stateChanged(self, p0): |
|
438 | def on_coherentIntegrationCEB_stateChanged(self, p0): | |
423 | """ |
|
439 | """ | |
424 | Slot documentation goes here. |
|
440 | Slot documentation goes here. | |
425 | """ |
|
441 | """ | |
426 | if p0==2: |
|
442 | if p0==2: | |
427 | self.numberIntegration.setEnabled(True) |
|
443 | self.numberIntegration.setEnabled(True) | |
428 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] |
|
444 | upProcessSelect=self.upObjVolList[int(self.addOpUpselec.currentIndex())] | |
429 | opObj10=upProcessSelect.addOperation(name='CohInt', optype='other') |
|
445 | opObj10=upProcessSelect.addOperation(name='CohInt', optype='other') | |
430 | print opObj10.id |
|
446 | print opObj10.id | |
431 | self.operObjList.append(opObj10) |
|
447 | self.operObjList.append(opObj10) | |
432 | print "Choose number of Cohint" |
|
448 | print "Choose number of Cohint" | |
433 | if p0==0: |
|
449 | if p0==0: | |
434 | print " deshabilitado" |
|
450 | print " deshabilitado" | |
435 | self.numberChannelopVol.setEnabled(False) |
|
451 | self.numberChannelopVol.setEnabled(False) | |
436 |
|
452 | |||
437 | def resetopVolt(self): |
|
453 | def resetopVolt(self): | |
438 | self.selecChannelopVolCEB.setChecked(False) |
|
454 | self.selecChannelopVolCEB.setChecked(False) | |
439 | self.selecHeighopVolCEB.setChecked(False) |
|
455 | self.selecHeighopVolCEB.setChecked(False) | |
440 | self.coherentIntegrationCEB.setChecked(False) |
|
456 | self.coherentIntegrationCEB.setChecked(False) | |
441 |
|
457 | self.profileSelecopVolCEB.setChecked(False) | ||
442 | #self.selecChannelopVolCEB.setEnabled(False) |
|
458 | #self.selecChannelopVolCEB.setEnabled(False) | |
443 | self.lineHeighProfileTxtopVol.clear() |
|
459 | self.lineHeighProfileTxtopVol.clear() | |
|
460 | self.lineProfileSelecopVolCEB.clear() | |||
444 | self.numberChannelopVol.clear() |
|
461 | self.numberChannelopVol.clear() | |
445 | self.numberIntegration.clear() |
|
462 | self.numberIntegration.clear() | |
446 |
|
463 | |||
447 |
|
464 | |||
448 | @pyqtSignature("") |
|
465 | @pyqtSignature("") | |
449 | def on_dataopVolOkBtn_clicked(self): |
|
466 | def on_dataopVolOkBtn_clicked(self): | |
450 | """ |
|
467 | """ | |
451 | Slot documentation goes here. |
|
468 | Slot documentation goes here. | |
452 | """ |
|
469 | """ | |
453 | if self.selecChannelopVolCEB.isChecked(): |
|
470 | if self.selecChannelopVolCEB.isChecked(): | |
454 | for i in self.operObjList: |
|
471 | for i in self.operObjList: | |
455 | if i.name=='selectChannels': |
|
472 | if i.name=='selectChannels': | |
456 | value=self.numberChannelopVol.text() |
|
473 | value=self.numberChannelopVol.text() | |
457 | i.addParameter(name='channelList', value=value, format='intlist') |
|
474 | i.addParameter(name='channelList', value=value, format='intlist') | |
458 |
|
475 | |||
459 |
|
476 | |||
460 | print "channel" |
|
477 | print "channel" | |
461 |
|
478 | |||
462 | if self.selecHeighopVolCEB.isChecked(): |
|
479 | if self.selecHeighopVolCEB.isChecked(): | |
463 | for i in self.operObjList: |
|
480 | for i in self.operObjList: | |
464 | if i.name=='selectHeights' : |
|
481 | if i.name=='selectHeights' : | |
465 | value=self.lineHeighProfileTxtopVol.text() |
|
482 | value=self.lineHeighProfileTxtopVol.text() | |
466 | valueList=value.split(',') |
|
483 | valueList=value.split(',') | |
467 | i.addParameter(name='minHei', value=value[0], format='float') |
|
484 | i.addParameter(name='minHei', value=valueList[0], format='float') | |
468 | i.addParameter(name='maxHei', value=value[1], format='float') |
|
485 | i.addParameter(name='maxHei', value=valueList[1], format='float') | |
469 |
|
|
486 | ||
470 | print "height" |
|
487 | print "height" | |
|
488 | ||||
|
489 | ||||
|
490 | if self.selecHeighopVolCEB.isChecked(): | |||
|
491 | for i in self.operObjList: | |||
|
492 | if i.name=='ProfileSelector' : | |||
|
493 | value=self.lineProfileSelecopVolCEB.text() | |||
|
494 | i.addParameter(name='ProfileSelector', value=value, format='intlist') | |||
|
495 | ||||
|
496 | ||||
|
497 | ||||
471 | if self.coherentIntegrationCEB.isChecked(): |
|
498 | if self.coherentIntegrationCEB.isChecked(): | |
472 | for i in self.operObjList: |
|
499 | for i in self.operObjList: | |
473 | if i.name=='CohInt': |
|
500 | if i.name=='CohInt': | |
474 | value=self.numberIntegration.text() |
|
501 | value=self.numberIntegration.text() | |
475 | i.addParameter(name='n', value=value, format='int') |
|
502 | i.addParameter(name='n', value=value, format='int') | |
476 |
|
503 | |||
477 |
|
504 | |||
478 | @pyqtSignature("int") |
|
505 | @pyqtSignature("int") | |
479 | def on_nFFTPointOpSpecCEB_stateChanged(self, p0): |
|
506 | def on_nFFTPointOpSpecCEB_stateChanged(self, p0): | |
480 | """ |
|
507 | """ | |
481 | Slot documentation goes here. |
|
508 | Slot documentation goes here. | |
482 | """ |
|
509 | """ | |
483 | if p0==2: |
|
510 | if p0==2: | |
484 | self.valuenFFTPointOpSpec.setEnabled(True) |
|
511 | self.valuenFFTPointOpSpec.setEnabled(True) | |
485 | print " nFFTPoint" |
|
512 | print " nFFTPoint" | |
486 | if p0==0: |
|
513 | if p0==0: | |
487 | print " deshabilitado" |
|
514 | print " deshabilitado" | |
488 |
|
515 | |||
489 |
|
516 | |||
490 | def resetopSpec(self): |
|
517 | def resetopSpec(self): | |
491 | self.nFFTPointOpSpecCEB.setChecked(False) |
|
518 | self.nFFTPointOpSpecCEB.setChecked(False) | |
492 |
|
519 | |||
493 | self.valuenFFTPointOpSpec.clear() |
|
520 | self.valuenFFTPointOpSpec.clear() | |
494 |
|
521 | |||
495 |
|
522 | |||
496 | @pyqtSignature("") |
|
523 | @pyqtSignature("") | |
497 | def on_dataopSpecOkBtn_clicked(self): |
|
524 | def on_dataopSpecOkBtn_clicked(self): | |
498 | """ |
|
525 | """ | |
499 | Slot documentation goes here. |
|
526 | Slot documentation goes here. | |
500 | """ |
|
527 | """ | |
501 | print "AΓ±adimos operaciones Spectra,nchannels,value,format" |
|
528 | print "AΓ±adimos operaciones Spectra,nchannels,value,format" | |
502 | if self.nFFTPointOpSpecCEB.isChecked(): |
|
529 | if self.nFFTPointOpSpecCEB.isChecked(): | |
503 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] |
|
530 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
504 | value=self.valuenFFTPointOpSpec.text() |
|
531 | value=self.valuenFFTPointOpSpec.text() | |
505 | upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int') |
|
532 | upProcessSelect.addParameter(name='nFFTPoints',value=value,format='int') | |
506 |
|
533 | |||
507 | @pyqtSignature("int") |
|
534 | @pyqtSignature("int") | |
508 | def on_SpectraPlotGraphCEB_stateChanged(self, p0): |
|
535 | def on_SpectraPlotGraphCEB_stateChanged(self, p0): | |
509 | """ |
|
536 | """ | |
510 | Slot documentation goes here. |
|
537 | Slot documentation goes here. | |
511 | """ |
|
538 | """ | |
512 | if p0==2: |
|
539 | if p0==2: | |
513 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] |
|
540 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
514 | opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other') |
|
541 | opObj10=upProcessSelect.addOperation(name='SpectraPlot',optype='other') | |
515 | print opObj10.id |
|
542 | print opObj10.id | |
516 | self.operObjList.append(opObj10) |
|
543 | self.operObjList.append(opObj10) | |
517 |
|
544 | |||
518 | if p0==0: |
|
545 | if p0==0: | |
519 | print " deshabilitado" |
|
546 | print " deshabilitado" | |
520 |
|
547 | |||
521 | @pyqtSignature("int") |
|
548 | @pyqtSignature("int") | |
522 | def on_CrossSpectraPlotGraphceb_stateChanged(self, p0): |
|
549 | def on_CrossSpectraPlotGraphceb_stateChanged(self, p0): | |
523 | """ |
|
550 | """ | |
524 | Slot documentation goes here. |
|
551 | Slot documentation goes here. | |
525 | """ |
|
552 | """ | |
526 | if p0==2: |
|
553 | if p0==2: | |
527 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] |
|
554 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
528 | opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other') |
|
555 | opObj10=upProcessSelect.addOperation(name='CrossSpectraPlot',optype='other') | |
529 | print opObj10.id |
|
556 | print opObj10.id | |
530 | self.operObjList.append(opObj10) |
|
557 | self.operObjList.append(opObj10) | |
531 | if p0==0: |
|
558 | if p0==0: | |
532 | print " deshabilitado" |
|
559 | print " deshabilitado" | |
533 |
|
560 | |||
534 | @pyqtSignature("int") |
|
561 | @pyqtSignature("int") | |
535 | def on_RTIPlotGraphCEB_stateChanged(self, p0): |
|
562 | def on_RTIPlotGraphCEB_stateChanged(self, p0): | |
536 | """ |
|
563 | """ | |
537 | Slot documentation goes here. |
|
564 | Slot documentation goes here. | |
538 | """ |
|
565 | """ | |
539 | if p0==2: |
|
566 | if p0==2: | |
540 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] |
|
567 | upProcessSelect=self.upobjSpecList[int(self.addOpSpecUpselec.currentIndex())] | |
541 | opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other') |
|
568 | opObj10=upProcessSelect.addOperation(name='RTIPlot',optype='other') | |
542 | print opObj10.id |
|
569 | print opObj10.id | |
543 | self.operObjList.append(opObj10) |
|
570 | self.operObjList.append(opObj10) | |
544 | if p0==0: |
|
571 | if p0==0: | |
545 | print " deshabilitado" |
|
572 | print " deshabilitado" | |
546 |
|
573 | |||
547 |
|
574 | |||
548 | def resetgraphSpec(self): |
|
575 | def resetgraphSpec(self): | |
549 | self.SpectraPlotGraphCEB.setChecked(False) |
|
576 | self.SpectraPlotGraphCEB.setChecked(False) | |
550 | self.CrossSpectraPlotGraphceb.setChecked(False) |
|
577 | self.CrossSpectraPlotGraphceb.setChecked(False) | |
551 | self.RTIPlotGraphCEB.setChecked(False) |
|
578 | self.RTIPlotGraphCEB.setChecked(False) | |
552 |
|
579 | |||
553 | @pyqtSignature("") |
|
580 | @pyqtSignature("") | |
554 | def on_dataGraphSpecOkBtn_clicked(self): |
|
581 | def on_dataGraphSpecOkBtn_clicked(self): | |
555 | """ |
|
582 | """ | |
556 | Slot documentation goes here. |
|
583 | Slot documentation goes here. | |
557 | """ |
|
584 | """ | |
558 | print "Graficar Spec op" |
|
585 | print "Graficar Spec op" | |
559 | if self.SpectraPlotGraphCEB.isChecked(): |
|
586 | if self.SpectraPlotGraphCEB.isChecked(): | |
560 | for i in self.operObjList: |
|
587 | for i in self.operObjList: | |
561 | if i.name=='SpectraPlot': |
|
588 | if i.name=='SpectraPlot': | |
562 | i.addParameter(name='idfigure', value='1', format='int') |
|
589 | i.addParameter(name='idfigure', value='1', format='int') | |
563 | i.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
590 | i.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
564 | i.addParameter(name='zmin', value='40', format='int') |
|
591 | i.addParameter(name='zmin', value='40', format='int') | |
565 | i.addParameter(name='zmax', value='90', format='int') |
|
592 | i.addParameter(name='zmax', value='90', format='int') | |
566 | i.addParameter(name='showprofile', value='1', format='int') |
|
593 | i.addParameter(name='showprofile', value='1', format='int') | |
567 |
|
594 | |||
568 | if self.CrossSpectraPlotGraphceb.isChecked(): |
|
595 | if self.CrossSpectraPlotGraphceb.isChecked(): | |
569 | for i in self.operObjList: |
|
596 | for i in self.operObjList: | |
570 | if i.name=='CrossSpectraPlot' : |
|
597 | if i.name=='CrossSpectraPlot' : | |
571 | i.addParameter(name='idfigure', value='2', format='int') |
|
598 | i.addParameter(name='idfigure', value='2', format='int') | |
572 | i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
599 | i.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
573 | i.addParameter(name='zmin', value='40', format='int') |
|
600 | i.addParameter(name='zmin', value='40', format='int') | |
574 | i.addParameter(name='zmax', value='90', format='int') |
|
601 | i.addParameter(name='zmax', value='90', format='int') | |
575 |
|
602 | |||
576 | if self.RTIPlotGraphCEB.isChecked(): |
|
603 | if self.RTIPlotGraphCEB.isChecked(): | |
577 | for i in self.operObjList: |
|
604 | for i in self.operObjList: | |
578 | if i.name=='RTIPlot': |
|
605 | if i.name=='RTIPlot': | |
579 | i.addParameter(name='n', value='2', format='int') |
|
606 | i.addParameter(name='n', value='2', format='int') | |
580 | i.addParameter(name='overlapping', value='1', format='int') |
|
607 | i.addParameter(name='overlapping', value='1', format='int') | |
581 |
|
608 | |||
582 | @pyqtSignature("") |
|
609 | @pyqtSignature("") | |
583 | def on_actionguardarObj_triggered(self): |
|
610 | def on_actionguardarObj_triggered(self): | |
584 | """ |
|
611 | """ | |
585 | GUARDAR EL ARCHIVO DE CONFIGURACION XML |
|
612 | GUARDAR EL ARCHIVO DE CONFIGURACION XML | |
586 | """ |
|
613 | """ | |
587 | if self.idp==1: |
|
614 | if self.idp==1: | |
588 | self.valuep=1 |
|
615 | self.valuep=1 | |
589 |
|
616 | |||
590 | print "Escribiendo el archivo XML" |
|
617 | print "Escribiendo el archivo XML" | |
591 | filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml" |
|
618 | filename="C:\\WorkspaceGUI\\CONFIG"+str(self.valuep)+".xml" | |
592 | self.controllerObj=self.proObjList[int(self.valuep)-1] |
|
619 | self.controllerObj=self.proObjList[int(self.valuep)-1] | |
593 | self.controllerObj.writeXml(filename) |
|
620 | self.controllerObj.writeXml(filename) | |
594 |
|
621 | |||
595 |
|
622 | |||
596 | class Window(QMainWindow, Ui_window): |
|
623 | class Window(QMainWindow, Ui_window): | |
597 | """ |
|
624 | """ | |
598 | Class documentation goes here. |
|
625 | Class documentation goes here. | |
599 | """ |
|
626 | """ | |
600 | closed=pyqtSignal() |
|
627 | closed=pyqtSignal() | |
601 | def __init__(self, parent = None): |
|
628 | def __init__(self, parent = None): | |
602 | """ |
|
629 | """ | |
603 | Constructor |
|
630 | Constructor | |
604 | """ |
|
631 | """ | |
605 | QMainWindow.__init__(self, parent) |
|
632 | QMainWindow.__init__(self, parent) | |
606 | self.setupUi(self) |
|
633 | self.setupUi(self) | |
607 | self.name=0 |
|
634 | self.name=0 | |
608 | self.nameproject=None |
|
635 | self.nameproject=None | |
609 | self.proyectNameLine.setText('My_name_is...') |
|
636 | self.proyectNameLine.setText('My_name_is...') | |
610 | self.descriptionTextEdit.setText('Write a description...') |
|
637 | self.descriptionTextEdit.setText('Write a description...') | |
611 |
|
638 | |||
612 |
|
639 | |||
613 | @pyqtSignature("") |
|
640 | @pyqtSignature("") | |
614 | def on_cancelButton_clicked(self): |
|
641 | def on_cancelButton_clicked(self): | |
615 | """ |
|
642 | """ | |
616 | Slot documentation goes here. |
|
643 | Slot documentation goes here. | |
617 | """ |
|
644 | """ | |
618 | # TODO: not implemented yet |
|
645 | # TODO: not implemented yet | |
619 | #raise NotImplementedError |
|
646 | #raise NotImplementedError | |
620 |
|
647 | |||
621 | self.hide() |
|
648 | self.hide() | |
622 |
|
649 | |||
623 | @pyqtSignature("") |
|
650 | @pyqtSignature("") | |
624 | def on_okButton_clicked(self): |
|
651 | def on_okButton_clicked(self): | |
625 | """ |
|
652 | """ | |
626 | Slot documentation goes here. |
|
653 | Slot documentation goes here. | |
627 | """ |
|
654 | """ | |
628 | #self.almacena() |
|
655 | #self.almacena() | |
629 | self.close() |
|
656 | self.close() | |
630 |
|
657 | |||
631 | @pyqtSignature("") |
|
658 | @pyqtSignature("") | |
632 | def on_saveButton_clicked(self): |
|
659 | def on_saveButton_clicked(self): | |
633 | """ |
|
660 | """ | |
634 | Slot documentation goes here. |
|
661 | Slot documentation goes here. | |
635 | """ |
|
662 | """ | |
636 | self.almacena() |
|
663 | self.almacena() | |
637 | # self.close() |
|
664 | # self.close() | |
638 |
|
665 | |||
639 | def almacena(self): |
|
666 | def almacena(self): | |
640 | #print str(self.proyectNameLine.text()) |
|
667 | #print str(self.proyectNameLine.text()) | |
641 | self.nameproject=str(self.proyectNameLine.text()) |
|
668 | self.nameproject=str(self.proyectNameLine.text()) | |
642 | self.description=str(self.descriptionTextEdit.toPlainText()) |
|
669 | self.description=str(self.descriptionTextEdit.toPlainText()) | |
643 | return self.nameproject,self.description |
|
670 | return self.nameproject,self.description | |
644 |
|
671 | |||
645 | def closeEvent(self, event): |
|
672 | def closeEvent(self, event): | |
646 | self.closed.emit() |
|
673 | self.closed.emit() | |
647 | event.accept() |
|
674 | event.accept() | |
648 |
|
675 | |||
649 |
|
676 | |||
650 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
|
677 | class UnitProcess(QMainWindow, Ui_UnitProcess): | |
651 | """ |
|
678 | """ | |
652 | Class documentation goes here. |
|
679 | Class documentation goes here. | |
653 | """ |
|
680 | """ | |
654 | closed=pyqtSignal() |
|
681 | closed=pyqtSignal() | |
655 | def __init__(self, parent = None): |
|
682 | def __init__(self, parent = None): | |
656 | """ |
|
683 | """ | |
657 | Constructor |
|
684 | Constructor | |
658 | """ |
|
685 | """ | |
659 | QMainWindow.__init__(self, parent) |
|
686 | QMainWindow.__init__(self, parent) | |
660 | self.setupUi(self) |
|
687 | self.setupUi(self) | |
661 | self.getFromWindow=None |
|
688 | self.getFromWindow=None | |
662 | self.getfromWindowList=[] |
|
689 | self.getfromWindowList=[] | |
663 |
|
690 | |||
664 | self.listUP=None |
|
691 | self.listUP=None | |
665 |
|
692 | |||
666 | def loadTotalList(self): |
|
693 | def loadTotalList(self): | |
667 | self.comboInputBox.clear() |
|
694 | self.comboInputBox.clear() | |
668 | for i in self.getfromWindowList: |
|
695 | for i in self.getfromWindowList: | |
669 | name=i.getElementName() |
|
696 | name=i.getElementName() | |
670 | id= i.id |
|
697 | id= i.id | |
671 | if i.getElementName()=='ProcUnit': |
|
698 | if i.getElementName()=='ProcUnit': | |
672 | id=int(i.id)-1 |
|
699 | id=int(i.id)-1 | |
673 | self.comboInputBox.addItem(str(name)+str(id)) |
|
700 | self.comboInputBox.addItem(str(name)+str(id)) | |
674 |
|
701 | |||
675 | @pyqtSignature("QString") |
|
702 | @pyqtSignature("QString") | |
676 | def on_comboInputBox_activated(self, p0): |
|
703 | def on_comboInputBox_activated(self, p0): | |
677 | """ |
|
704 | """ | |
678 | Slot documentation goes here. |
|
705 | Slot documentation goes here. | |
679 | """ |
|
706 | """ | |
680 |
|
707 | |||
681 | # TODO: not implemented yet |
|
708 | # TODO: not implemented yet | |
682 | #raise NotImplementedError |
|
709 | #raise NotImplementedError | |
683 |
|
710 | |||
684 | @pyqtSignature("QString") |
|
711 | @pyqtSignature("QString") | |
685 | def on_comboTypeBox_activated(self, p0): |
|
712 | def on_comboTypeBox_activated(self, p0): | |
686 | """ |
|
713 | """ | |
687 | Slot documentation goes here. |
|
714 | Slot documentation goes here. | |
688 | """ |
|
715 | """ | |
689 | # TODO: not implemented yet |
|
716 | # TODO: not implemented yet | |
690 | #raise NotImplementedError |
|
717 | #raise NotImplementedError | |
691 |
|
718 | |||
692 | @pyqtSignature("") |
|
719 | @pyqtSignature("") | |
693 | def on_unitPokbut_clicked(self): |
|
720 | def on_unitPokbut_clicked(self): | |
694 | """ |
|
721 | """ | |
695 | Slot documentation goes here. |
|
722 | Slot documentation goes here. | |
696 | """ |
|
723 | """ | |
697 | self.close() |
|
724 | self.close() | |
698 |
|
725 | |||
699 | @pyqtSignature("") |
|
726 | @pyqtSignature("") | |
700 | def on_unitPsavebut_clicked(self): |
|
727 | def on_unitPsavebut_clicked(self): | |
701 | """ |
|
728 | """ | |
702 | Slot documentation goes here. |
|
729 | Slot documentation goes here. | |
703 | """ |
|
730 | """ | |
704 |
|
731 | |||
705 | print "alex" |
|
732 | print "alex" | |
706 | self.almacena() |
|
733 | self.almacena() | |
707 |
|
734 | |||
708 | @pyqtSignature("") |
|
735 | @pyqtSignature("") | |
709 | def on_unitPcancelbut_clicked(self): |
|
736 | def on_unitPcancelbut_clicked(self): | |
710 | """ |
|
737 | """ | |
711 | Slot documentation goes here. |
|
738 | Slot documentation goes here. | |
712 | """ |
|
739 | """ | |
713 | # TODO: not implemented yet |
|
740 | # TODO: not implemented yet | |
714 | #raise NotImplementedError |
|
741 | #raise NotImplementedError | |
715 | self.hide() |
|
742 | self.hide() | |
716 |
|
743 | |||
717 | def almacena(self): |
|
744 | def almacena(self): | |
718 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
745 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
719 | #self.nameofUP= str(self.nameUptxt.text()) |
|
746 | #self.nameofUP= str(self.nameUptxt.text()) | |
720 | self.typeofUP= str(self.comboTypeBox.currentText()) |
|
747 | self.typeofUP= str(self.comboTypeBox.currentText()) | |
721 | return self.getFromWindow,self.typeofUP |
|
748 | return self.getFromWindow,self.typeofUP | |
722 |
|
749 | |||
723 | def closeEvent(self, event): |
|
750 | def closeEvent(self, event): | |
724 | self.closed.emit() |
|
751 | self.closed.emit() | |
725 | event.accept() |
|
752 | event.accept() | |
726 |
|
753 | |||
727 |
|
754 | |||
728 |
|
755 | |||
729 |
|
756 | |||
730 |
|
757 | |||
731 |
|
758 | |||
732 | No newline at end of file |
|
759 |
General Comments 0
You need to be logged in to leave comments.
Login now