This diff has been collapsed as it changes many lines, (719 lines changed) Show them Hide them | |||||
@@ -1,1427 +1,1744 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | Module implementing MainWindow. |
|
3 | Module implementing MainWindow. | |
4 | #+++++++++++++GUI V1++++++++++++++# |
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
5 | @author: AlexanderValdezPortocarrero ñ_ñ |
|
5 | @author: AlexanderValdezPortocarrero ñ_ñ | |
6 | """ |
|
6 | """ | |
7 | import os, sys |
|
7 | import os, sys | |
8 | import datetime |
|
8 | import datetime | |
9 | from PyQt4.QtGui import QMainWindow |
|
9 | from PyQt4.QtGui import QMainWindow | |
10 | from PyQt4.QtCore import pyqtSignature |
|
10 | from PyQt4.QtCore import pyqtSignature | |
11 | from PyQt4.QtCore import pyqtSignal |
|
11 | from PyQt4.QtCore import pyqtSignal | |
12 | from PyQt4 import QtCore |
|
12 | from PyQt4 import QtCore | |
13 | from PyQt4 import QtGui |
|
13 | from PyQt4 import QtGui | |
14 |
|
14 | |||
15 | from viewer.ui_unitprocess import Ui_UnitProcess |
|
15 | from viewer.ui_unitprocess import Ui_UnitProcess | |
16 | from viewer.ui_window import Ui_window |
|
16 | from viewer.ui_window import Ui_window | |
17 | from viewer.ui_mainwindow import Ui_BasicWindow |
|
17 | from viewer.ui_mainwindow import Ui_BasicWindow | |
18 |
|
18 | |||
19 |
|
19 | |||
20 | from modelProperties import treeModel |
|
20 | from modelProperties import treeModel | |
21 |
|
21 | |||
22 | path = os.path.split(os.getcwd())[0] |
|
22 | path = os.path.split(os.getcwd())[0] | |
23 |
|
23 | |||
24 | sys.path.append(path) |
|
24 | sys.path.append(path) | |
25 |
|
25 | |||
26 | from controller import * |
|
26 | from controller import * | |
27 |
|
27 | |||
28 | def isRadarFile(file): |
|
28 | def isRadarFile(file): | |
29 | try: |
|
29 | try: | |
30 | year = int(file[1:5]) |
|
30 | year = int(file[1:5]) | |
31 | doy = int(file[5:8]) |
|
31 | doy = int(file[5:8]) | |
32 | set = int(file[8:11]) |
|
32 | set = int(file[8:11]) | |
33 | except: |
|
33 | except: | |
34 | return 0 |
|
34 | return 0 | |
35 |
|
35 | |||
36 | return 1 |
|
36 | return 1 | |
37 |
|
37 | |||
38 | def isRadarPath(path): |
|
38 | def isRadarPath(path): | |
39 | try: |
|
39 | try: | |
40 | year = int(path[1:5]) |
|
40 | year = int(path[1:5]) | |
41 | doy = int(path[5:8]) |
|
41 | doy = int(path[5:8]) | |
42 | except: |
|
42 | except: | |
43 | return 0 |
|
43 | return 0 | |
44 |
|
44 | |||
45 | return 1 |
|
45 | return 1 | |
46 |
|
46 | |||
47 |
|
47 | |||
48 | class BasicWindow(QMainWindow,Ui_BasicWindow): |
|
48 | class BasicWindow(QMainWindow,Ui_BasicWindow): | |
49 | """ |
|
49 | """ | |
50 |
|
50 | |||
51 | """ |
|
51 | """ | |
52 | def __init__(self,parent = None): |
|
52 | def __init__(self,parent = None): | |
53 | """ |
|
53 | """ | |
54 |
|
54 | |||
55 | """ |
|
55 | """ | |
56 | QMainWindow.__init__(self,parent) |
|
56 | QMainWindow.__init__(self,parent) | |
57 | self.setupUi(self) |
|
57 | self.setupUi(self) | |
58 | self.__projObjDict = {} |
|
58 | self.__projObjDict = {} | |
59 | self.__upObjDict = {} |
|
59 | self.__upObjDict = {} | |
60 | self.__arbolDict = {} |
|
60 | self.__arbolDict = {} | |
61 | self.readUnitConfObjList=[] |
|
61 | self.readUnitConfObjList=[] | |
62 | self.operObjList=[] |
|
62 | self.operObjList=[] | |
63 | self.idp = 0 |
|
63 | self.idp = 0 | |
|
64 | self.idImag=0 | |||
64 | self.online=0 |
|
65 | self.online=0 | |
65 | self.walk=1 |
|
66 | self.walk=1 | |
66 | self.indexclick=None |
|
67 | self.indexclick=None | |
67 | self.setParameter() |
|
68 | self.setParameter() | |
68 |
|
69 | |||
69 | @pyqtSignature("") |
|
70 | @pyqtSignature("") | |
70 | def on_actionCreate_triggered(self): |
|
71 | def on_actionCreate_triggered(self): | |
71 | """ |
|
72 | """ | |
72 | Slot documentation goes here. |
|
73 | Slot documentation goes here. | |
73 | """ |
|
74 | """ | |
74 | self.setProjectParam() |
|
75 | self.setProjectParam() | |
75 |
|
76 | |||
76 | @pyqtSignature("") |
|
77 | @pyqtSignature("") | |
77 | def on_actionSave_triggered(self): |
|
78 | def on_actionSave_triggered(self): | |
78 | """ |
|
79 | """ | |
79 | Slot documentation goes here. |
|
80 | Slot documentation goes here. | |
80 | """ |
|
81 | """ | |
81 | self.saveProject() |
|
82 | self.saveProject() | |
82 |
|
83 | |||
83 | @pyqtSignature("") |
|
84 | @pyqtSignature("") | |
84 | def on_actionClose_triggered(self): |
|
85 | def on_actionClose_triggered(self): | |
85 | """ |
|
86 | """ | |
86 | Slot documentation goes here. |
|
87 | Slot documentation goes here. | |
87 | """ |
|
88 | """ | |
88 | self.close() |
|
89 | self.close() | |
89 |
|
90 | |||
90 | def on_actionStart_triggered(self): |
|
91 | def on_actionStart_triggered(self): | |
91 | """ |
|
92 | """ | |
92 | """ |
|
93 | """ | |
93 | self.playProject() |
|
94 | self.playProject() | |
94 |
|
95 | |||
95 | @pyqtSignature("") |
|
96 | @pyqtSignature("") | |
96 | def on_actionCreateToolbar_triggered(self): |
|
97 | def on_actionCreateToolbar_triggered(self): | |
97 | """ |
|
98 | """ | |
98 | Slot documentation goes here. |
|
99 | Slot documentation goes here. | |
99 | """ |
|
100 | """ | |
100 | self.setProjectParam() |
|
101 | self.setProjectParam() | |
101 |
|
102 | |||
102 | @pyqtSignature("") |
|
103 | @pyqtSignature("") | |
103 | def on_actionSaveToolbar_triggered(self): |
|
104 | def on_actionSaveToolbar_triggered(self): | |
104 | """ |
|
105 | """ | |
105 | Slot documentation goes here. |
|
106 | Slot documentation goes here. | |
106 | """ |
|
107 | """ | |
107 | self.saveProject() |
|
108 | self.saveProject() | |
108 |
|
109 | |||
109 | @pyqtSignature("") |
|
110 | @pyqtSignature("") | |
110 | def on_actionStarToolbar_triggered(self): |
|
111 | def on_actionStarToolbar_triggered(self): | |
111 | """ |
|
112 | """ | |
112 | Slot documentation goes here. |
|
113 | Slot documentation goes here. | |
113 | """ |
|
114 | """ | |
114 | self.playProject() |
|
115 | self.playProject() | |
115 |
|
116 | |||
116 |
|
117 | |||
117 | @pyqtSignature("int") |
|
118 | @pyqtSignature("int") | |
118 | def on_proComReadMode_activated(self, p0): |
|
119 | def on_proComReadMode_activated(self, p0): | |
119 | """ |
|
120 | """ | |
120 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
121 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
121 | """ |
|
122 | """ | |
122 | if p0==0: |
|
123 | if p0==0: | |
123 | self.online=0 |
|
124 | self.online=0 | |
124 | self.proDelay.setText("0") |
|
125 | self.proDelay.setText("0") | |
125 | self.proDelay.setEnabled(False) |
|
126 | self.proDelay.setEnabled(False) | |
126 | elif p0==1: |
|
127 | elif p0==1: | |
127 | self.online=1 |
|
128 | self.online=1 | |
128 | self.proDelay.setText("5") |
|
129 | self.proDelay.setText("5") | |
129 | self.proDelay.setEnabled(True) |
|
130 | self.proDelay.setEnabled(True) | |
130 | self.console.clear() |
|
131 | self.console.clear() | |
131 | self.console.append("Choose the type of Walk") |
|
132 | self.console.append("Choose the type of Walk") | |
132 |
|
133 | |||
133 |
|
134 | |||
134 |
|
135 | |||
135 | @pyqtSignature("int") |
|
136 | @pyqtSignature("int") | |
136 | def on_proComDataType_activated(self,index): |
|
137 | def on_proComDataType_activated(self,index): | |
137 | """ |
|
138 | """ | |
138 | Voltage or Spectra |
|
139 | Voltage or Spectra | |
139 | """ |
|
140 | """ | |
140 | if index==0: |
|
141 | if index==0: | |
141 | self.datatype='.r' |
|
142 | self.datatype='.r' | |
142 | elif index==1: |
|
143 | elif index==1: | |
143 | self.datatype='.pdata' |
|
144 | self.datatype='.pdata' | |
144 |
|
145 | |||
145 | self.proDataType.setText(self.datatype) |
|
146 | self.proDataType.setText(self.datatype) | |
146 | self.console.clear() |
|
147 | self.console.clear() | |
147 | self.console.append("Choose your DataPath") |
|
148 | self.console.append("Choose your DataPath") | |
148 | self.console.append("Use the toolpath or Write the path") |
|
149 | self.console.append("Use the toolpath or Write the path") | |
149 |
|
150 | |||
150 | @pyqtSignature("int") |
|
151 | @pyqtSignature("int") | |
151 | def on_proComWalk_activated(self,index): |
|
152 | def on_proComWalk_activated(self,index): | |
152 | """ |
|
153 | """ | |
153 |
|
154 | |||
154 | """ |
|
155 | """ | |
155 | if index==0: |
|
156 | if index==0: | |
156 | self.walk=0 |
|
157 | self.walk=0 | |
157 | elif index==1: |
|
158 | elif index==1: | |
158 | self.walk=1 |
|
159 | self.walk=1 | |
159 |
|
160 | |||
160 | self.console.clear() |
|
161 | self.console.clear() | |
161 | self.console.append("If you have choose online mode write the delay") |
|
162 | self.console.append("If you have choose online mode write the delay") | |
162 | self.console.append("Now, Push the Button Load to charge the date") |
|
163 | self.console.append("Now, Push the Button Load to charge the date") | |
163 |
|
164 | |||
164 | @pyqtSignature("") |
|
165 | @pyqtSignature("") | |
165 | def on_proToolPath_clicked(self): |
|
166 | def on_proToolPath_clicked(self): | |
166 | """ |
|
167 | """ | |
167 | Choose your path |
|
168 | Choose your path | |
168 | """ |
|
169 | """ | |
169 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
170 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
170 | self.proDataPath.setText(self.dataPath) |
|
171 | self.proDataPath.setText(self.dataPath) | |
171 |
|
172 | |||
172 | self.proComStartDate.clear() |
|
173 | self.proComStartDate.clear() | |
173 | self.proComEndDate.clear() |
|
174 | self.proComEndDate.clear() | |
174 |
|
175 | |||
175 | if not os.path.exists(self.dataPath): |
|
176 | if not os.path.exists(self.dataPath): | |
176 | self.proOk.setEnabled(False) |
|
177 | self.proOk.setEnabled(False) | |
177 | self.console.clear() |
|
178 | self.console.clear() | |
178 | self.console.append("Write a correct a path") |
|
179 | self.console.append("Write a correct a path") | |
179 | return |
|
180 | return | |
180 | self.console.clear() |
|
181 | self.console.clear() | |
181 | self.console.append("Select the read mode") |
|
182 | self.console.append("Select the read mode") | |
182 |
|
183 | |||
183 |
|
184 | |||
184 | @pyqtSignature("") |
|
185 | @pyqtSignature("") | |
185 | def on_proLoadButton_clicked(self): |
|
186 | def on_proLoadButton_clicked(self): | |
186 | self.proOk.setEnabled(True) |
|
187 | self.proOk.setEnabled(True) | |
187 | self.console.clear() |
|
188 | self.console.clear() | |
188 | self.console.append("You will see the range of date Load") |
|
189 | self.console.append("You will see the range of date Load") | |
189 | self.console.append("First,Don't forget to Choose the Read Mode: OffLine or Online") |
|
190 | self.console.append("First,Don't forget to Choose the Read Mode: OffLine or Online") | |
190 | self.console.append("The option delay is for default 0") |
|
191 | self.console.append("The option delay is for default 0") | |
191 | self.loadDays() |
|
192 | self.loadDays() | |
192 |
|
193 | |||
193 |
|
194 | |||
194 | @pyqtSignature("int") |
|
195 | @pyqtSignature("int") | |
195 | def on_proComStartDate_activated(self, index): |
|
196 | def on_proComStartDate_activated(self, index): | |
196 | """ |
|
197 | """ | |
197 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
198 | SELECCION DEL RANGO DE FECHAS -START DATE | |
198 | """ |
|
199 | """ | |
199 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() |
|
200 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() | |
200 | self.proComEndDate.clear() |
|
201 | self.proComEndDate.clear() | |
201 |
|
202 | |||
202 | for i in self.dateList[index:]: |
|
203 | for i in self.dateList[index:]: | |
203 | self.proComEndDate.addItem(i) |
|
204 | self.proComEndDate.addItem(i) | |
204 |
|
205 | |||
205 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) |
|
206 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex) | |
206 |
|
207 | |||
207 | @pyqtSignature("int") |
|
208 | @pyqtSignature("int") | |
208 | def on_proComEndDate_activated(self, index): |
|
209 | def on_proComEndDate_activated(self, index): | |
209 | """ |
|
210 | """ | |
210 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
211 | SELECCION DEL RANGO DE FECHAS-END DATE | |
211 | """ |
|
212 | """ | |
212 | startIndex=self.proComStartDate.currentIndex() |
|
213 | startIndex=self.proComStartDate.currentIndex() | |
213 | stopIndex = self.proComEndDate.count() - index |
|
214 | stopIndex = self.proComEndDate.count() - index | |
214 | self.proComStartDate.clear() |
|
215 | self.proComStartDate.clear() | |
215 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: |
|
216 | for i in self.dateList[:len(self.dateList) - stopIndex + 1]: | |
216 | self.proComStartDate.addItem(i) |
|
217 | self.proComStartDate.addItem(i) | |
217 | self.proComStartDate.setCurrentIndex(startIndex) |
|
218 | self.proComStartDate.setCurrentIndex(startIndex) | |
218 |
|
219 | |||
219 | @pyqtSignature("") |
|
220 | @pyqtSignature("") | |
220 | def on_proOk_clicked(self): |
|
221 | def on_proOk_clicked(self): | |
221 | """ |
|
222 | """ | |
222 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
223 | Añade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
223 | Prepara la configuración del diágrama del Arbol del treeView numero 2 |
|
224 | Prepara la configuración del diágrama del Arbol del treeView numero 2 | |
224 | """ |
|
225 | """ | |
|
226 | ||||
225 | self.console.clear() |
|
227 | self.console.clear() | |
226 | self.idp +=1 |
|
228 | self.idp +=1 | |
227 | self.projectObj= Project () |
|
229 | self.projectObj= Project () | |
228 | self.__projObjDict[self.idp]=self.projectObj |
|
230 | self.__projObjDict[self.idp]=self.projectObj | |
229 |
|
||||
230 | id = self.idp |
|
231 | id = self.idp | |
231 | name = str(self.proName.text()) |
|
232 | name = str(self.proName.text()) | |
232 | try: |
|
233 | try: | |
233 | name=str(self.proName.text()) |
|
234 | name=str(self.proName.text()) | |
234 | except: |
|
235 | except: | |
235 | self.console.clear() |
|
236 | self.console.clear() | |
236 | self.console.append("Please Write a name") |
|
237 | self.console.append("Please Write a name") | |
237 | return 0 |
|
238 | return 0 | |
238 |
|
239 | |||
239 |
|
240 | |||
240 | desc=str(self.proDescription.toPlainText()) |
|
241 | desc=str(self.proDescription.toPlainText()) | |
241 | self.projectObj.setup(id = id, name=name, description=desc) |
|
242 | self.projectObj.setup(id = id, name=name, description=desc) | |
242 | datatype = str(self.proComDataType.currentText()) |
|
243 | datatype = str(self.proComDataType.currentText()) | |
243 | path = str(self.proDataPath.text()) |
|
244 | path = str(self.proDataPath.text()) | |
244 | #path='C://data3' |
|
245 | if not os.path.exists(path): | |
|
246 | self.proOk.setEnabled(False) | |||
|
247 | self.console.clear() | |||
|
248 | self.console.append("Write a correct a path") | |||
|
249 | return | |||
|
250 | ||||
245 | online = int(self.online) |
|
251 | online = int(self.online) | |
246 | if online ==0: |
|
252 | if online ==0: | |
247 | delay=0 |
|
253 | delay=0 | |
248 | else: |
|
254 | else: | |
249 | delay=self.proDelay.text() |
|
255 | delay=self.proDelay.text() | |
250 | try: |
|
256 | try: | |
251 | delay=int(self.proDelay.text()) |
|
257 | delay=int(self.proDelay.text()) | |
252 | except: |
|
258 | except: | |
253 | self.console.clear() |
|
259 | self.console.clear() | |
254 | self.console.append("Please Write a number for delay") |
|
260 | self.console.append("Please Write a number for delay") | |
255 | return 0 |
|
261 | return 0 | |
256 |
|
262 | |||
257 | walk = int(self.walk) |
|
263 | walk = int(self.walk) | |
258 | starDate = str(self.proComStartDate.currentText()) |
|
264 | starDate = str(self.proComStartDate.currentText()) | |
259 | endDate = str(self.proComEndDate.currentText()) |
|
265 | endDate = str(self.proComEndDate.currentText()) | |
260 | reloj1=self.proStartTime.time() |
|
266 | reloj1=self.proStartTime.time() | |
261 | reloj2=self.proEndTime.time() |
|
267 | reloj2=self.proEndTime.time() | |
262 |
|
268 | |||
263 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype, |
|
269 | self.readUnitConfObj = self.projectObj.addReadUnit(datatype = datatype, | |
264 | path = path, |
|
270 | path = path, | |
265 | startDate = starDate, |
|
271 | startDate = starDate, | |
266 | endDate = endDate, |
|
272 | endDate = endDate, | |
267 | startTime= str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), |
|
273 | startTime= str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
268 | endTime= str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), |
|
274 | endTime= str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
269 | online= online, |
|
275 | online= online, | |
270 | delay=delay, |
|
276 | delay=delay, | |
271 | walk= walk) |
|
277 | walk= walk) | |
272 | self.readUnitConfObjList.append(self.readUnitConfObj) |
|
278 | self.readUnitConfObjList.append(self.readUnitConfObj) | |
273 |
|
279 | |||
274 | #Project Explorer |
|
280 | #Project Explorer | |
275 | self.parentItem=self.model.invisibleRootItem() |
|
281 | self.parentItem=self.model.invisibleRootItem() | |
276 | self.__arbolDict[self.idp] =QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) |
|
282 | self.__arbolDict[self.idp] =QtGui.QStandardItem(QtCore.QString(name).arg(self.idp)) | |
277 | self.parentItem.appendRow(self.__arbolDict[self.idp]) |
|
283 | self.parentItem.appendRow(self.__arbolDict[self.idp]) | |
278 | self.parentItem=self.__arbolDict[self.idp] |
|
284 | self.parentItem=self.__arbolDict[self.idp] | |
279 |
|
285 | |||
280 | #Project Properties |
|
286 | #Project Properties | |
281 | self.model_2=treeModel() |
|
287 | self.model_2=treeModel() | |
282 | self.model_2.setParams(name = self.projectObj.name, |
|
288 | self.model_2.setParams(name = self.projectObj.name, | |
283 | directorio = path, |
|
289 | directorio = path, | |
284 | workspace = self.pathWorkSpace, |
|
290 | workspace = self.pathWorkSpace, | |
285 | remode = str(self.proComReadMode.currentText()), |
|
291 | remode = str(self.proComReadMode.currentText()), | |
286 | dataformat = datatype, |
|
292 | dataformat = datatype, | |
287 | date = str(starDate)+"-"+str(endDate), |
|
293 | date = str(starDate)+"-"+str(endDate), | |
288 | initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), |
|
294 | initTime = str(reloj1.hour()) +":"+str(reloj1.minute())+":"+ str(reloj1.second()), | |
289 | endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), |
|
295 | endTime = str(reloj2.hour()) +":"+str(reloj2.minute())+":"+ str(reloj2.second()), | |
290 | timezone = "Local" , |
|
296 | timezone = "Local" , | |
291 | Summary = desc) |
|
297 | Summary = desc) | |
292 |
|
298 | |||
293 | self.treeProjectProperties.setModel(self.model_2) |
|
299 | self.treeProjectProperties.setModel(self.model_2) | |
294 | self.treeProjectProperties.expandAll() |
|
300 | self.treeProjectProperties.expandAll() | |
295 |
|
301 | |||
296 | #Disable tabProject after finish the creation |
|
302 | #Disable tabProject after finish the creation | |
297 | self.tabProject.setEnabled(False) |
|
303 | self.tabProject.setEnabled(False) | |
298 | self.console.clear() |
|
304 | # self.console.clear() | |
299 | self.console.append("Now you can add a Unit Processing") |
|
305 | # self.console.append("Now you can add a Unit Processing") | |
300 | self.console.append("If you want to save your project") |
|
306 | # self.console.append("If you want to save your project") | |
301 | self.console.append("click on your project name in the Tree Project Explorer") |
|
307 | # self.console.append("click on your project name in the Tree Project Explorer") | |
302 |
|
308 | # | ||
303 |
|
309 | |||
304 | @pyqtSignature("") |
|
310 | @pyqtSignature("") | |
305 | def on_proClear_clicked(self): |
|
311 | def on_proClear_clicked(self): | |
306 | self.setProjectParam() |
|
312 | self.setProjectParam() | |
307 | #----------------Voltage Operation-------------------# |
|
313 | #----------------Voltage Operation-------------------# | |
308 |
|
314 | |||
309 | @pyqtSignature("int") |
|
315 | @pyqtSignature("int") | |
310 | def on_volOpCebChannels_stateChanged(self, p0): |
|
316 | def on_volOpCebChannels_stateChanged(self, p0): | |
311 | """ |
|
317 | """ | |
312 | Check Box habilita operaciones de Selecci�n de Canales |
|
318 | Check Box habilita operaciones de Selecci�n de Canales | |
313 | """ |
|
319 | """ | |
314 | if p0==2: |
|
320 | if p0==2: | |
315 | self.volOpComChannels.setEnabled(True) |
|
321 | self.volOpComChannels.setEnabled(True) | |
316 | self.volOpChannel.setEnabled(True) |
|
322 | self.volOpChannel.setEnabled(True) | |
317 |
|
323 | |||
318 | if p0==0: |
|
324 | if p0==0: | |
319 | self.volOpComChannels.setEnabled(False) |
|
325 | self.volOpComChannels.setEnabled(False) | |
320 | self.volOpChannel.setEnabled(False) |
|
326 | self.volOpChannel.setEnabled(False) | |
321 |
|
327 | |||
322 |
|
328 | |||
323 | @pyqtSignature("int") |
|
329 | @pyqtSignature("int") | |
324 | def on_volOpCebHeights_stateChanged(self, p0): |
|
330 | def on_volOpCebHeights_stateChanged(self, p0): | |
325 | """ |
|
331 | """ | |
326 | Check Box habilita operaciones de Selecci�n de Alturas |
|
332 | Check Box habilita operaciones de Selecci�n de Alturas | |
327 | """ |
|
333 | """ | |
328 | if p0==2: |
|
334 | if p0==2: | |
329 | self.volOpHeights.setEnabled(True) |
|
335 | self.volOpHeights.setEnabled(True) | |
330 | self.volOpComHeights.setEnabled(True) |
|
336 | self.volOpComHeights.setEnabled(True) | |
331 |
|
337 | |||
332 | if p0==0: |
|
338 | if p0==0: | |
333 | self.volOpHeights.setEnabled(False) |
|
339 | self.volOpHeights.setEnabled(False) | |
334 | self.volOpComHeights.setEnabled(False) |
|
340 | self.volOpComHeights.setEnabled(False) | |
335 |
|
341 | |||
336 | @pyqtSignature("int") |
|
342 | @pyqtSignature("int") | |
337 | def on_volOpCebFilter_stateChanged(self, p0): |
|
343 | def on_volOpCebFilter_stateChanged(self, p0): | |
338 | """ |
|
344 | """ | |
339 | Name='Decoder', optype='other' |
|
345 | Name='Decoder', optype='other' | |
340 | """ |
|
346 | """ | |
341 | if p0==2: |
|
347 | if p0==2: | |
342 | self.volOpFilter.setEnabled(True) |
|
348 | self.volOpFilter.setEnabled(True) | |
343 |
|
349 | |||
344 | if p0==0: |
|
350 | if p0==0: | |
345 | self.volOpFilter.setEnabled(False) |
|
351 | self.volOpFilter.setEnabled(False) | |
346 |
|
352 | |||
347 | @pyqtSignature("int") |
|
353 | @pyqtSignature("int") | |
348 | def on_volOpCebProfile_stateChanged(self, p0): |
|
354 | def on_volOpCebProfile_stateChanged(self, p0): | |
349 | """ |
|
355 | """ | |
350 | Check Box habilita ingreso del rango de Perfiles |
|
356 | Check Box habilita ingreso del rango de Perfiles | |
351 | """ |
|
357 | """ | |
352 | if p0==2: |
|
358 | if p0==2: | |
353 | self.volOpComProfile.setEnabled(True) |
|
359 | self.volOpComProfile.setEnabled(True) | |
354 | self.volOpProfile.setEnabled(True) |
|
360 | self.volOpProfile.setEnabled(True) | |
355 |
|
361 | |||
356 | if p0==0: |
|
362 | if p0==0: | |
357 | self.volOpComProfile.setEnabled(False) |
|
363 | self.volOpComProfile.setEnabled(False) | |
358 | self.volOpProfile.setEnabled(False) |
|
364 | self.volOpProfile.setEnabled(False) | |
359 |
|
365 | |||
360 | @pyqtSignature("int") |
|
366 | @pyqtSignature("int") | |
361 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
367 | def on_volOpCebDecodification_stateChanged(self, p0): | |
362 | """ |
|
368 | """ | |
363 | Check Box habilita |
|
369 | Check Box habilita | |
364 | """ |
|
370 | """ | |
365 | if p0==2: |
|
371 | if p0==2: | |
366 | self.volOpComCode.setEnabled(True) |
|
372 | self.volOpComCode.setEnabled(True) | |
367 | self.volOpComMode.setEnabled(True) |
|
373 | self.volOpComMode.setEnabled(True) | |
368 |
|
374 | |||
369 | if p0==0: |
|
375 | if p0==0: | |
370 | self.volOpComCode.setEnabled(False) |
|
376 | self.volOpComCode.setEnabled(False) | |
371 | self.volOpComMode.setEnabled(False) |
|
377 | self.volOpComMode.setEnabled(False) | |
372 |
|
378 | |||
373 |
|
379 | |||
374 | @pyqtSignature("int") |
|
380 | @pyqtSignature("int") | |
375 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
381 | def on_volOpCebCohInt_stateChanged(self, p0): | |
376 | """ |
|
382 | """ | |
377 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
383 | Check Box habilita ingresode del numero de Integraciones a realizar | |
378 | """ |
|
384 | """ | |
379 | if p0==2: |
|
385 | if p0==2: | |
380 | self.volOpCohInt.setEnabled(True) |
|
386 | self.volOpCohInt.setEnabled(True) | |
381 | if p0==0: |
|
387 | if p0==0: | |
382 | self.volOpCohInt.setEnabled(False) |
|
388 | self.volOpCohInt.setEnabled(False) | |
383 |
|
389 | |||
384 |
|
390 | |||
385 |
|
391 | |||
386 |
|
392 | |||
387 | @pyqtSignature("") |
|
393 | @pyqtSignature("") | |
388 | def on_volOpOk_clicked(self): |
|
394 | def on_volOpOk_clicked(self): | |
389 | """ |
|
395 | """ | |
390 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES A�ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
396 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES A�ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
391 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
397 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
392 | """ |
|
398 | """ | |
393 | for i in self.__arbolDict: |
|
399 | for i in self.__arbolDict: | |
394 | if self.__arbolDict[i]==self.indexclick: |
|
400 | if self.__arbolDict[i]==self.indexclick: | |
395 | if self.__upObjDict.has_key(i)==True: |
|
401 | if self.__upObjDict.has_key(i)==True: | |
396 | self.upObj=self.__upObjDict[i] |
|
402 | self.upObj=self.__upObjDict[i] | |
397 |
|
403 | |||
398 | if self.volOpCebChannels.isChecked(): |
|
404 | if self.volOpCebChannels.isChecked(): | |
399 | if self.volOpComChannels.currentIndex()== 0: |
|
405 | if self.volOpComChannels.currentIndex()== 0: | |
400 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
406 | opObj10=self.upObj.addOperation(name="selectChannels") | |
401 | self.operObjList.append(opObj10) |
|
407 | self.operObjList.append(opObj10) | |
402 | value=self.volOpChannel.text() |
|
408 | value=self.volOpChannel.text() | |
403 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
409 | opObj10.addParameter(name='channelList', value=value, format='intlist') | |
404 | else: |
|
410 | else: | |
405 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
411 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") | |
406 | self.operObjList.append(opObj10) |
|
412 | self.operObjList.append(opObj10) | |
407 | value=self.volOpChannel.text() |
|
413 | value=self.volOpChannel.text() | |
408 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
414 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
409 |
|
415 | |||
410 | if self.volOpCebHeights.isChecked(): |
|
416 | if self.volOpCebHeights.isChecked(): | |
411 | if self.volOpComHeights.currentIndex()== 0: |
|
417 | if self.volOpComHeights.currentIndex()== 0: | |
412 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
418 | opObj10=self.upObj.addOperation(name='selectHeights') | |
413 | value=self.volOpHeights.text() |
|
419 | value=self.volOpHeights.text() | |
414 | valueList=value.split(',') |
|
420 | valueList=value.split(',') | |
415 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
421 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') | |
416 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
422 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') | |
417 | else: |
|
423 | else: | |
418 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
424 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') | |
419 | value=self.volOpHeights.text() |
|
425 | value=self.volOpHeights.text() | |
420 | valueList=value.split(',') |
|
426 | valueList=value.split(',') | |
421 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
427 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') | |
422 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
428 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') | |
423 |
|
429 | |||
424 | if self.volOpCebFilter.isChecked(): |
|
430 | if self.volOpCebFilter.isChecked(): | |
425 | opObj10=self.upObj.addOperation(name='filterByHeights') |
|
431 | opObj10=self.upObj.addOperation(name='filterByHeights') | |
426 | value=self.volOpFilter.text() |
|
432 | value=self.volOpFilter.text() | |
427 | opObj10.addParameter(name='window', value=value, format='int') |
|
433 | opObj10.addParameter(name='window', value=value, format='int') | |
428 |
|
434 | |||
429 | if self.volOpCebProfile.isChecked(): |
|
435 | if self.volOpCebProfile.isChecked(): | |
430 | opObj10=self.upObj.addOperation(name='ProfileSelector', optype='other') |
|
436 | opObj10=self.upObj.addOperation(name='ProfileSelector', optype='other') | |
431 | if self.volOpComProfile.currentIndex()== 0: |
|
437 | if self.volOpComProfile.currentIndex()== 0: | |
432 | self.operObjList.append(opObj10) |
|
438 | self.operObjList.append(opObj10) | |
433 | value=self.volOpProfile.text() |
|
439 | value=self.volOpProfile.text() | |
434 | opObj10.addParameter(name='profileList', value=value, format='intlist') |
|
440 | opObj10.addParameter(name='profileList', value=value, format='intlist') | |
435 | else: |
|
441 | else: | |
436 | self.operObjList.append(opObj10) |
|
442 | self.operObjList.append(opObj10) | |
437 | value=self.volOpProfile.text() |
|
443 | value=self.volOpProfile.text() | |
438 | opObj10.addParameter(name='profileRangeList', value=value, format='intlist') |
|
444 | opObj10.addParameter(name='profileRangeList', value=value, format='intlist') | |
439 |
|
445 | |||
440 | if self.volOpCebDecodification.isChecked(): |
|
446 | if self.volOpCebDecodification.isChecked(): | |
441 | opObj10=self.upObj.addOperation(name='Decoder', optype='other') |
|
447 | opObj10=self.upObj.addOperation(name='Decoder', optype='other') | |
442 | if self.volOpComCode.currentIndex()==0: |
|
448 | if self.volOpComCode.currentIndex()==0: | |
443 | opObj10.addParameter(name='code', value='1,1,-1,-1,-1,1', format='floatlist') |
|
449 | opObj10.addParameter(name='code', value='1,1,-1,-1,-1,1', format='floatlist') | |
444 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
450 | opObj10.addParameter(name='nCode', value='2', format='int') | |
445 | opObj10.addParameter(name='nBaud', value='3', format='int') |
|
451 | opObj10.addParameter(name='nBaud', value='3', format='int') | |
446 | if self.volOpComCode.currentIndex()==1: |
|
452 | if self.volOpComCode.currentIndex()==1: | |
447 | opObj10.addParameter(name='code', value='1,1,−1,1,-1,-1,1,-1', format='floatlist') |
|
453 | opObj10.addParameter(name='code', value='1,1,−1,1,-1,-1,1,-1', format='floatlist') | |
448 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
454 | opObj10.addParameter(name='nCode', value='2', format='int') | |
449 | opObj10.addParameter(name='nBaud', value='4', format='int') |
|
455 | opObj10.addParameter(name='nBaud', value='4', format='int') | |
450 | if self.volOpComCode.currentIndex()==2: |
|
456 | if self.volOpComCode.currentIndex()==2: | |
451 | opObj10.addParameter(name='code', value='1,1,1,−1,1,-1,-1,-1,1,-1', format='floatlist') |
|
457 | opObj10.addParameter(name='code', value='1,1,1,−1,1,-1,-1,-1,1,-1', format='floatlist') | |
452 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
458 | opObj10.addParameter(name='nCode', value='2', format='int') | |
453 | opObj10.addParameter(name='nBaud', value='5', format='int') |
|
459 | opObj10.addParameter(name='nBaud', value='5', format='int') | |
454 | if self.volOpComCode.currentIndex()==3: |
|
460 | if self.volOpComCode.currentIndex()==3: | |
455 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,1,−1,-1,-1,-1,1,1,-1,1', format='floatlist') |
|
461 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,1,−1,-1,-1,-1,1,1,-1,1', format='floatlist') | |
456 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
462 | opObj10.addParameter(name='nCode', value='2', format='int') | |
457 | opObj10.addParameter(name='nBaud', value='7', format='int') |
|
463 | opObj10.addParameter(name='nBaud', value='7', format='int') | |
458 | if self.volOpComCode.currentIndex()==4: |
|
464 | if self.volOpComCode.currentIndex()==4: | |
459 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,−1,1,−1,−1,1,−1,-1 ,-1 ,-1 ,1 ,1 ,1 ,-1 ,1 ,1 ,-1 ,1', format='floatlist') |
|
465 | opObj10.addParameter(name='code', value='1,1,1,−1,−1,−1,1,−1,−1,1,−1,-1 ,-1 ,-1 ,1 ,1 ,1 ,-1 ,1 ,1 ,-1 ,1', format='floatlist') | |
460 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
466 | opObj10.addParameter(name='nCode', value='2', format='int') | |
461 | opObj10.addParameter(name='nBaud', value='11', format='int') |
|
467 | opObj10.addParameter(name='nBaud', value='11', format='int') | |
462 | if self.volOpComCode.currentIndex()==5: |
|
468 | if self.volOpComCode.currentIndex()==5: | |
463 | opObj10.addParameter(name='code', value='1,1,1,1,1,−1,−1,1,1,−1,1,−1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1', format='floatlist') |
|
469 | opObj10.addParameter(name='code', value='1,1,1,1,1,−1,−1,1,1,−1,1,−1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1', format='floatlist') | |
464 | opObj10.addParameter(name='nCode', value='2', format='int') |
|
470 | opObj10.addParameter(name='nCode', value='2', format='int') | |
465 | opObj10.addParameter(name='nBaud', value='13', format='int') |
|
471 | opObj10.addParameter(name='nBaud', value='13', format='int') | |
466 |
|
472 | |||
467 | if self.volOpComMode.currentIndex()==0: |
|
473 | if self.volOpComMode.currentIndex()==0: | |
468 | opObj10.addParameter(name='mode', value='0', format='int') |
|
474 | opObj10.addParameter(name='mode', value='0', format='int') | |
469 |
|
475 | |||
470 | if self.volOpComMode.currentIndex()==1: |
|
476 | if self.volOpComMode.currentIndex()==1: | |
471 | opObj10.addParameter(name='mode', value='1', format='int') |
|
477 | opObj10.addParameter(name='mode', value='1', format='int') | |
472 |
|
478 | |||
473 | if self.volOpComMode.currentIndex()==2: |
|
479 | if self.volOpComMode.currentIndex()==2: | |
474 | opObj10.addParameter(name='mode', value='2', format='int') |
|
480 | opObj10.addParameter(name='mode', value='2', format='int') | |
475 |
|
481 | |||
476 | if self.volOpCebCohInt.isChecked(): |
|
482 | if self.volOpCebCohInt.isChecked(): | |
477 | opObj10=self.upObj.addOperation(name='CohInt', optype='other') |
|
483 | opObj10=self.upObj.addOperation(name='CohInt', optype='other') | |
478 | self.operObjList.append(opObj10) |
|
484 | self.operObjList.append(opObj10) | |
479 | value=self.volOpCohInt.text() |
|
485 | value=self.volOpCohInt.text() | |
480 | opObj10.addParameter(name='n', value=value, format='int') |
|
486 | opObj10.addParameter(name='n', value=value, format='int') | |
481 | #self.tabopVoltage.setEnabled(False) |
|
487 | #self.tabopVoltage.setEnabled(False) | |
482 | self.console.clear() |
|
488 | self.console.clear() | |
483 | self.console.append("If you want to save your project") |
|
489 | self.console.append("If you want to save your project") | |
484 | self.console.append("click on your project name in the Tree Project Explorer") |
|
490 | self.console.append("click on your project name in the Tree Project Explorer") | |
485 |
|
491 | |||
486 | #----------------Voltage Graph-------------------# |
|
492 | #----------------Voltage Graph-------------------# | |
487 | @pyqtSignature("int") |
|
493 | @pyqtSignature("int") | |
488 | def on_volGraphCebSave_stateChanged(self, p0): |
|
494 | def on_volGraphCebSave_stateChanged(self, p0): | |
489 | """ |
|
495 | """ | |
490 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
496 | Check Box habilita ingresode del numero de Integraciones a realizar | |
491 | """ |
|
497 | """ | |
492 | if p0==2: |
|
498 | if p0==2: | |
493 | self.volGraphPath.setEnabled(True) |
|
499 | self.volGraphPath.setEnabled(True) | |
494 | self.volGraphPrefix.setEnabled(True) |
|
500 | self.volGraphPrefix.setEnabled(True) | |
495 | self.volGraphToolPath.setEnabled(True) |
|
501 | self.volGraphToolPath.setEnabled(True) | |
496 |
|
502 | |||
497 | if p0==0: |
|
503 | if p0==0: | |
498 | self.volGraphPath.setEnabled(False) |
|
504 | self.volGraphPath.setEnabled(False) | |
499 | self.volGraphPrefix.setEnabled(False) |
|
505 | self.volGraphPrefix.setEnabled(False) | |
500 | self.volGraphToolPath.setEnabled(False) |
|
506 | self.volGraphToolPath.setEnabled(False) | |
501 |
|
507 | |||
502 | @pyqtSignature("") |
|
508 | @pyqtSignature("") | |
503 | def on_volGraphToolPath_clicked(self): |
|
509 | def on_volGraphToolPath_clicked(self): | |
504 | """ |
|
510 | """ | |
505 | Donde se guardan los DATOS |
|
511 | Donde se guardan los DATOS | |
506 | """ |
|
512 | """ | |
507 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
513 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
508 | self.volGraphPath.setText(self.dataPath) |
|
514 | self.volGraphPath.setText(self.dataPath) | |
509 |
|
515 | |||
510 | if not os.path.exists(self.dataPath): |
|
516 | if not os.path.exists(self.dataPath): | |
511 | self.volGraphOk.setEnabled(False) |
|
517 | self.volGraphOk.setEnabled(False) | |
512 | return |
|
518 | return | |
513 |
|
519 | |||
514 |
|
||||
515 | @pyqtSignature("int") |
|
520 | @pyqtSignature("int") | |
516 |
def on_volGraphC |
|
521 | def on_volGraphCebshow_stateChanged(self, p0): | |
517 | """ |
|
522 | """ | |
518 | Metodo que identifica que tipo de dato se va a trabajar VOLTAGE O ESPECTRA |
|
523 | Check Box habilita ingresode del numero de Integraciones a realizar | |
519 | """ |
|
524 | """ | |
520 |
if |
|
525 | if p0==0: | |
521 | self.volGraphIdFigure.setEnabled(False) |
|
526 | ||
522 | self.volGraphWintitle.setEnabled(False) |
|
|||
523 | self.volGraphChannelList.setEnabled(False) |
|
527 | self.volGraphChannelList.setEnabled(False) | |
524 |
self.volGraph |
|
528 | self.volGraphfreqrange.setEnabled(False) | |
525 |
self.volGraph |
|
529 | self.volGraphHeightrange.setEnabled(False) | |
526 |
if |
|
530 | if p0==2: | |
527 | self.volGraphIdFigure.setEnabled(True) |
|
531 | ||
528 | self.volGraphWintitle.setEnabled(True) |
|
|||
529 | self.volGraphChannelList.setEnabled(True) |
|
532 | self.volGraphChannelList.setEnabled(True) | |
530 |
self.volGraph |
|
533 | self.volGraphfreqrange.setEnabled(True) | |
531 |
self.volGraph |
|
534 | self.volGraphHeightrange.setEnabled(True) | |
|
535 | self.idImag += 1 | |||
|
536 | print self.idImag | |||
|
537 | ||||
532 |
|
538 | |||
533 | @pyqtSignature(" ") |
|
539 | @pyqtSignature(" ") | |
534 | def on_volGraphOk_clicked(self): |
|
540 | def on_volGraphOk_clicked(self): | |
535 | """ |
|
541 | """ | |
536 | GRAPH |
|
542 | GRAPH | |
537 | """ |
|
543 | """ | |
538 | for i in self.__arbolDict: |
|
544 | for i in self.__arbolDict: | |
539 | if self.__arbolDict[i]==self.indexclick: |
|
545 | if self.__arbolDict[i]==self.indexclick: | |
540 | if self.__upObjDict.has_key(i)==True: |
|
546 | if self.__upObjDict.has_key(i)==True: | |
541 | self.upObj=self.__upObjDict[i] |
|
547 | self.upObj=self.__upObjDict[i] | |
542 |
|
548 | |||
543 |
if self.volGraphC |
|
549 | if self.volGraphCebshow.isChecked(): | |
544 | opObj10=self.upObj.addOperation(name='Scope', optype='other') |
|
550 | opObj10=self.upObj.addOperation(name='Scope', optype='other') | |
545 | self.operObjList.append(opObj10) |
|
551 | self.operObjList.append(opObj10) | |
546 | wintitle=self.volGraphWintitle.text() |
|
|||
547 | channelList=self.volGraphChannelList.text() |
|
552 | channelList=self.volGraphChannelList.text() | |
548 |
xvalue= self.volGraph |
|
553 | xvalue= self.volGraphfreqrange.text() | |
549 |
yvalue= self.volGraph |
|
554 | yvalue= self.volGraphHeightrange.text() | |
550 |
|
555 | |||
551 |
opObj1 |
|
556 | opObj1.addParameter(name='idfigure', value=int(self.idImag), format='int') | |
552 | opObj10.addParameter(name='channelList', value=channelList, format='int') |
|
557 | opObj10.addParameter(name='channelList', value=channelList, format='int') | |
553 | xvalueList=xvalue.split(',') |
|
558 | xvalueList=xvalue.split(',') | |
554 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
559 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |
555 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
560 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |
556 | yvalueList=yvalue.split(",") |
|
561 | yvalueList=yvalue.split(",") | |
557 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
562 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |
558 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
563 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |
559 |
|
564 | |||
560 | if self.volGraphCebSave.isChecked(): |
|
565 | if self.volGraphCebSave.isChecked(): | |
561 | opObj10.addParameter(name='save', value='1', format='int') |
|
566 | opObj10.addParameter(name='save', value='1', format='int') | |
562 | opObj10.addParameter(name='figpath', value= self.volGraphPath.text()) |
|
567 | opObj10.addParameter(name='figpath', value= self.volGraphPath.text()) | |
563 | opObj10.addParameter(name='figfile', value= self.volGraphPrefix.text()) |
|
568 | opObj10.addParameter(name='figfile', value= self.volGraphPrefix.text()) | |
|
569 | ||||
564 | self.tabgraphVoltage.setEnabled(False) |
|
570 | self.tabgraphVoltage.setEnabled(False) | |
565 | self.console.clear() |
|
571 | self.console.clear() | |
566 | self.console.append("If you want to save your project") |
|
572 | self.console.append("If you want to save your project") | |
567 | self.console.append("click on your project name in the Tree Project Explorer") |
|
573 | self.console.append("click on your project name in the Tree Project Explorer") | |
568 |
|
|
574 | ||
569 | #------Spectra operation--------# |
|
575 | #------Spectra operation--------# | |
570 | @pyqtSignature("int") |
|
576 | @pyqtSignature("int") | |
571 | def on_specOpCebnFFTpoints_stateChanged(self, p0): |
|
577 | def on_specOpCebnFFTpoints_stateChanged(self, p0): | |
572 | """ |
|
578 | """ | |
573 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
579 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
574 | """ |
|
580 | """ | |
575 | if p0==2: |
|
581 | if p0==2: | |
576 | self.specOpnFFTpoints.setEnabled(True) |
|
582 | self.specOpnFFTpoints.setEnabled(True) | |
577 | self.specOppairsList.setEnabled(True) |
|
583 | self.specOppairsList.setEnabled(True) | |
578 | if p0==0: |
|
584 | if p0==0: | |
579 | self.specOpnFFTpoints.setEnabled(False) |
|
585 | self.specOpnFFTpoints.setEnabled(False) | |
580 | self.specOppairsList.setEnabled(False) |
|
586 | self.specOppairsList.setEnabled(False) | |
581 |
|
587 | |||
582 | @pyqtSignature("int") |
|
588 | @pyqtSignature("int") | |
583 | def on_specOpCebChannel_stateChanged(self, p0): |
|
589 | def on_specOpCebChannel_stateChanged(self, p0): | |
584 | """ |
|
590 | """ | |
585 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
591 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
586 | """ |
|
592 | """ | |
587 | if p0==2: |
|
593 | if p0==2: | |
588 | self.specOpChannel.setEnabled(True) |
|
594 | self.specOpChannel.setEnabled(True) | |
589 | self.specOpComChannel.setEnabled(True) |
|
595 | self.specOpComChannel.setEnabled(True) | |
590 | if p0==0: |
|
596 | if p0==0: | |
591 | self.specOpChannel.setEnabled(False) |
|
597 | self.specOpChannel.setEnabled(False) | |
592 | self.specOpComChannel.setEnabled(False) |
|
598 | self.specOpComChannel.setEnabled(False) | |
593 |
|
599 | |||
594 | @pyqtSignature("int") |
|
600 | @pyqtSignature("int") | |
595 | def on_specOpCebHeights_stateChanged(self, p0): |
|
601 | def on_specOpCebHeights_stateChanged(self, p0): | |
596 | """ |
|
602 | """ | |
597 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
603 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
598 | """ |
|
604 | """ | |
599 | if p0==2: |
|
605 | if p0==2: | |
600 | self.specOpComHeights.setEnabled(True) |
|
606 | self.specOpComHeights.setEnabled(True) | |
601 | self.specOpHeights.setEnabled(True) |
|
607 | self.specOpHeights.setEnabled(True) | |
602 | if p0==0: |
|
608 | if p0==0: | |
603 | self.specOpComHeights.setEnabled(False) |
|
609 | self.specOpComHeights.setEnabled(False) | |
604 | self.specOpHeights.setEnabled(False) |
|
610 | self.specOpHeights.setEnabled(False) | |
605 |
|
611 | |||
606 |
|
612 | |||
607 | @pyqtSignature("int") |
|
613 | @pyqtSignature("int") | |
608 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
614 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
609 | """ |
|
615 | """ | |
610 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
616 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
611 | """ |
|
617 | """ | |
612 | if p0==2: |
|
618 | if p0==2: | |
613 | self.specOpIncoherent.setEnabled(True) |
|
619 | self.specOpIncoherent.setEnabled(True) | |
614 | if p0==0: |
|
620 | if p0==0: | |
615 | self.specOpIncoherent.setEnabled(False) |
|
621 | self.specOpIncoherent.setEnabled(False) | |
616 |
|
622 | |||
617 | @pyqtSignature("int") |
|
623 | @pyqtSignature("int") | |
618 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
624 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
619 | """ |
|
625 | """ | |
620 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
626 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . | |
621 | """ |
|
627 | """ | |
622 | if p0==2: |
|
628 | if p0==2: | |
623 | self.specOpRemoveDC.setEnabled(True) |
|
629 | self.specOpRemoveDC.setEnabled(True) | |
624 | if p0==0: |
|
630 | if p0==0: | |
625 | self.specOpRemoveDC.setEnabled(False) |
|
631 | self.specOpRemoveDC.setEnabled(False) | |
626 |
|
632 | |||
627 | @pyqtSignature("") |
|
633 | @pyqtSignature("") | |
628 | def on_specOpOk_clicked(self): |
|
634 | def on_specOpOk_clicked(self): | |
629 | """ |
|
635 | """ | |
630 | AÑADE OPERACION SPECTRA |
|
636 | AÑADE OPERACION SPECTRA | |
631 | """ |
|
637 | """ | |
632 | for i in self.__arbolDict: |
|
638 | for i in self.__arbolDict: | |
633 | if self.__arbolDict[i]==self.indexclick: |
|
639 | if self.__arbolDict[i]==self.indexclick: | |
634 | if self.__upObjDict.has_key(i)==True: |
|
640 | if self.__upObjDict.has_key(i)==True: | |
635 | self.upObj=self.__upObjDict[i] |
|
641 | self.upObj=self.__upObjDict[i] | |
636 | # self.operObjList.append(opObj10) |
|
642 | # self.operObjList.append(opObj10) | |
637 | if self.specOpCebnFFTpoints.isChecked(): |
|
643 | if self.specOpCebnFFTpoints.isChecked(): | |
638 | value1=self.specOpnFFTpoints.text() |
|
644 | value1=self.specOpnFFTpoints.text() | |
639 | value2=self.specOppairsList.text() |
|
645 | value2=self.specOppairsList.text() | |
640 | self.upObj.addParameter(name='nFFTPoints',value=value1,format='int') |
|
646 | self.upObj.addParameter(name='nFFTPoints',value=value1,format='int') | |
641 | self.upObj.addParameter(name='pairsList', value=value2, format='pairslist') |
|
647 | self.upObj.addParameter(name='pairsList', value=value2, format='pairslist') | |
642 |
|
648 | |||
643 | if self.specOpCebHeights.isChecked(): |
|
649 | if self.specOpCebHeights.isChecked(): | |
644 | if self.specOpComHeights.currentIndex()== 0: |
|
650 | if self.specOpComHeights.currentIndex()== 0: | |
645 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
651 | opObj10=self.upObj.addOperation(name='selectHeights') | |
646 | value=self.specOpHeights.text() |
|
652 | value=self.specOpHeights.text() | |
647 | valueList=value.split(',') |
|
653 | valueList=value.split(',') | |
648 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
654 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') | |
649 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
655 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') | |
650 | else: |
|
656 | else: | |
651 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
657 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') | |
652 | value=self.specOpHeights.text() |
|
658 | value=self.specOpHeights.text() | |
653 | valueList=value.split(',') |
|
659 | valueList=value.split(',') | |
654 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
660 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') | |
655 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
661 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') | |
656 |
|
662 | |||
657 | if self.specOpCebChannel.isChecked(): |
|
663 | if self.specOpCebChannel.isChecked(): | |
658 | if self.specOpComChannel.currentIndex()== 0: |
|
664 | if self.specOpComChannel.currentIndex()== 0: | |
659 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
665 | opObj10=self.upObj.addOperation(name="selectChannels") | |
660 | self.operObjList.append(opObj10) |
|
666 | self.operObjList.append(opObj10) | |
661 | value=self.specOpChannel.text() |
|
667 | value=self.specOpChannel.text() | |
662 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
668 | opObj10.addParameter(name='channelList', value=value, format='intlist') | |
663 | else: |
|
669 | else: | |
664 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
670 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") | |
665 | self.operObjList.append(opObj10) |
|
671 | self.operObjList.append(opObj10) | |
666 | value=self.specOpChannel.text() |
|
672 | value=self.specOpChannel.text() | |
667 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
673 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') | |
668 |
|
674 | |||
669 | if self.specOpCebIncoherent.isChecked(): |
|
675 | if self.specOpCebIncoherent.isChecked(): | |
670 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') |
|
676 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') | |
671 | self.operObjList.append(opObj10) |
|
677 | self.operObjList.append(opObj10) | |
672 | value=self.specOpIncoherent.text() |
|
678 | value=self.specOpIncoherent.text() | |
673 | opObj10.addParameter(name='n', value=value, format='float') |
|
679 | opObj10.addParameter(name='n', value=value, format='float') | |
674 |
|
680 | |||
675 | if self.specOpCebRemoveDC.isChecked(): |
|
681 | if self.specOpCebRemoveDC.isChecked(): | |
676 | opObj10=self.upObj.addOperation(name='removeDC') |
|
682 | opObj10=self.upObj.addOperation(name='removeDC') | |
677 | value=self.specOpRemoveDC.text() |
|
683 | value=self.specOpRemoveDC.text() | |
678 | opObj10.addParameter(name='mode', value=value,format='int') |
|
684 | opObj10.addParameter(name='mode', value=value,format='int') | |
679 |
|
685 | |||
680 |
|
686 | |||
681 | self.tabopSpectra.setEnabled(False) |
|
687 | #self.tabopSpectra.setEnabled(False) | |
682 | self.console.clear() |
|
688 | self.console.clear() | |
683 | self.console.append("If you want to save your project") |
|
689 | self.console.append("If you want to save your project") | |
684 | self.console.append("click on your project name in the Tree Project Explorer") |
|
690 | self.console.append("click on your project name in the Tree Project Explorer") | |
685 |
|
691 | |||
686 |
|
692 | |||
687 | #------Spectra Graph--------# |
|
693 | #------Spectra Graph--------# | |
688 | @pyqtSignature("int") |
|
694 | @pyqtSignature("int") | |
689 |
def on_specGraphC |
|
695 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
690 | if index==0: |
|
696 | ||
691 | print "return" |
|
697 | if p0==2: | |
692 |
|
698 | self.specGgraphFreq.setEnabled(True) | ||
693 | if index==1: |
|
699 | self.specGgraphHeight.setEnabled(True) | |
694 |
self. |
|
700 | self.specGgraphDbsrange.setEnabled(True) | |
695 | self.specGraphTimeRange.setEnabled(False) |
|
701 | if p0==0: | |
696 |
|
702 | self.specGgraphFreq.setEnabled(False) | ||
697 | if index==2: |
|
703 | self.specGgraphHeight.setEnabled(False) | |
698 |
self. |
|
704 | self.specGgraphDbsrange.setEnabled(False) | |
699 | self.specGraphTimeRange.setEnabled(False) |
|
|||
700 |
|
705 | |||
701 | if index==3: |
|
|||
702 | self.setspecGraph() |
|
|||
703 |
|
706 | |||
|
707 | @pyqtSignature("int") | |||
|
708 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |||
|
709 | ||||
|
710 | if p0==2: | |||
|
711 | self.specGgraphFreq.setEnabled(True) | |||
|
712 | self.specGgraphHeight.setEnabled(True) | |||
|
713 | self.specGgraphmagnitud.setEnabled(True) | |||
|
714 | if p0==0: | |||
|
715 | self.specGgraphFreq.setEnabled(False) | |||
|
716 | self.specGgraphHeight.setEnabled(False) | |||
|
717 | self.specGgraphmagnitud.setEnabled(False) | |||
704 |
|
718 | |||
705 | if index==4: |
|
719 | @pyqtSignature("int") | |
706 | self.setspecGraph() |
|
720 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
707 | self.specGraphTimeRange.setEnabled(False) |
|
|||
708 |
|
721 | |||
709 |
if |
|
722 | if p0==2: | |
710 |
self. |
|
723 | self.specGgraphTimeRange.setEnabled(True) | |
|
724 | self.specGgraphHeight.setEnabled(True) | |||
|
725 | self.specGgraphDbsrange.setEnabled(True) | |||
|
726 | if p0==0: | |||
|
727 | self.specGgraphTimeRange.setEnabled(False) | |||
|
728 | self.specGgraphHeight.setEnabled(False) | |||
|
729 | self.specGgraphDbsrange.setEnabled(False) | |||
|
730 | ||||
711 |
|
731 | |||
712 | if index==6: |
|
732 | ||
713 | self.setspecGraph() |
|
733 | @pyqtSignature("int") | |
714 | self.specGgraphzrange.setEnabled(False) |
|
734 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
|
735 | ||||
|
736 | if p0==2: | |||
|
737 | self.specGgraphTimeRange.setEnabled(True) | |||
|
738 | self.specGgraphHeight.setEnabled(True) | |||
|
739 | self.specGgraphmagnitud.setEnabled(True) | |||
|
740 | if p0==0: | |||
|
741 | self.specGgraphTimeRange.setEnabled(False) | |||
|
742 | self.specGgraphHeight.setEnabled(False) | |||
|
743 | self.specGgraphmagnitud.setEnabled(False) | |||
|
744 | ||||
|
745 | ||||
|
746 | @pyqtSignature("int") | |||
|
747 | def on_specGraphRTIfromnoise_stateChanged(self, p0): | |||
|
748 | ||||
|
749 | if p0==2: | |||
|
750 | self.specGgraphTimeRange.setEnabled(True) | |||
|
751 | self.specGgraphHeight.setEnabled(True) | |||
|
752 | self.specGgraphDbsrange.setEnabled(True) | |||
|
753 | if p0==0: | |||
|
754 | self.specGgraphTimeRange.setEnabled(False) | |||
|
755 | self.specGgraphHeight.setEnabled(False) | |||
|
756 | self.specGgraphDbsrange.setEnabled(False) | |||
715 |
|
757 | |||
716 | @pyqtSignature("int") |
|
758 | @pyqtSignature("int") | |
717 |
def on_specGraph |
|
759 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
|
760 | ||||
|
761 | if p0==2: | |||
|
762 | ||||
|
763 | self.specGgraphHeight.setEnabled(True) | |||
|
764 | self.specGgraphDbsrange.setEnabled(True) | |||
|
765 | if p0==0: | |||
|
766 | self.specGgraphHeight.setEnabled(False) | |||
|
767 | self.specGgraphDbsrange.setEnabled(False) | |||
|
768 | ||||
|
769 | @pyqtSignature("int") | |||
|
770 | def on_specGraphPhase_stateChanged(self, p0): | |||
|
771 | ||||
|
772 | if p0==2: | |||
|
773 | self.specGgraphTimeRange.setEnabled(True) | |||
|
774 | self.specGgraphPhaserange.setEnabled(True) | |||
|
775 | ||||
|
776 | if p0==0: | |||
|
777 | self.specGgraphTimeRange.setEnabled(False) | |||
|
778 | self.specGgraphPhaserange.setEnabled(False) | |||
|
779 | ||||
|
780 | @pyqtSignature("int") | |||
|
781 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |||
718 | """ |
|
782 | """ | |
719 | """ |
|
783 | """ | |
720 | if p0==2: |
|
784 | if p0==2: | |
721 | self.specGraphPath.setEnabled(True) |
|
785 | self.specGraphPath.setEnabled(True) | |
722 | self.specGraphPrefix.setEnabled(True) |
|
786 | self.specGraphPrefix.setEnabled(True) | |
723 | self.specGraphToolPath.setEnabled(True) |
|
787 | self.specGraphToolPath.setEnabled(True) | |
724 | if p0==0: |
|
788 | if p0==0: | |
725 | self.specGraphPath.setEnabled(False) |
|
789 | self.specGraphPath.setEnabled(False) | |
726 | self.specGraphPrefix.setEnabled(False) |
|
790 | self.specGraphPrefix.setEnabled(False) | |
727 |
s |
|
791 | self.specGraphToolPath.setEnabled(False) | |
|
792 | ||||
|
793 | ||||
|
794 | @pyqtSignature("int") | |||
|
795 | def on_specGraphSaveCross_stateChanged(self, p0): | |||
|
796 | if p0==2: | |||
|
797 | self.specGraphPath.setEnabled(True) | |||
|
798 | self.specGraphPrefix.setEnabled(True) | |||
|
799 | self.specGraphToolPath.setEnabled(True) | |||
|
800 | ||||
|
801 | @pyqtSignature("int") | |||
|
802 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |||
|
803 | if p0==2: | |||
|
804 | self.specGraphPath.setEnabled(True) | |||
|
805 | self.specGraphPrefix.setEnabled(True) | |||
|
806 | self.specGraphToolPath.setEnabled(True) | |||
|
807 | ||||
|
808 | @pyqtSignature("int") | |||
|
809 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |||
|
810 | if p0==2: | |||
|
811 | self.specGraphPath.setEnabled(True) | |||
|
812 | self.specGraphPrefix.setEnabled(True) | |||
|
813 | self.specGraphToolPath.setEnabled(True) | |||
|
814 | ||||
|
815 | @pyqtSignature("int") | |||
|
816 | def on_specGraphSaveRTIfromNoise_stateChanged(self, p0): | |||
|
817 | if p0==2: | |||
|
818 | self.specGraphPath.setEnabled(True) | |||
|
819 | self.specGraphPrefix.setEnabled(True) | |||
|
820 | self.specGraphToolPath.setEnabled(True) | |||
|
821 | ||||
|
822 | @pyqtSignature("int") | |||
|
823 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |||
|
824 | if p0==2: | |||
|
825 | self.specGraphPath.setEnabled(True) | |||
|
826 | self.specGraphPrefix.setEnabled(True) | |||
|
827 | self.specGraphToolPath.setEnabled(True) | |||
|
828 | ||||
|
829 | @pyqtSignature("int") | |||
|
830 | def on_specGraphSavePhase_stateChanged(self, p0): | |||
|
831 | if p0==2: | |||
|
832 | self.specGraphPath.setEnabled(True) | |||
|
833 | self.specGraphPrefix.setEnabled(True) | |||
|
834 | self.specGraphToolPath.setEnabled(True) | |||
|
835 | ||||
|
836 | @pyqtSignature("int") | |||
|
837 | def on_specGraphSaveCCF_stateChanged(self, p0): | |||
|
838 | if p0==2: | |||
|
839 | self.specGraphPath.setEnabled(True) | |||
|
840 | self.specGraphPrefix.setEnabled(True) | |||
|
841 | self.specGraphToolPath.setEnabled(True) | |||
|
842 | ||||
728 | @pyqtSignature("") |
|
843 | @pyqtSignature("") | |
729 | def on_specGraphToolPath_clicked(self): |
|
844 | def on_specGraphToolPath_clicked(self): | |
730 | """ |
|
845 | """ | |
731 | """ |
|
846 | """ | |
732 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
847 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
733 | self.specGraphPath.setText(self.savePath) |
|
848 | self.specGraphPath.setText(self.savePath) | |
734 | if not os.path.exists(self.savePath): |
|
849 | if not os.path.exists(self.savePath): | |
735 | self.console.clear() |
|
850 | self.console.clear() | |
736 | self.console.append("Write a correct a path") |
|
851 | self.console.append("Write a correct a path") | |
737 | return |
|
852 | return | |
738 |
|
853 | |||
739 | @pyqtSignature("") |
|
854 | @pyqtSignature("") | |
740 | def on_specGraphOk_clicked(self): |
|
855 | def on_specGraphOk_clicked(self): | |
741 |
|
856 | |||
742 | for i in self.__arbolDict: |
|
857 | for i in self.__arbolDict: | |
743 | if self.__arbolDict[i]==self.indexclick: |
|
858 | if self.__arbolDict[i]==self.indexclick: | |
744 | if self.__upObjDict.has_key(i)==True: |
|
859 | if self.__upObjDict.has_key(i)==True: | |
745 | self.upObj=self.__upObjDict[i] |
|
860 | self.upObj=self.__upObjDict[i] | |
746 |
|
861 | if self.specGraphCebSpectraplot.isChecked(): | ||
747 | if self.specGraphComType.currentIndex()==1: |
|
|||
748 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') |
|
862 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') | |
749 | self.properSpecGraph(opObj10) |
|
863 | ||
750 |
|
|
864 | self.idImag += 1 | |
751 | if self.specGraphComType.currentIndex()==2: |
|
865 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |
|
866 | ||||
|
867 | channelList=self.specGgraphChannelList.text() | |||
|
868 | if self.specGgraphChannelList.isModified(): | |||
|
869 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
870 | ||||
|
871 | xvalue= self.specGgraphFreq.text() | |||
|
872 | if self.specGgraphFreq.isModified(): | |||
|
873 | xvalueList=xvalue.split(',') | |||
|
874 | try: | |||
|
875 | value=int(xvalueList[0]) | |||
|
876 | value=int(xvalueList[1]) | |||
|
877 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
878 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
879 | except: | |||
|
880 | return 0 | |||
|
881 | ||||
|
882 | yvalue= self.specGgraphHeight.text() | |||
|
883 | if self.specGgraphHeight.isModified(): | |||
|
884 | yvalueList=yvalue.split(",") | |||
|
885 | try: | |||
|
886 | value=int(yvalueList[0]) | |||
|
887 | value=int(yvalueList[1]) | |||
|
888 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
889 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
890 | except: | |||
|
891 | return 0 | |||
|
892 | ||||
|
893 | zvalue= self.specGgraphDbsrange.text() | |||
|
894 | if self.specGgraphDbsrange.isModified(): | |||
|
895 | zvalueList=zvalue.split(",") | |||
|
896 | try: | |||
|
897 | value=int(zvalueList[0]) | |||
|
898 | value=int(zvalueList[1]) | |||
|
899 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |||
|
900 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |||
|
901 | except: | |||
|
902 | return 0 | |||
|
903 | ||||
|
904 | if self.specGraphSaveSpectra.isChecked(): | |||
|
905 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
906 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
907 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
|
908 | ||||
|
909 | ||||
|
910 | if self.specGraphCebCrossSpectraplot.isChecked(): | |||
752 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') |
|
911 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') | |
753 | self.properSpecGraph(opObj10) |
|
912 | ||
754 | opObj10.addParameter(name='power_cmap', value='jet', format='str') |
|
913 | opObj10.addParameter(name='power_cmap', value='jet', format='str') | |
755 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
914 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') | |
756 |
opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
915 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
|
916 | ||||
|
917 | ||||
|
918 | self.idImag += 1 | |||
|
919 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |||
|
920 | ||||
|
921 | channelList=self.specGgraphChannelList.text() | |||
|
922 | if self.specGgraphChannelList.isModified(): | |||
|
923 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
924 | ||||
|
925 | xvalue= self.specGgraphFreq.text() | |||
|
926 | if self.specGgraphFreq.isModified(): | |||
|
927 | xvalueList=xvalue.split(',') | |||
|
928 | try: | |||
|
929 | value=int(xvalueList[0]) | |||
|
930 | value=int(xvalueList[1]) | |||
|
931 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
932 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
933 | except: | |||
|
934 | return 0 | |||
|
935 | ||||
|
936 | yvalue= self.specGgraphHeight.text() | |||
|
937 | if self.specGgraphHeight.isModified(): | |||
|
938 | yvalueList=yvalue.split(",") | |||
|
939 | try: | |||
|
940 | value=int(yvalueList[0]) | |||
|
941 | value=int(yvalueList[1]) | |||
|
942 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
943 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
944 | except: | |||
|
945 | return 0 | |||
|
946 | ||||
|
947 | zvalue= self.specGgraphmagnitud.text() | |||
|
948 | if self.specGgraphmagnitud.isModified(): | |||
|
949 | zvalueList=zvalue.split(",") | |||
|
950 | try: | |||
|
951 | value=int(zvalueList[0]) | |||
|
952 | value=int(zvalueList[1]) | |||
|
953 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |||
|
954 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |||
|
955 | except: | |||
|
956 | return 0 | |||
|
957 | ||||
|
958 | if self.specGraphSaveCross.isChecked(): | |||
|
959 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
960 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
961 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
|
962 | ||||
|
963 | ||||
|
964 | ||||
|
965 | if self.specGraphCebRTIplot.isChecked(): | |||
|
966 | opObj10=self.upObj.addOperation(name='RTIPlot',optype='other') | |||
|
967 | ||||
|
968 | self.idImag += 1 | |||
|
969 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |||
|
970 | ||||
|
971 | channelList=self.specGgraphChannelList.text() | |||
|
972 | if self.specGgraphChannelList.isModified(): | |||
|
973 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
974 | ||||
|
975 | xvalue= self.specGgraphTimeRange.text() | |||
|
976 | if self.specGgraphTimeRange.isModified(): | |||
|
977 | xvalueList=xvalue.split(',') | |||
|
978 | try: | |||
|
979 | value=int(xvalueList[0]) | |||
|
980 | value=int(xvalueList[1]) | |||
|
981 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
982 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
983 | except: | |||
|
984 | return 0 | |||
|
985 | ||||
|
986 | yvalue= self.specGgraphHeight.text() | |||
|
987 | if self.specGgraphHeight.isModified(): | |||
|
988 | yvalueList=yvalue.split(",") | |||
|
989 | try: | |||
|
990 | value=int(yvalueList[0]) | |||
|
991 | value=int(yvalueList[1]) | |||
|
992 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
993 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
994 | except: | |||
|
995 | return 0 | |||
757 |
|
996 | |||
758 | if self.specGraphComType.currentIndex()==3: |
|
997 | zvalue= self.specGgraphDbsrange.text() | |
759 | opObj10=self.upObj.addOperation(name='RTIPlot',optype='other') |
|
998 | if self.specGgraphDbsrange.isModified(): | |
760 | self.properSpecGraph(opObj10) |
|
999 | zvalueList=zvalue.split(",") | |
761 | value =self.specGraphTimeRange.text() |
|
1000 | try: | |
762 | opObj10.addParameter(name='timerange', value=value, format='int') |
|
1001 | value=int(zvalueList[0]) | |
|
1002 | value=int(zvalueList[1]) | |||
|
1003 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |||
|
1004 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |||
|
1005 | except: | |||
|
1006 | return 0 | |||
|
1007 | ||||
|
1008 | if self.specGraphSaveRTIplot.isChecked(): | |||
|
1009 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
1010 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
1011 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
763 |
|
1012 | |||
764 |
if self.specGraphC |
|
1013 | if self.specGraphCebCoherencmap.isChecked(): | |
765 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') |
|
1014 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') | |
766 | self.properSpecGraph(opObj10) |
|
1015 | ||
767 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1016 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') | |
768 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1017 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
|
1018 | ||||
|
1019 | self.idImag += 1 | |||
|
1020 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |||
|
1021 | ||||
|
1022 | channelList=self.specGgraphChannelList.text() | |||
|
1023 | if self.specGgraphChannelList.isModified(): | |||
|
1024 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
1025 | ||||
|
1026 | xvalue= self.specGgraphTimeRange.text() | |||
|
1027 | if self.specGgraphTimeRange.isModified(): | |||
|
1028 | xvalueList=xvalue.split(',') | |||
|
1029 | try: | |||
|
1030 | value=int(xvalueList[0]) | |||
|
1031 | value=int(xvalueList[1]) | |||
|
1032 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
1033 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
1034 | except: | |||
|
1035 | return 0 | |||
|
1036 | ||||
|
1037 | yvalue= self.specGgraphHeight.text() | |||
|
1038 | if self.specGgraphHeight.isModified(): | |||
|
1039 | yvalueList=yvalue.split(",") | |||
|
1040 | try: | |||
|
1041 | value=int(yvalueList[0]) | |||
|
1042 | value=int(yvalueList[1]) | |||
|
1043 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
1044 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
1045 | except: | |||
|
1046 | return 0 | |||
|
1047 | ||||
|
1048 | zvalue= self.specGgraphmagnitud.text() | |||
|
1049 | if self.specGgraphmagnitud.isModified(): | |||
|
1050 | zvalueList=zvalue.split(",") | |||
|
1051 | try: | |||
|
1052 | value=int(zvalueList[0]) | |||
|
1053 | value=int(zvalueList[1]) | |||
|
1054 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') | |||
|
1055 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') | |||
|
1056 | except: | |||
|
1057 | return 0 | |||
|
1058 | ||||
|
1059 | if self.specGraphSaveCoherencemap.isChecked(): | |||
|
1060 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
1061 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
1062 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
|
1063 | ||||
769 |
|
1064 | |||
770 |
if self.specGraph |
|
1065 | if self.specGraphRTIfromnoise.isChecked(): | |
771 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') |
|
1066 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') | |
772 | self.properSpecGraph(opObj10) |
|
1067 | ||
773 | self.specGgraphzrange.setEnabled(False) |
|
1068 | self.idImag += 1 | |
|
1069 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |||
|
1070 | ||||
|
1071 | channelList=self.specGgraphChannelList.text() | |||
|
1072 | if self.specGgraphChannelList.isModified(): | |||
|
1073 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
1074 | ||||
|
1075 | xvalue= self.specGgraphTimeRange.text() | |||
|
1076 | if self.specGgraphTimeRange.isModified(): | |||
|
1077 | xvalueList=xvalue.split(',') | |||
|
1078 | try: | |||
|
1079 | value=int(xvalueList[0]) | |||
|
1080 | value=int(xvalueList[1]) | |||
|
1081 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
1082 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
1083 | except: | |||
|
1084 | return 0 | |||
|
1085 | ||||
|
1086 | yvalue= self.specGgraphHeight.text() | |||
|
1087 | if self.specGgraphHeight.isModified(): | |||
|
1088 | yvalueList=yvalue.split(",") | |||
|
1089 | try: | |||
|
1090 | value=int(yvalueList[0]) | |||
|
1091 | value=int(yvalueList[1]) | |||
|
1092 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
1093 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
1094 | except: | |||
|
1095 | return 0 | |||
|
1096 | ||||
|
1097 | ||||
|
1098 | if self.specGraphSaveRTIfromNoise.isChecked(): | |||
|
1099 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
1100 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
1101 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
|
1102 | ||||
774 |
|
1103 | |||
775 |
if self.specGraph |
|
1104 | if self.specGraphPowerprofile.isChecked(): | |
776 | opObj10=self.upObj.addOperation(name='ProfilePlot',optype='other') |
|
1105 | opObj10=self.upObj.addOperation(name='ProfilePlot',optype='other') | |
777 |
self. |
|
1106 | self.idImag += 1 | |
778 | self.specGgraphzrange.setEnabled(False) |
|
1107 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') | |
779 |
|
|
1108 | ||
|
1109 | channelList=self.specGgraphChannelList.text() | |||
|
1110 | if self.specGgraphChannelList.isModified(): | |||
|
1111 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') | |||
|
1112 | ||||
|
1113 | xvalue= self.specGgraphDbsrange.text() | |||
|
1114 | if self.specGgraphDbsrange.isModified(): | |||
|
1115 | xvalueList=xvalue.split(',') | |||
|
1116 | try: | |||
|
1117 | value=int(xvalueList[0]) | |||
|
1118 | value=int(xvalueList[1]) | |||
|
1119 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') | |||
|
1120 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') | |||
|
1121 | except: | |||
|
1122 | return 0 | |||
|
1123 | ||||
|
1124 | yvalue= self.specGgraphHeight.text() | |||
|
1125 | if self.specGgraphHeight.isModified(): | |||
|
1126 | yvalueList=yvalue.split(",") | |||
|
1127 | try: | |||
|
1128 | value=int(yvalueList[0]) | |||
|
1129 | value=int(yvalueList[1]) | |||
|
1130 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') | |||
|
1131 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') | |||
|
1132 | except: | |||
|
1133 | return 0 | |||
|
1134 | ||||
|
1135 | ||||
|
1136 | if self.specGraphSavePowerprofile.isChecked(): | |||
|
1137 | opObj10.addParameter(name='save', value='1', format='bool') | |||
|
1138 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') | |||
|
1139 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') | |||
|
1140 | ||||
|
1141 | ||||
780 |
|
1142 | |||
781 | #self.tabgraphSpectra.setEnabled(False) |
|
1143 | #self.tabgraphSpectra.setEnabled(False) | |
782 | self.specGraphComType.setEnabled(False) |
|
1144 | ||
783 | self.console.clear() |
|
1145 | self.console.clear() | |
784 | self.console.append("If you want to save your project") |
|
1146 | self.console.append("If you want to save your project") | |
785 | self.console.append("click on your project name in the Tree Project Explorer") |
|
1147 | self.console.append("click on your project name in the Tree Project Explorer") | |
786 |
|
|
1148 | ||
787 | @pyqtSignature("") |
|
1149 | @pyqtSignature("") | |
788 | def on_specGraphClear_clicked(self): |
|
1150 | def on_specGraphClear_clicked(self): | |
789 | self.clearspecGraph() |
|
1151 | self.clearspecGraph() | |
790 |
|
||||
791 | def properSpecGraph(self,opObj10): |
|
|||
792 |
|
||||
793 | self.operObjList.append(opObj10) |
|
|||
794 | wintitle=self.specGraphWinTitle.text() |
|
|||
795 | opObj10.addParameter(name='wintitle', value=wintitle, format='str') |
|
|||
796 | idfigure=self.specGraphIdFigure.text() |
|
|||
797 |
|
||||
798 | opObj10.addParameter(name='idfigure', value=idfigure, format='int') |
|
|||
799 |
|
||||
800 | channelList=self.specGraphChannelList.text() |
|
|||
801 | if self.specGraphChannelList.isModified(): |
|
|||
802 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
|||
803 |
|
||||
804 | xvalue= self.specGgraphxrange.text() |
|
|||
805 | if self.specGgraphxrange.isModified(): |
|
|||
806 | xvalueList=xvalue.split(',') |
|
|||
807 | try: |
|
|||
808 | value=int(xvalueList[0]) |
|
|||
809 | value=int(xvalueList[1]) |
|
|||
810 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
|||
811 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
|||
812 | except: |
|
|||
813 | return 0 |
|
|||
814 |
|
||||
815 | yvalue= self.specGgraphyrange.text() |
|
|||
816 | if self.specGgraphyrange.isModified(): |
|
|||
817 | yvalueList=yvalue.split(",") |
|
|||
818 | try: |
|
|||
819 | value=int(yvalueList[0]) |
|
|||
820 | value=int(yvalueList[1]) |
|
|||
821 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
|||
822 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
|||
823 | except: |
|
|||
824 | return 0 |
|
|||
825 |
|
||||
826 | zvalue= self.specGgraphzrange.text() |
|
|||
827 | if self.specGgraphzrange.isModified(): |
|
|||
828 | zvalueList=zvalue.split(",") |
|
|||
829 | try: |
|
|||
830 | value=int(zvalueList[0]) |
|
|||
831 | value=int(zvalueList[1]) |
|
|||
832 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
|||
833 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
|||
834 | except: |
|
|||
835 | return 0 |
|
|||
836 |
|
||||
837 | if self.specGraphCebSave.isChecked(): |
|
|||
838 | opObj10.addParameter(name='save', value='1', format='bool') |
|
|||
839 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
|||
840 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
|||
841 |
|
||||
842 |
|
1152 | |||
843 | def setspecGraph(self): |
|
1153 | def setspecGraph(self): | |
844 | self.specGraphIdFigure.setEnabled(True) |
|
1154 | ||
845 |
self.specG |
|
1155 | self.specGgraphChannelList.setEnabled(True) | |
846 | self.specGraphChannelList.setEnabled(True) |
|
1156 | ||
847 | self.specGgraphxrange.setEnabled(True) |
|
|||
848 | self.specGgraphyrange.setEnabled(True) |
|
|||
849 | self.specGgraphzrange.setEnabled(True) |
|
|||
850 | self.specGraphTimeRange.setEnabled(True) |
|
|||
851 | # self.specGraphPath.setEnabled(True) |
|
|||
852 | # self.specGraphToolPath.setEnabled(True) |
|
|||
853 | # self.specGraphPrefix.setEnabled(True) |
|
|||
854 | def clearspecGraph(self): |
|
1157 | def clearspecGraph(self): | |
855 | self.specGraphComType.setEnabled(True) |
|
1158 | ||
856 |
self.specG |
|
1159 | self.specGgraphChannelList.clear() | |
857 | self.specGraphIdFigure.clear() |
|
1160 | ||
858 | self.specGraphWinTitle.clear() |
|
|||
859 | self.specGraphChannelList.clear() |
|
|||
860 | self.specGgraphxrange.clear() |
|
|||
861 | self.specGgraphyrange.clear() |
|
|||
862 | self.specGgraphzrange.clear() |
|
|||
863 | self.specGraphTimeRange.clear() |
|
|||
864 |
|
1161 | |||
865 | def playProject(self): |
|
1162 | def playProject(self): | |
866 |
|
1163 | |||
867 | for i in self.__arbolDict: |
|
1164 | for i in self.__arbolDict: | |
868 | if self.__arbolDict[i]==self.indexclick: |
|
1165 | if self.__arbolDict[i]==self.indexclick: | |
869 |
|
|
1166 | if self.__projObjDict.has_key(i)==True: | |
870 | else: |
|
1167 | self.projectObj=self.__projObjDict[i] | |
871 | self.console.clear() |
|
1168 | filename=self.pathWorkSpace+"/"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" | |
872 |
self.console. |
|
1169 | self.console.clear() | |
873 | return 0 |
|
1170 | self.console.append("Please Wait...") | |
874 | filename=self.pathWorkSpace+str(self.projectObj.name)+str(self.projectObj.id)+".xml" |
|
1171 | self.projectObj.readXml(filename) | |
875 |
self.projectObj. |
|
1172 | self.projectObj.createObjects() | |
876 | #controllerObj.printattr() |
|
1173 | self.projectObj.connectObjects() | |
877 |
|
1174 | self.projectObj.run() | ||
878 | self.projectObj.createObjects() |
|
1175 | return 0 | |
879 | self.projectObj.connectObjects() |
|
1176 | else: | |
880 | self.projectObj.run() |
|
1177 | self.console.clear() | |
881 | self.console.clear() |
|
1178 | self.console.append("First,click on current project") | |
882 | self.console.append("Please Wait...") |
|
1179 | ||
883 |
|
1180 | |||
884 |
|
1181 | |||
885 | def saveProject(self): |
|
1182 | def saveProject(self): | |
886 |
|
1183 | print self.indexclick | ||
887 |
for i in self.__arbolDict: |
|
1184 | for i in self.__arbolDict: | |
888 | if self.__arbolDict[i]==self.indexclick: |
|
1185 | if self.__arbolDict[i]==self.indexclick: | |
889 |
|
|
1186 | if self.__projObjDict.has_key(i)==True: | |
890 | else: |
|
1187 | self.projectObj=self.__projObjDict[int(i)] | |
891 |
|
|
1188 | else: | |
892 | self.console.append("First, Click on current project") |
|
1189 | self.console.clear() | |
893 | return 0 |
|
1190 | self.console.append("First,click on current project") | |
894 |
|
1191 | |||
895 | filename=self.pathWorkSpace+str(self.projectObj.name)+str(self.projectObj.id)+".xml" |
|
1192 | filename=self.pathWorkSpace+"/"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" | |
896 | self.projectObj.writeXml(filename) |
|
|||
897 | self.console.clear() |
|
1193 | self.console.clear() | |
|
1194 | self.projectObj.writeXml(filename) | |||
898 | self.console.append("Now, you can push the icon Start in the toolbar or push start in menu run") |
|
1195 | self.console.append("Now, you can push the icon Start in the toolbar or push start in menu run") | |
899 |
|
1196 | |||
900 |
|
1197 | |||
901 | def clickFunction(self,index): |
|
1198 | def clickFunction(self,index): | |
902 | self.indexclick= index.model().itemFromIndex(index) |
|
1199 | self.indexclick= index.model().itemFromIndex(index) | |
903 |
|
1200 | |||
904 | def doubleclickFunction(self): |
|
1201 | def doubleclickFunction(self): | |
905 | for i in self.__arbolDict: |
|
1202 | for i in self.__arbolDict: | |
906 | if self.__arbolDict[i]==self.indexclick: |
|
1203 | if self.__arbolDict[i]==self.indexclick: | |
907 | if self.__projObjDict.has_key(i)==True: |
|
1204 | if self.__projObjDict.has_key(i)==True: | |
908 | #self.tabProject.setEnabled(True) |
|
1205 | #self.tabProject.setEnabled(True) | |
|
1206 | ||||
909 | self.proName.setText(str(self.__projObjDict[i].name)) |
|
1207 | self.proName.setText(str(self.__projObjDict[i].name)) | |
910 | self.proDataPath.setText(str(self.readUnitConfObjList[i-1].path)) |
|
1208 | self.proDataPath.setText(str(self.readUnitConfObjList[i-1].path)) | |
911 |
|
1209 | |||
912 | startDate = str(self.readUnitConfObjList[i-1].startDate) |
|
1210 | startDate = str(self.readUnitConfObjList[i-1].startDate) | |
913 | endDate = str(self.readUnitConfObjList[i-1].endDate) |
|
1211 | endDate = str(self.readUnitConfObjList[i-1].endDate) | |
914 | self.proComStartDate.clear() |
|
1212 | self.proComStartDate.clear() | |
915 | self.proComEndDate.clear() |
|
1213 | self.proComEndDate.clear() | |
916 | self.proComStartDate.addItem( startDate) |
|
1214 | self.proComStartDate.addItem( startDate) | |
917 | self.proComEndDate.addItem(endDate) |
|
1215 | self.proComEndDate.addItem(endDate) | |
918 | startTime=str(self.readUnitConfObjList[i-1].startTime) |
|
1216 | startTime=str(self.readUnitConfObjList[i-1].startTime) | |
919 | endTime=str(self.readUnitConfObjList[i-1].endTime) |
|
1217 | endTime=str(self.readUnitConfObjList[i-1].endTime) | |
920 | starlist=startTime.split(":") |
|
1218 | starlist=startTime.split(":") | |
921 | endlist=endTime.split(":") |
|
1219 | endlist=endTime.split(":") | |
922 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1220 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
923 | self.proStartTime.setTime(self.time) |
|
1221 | self.proStartTime.setTime(self.time) | |
924 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1222 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
925 | self.proEndTime.setTime(self.time) |
|
1223 | self.proEndTime.setTime(self.time) | |
926 |
|
1224 | |||
927 | self.model_2=treeModel() |
|
1225 | self.model_2=treeModel() | |
928 | self.model_2.setParams(name = str(self.__projObjDict[i].name), |
|
1226 | self.model_2.setParams(name = str(self.__projObjDict[i].name), | |
929 | directorio = str(self.readUnitConfObjList[i-1].path), |
|
1227 | directorio = str(self.readUnitConfObjList[i-1].path), | |
930 | workspace = self.pathWorkSpace, |
|
1228 | workspace = self.pathWorkSpace, | |
931 | remode = "Off Line", |
|
1229 | remode = "Off Line", | |
932 | dataformat = self.readUnitConfObjList[i-1].datatype, |
|
1230 | dataformat = self.readUnitConfObjList[i-1].datatype, | |
933 | date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate), |
|
1231 | date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate), | |
934 | initTime = str(self.readUnitConfObjList[i-1].startTime), |
|
1232 | initTime = str(self.readUnitConfObjList[i-1].startTime), | |
935 | endTime = str(self.readUnitConfObjList[i-1].endTime), |
|
1233 | endTime = str(self.readUnitConfObjList[i-1].endTime), | |
936 | timezone = "Local" , |
|
1234 | timezone = "Local" , | |
937 | Summary = str(self.__projObjDict[i].description)) |
|
1235 | Summary = str(self.__projObjDict[i].description)) | |
938 | self.treeProjectProperties.setModel(self.model_2) |
|
1236 | self.treeProjectProperties.setModel(self.model_2) | |
939 | self.treeProjectProperties.expandAll() |
|
1237 | self.treeProjectProperties.expandAll() | |
940 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
1238 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
941 |
|
1239 | |||
942 | if self.indexclick.text()=='Voltage': |
|
1240 | if self.indexclick.text()=='Voltage': | |
943 | self.tabVoltage.setEnabled(True) |
|
1241 | self.tabVoltage.setEnabled(True) | |
944 | self.tabSpectra.setEnabled(False) |
|
1242 | self.tabSpectra.setEnabled(False) | |
945 | self.tabCorrelation.setEnabled(False) |
|
1243 | self.tabCorrelation.setEnabled(False) | |
946 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
1244 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
947 |
|
1245 | |||
948 | self.volOpComChannels.setEnabled(False) |
|
1246 | self.volOpComChannels.setEnabled(False) | |
949 | self.volOpComHeights.setEnabled(False) |
|
1247 | self.volOpComHeights.setEnabled(False) | |
950 | self.volOpFilter.setEnabled(False) |
|
1248 | self.volOpFilter.setEnabled(False) | |
951 | self.volOpComProfile.setEnabled(False) |
|
1249 | self.volOpComProfile.setEnabled(False) | |
952 | self.volOpComCode.setEnabled(False) |
|
1250 | self.volOpComCode.setEnabled(False) | |
953 | self.volOpCohInt.setEnabled(False) |
|
1251 | self.volOpCohInt.setEnabled(False) | |
954 | self.volOpChannel.clear() |
|
1252 | self.volOpChannel.clear() | |
955 | self.volOpHeights.clear() |
|
1253 | self.volOpHeights.clear() | |
956 | self.volOpProfile.clear() |
|
1254 | self.volOpProfile.clear() | |
957 | self.volOpFilter.clear() |
|
1255 | self.volOpFilter.clear() | |
958 |
|
1256 | |||
959 | self.volOpChannel.setEnabled(False) |
|
1257 | self.volOpChannel.setEnabled(False) | |
960 | self.volOpHeights.setEnabled(False) |
|
1258 | self.volOpHeights.setEnabled(False) | |
961 | self.volOpProfile.setEnabled(False) |
|
1259 | self.volOpProfile.setEnabled(False) | |
962 | self.volOpCebHeights.clearFocus() |
|
1260 | self.volOpCebHeights.clearFocus() | |
963 | # self.volOpCebChannels.clear() |
|
1261 | # self.volOpCebChannels.clear() | |
964 | # self.volOpCebHeights.clear() |
|
1262 | # self.volOpCebHeights.clear() | |
965 | # self.volOpCebFilter.clear() |
|
1263 | # self.volOpCebFilter.clear() | |
966 | # self.volOpCebProfile.clear() |
|
1264 | # self.volOpCebProfile.clear() | |
967 | # self.volOpCebDecodification.clear() |
|
1265 | # self.volOpCebDecodification.clear() | |
968 | # self.volOpCebCohInt.clear() |
|
1266 | # self.volOpCebCohInt.clear() | |
969 |
|
1267 | |||
970 |
|
1268 | |||
971 | if self.indexclick.text()=='Spectra': |
|
1269 | if self.indexclick.text()=='Spectra': | |
972 | self.tabSpectra.setEnabled(True) |
|
1270 | self.tabSpectra.setEnabled(True) | |
|
1271 | self.specOpnFFTpoints.setEnabled(True) | |||
973 | self.tabVoltage.setEnabled(False) |
|
1272 | self.tabVoltage.setEnabled(False) | |
974 | self.tabCorrelation.setEnabled(False) |
|
1273 | self.tabCorrelation.setEnabled(False) | |
975 |
self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
1274 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
976 |
|
|
1275 | ||
|
1276 | self.specOpnFFTpoints.clear() | |||
|
1277 | self.specOppairsList.clear() | |||
|
1278 | self.specOpChannel.clear() | |||
|
1279 | self.specOpHeights.clear() | |||
|
1280 | self.specOpIncoherent.clear() | |||
|
1281 | self.specOpRemoveDC.clear() | |||
|
1282 | self.specOpRemoveInterference.clear() | |||
|
1283 | ||||
|
1284 | ||||
977 | if self.indexclick.text()=='Correlation': |
|
1285 | if self.indexclick.text()=='Correlation': | |
978 | self.tabCorrelation.setEnabled(True) |
|
1286 | self.tabCorrelation.setEnabled(True) | |
979 | self.tabVoltage.setEnabled(False) |
|
1287 | self.tabVoltage.setEnabled(False) | |
980 | self.tabSpectra.setEnabled(False) |
|
1288 | self.tabSpectra.setEnabled(False) | |
981 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) |
|
1289 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) | |
982 |
|
1290 | |||
983 | def popup(self, pos): |
|
1291 | def popup(self, pos): | |
984 |
|
1292 | |||
985 | self.menu = QtGui.QMenu() |
|
1293 | self.menu = QtGui.QMenu() | |
986 | quitAction0 = self.menu.addAction("AddNewProject") |
|
1294 | quitAction0 = self.menu.addAction("AddNewProject") | |
987 | quitAction1 = self.menu.addAction("AddNewProcessingUnit") |
|
1295 | quitAction1 = self.menu.addAction("AddNewProcessingUnit") | |
988 | quitAction2 = self.menu.addAction("Delete Branch") |
|
1296 | quitAction2 = self.menu.addAction("Delete Branch") | |
989 | quitAction3 = self.menu.addAction("Exit") |
|
1297 | quitAction3 = self.menu.addAction("Exit") | |
990 |
|
1298 | |||
991 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
1299 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
992 | if action == quitAction0: |
|
1300 | if action == quitAction0: | |
993 | self.setProjectParam() |
|
1301 | self.setProjectParam() | |
994 | if action == quitAction1: |
|
1302 | if action == quitAction1: | |
995 | self.addPU() |
|
1303 | self.addPU() | |
996 | self.console.clear() |
|
1304 | self.console.clear() | |
997 | self.console.append("Please, Choose the type of Processing Unit") |
|
1305 | self.console.append("Please, Choose the type of Processing Unit") | |
998 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
1306 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
999 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
1307 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
1000 | if action == quitAction2: |
|
1308 | if action == quitAction2: | |
1001 | for i in self.__arbolDict: |
|
1309 | for i in self.__arbolDict: | |
1002 | if self.__arbolDict[i]==self.indexclick: |
|
1310 | if self.__arbolDict[i]==self.indexclick: | |
1003 | self.arbolItem=self.__arbolDict[i] |
|
1311 | self.arbolItem=self.__arbolDict[i] | |
1004 | #print self.arbolItem |
|
|||
1005 | #self.treeProjectExplorer.removeRows(self.arbolItem) |
|
|||
1006 | self.arbolItem.removeRows(self.arbolItem.row(),1) |
|
1312 | self.arbolItem.removeRows(self.arbolItem.row(),1) | |
1007 |
|
1313 | |||
1008 | if action == quitAction3: |
|
1314 | if action == quitAction3: | |
1009 | return |
|
1315 | return | |
1010 |
|
1316 | |||
1011 | def setProjectParam(self): |
|
1317 | def setProjectParam(self): | |
1012 | self.tabWidgetProject.setEnabled(True) |
|
1318 | self.tabWidgetProject.setEnabled(True) | |
1013 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
1319 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
1014 | self.tabProject.setEnabled(True) |
|
1320 | self.tabProject.setEnabled(True) | |
1015 |
|
1321 | |||
1016 | self.proName.clear() |
|
1322 | self.proName.clear() | |
1017 | self.proDataType.setText('.r') |
|
1323 | self.proDataType.setText('.r') | |
1018 | self.proDataPath.clear() |
|
1324 | self.proDataPath.clear() | |
1019 | self.proComDataType.clear() |
|
1325 | self.proComDataType.clear() | |
1020 | self.proComDataType.addItem("Voltage") |
|
1326 | self.proComDataType.addItem("Voltage") | |
1021 | self.proComDataType.addItem("Spectra") |
|
1327 | self.proComDataType.addItem("Spectra") | |
1022 |
|
1328 | |||
1023 | self.proComStartDate.clear() |
|
1329 | self.proComStartDate.clear() | |
1024 | self.proComEndDate.clear() |
|
1330 | self.proComEndDate.clear() | |
1025 |
|
1331 | |||
1026 | startTime="00:00:00" |
|
1332 | startTime="00:00:00" | |
1027 | endTime="23:59:59" |
|
1333 | endTime="23:59:59" | |
1028 | starlist=startTime.split(":") |
|
1334 | starlist=startTime.split(":") | |
1029 | endlist=endTime.split(":") |
|
1335 | endlist=endTime.split(":") | |
1030 |
|
1336 | |||
1031 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1337 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
1032 | self.proStartTime.setTime(self.time) |
|
1338 | self.proStartTime.setTime(self.time) | |
1033 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1339 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
1034 | self.proEndTime.setTime(self.time) |
|
1340 | self.proEndTime.setTime(self.time) | |
1035 | self.proDescription.clear() |
|
1341 | self.proDescription.clear() | |
1036 |
|
1342 | |||
1037 | self.console.clear() |
|
1343 | self.console.clear() | |
1038 | self.console.append("Please, Write a name Project") |
|
1344 | self.console.append("Please, Write a name Project") | |
1039 | self.console.append("Introduce Project Parameters") |
|
1345 | self.console.append("Introduce Project Parameters") | |
1040 | self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
1346 | self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
1041 |
|
1347 | |||
1042 |
|
1348 | |||
1043 | def addPU(self): |
|
1349 | def addPU(self): | |
1044 | self.configUP=UnitProcess(self) |
|
1350 | self.configUP=UnitProcess(self) | |
1045 | for i in self.__arbolDict: |
|
1351 | for i in self.__arbolDict: | |
1046 | if self.__arbolDict[i]==self.indexclick: |
|
1352 | if self.__arbolDict[i]==self.indexclick: | |
1047 | if self.__projObjDict.has_key(i)==True: |
|
1353 | if self.__projObjDict.has_key(i)==True: | |
1048 | self.projectObj=self.__projObjDict[int(i)] |
|
1354 | self.projectObj=self.__projObjDict[int(i)] | |
1049 | self.configUP.dataTypeProject=str(self.proComDataType.currentText()) |
|
1355 | self.configUP.dataTypeProject=str(self.proComDataType.currentText()) | |
1050 | self.configUP.getfromWindowList.append(self.projectObj) |
|
1356 | self.configUP.getfromWindowList.append(self.projectObj) | |
1051 | else: |
|
1357 | else: | |
1052 | self.upObj=self.__upObjDict[i] |
|
1358 | self.upObj=self.__upObjDict[i] | |
1053 | self.configUP.getfromWindowList.append(self.upObj) |
|
1359 | self.configUP.getfromWindowList.append(self.upObj) | |
1054 |
|
1360 | |||
1055 | self.configUP.loadTotalList() |
|
1361 | self.configUP.loadTotalList() | |
1056 | self.configUP.show() |
|
1362 | self.configUP.show() | |
1057 | self.configUP.closed.connect(self.createUP) |
|
1363 | self.configUP.closed.connect(self.createUP) | |
1058 |
|
1364 | |||
1059 | def createUP(self): |
|
1365 | def createUP(self): | |
1060 |
|
1366 | |||
1061 | if not self.configUP.create: |
|
1367 | if not self.configUP.create: | |
1062 | return |
|
1368 | return | |
1063 |
|
1369 | |||
1064 | self.uporProObjRecover=self.configUP.getFromWindow |
|
1370 | self.uporProObjRecover=self.configUP.getFromWindow | |
1065 |
|
1371 | |||
1066 | self.upType = self.configUP.typeofUP |
|
1372 | self.upType = self.configUP.typeofUP | |
1067 | for i in self.__arbolDict: |
|
1373 | for i in self.__arbolDict: | |
1068 | if self.__arbolDict[i]==self.indexclick: |
|
1374 | if self.__arbolDict[i]==self.indexclick: | |
1069 | if self.__projObjDict.has_key(i)==True: |
|
1375 | if self.__projObjDict.has_key(i)==True: | |
1070 | self.projectObj=self.__projObjDict[int(i)] |
|
1376 | self.projectObj=self.__projObjDict[int(i)] | |
1071 |
|
1377 | |||
1072 | if self.__upObjDict.has_key(i)==True: |
|
1378 | if self.__upObjDict.has_key(i)==True: | |
1073 | self.upObj=self.__upObjDict[i] |
|
1379 | self.upObj=self.__upObjDict[i] | |
1074 | getIdProject=self.upObj.id[0] |
|
1380 | getIdProject=self.upObj.id[0] | |
1075 | self.projectObj=self.__projObjDict[int(getIdProject)] |
|
1381 | self.projectObj=self.__projObjDict[int(getIdProject)] | |
1076 |
|
1382 | |||
1077 | datatype=str(self.upType) |
|
1383 | datatype=str(self.upType) | |
1078 | uporprojectObj=self.uporProObjRecover |
|
1384 | uporprojectObj=self.uporProObjRecover | |
1079 |
|
1385 | |||
1080 | if uporprojectObj.getElementName()=='ProcUnit': |
|
1386 | if uporprojectObj.getElementName()=='ProcUnit': | |
1081 | inputId=uporprojectObj.getId() |
|
1387 | inputId=uporprojectObj.getId() | |
1082 | self.console.clear() |
|
1388 | self.console.clear() | |
1083 | self.console.append("Double Clik on the Processing Unit to enable the tab") |
|
1389 | self.console.append("Double Clik on the Processing Unit to enable the tab") | |
1084 | self.console.append("Before Add other Processing Unit complete the tab") |
|
1390 | self.console.append("Before Add other Processing Unit complete the tab") | |
1085 | else: |
|
1391 | else: | |
1086 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() |
|
1392 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() | |
1087 | self.console.clear() |
|
1393 | self.console.clear() | |
1088 | self.console.append("Double Clik on the Processing Unit to enable the tab") |
|
1394 | self.console.append("Double Clik on the Processing Unit to enable the tab") | |
1089 | self.console.append("Before Add other Project or Processing Unit complete the tab") |
|
1395 | self.console.append("Before Add other Project or Processing Unit complete the tab") | |
1090 |
|
1396 | |||
1091 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) |
|
1397 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) | |
1092 | self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1 |
|
1398 | self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1 | |
1093 |
|
1399 | |||
1094 | self.parentItem=self.__arbolDict[uporprojectObj.id] |
|
1400 | self.parentItem=self.__arbolDict[uporprojectObj.id] | |
1095 | self.numbertree=int(self.procUnitConfObj1.getId())-1 |
|
1401 | self.numbertree=int(self.procUnitConfObj1.getId())-1 | |
1096 | self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree)) |
|
1402 | self.__arbolDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree)) | |
1097 | self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) |
|
1403 | self.parentItem.appendRow(self.__arbolDict[self.procUnitConfObj1.id]) | |
1098 | self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] |
|
1404 | self.parentItem=self.__arbolDict[self.procUnitConfObj1.id] | |
1099 | self.treeProjectExplorer.expandAll() |
|
1405 | self.treeProjectExplorer.expandAll() | |
1100 |
|
1406 | |||
1101 |
|
1407 | |||
1102 | def searchData(self,path,ext,walk,expLabel=''): |
|
1408 | def searchData(self,path,ext,walk,expLabel=''): | |
1103 | dateList=[] |
|
1409 | dateList=[] | |
1104 | fileList=[] |
|
1410 | fileList=[] | |
1105 | if walk== 0: |
|
1411 | if walk== 0: | |
1106 | files= os.listdir(path) |
|
1412 | files= os.listdir(path) | |
1107 | for thisFile in files: |
|
1413 | for thisFile in files: | |
1108 | thisExt = os.path.splitext(thisFile)[-1] |
|
1414 | thisExt = os.path.splitext(thisFile)[-1] | |
1109 | print thisExt |
|
|||
1110 | if thisExt != ext: |
|
1415 | if thisExt != ext: | |
1111 | self.console.clear() |
|
1416 | self.console.clear() | |
1112 | self.console.append("There is no datatype selected in the path Directory") |
|
1417 | self.console.append("There is no datatype selected in the path Directory") | |
1113 | self.proOk.setEnabled(False) |
|
1418 | self.proOk.setEnabled(False) | |
1114 | continue |
|
1419 | continue | |
1115 |
|
1420 | |||
1116 | fileList.append(thisFile) |
|
1421 | fileList.append(thisFile) | |
1117 |
|
1422 | |||
1118 | for thisFile in fileList: |
|
1423 | for thisFile in fileList: | |
1119 |
|
1424 | |||
1120 | if not isRadarFile(thisFile): |
|
1425 | if not isRadarFile(thisFile): | |
1121 | self.console.clear() |
|
1426 | self.console.clear() | |
1122 | self.console.append("Please, Choose the Correct Path") |
|
1427 | self.console.append("Please, Choose the Correct Path") | |
1123 | self.proOk.setEnabled(False) |
|
1428 | self.proOk.setEnabled(False) | |
1124 | continue |
|
1429 | continue | |
1125 |
|
1430 | |||
1126 | year = int(thisFile[1:5]) |
|
1431 | year = int(thisFile[1:5]) | |
1127 | doy = int(thisFile[5:8]) |
|
1432 | doy = int(thisFile[5:8]) | |
1128 |
|
1433 | |||
1129 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) |
|
1434 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
1130 | dateformat = date.strftime("%Y/%m/%d") |
|
1435 | dateformat = date.strftime("%Y/%m/%d") | |
1131 |
|
1436 | |||
1132 | if dateformat not in dateList: |
|
1437 | if dateformat not in dateList: | |
1133 | dateList.append(dateformat) |
|
1438 | dateList.append(dateformat) | |
1134 |
|
1439 | |||
1135 | if walk == 1: |
|
1440 | if walk == 1: | |
1136 |
|
1441 | |||
1137 | dirList = os.listdir(path) |
|
1442 | dirList = os.listdir(path) | |
1138 |
|
1443 | |||
1139 | dirList.sort() |
|
1444 | dirList.sort() | |
1140 |
|
1445 | |||
1141 | dateList = [] |
|
1446 | dateList = [] | |
1142 |
|
1447 | |||
1143 | for thisDir in dirList: |
|
1448 | for thisDir in dirList: | |
1144 |
|
1449 | |||
1145 | if not isRadarPath(thisDir): |
|
1450 | if not isRadarPath(thisDir): | |
1146 | self.console.clear() |
|
1451 | self.console.clear() | |
1147 | self.console.append("Please, Choose the Correct Path") |
|
1452 | self.console.append("Please, Choose the Correct Path") | |
1148 | self.proOk.setEnabled(False) |
|
1453 | self.proOk.setEnabled(False) | |
1149 | continue |
|
1454 | continue | |
1150 |
|
1455 | |||
1151 | doypath = os.path.join(path, thisDir, expLabel) |
|
1456 | doypath = os.path.join(path, thisDir, expLabel) | |
1152 | if not os.path.exists(doypath): |
|
1457 | if not os.path.exists(doypath): | |
1153 | self.console.clear() |
|
1458 | self.console.clear() | |
1154 | self.console.append("Please, Choose the Correct Path") |
|
1459 | self.console.append("Please, Choose the Correct Path") | |
1155 | return |
|
1460 | return | |
1156 | files = os.listdir(doypath) |
|
1461 | files = os.listdir(doypath) | |
1157 | fileList = [] |
|
1462 | fileList = [] | |
1158 |
|
1463 | |||
1159 | for thisFile in files: |
|
1464 | for thisFile in files: | |
1160 | thisExt=os.path.splitext(thisFile)[-1] |
|
1465 | thisExt=os.path.splitext(thisFile)[-1] | |
1161 | if thisExt != ext: |
|
1466 | if thisExt != ext: | |
1162 | self.console.clear() |
|
1467 | self.console.clear() | |
1163 | self.console.append("There is no datatype selected in the Path Directory") |
|
1468 | self.console.append("There is no datatype selected in the Path Directory") | |
1164 | self.proOk.setEnabled(False) |
|
1469 | self.proOk.setEnabled(False) | |
1165 | continue |
|
1470 | continue | |
1166 |
|
1471 | |||
1167 | if not isRadarFile(thisFile): |
|
1472 | if not isRadarFile(thisFile): | |
1168 | self.proOk.setEnabled(False) |
|
1473 | self.proOk.setEnabled(False) | |
1169 | self.console.clear() |
|
1474 | self.console.clear() | |
1170 | self.console.append("Please, Choose the Correct Path") |
|
1475 | self.console.append("Please, Choose the Correct Path") | |
1171 | continue |
|
1476 | continue | |
1172 |
|
1477 | |||
1173 | fileList.append(thisFile) |
|
1478 | fileList.append(thisFile) | |
1174 | break |
|
1479 | break | |
1175 |
|
1480 | |||
1176 | if fileList == []: |
|
1481 | if fileList == []: | |
1177 | continue |
|
1482 | continue | |
1178 |
|
1483 | |||
1179 | year = int(thisDir[1:5]) |
|
1484 | year = int(thisDir[1:5]) | |
1180 | doy = int(thisDir[5:8]) |
|
1485 | doy = int(thisDir[5:8]) | |
1181 |
|
1486 | |||
1182 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) |
|
1487 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) | |
1183 | dateformat = date.strftime("%Y/%m/%d") |
|
1488 | dateformat = date.strftime("%Y/%m/%d") | |
1184 | dateList.append(dateformat) |
|
1489 | dateList.append(dateformat) | |
1185 |
|
1490 | |||
1186 | return dateList |
|
1491 | return dateList | |
1187 |
|
1492 | |||
1188 | def loadDays(self): |
|
1493 | def loadDays(self): | |
1189 | """ |
|
1494 | """ | |
1190 | Method to loads day |
|
1495 | Method to loads day | |
1191 | """ |
|
1496 | """ | |
1192 | ext=str(self.proDataType.text()) |
|
1497 | ext=str(self.proDataType.text()) | |
1193 |
|
1498 | |||
1194 | #-------------------------# |
|
1499 | #-------------------------# | |
1195 | walk= self.walk |
|
1500 | walk= self.walk | |
1196 |
|
1501 | |||
1197 | path=str(self.proDataPath.text()) |
|
1502 | path=str(self.proDataPath.text()) | |
1198 | if not os.path.exists(path): |
|
1503 | if not os.path.exists(path): | |
1199 | self.proOk.setEnabled(False) |
|
1504 | self.proOk.setEnabled(False) | |
1200 | self.console.clear() |
|
1505 | self.console.clear() | |
1201 | self.console.append("Write a correct a path") |
|
1506 | self.console.append("Write a correct a path") | |
1202 | return |
|
1507 | return | |
1203 | self.proComStartDate.clear() |
|
1508 | self.proComStartDate.clear() | |
1204 | self.proComEndDate.clear() |
|
1509 | self.proComEndDate.clear() | |
1205 | #Load List to select start day and end day.(QComboBox) |
|
1510 | #Load List to select start day and end day.(QComboBox) | |
1206 | dateList=self.searchData(path,ext=ext,walk=walk) |
|
1511 | dateList=self.searchData(path,ext=ext,walk=walk) | |
1207 | self.dateList=dateList |
|
1512 | self.dateList=dateList | |
1208 | for thisDate in dateList: |
|
1513 | for thisDate in dateList: | |
1209 | self.proComStartDate.addItem(thisDate) |
|
1514 | self.proComStartDate.addItem(thisDate) | |
1210 | self.proComEndDate.addItem(thisDate) |
|
1515 | self.proComEndDate.addItem(thisDate) | |
1211 | self.proComEndDate.setCurrentIndex(self.proComStartDate.count()-1) |
|
1516 | self.proComEndDate.setCurrentIndex(self.proComStartDate.count()-1) | |
1212 |
|
1517 | |||
1213 | def setWorkSpaceGUI(self,pathWorkSpace): |
|
1518 | def setWorkSpaceGUI(self,pathWorkSpace): | |
1214 | self.pathWorkSpace = pathWorkSpace |
|
1519 | self.pathWorkSpace = pathWorkSpace | |
|
1520 | #---Comandos Usados en Console----# | |||
|
1521 | def __del__(self): | |||
|
1522 | sys.stdout=sys.__stdout__ | |||
|
1523 | ||||
|
1524 | def normalOutputWritten(self,text): | |||
|
1525 | self.console.append(text) | |||
|
1526 | ||||
|
1527 | #-----Fin------# | |||
1215 |
|
1528 | |||
1216 | def setParameter(self): |
|
1529 | def setParameter(self): | |
1217 | self.setWindowTitle("ROJ-Signal Chain") |
|
1530 | self.setWindowTitle("ROJ-Signal Chain") | |
1218 | self.setWindowIcon(QtGui.QIcon("figure/adn.jpg")) |
|
1531 | self.setWindowIcon(QtGui.QIcon("figure/adn.jpg")) | |
|
1532 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |||
|
1533 | ||||
1219 | self.tabWidgetProject.setEnabled(False) |
|
1534 | self.tabWidgetProject.setEnabled(False) | |
1220 | self.tabVoltage.setEnabled(False) |
|
1535 | self.tabVoltage.setEnabled(False) | |
1221 | self.tabSpectra.setEnabled(False) |
|
1536 | self.tabSpectra.setEnabled(False) | |
1222 | self.tabCorrelation.setEnabled(False) |
|
1537 | self.tabCorrelation.setEnabled(False) | |
1223 |
|
1538 | |||
1224 | self.actionCreate.setShortcut('Ctrl+P') |
|
1539 | self.actionCreate.setShortcut('Ctrl+P') | |
1225 | self.actionStart.setShortcut('Ctrl+R') |
|
1540 | self.actionStart.setShortcut('Ctrl+R') | |
1226 | self.actionSave.setShortcut('Ctrl+S') |
|
1541 | self.actionSave.setShortcut('Ctrl+S') | |
1227 | self.actionClose.setShortcut('Ctrl+Q') |
|
1542 | self.actionClose.setShortcut('Ctrl+Q') | |
1228 |
|
1543 | |||
1229 | self.proName.clear() |
|
1544 | self.proName.clear() | |
1230 | self.proDataPath.setText('') |
|
1545 | self.proDataPath.setText('') | |
1231 | self.console.append("Welcome to Signal Chain please Create a New Project") |
|
1546 | self.console.append("Welcome to Signal Chain please Create a New Project") | |
1232 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
1547 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
1233 | self.time =QtCore.QTime() |
|
1548 | self.time =QtCore.QTime() | |
1234 | self.hour =0 |
|
1549 | self.hour =0 | |
1235 | self.min =0 |
|
1550 | self.min =0 | |
1236 | self.sec =0 |
|
1551 | self.sec =0 | |
1237 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
1552 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
1238 | startTime="00:00:00" |
|
1553 | startTime="00:00:00" | |
1239 | endTime="23:59:59" |
|
1554 | endTime="23:59:59" | |
1240 | starlist=startTime.split(":") |
|
1555 | starlist=startTime.split(":") | |
1241 | endlist=endTime.split(":") |
|
1556 | endlist=endTime.split(":") | |
1242 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1557 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) | |
1243 | self.proStartTime.setTime(self.time) |
|
1558 | self.proStartTime.setTime(self.time) | |
1244 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1559 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) | |
1245 | self.proEndTime.setTime(self.time) |
|
1560 | self.proEndTime.setTime(self.time) | |
1246 | self.proOk.setEnabled(False) |
|
1561 | self.proOk.setEnabled(False) | |
1247 | #set model Project Explorer |
|
1562 | #set model Project Explorer | |
1248 | self.model = QtGui.QStandardItemModel() |
|
1563 | self.model = QtGui.QStandardItemModel() | |
1249 | self.model.setHorizontalHeaderLabels(("Project Explorer",)) |
|
1564 | self.model.setHorizontalHeaderLabels(("Project Explorer",)) | |
1250 | layout = QtGui.QVBoxLayout() |
|
1565 | layout = QtGui.QVBoxLayout() | |
1251 | layout.addWidget(self.treeProjectExplorer) |
|
1566 | layout.addWidget(self.treeProjectExplorer) | |
1252 | self.treeProjectExplorer.setModel(self.model) |
|
1567 | self.treeProjectExplorer.setModel(self.model) | |
1253 | self.treeProjectExplorer.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
1568 | self.treeProjectExplorer.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
1254 | self.treeProjectExplorer.customContextMenuRequested.connect(self.popup) |
|
1569 | self.treeProjectExplorer.customContextMenuRequested.connect(self.popup) | |
1255 | self.treeProjectExplorer.clicked.connect(self.clickFunction) |
|
1570 | self.treeProjectExplorer.clicked.connect(self.clickFunction) | |
1256 |
|
1571 | |||
1257 | self.treeProjectExplorer.doubleClicked.connect(self.doubleclickFunction) |
|
1572 | self.treeProjectExplorer.doubleClicked.connect(self.doubleclickFunction) | |
1258 | self.treeProjectExplorer.expandAll() |
|
1573 | self.treeProjectExplorer.expandAll() | |
1259 | #set model Project Properties |
|
1574 | #set model Project Properties | |
1260 |
|
1575 | |||
1261 | self.model_2=treeModel() |
|
1576 | self.model_2=treeModel() | |
1262 | self.model_2.showtree() |
|
1577 | self.model_2.showtree() | |
1263 | self.treeProjectProperties.setModel(self.model_2) |
|
1578 | self.treeProjectProperties.setModel(self.model_2) | |
1264 | self.treeProjectProperties.expandAll() |
|
1579 | self.treeProjectProperties.expandAll() | |
1265 | #set Project |
|
1580 | #set Project | |
1266 | self.proDelay.setEnabled(False) |
|
1581 | self.proDelay.setEnabled(False) | |
1267 | self.proDataType.setReadOnly(True) |
|
1582 | self.proDataType.setReadOnly(True) | |
1268 |
|
1583 | |||
1269 | #set Operation Voltage |
|
1584 | #set Operation Voltage | |
1270 | self.volOpComChannels.setEnabled(False) |
|
1585 | self.volOpComChannels.setEnabled(False) | |
1271 | self.volOpComHeights.setEnabled(False) |
|
1586 | self.volOpComHeights.setEnabled(False) | |
1272 | self.volOpFilter.setEnabled(False) |
|
1587 | self.volOpFilter.setEnabled(False) | |
1273 | self.volOpComProfile.setEnabled(False) |
|
1588 | self.volOpComProfile.setEnabled(False) | |
1274 | self.volOpComCode.setEnabled(False) |
|
1589 | self.volOpComCode.setEnabled(False) | |
1275 | self.volOpCohInt.setEnabled(False) |
|
1590 | self.volOpCohInt.setEnabled(False) | |
1276 |
|
1591 | |||
1277 | self.volOpChannel.setEnabled(False) |
|
1592 | self.volOpChannel.setEnabled(False) | |
1278 | self.volOpHeights.setEnabled(False) |
|
1593 | self.volOpHeights.setEnabled(False) | |
1279 | self.volOpProfile.setEnabled(False) |
|
1594 | self.volOpProfile.setEnabled(False) | |
1280 | self.volOpComMode.setEnabled(False) |
|
1595 | self.volOpComMode.setEnabled(False) | |
1281 |
|
1596 | |||
1282 | self.volGraphPath.setEnabled(False) |
|
1597 | self.volGraphPath.setEnabled(False) | |
1283 | self.volGraphPrefix.setEnabled(False) |
|
1598 | self.volGraphPrefix.setEnabled(False) | |
1284 | self.volGraphToolPath.setEnabled(False) |
|
1599 | self.volGraphToolPath.setEnabled(False) | |
1285 |
|
1600 | |||
1286 | #set Graph Voltage |
|
1601 | #set Graph Voltage | |
1287 | self.volGraphIdFigure.setEnabled(False) |
|
|||
1288 | self.volGraphWintitle.setEnabled(False) |
|
|||
1289 | self.volGraphChannelList.setEnabled(False) |
|
1602 | self.volGraphChannelList.setEnabled(False) | |
1290 |
self.volGraph |
|
1603 | self.volGraphfreqrange.setEnabled(False) | |
|
1604 | self.volGraphHeightrange.setEnabled(False) | |||
|
1605 | ||||
1291 | self.volGraphyrange.setEnabled(False) |
|
1606 | self.volGraphyrange.setEnabled(False) | |
1292 | #set Operation Spectra |
|
1607 | #set Operation Spectra | |
1293 | self.specOpnFFTpoints.setEnabled(False) |
|
1608 | self.specOpnFFTpoints.setEnabled(False) | |
1294 | self.specOppairsList.setEnabled(False) |
|
1609 | self.specOppairsList.setEnabled(False) | |
1295 | self.specOpComChannel.setEnabled(False) |
|
1610 | self.specOpComChannel.setEnabled(False) | |
1296 | self.specOpComHeights.setEnabled(False) |
|
1611 | self.specOpComHeights.setEnabled(False) | |
1297 | self.specOpIncoherent.setEnabled(False) |
|
1612 | self.specOpIncoherent.setEnabled(False) | |
1298 | self.specOpRemoveDC .setEnabled(False) |
|
1613 | self.specOpRemoveDC .setEnabled(False) | |
1299 | self.specOpRemoveInterference.setEnabled(False) |
|
1614 | self.specOpRemoveInterference.setEnabled(False) | |
1300 |
|
1615 | |||
1301 | self.specOpChannel.setEnabled(False) |
|
1616 | self.specOpChannel.setEnabled(False) | |
1302 | self.specOpHeights.setEnabled(False) |
|
1617 | self.specOpHeights.setEnabled(False) | |
1303 | #set Graph Spectra |
|
1618 | #set Graph Spectra | |
1304 |
self.specG |
|
1619 | self.specGgraphChannelList.setEnabled(False) | |
1305 |
self.specG |
|
1620 | self.specGgraphFreq.setEnabled(False) | |
1306 |
self.specG |
|
1621 | self.specGgraphHeight.setEnabled(False) | |
1307 |
self.specGgraph |
|
1622 | self.specGgraphDbsrange.setEnabled(False) | |
1308 |
self.specGgraph |
|
1623 | self.specGgraphmagnitud.setEnabled(False) | |
1309 |
self.specGgraph |
|
1624 | self.specGgraphTimeRange.setEnabled(False) | |
1310 |
self.specG |
|
1625 | self.specGgraphPhaserange.setEnabled(False) | |
1311 | self.specGraphPath.setEnabled(False) |
|
1626 | self.specGraphPath.setEnabled(False) | |
1312 | self.specGraphToolPath.setEnabled(False) |
|
1627 | self.specGraphToolPath.setEnabled(False) | |
1313 | self.specGraphPrefix.setEnabled(False) |
|
1628 | self.specGraphPrefix.setEnabled(False) | |
1314 |
|
1629 | |||
1315 |
|
1630 | |||
1316 | #tool tip gui |
|
1631 | #tool tip gui | |
1317 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
1632 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
1318 | self.treeProjectExplorer.setToolTip('Right clik to add Project or Unit Process') |
|
1633 | self.treeProjectExplorer.setToolTip('Right clik to add Project or Unit Process') | |
1319 | #tool tip gui project |
|
1634 | #tool tip gui project | |
1320 | self.proComWalk.setToolTip('<b>Search0</b>:<i>Search file in format .r or pdata</i> <b>Search1</b>:<i>Search file in a directory DYYYYDOY</i>') |
|
1635 | self.proComWalk.setToolTip('<b>Search0</b>:<i>Search file in format .r or pdata</i> <b>Search1</b>:<i>Search file in a directory DYYYYDOY</i>') | |
1321 | self.proComWalk.setCurrentIndex(1) |
|
1636 | self.proComWalk.setCurrentIndex(1) | |
1322 | #tool tip gui volOp |
|
1637 | #tool tip gui volOp | |
1323 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
1638 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
1324 | self.volOpHeights.setToolTip('Example: 90,180') |
|
1639 | self.volOpHeights.setToolTip('Example: 90,180') | |
1325 | self.volOpFilter.setToolTip('Example: 3') |
|
1640 | self.volOpFilter.setToolTip('Example: 3') | |
1326 | self.volOpProfile.setToolTip('Example:0,125 ') |
|
1641 | self.volOpProfile.setToolTip('Example:0,125 ') | |
1327 | self.volOpCohInt.setToolTip('Example: 100') |
|
1642 | self.volOpCohInt.setToolTip('Example: 100') | |
1328 | self.volOpOk.setToolTip('If you have finish, please Ok ') |
|
1643 | self.volOpOk.setToolTip('If you have finish, please Ok ') | |
1329 | #tool tip gui volGraph |
|
1644 | #tool tip gui volGraph | |
1330 |
self.volGraph |
|
1645 | self.volGraphfreqrange.setToolTip('Example: 10,150') | |
1331 |
self.volGraph |
|
1646 | self.volGraphHeightrange.setToolTip('Example: 20,180') | |
1332 | self.volGraphyrange.setToolTip('Example: 20,180') |
|
|||
1333 | self.volGraphOk.setToolTip('If you have finish, please Ok ') |
|
1647 | self.volGraphOk.setToolTip('If you have finish, please Ok ') | |
1334 |
|
|
1648 | #tool tip gui specOp | |
1335 | self.specOpnFFTpoints.setToolTip('Example: 100') |
|
1649 | self.specOpnFFTpoints.setToolTip('Example: 100') | |
1336 | self.specOpIncoherent.setToolTip('Example: 150') |
|
1650 | self.specOpIncoherent.setToolTip('Example: 150') | |
1337 | self.specOpRemoveDC .setToolTip('Example: 1') |
|
1651 | self.specOpRemoveDC .setToolTip('Example: 1') | |
1338 |
|
1652 | |||
1339 |
|
1653 | |||
1340 | self.specOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
1654 | self.specOpChannel.setToolTip('Example: 1,2,3,4,5') | |
1341 | self.specOpHeights.setToolTip('Example: 90,180') |
|
1655 | self.specOpHeights.setToolTip('Example: 90,180') | |
1342 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
1656 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
1343 | #tool tip gui specGraph |
|
1657 | #tool tip gui specGraph | |
1344 | self.specGraphIdFigure.setToolTip('Example: 2') |
|
|||
1345 | self.specGraphWinTitle.setToolTip('Example: Myplot') |
|
|||
1346 | self.specGraphChannelList.setToolTip('Example: Myplot') |
|
|||
1347 | self.specGgraphxrange.setToolTip('Example: 10,150') |
|
|||
1348 | self.specGgraphyrange.setToolTip('Example: 20,160') |
|
|||
1349 | self.specGgraphzrange.setToolTip('Example: 30,170') |
|
|||
1350 |
|
||||
1351 | self.specGraphPrefix.setToolTip('Example: figure') |
|
|||
1352 |
|
1658 | |||
|
1659 | self.specGgraphChannelList.setToolTip('Example: Myplot') | |||
|
1660 | self.specGgraphFreq.setToolTip('Example: 10,150') | |||
|
1661 | self.specGgraphHeight.setToolTip('Example: 20,160') | |||
|
1662 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |||
|
1663 | ||||
|
1664 | self.specGraphPrefix.setToolTip('Example: figure') | |||
1353 |
|
1665 | |||
1354 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
|
1666 | class UnitProcess(QMainWindow, Ui_UnitProcess): | |
1355 | """ |
|
1667 | """ | |
1356 | Class documentation goes here. |
|
1668 | Class documentation goes here. | |
1357 | """ |
|
1669 | """ | |
1358 | closed=pyqtSignal() |
|
1670 | closed=pyqtSignal() | |
1359 | create= False |
|
1671 | create= False | |
1360 | def __init__(self, parent = None): |
|
1672 | def __init__(self, parent = None): | |
1361 | """ |
|
1673 | """ | |
1362 | Constructor |
|
1674 | Constructor | |
1363 | """ |
|
1675 | """ | |
1364 | QMainWindow.__init__(self, parent) |
|
1676 | QMainWindow.__init__(self, parent) | |
1365 | self.setupUi(self) |
|
1677 | self.setupUi(self) | |
1366 | self.getFromWindow=None |
|
1678 | self.getFromWindow=None | |
1367 | self.getfromWindowList=[] |
|
1679 | self.getfromWindowList=[] | |
1368 | self.dataTypeProject=None |
|
1680 | self.dataTypeProject=None | |
1369 |
|
1681 | |||
1370 | self.listUP=None |
|
1682 | self.listUP=None | |
1371 |
|
1683 | |||
1372 | @pyqtSignature("") |
|
1684 | @pyqtSignature("") | |
1373 | def on_unitPokbut_clicked(self): |
|
1685 | def on_unitPokbut_clicked(self): | |
1374 | """ |
|
1686 | """ | |
1375 | Slot documentation goes here. |
|
1687 | Slot documentation goes here. | |
1376 | """ |
|
1688 | """ | |
1377 | self.create =True |
|
1689 | self.create =True | |
1378 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
1690 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
1379 | #self.nameofUP= str(self.nameUptxt.text()) |
|
1691 | #self.nameofUP= str(self.nameUptxt.text()) | |
1380 | self.typeofUP= str(self.comboTypeBox.currentText()) |
|
1692 | self.typeofUP= str(self.comboTypeBox.currentText()) | |
1381 | self.close() |
|
1693 | self.close() | |
1382 |
|
1694 | |||
1383 |
|
1695 | |||
1384 | @pyqtSignature("") |
|
1696 | @pyqtSignature("") | |
1385 | def on_unitPcancelbut_clicked(self): |
|
1697 | def on_unitPcancelbut_clicked(self): | |
1386 | """ |
|
1698 | """ | |
1387 | Slot documentation goes here. |
|
1699 | Slot documentation goes here. | |
1388 | """ |
|
1700 | """ | |
1389 | self.create=False |
|
1701 | self.create=False | |
1390 | self.close() |
|
1702 | self.close() | |
1391 |
|
1703 | |||
1392 | def loadTotalList(self): |
|
1704 | def loadTotalList(self): | |
1393 | self.comboInputBox.clear() |
|
1705 | self.comboInputBox.clear() | |
1394 | for i in self.getfromWindowList: |
|
1706 | for i in self.getfromWindowList: | |
1395 |
|
1707 | |||
1396 | name=i.getElementName() |
|
1708 | name=i.getElementName() | |
1397 | if name=='Project': |
|
1709 | if name=='Project': | |
1398 | id= i.id |
|
1710 | id= i.id | |
1399 | name=i.name |
|
1711 | name=i.name | |
1400 | if self.dataTypeProject=='Voltage': |
|
1712 | if self.dataTypeProject=='Voltage': | |
1401 | self.comboTypeBox.clear() |
|
1713 | self.comboTypeBox.clear() | |
1402 | self.comboTypeBox.addItem("Voltage") |
|
1714 | self.comboTypeBox.addItem("Voltage") | |
1403 |
|
1715 | |||
1404 | if self.dataTypeProject=='Spectra': |
|
1716 | if self.dataTypeProject=='Spectra': | |
1405 | self.comboTypeBox.clear() |
|
1717 | self.comboTypeBox.clear() | |
1406 | self.comboTypeBox.addItem("Spectra") |
|
1718 | self.comboTypeBox.addItem("Spectra") | |
1407 | self.comboTypeBox.addItem("Correlation") |
|
1719 | self.comboTypeBox.addItem("Correlation") | |
1408 |
|
1720 | |||
1409 | if name=='ProcUnit': |
|
1721 | if name=='ProcUnit': | |
1410 | id=int(i.id)-1 |
|
1722 | id=int(i.id)-1 | |
1411 | name=i.datatype |
|
1723 | name=i.datatype | |
1412 | if name == 'Voltage': |
|
1724 | if name == 'Voltage': | |
1413 | self.comboTypeBox.clear() |
|
1725 | self.comboTypeBox.clear() | |
1414 | self.comboTypeBox.addItem("Spectra") |
|
1726 | self.comboTypeBox.addItem("Spectra") | |
1415 | self.comboTypeBox.addItem("Correlation") |
|
1727 | self.comboTypeBox.addItem("Correlation") | |
1416 | if name == 'Spectra': |
|
1728 | if name == 'Spectra': | |
1417 | self.comboTypeBox.clear() |
|
1729 | self.comboTypeBox.clear() | |
1418 | self.comboTypeBox.addItem("Spectra") |
|
1730 | self.comboTypeBox.addItem("Spectra") | |
1419 | self.comboTypeBox.addItem("Correlation") |
|
1731 | self.comboTypeBox.addItem("Correlation") | |
1420 |
|
1732 | |||
1421 |
|
1733 | |||
1422 | self.comboInputBox.addItem(str(name)) |
|
1734 | self.comboInputBox.addItem(str(name)) | |
1423 | #self.comboInputBox.addItem(str(name)+str(id)) |
|
1735 | #self.comboInputBox.addItem(str(name)+str(id)) | |
1424 |
|
1736 | |||
1425 | def closeEvent(self, event): |
|
1737 | def closeEvent(self, event): | |
1426 | self.closed.emit() |
|
1738 | self.closed.emit() | |
1427 | event.accept() No newline at end of file |
|
1739 | event.accept() | |
|
1740 | ||||
|
1741 | class ShowMeConsole(QtCore.QObject): | |||
|
1742 | textWritten=QtCore.pyqtSignal(str) | |||
|
1743 | def write (self,text): | |||
|
1744 | self.textWritten.emit(str(text)) No newline at end of file |
General Comments 0
You need to be logged in to leave comments.
Login now