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