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