@@ -1,1751 +1,1753 | |||
|
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 | 552 | channelList=self.volGraphChannelList.text() |
|
553 | 553 | xvalue= self.volGraphfreqrange.text() |
|
554 | 554 | yvalue= self.volGraphHeightrange.text() |
|
555 | 555 | |
|
556 | 556 | opObj1.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
557 | 557 | opObj10.addParameter(name='channelList', value=channelList, format='int') |
|
558 | 558 | xvalueList=xvalue.split(',') |
|
559 | 559 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
560 | 560 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
561 | 561 | yvalueList=yvalue.split(",") |
|
562 | 562 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
563 | 563 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
564 | 564 | |
|
565 | 565 | if self.volGraphCebSave.isChecked(): |
|
566 | 566 | opObj10.addParameter(name='save', value='1', format='int') |
|
567 | 567 | opObj10.addParameter(name='figpath', value= self.volGraphPath.text()) |
|
568 | 568 | opObj10.addParameter(name='figfile', value= self.volGraphPrefix.text()) |
|
569 | 569 | |
|
570 | 570 | self.tabgraphVoltage.setEnabled(False) |
|
571 | 571 | self.console.clear() |
|
572 | 572 | self.console.append("If you want to save your project") |
|
573 | 573 | self.console.append("click on your project name in the Tree Project Explorer") |
|
574 | 574 | |
|
575 | 575 | #------Spectra operation--------# |
|
576 | 576 | @pyqtSignature("int") |
|
577 | 577 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
578 | 578 | """ |
|
579 | 579 | Habilita la opcion de a�adir el par�metro CrossSpectra a la Unidad de Procesamiento . |
|
580 | 580 | """ |
|
581 | 581 | if p0==2: |
|
582 | 582 | # self.specOpnFFTpoints.setEnabled(True) |
|
583 | 583 | self.specOppairsList.setEnabled(True) |
|
584 | 584 | if p0==0: |
|
585 | 585 | # self.specOpnFFTpoints.setEnabled(False) |
|
586 | 586 | self.specOppairsList.setEnabled(False) |
|
587 | 587 | |
|
588 | 588 | @pyqtSignature("int") |
|
589 | 589 | def on_specOpCebChannel_stateChanged(self, p0): |
|
590 | 590 | """ |
|
591 | 591 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
592 | 592 | """ |
|
593 | 593 | if p0==2: |
|
594 | 594 | self.specOpChannel.setEnabled(True) |
|
595 | 595 | self.specOpComChannel.setEnabled(True) |
|
596 | 596 | if p0==0: |
|
597 | 597 | self.specOpChannel.setEnabled(False) |
|
598 | 598 | self.specOpComChannel.setEnabled(False) |
|
599 | 599 | |
|
600 | 600 | @pyqtSignature("int") |
|
601 | 601 | def on_specOpCebHeights_stateChanged(self, p0): |
|
602 | 602 | """ |
|
603 | 603 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
604 | 604 | """ |
|
605 | 605 | if p0==2: |
|
606 | 606 | self.specOpComHeights.setEnabled(True) |
|
607 | 607 | self.specOpHeights.setEnabled(True) |
|
608 | 608 | if p0==0: |
|
609 | 609 | self.specOpComHeights.setEnabled(False) |
|
610 | 610 | self.specOpHeights.setEnabled(False) |
|
611 | 611 | |
|
612 | 612 | |
|
613 | 613 | @pyqtSignature("int") |
|
614 | 614 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
615 | 615 | """ |
|
616 | 616 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
617 | 617 | """ |
|
618 | 618 | if p0==2: |
|
619 | 619 | self.specOpIncoherent.setEnabled(True) |
|
620 | 620 | if p0==0: |
|
621 | 621 | self.specOpIncoherent.setEnabled(False) |
|
622 | 622 | |
|
623 | 623 | @pyqtSignature("int") |
|
624 | 624 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
625 | 625 | """ |
|
626 | 626 | Habilita la opcion de a�adir el par�metro nFFTPoints a la Unidad de Procesamiento . |
|
627 | 627 | """ |
|
628 | 628 | if p0==2: |
|
629 | 629 | self.specOpRemoveDC.setEnabled(True) |
|
630 | 630 | if p0==0: |
|
631 | 631 | self.specOpRemoveDC.setEnabled(False) |
|
632 | 632 | |
|
633 | 633 | @pyqtSignature("") |
|
634 | 634 | def on_specOpOk_clicked(self): |
|
635 | 635 | """ |
|
636 | 636 | AÑADE OPERACION SPECTRA |
|
637 | 637 | """ |
|
638 | 638 | for i in self.__treeObjDict: |
|
639 | 639 | if self.__treeObjDict[i]==self.indexclick: |
|
640 | 640 | if self.__upObjDict.has_key(i)==True: |
|
641 | 641 | self.upObj=self.__upObjDict[i] |
|
642 | 642 | value1=self.specOpnFFTpoints.text() |
|
643 | 643 | try: |
|
644 | 644 | value1=int(self.specOpnFFTpoints.text()) |
|
645 | self.tabgraphSpectra.setEnabled(True) | |
|
645 | 646 | except: |
|
647 | self.tabgraphSpectra.setEnabled(False) | |
|
646 | 648 | self.console.clear() |
|
647 | 649 | self.console.append("Please Write the number of FFT") |
|
648 | 650 | return 0 |
|
649 | 651 | self.upObj.addParameter(name='nFFTPoints',value=value1,format='int') |
|
650 | 652 | # self.operObjList.append(opObj10) |
|
651 | 653 | if self.specOpCebCrossSpectra.isChecked(): |
|
652 | 654 | value2=self.specOppairsList.text() |
|
653 | 655 | self.upObj.addParameter(name='pairsList', value=value2, format='pairslist') |
|
654 | 656 | |
|
655 | 657 | if self.specOpCebHeights.isChecked(): |
|
656 | 658 | if self.specOpComHeights.currentIndex()== 0: |
|
657 | 659 | opObj10=self.upObj.addOperation(name='selectHeights') |
|
658 | 660 | value=self.specOpHeights.text() |
|
659 | 661 | valueList=value.split(',') |
|
660 | 662 | opObj10.addParameter(name='minHei', value=valueList[0], format='float') |
|
661 | 663 | opObj10.addParameter(name='maxHei', value=valueList[1], format='float') |
|
662 | 664 | else: |
|
663 | 665 | opObj10=self.upObj.addOperation(name='selectHeightsByIndex') |
|
664 | 666 | value=self.specOpHeights.text() |
|
665 | 667 | valueList=value.split(',') |
|
666 | 668 | opObj10.addParameter(name='minIndex', value=valueList[0], format='float') |
|
667 | 669 | opObj10.addParameter(name='maxIndex', value=valueList[1], format='float') |
|
668 | 670 | |
|
669 | 671 | if self.specOpCebChannel.isChecked(): |
|
670 | 672 | if self.specOpComChannel.currentIndex()== 0: |
|
671 | 673 | opObj10=self.upObj.addOperation(name="selectChannels") |
|
672 | 674 | self.operObjList.append(opObj10) |
|
673 | 675 | value=self.specOpChannel.text() |
|
674 | 676 | opObj10.addParameter(name='channelList', value=value, format='intlist') |
|
675 | 677 | else: |
|
676 | 678 | opObj10=self.upObj.addOperation(name="selectChannelsByIndex") |
|
677 | 679 | self.operObjList.append(opObj10) |
|
678 | 680 | value=self.specOpChannel.text() |
|
679 | 681 | opObj10.addParameter(name='channelIndexList', value=value, format='intlist') |
|
680 | 682 | |
|
681 | 683 | if self.specOpCebIncoherent.isChecked(): |
|
682 | 684 | opObj10=self.upObj.addOperation(name='IncohInt', optype='other') |
|
683 | 685 | self.operObjList.append(opObj10) |
|
684 | 686 | value=self.specOpIncoherent.text() |
|
685 | 687 | opObj10.addParameter(name='n', value=value, format='float') |
|
686 | 688 | |
|
687 | 689 | if self.specOpCebRemoveDC.isChecked(): |
|
688 | 690 | opObj10=self.upObj.addOperation(name='removeDC') |
|
689 | 691 | value=self.specOpRemoveDC.text() |
|
690 | 692 | opObj10.addParameter(name='mode', value=value,format='int') |
|
691 | 693 | |
|
692 | 694 | |
|
693 | 695 | #self.tabopSpectra.setEnabled(False) |
|
694 | 696 | self.console.clear() |
|
695 | 697 | self.console.append("If you want to save your project") |
|
696 | 698 | self.console.append("click on your project name in the Tree Project Explorer") |
|
697 | 699 | |
|
698 | 700 | |
|
699 | 701 | #------Spectra Graph--------# |
|
700 | 702 | @pyqtSignature("int") |
|
701 | 703 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
702 | 704 | |
|
703 | 705 | if p0==2: |
|
704 | 706 | self.specGgraphFreq.setEnabled(True) |
|
705 | 707 | self.specGgraphHeight.setEnabled(True) |
|
706 | 708 | self.specGgraphDbsrange.setEnabled(True) |
|
707 | 709 | if p0==0: |
|
708 | 710 | self.specGgraphFreq.setEnabled(False) |
|
709 | 711 | self.specGgraphHeight.setEnabled(False) |
|
710 | 712 | self.specGgraphDbsrange.setEnabled(False) |
|
711 | 713 | |
|
712 | 714 | |
|
713 | 715 | @pyqtSignature("int") |
|
714 | 716 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
715 | 717 | |
|
716 | 718 | if p0==2: |
|
717 | 719 | self.specGgraphFreq.setEnabled(True) |
|
718 | 720 | self.specGgraphHeight.setEnabled(True) |
|
719 | 721 | self.specGgraphmagnitud.setEnabled(True) |
|
720 | 722 | if p0==0: |
|
721 | 723 | self.specGgraphFreq.setEnabled(False) |
|
722 | 724 | self.specGgraphHeight.setEnabled(False) |
|
723 | 725 | self.specGgraphmagnitud.setEnabled(False) |
|
724 | 726 | |
|
725 | 727 | @pyqtSignature("int") |
|
726 | 728 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
727 | 729 | |
|
728 | 730 | if p0==2: |
|
729 | 731 | self.specGgraphTimeRange.setEnabled(True) |
|
730 | 732 | self.specGgraphHeight.setEnabled(True) |
|
731 | 733 | self.specGgraphDbsrange.setEnabled(True) |
|
732 | 734 | if p0==0: |
|
733 | 735 | self.specGgraphTimeRange.setEnabled(False) |
|
734 | 736 | self.specGgraphHeight.setEnabled(False) |
|
735 | 737 | self.specGgraphDbsrange.setEnabled(False) |
|
736 | 738 | |
|
737 | 739 | |
|
738 | 740 | |
|
739 | 741 | @pyqtSignature("int") |
|
740 | 742 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
741 | 743 | |
|
742 | 744 | if p0==2: |
|
743 | 745 | self.specGgraphTimeRange.setEnabled(True) |
|
744 | 746 | self.specGgraphHeight.setEnabled(True) |
|
745 | 747 | self.specGgraphmagnitud.setEnabled(True) |
|
746 | 748 | if p0==0: |
|
747 | 749 | self.specGgraphTimeRange.setEnabled(False) |
|
748 | 750 | self.specGgraphHeight.setEnabled(False) |
|
749 | 751 | self.specGgraphmagnitud.setEnabled(False) |
|
750 | 752 | |
|
751 | 753 | |
|
752 | 754 | @pyqtSignature("int") |
|
753 | 755 | def on_specGraphRTIfromnoise_stateChanged(self, p0): |
|
754 | 756 | |
|
755 | 757 | if p0==2: |
|
756 | 758 | self.specGgraphTimeRange.setEnabled(True) |
|
757 | 759 | self.specGgraphHeight.setEnabled(True) |
|
758 | 760 | self.specGgraphDbsrange.setEnabled(True) |
|
759 | 761 | if p0==0: |
|
760 | 762 | self.specGgraphTimeRange.setEnabled(False) |
|
761 | 763 | self.specGgraphHeight.setEnabled(False) |
|
762 | 764 | self.specGgraphDbsrange.setEnabled(False) |
|
763 | 765 | |
|
764 | 766 | @pyqtSignature("int") |
|
765 | 767 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
766 | 768 | |
|
767 | 769 | if p0==2: |
|
768 | 770 | |
|
769 | 771 | self.specGgraphHeight.setEnabled(True) |
|
770 | 772 | self.specGgraphDbsrange.setEnabled(True) |
|
771 | 773 | if p0==0: |
|
772 | 774 | self.specGgraphHeight.setEnabled(False) |
|
773 | 775 | self.specGgraphDbsrange.setEnabled(False) |
|
774 | 776 | |
|
775 | 777 | @pyqtSignature("int") |
|
776 | 778 | def on_specGraphPhase_stateChanged(self, p0): |
|
777 | 779 | |
|
778 | 780 | if p0==2: |
|
779 | 781 | self.specGgraphTimeRange.setEnabled(True) |
|
780 | 782 | self.specGgraphPhaserange.setEnabled(True) |
|
781 | 783 | |
|
782 | 784 | if p0==0: |
|
783 | 785 | self.specGgraphTimeRange.setEnabled(False) |
|
784 | 786 | self.specGgraphPhaserange.setEnabled(False) |
|
785 | 787 | |
|
786 | 788 | @pyqtSignature("int") |
|
787 | 789 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
788 | 790 | """ |
|
789 | 791 | """ |
|
790 | 792 | if p0==2: |
|
791 | 793 | self.specGraphPath.setEnabled(True) |
|
792 | 794 | self.specGraphPrefix.setEnabled(True) |
|
793 | 795 | self.specGraphToolPath.setEnabled(True) |
|
794 | 796 | if p0==0: |
|
795 | 797 | self.specGraphPath.setEnabled(False) |
|
796 | 798 | self.specGraphPrefix.setEnabled(False) |
|
797 | 799 | self.specGraphToolPath.setEnabled(False) |
|
798 | 800 | |
|
799 | 801 | |
|
800 | 802 | @pyqtSignature("int") |
|
801 | 803 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
802 | 804 | if p0==2: |
|
803 | 805 | self.specGraphPath.setEnabled(True) |
|
804 | 806 | self.specGraphPrefix.setEnabled(True) |
|
805 | 807 | self.specGraphToolPath.setEnabled(True) |
|
806 | 808 | |
|
807 | 809 | @pyqtSignature("int") |
|
808 | 810 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
809 | 811 | if p0==2: |
|
810 | 812 | self.specGraphPath.setEnabled(True) |
|
811 | 813 | self.specGraphPrefix.setEnabled(True) |
|
812 | 814 | self.specGraphToolPath.setEnabled(True) |
|
813 | 815 | |
|
814 | 816 | @pyqtSignature("int") |
|
815 | 817 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
816 | 818 | if p0==2: |
|
817 | 819 | self.specGraphPath.setEnabled(True) |
|
818 | 820 | self.specGraphPrefix.setEnabled(True) |
|
819 | 821 | self.specGraphToolPath.setEnabled(True) |
|
820 | 822 | |
|
821 | 823 | @pyqtSignature("int") |
|
822 | 824 | def on_specGraphSaveRTIfromNoise_stateChanged(self, p0): |
|
823 | 825 | if p0==2: |
|
824 | 826 | self.specGraphPath.setEnabled(True) |
|
825 | 827 | self.specGraphPrefix.setEnabled(True) |
|
826 | 828 | self.specGraphToolPath.setEnabled(True) |
|
827 | 829 | |
|
828 | 830 | @pyqtSignature("int") |
|
829 | 831 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
830 | 832 | if p0==2: |
|
831 | 833 | self.specGraphPath.setEnabled(True) |
|
832 | 834 | self.specGraphPrefix.setEnabled(True) |
|
833 | 835 | self.specGraphToolPath.setEnabled(True) |
|
834 | 836 | |
|
835 | 837 | @pyqtSignature("int") |
|
836 | 838 | def on_specGraphSavePhase_stateChanged(self, p0): |
|
837 | 839 | if p0==2: |
|
838 | 840 | self.specGraphPath.setEnabled(True) |
|
839 | 841 | self.specGraphPrefix.setEnabled(True) |
|
840 | 842 | self.specGraphToolPath.setEnabled(True) |
|
841 | 843 | |
|
842 | 844 | @pyqtSignature("int") |
|
843 | 845 | def on_specGraphSaveCCF_stateChanged(self, p0): |
|
844 | 846 | if p0==2: |
|
845 | 847 | self.specGraphPath.setEnabled(True) |
|
846 | 848 | self.specGraphPrefix.setEnabled(True) |
|
847 | 849 | self.specGraphToolPath.setEnabled(True) |
|
848 | 850 | |
|
849 | 851 | @pyqtSignature("") |
|
850 | 852 | def on_specGraphToolPath_clicked(self): |
|
851 | 853 | """ |
|
852 | 854 | """ |
|
853 | 855 | self.savePath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
854 | 856 | self.specGraphPath.setText(self.savePath) |
|
855 | 857 | if not os.path.exists(self.savePath): |
|
856 | 858 | self.console.clear() |
|
857 | 859 | self.console.append("Write a correct a path") |
|
858 | 860 | return |
|
859 | 861 | |
|
860 | 862 | @pyqtSignature("") |
|
861 | 863 | def on_specGraphOk_clicked(self): |
|
862 | 864 | |
|
863 | 865 | for i in self.__treeObjDict: |
|
864 | 866 | if self.__treeObjDict[i]==self.indexclick: |
|
865 | 867 | if self.__upObjDict.has_key(i)==True: |
|
866 | 868 | self.upObj=self.__upObjDict[i] |
|
867 | 869 | if self.specGraphCebSpectraplot.isChecked(): |
|
868 | 870 | opObj10=self.upObj.addOperation(name='SpectraPlot',optype='other') |
|
869 | 871 | |
|
870 | 872 | self.idImag += 1 |
|
871 | 873 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
872 | 874 | |
|
873 | 875 | channelList=self.specGgraphChannelList.text() |
|
874 | 876 | if self.specGgraphChannelList.isModified(): |
|
875 | 877 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
876 | 878 | |
|
877 | 879 | xvalue= self.specGgraphFreq.text() |
|
878 | 880 | if self.specGgraphFreq.isModified(): |
|
879 | 881 | xvalueList=xvalue.split(',') |
|
880 | 882 | try: |
|
881 | 883 | value=int(xvalueList[0]) |
|
882 | 884 | value=int(xvalueList[1]) |
|
883 | 885 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
884 | 886 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
885 | 887 | except: |
|
886 | 888 | return 0 |
|
887 | 889 | |
|
888 | 890 | yvalue= self.specGgraphHeight.text() |
|
889 | 891 | if self.specGgraphHeight.isModified(): |
|
890 | 892 | yvalueList=yvalue.split(",") |
|
891 | 893 | try: |
|
892 | 894 | value=int(yvalueList[0]) |
|
893 | 895 | value=int(yvalueList[1]) |
|
894 | 896 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
895 | 897 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
896 | 898 | except: |
|
897 | 899 | return 0 |
|
898 | 900 | |
|
899 | 901 | zvalue= self.specGgraphDbsrange.text() |
|
900 | 902 | if self.specGgraphDbsrange.isModified(): |
|
901 | 903 | zvalueList=zvalue.split(",") |
|
902 | 904 | try: |
|
903 | 905 | value=int(zvalueList[0]) |
|
904 | 906 | value=int(zvalueList[1]) |
|
905 | 907 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
906 | 908 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
907 | 909 | except: |
|
908 | 910 | return 0 |
|
909 | 911 | |
|
910 | 912 | if self.specGraphSaveSpectra.isChecked(): |
|
911 | 913 | opObj10.addParameter(name='save', value='1', format='bool') |
|
912 | 914 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
913 | 915 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
914 | 916 | |
|
915 | 917 | |
|
916 | 918 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
917 | 919 | opObj10=self.upObj.addOperation(name='CrossSpectraPlot',optype='other') |
|
918 | 920 | |
|
919 | 921 | opObj10.addParameter(name='power_cmap', value='jet', format='str') |
|
920 | 922 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
921 | 923 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
922 | 924 | |
|
923 | 925 | |
|
924 | 926 | self.idImag += 1 |
|
925 | 927 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
926 | 928 | |
|
927 | 929 | channelList=self.specGgraphChannelList.text() |
|
928 | 930 | if self.specGgraphChannelList.isModified(): |
|
929 | 931 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
930 | 932 | |
|
931 | 933 | xvalue= self.specGgraphFreq.text() |
|
932 | 934 | if self.specGgraphFreq.isModified(): |
|
933 | 935 | xvalueList=xvalue.split(',') |
|
934 | 936 | try: |
|
935 | 937 | value=int(xvalueList[0]) |
|
936 | 938 | value=int(xvalueList[1]) |
|
937 | 939 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
938 | 940 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
939 | 941 | except: |
|
940 | 942 | return 0 |
|
941 | 943 | |
|
942 | 944 | yvalue= self.specGgraphHeight.text() |
|
943 | 945 | if self.specGgraphHeight.isModified(): |
|
944 | 946 | yvalueList=yvalue.split(",") |
|
945 | 947 | try: |
|
946 | 948 | value=int(yvalueList[0]) |
|
947 | 949 | value=int(yvalueList[1]) |
|
948 | 950 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
949 | 951 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
950 | 952 | except: |
|
951 | 953 | return 0 |
|
952 | 954 | |
|
953 | 955 | zvalue= self.specGgraphmagnitud.text() |
|
954 | 956 | if self.specGgraphmagnitud.isModified(): |
|
955 | 957 | zvalueList=zvalue.split(",") |
|
956 | 958 | try: |
|
957 | 959 | value=int(zvalueList[0]) |
|
958 | 960 | value=int(zvalueList[1]) |
|
959 | 961 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
960 | 962 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
961 | 963 | except: |
|
962 | 964 | return 0 |
|
963 | 965 | |
|
964 | 966 | if self.specGraphSaveCross.isChecked(): |
|
965 | 967 | opObj10.addParameter(name='save', value='1', format='bool') |
|
966 | 968 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
967 | 969 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
968 | 970 | |
|
969 | 971 | |
|
970 | 972 | |
|
971 | 973 | if self.specGraphCebRTIplot.isChecked(): |
|
972 | 974 | opObj10=self.upObj.addOperation(name='RTIPlot',optype='other') |
|
973 | 975 | |
|
974 | 976 | self.idImag += 1 |
|
975 | 977 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
976 | 978 | |
|
977 | 979 | channelList=self.specGgraphChannelList.text() |
|
978 | 980 | if self.specGgraphChannelList.isModified(): |
|
979 | 981 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
980 | 982 | |
|
981 | 983 | xvalue= self.specGgraphTimeRange.text() |
|
982 | 984 | if self.specGgraphTimeRange.isModified(): |
|
983 | 985 | xvalueList=xvalue.split(',') |
|
984 | 986 | try: |
|
985 | 987 | value=int(xvalueList[0]) |
|
986 | 988 | value=int(xvalueList[1]) |
|
987 | 989 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
988 | 990 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
989 | 991 | except: |
|
990 | 992 | return 0 |
|
991 | 993 | |
|
992 | 994 | yvalue= self.specGgraphHeight.text() |
|
993 | 995 | if self.specGgraphHeight.isModified(): |
|
994 | 996 | yvalueList=yvalue.split(",") |
|
995 | 997 | try: |
|
996 | 998 | value=int(yvalueList[0]) |
|
997 | 999 | value=int(yvalueList[1]) |
|
998 | 1000 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
999 | 1001 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1000 | 1002 | except: |
|
1001 | 1003 | return 0 |
|
1002 | 1004 | |
|
1003 | 1005 | zvalue= self.specGgraphDbsrange.text() |
|
1004 | 1006 | if self.specGgraphDbsrange.isModified(): |
|
1005 | 1007 | zvalueList=zvalue.split(",") |
|
1006 | 1008 | try: |
|
1007 | 1009 | value=int(zvalueList[0]) |
|
1008 | 1010 | value=int(zvalueList[1]) |
|
1009 | 1011 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
1010 | 1012 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
1011 | 1013 | except: |
|
1012 | 1014 | return 0 |
|
1013 | 1015 | |
|
1014 | 1016 | if self.specGraphSaveRTIplot.isChecked(): |
|
1015 | 1017 | opObj10.addParameter(name='save', value='1', format='bool') |
|
1016 | 1018 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
1017 | 1019 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
1018 | 1020 | |
|
1019 | 1021 | if self.specGraphCebCoherencmap.isChecked(): |
|
1020 | 1022 | opObj10=self.upObj.addOperation(name='CoherenceMap',optype='other') |
|
1021 | 1023 | |
|
1022 | 1024 | opObj10.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1023 | 1025 | opObj10.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1024 | 1026 | |
|
1025 | 1027 | self.idImag += 1 |
|
1026 | 1028 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
1027 | 1029 | |
|
1028 | 1030 | channelList=self.specGgraphChannelList.text() |
|
1029 | 1031 | if self.specGgraphChannelList.isModified(): |
|
1030 | 1032 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
1031 | 1033 | |
|
1032 | 1034 | xvalue= self.specGgraphTimeRange.text() |
|
1033 | 1035 | if self.specGgraphTimeRange.isModified(): |
|
1034 | 1036 | xvalueList=xvalue.split(',') |
|
1035 | 1037 | try: |
|
1036 | 1038 | value=int(xvalueList[0]) |
|
1037 | 1039 | value=int(xvalueList[1]) |
|
1038 | 1040 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
1039 | 1041 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
1040 | 1042 | except: |
|
1041 | 1043 | return 0 |
|
1042 | 1044 | |
|
1043 | 1045 | yvalue= self.specGgraphHeight.text() |
|
1044 | 1046 | if self.specGgraphHeight.isModified(): |
|
1045 | 1047 | yvalueList=yvalue.split(",") |
|
1046 | 1048 | try: |
|
1047 | 1049 | value=int(yvalueList[0]) |
|
1048 | 1050 | value=int(yvalueList[1]) |
|
1049 | 1051 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1050 | 1052 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1051 | 1053 | except: |
|
1052 | 1054 | return 0 |
|
1053 | 1055 | |
|
1054 | 1056 | zvalue= self.specGgraphmagnitud.text() |
|
1055 | 1057 | if self.specGgraphmagnitud.isModified(): |
|
1056 | 1058 | zvalueList=zvalue.split(",") |
|
1057 | 1059 | try: |
|
1058 | 1060 | value=int(zvalueList[0]) |
|
1059 | 1061 | value=int(zvalueList[1]) |
|
1060 | 1062 | opObj10.addParameter(name='zmin', value=zvalueList[0], format='int') |
|
1061 | 1063 | opObj10.addParameter(name='zmax', value=zvalueList[1], format='int') |
|
1062 | 1064 | except: |
|
1063 | 1065 | return 0 |
|
1064 | 1066 | |
|
1065 | 1067 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1066 | 1068 | opObj10.addParameter(name='save', value='1', format='bool') |
|
1067 | 1069 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
1068 | 1070 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
1069 | 1071 | |
|
1070 | 1072 | |
|
1071 | 1073 | if self.specGraphRTIfromnoise.isChecked(): |
|
1072 | 1074 | opObj10=self.upObj.addOperation(name='RTIfromNoise',optype='other') |
|
1073 | 1075 | |
|
1074 | 1076 | self.idImag += 1 |
|
1075 | 1077 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
1076 | 1078 | |
|
1077 | 1079 | channelList=self.specGgraphChannelList.text() |
|
1078 | 1080 | if self.specGgraphChannelList.isModified(): |
|
1079 | 1081 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
1080 | 1082 | |
|
1081 | 1083 | xvalue= self.specGgraphTimeRange.text() |
|
1082 | 1084 | if self.specGgraphTimeRange.isModified(): |
|
1083 | 1085 | xvalueList=xvalue.split(',') |
|
1084 | 1086 | try: |
|
1085 | 1087 | value=int(xvalueList[0]) |
|
1086 | 1088 | value=int(xvalueList[1]) |
|
1087 | 1089 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
1088 | 1090 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
1089 | 1091 | except: |
|
1090 | 1092 | return 0 |
|
1091 | 1093 | |
|
1092 | 1094 | yvalue= self.specGgraphHeight.text() |
|
1093 | 1095 | if self.specGgraphHeight.isModified(): |
|
1094 | 1096 | yvalueList=yvalue.split(",") |
|
1095 | 1097 | try: |
|
1096 | 1098 | value=int(yvalueList[0]) |
|
1097 | 1099 | value=int(yvalueList[1]) |
|
1098 | 1100 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1099 | 1101 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1100 | 1102 | except: |
|
1101 | 1103 | return 0 |
|
1102 | 1104 | |
|
1103 | 1105 | |
|
1104 | 1106 | if self.specGraphSaveRTIfromNoise.isChecked(): |
|
1105 | 1107 | opObj10.addParameter(name='save', value='1', format='bool') |
|
1106 | 1108 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
1107 | 1109 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
1108 | 1110 | |
|
1109 | 1111 | |
|
1110 | 1112 | if self.specGraphPowerprofile.isChecked(): |
|
1111 | 1113 | opObj10=self.upObj.addOperation(name='ProfilePlot',optype='other') |
|
1112 | 1114 | self.idImag += 1 |
|
1113 | 1115 | opObj10.addParameter(name='idfigure', value=int(self.idImag), format='int') |
|
1114 | 1116 | |
|
1115 | 1117 | channelList=self.specGgraphChannelList.text() |
|
1116 | 1118 | if self.specGgraphChannelList.isModified(): |
|
1117 | 1119 | opObj10.addParameter(name='channelList', value=channelList, format='intlist') |
|
1118 | 1120 | |
|
1119 | 1121 | xvalue= self.specGgraphDbsrange.text() |
|
1120 | 1122 | if self.specGgraphDbsrange.isModified(): |
|
1121 | 1123 | xvalueList=xvalue.split(',') |
|
1122 | 1124 | try: |
|
1123 | 1125 | value=int(xvalueList[0]) |
|
1124 | 1126 | value=int(xvalueList[1]) |
|
1125 | 1127 | opObj10.addParameter(name='xmin', value=xvalueList[0], format='int') |
|
1126 | 1128 | opObj10.addParameter(name='xmax', value=xvalueList[1], format='int') |
|
1127 | 1129 | except: |
|
1128 | 1130 | return 0 |
|
1129 | 1131 | |
|
1130 | 1132 | yvalue= self.specGgraphHeight.text() |
|
1131 | 1133 | if self.specGgraphHeight.isModified(): |
|
1132 | 1134 | yvalueList=yvalue.split(",") |
|
1133 | 1135 | try: |
|
1134 | 1136 | value=int(yvalueList[0]) |
|
1135 | 1137 | value=int(yvalueList[1]) |
|
1136 | 1138 | opObj10.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1137 | 1139 | opObj10.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1138 | 1140 | except: |
|
1139 | 1141 | return 0 |
|
1140 | 1142 | |
|
1141 | 1143 | |
|
1142 | 1144 | if self.specGraphSavePowerprofile.isChecked(): |
|
1143 | 1145 | opObj10.addParameter(name='save', value='1', format='bool') |
|
1144 | 1146 | opObj10.addParameter(name='figpath', value= self.specGraphPath.text(),format='str') |
|
1145 | 1147 | opObj10.addParameter(name='figfile', value= self.specGraphPrefix.text(),format='str') |
|
1146 | 1148 | |
|
1147 | 1149 | |
|
1148 | 1150 | |
|
1149 | 1151 | #self.tabgraphSpectra.setEnabled(False) |
|
1150 | 1152 | |
|
1151 | 1153 | self.console.clear() |
|
1152 | 1154 | self.console.append("If you want to save your project") |
|
1153 | 1155 | self.console.append("click on your project name in the Tree Project Explorer") |
|
1154 | 1156 | |
|
1155 | 1157 | @pyqtSignature("") |
|
1156 | 1158 | def on_specGraphClear_clicked(self): |
|
1157 | 1159 | self.clearspecGraph() |
|
1158 | 1160 | |
|
1159 | 1161 | def setspecGraph(self): |
|
1160 | 1162 | |
|
1161 | 1163 | self.specGgraphChannelList.setEnabled(True) |
|
1162 | 1164 | |
|
1163 | 1165 | def clearspecGraph(self): |
|
1164 | 1166 | |
|
1165 | 1167 | self.specGgraphChannelList.clear() |
|
1166 | 1168 | |
|
1167 | 1169 | |
|
1168 | 1170 | def playProject(self): |
|
1169 | 1171 | |
|
1170 | 1172 | for i in self.__treeObjDict: |
|
1171 | 1173 | if self.__treeObjDict[i]==self.indexclick: |
|
1172 | 1174 | if self.__projObjDict.has_key(i)==True: |
|
1173 | 1175 | self.projectObj=self.__projObjDict[i] |
|
1174 | 1176 | filename=self.pathWorkSpace+"/"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" |
|
1175 | 1177 | self.console.clear() |
|
1176 | 1178 | self.console.append("Please Wait...") |
|
1177 | 1179 | self.projectObj.readXml(filename) |
|
1178 | 1180 | self.projectObj.createObjects() |
|
1179 | 1181 | self.projectObj.connectObjects() |
|
1180 | 1182 | self.projectObj.run() |
|
1181 | 1183 | return 0 |
|
1182 | 1184 | else: |
|
1183 | 1185 | self.console.clear() |
|
1184 | 1186 | self.console.append("First,click on current project") |
|
1185 | 1187 | |
|
1186 | 1188 | |
|
1187 | 1189 | |
|
1188 | 1190 | def saveProject(self): |
|
1189 | 1191 | print self.indexclick |
|
1190 | 1192 | for i in self.__treeObjDict: |
|
1191 | 1193 | if self.__treeObjDict[i]==self.indexclick: |
|
1192 | 1194 | if self.__projObjDict.has_key(i)==True: |
|
1193 | 1195 | self.projectObj=self.__projObjDict[int(i)] |
|
1194 | 1196 | else: |
|
1195 | 1197 | self.console.clear() |
|
1196 | 1198 | self.console.append("First,click on current project") |
|
1197 | 1199 | |
|
1198 | 1200 | filename=self.pathWorkSpace+"/"+str(self.projectObj.name)+str(self.projectObj.id)+".xml" |
|
1199 | 1201 | self.console.clear() |
|
1200 | 1202 | self.projectObj.writeXml(filename) |
|
1201 | 1203 | self.console.append("Now, you can push the icon Start in the toolbar or push start in menu run") |
|
1202 | 1204 | |
|
1203 | 1205 | |
|
1204 | 1206 | def clickFunction(self,index): |
|
1205 | 1207 | self.indexclick= index.model().itemFromIndex(index) |
|
1206 | 1208 | |
|
1207 | 1209 | def doubleclickFunction(self): |
|
1208 | 1210 | for i in self.__treeObjDict: |
|
1209 | 1211 | if self.__treeObjDict[i]==self.indexclick: |
|
1210 | 1212 | if self.__projObjDict.has_key(i)==True: |
|
1211 | 1213 | #self.tabProject.setEnabled(True) |
|
1212 | 1214 | |
|
1213 | 1215 | self.proName.setText(str(self.__projObjDict[i].name)) |
|
1214 | 1216 | self.proDataPath.setText(str(self.readUnitConfObjList[i-1].path)) |
|
1215 | 1217 | |
|
1216 | 1218 | startDate = str(self.readUnitConfObjList[i-1].startDate) |
|
1217 | 1219 | endDate = str(self.readUnitConfObjList[i-1].endDate) |
|
1218 | 1220 | self.proComStartDate.clear() |
|
1219 | 1221 | self.proComEndDate.clear() |
|
1220 | 1222 | self.proComStartDate.addItem( startDate) |
|
1221 | 1223 | self.proComEndDate.addItem(endDate) |
|
1222 | 1224 | startTime=str(self.readUnitConfObjList[i-1].startTime) |
|
1223 | 1225 | endTime=str(self.readUnitConfObjList[i-1].endTime) |
|
1224 | 1226 | starlist=startTime.split(":") |
|
1225 | 1227 | endlist=endTime.split(":") |
|
1226 | 1228 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1227 | 1229 | self.proStartTime.setTime(self.time) |
|
1228 | 1230 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1229 | 1231 | self.proEndTime.setTime(self.time) |
|
1230 | 1232 | |
|
1231 | 1233 | self.model_2=treeModel() |
|
1232 | 1234 | self.model_2.setParams(name = str(self.__projObjDict[i].name), |
|
1233 | 1235 | directorio = str(self.readUnitConfObjList[i-1].path), |
|
1234 | 1236 | workspace = self.pathWorkSpace, |
|
1235 | 1237 | remode = "Off Line", |
|
1236 | 1238 | dataformat = self.readUnitConfObjList[i-1].datatype, |
|
1237 | 1239 | date = str(self.readUnitConfObjList[i-1].startDate)+"-"+str(self.readUnitConfObjList[i-1].endDate), |
|
1238 | 1240 | initTime = str(self.readUnitConfObjList[i-1].startTime), |
|
1239 | 1241 | endTime = str(self.readUnitConfObjList[i-1].endTime), |
|
1240 | 1242 | timezone = "Local" , |
|
1241 | 1243 | Summary = str(self.__projObjDict[i].description)) |
|
1242 | 1244 | self.treeProjectProperties.setModel(self.model_2) |
|
1243 | 1245 | self.treeProjectProperties.expandAll() |
|
1244 | 1246 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
1245 | 1247 | |
|
1246 | 1248 | if self.indexclick.text()=='Voltage': |
|
1247 | 1249 | self.tabVoltage.setEnabled(True) |
|
1248 | 1250 | self.tabSpectra.setEnabled(False) |
|
1249 | 1251 | self.tabCorrelation.setEnabled(False) |
|
1250 | 1252 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
1251 | 1253 | |
|
1252 | 1254 | self.volOpComChannels.setEnabled(False) |
|
1253 | 1255 | self.volOpComHeights.setEnabled(False) |
|
1254 | 1256 | self.volOpFilter.setEnabled(False) |
|
1255 | 1257 | self.volOpComProfile.setEnabled(False) |
|
1256 | 1258 | self.volOpComCode.setEnabled(False) |
|
1257 | 1259 | self.volOpCohInt.setEnabled(False) |
|
1258 | 1260 | self.volOpChannel.clear() |
|
1259 | 1261 | self.volOpHeights.clear() |
|
1260 | 1262 | self.volOpProfile.clear() |
|
1261 | 1263 | self.volOpFilter.clear() |
|
1262 | 1264 | |
|
1263 | 1265 | self.volOpChannel.setEnabled(False) |
|
1264 | 1266 | self.volOpHeights.setEnabled(False) |
|
1265 | 1267 | self.volOpProfile.setEnabled(False) |
|
1266 | 1268 | self.volOpCebHeights.clearFocus() |
|
1267 | 1269 | # self.volOpCebChannels.clear() |
|
1268 | 1270 | # self.volOpCebHeights.clear() |
|
1269 | 1271 | # self.volOpCebFilter.clear() |
|
1270 | 1272 | # self.volOpCebProfile.clear() |
|
1271 | 1273 | # self.volOpCebDecodification.clear() |
|
1272 | 1274 | # self.volOpCebCohInt.clear() |
|
1273 | 1275 | |
|
1274 | 1276 | |
|
1275 | 1277 | if self.indexclick.text()=='Spectra': |
|
1276 | 1278 | self.tabSpectra.setEnabled(True) |
|
1277 | 1279 | self.specOpnFFTpoints.setEnabled(True) |
|
1278 | 1280 | self.tabVoltage.setEnabled(False) |
|
1279 | 1281 | self.tabCorrelation.setEnabled(False) |
|
1280 | 1282 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
1281 | 1283 | self.specGgraphChannelList.setEnabled(True) |
|
1282 | 1284 | self.specGgraphChannelList.clear() |
|
1283 | 1285 | |
|
1284 | 1286 | self.specOpnFFTpoints.clear() |
|
1285 | 1287 | self.specOppairsList.clear() |
|
1286 | 1288 | self.specOpChannel.clear() |
|
1287 | 1289 | self.specOpHeights.clear() |
|
1288 | 1290 | self.specOpIncoherent.clear() |
|
1289 | 1291 | self.specOpRemoveDC.clear() |
|
1290 | 1292 | self.specOpRemoveInterference.clear() |
|
1291 | 1293 | |
|
1292 | 1294 | |
|
1293 | 1295 | if self.indexclick.text()=='Correlation': |
|
1294 | 1296 | self.tabCorrelation.setEnabled(True) |
|
1295 | 1297 | self.tabVoltage.setEnabled(False) |
|
1296 | 1298 | self.tabSpectra.setEnabled(False) |
|
1297 | 1299 | self.tabWidgetProject.setCurrentWidget(self.tabCorrelation) |
|
1298 | 1300 | |
|
1299 | 1301 | def popup(self, pos): |
|
1300 | 1302 | |
|
1301 | 1303 | self.menu = QtGui.QMenu() |
|
1302 | 1304 | quitAction0 = self.menu.addAction("AddNewProject") |
|
1303 | 1305 | quitAction1 = self.menu.addAction("AddNewProcessingUnit") |
|
1304 | 1306 | quitAction2 = self.menu.addAction("Delete Branch") |
|
1305 | 1307 | quitAction3 = self.menu.addAction("Exit") |
|
1306 | 1308 | |
|
1307 | 1309 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
1308 | 1310 | if action == quitAction0: |
|
1309 | 1311 | self.setProjectParam() |
|
1310 | 1312 | if action == quitAction1: |
|
1311 | 1313 | self.addPU() |
|
1312 | 1314 | self.console.clear() |
|
1313 | 1315 | self.console.append("Please, Choose the type of Processing Unit") |
|
1314 | 1316 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
1315 | 1317 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
1316 | 1318 | if action == quitAction2: |
|
1317 | 1319 | for i in self.__treeObjDict: |
|
1318 | 1320 | if self.__treeObjDict[i]==self.indexclick: |
|
1319 | 1321 | self.arbolItem=self.__treeObjDict[i] |
|
1320 | 1322 | self.arbolItem.removeRows(self.arbolItem.row(),1) |
|
1321 | 1323 | |
|
1322 | 1324 | if action == quitAction3: |
|
1323 | 1325 | return |
|
1324 | 1326 | |
|
1325 | 1327 | def setProjectParam(self): |
|
1326 | 1328 | self.tabWidgetProject.setEnabled(True) |
|
1327 | 1329 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
1328 | 1330 | self.tabProject.setEnabled(True) |
|
1329 | 1331 | |
|
1330 | 1332 | self.proName.clear() |
|
1331 | 1333 | self.proDataType.setText('.r') |
|
1332 | 1334 | self.proDataPath.clear() |
|
1333 | 1335 | self.proComDataType.clear() |
|
1334 | 1336 | self.proComDataType.addItem("Voltage") |
|
1335 | 1337 | self.proComDataType.addItem("Spectra") |
|
1336 | 1338 | |
|
1337 | 1339 | self.proComStartDate.clear() |
|
1338 | 1340 | self.proComEndDate.clear() |
|
1339 | 1341 | |
|
1340 | 1342 | startTime="00:00:00" |
|
1341 | 1343 | endTime="23:59:59" |
|
1342 | 1344 | starlist=startTime.split(":") |
|
1343 | 1345 | endlist=endTime.split(":") |
|
1344 | 1346 | |
|
1345 | 1347 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1346 | 1348 | self.proStartTime.setTime(self.time) |
|
1347 | 1349 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1348 | 1350 | self.proEndTime.setTime(self.time) |
|
1349 | 1351 | self.proDescription.clear() |
|
1350 | 1352 | |
|
1351 | 1353 | self.console.clear() |
|
1352 | 1354 | self.console.append("Please, Write a name Project") |
|
1353 | 1355 | self.console.append("Introduce Project Parameters") |
|
1354 | 1356 | self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
1355 | 1357 | |
|
1356 | 1358 | |
|
1357 | 1359 | def addPU(self): |
|
1358 | 1360 | self.configUP=UnitProcess(self) |
|
1359 | 1361 | for i in self.__treeObjDict: |
|
1360 | 1362 | if self.__treeObjDict[i]==self.indexclick: |
|
1361 | 1363 | if self.__projObjDict.has_key(i)==True: |
|
1362 | 1364 | self.projectObj=self.__projObjDict[int(i)] |
|
1363 | 1365 | self.configUP.dataTypeProject=str(self.proComDataType.currentText()) |
|
1364 | 1366 | self.configUP.getfromWindowList.append(self.projectObj) |
|
1365 | 1367 | else: |
|
1366 | 1368 | self.upObj=self.__upObjDict[i] |
|
1367 | 1369 | self.configUP.getfromWindowList.append(self.upObj) |
|
1368 | 1370 | |
|
1369 | 1371 | self.configUP.loadTotalList() |
|
1370 | 1372 | self.configUP.show() |
|
1371 | 1373 | self.configUP.closed.connect(self.createUP) |
|
1372 | 1374 | |
|
1373 | 1375 | def createUP(self): |
|
1374 | 1376 | |
|
1375 | 1377 | if not self.configUP.create: |
|
1376 | 1378 | return |
|
1377 | 1379 | |
|
1378 | 1380 | self.uporProObjRecover=self.configUP.getFromWindow |
|
1379 | 1381 | |
|
1380 | 1382 | self.upType = self.configUP.typeofUP |
|
1381 | 1383 | for i in self.__treeObjDict: |
|
1382 | 1384 | if self.__treeObjDict[i]==self.indexclick: |
|
1383 | 1385 | if self.__projObjDict.has_key(i)==True: |
|
1384 | 1386 | self.projectObj=self.__projObjDict[int(i)] |
|
1385 | 1387 | |
|
1386 | 1388 | if self.__upObjDict.has_key(i)==True: |
|
1387 | 1389 | self.upObj=self.__upObjDict[i] |
|
1388 | 1390 | getIdProject=self.upObj.id[0] |
|
1389 | 1391 | self.projectObj=self.__projObjDict[int(getIdProject)] |
|
1390 | 1392 | |
|
1391 | 1393 | datatype=str(self.upType) |
|
1392 | 1394 | uporprojectObj=self.uporProObjRecover |
|
1393 | 1395 | |
|
1394 | 1396 | if uporprojectObj.getElementName()=='ProcUnit': |
|
1395 | 1397 | inputId=uporprojectObj.getId() |
|
1396 | 1398 | self.console.clear() |
|
1397 | 1399 | self.console.append("Double Clik on the Processing Unit to enable the tab") |
|
1398 | 1400 | self.console.append("Before Add other Processing Unit complete the tab") |
|
1399 | 1401 | else: |
|
1400 | 1402 | inputId=self.readUnitConfObjList[uporprojectObj.id-1].getId() |
|
1401 | 1403 | self.console.clear() |
|
1402 | 1404 | self.console.append("Double Clik on the Processing Unit to enable the tab") |
|
1403 | 1405 | self.console.append("Before Add other Project or Processing Unit complete the tab") |
|
1404 | 1406 | |
|
1405 | 1407 | self.procUnitConfObj1 = self.projectObj.addProcUnit(datatype=datatype, inputId=inputId) |
|
1406 | 1408 | self.__upObjDict[self.procUnitConfObj1.id]= self.procUnitConfObj1 |
|
1407 | 1409 | |
|
1408 | 1410 | self.parentItem=self.__treeObjDict[uporprojectObj.id] |
|
1409 | 1411 | self.numbertree=int(self.procUnitConfObj1.getId())-1 |
|
1410 | 1412 | self.__treeObjDict[self.procUnitConfObj1.id]=QtGui.QStandardItem(QtCore.QString(datatype).arg(self.numbertree)) |
|
1411 | 1413 | self.parentItem.appendRow(self.__treeObjDict[self.procUnitConfObj1.id]) |
|
1412 | 1414 | self.parentItem=self.__treeObjDict[self.procUnitConfObj1.id] |
|
1413 | 1415 | self.treeProjectExplorer.expandAll() |
|
1414 | 1416 | |
|
1415 | 1417 | |
|
1416 | 1418 | def searchData(self,path,ext,walk,expLabel=''): |
|
1417 | 1419 | dateList=[] |
|
1418 | 1420 | fileList=[] |
|
1419 | 1421 | if walk== 0: |
|
1420 | 1422 | files= os.listdir(path) |
|
1421 | 1423 | for thisFile in files: |
|
1422 | 1424 | thisExt = os.path.splitext(thisFile)[-1] |
|
1423 | 1425 | if thisExt != ext: |
|
1424 | 1426 | self.console.clear() |
|
1425 | 1427 | self.console.append("There is no datatype selected in the path Directory") |
|
1426 | 1428 | self.proOk.setEnabled(False) |
|
1427 | 1429 | continue |
|
1428 | 1430 | |
|
1429 | 1431 | fileList.append(thisFile) |
|
1430 | 1432 | |
|
1431 | 1433 | for thisFile in fileList: |
|
1432 | 1434 | |
|
1433 | 1435 | if not isRadarFile(thisFile): |
|
1434 | 1436 | self.console.clear() |
|
1435 | 1437 | self.console.append("Please, Choose the Correct Path") |
|
1436 | 1438 | self.proOk.setEnabled(False) |
|
1437 | 1439 | continue |
|
1438 | 1440 | |
|
1439 | 1441 | year = int(thisFile[1:5]) |
|
1440 | 1442 | doy = int(thisFile[5:8]) |
|
1441 | 1443 | |
|
1442 | 1444 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) |
|
1443 | 1445 | dateformat = date.strftime("%Y/%m/%d") |
|
1444 | 1446 | |
|
1445 | 1447 | if dateformat not in dateList: |
|
1446 | 1448 | dateList.append(dateformat) |
|
1447 | 1449 | |
|
1448 | 1450 | if walk == 1: |
|
1449 | 1451 | |
|
1450 | 1452 | dirList = os.listdir(path) |
|
1451 | 1453 | |
|
1452 | 1454 | dirList.sort() |
|
1453 | 1455 | |
|
1454 | 1456 | dateList = [] |
|
1455 | 1457 | |
|
1456 | 1458 | for thisDir in dirList: |
|
1457 | 1459 | |
|
1458 | 1460 | if not isRadarPath(thisDir): |
|
1459 | 1461 | self.console.clear() |
|
1460 | 1462 | self.console.append("Please, Choose the Correct Path") |
|
1461 | 1463 | self.proOk.setEnabled(False) |
|
1462 | 1464 | continue |
|
1463 | 1465 | |
|
1464 | 1466 | doypath = os.path.join(path, thisDir, expLabel) |
|
1465 | 1467 | if not os.path.exists(doypath): |
|
1466 | 1468 | self.console.clear() |
|
1467 | 1469 | self.console.append("Please, Choose the Correct Path") |
|
1468 | 1470 | return |
|
1469 | 1471 | files = os.listdir(doypath) |
|
1470 | 1472 | fileList = [] |
|
1471 | 1473 | |
|
1472 | 1474 | for thisFile in files: |
|
1473 | 1475 | thisExt=os.path.splitext(thisFile)[-1] |
|
1474 | 1476 | if thisExt != ext: |
|
1475 | 1477 | self.console.clear() |
|
1476 | 1478 | self.console.append("There is no datatype selected in the Path Directory") |
|
1477 | 1479 | self.proOk.setEnabled(False) |
|
1478 | 1480 | continue |
|
1479 | 1481 | |
|
1480 | 1482 | if not isRadarFile(thisFile): |
|
1481 | 1483 | self.proOk.setEnabled(False) |
|
1482 | 1484 | self.console.clear() |
|
1483 | 1485 | self.console.append("Please, Choose the Correct Path") |
|
1484 | 1486 | continue |
|
1485 | 1487 | |
|
1486 | 1488 | fileList.append(thisFile) |
|
1487 | 1489 | break |
|
1488 | 1490 | |
|
1489 | 1491 | if fileList == []: |
|
1490 | 1492 | continue |
|
1491 | 1493 | |
|
1492 | 1494 | year = int(thisDir[1:5]) |
|
1493 | 1495 | doy = int(thisDir[5:8]) |
|
1494 | 1496 | |
|
1495 | 1497 | date = datetime.date(year,1,1) + datetime.timedelta(doy-1) |
|
1496 | 1498 | dateformat = date.strftime("%Y/%m/%d") |
|
1497 | 1499 | dateList.append(dateformat) |
|
1498 | 1500 | |
|
1499 | 1501 | return dateList |
|
1500 | 1502 | |
|
1501 | 1503 | def loadDays(self): |
|
1502 | 1504 | """ |
|
1503 | 1505 | Method to loads day |
|
1504 | 1506 | """ |
|
1505 | 1507 | ext=str(self.proDataType.text()) |
|
1506 | 1508 | |
|
1507 | 1509 | #-------------------------# |
|
1508 | 1510 | walk= self.walk |
|
1509 | 1511 | |
|
1510 | 1512 | path=str(self.proDataPath.text()) |
|
1511 | 1513 | if not os.path.exists(path): |
|
1512 | 1514 | self.proOk.setEnabled(False) |
|
1513 | 1515 | self.console.clear() |
|
1514 | 1516 | self.console.append("Write a correct a path") |
|
1515 | 1517 | return |
|
1516 | 1518 | self.proComStartDate.clear() |
|
1517 | 1519 | self.proComEndDate.clear() |
|
1518 | 1520 | #Load List to select start day and end day.(QComboBox) |
|
1519 | 1521 | dateList=self.searchData(path,ext=ext,walk=walk) |
|
1520 | 1522 | self.dateList=dateList |
|
1521 | 1523 | for thisDate in dateList: |
|
1522 | 1524 | self.proComStartDate.addItem(thisDate) |
|
1523 | 1525 | self.proComEndDate.addItem(thisDate) |
|
1524 | 1526 | self.proComEndDate.setCurrentIndex(self.proComStartDate.count()-1) |
|
1525 | 1527 | |
|
1526 | 1528 | def setWorkSpaceGUI(self,pathWorkSpace): |
|
1527 | 1529 | self.pathWorkSpace = pathWorkSpace |
|
1528 | 1530 | #---Comandos Usados en Console----# |
|
1529 | 1531 | def __del__(self): |
|
1530 | 1532 | sys.stdout=sys.__stdout__ |
|
1531 | 1533 | |
|
1532 | 1534 | def normalOutputWritten(self,text): |
|
1533 | 1535 | self.console.append(text) |
|
1534 | 1536 | |
|
1535 | 1537 | #-----Fin------# |
|
1536 | 1538 | |
|
1537 | 1539 | def setParameter(self): |
|
1538 | 1540 | self.setWindowTitle("ROJ-Signal Chain") |
|
1539 | 1541 | self.setWindowIcon(QtGui.QIcon("figure/adn.jpg")) |
|
1540 | 1542 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
1541 | 1543 | |
|
1542 | 1544 | self.tabWidgetProject.setEnabled(False) |
|
1543 | 1545 | self.tabVoltage.setEnabled(False) |
|
1544 | 1546 | self.tabSpectra.setEnabled(False) |
|
1545 | 1547 | self.tabCorrelation.setEnabled(False) |
|
1546 | 1548 | |
|
1547 | 1549 | self.actionCreate.setShortcut('Ctrl+P') |
|
1548 | 1550 | self.actionStart.setShortcut('Ctrl+R') |
|
1549 | 1551 | self.actionSave.setShortcut('Ctrl+S') |
|
1550 | 1552 | self.actionClose.setShortcut('Ctrl+Q') |
|
1551 | 1553 | |
|
1552 | 1554 | self.proName.clear() |
|
1553 | 1555 | self.proDataPath.setText('') |
|
1554 | 1556 | self.console.append("Welcome to Signal Chain please Create a New Project") |
|
1555 | 1557 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
1556 | 1558 | self.time =QtCore.QTime() |
|
1557 | 1559 | self.hour =0 |
|
1558 | 1560 | self.min =0 |
|
1559 | 1561 | self.sec =0 |
|
1560 | 1562 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
1561 | 1563 | startTime="00:00:00" |
|
1562 | 1564 | endTime="23:59:59" |
|
1563 | 1565 | starlist=startTime.split(":") |
|
1564 | 1566 | endlist=endTime.split(":") |
|
1565 | 1567 | self.time.setHMS(int(starlist[0]),int(starlist[1]),int(starlist[2])) |
|
1566 | 1568 | self.proStartTime.setTime(self.time) |
|
1567 | 1569 | self.time.setHMS(int(endlist[0]),int(endlist[1]),int(endlist[2])) |
|
1568 | 1570 | self.proEndTime.setTime(self.time) |
|
1569 | 1571 | self.proOk.setEnabled(False) |
|
1570 | 1572 | #set model Project Explorer |
|
1571 | 1573 | self.model = QtGui.QStandardItemModel() |
|
1572 | 1574 | self.model.setHorizontalHeaderLabels(("Project Explorer",)) |
|
1573 | 1575 | layout = QtGui.QVBoxLayout() |
|
1574 | 1576 | layout.addWidget(self.treeProjectExplorer) |
|
1575 | 1577 | self.treeProjectExplorer.setModel(self.model) |
|
1576 | 1578 | self.treeProjectExplorer.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
1577 | 1579 | self.treeProjectExplorer.customContextMenuRequested.connect(self.popup) |
|
1578 | 1580 | self.treeProjectExplorer.clicked.connect(self.clickFunction) |
|
1579 | 1581 | |
|
1580 | 1582 | self.treeProjectExplorer.doubleClicked.connect(self.doubleclickFunction) |
|
1581 | 1583 | self.treeProjectExplorer.expandAll() |
|
1582 | 1584 | #set model Project Properties |
|
1583 | 1585 | |
|
1584 | 1586 | self.model_2=treeModel() |
|
1585 | 1587 | self.model_2.showtree() |
|
1586 | 1588 | self.treeProjectProperties.setModel(self.model_2) |
|
1587 | 1589 | self.treeProjectProperties.expandAll() |
|
1588 | 1590 | #set Project |
|
1589 | 1591 | self.proDelay.setEnabled(False) |
|
1590 | 1592 | self.proDataType.setReadOnly(True) |
|
1591 | 1593 | |
|
1592 | 1594 | #set Operation Voltage |
|
1593 | 1595 | self.volOpComChannels.setEnabled(False) |
|
1594 | 1596 | self.volOpComHeights.setEnabled(False) |
|
1595 | 1597 | self.volOpFilter.setEnabled(False) |
|
1596 | 1598 | self.volOpComProfile.setEnabled(False) |
|
1597 | 1599 | self.volOpComCode.setEnabled(False) |
|
1598 | 1600 | self.volOpCohInt.setEnabled(False) |
|
1599 | 1601 | |
|
1600 | 1602 | self.volOpChannel.setEnabled(False) |
|
1601 | 1603 | self.volOpHeights.setEnabled(False) |
|
1602 | 1604 | self.volOpProfile.setEnabled(False) |
|
1603 | 1605 | self.volOpComMode.setEnabled(False) |
|
1604 | 1606 | |
|
1605 | 1607 | self.volGraphPath.setEnabled(False) |
|
1606 | 1608 | self.volGraphPrefix.setEnabled(False) |
|
1607 | 1609 | self.volGraphToolPath.setEnabled(False) |
|
1608 | 1610 | |
|
1609 | 1611 | #set Graph Voltage |
|
1610 | 1612 | self.volGraphChannelList.setEnabled(False) |
|
1611 | 1613 | self.volGraphfreqrange.setEnabled(False) |
|
1612 | 1614 | self.volGraphHeightrange.setEnabled(False) |
|
1613 | 1615 | |
|
1614 | 1616 | #set Operation Spectra |
|
1615 | 1617 | self.specOpnFFTpoints.setEnabled(False) |
|
1616 | 1618 | self.specOppairsList.setEnabled(False) |
|
1617 | 1619 | self.specOpComChannel.setEnabled(False) |
|
1618 | 1620 | self.specOpComHeights.setEnabled(False) |
|
1619 | 1621 | self.specOpIncoherent.setEnabled(False) |
|
1620 | 1622 | self.specOpRemoveDC .setEnabled(False) |
|
1621 | 1623 | self.specOpRemoveInterference.setEnabled(False) |
|
1622 | 1624 | |
|
1623 | 1625 | self.specOpChannel.setEnabled(False) |
|
1624 | 1626 | self.specOpHeights.setEnabled(False) |
|
1625 | 1627 | #set Graph Spectra |
|
1626 | 1628 | self.specGgraphChannelList.setEnabled(False) |
|
1627 | 1629 | self.specGgraphFreq.setEnabled(False) |
|
1628 | 1630 | self.specGgraphHeight.setEnabled(False) |
|
1629 | 1631 | self.specGgraphDbsrange.setEnabled(False) |
|
1630 | 1632 | self.specGgraphmagnitud.setEnabled(False) |
|
1631 | 1633 | self.specGgraphTimeRange.setEnabled(False) |
|
1632 | 1634 | self.specGgraphPhaserange.setEnabled(False) |
|
1633 | 1635 | self.specGraphPath.setEnabled(False) |
|
1634 | 1636 | self.specGraphToolPath.setEnabled(False) |
|
1635 | 1637 | self.specGraphPrefix.setEnabled(False) |
|
1636 | 1638 | |
|
1637 | 1639 | |
|
1638 | 1640 | #tool tip gui |
|
1639 | 1641 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
1640 | 1642 | self.treeProjectExplorer.setToolTip('Right clik to add Project or Unit Process') |
|
1641 | 1643 | #tool tip gui project |
|
1642 | 1644 | 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>') |
|
1643 | 1645 | self.proComWalk.setCurrentIndex(1) |
|
1644 | 1646 | #tool tip gui volOp |
|
1645 | 1647 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
1646 | 1648 | self.volOpHeights.setToolTip('Example: 90,180') |
|
1647 | 1649 | self.volOpFilter.setToolTip('Example: 3') |
|
1648 | 1650 | self.volOpProfile.setToolTip('Example:0,125 ') |
|
1649 | 1651 | self.volOpCohInt.setToolTip('Example: 100') |
|
1650 | 1652 | self.volOpOk.setToolTip('If you have finish, please Ok ') |
|
1651 | 1653 | #tool tip gui volGraph |
|
1652 | 1654 | self.volGraphfreqrange.setToolTip('Example: 10,150') |
|
1653 | 1655 | self.volGraphHeightrange.setToolTip('Example: 20,180') |
|
1654 | 1656 | self.volGraphOk.setToolTip('If you have finish, please Ok ') |
|
1655 | 1657 | #tool tip gui specOp |
|
1656 | 1658 | self.specOpnFFTpoints.setToolTip('Example: 100') |
|
1657 | 1659 | self.specOpIncoherent.setToolTip('Example: 150') |
|
1658 | 1660 | self.specOpRemoveDC .setToolTip('Example: 1') |
|
1659 | 1661 | |
|
1660 | 1662 | |
|
1661 | 1663 | self.specOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
1662 | 1664 | self.specOpHeights.setToolTip('Example: 90,180') |
|
1663 | 1665 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
1664 | 1666 | #tool tip gui specGraph |
|
1665 | 1667 | |
|
1666 | 1668 | self.specGgraphChannelList.setToolTip('Example: Myplot') |
|
1667 | 1669 | self.specGgraphFreq.setToolTip('Example: 10,150') |
|
1668 | 1670 | self.specGgraphHeight.setToolTip('Example: 20,160') |
|
1669 | 1671 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
1670 | 1672 | |
|
1671 | 1673 | self.specGraphPrefix.setToolTip('Example: figure') |
|
1672 | 1674 | |
|
1673 | 1675 | class UnitProcess(QMainWindow, Ui_UnitProcess): |
|
1674 | 1676 | """ |
|
1675 | 1677 | Class documentation goes here. |
|
1676 | 1678 | """ |
|
1677 | 1679 | closed=pyqtSignal() |
|
1678 | 1680 | create= False |
|
1679 | 1681 | def __init__(self, parent = None): |
|
1680 | 1682 | """ |
|
1681 | 1683 | Constructor |
|
1682 | 1684 | """ |
|
1683 | 1685 | QMainWindow.__init__(self, parent) |
|
1684 | 1686 | self.setupUi(self) |
|
1685 | 1687 | self.getFromWindow=None |
|
1686 | 1688 | self.getfromWindowList=[] |
|
1687 | 1689 | self.dataTypeProject=None |
|
1688 | 1690 | |
|
1689 | 1691 | self.listUP=None |
|
1690 | 1692 | |
|
1691 | 1693 | @pyqtSignature("") |
|
1692 | 1694 | def on_unitPokbut_clicked(self): |
|
1693 | 1695 | """ |
|
1694 | 1696 | Slot documentation goes here. |
|
1695 | 1697 | """ |
|
1696 | 1698 | self.create =True |
|
1697 | 1699 | self.getFromWindow=self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
1698 | 1700 | #self.nameofUP= str(self.nameUptxt.text()) |
|
1699 | 1701 | self.typeofUP= str(self.comboTypeBox.currentText()) |
|
1700 | 1702 | self.close() |
|
1701 | 1703 | |
|
1702 | 1704 | |
|
1703 | 1705 | @pyqtSignature("") |
|
1704 | 1706 | def on_unitPcancelbut_clicked(self): |
|
1705 | 1707 | """ |
|
1706 | 1708 | Slot documentation goes here. |
|
1707 | 1709 | """ |
|
1708 | 1710 | self.create=False |
|
1709 | 1711 | self.close() |
|
1710 | 1712 | |
|
1711 | 1713 | def loadTotalList(self): |
|
1712 | 1714 | self.comboInputBox.clear() |
|
1713 | 1715 | for i in self.getfromWindowList: |
|
1714 | 1716 | |
|
1715 | 1717 | name=i.getElementName() |
|
1716 | 1718 | if name=='Project': |
|
1717 | 1719 | id= i.id |
|
1718 | 1720 | name=i.name |
|
1719 | 1721 | if self.dataTypeProject=='Voltage': |
|
1720 | 1722 | self.comboTypeBox.clear() |
|
1721 | 1723 | self.comboTypeBox.addItem("Voltage") |
|
1722 | 1724 | |
|
1723 | 1725 | if self.dataTypeProject=='Spectra': |
|
1724 | 1726 | self.comboTypeBox.clear() |
|
1725 | 1727 | self.comboTypeBox.addItem("Spectra") |
|
1726 | 1728 | self.comboTypeBox.addItem("Correlation") |
|
1727 | 1729 | |
|
1728 | 1730 | if name=='ProcUnit': |
|
1729 | 1731 | id=int(i.id)-1 |
|
1730 | 1732 | name=i.datatype |
|
1731 | 1733 | if name == 'Voltage': |
|
1732 | 1734 | self.comboTypeBox.clear() |
|
1733 | 1735 | self.comboTypeBox.addItem("Spectra") |
|
1734 | 1736 | self.comboTypeBox.addItem("Correlation") |
|
1735 | 1737 | if name == 'Spectra': |
|
1736 | 1738 | self.comboTypeBox.clear() |
|
1737 | 1739 | self.comboTypeBox.addItem("Spectra") |
|
1738 | 1740 | self.comboTypeBox.addItem("Correlation") |
|
1739 | 1741 | |
|
1740 | 1742 | |
|
1741 | 1743 | self.comboInputBox.addItem(str(name)) |
|
1742 | 1744 | #self.comboInputBox.addItem(str(name)+str(id)) |
|
1743 | 1745 | |
|
1744 | 1746 | def closeEvent(self, event): |
|
1745 | 1747 | self.closed.emit() |
|
1746 | 1748 | event.accept() |
|
1747 | 1749 | |
|
1748 | 1750 | class ShowMeConsole(QtCore.QObject): |
|
1749 | 1751 | textWritten=QtCore.pyqtSignal(str) |
|
1750 | 1752 | def write (self,text): |
|
1751 | 1753 | 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