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