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