@@ -1,6073 +1,6076 | |||||
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 | #+++++++++++++GUI V2++++++++++++++# |
|
7 | #+++++++++++++GUI V2++++++++++++++# | |
8 | @author Miguel Urco |
|
8 | @author Miguel Urco | |
9 | """ |
|
9 | """ | |
10 | import os, sys |
|
10 | import os, sys | |
11 | import datetime |
|
11 | import datetime | |
12 | import numpy |
|
12 | import numpy | |
13 | import ast |
|
13 | import ast | |
14 |
|
14 | |||
15 | from Queue import Queue |
|
15 | from Queue import Queue | |
16 |
|
16 | |||
17 | from collections import OrderedDict |
|
17 | from collections import OrderedDict | |
18 | from os.path import expanduser |
|
18 | from os.path import expanduser | |
19 | from time import sleep |
|
19 | from time import sleep | |
20 |
|
20 | |||
21 | from PyQt4.QtGui import QMainWindow |
|
21 | from PyQt4.QtGui import QMainWindow | |
22 | from PyQt4.QtCore import pyqtSignature |
|
22 | from PyQt4.QtCore import pyqtSignature | |
23 | from PyQt4.QtCore import pyqtSignal |
|
23 | from PyQt4.QtCore import pyqtSignal | |
24 | from PyQt4 import QtCore |
|
24 | from PyQt4 import QtCore | |
25 | from PyQt4 import QtGui |
|
25 | from PyQt4 import QtGui | |
26 |
|
26 | |||
27 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
27 | from propertiesViewModel import TreeModel, PropertyBuffer | |
28 | from parametersModel import ProjectParms |
|
28 | from parametersModel import ProjectParms | |
29 |
|
29 | |||
30 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
30 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess | |
31 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
31 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp | |
32 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
32 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow | |
33 |
|
33 | |||
34 | from schainpy.controller_api import ControllerThread |
|
34 | from schainpy.controller_api import ControllerThread | |
35 | from schainpy.controller import Project |
|
35 | from schainpy.controller import Project | |
36 |
|
36 | |||
37 | from schainpy.model.graphics.jroplotter import PlotManager |
|
37 | from schainpy.model.graphics.jroplotter import PlotManager | |
38 | from schainpy.gui.figures import tools |
|
38 | from schainpy.gui.figures import tools | |
39 |
|
39 | |||
40 | FIGURES_PATH = tools.get_path() |
|
40 | FIGURES_PATH = tools.get_path() | |
41 | TEMPORAL_FILE = ".temp.xml" |
|
41 | TEMPORAL_FILE = ".temp.xml" | |
42 |
|
42 | |||
43 | def isRadarFile(file): |
|
43 | def isRadarFile(file): | |
44 | try: |
|
44 | try: | |
45 | year = int(file[1:5]) |
|
45 | year = int(file[1:5]) | |
46 | doy = int(file[5:8]) |
|
46 | doy = int(file[5:8]) | |
47 | set = int(file[8:11]) |
|
47 | set = int(file[8:11]) | |
48 | except: |
|
48 | except: | |
49 | return 0 |
|
49 | return 0 | |
50 |
|
50 | |||
51 | return 1 |
|
51 | return 1 | |
52 |
|
52 | |||
53 | def isRadarPath(path): |
|
53 | def isRadarPath(path): | |
54 | try: |
|
54 | try: | |
55 | year = int(path[1:5]) |
|
55 | year = int(path[1:5]) | |
56 | doy = int(path[5:8]) |
|
56 | doy = int(path[5:8]) | |
57 | except: |
|
57 | except: | |
58 | return 0 |
|
58 | return 0 | |
59 |
|
59 | |||
60 | return 1 |
|
60 | return 1 | |
61 |
|
61 | |||
62 | def isInt(cadena): |
|
62 | def isInt(cadena): | |
63 |
|
63 | |||
64 | try: |
|
64 | try: | |
65 | int(cadena) |
|
65 | int(cadena) | |
66 | except: |
|
66 | except: | |
67 | return 0 |
|
67 | return 0 | |
68 |
|
68 | |||
69 | return 1 |
|
69 | return 1 | |
70 |
|
70 | |||
71 | def isFloat(cadena): |
|
71 | def isFloat(cadena): | |
72 |
|
72 | |||
73 | try: |
|
73 | try: | |
74 | float(cadena) |
|
74 | float(cadena) | |
75 | except: |
|
75 | except: | |
76 | return 0 |
|
76 | return 0 | |
77 |
|
77 | |||
78 | return 1 |
|
78 | return 1 | |
79 |
|
79 | |||
80 | def isList(cadena): |
|
80 | def isList(cadena): | |
81 |
|
81 | |||
82 | value = str.strip(cadena) |
|
82 | value = str.strip(cadena) | |
83 |
|
83 | |||
84 | if not value: |
|
84 | if not value: | |
85 | return 0 |
|
85 | return 0 | |
86 |
|
86 | |||
87 | try: |
|
87 | try: | |
88 | x = ast.literal_eval(value) |
|
88 | x = ast.literal_eval(value) | |
89 | except: |
|
89 | except: | |
90 | return 0 |
|
90 | return 0 | |
91 |
|
91 | |||
92 | if type(x) in (int, float, tuple, list): |
|
92 | if type(x) in (int, float, tuple, list): | |
93 | return 1 |
|
93 | return 1 | |
94 |
|
94 | |||
95 | return 0 |
|
95 | return 0 | |
96 |
|
96 | |||
97 | def isIntList(cadena): |
|
97 | def isIntList(cadena): | |
98 |
|
98 | |||
99 | value = str.strip(cadena) |
|
99 | value = str.strip(cadena) | |
100 |
|
100 | |||
101 | if not value: |
|
101 | if not value: | |
102 | return 0 |
|
102 | return 0 | |
103 |
|
103 | |||
104 | try: |
|
104 | try: | |
105 | x = ast.literal_eval(value) |
|
105 | x = ast.literal_eval(value) | |
106 | except: |
|
106 | except: | |
107 | return 0 |
|
107 | return 0 | |
108 |
|
108 | |||
109 | if type(x) not in (int, tuple, list): |
|
109 | if type(x) not in (int, tuple, list): | |
110 | return 0 |
|
110 | return 0 | |
111 |
|
111 | |||
112 | return 1 |
|
112 | return 1 | |
113 |
|
113 | |||
114 | def isFloatRange(cadena): |
|
114 | def isFloatRange(cadena): | |
115 |
|
115 | |||
116 | value = str.strip(cadena) |
|
116 | value = str.strip(cadena) | |
117 |
|
117 | |||
118 | if not value: |
|
118 | if not value: | |
119 | return 0 |
|
119 | return 0 | |
120 |
|
120 | |||
121 | c = str.split(value, ",") |
|
121 | c = str.split(value, ",") | |
122 |
|
122 | |||
123 | if len(c) != 2: |
|
123 | if len(c) != 2: | |
124 | return 0 |
|
124 | return 0 | |
125 |
|
125 | |||
126 | if not isFloat(c[0]): |
|
126 | if not isFloat(c[0]): | |
127 | return 0 |
|
127 | return 0 | |
128 |
|
128 | |||
129 | if not isFloat(c[1]): |
|
129 | if not isFloat(c[1]): | |
130 | return 0 |
|
130 | return 0 | |
131 |
|
131 | |||
132 | return 1 |
|
132 | return 1 | |
133 |
|
133 | |||
134 | def isIntRange(cadena): |
|
134 | def isIntRange(cadena): | |
135 |
|
135 | |||
136 | value = str.strip(cadena) |
|
136 | value = str.strip(cadena) | |
137 |
|
137 | |||
138 | if not value: |
|
138 | if not value: | |
139 | return 0 |
|
139 | return 0 | |
140 |
|
140 | |||
141 | c = str.split(value, ",") |
|
141 | c = str.split(value, ",") | |
142 |
|
142 | |||
143 | if len(c) != 2: |
|
143 | if len(c) != 2: | |
144 | return 0 |
|
144 | return 0 | |
145 |
|
145 | |||
146 | if not isInt(c[0]): |
|
146 | if not isInt(c[0]): | |
147 | return 0 |
|
147 | return 0 | |
148 |
|
148 | |||
149 | if not isInt(c[1]): |
|
149 | if not isInt(c[1]): | |
150 | return 0 |
|
150 | return 0 | |
151 |
|
151 | |||
152 | def isPair(value): |
|
152 | def isPair(value): | |
153 |
|
153 | |||
154 | if type(value) not in (tuple, list): |
|
154 | if type(value) not in (tuple, list): | |
155 | return 0 |
|
155 | return 0 | |
156 |
|
156 | |||
157 | if len(value) != 2: |
|
157 | if len(value) != 2: | |
158 | return 0 |
|
158 | return 0 | |
159 |
|
159 | |||
160 | for i in value: |
|
160 | for i in value: | |
161 | if type(i) not in (int,): |
|
161 | if type(i) not in (int,): | |
162 | return 0 |
|
162 | return 0 | |
163 |
|
163 | |||
164 | return 1 |
|
164 | return 1 | |
165 |
|
165 | |||
166 | def isPairList(cadena): |
|
166 | def isPairList(cadena): | |
167 |
|
167 | |||
168 | value = str.strip(cadena) |
|
168 | value = str.strip(cadena) | |
169 |
|
169 | |||
170 | if not value: |
|
170 | if not value: | |
171 | return 0 |
|
171 | return 0 | |
172 |
|
172 | |||
173 | try: |
|
173 | try: | |
174 | x = ast.literal_eval(value) |
|
174 | x = ast.literal_eval(value) | |
175 | except: |
|
175 | except: | |
176 | return 0 |
|
176 | return 0 | |
177 |
|
177 | |||
178 | if type(x) not in (tuple, list): |
|
178 | if type(x) not in (tuple, list): | |
179 | return 0 |
|
179 | return 0 | |
180 |
|
180 | |||
181 | if type(x[0]) not in (tuple, list): |
|
181 | if type(x[0]) not in (tuple, list): | |
182 | #x = (0,1) |
|
182 | #x = (0,1) | |
183 | if not isPair(x): |
|
183 | if not isPair(x): | |
184 | return 0 |
|
184 | return 0 | |
185 |
|
185 | |||
186 | return 1 |
|
186 | return 1 | |
187 |
|
187 | |||
188 | for thisPair in x: |
|
188 | for thisPair in x: | |
189 | if not isPair(thisPair): |
|
189 | if not isPair(thisPair): | |
190 | return 0 |
|
190 | return 0 | |
191 |
|
191 | |||
192 | return 1 |
|
192 | return 1 | |
193 |
|
193 | |||
194 | def isMultiList(cadena): |
|
194 | def isMultiList(cadena): | |
195 |
|
195 | |||
196 | value = str.strip(cadena) |
|
196 | value = str.strip(cadena) | |
197 |
|
197 | |||
198 | if not value: |
|
198 | if not value: | |
199 | return 0 |
|
199 | return 0 | |
200 |
|
200 | |||
201 | try: |
|
201 | try: | |
202 | x = ast.literal_eval(value) |
|
202 | x = ast.literal_eval(value) | |
203 | except: |
|
203 | except: | |
204 | return 0 |
|
204 | return 0 | |
205 |
|
205 | |||
206 | if type(x) not in (tuple, list): |
|
206 | if type(x) not in (tuple, list): | |
207 | return 0 |
|
207 | return 0 | |
208 |
|
208 | |||
209 | for thisList in x: |
|
209 | for thisList in x: | |
210 | if type(thisList) not in (int, float, tuple, list): |
|
210 | if type(thisList) not in (int, float, tuple, list): | |
211 | return 0 |
|
211 | return 0 | |
212 |
|
212 | |||
213 | return 1 |
|
213 | return 1 | |
214 |
|
214 | |||
215 | def getCode(cadena): |
|
215 | def getCode(cadena): | |
216 |
|
216 | |||
217 | if not isMultiList(cadena): |
|
217 | if not isMultiList(cadena): | |
218 | return None |
|
218 | return None | |
219 |
|
219 | |||
220 | try: |
|
220 | try: | |
221 | x = ast.literal_eval(cadena) |
|
221 | x = ast.literal_eval(cadena) | |
222 | except: |
|
222 | except: | |
223 | return None |
|
223 | return None | |
224 |
|
224 | |||
225 | if type(x[0]) in (int, float): |
|
225 | if type(x[0]) in (int, float): | |
226 | return [x] |
|
226 | return [x] | |
227 |
|
227 | |||
228 | return x |
|
228 | return x | |
229 |
|
229 | |||
230 |
|
230 | |||
231 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
231 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
232 | """ |
|
232 | """ | |
233 | """ |
|
233 | """ | |
234 | def __init__(self, parent=None): |
|
234 | def __init__(self, parent=None): | |
235 | """ |
|
235 | """ | |
236 |
|
236 | |||
237 | """ |
|
237 | """ | |
238 | QMainWindow.__init__(self, parent) |
|
238 | QMainWindow.__init__(self, parent) | |
239 | self.setupUi(self) |
|
239 | self.setupUi(self) | |
240 | self.__puObjDict = {} |
|
240 | self.__puObjDict = {} | |
241 | self.__itemTreeDict = {} |
|
241 | self.__itemTreeDict = {} | |
242 | self.readUnitConfObjList = [] |
|
242 | self.readUnitConfObjList = [] | |
243 | self.operObjList = [] |
|
243 | self.operObjList = [] | |
244 | self.projecObjView = None |
|
244 | self.projecObjView = None | |
245 | self.idProject = 0 |
|
245 | self.idProject = 0 | |
246 | # self.idImag = 0 |
|
246 | # self.idImag = 0 | |
247 |
|
247 | |||
248 | self.idImagscope = 0 |
|
248 | self.idImagscope = 0 | |
249 | self.idImagspectra = 0 |
|
249 | self.idImagspectra = 0 | |
250 | self.idImagcross = 0 |
|
250 | self.idImagcross = 0 | |
251 | self.idImagrti = 0 |
|
251 | self.idImagrti = 0 | |
252 | self.idImagcoherence = 0 |
|
252 | self.idImagcoherence = 0 | |
253 | self.idImagpower = 0 |
|
253 | self.idImagpower = 0 | |
254 | self.idImagrtinoise = 0 |
|
254 | self.idImagrtinoise = 0 | |
255 | self.idImagspectraHeis = 0 |
|
255 | self.idImagspectraHeis = 0 | |
256 | self.idImagrtiHeis = 0 |
|
256 | self.idImagrtiHeis = 0 | |
257 |
|
257 | |||
258 | self.dateList = [] |
|
258 | self.dateList = [] | |
259 | self.dataPath = None |
|
259 | self.dataPath = None | |
260 | self.create = False |
|
260 | self.create = False | |
261 | self.selectedItemTree = None |
|
261 | self.selectedItemTree = None | |
262 | self.controllerThread = None |
|
262 | self.controllerThread = None | |
263 | # self.commCtrlPThread = None |
|
263 | # self.commCtrlPThread = None | |
264 | # self.create_figure() |
|
264 | # self.create_figure() | |
265 | self.temporalFTP = ftpBuffer() |
|
265 | self.temporalFTP = ftpBuffer() | |
266 | self.projectProperCaracteristica = [] |
|
266 | self.projectProperCaracteristica = [] | |
267 | self.projectProperPrincipal = [] |
|
267 | self.projectProperPrincipal = [] | |
268 | self.projectProperDescripcion = [] |
|
268 | self.projectProperDescripcion = [] | |
269 | self.volProperCaracteristica = [] |
|
269 | self.volProperCaracteristica = [] | |
270 | self.volProperPrincipal = [] |
|
270 | self.volProperPrincipal = [] | |
271 | self.volProperDescripcion = [] |
|
271 | self.volProperDescripcion = [] | |
272 | self.specProperCaracteristica = [] |
|
272 | self.specProperCaracteristica = [] | |
273 | self.specProperPrincipal = [] |
|
273 | self.specProperPrincipal = [] | |
274 | self.specProperDescripcion = [] |
|
274 | self.specProperDescripcion = [] | |
275 |
|
275 | |||
276 | self.specHeisProperCaracteristica = [] |
|
276 | self.specHeisProperCaracteristica = [] | |
277 | self.specHeisProperPrincipal = [] |
|
277 | self.specHeisProperPrincipal = [] | |
278 | self.specHeisProperDescripcion = [] |
|
278 | self.specHeisProperDescripcion = [] | |
279 |
|
279 | |||
280 | # self.pathWorkSpace = './' |
|
280 | # self.pathWorkSpace = './' | |
281 |
|
281 | |||
282 | self.__projectObjDict = {} |
|
282 | self.__projectObjDict = {} | |
283 | self.__operationObjDict = {} |
|
283 | self.__operationObjDict = {} | |
284 |
|
284 | |||
285 | self.__puLocalFolder2FTP = {} |
|
285 | self.__puLocalFolder2FTP = {} | |
286 | self.threadStarted = False |
|
286 | self.threadStarted = False | |
287 |
|
287 | |||
288 | self.plotManager = None |
|
288 | self.plotManager = None | |
289 |
|
289 | |||
290 | # self.create_comm() |
|
290 | # self.create_comm() | |
291 | self.create_updating_timer() |
|
291 | self.create_updating_timer() | |
292 | self.setGUIStatus() |
|
292 | self.setGUIStatus() | |
293 |
|
293 | |||
294 | @pyqtSignature("") |
|
294 | @pyqtSignature("") | |
295 | def on_actionOpen_triggered(self): |
|
295 | def on_actionOpen_triggered(self): | |
296 | """ |
|
296 | """ | |
297 | Slot documentation goes here. |
|
297 | Slot documentation goes here. | |
298 | """ |
|
298 | """ | |
299 | self.openProject() |
|
299 | self.openProject() | |
300 |
|
300 | |||
301 | @pyqtSignature("") |
|
301 | @pyqtSignature("") | |
302 | def on_actionCreate_triggered(self): |
|
302 | def on_actionCreate_triggered(self): | |
303 | """ |
|
303 | """ | |
304 | Slot documentation goes here. |
|
304 | Slot documentation goes here. | |
305 | """ |
|
305 | """ | |
306 | self.setInputsProject_View() |
|
306 | self.setInputsProject_View() | |
307 | self.create = True |
|
307 | self.create = True | |
308 |
|
308 | |||
309 | @pyqtSignature("") |
|
309 | @pyqtSignature("") | |
310 | def on_actionSave_triggered(self): |
|
310 | def on_actionSave_triggered(self): | |
311 | """ |
|
311 | """ | |
312 | Slot documentation goes here. |
|
312 | Slot documentation goes here. | |
313 | """ |
|
313 | """ | |
314 | self.saveProject() |
|
314 | self.saveProject() | |
315 |
|
315 | |||
316 | @pyqtSignature("") |
|
316 | @pyqtSignature("") | |
317 | def on_actionClose_triggered(self): |
|
317 | def on_actionClose_triggered(self): | |
318 | """ |
|
318 | """ | |
319 | Slot documentation goes here. |
|
319 | Slot documentation goes here. | |
320 | """ |
|
320 | """ | |
321 | self.close() |
|
321 | self.close() | |
322 |
|
322 | |||
323 | @pyqtSignature("") |
|
323 | @pyqtSignature("") | |
324 | def on_actionStart_triggered(self): |
|
324 | def on_actionStart_triggered(self): | |
325 | """ |
|
325 | """ | |
326 | """ |
|
326 | """ | |
327 | self.playProject() |
|
327 | self.playProject() | |
328 |
|
328 | |||
329 | @pyqtSignature("") |
|
329 | @pyqtSignature("") | |
330 | def on_actionPause_triggered(self): |
|
330 | def on_actionPause_triggered(self): | |
331 | """ |
|
331 | """ | |
332 | """ |
|
332 | """ | |
333 | self.pauseProject() |
|
333 | self.pauseProject() | |
334 |
|
334 | |||
335 | @pyqtSignature("") |
|
335 | @pyqtSignature("") | |
336 | def on_actionStop_triggered(self): |
|
336 | def on_actionStop_triggered(self): | |
337 | """ |
|
337 | """ | |
338 | """ |
|
338 | """ | |
339 | self.stopProject() |
|
339 | self.stopProject() | |
340 |
|
340 | |||
341 | @pyqtSignature("") |
|
341 | @pyqtSignature("") | |
342 | def on_actionAbout_triggered(self): |
|
342 | def on_actionAbout_triggered(self): | |
343 | """ |
|
343 | """ | |
344 | """ |
|
344 | """ | |
345 | self.aboutEvent() |
|
345 | self.aboutEvent() | |
346 |
|
346 | |||
347 | @pyqtSignature("") |
|
347 | @pyqtSignature("") | |
348 | def on_actionFTP_triggered(self): |
|
348 | def on_actionFTP_triggered(self): | |
349 | """ |
|
349 | """ | |
350 | """ |
|
350 | """ | |
351 | self.configFTPWindowObj = Ftp(self) |
|
351 | self.configFTPWindowObj = Ftp(self) | |
352 |
|
352 | |||
353 | if not self.temporalFTP.create: |
|
353 | if not self.temporalFTP.create: | |
354 | self.temporalFTP.setwithoutconfiguration() |
|
354 | self.temporalFTP.setwithoutconfiguration() | |
355 |
|
355 | |||
356 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, |
|
356 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |
357 | self.temporalFTP.remotefolder, |
|
357 | self.temporalFTP.remotefolder, | |
358 | self.temporalFTP.username, |
|
358 | self.temporalFTP.username, | |
359 | self.temporalFTP.password, |
|
359 | self.temporalFTP.password, | |
360 | self.temporalFTP.ftp_wei, |
|
360 | self.temporalFTP.ftp_wei, | |
361 | self.temporalFTP.exp_code, |
|
361 | self.temporalFTP.exp_code, | |
362 | self.temporalFTP.sub_exp_code, |
|
362 | self.temporalFTP.sub_exp_code, | |
363 | self.temporalFTP.plot_pos) |
|
363 | self.temporalFTP.plot_pos) | |
364 |
|
364 | |||
365 | self.configFTPWindowObj.show() |
|
365 | self.configFTPWindowObj.show() | |
366 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
366 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
367 |
|
367 | |||
368 | def createFTPConfig(self): |
|
368 | def createFTPConfig(self): | |
369 |
|
369 | |||
370 | if not self.configFTPWindowObj.create: |
|
370 | if not self.configFTPWindowObj.create: | |
371 | self.console.clear() |
|
371 | self.console.clear() | |
372 | self.console.append("There is no FTP configuration") |
|
372 | self.console.append("There is no FTP configuration") | |
373 | return |
|
373 | return | |
374 |
|
374 | |||
375 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
375 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
376 |
|
376 | |||
377 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
377 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
378 | self.temporalFTP.save(server=server, |
|
378 | self.temporalFTP.save(server=server, | |
379 | remotefolder=remotefolder, |
|
379 | remotefolder=remotefolder, | |
380 | username=username, |
|
380 | username=username, | |
381 | password=password, |
|
381 | password=password, | |
382 | ftp_wei=ftp_wei, |
|
382 | ftp_wei=ftp_wei, | |
383 | exp_code=exp_code, |
|
383 | exp_code=exp_code, | |
384 | sub_exp_code=sub_exp_code, |
|
384 | sub_exp_code=sub_exp_code, | |
385 | plot_pos=plot_pos) |
|
385 | plot_pos=plot_pos) | |
386 |
|
386 | |||
387 | @pyqtSignature("") |
|
387 | @pyqtSignature("") | |
388 | def on_actionOpenToolbar_triggered(self): |
|
388 | def on_actionOpenToolbar_triggered(self): | |
389 | """ |
|
389 | """ | |
390 | Slot documentation goes here. |
|
390 | Slot documentation goes here. | |
391 | """ |
|
391 | """ | |
392 | self.openProject() |
|
392 | self.openProject() | |
393 |
|
393 | |||
394 | @pyqtSignature("") |
|
394 | @pyqtSignature("") | |
395 | def on_actionCreateToolbar_triggered(self): |
|
395 | def on_actionCreateToolbar_triggered(self): | |
396 | """ |
|
396 | """ | |
397 | Slot documentation goes here. |
|
397 | Slot documentation goes here. | |
398 | """ |
|
398 | """ | |
399 | self.setInputsProject_View() |
|
399 | self.setInputsProject_View() | |
400 | self.create = True |
|
400 | self.create = True | |
401 |
|
401 | |||
402 | @pyqtSignature("") |
|
402 | @pyqtSignature("") | |
403 | def on_actionAddPU_triggered(self): |
|
403 | def on_actionAddPU_triggered(self): | |
404 |
|
404 | |||
405 | if len(self.__projectObjDict) == 0: |
|
405 | if len(self.__projectObjDict) == 0: | |
406 | outputstr = "First create a Project before add any Processing Unit" |
|
406 | outputstr = "First create a Project before add any Processing Unit" | |
407 | self.console.clear() |
|
407 | self.console.clear() | |
408 | self.console.append(outputstr) |
|
408 | self.console.append(outputstr) | |
409 | return |
|
409 | return | |
410 | else: |
|
410 | else: | |
411 | self.addPUWindow() |
|
411 | self.addPUWindow() | |
412 | self.console.clear() |
|
412 | self.console.clear() | |
413 | self.console.append("Please, Choose the type of Processing Unit") |
|
413 | self.console.append("Please, Choose the type of Processing Unit") | |
414 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
414 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
415 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
415 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
416 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
416 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
417 |
|
417 | |||
418 |
|
418 | |||
419 | @pyqtSignature("") |
|
419 | @pyqtSignature("") | |
420 | def on_actionSaveToolbar_triggered(self): |
|
420 | def on_actionSaveToolbar_triggered(self): | |
421 | """ |
|
421 | """ | |
422 | Slot documentation goes here. |
|
422 | Slot documentation goes here. | |
423 | """ |
|
423 | """ | |
424 | self.saveProject() |
|
424 | self.saveProject() | |
425 |
|
425 | |||
426 | @pyqtSignature("") |
|
426 | @pyqtSignature("") | |
427 | def on_actionStarToolbar_triggered(self): |
|
427 | def on_actionStarToolbar_triggered(self): | |
428 | """ |
|
428 | """ | |
429 | Slot documentation goes here. |
|
429 | Slot documentation goes here. | |
430 | """ |
|
430 | """ | |
431 | self.playProject() |
|
431 | self.playProject() | |
432 |
|
432 | |||
433 | @pyqtSignature("") |
|
433 | @pyqtSignature("") | |
434 | def on_actionPauseToolbar_triggered(self): |
|
434 | def on_actionPauseToolbar_triggered(self): | |
435 |
|
435 | |||
436 | self.pauseProject() |
|
436 | self.pauseProject() | |
437 |
|
437 | |||
438 | @pyqtSignature("") |
|
438 | @pyqtSignature("") | |
439 | def on_actionStopToolbar_triggered(self): |
|
439 | def on_actionStopToolbar_triggered(self): | |
440 | """ |
|
440 | """ | |
441 | Slot documentation goes here. |
|
441 | Slot documentation goes here. | |
442 | """ |
|
442 | """ | |
443 | self.stopProject() |
|
443 | self.stopProject() | |
444 |
|
444 | |||
445 | @pyqtSignature("int") |
|
445 | @pyqtSignature("int") | |
446 | def on_proComReadMode_activated(self, index): |
|
446 | def on_proComReadMode_activated(self, index): | |
447 | """ |
|
447 | """ | |
448 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
448 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
449 | """ |
|
449 | """ | |
450 | if index == 0: |
|
450 | if index == 0: | |
451 | # self.proDelay.setText("0") |
|
451 | # self.proDelay.setText("0") | |
452 | self.proSet.setEnabled(True) |
|
452 | self.proSet.setEnabled(True) | |
453 | self.proDelay.setEnabled(False) |
|
453 | self.proDelay.setEnabled(False) | |
454 | elif index == 1: |
|
454 | elif index == 1: | |
455 | self.proSet.setText("") |
|
455 | self.proSet.setText("") | |
456 | # self.proDelay.setText("5") |
|
456 | # self.proDelay.setText("5") | |
457 | self.proSet.setEnabled(False) |
|
457 | self.proSet.setEnabled(False) | |
458 | self.proDelay.setEnabled(True) |
|
458 | self.proDelay.setEnabled(True) | |
459 |
|
459 | |||
460 |
|
460 | |||
461 | def __setRawDataWindow(self): |
|
461 | def __setRawDataWindow(self): | |
462 |
|
462 | |||
463 | self.__setPDataWindow() |
|
463 | self.__setPDataWindow() | |
464 |
|
464 | |||
465 | self.frame_data.show() |
|
465 | self.frame_data.show() | |
466 |
|
466 | |||
467 | self.labnTxs.show() |
|
467 | self.labnTxs.show() | |
468 | self.pronTxs.show() |
|
468 | self.pronTxs.show() | |
469 |
|
469 | |||
470 | self.labByBlock.show() |
|
470 | self.labByBlock.show() | |
471 | self.proComByBlock.show() |
|
471 | self.proComByBlock.show() | |
472 |
|
472 | |||
473 | def __setPDataWindow(self): |
|
473 | def __setPDataWindow(self): | |
474 |
|
474 | |||
475 | self.labelIPPKm.hide() |
|
475 | self.labelIPPKm.hide() | |
476 | self.proIPPKm.hide() |
|
476 | self.proIPPKm.hide() | |
477 |
|
477 | |||
478 | self.labelSet.show() |
|
478 | self.labelSet.show() | |
479 | self.proSet.show() |
|
479 | self.proSet.show() | |
480 |
|
480 | |||
481 | self.labExpLabel.show() |
|
481 | self.labExpLabel.show() | |
482 | self.proExpLabel.show() |
|
482 | self.proExpLabel.show() | |
483 |
|
483 | |||
484 | self.labelWalk.show() |
|
484 | self.labelWalk.show() | |
485 | self.proComWalk.show() |
|
485 | self.proComWalk.show() | |
486 |
|
486 | |||
487 | self.frame_data.hide() |
|
487 | self.frame_data.hide() | |
488 |
|
488 | |||
489 | # self.labnTxs.hide() |
|
489 | # self.labnTxs.hide() | |
490 | # self.pronTxs.hide() |
|
490 | # self.pronTxs.hide() | |
491 | # |
|
491 | # | |
492 | # self.labByBlock.hide() |
|
492 | # self.labByBlock.hide() | |
493 | # self.proComByBlock.hide() |
|
493 | # self.proComByBlock.hide() | |
494 |
|
494 | |||
495 | def __setUSRPDataWindow(self): |
|
495 | def __setUSRPDataWindow(self): | |
496 |
|
496 | |||
497 | self.frame_data.show() |
|
497 | self.frame_data.show() | |
498 |
|
498 | |||
499 | self.labelIPPKm.show() |
|
499 | self.labelIPPKm.show() | |
500 | self.proIPPKm.show() |
|
500 | self.proIPPKm.show() | |
501 |
|
501 | |||
502 | self.labelSet.hide() |
|
502 | self.labelSet.hide() | |
503 | self.proSet.hide() |
|
503 | self.proSet.hide() | |
504 |
|
504 | |||
505 | self.labExpLabel.hide() |
|
505 | self.labExpLabel.hide() | |
506 | self.proExpLabel.hide() |
|
506 | self.proExpLabel.hide() | |
507 |
|
507 | |||
508 | self.labelWalk.hide() |
|
508 | self.labelWalk.hide() | |
509 | self.proComWalk.hide() |
|
509 | self.proComWalk.hide() | |
510 |
|
510 | |||
511 | self.labnTxs.hide() |
|
511 | self.labnTxs.hide() | |
512 | self.pronTxs.hide() |
|
512 | self.pronTxs.hide() | |
513 |
|
513 | |||
514 | self.labByBlock.hide() |
|
514 | self.labByBlock.hide() | |
515 | self.proComByBlock.hide() |
|
515 | self.proComByBlock.hide() | |
516 |
|
516 | |||
517 | @pyqtSignature("int") |
|
517 | @pyqtSignature("int") | |
518 | def on_proComDataType_activated(self, index): |
|
518 | def on_proComDataType_activated(self, index): | |
519 | """ |
|
519 | """ | |
520 | Voltage or Spectra |
|
520 | Voltage or Spectra | |
521 | """ |
|
521 | """ | |
522 |
|
522 | |||
523 | if index == 0: |
|
523 | if index == 0: | |
524 | extension = '.r' |
|
524 | extension = '.r' | |
525 | self.__setRawDataWindow() |
|
525 | self.__setRawDataWindow() | |
526 |
|
526 | |||
527 | elif index == 1: |
|
527 | elif index == 1: | |
528 | extension = '.pdata' |
|
528 | extension = '.pdata' | |
529 | self.__setPDataWindow() |
|
529 | self.__setPDataWindow() | |
530 |
|
530 | |||
531 |
|
531 | |||
532 | elif index == 2: |
|
532 | elif index == 2: | |
533 | extension = '.fits' |
|
533 | extension = '.fits' | |
534 | self.__setPDataWindow() |
|
534 | self.__setPDataWindow() | |
535 |
|
535 | |||
536 | elif index == 3: |
|
536 | elif index == 3: | |
537 | extension = '.hdf5' |
|
537 | extension = '.hdf5' | |
538 | self.__setUSRPDataWindow() |
|
538 | self.__setUSRPDataWindow() | |
539 |
|
539 | |||
540 | self.proDataType.setText(extension) |
|
540 | self.proDataType.setText(extension) | |
541 |
|
541 | |||
542 | @pyqtSignature("int") |
|
542 | @pyqtSignature("int") | |
543 | def on_proComWalk_activated(self, index): |
|
543 | def on_proComWalk_activated(self, index): | |
544 | """ |
|
544 | """ | |
545 |
|
545 | |||
546 | """ |
|
546 | """ | |
547 | if index == 0: |
|
547 | if index == 0: | |
548 | self.proExpLabel.setEnabled(False) |
|
548 | self.proExpLabel.setEnabled(False) | |
549 | elif index == 1: |
|
549 | elif index == 1: | |
550 | self.proExpLabel.setEnabled(True) |
|
550 | self.proExpLabel.setEnabled(True) | |
551 |
|
551 | |||
552 | @pyqtSignature("") |
|
552 | @pyqtSignature("") | |
553 | def on_proToolPath_clicked(self): |
|
553 | def on_proToolPath_clicked(self): | |
554 | """ |
|
554 | """ | |
555 | Choose your path |
|
555 | Choose your path | |
556 | """ |
|
556 | """ | |
557 |
|
557 | |||
558 | current_dpath = './' |
|
558 | current_dpath = './' | |
559 | if self.dataPath: |
|
559 | if self.dataPath: | |
560 | current_dpath = self.dataPath |
|
560 | current_dpath = self.dataPath | |
561 |
|
561 | |||
562 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
562 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
563 |
|
563 | |||
564 | #If it was canceled |
|
564 | #If it was canceled | |
565 | if not datapath: |
|
565 | if not datapath: | |
566 | return |
|
566 | return | |
567 |
|
567 | |||
568 | #If any change was done |
|
568 | #If any change was done | |
569 | if datapath == self.dataPath: |
|
569 | if datapath == self.dataPath: | |
570 | return |
|
570 | return | |
571 |
|
571 | |||
572 | self.proDataPath.setText(datapath) |
|
572 | self.proDataPath.setText(datapath) | |
573 |
|
573 | |||
574 | self._disable_play_button() |
|
574 | self._disable_play_button() | |
575 | self._disable_save_button() |
|
575 | self._disable_save_button() | |
576 | self.proOk.setEnabled(False) |
|
576 | self.proOk.setEnabled(False) | |
577 |
|
577 | |||
578 | self.proComStartDate.clear() |
|
578 | self.proComStartDate.clear() | |
579 | self.proComEndDate.clear() |
|
579 | self.proComEndDate.clear() | |
580 |
|
580 | |||
581 | if not os.path.exists(datapath): |
|
581 | if not os.path.exists(datapath): | |
582 |
|
582 | |||
583 | self.console.clear() |
|
583 | self.console.clear() | |
584 | self.console.append("Write a valid path") |
|
584 | self.console.append("Write a valid path") | |
585 | return |
|
585 | return | |
586 |
|
586 | |||
587 | self.dataPath = datapath |
|
587 | self.dataPath = datapath | |
588 |
|
588 | |||
589 | self.console.clear() |
|
589 | self.console.clear() | |
590 | self.console.append("Select the read mode and press 'load button'") |
|
590 | self.console.append("Select the read mode and press 'load button'") | |
591 |
|
591 | |||
592 |
|
592 | |||
593 | @pyqtSignature("") |
|
593 | @pyqtSignature("") | |
594 | def on_proLoadButton_clicked(self): |
|
594 | def on_proLoadButton_clicked(self): | |
595 |
|
595 | |||
596 | self.console.clear() |
|
596 | self.console.clear() | |
597 |
|
597 | |||
598 | projectParms = self.__getParmsFromProjectWindow() |
|
598 | projectParms = self.__getParmsFromProjectWindow() | |
599 |
|
599 | |||
600 | if not projectParms.online: |
|
600 | if not projectParms.online: | |
601 | self.proComStartDate.clear() |
|
601 | self.proComStartDate.clear() | |
602 | self.proComEndDate.clear() |
|
602 | self.proComEndDate.clear() | |
603 | self.proComStartDate.setEnabled(True) |
|
603 | self.proComStartDate.setEnabled(True) | |
604 | self.proComEndDate.setEnabled(True) |
|
604 | self.proComEndDate.setEnabled(True) | |
605 | self.proStartTime.setEnabled(True) |
|
605 | self.proStartTime.setEnabled(True) | |
606 | self.proEndTime.setEnabled(True) |
|
606 | self.proEndTime.setEnabled(True) | |
607 | self.frame_2.setEnabled(True) |
|
607 | self.frame_2.setEnabled(True) | |
608 |
|
608 | |||
609 | else: |
|
609 | else: | |
610 | self.proComStartDate.addItem("1960/01/30") |
|
610 | self.proComStartDate.addItem("1960/01/30") | |
611 | self.proComEndDate.addItem("2018/12/31") |
|
611 | self.proComEndDate.addItem("2018/12/31") | |
612 | self.proComStartDate.setEnabled(False) |
|
612 | self.proComStartDate.setEnabled(False) | |
613 | self.proComEndDate.setEnabled(False) |
|
613 | self.proComEndDate.setEnabled(False) | |
614 | self.proStartTime.setEnabled(False) |
|
614 | self.proStartTime.setEnabled(False) | |
615 | self.proEndTime.setEnabled(False) |
|
615 | self.proEndTime.setEnabled(False) | |
616 | self.frame_2.setEnabled(True) |
|
616 | self.frame_2.setEnabled(True) | |
617 |
|
617 | |||
618 | if self.loadDays(projectParms.dpath, projectParms.ext, projectParms.walk, projectParms.expLabel) == []: |
|
618 | if self.loadDays(projectParms.dpath, projectParms.ext, projectParms.walk, projectParms.expLabel) == []: | |
619 | self._disable_save_button() |
|
619 | self._disable_save_button() | |
620 | self._disable_play_button() |
|
620 | self._disable_play_button() | |
621 | self.proOk.setEnabled(False) |
|
621 | self.proOk.setEnabled(False) | |
622 | else: |
|
622 | else: | |
623 | self._enable_save_button() |
|
623 | self._enable_save_button() | |
624 | self._enable_play_button() |
|
624 | self._enable_play_button() | |
625 | self.proOk.setEnabled(True) |
|
625 | self.proOk.setEnabled(True) | |
626 |
|
626 | |||
627 | @pyqtSignature("int") |
|
627 | @pyqtSignature("int") | |
628 | def on_proComStartDate_activated(self, index): |
|
628 | def on_proComStartDate_activated(self, index): | |
629 | """ |
|
629 | """ | |
630 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
630 | SELECCION DEL RANGO DE FECHAS -START DATE | |
631 | """ |
|
631 | """ | |
632 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
632 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
633 |
|
633 | |||
634 | self.proComEndDate.clear() |
|
634 | self.proComEndDate.clear() | |
635 | for i in self.dateList[index:]: |
|
635 | for i in self.dateList[index:]: | |
636 | self.proComEndDate.addItem(i) |
|
636 | self.proComEndDate.addItem(i) | |
637 |
|
637 | |||
638 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
638 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
639 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
639 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
640 | else: |
|
640 | else: | |
641 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
641 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
642 |
|
642 | |||
643 | @pyqtSignature("int") |
|
643 | @pyqtSignature("int") | |
644 | def on_proComEndDate_activated(self, index): |
|
644 | def on_proComEndDate_activated(self, index): | |
645 | """ |
|
645 | """ | |
646 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
646 | SELECCION DEL RANGO DE FECHAS-END DATE | |
647 | """ |
|
647 | """ | |
648 | pass |
|
648 | pass | |
649 |
|
649 | |||
650 | @pyqtSignature("") |
|
650 | @pyqtSignature("") | |
651 | def on_proOk_clicked(self): |
|
651 | def on_proOk_clicked(self): | |
652 | """ |
|
652 | """ | |
653 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
653 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
654 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
654 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
655 | """ |
|
655 | """ | |
656 |
|
656 | |||
657 | self._disable_play_button() |
|
657 | self._disable_play_button() | |
658 | self._disable_save_button() |
|
658 | self._disable_save_button() | |
659 |
|
659 | |||
660 | self.console.clear() |
|
660 | self.console.clear() | |
661 |
|
661 | |||
662 | if self.create: |
|
662 | if self.create: | |
663 |
|
663 | |||
664 | projectId = self.__getNewProjectId() |
|
664 | projectId = self.__getNewProjectId() | |
665 |
|
665 | |||
666 | if not projectId: |
|
666 | if not projectId: | |
667 | return 0 |
|
667 | return 0 | |
668 |
|
668 | |||
669 | projectObjView = self.createProjectView(projectId) |
|
669 | projectObjView = self.createProjectView(projectId) | |
670 |
|
670 | |||
671 | if not projectObjView: |
|
671 | if not projectObjView: | |
672 | return 0 |
|
672 | return 0 | |
673 |
|
673 | |||
674 | self.create = False |
|
674 | self.create = False | |
675 |
|
675 | |||
676 | readUnitObj = self.createReadUnitView(projectObjView) |
|
676 | readUnitObj = self.createReadUnitView(projectObjView) | |
677 |
|
677 | |||
678 | if not readUnitObj: |
|
678 | if not readUnitObj: | |
679 | return 0 |
|
679 | return 0 | |
680 |
|
680 | |||
681 | else: |
|
681 | else: | |
682 | projectObjView = self.updateProjectView() |
|
682 | projectObjView = self.updateProjectView() | |
683 |
|
683 | |||
684 | if not projectObjView: |
|
684 | if not projectObjView: | |
685 | return 0 |
|
685 | return 0 | |
686 |
|
686 | |||
687 | projectId = projectObjView.getId() |
|
687 | projectId = projectObjView.getId() | |
688 | idReadUnit = projectObjView.getReadUnitId() |
|
688 | idReadUnit = projectObjView.getReadUnitId() | |
689 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
689 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
690 |
|
690 | |||
691 | if not readUnitObj: |
|
691 | if not readUnitObj: | |
692 | return 0 |
|
692 | return 0 | |
693 |
|
693 | |||
694 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
694 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
695 | # Project Properties |
|
695 | # Project Properties | |
696 | self.refreshProjectProperties(projectObjView) |
|
696 | self.refreshProjectProperties(projectObjView) | |
697 | # Disable tabProject after finish the creation |
|
697 | # Disable tabProject after finish the creation | |
698 |
|
698 | |||
699 | self._enable_play_button() |
|
699 | self._enable_play_button() | |
700 | self._enable_save_button() |
|
700 | self._enable_save_button() | |
701 |
|
701 | |||
702 | self.console.clear() |
|
702 | self.console.clear() | |
703 | self.console.append("The project parameters were validated") |
|
703 | self.console.append("The project parameters were validated") | |
704 |
|
704 | |||
705 | return 1 |
|
705 | return 1 | |
706 |
|
706 | |||
707 | @pyqtSignature("") |
|
707 | @pyqtSignature("") | |
708 | def on_proClear_clicked(self): |
|
708 | def on_proClear_clicked(self): | |
709 |
|
709 | |||
710 | self.console.clear() |
|
710 | self.console.clear() | |
711 |
|
711 | |||
712 | @pyqtSignature("int") |
|
712 | @pyqtSignature("int") | |
713 | def on_volOpCebChannels_stateChanged(self, p0): |
|
713 | def on_volOpCebChannels_stateChanged(self, p0): | |
714 | """ |
|
714 | """ | |
715 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
715 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
716 | """ |
|
716 | """ | |
717 | if p0 == 2: |
|
717 | if p0 == 2: | |
718 | self.volOpComChannels.setEnabled(True) |
|
718 | self.volOpComChannels.setEnabled(True) | |
719 | self.volOpChannel.setEnabled(True) |
|
719 | self.volOpChannel.setEnabled(True) | |
720 |
|
720 | |||
721 | if p0 == 0: |
|
721 | if p0 == 0: | |
722 | self.volOpComChannels.setEnabled(False) |
|
722 | self.volOpComChannels.setEnabled(False) | |
723 | self.volOpChannel.setEnabled(False) |
|
723 | self.volOpChannel.setEnabled(False) | |
724 | # self.volOpChannel.clear() |
|
724 | # self.volOpChannel.clear() | |
725 |
|
725 | |||
726 | @pyqtSignature("int") |
|
726 | @pyqtSignature("int") | |
727 | def on_volOpCebHeights_stateChanged(self, p0): |
|
727 | def on_volOpCebHeights_stateChanged(self, p0): | |
728 | """ |
|
728 | """ | |
729 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
729 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
730 | """ |
|
730 | """ | |
731 | if p0 == 2: |
|
731 | if p0 == 2: | |
732 | self.volOpHeights.setEnabled(True) |
|
732 | self.volOpHeights.setEnabled(True) | |
733 | self.volOpComHeights.setEnabled(True) |
|
733 | self.volOpComHeights.setEnabled(True) | |
734 |
|
734 | |||
735 | if p0 == 0: |
|
735 | if p0 == 0: | |
736 | self.volOpHeights.setEnabled(False) |
|
736 | self.volOpHeights.setEnabled(False) | |
737 | # self.volOpHeights.clear() |
|
737 | # self.volOpHeights.clear() | |
738 | self.volOpComHeights.setEnabled(False) |
|
738 | self.volOpComHeights.setEnabled(False) | |
739 |
|
739 | |||
740 | @pyqtSignature("int") |
|
740 | @pyqtSignature("int") | |
741 | def on_volOpCebFilter_stateChanged(self, p0): |
|
741 | def on_volOpCebFilter_stateChanged(self, p0): | |
742 | """ |
|
742 | """ | |
743 | Name='Decoder', optype='other' |
|
743 | Name='Decoder', optype='other' | |
744 | """ |
|
744 | """ | |
745 | if p0 == 2: |
|
745 | if p0 == 2: | |
746 | self.volOpFilter.setEnabled(True) |
|
746 | self.volOpFilter.setEnabled(True) | |
747 |
|
747 | |||
748 | if p0 == 0: |
|
748 | if p0 == 0: | |
749 | self.volOpFilter.setEnabled(False) |
|
749 | self.volOpFilter.setEnabled(False) | |
750 | # self.volOpFilter.clear() |
|
750 | # self.volOpFilter.clear() | |
751 |
|
751 | |||
752 | @pyqtSignature("int") |
|
752 | @pyqtSignature("int") | |
753 | def on_volOpCebProfile_stateChanged(self, p0): |
|
753 | def on_volOpCebProfile_stateChanged(self, p0): | |
754 | """ |
|
754 | """ | |
755 | Check Box habilita ingreso del rango de Perfiles |
|
755 | Check Box habilita ingreso del rango de Perfiles | |
756 | """ |
|
756 | """ | |
757 | if p0 == 2: |
|
757 | if p0 == 2: | |
758 | self.volOpComProfile.setEnabled(True) |
|
758 | self.volOpComProfile.setEnabled(True) | |
759 | self.volOpProfile.setEnabled(True) |
|
759 | self.volOpProfile.setEnabled(True) | |
760 |
|
760 | |||
761 | if p0 == 0: |
|
761 | if p0 == 0: | |
762 | self.volOpComProfile.setEnabled(False) |
|
762 | self.volOpComProfile.setEnabled(False) | |
763 | self.volOpProfile.setEnabled(False) |
|
763 | self.volOpProfile.setEnabled(False) | |
764 | # self.volOpProfile.clear() |
|
764 | # self.volOpProfile.clear() | |
765 |
|
765 | |||
766 | @pyqtSignature("int") |
|
766 | @pyqtSignature("int") | |
767 | def on_volOpComProfile_activated(self, index): |
|
767 | def on_volOpComProfile_activated(self, index): | |
768 | """ |
|
768 | """ | |
769 | Check Box habilita ingreso del rango de Perfiles |
|
769 | Check Box habilita ingreso del rango de Perfiles | |
770 | """ |
|
770 | """ | |
771 | #Profile List |
|
771 | #Profile List | |
772 | if index == 0: |
|
772 | if index == 0: | |
773 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
773 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
774 |
|
774 | |||
775 | #Profile Range |
|
775 | #Profile Range | |
776 | if index == 1: |
|
776 | if index == 1: | |
777 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
777 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
778 |
|
778 | |||
779 | #Profile Range List |
|
779 | #Profile Range List | |
780 | if index == 2: |
|
780 | if index == 2: | |
781 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
781 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
782 |
|
782 | |||
783 | @pyqtSignature("int") |
|
783 | @pyqtSignature("int") | |
784 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
784 | def on_volOpCebDecodification_stateChanged(self, p0): | |
785 | """ |
|
785 | """ | |
786 | Check Box habilita |
|
786 | Check Box habilita | |
787 | """ |
|
787 | """ | |
788 | if p0 == 2: |
|
788 | if p0 == 2: | |
789 | self.volOpComCode.setEnabled(True) |
|
789 | self.volOpComCode.setEnabled(True) | |
790 | self.volOpComMode.setEnabled(True) |
|
790 | self.volOpComMode.setEnabled(True) | |
791 | if p0 == 0: |
|
791 | if p0 == 0: | |
792 | self.volOpComCode.setEnabled(False) |
|
792 | self.volOpComCode.setEnabled(False) | |
793 | self.volOpComMode.setEnabled(False) |
|
793 | self.volOpComMode.setEnabled(False) | |
794 |
|
794 | |||
795 | @pyqtSignature("int") |
|
795 | @pyqtSignature("int") | |
796 | def on_volOpComCode_activated(self, index): |
|
796 | def on_volOpComCode_activated(self, index): | |
797 | """ |
|
797 | """ | |
798 | Check Box habilita ingreso |
|
798 | Check Box habilita ingreso | |
799 | """ |
|
799 | """ | |
800 | if index == 13: |
|
800 | if index == 13: | |
801 | self.volOpCode.setEnabled(True) |
|
801 | self.volOpCode.setEnabled(True) | |
802 | else: |
|
802 | else: | |
803 | self.volOpCode.setEnabled(False) |
|
803 | self.volOpCode.setEnabled(False) | |
804 |
|
804 | |||
805 | if index == 0: |
|
805 | if index == 0: | |
806 | code = '' |
|
806 | # code = '' | |
807 | self.volOpCode.setText(str(code)) |
|
807 | # self.volOpCode.setText(str(code)) | |
808 | return |
|
808 | return | |
809 |
|
809 | |||
810 | if index == 1: |
|
810 | if index == 1: | |
811 | code = '(1,1,-1)' |
|
811 | code = '(1,1,-1)' | |
812 | nCode = '1' |
|
812 | nCode = '1' | |
813 | nBaud = '3' |
|
813 | nBaud = '3' | |
814 | if index == 2: |
|
814 | if index == 2: | |
815 | code = '(1,1,-1,1)' |
|
815 | code = '(1,1,-1,1)' | |
816 | nCode = '1' |
|
816 | nCode = '1' | |
817 | nBaud = '4' |
|
817 | nBaud = '4' | |
818 | if index == 3: |
|
818 | if index == 3: | |
819 | code = '(1,1,1,-1,1)' |
|
819 | code = '(1,1,1,-1,1)' | |
820 | nCode = '1' |
|
820 | nCode = '1' | |
821 | nBaud = '5' |
|
821 | nBaud = '5' | |
822 | if index == 4: |
|
822 | if index == 4: | |
823 | code = '(1,1,1,-1,-1,1,-1)' |
|
823 | code = '(1,1,1,-1,-1,1,-1)' | |
824 | nCode = '1' |
|
824 | nCode = '1' | |
825 | nBaud = '7' |
|
825 | nBaud = '7' | |
826 | if index == 5: |
|
826 | if index == 5: | |
827 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
827 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
828 | nCode = '1' |
|
828 | nCode = '1' | |
829 | nBaud = '11' |
|
829 | nBaud = '11' | |
830 | if index == 6: |
|
830 | if index == 6: | |
831 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
831 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
832 | nCode = '1' |
|
832 | nCode = '1' | |
833 | nBaud = '13' |
|
833 | nBaud = '13' | |
834 | if index == 7: |
|
834 | if index == 7: | |
835 | code = '(1,1,-1,-1,-1,1)' |
|
835 | code = '(1,1,-1,-1,-1,1)' | |
836 | nCode = '2' |
|
836 | nCode = '2' | |
837 | nBaud = '3' |
|
837 | nBaud = '3' | |
838 | if index == 8: |
|
838 | if index == 8: | |
839 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
839 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
840 | nCode = '2' |
|
840 | nCode = '2' | |
841 | nBaud = '4' |
|
841 | nBaud = '4' | |
842 | if index == 9: |
|
842 | if index == 9: | |
843 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
843 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
844 | nCode = '2' |
|
844 | nCode = '2' | |
845 | nBaud = '5' |
|
845 | nBaud = '5' | |
846 | if index == 10: |
|
846 | if index == 10: | |
847 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
847 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
848 | nCode = '2' |
|
848 | nCode = '2' | |
849 | nBaud = '7' |
|
849 | nBaud = '7' | |
850 | if index == 11: |
|
850 | if index == 11: | |
851 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' |
|
851 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
852 | nCode = '2' |
|
852 | nCode = '2' | |
853 | nBaud = '11' |
|
853 | nBaud = '11' | |
854 | if index == 12: |
|
854 | if index == 12: | |
855 | code = '(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)' |
|
855 | code = '(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)' | |
856 | nCode = '2' |
|
856 | nCode = '2' | |
857 | nBaud = '13' |
|
857 | nBaud = '13' | |
858 |
|
858 | |||
859 | code = ast.literal_eval(code) |
|
859 | code = ast.literal_eval(code) | |
860 | nCode = int(nCode) |
|
860 | nCode = int(nCode) | |
861 | nBaud = int(nBaud) |
|
861 | nBaud = int(nBaud) | |
862 |
|
862 | |||
863 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
863 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
864 |
|
864 | |||
865 | self.volOpCode.setText(str(code)) |
|
865 | self.volOpCode.setText(str(code)) | |
866 |
|
866 | |||
867 | @pyqtSignature("int") |
|
867 | @pyqtSignature("int") | |
868 | def on_volOpCebFlip_stateChanged(self, p0): |
|
868 | def on_volOpCebFlip_stateChanged(self, p0): | |
869 | """ |
|
869 | """ | |
870 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
870 | Check Box habilita ingresode del numero de Integraciones a realizar | |
871 | """ |
|
871 | """ | |
872 | if p0 == 2: |
|
872 | if p0 == 2: | |
873 | self.volOpFlip.setEnabled(True) |
|
873 | self.volOpFlip.setEnabled(True) | |
874 | if p0 == 0: |
|
874 | if p0 == 0: | |
875 | self.volOpFlip.setEnabled(False) |
|
875 | self.volOpFlip.setEnabled(False) | |
876 | # self.volOpFlip.clear() |
|
876 | # self.volOpFlip.clear() | |
877 |
|
877 | |||
878 | @pyqtSignature("int") |
|
878 | @pyqtSignature("int") | |
879 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
879 | def on_volOpCebCohInt_stateChanged(self, p0): | |
880 | """ |
|
880 | """ | |
881 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
881 | Check Box habilita ingresode del numero de Integraciones a realizar | |
882 | """ |
|
882 | """ | |
883 | if p0 == 2: |
|
883 | if p0 == 2: | |
884 | self.volOpCohInt.setEnabled(True) |
|
884 | self.volOpCohInt.setEnabled(True) | |
885 | if p0 == 0: |
|
885 | if p0 == 0: | |
886 | self.volOpCohInt.setEnabled(False) |
|
886 | self.volOpCohInt.setEnabled(False) | |
887 | # self.volOpCohInt.clear() |
|
887 | # self.volOpCohInt.clear() | |
888 |
|
888 | |||
889 | @pyqtSignature("int") |
|
889 | @pyqtSignature("int") | |
890 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
890 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
891 | """ |
|
891 | """ | |
892 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
892 | Check Box habilita ingresode del numero de Integraciones a realizar | |
893 | """ |
|
893 | """ | |
894 | if p0 == 2: |
|
894 | if p0 == 2: | |
895 | self.volOpRadarfrequency.setEnabled(True) |
|
895 | self.volOpRadarfrequency.setEnabled(True) | |
896 | if p0 == 0: |
|
896 | if p0 == 0: | |
897 | self.volOpRadarfrequency.clear() |
|
897 | self.volOpRadarfrequency.clear() | |
898 | self.volOpRadarfrequency.setEnabled(False) |
|
898 | self.volOpRadarfrequency.setEnabled(False) | |
899 |
|
899 | |||
900 | @pyqtSignature("") |
|
900 | @pyqtSignature("") | |
901 | def on_volOutputToolPath_clicked(self): |
|
901 | def on_volOutputToolPath_clicked(self): | |
902 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
902 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
903 | self.volOutputPath.setText(dirOutPath) |
|
903 | self.volOutputPath.setText(dirOutPath) | |
904 |
|
904 | |||
905 | @pyqtSignature("") |
|
905 | @pyqtSignature("") | |
906 | def on_specOutputToolPath_clicked(self): |
|
906 | def on_specOutputToolPath_clicked(self): | |
907 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
907 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
908 | self.specOutputPath.setText(dirOutPath) |
|
908 | self.specOutputPath.setText(dirOutPath) | |
909 |
|
909 | |||
910 | @pyqtSignature("") |
|
910 | @pyqtSignature("") | |
911 | def on_specHeisOutputToolPath_clicked(self): |
|
911 | def on_specHeisOutputToolPath_clicked(self): | |
912 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
912 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
913 | self.specHeisOutputPath.setText(dirOutPath) |
|
913 | self.specHeisOutputPath.setText(dirOutPath) | |
914 |
|
914 | |||
915 | @pyqtSignature("") |
|
915 | @pyqtSignature("") | |
916 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
916 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
917 |
|
917 | |||
918 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
918 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
919 | self.specHeisOutputMetada.setText(filename) |
|
919 | self.specHeisOutputMetada.setText(filename) | |
920 |
|
920 | |||
921 | @pyqtSignature("") |
|
921 | @pyqtSignature("") | |
922 | def on_volOpOk_clicked(self): |
|
922 | def on_volOpOk_clicked(self): | |
923 | """ |
|
923 | """ | |
924 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
924 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
925 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
925 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
926 | """ |
|
926 | """ | |
927 |
|
927 | |||
928 | checkPath = False |
|
928 | checkPath = False | |
929 |
|
929 | |||
930 | self._disable_play_button() |
|
930 | self._disable_play_button() | |
931 | self._disable_save_button() |
|
931 | self._disable_save_button() | |
932 |
|
932 | |||
933 | self.console.clear() |
|
933 | self.console.clear() | |
934 | self.console.append("Checking input parameters:\n") |
|
934 | self.console.append("Checking input parameters:\n") | |
935 |
|
935 | |||
936 | puObj = self.getSelectedItemObj() |
|
936 | puObj = self.getSelectedItemObj() | |
937 | puObj.removeOperations() |
|
937 | puObj.removeOperations() | |
938 |
|
938 | |||
939 | if self.volOpCebRadarfrequency.isChecked(): |
|
939 | if self.volOpCebRadarfrequency.isChecked(): | |
940 | value = str(self.volOpRadarfrequency.text()) |
|
940 | value = str(self.volOpRadarfrequency.text()) | |
941 | format = 'float' |
|
941 | format = 'float' | |
942 | name_operation = 'setRadarFrequency' |
|
942 | name_operation = 'setRadarFrequency' | |
943 | name_parameter = 'frequency' |
|
943 | name_parameter = 'frequency' | |
944 |
|
944 | |||
945 | if not isFloat(value): |
|
945 | if not isFloat(value): | |
946 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
946 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
947 | return 0 |
|
947 | return 0 | |
948 |
|
948 | |||
949 | opObj = puObj.addOperation(name=name_operation) |
|
949 | opObj = puObj.addOperation(name=name_operation) | |
950 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
950 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
951 |
|
951 | |||
952 | if self.volOpCebChannels.isChecked(): |
|
952 | if self.volOpCebChannels.isChecked(): | |
953 |
|
953 | |||
954 | format = 'intlist' |
|
954 | format = 'intlist' | |
955 | if self.volOpComChannels.currentIndex() == 0: |
|
955 | if self.volOpComChannels.currentIndex() == 0: | |
956 | name_operation = "selectChannels" |
|
956 | name_operation = "selectChannels" | |
957 | name_parameter = 'channelList' |
|
957 | name_parameter = 'channelList' | |
958 | else: |
|
958 | else: | |
959 | name_operation = "selectChannelsByIndex" |
|
959 | name_operation = "selectChannelsByIndex" | |
960 | name_parameter = 'channelIndexList' |
|
960 | name_parameter = 'channelIndexList' | |
961 |
|
961 | |||
962 | value = str(self.volOpChannel.text()) |
|
962 | value = str(self.volOpChannel.text()) | |
963 |
|
963 | |||
964 | if not isIntList(value): |
|
964 | if not isIntList(value): | |
965 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
965 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
966 | return 0 |
|
966 | return 0 | |
967 |
|
967 | |||
968 | opObj = puObj.addOperation(name=name_operation) |
|
968 | opObj = puObj.addOperation(name=name_operation) | |
969 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
969 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
970 |
|
970 | |||
971 | if self.volOpCebHeights.isChecked(): |
|
971 | if self.volOpCebHeights.isChecked(): | |
972 | value = str(self.volOpHeights.text()) |
|
972 | value = str(self.volOpHeights.text()) | |
973 |
|
973 | |||
974 | if not isFloatRange(value): |
|
974 | if not isFloatRange(value): | |
975 | self.console.append("Invalid value '%s' for Height range" %value) |
|
975 | self.console.append("Invalid value '%s' for Height range" %value) | |
976 | return 0 |
|
976 | return 0 | |
977 |
|
977 | |||
978 | valueList = value.split(',') |
|
978 | valueList = value.split(',') | |
979 |
|
979 | |||
980 | if self.volOpComHeights.currentIndex() == 0: |
|
980 | if self.volOpComHeights.currentIndex() == 0: | |
981 | format = 'float' |
|
981 | format = 'float' | |
982 | name_operation = 'selectHeights' |
|
982 | name_operation = 'selectHeights' | |
983 | name_parameter1 = 'minHei' |
|
983 | name_parameter1 = 'minHei' | |
984 | name_parameter2 = 'maxHei' |
|
984 | name_parameter2 = 'maxHei' | |
985 | else: |
|
985 | else: | |
986 | format = 'int' |
|
986 | format = 'int' | |
987 | name_operation = 'selectHeightsByIndex' |
|
987 | name_operation = 'selectHeightsByIndex' | |
988 | name_parameter1 = 'minIndex' |
|
988 | name_parameter1 = 'minIndex' | |
989 | name_parameter2 = 'maxIndex' |
|
989 | name_parameter2 = 'maxIndex' | |
990 |
|
990 | |||
991 | opObj = puObj.addOperation(name=name_operation) |
|
991 | opObj = puObj.addOperation(name=name_operation) | |
992 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
992 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
993 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
993 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
994 |
|
994 | |||
995 | if self.volOpCebFilter.isChecked(): |
|
995 | if self.volOpCebFilter.isChecked(): | |
996 | value = str(self.volOpFilter.text()) |
|
996 | value = str(self.volOpFilter.text()) | |
997 |
|
997 | |||
998 | if not isInt(value): |
|
998 | if not isInt(value): | |
999 | self.console.append("Invalid value '%s' for Filter" %value) |
|
999 | self.console.append("Invalid value '%s' for Filter" %value) | |
1000 | return 0 |
|
1000 | return 0 | |
1001 |
|
1001 | |||
1002 | format = 'int' |
|
1002 | format = 'int' | |
1003 | name_operation = 'filterByHeights' |
|
1003 | name_operation = 'filterByHeights' | |
1004 | name_parameter = 'window' |
|
1004 | name_parameter = 'window' | |
1005 | opObj = puObj.addOperation(name=name_operation) |
|
1005 | opObj = puObj.addOperation(name=name_operation) | |
1006 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1006 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1007 |
|
1007 | |||
1008 | if self.volOpCebProfile.isChecked(): |
|
1008 | if self.volOpCebProfile.isChecked(): | |
1009 | value = str(self.volOpProfile.text()) |
|
1009 | value = str(self.volOpProfile.text()) | |
1010 |
|
1010 | |||
1011 | format = 'intlist' |
|
1011 | format = 'intlist' | |
1012 | optype = 'other' |
|
1012 | optype = 'other' | |
1013 | name_operation = 'ProfileSelector' |
|
1013 | name_operation = 'ProfileSelector' | |
1014 |
|
1014 | |||
1015 | if self.volOpComProfile.currentIndex() == 0: |
|
1015 | if self.volOpComProfile.currentIndex() == 0: | |
1016 | name_parameter = 'profileList' |
|
1016 | name_parameter = 'profileList' | |
1017 | if self.volOpComProfile.currentIndex() == 1: |
|
1017 | if self.volOpComProfile.currentIndex() == 1: | |
1018 | name_parameter = 'profileRangeList' |
|
1018 | name_parameter = 'profileRangeList' | |
1019 | if self.volOpComProfile.currentIndex() == 2: |
|
1019 | if self.volOpComProfile.currentIndex() == 2: | |
1020 | name_parameter = 'rangeList' |
|
1020 | name_parameter = 'rangeList' | |
1021 |
|
1021 | |||
1022 | if not isIntList(value): |
|
1022 | if not isIntList(value): | |
1023 | self.console.append("Invalid value '%s' for %s" %(value, name_parameter) ) |
|
1023 | self.console.append("Invalid value '%s' for %s" %(value, name_parameter) ) | |
1024 | return 0 |
|
1024 | return 0 | |
1025 |
|
1025 | |||
1026 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
1026 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
1027 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1027 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1028 |
|
1028 | |||
1029 | if self.volOpCebDecodification.isChecked(): |
|
1029 | if self.volOpCebDecodification.isChecked(): | |
1030 | name_operation = 'Decoder' |
|
1030 | name_operation = 'Decoder' | |
1031 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
1031 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
1032 |
|
1032 | |||
1033 | if self.volOpComCode.currentIndex() != 0: |
|
1033 | if self.volOpComCode.currentIndex() != 0: | |
1034 |
|
1034 | |||
1035 | code = str(self.volOpCode.text()) |
|
1035 | code = str(self.volOpCode.text()) | |
1036 |
|
1036 | |||
1037 | if not isMultiList(code): |
|
1037 | if not isMultiList(code): | |
1038 | self.console.append("Please write a valid Code (Example: [1,1,-1], [1,-1,1])") |
|
1038 | self.console.append("Please write a valid Code (Example: [1,1,-1], [1,-1,1])") | |
1039 | return 0 |
|
1039 | return 0 | |
1040 |
|
1040 | |||
1041 | real_code = getCode(code) |
|
1041 | real_code = getCode(code) | |
1042 | nCode = len(real_code) |
|
1042 | nCode = len(real_code) | |
1043 | nBaud = len(real_code[0]) |
|
1043 | nBaud = len(real_code[0]) | |
1044 |
|
1044 | |||
1045 | opObj.addParameter(name='code', value=code, format='intlist') |
|
1045 | opObj.addParameter(name='code', value=code, format='intlist') | |
1046 | opObj.addParameter(name='nCode', value=nCode, format='int') |
|
1046 | opObj.addParameter(name='nCode', value=nCode, format='int') | |
1047 | opObj.addParameter(name='nBaud', value=nBaud, format='int') |
|
1047 | opObj.addParameter(name='nBaud', value=nBaud, format='int') | |
1048 |
|
1048 | |||
1049 | name_parameter = 'mode' |
|
1049 | name_parameter = 'mode' | |
1050 | format = 'int' |
|
1050 | format = 'int' | |
1051 | value = str(self.volOpComMode.currentIndex()) |
|
1051 | value = str(self.volOpComMode.currentIndex()) | |
1052 |
|
1052 | |||
1053 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1053 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1054 |
|
1054 | |||
1055 |
|
1055 | |||
1056 | if self.volOpCebFlip.isChecked(): |
|
1056 | if self.volOpCebFlip.isChecked(): | |
1057 | name_operation = 'deFlip' |
|
1057 | name_operation = 'deFlip' | |
1058 | optype = 'self' |
|
1058 | optype = 'self' | |
1059 |
|
1059 | |||
1060 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1060 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1061 |
|
1061 | |||
1062 | name_parameter = 'channelList' |
|
|||
1063 | format = 'intlist' |
|
|||
1064 | value = str(self.volOpFlip.text()) |
|
1062 | value = str(self.volOpFlip.text()) | |
1065 |
|
1063 | |||
1066 |
if |
|
1064 | if value: | |
1067 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1065 | ||
1068 |
|
|
1066 | name_parameter = 'channelList' | |
|
1067 | format = 'intlist' | |||
1069 |
|
1068 | |||
1070 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1069 | if not isIntList(value): | |
|
1070 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |||
|
1071 | return 0 | |||
|
1072 | ||||
|
1073 | opObj.addParameter(name=name_parameter, value=value, format=format) | |||
1071 |
|
1074 | |||
1072 | if self.volOpCebCohInt.isChecked(): |
|
1075 | if self.volOpCebCohInt.isChecked(): | |
1073 | name_operation = 'CohInt' |
|
1076 | name_operation = 'CohInt' | |
1074 | optype = 'other' |
|
1077 | optype = 'other' | |
1075 | value = str(self.volOpCohInt.text()) |
|
1078 | value = str(self.volOpCohInt.text()) | |
1076 |
|
1079 | |||
1077 | if not isInt(value): |
|
1080 | if not isInt(value): | |
1078 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1081 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1079 | return 0 |
|
1082 | return 0 | |
1080 |
|
1083 | |||
1081 | name_parameter = 'n' |
|
1084 | name_parameter = 'n' | |
1082 | format = 'int' |
|
1085 | format = 'int' | |
1083 |
|
1086 | |||
1084 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1087 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1085 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1088 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1086 |
|
1089 | |||
1087 | if self.volGraphCebshow.isChecked(): |
|
1090 | if self.volGraphCebshow.isChecked(): | |
1088 | name_operation = 'Scope' |
|
1091 | name_operation = 'Scope' | |
1089 | optype = 'other' |
|
1092 | optype = 'other' | |
1090 |
|
1093 | |||
1091 | name_parameter1 = 'id' |
|
1094 | name_parameter1 = 'id' | |
1092 | format1 = 'int' |
|
1095 | format1 = 'int' | |
1093 |
|
1096 | |||
1094 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1097 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1095 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
1098 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
1096 |
|
1099 | |||
1097 | channelList = str(self.volGraphChannelList.text()).strip() |
|
1100 | channelList = str(self.volGraphChannelList.text()).strip() | |
1098 | xvalue = str(self.volGraphHeightrange.text()).strip() |
|
1101 | xvalue = str(self.volGraphHeightrange.text()).strip() | |
1099 | yvalue = str(self.volGraphIntensityRange.text()).strip() |
|
1102 | yvalue = str(self.volGraphIntensityRange.text()).strip() | |
1100 | figpath = str(self.volGraphPath.text()).strip() |
|
1103 | figpath = str(self.volGraphPath.text()).strip() | |
1101 | figfile = str(self.volGraphPrefix.text()).strip() |
|
1104 | figfile = str(self.volGraphPrefix.text()).strip() | |
1102 |
|
1105 | |||
1103 | if channelList != "": |
|
1106 | if channelList != "": | |
1104 | if not isIntList(channelList): |
|
1107 | if not isIntList(channelList): | |
1105 | self.console.append("Invalid value '%s' for 'Graphics:ChannelList'" %(channelList)) |
|
1108 | self.console.append("Invalid value '%s' for 'Graphics:ChannelList'" %(channelList)) | |
1106 | return 0 |
|
1109 | return 0 | |
1107 |
|
1110 | |||
1108 | if xvalue != "": |
|
1111 | if xvalue != "": | |
1109 | if not isFloatRange(xvalue): |
|
1112 | if not isFloatRange(xvalue): | |
1110 | self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(xvalue)) |
|
1113 | self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(xvalue)) | |
1111 | return 0 |
|
1114 | return 0 | |
1112 |
|
1115 | |||
1113 | if yvalue != "": |
|
1116 | if yvalue != "": | |
1114 | if not isFloatRange(yvalue): |
|
1117 | if not isFloatRange(yvalue): | |
1115 | self.console.append("Invalid value '%s' for 'Graphics:Amplitude-Range'" %(yvalue)) |
|
1118 | self.console.append("Invalid value '%s' for 'Graphics:Amplitude-Range'" %(yvalue)) | |
1116 | return 0 |
|
1119 | return 0 | |
1117 |
|
1120 | |||
1118 |
|
1121 | |||
1119 | if channelList: |
|
1122 | if channelList: | |
1120 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1123 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1121 |
|
1124 | |||
1122 | if xvalue: |
|
1125 | if xvalue: | |
1123 | xvalueList = xvalue.split(',') |
|
1126 | xvalueList = xvalue.split(',') | |
1124 |
|
1127 | |||
1125 | opObj.addParameter(name='xmin', value=xvalueList[0], format='float') |
|
1128 | opObj.addParameter(name='xmin', value=xvalueList[0], format='float') | |
1126 | opObj.addParameter(name='xmax', value=xvalueList[1], format='float') |
|
1129 | opObj.addParameter(name='xmax', value=xvalueList[1], format='float') | |
1127 |
|
1130 | |||
1128 | if yvalue: |
|
1131 | if yvalue: | |
1129 | yvalueList = yvalue.split(",") |
|
1132 | yvalueList = yvalue.split(",") | |
1130 |
|
1133 | |||
1131 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1134 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') | |
1132 | opObj.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1135 | opObj.addParameter(name='ymax', value=yvalueList[1], format='int') | |
1133 |
|
1136 | |||
1134 | plot_type = self.volComScopeType.currentIndex() |
|
1137 | plot_type = self.volComScopeType.currentIndex() | |
1135 |
|
1138 | |||
1136 | if plot_type == 0: |
|
1139 | if plot_type == 0: | |
1137 | opObj.addParameter(name='type', value="iq") |
|
1140 | opObj.addParameter(name='type', value="iq") | |
1138 | if plot_type == 1: |
|
1141 | if plot_type == 1: | |
1139 | opObj.addParameter(name='type', value="power") |
|
1142 | opObj.addParameter(name='type', value="power") | |
1140 |
|
1143 | |||
1141 | if self.volGraphCebSave.isChecked(): |
|
1144 | if self.volGraphCebSave.isChecked(): | |
1142 | checkPath = True |
|
1145 | checkPath = True | |
1143 |
|
1146 | |||
1144 | opObj.addParameter(name='save', value='1', format='int') |
|
1147 | opObj.addParameter(name='save', value='1', format='int') | |
1145 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1148 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1146 |
|
1149 | |||
1147 | if figfile: |
|
1150 | if figfile: | |
1148 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1151 | opObj.addParameter(name='figfile', value=value, format='str') | |
1149 |
|
1152 | |||
1150 | if checkPath: |
|
1153 | if checkPath: | |
1151 |
|
1154 | |||
1152 | if not figpath: |
|
1155 | if not figpath: | |
1153 | self.console.clear() |
|
1156 | self.console.clear() | |
1154 | self.console.append("Graphic path should be defined") |
|
1157 | self.console.append("Graphic path should be defined") | |
1155 | return 0 |
|
1158 | return 0 | |
1156 |
|
1159 | |||
1157 | if os.path.isdir(figpath): |
|
1160 | if os.path.isdir(figpath): | |
1158 | self.console.clear() |
|
1161 | self.console.clear() | |
1159 | self.console.append("Graphic path does not exist, it has to be created") |
|
1162 | self.console.append("Graphic path does not exist, it has to be created") | |
1160 | return 0 |
|
1163 | return 0 | |
1161 |
|
1164 | |||
1162 | # if something happend |
|
1165 | # if something happend | |
1163 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1166 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1164 | if parms_ok: |
|
1167 | if parms_ok: | |
1165 | name_operation = 'VoltageWriter' |
|
1168 | name_operation = 'VoltageWriter' | |
1166 | optype = 'other' |
|
1169 | optype = 'other' | |
1167 | name_parameter1 = 'path' |
|
1170 | name_parameter1 = 'path' | |
1168 | name_parameter2 = 'blocksPerFile' |
|
1171 | name_parameter2 = 'blocksPerFile' | |
1169 | name_parameter3 = 'profilesPerBlock' |
|
1172 | name_parameter3 = 'profilesPerBlock' | |
1170 | value1 = output_path |
|
1173 | value1 = output_path | |
1171 | value2 = blocksperfile |
|
1174 | value2 = blocksperfile | |
1172 | value3 = profilesperblock |
|
1175 | value3 = profilesperblock | |
1173 | format = "int" |
|
1176 | format = "int" | |
1174 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1177 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1175 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1178 | opObj.addParameter(name=name_parameter1, value=value1) | |
1176 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1179 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1177 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1180 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1178 |
|
1181 | |||
1179 | self.console.clear() |
|
1182 | self.console.clear() | |
1180 | try: |
|
1183 | try: | |
1181 | self.refreshPUProperties(puObj) |
|
1184 | self.refreshPUProperties(puObj) | |
1182 | except: |
|
1185 | except: | |
1183 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1186 | self.console.append("An error reading input parameters was found ...Check them!") | |
1184 | return 0 |
|
1187 | return 0 | |
1185 |
|
1188 | |||
1186 | self.console.append("Save your project and press Play button to start signal processing") |
|
1189 | self.console.append("Save your project and press Play button to start signal processing") | |
1187 |
|
1190 | |||
1188 | self._enable_play_button() |
|
1191 | self._enable_play_button() | |
1189 | self._enable_save_button() |
|
1192 | self._enable_save_button() | |
1190 |
|
1193 | |||
1191 | return 1 |
|
1194 | return 1 | |
1192 |
|
1195 | |||
1193 | @pyqtSignature("") |
|
1196 | @pyqtSignature("") | |
1194 | def on_volGraphClear_clicked(self): |
|
1197 | def on_volGraphClear_clicked(self): | |
1195 |
|
1198 | |||
1196 | self.console.clear() |
|
1199 | self.console.clear() | |
1197 |
|
1200 | |||
1198 | """ |
|
1201 | """ | |
1199 | Voltage Graph |
|
1202 | Voltage Graph | |
1200 | """ |
|
1203 | """ | |
1201 | @pyqtSignature("int") |
|
1204 | @pyqtSignature("int") | |
1202 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1205 | def on_volGraphCebSave_stateChanged(self, p0): | |
1203 | """ |
|
1206 | """ | |
1204 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1207 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1205 | """ |
|
1208 | """ | |
1206 | if p0 == 2: |
|
1209 | if p0 == 2: | |
1207 | self.volGraphPath.setEnabled(True) |
|
1210 | self.volGraphPath.setEnabled(True) | |
1208 | self.volGraphPrefix.setEnabled(True) |
|
1211 | self.volGraphPrefix.setEnabled(True) | |
1209 | self.volGraphToolPath.setEnabled(True) |
|
1212 | self.volGraphToolPath.setEnabled(True) | |
1210 |
|
1213 | |||
1211 | if p0 == 0: |
|
1214 | if p0 == 0: | |
1212 | self.volGraphPath.setEnabled(False) |
|
1215 | self.volGraphPath.setEnabled(False) | |
1213 | self.volGraphPrefix.setEnabled(False) |
|
1216 | self.volGraphPrefix.setEnabled(False) | |
1214 | self.volGraphToolPath.setEnabled(False) |
|
1217 | self.volGraphToolPath.setEnabled(False) | |
1215 |
|
1218 | |||
1216 | @pyqtSignature("") |
|
1219 | @pyqtSignature("") | |
1217 | def on_volGraphToolPath_clicked(self): |
|
1220 | def on_volGraphToolPath_clicked(self): | |
1218 | """ |
|
1221 | """ | |
1219 | Donde se guardan los DATOS |
|
1222 | Donde se guardan los DATOS | |
1220 | """ |
|
1223 | """ | |
1221 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1224 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1222 | self.volGraphPath.setText(save_path) |
|
1225 | self.volGraphPath.setText(save_path) | |
1223 |
|
1226 | |||
1224 | if not os.path.exists(save_path): |
|
1227 | if not os.path.exists(save_path): | |
1225 | self.console.clear() |
|
1228 | self.console.clear() | |
1226 | self.console.append("Set a valid path") |
|
1229 | self.console.append("Set a valid path") | |
1227 | self.volGraphOk.setEnabled(False) |
|
1230 | self.volGraphOk.setEnabled(False) | |
1228 | return |
|
1231 | return | |
1229 |
|
1232 | |||
1230 | @pyqtSignature("int") |
|
1233 | @pyqtSignature("int") | |
1231 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1234 | def on_volGraphCebshow_stateChanged(self, p0): | |
1232 | """ |
|
1235 | """ | |
1233 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1236 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1234 | """ |
|
1237 | """ | |
1235 | if p0 == 0: |
|
1238 | if p0 == 0: | |
1236 |
|
1239 | |||
1237 | self.volGraphChannelList.setEnabled(False) |
|
1240 | self.volGraphChannelList.setEnabled(False) | |
1238 | self.volGraphIntensityRange.setEnabled(False) |
|
1241 | self.volGraphIntensityRange.setEnabled(False) | |
1239 | self.volGraphHeightrange.setEnabled(False) |
|
1242 | self.volGraphHeightrange.setEnabled(False) | |
1240 | if p0 == 2: |
|
1243 | if p0 == 2: | |
1241 |
|
1244 | |||
1242 | self.volGraphChannelList.setEnabled(True) |
|
1245 | self.volGraphChannelList.setEnabled(True) | |
1243 | self.volGraphIntensityRange.setEnabled(True) |
|
1246 | self.volGraphIntensityRange.setEnabled(True) | |
1244 | self.volGraphHeightrange.setEnabled(True) |
|
1247 | self.volGraphHeightrange.setEnabled(True) | |
1245 |
|
1248 | |||
1246 | """ |
|
1249 | """ | |
1247 | Spectra operation |
|
1250 | Spectra operation | |
1248 | """ |
|
1251 | """ | |
1249 | @pyqtSignature("int") |
|
1252 | @pyqtSignature("int") | |
1250 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1253 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1251 | """ |
|
1254 | """ | |
1252 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1255 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1253 | """ |
|
1256 | """ | |
1254 | if p0 == 2: |
|
1257 | if p0 == 2: | |
1255 | self.specOpRadarfrequency.setEnabled(True) |
|
1258 | self.specOpRadarfrequency.setEnabled(True) | |
1256 | if p0 == 0: |
|
1259 | if p0 == 0: | |
1257 | # self.specOpRadarfrequency.clear() |
|
1260 | # self.specOpRadarfrequency.clear() | |
1258 | self.specOpRadarfrequency.setEnabled(False) |
|
1261 | self.specOpRadarfrequency.setEnabled(False) | |
1259 |
|
1262 | |||
1260 |
|
1263 | |||
1261 | @pyqtSignature("int") |
|
1264 | @pyqtSignature("int") | |
1262 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1265 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1263 | """ |
|
1266 | """ | |
1264 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1267 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1265 | """ |
|
1268 | """ | |
1266 | if p0 == 2: |
|
1269 | if p0 == 2: | |
1267 | # self.specOpnFFTpoints.setEnabled(True) |
|
1270 | # self.specOpnFFTpoints.setEnabled(True) | |
1268 | self.specOpComCrossSpectra.setEnabled(True) |
|
1271 | self.specOpComCrossSpectra.setEnabled(True) | |
1269 | self.specOppairsList.setEnabled(True) |
|
1272 | self.specOppairsList.setEnabled(True) | |
1270 |
|
1273 | |||
1271 | if p0 == 0: |
|
1274 | if p0 == 0: | |
1272 | # self.specOpnFFTpoints.setEnabled(False) |
|
1275 | # self.specOpnFFTpoints.setEnabled(False) | |
1273 | self.specOpComCrossSpectra.setEnabled(False) |
|
1276 | self.specOpComCrossSpectra.setEnabled(False) | |
1274 | self.specOppairsList.setEnabled(False) |
|
1277 | self.specOppairsList.setEnabled(False) | |
1275 |
|
1278 | |||
1276 | @pyqtSignature("int") |
|
1279 | @pyqtSignature("int") | |
1277 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1280 | def on_specOpCebChannel_stateChanged(self, p0): | |
1278 | """ |
|
1281 | """ | |
1279 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1282 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1280 | """ |
|
1283 | """ | |
1281 | if p0 == 2: |
|
1284 | if p0 == 2: | |
1282 | self.specOpChannel.setEnabled(True) |
|
1285 | self.specOpChannel.setEnabled(True) | |
1283 | self.specOpComChannel.setEnabled(True) |
|
1286 | self.specOpComChannel.setEnabled(True) | |
1284 | if p0 == 0: |
|
1287 | if p0 == 0: | |
1285 | self.specOpChannel.setEnabled(False) |
|
1288 | self.specOpChannel.setEnabled(False) | |
1286 | self.specOpComChannel.setEnabled(False) |
|
1289 | self.specOpComChannel.setEnabled(False) | |
1287 |
|
1290 | |||
1288 | @pyqtSignature("int") |
|
1291 | @pyqtSignature("int") | |
1289 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1292 | def on_specOpCebHeights_stateChanged(self, p0): | |
1290 | """ |
|
1293 | """ | |
1291 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1294 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1292 | """ |
|
1295 | """ | |
1293 | if p0 == 2: |
|
1296 | if p0 == 2: | |
1294 | self.specOpComHeights.setEnabled(True) |
|
1297 | self.specOpComHeights.setEnabled(True) | |
1295 | self.specOpHeights.setEnabled(True) |
|
1298 | self.specOpHeights.setEnabled(True) | |
1296 | if p0 == 0: |
|
1299 | if p0 == 0: | |
1297 | self.specOpComHeights.setEnabled(False) |
|
1300 | self.specOpComHeights.setEnabled(False) | |
1298 | self.specOpHeights.setEnabled(False) |
|
1301 | self.specOpHeights.setEnabled(False) | |
1299 |
|
1302 | |||
1300 |
|
1303 | |||
1301 | @pyqtSignature("int") |
|
1304 | @pyqtSignature("int") | |
1302 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1305 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1303 | """ |
|
1306 | """ | |
1304 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1307 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1305 | """ |
|
1308 | """ | |
1306 | if p0 == 2: |
|
1309 | if p0 == 2: | |
1307 | self.specOpIncoherent.setEnabled(True) |
|
1310 | self.specOpIncoherent.setEnabled(True) | |
1308 | if p0 == 0: |
|
1311 | if p0 == 0: | |
1309 | self.specOpIncoherent.setEnabled(False) |
|
1312 | self.specOpIncoherent.setEnabled(False) | |
1310 |
|
1313 | |||
1311 | @pyqtSignature("int") |
|
1314 | @pyqtSignature("int") | |
1312 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1315 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1313 | """ |
|
1316 | """ | |
1314 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1317 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1315 | """ |
|
1318 | """ | |
1316 | if p0 == 2: |
|
1319 | if p0 == 2: | |
1317 | self.specOpComRemoveDC.setEnabled(True) |
|
1320 | self.specOpComRemoveDC.setEnabled(True) | |
1318 | if p0 == 0: |
|
1321 | if p0 == 0: | |
1319 | self.specOpComRemoveDC.setEnabled(False) |
|
1322 | self.specOpComRemoveDC.setEnabled(False) | |
1320 |
|
1323 | |||
1321 | @pyqtSignature("int") |
|
1324 | @pyqtSignature("int") | |
1322 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1325 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1323 | """ |
|
1326 | """ | |
1324 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1327 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1325 | """ |
|
1328 | """ | |
1326 | if p0 == 2: |
|
1329 | if p0 == 2: | |
1327 | self.specOpgetNoise.setEnabled(True) |
|
1330 | self.specOpgetNoise.setEnabled(True) | |
1328 |
|
1331 | |||
1329 | if p0 == 0: |
|
1332 | if p0 == 0: | |
1330 | self.specOpgetNoise.setEnabled(False) |
|
1333 | self.specOpgetNoise.setEnabled(False) | |
1331 |
|
1334 | |||
1332 | @pyqtSignature("") |
|
1335 | @pyqtSignature("") | |
1333 | def on_specOpOk_clicked(self): |
|
1336 | def on_specOpOk_clicked(self): | |
1334 | """ |
|
1337 | """ | |
1335 | AΓADE OPERACION SPECTRA |
|
1338 | AΓADE OPERACION SPECTRA | |
1336 | """ |
|
1339 | """ | |
1337 |
|
1340 | |||
1338 | addFTP = False |
|
1341 | addFTP = False | |
1339 | checkPath = False |
|
1342 | checkPath = False | |
1340 |
|
1343 | |||
1341 | self._disable_play_button() |
|
1344 | self._disable_play_button() | |
1342 | self._disable_save_button() |
|
1345 | self._disable_save_button() | |
1343 |
|
1346 | |||
1344 | self.console.clear() |
|
1347 | self.console.clear() | |
1345 | self.console.append("Checking input parameters:\n") |
|
1348 | self.console.append("Checking input parameters:\n") | |
1346 |
|
1349 | |||
1347 | projectObj = self.getSelectedProjectObj() |
|
1350 | projectObj = self.getSelectedProjectObj() | |
1348 |
|
1351 | |||
1349 | if not projectObj: |
|
1352 | if not projectObj: | |
1350 | self.console.append("Please select a project before update it") |
|
1353 | self.console.append("Please select a project before update it") | |
1351 | return |
|
1354 | return | |
1352 |
|
1355 | |||
1353 | puObj = self.getSelectedItemObj() |
|
1356 | puObj = self.getSelectedItemObj() | |
1354 |
|
1357 | |||
1355 | puObj.removeOperations() |
|
1358 | puObj.removeOperations() | |
1356 |
|
1359 | |||
1357 | if self.specOpCebRadarfrequency.isChecked(): |
|
1360 | if self.specOpCebRadarfrequency.isChecked(): | |
1358 | value = str(self.specOpRadarfrequency.text()) |
|
1361 | value = str(self.specOpRadarfrequency.text()) | |
1359 | format = 'float' |
|
1362 | format = 'float' | |
1360 | name_operation = 'setRadarFrequency' |
|
1363 | name_operation = 'setRadarFrequency' | |
1361 | name_parameter = 'frequency' |
|
1364 | name_parameter = 'frequency' | |
1362 |
|
1365 | |||
1363 | if not isFloat(value): |
|
1366 | if not isFloat(value): | |
1364 | self.console.clear() |
|
1367 | self.console.clear() | |
1365 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1368 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1366 | return 0 |
|
1369 | return 0 | |
1367 |
|
1370 | |||
1368 | radarfreq = float(value)*1e6 |
|
1371 | radarfreq = float(value)*1e6 | |
1369 | opObj = puObj.addOperation(name=name_operation) |
|
1372 | opObj = puObj.addOperation(name=name_operation) | |
1370 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1373 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1371 |
|
1374 | |||
1372 | inputId = puObj.getInputId() |
|
1375 | inputId = puObj.getInputId() | |
1373 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1376 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1374 |
|
1377 | |||
1375 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1378 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1376 |
|
1379 | |||
1377 | value = str(self.specOpnFFTpoints.text()) |
|
1380 | value = str(self.specOpnFFTpoints.text()) | |
1378 |
|
1381 | |||
1379 | if not isInt(value): |
|
1382 | if not isInt(value): | |
1380 | self.console.append("Invalid value [%s] for '%s'" %(value, 'nFFTPoints')) |
|
1383 | self.console.append("Invalid value [%s] for '%s'" %(value, 'nFFTPoints')) | |
1381 | return 0 |
|
1384 | return 0 | |
1382 |
|
1385 | |||
1383 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1386 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1384 |
|
1387 | |||
1385 | value = str(self.specOpProfiles.text()) |
|
1388 | value = str(self.specOpProfiles.text()) | |
1386 | if not isInt(value): |
|
1389 | if not isInt(value): | |
1387 | self.console.append("Please write a value on Profiles field") |
|
1390 | self.console.append("Please write a value on Profiles field") | |
1388 | else: |
|
1391 | else: | |
1389 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1392 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1390 |
|
1393 | |||
1391 | value = str(self.specOpippFactor.text()) |
|
1394 | value = str(self.specOpippFactor.text()) | |
1392 | if not isInt(value): |
|
1395 | if not isInt(value): | |
1393 | self.console.append("Please write a value on IppFactor field") |
|
1396 | self.console.append("Please write a value on IppFactor field") | |
1394 | else: |
|
1397 | else: | |
1395 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1398 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1396 |
|
1399 | |||
1397 | if self.specOpCebCrossSpectra.isChecked(): |
|
1400 | if self.specOpCebCrossSpectra.isChecked(): | |
1398 | name_parameter = 'pairsList' |
|
1401 | name_parameter = 'pairsList' | |
1399 | format = 'pairslist' |
|
1402 | format = 'pairslist' | |
1400 | value = str(self.specOppairsList.text()) |
|
1403 | value = str(self.specOppairsList.text()) | |
1401 |
|
1404 | |||
1402 | if not isPairList(value): |
|
1405 | if not isPairList(value): | |
1403 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1406 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1404 | return 0 |
|
1407 | return 0 | |
1405 |
|
1408 | |||
1406 | puObj.addParameter(name=name_parameter, value=value, format=format) |
|
1409 | puObj.addParameter(name=name_parameter, value=value, format=format) | |
1407 |
|
1410 | |||
1408 | if self.specOpCebHeights.isChecked(): |
|
1411 | if self.specOpCebHeights.isChecked(): | |
1409 | value = str(self.specOpHeights.text()) |
|
1412 | value = str(self.specOpHeights.text()) | |
1410 |
|
1413 | |||
1411 | if not isFloatRange(value): |
|
1414 | if not isFloatRange(value): | |
1412 | self.console.append("Invalid value [%s] for Height range" %value) |
|
1415 | self.console.append("Invalid value [%s] for Height range" %value) | |
1413 | return 0 |
|
1416 | return 0 | |
1414 |
|
1417 | |||
1415 | valueList = value.split(',') |
|
1418 | valueList = value.split(',') | |
1416 | value0 = valueList[0] |
|
1419 | value0 = valueList[0] | |
1417 | value1 = valueList[1] |
|
1420 | value1 = valueList[1] | |
1418 |
|
1421 | |||
1419 | if self.specOpComHeights.currentIndex() == 0: |
|
1422 | if self.specOpComHeights.currentIndex() == 0: | |
1420 | name_operation = 'selectHeights' |
|
1423 | name_operation = 'selectHeights' | |
1421 | name_parameter1 = 'minHei' |
|
1424 | name_parameter1 = 'minHei' | |
1422 | name_parameter2 = 'maxHei' |
|
1425 | name_parameter2 = 'maxHei' | |
1423 | else: |
|
1426 | else: | |
1424 | name_operation = 'selectHeightsByIndex' |
|
1427 | name_operation = 'selectHeightsByIndex' | |
1425 | name_parameter1 = 'minIndex' |
|
1428 | name_parameter1 = 'minIndex' | |
1426 | name_parameter2 = 'maxIndex' |
|
1429 | name_parameter2 = 'maxIndex' | |
1427 |
|
1430 | |||
1428 | format = 'float' |
|
1431 | format = 'float' | |
1429 |
|
1432 | |||
1430 | opObj = puObj.addOperation(name=name_operation) |
|
1433 | opObj = puObj.addOperation(name=name_operation) | |
1431 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1434 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1432 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1435 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1433 |
|
1436 | |||
1434 | if self.specOpCebChannel.isChecked(): |
|
1437 | if self.specOpCebChannel.isChecked(): | |
1435 |
|
1438 | |||
1436 | if self.specOpComChannel.currentIndex() == 0: |
|
1439 | if self.specOpComChannel.currentIndex() == 0: | |
1437 | name_operation = "selectChannels" |
|
1440 | name_operation = "selectChannels" | |
1438 | name_parameter = 'channelList' |
|
1441 | name_parameter = 'channelList' | |
1439 | else: |
|
1442 | else: | |
1440 | name_operation = "selectChannelsByIndex" |
|
1443 | name_operation = "selectChannelsByIndex" | |
1441 | name_parameter = 'channelIndexList' |
|
1444 | name_parameter = 'channelIndexList' | |
1442 |
|
1445 | |||
1443 | format = 'intlist' |
|
1446 | format = 'intlist' | |
1444 | value = str(self.specOpChannel.text()) |
|
1447 | value = str(self.specOpChannel.text()) | |
1445 |
|
1448 | |||
1446 | if not isIntList(value): |
|
1449 | if not isIntList(value): | |
1447 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1450 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1448 | return 0 |
|
1451 | return 0 | |
1449 |
|
1452 | |||
1450 | opObj = puObj.addOperation(name=name_operation) |
|
1453 | opObj = puObj.addOperation(name=name_operation) | |
1451 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1454 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1452 |
|
1455 | |||
1453 | if self.specOpCebIncoherent.isChecked(): |
|
1456 | if self.specOpCebIncoherent.isChecked(): | |
1454 |
|
1457 | |||
1455 | name_operation = 'IncohInt' |
|
1458 | name_operation = 'IncohInt' | |
1456 | optype = 'other' |
|
1459 | optype = 'other' | |
1457 |
|
1460 | |||
1458 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1461 | if self.specOpCobIncInt.currentIndex() == 0: | |
1459 | name_parameter = 'timeInterval' |
|
1462 | name_parameter = 'timeInterval' | |
1460 | format = 'float' |
|
1463 | format = 'float' | |
1461 | else: |
|
1464 | else: | |
1462 | name_parameter = 'n' |
|
1465 | name_parameter = 'n' | |
1463 | format = 'int' |
|
1466 | format = 'int' | |
1464 |
|
1467 | |||
1465 | value = str(self.specOpIncoherent.text()) |
|
1468 | value = str(self.specOpIncoherent.text()) | |
1466 |
|
1469 | |||
1467 | if not isFloat(value): |
|
1470 | if not isFloat(value): | |
1468 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1471 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1469 | return 0 |
|
1472 | return 0 | |
1470 |
|
1473 | |||
1471 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1474 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1472 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1475 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1473 |
|
1476 | |||
1474 | if self.specOpCebRemoveDC.isChecked(): |
|
1477 | if self.specOpCebRemoveDC.isChecked(): | |
1475 | name_operation = 'removeDC' |
|
1478 | name_operation = 'removeDC' | |
1476 | name_parameter = 'mode' |
|
1479 | name_parameter = 'mode' | |
1477 | format = 'int' |
|
1480 | format = 'int' | |
1478 |
|
1481 | |||
1479 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1482 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1480 | value = 1 |
|
1483 | value = 1 | |
1481 | else: |
|
1484 | else: | |
1482 | value = 2 |
|
1485 | value = 2 | |
1483 |
|
1486 | |||
1484 | opObj = puObj.addOperation(name=name_operation) |
|
1487 | opObj = puObj.addOperation(name=name_operation) | |
1485 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1488 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1486 |
|
1489 | |||
1487 | if self.specOpCebRemoveInt.isChecked(): |
|
1490 | if self.specOpCebRemoveInt.isChecked(): | |
1488 | name_operation = 'removeInterference' |
|
1491 | name_operation = 'removeInterference' | |
1489 | opObj = puObj.addOperation(name=name_operation) |
|
1492 | opObj = puObj.addOperation(name=name_operation) | |
1490 |
|
1493 | |||
1491 |
|
1494 | |||
1492 | if self.specOpCebgetNoise.isChecked(): |
|
1495 | if self.specOpCebgetNoise.isChecked(): | |
1493 | value = str(self.specOpgetNoise.text()) |
|
1496 | value = str(self.specOpgetNoise.text()) | |
1494 | valueList = value.split(',') |
|
1497 | valueList = value.split(',') | |
1495 | format = 'float' |
|
1498 | format = 'float' | |
1496 | name_operation = "getNoise" |
|
1499 | name_operation = "getNoise" | |
1497 | opObj = puObj.addOperation(name=name_operation) |
|
1500 | opObj = puObj.addOperation(name=name_operation) | |
1498 |
|
1501 | |||
1499 | if not value == '': |
|
1502 | if not value == '': | |
1500 | valueList = value.split(',') |
|
1503 | valueList = value.split(',') | |
1501 | length = len(valueList) |
|
1504 | length = len(valueList) | |
1502 | if length == 1: |
|
1505 | if length == 1: | |
1503 | try: |
|
1506 | try: | |
1504 | value1 = float(valueList[0]) |
|
1507 | value1 = float(valueList[0]) | |
1505 | except: |
|
1508 | except: | |
1506 | self.console.clear() |
|
1509 | self.console.clear() | |
1507 | self.console.append("Please Write correct parameter Get Noise") |
|
1510 | self.console.append("Please Write correct parameter Get Noise") | |
1508 | return 0 |
|
1511 | return 0 | |
1509 | name1 = 'minHei' |
|
1512 | name1 = 'minHei' | |
1510 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1513 | opObj.addParameter(name=name1, value=value1, format=format) | |
1511 | elif length == 2: |
|
1514 | elif length == 2: | |
1512 | try: |
|
1515 | try: | |
1513 | value1 = float(valueList[0]) |
|
1516 | value1 = float(valueList[0]) | |
1514 | value2 = float(valueList[1]) |
|
1517 | value2 = float(valueList[1]) | |
1515 | except: |
|
1518 | except: | |
1516 | self.console.clear() |
|
1519 | self.console.clear() | |
1517 | self.console.append("Please Write corrects parameter Get Noise") |
|
1520 | self.console.append("Please Write corrects parameter Get Noise") | |
1518 | return 0 |
|
1521 | return 0 | |
1519 | name1 = 'minHei' |
|
1522 | name1 = 'minHei' | |
1520 | name2 = 'maxHei' |
|
1523 | name2 = 'maxHei' | |
1521 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1524 | opObj.addParameter(name=name1, value=value1, format=format) | |
1522 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1525 | opObj.addParameter(name=name2, value=value2, format=format) | |
1523 |
|
1526 | |||
1524 | elif length == 3: |
|
1527 | elif length == 3: | |
1525 | try: |
|
1528 | try: | |
1526 | value1 = float(valueList[0]) |
|
1529 | value1 = float(valueList[0]) | |
1527 | value2 = float(valueList[1]) |
|
1530 | value2 = float(valueList[1]) | |
1528 | value3 = float(valueList[2]) |
|
1531 | value3 = float(valueList[2]) | |
1529 | except: |
|
1532 | except: | |
1530 | self.console.clear() |
|
1533 | self.console.clear() | |
1531 | self.console.append("Please Write corrects parameter Get Noise") |
|
1534 | self.console.append("Please Write corrects parameter Get Noise") | |
1532 | return 0 |
|
1535 | return 0 | |
1533 | name1 = 'minHei' |
|
1536 | name1 = 'minHei' | |
1534 | name2 = 'maxHei' |
|
1537 | name2 = 'maxHei' | |
1535 | name3 = 'minVel' |
|
1538 | name3 = 'minVel' | |
1536 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1539 | opObj.addParameter(name=name1, value=value1, format=format) | |
1537 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1540 | opObj.addParameter(name=name2, value=value2, format=format) | |
1538 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1541 | opObj.addParameter(name=name3, value=value3, format=format) | |
1539 |
|
1542 | |||
1540 | elif length == 4: |
|
1543 | elif length == 4: | |
1541 | try: |
|
1544 | try: | |
1542 | value1 = float(valueList[0]) |
|
1545 | value1 = float(valueList[0]) | |
1543 | value2 = float(valueList[1]) |
|
1546 | value2 = float(valueList[1]) | |
1544 | value3 = float(valueList[2]) |
|
1547 | value3 = float(valueList[2]) | |
1545 | value4 = float(valueList[3]) |
|
1548 | value4 = float(valueList[3]) | |
1546 | except: |
|
1549 | except: | |
1547 | self.console.clear() |
|
1550 | self.console.clear() | |
1548 | self.console.append("Please Write corrects parameter Get Noise") |
|
1551 | self.console.append("Please Write corrects parameter Get Noise") | |
1549 | return 0 |
|
1552 | return 0 | |
1550 | name1 = 'minHei' |
|
1553 | name1 = 'minHei' | |
1551 | name2 = 'maxHei' |
|
1554 | name2 = 'maxHei' | |
1552 | name3 = 'minVel' |
|
1555 | name3 = 'minVel' | |
1553 | name4 = 'maxVel' |
|
1556 | name4 = 'maxVel' | |
1554 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1557 | opObj.addParameter(name=name1, value=value1, format=format) | |
1555 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1558 | opObj.addParameter(name=name2, value=value2, format=format) | |
1556 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1559 | opObj.addParameter(name=name3, value=value3, format=format) | |
1557 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1560 | opObj.addParameter(name=name4, value=value4, format=format) | |
1558 |
|
1561 | |||
1559 | elif length > 4: |
|
1562 | elif length > 4: | |
1560 | self.console.clear() |
|
1563 | self.console.clear() | |
1561 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1564 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1562 | return 0 |
|
1565 | return 0 | |
1563 |
|
1566 | |||
1564 | channelList = str(self.specGgraphChannelList.text()).strip() |
|
1567 | channelList = str(self.specGgraphChannelList.text()).strip() | |
1565 | vel_range = str(self.specGgraphFreq.text()).strip() |
|
1568 | vel_range = str(self.specGgraphFreq.text()).strip() | |
1566 | hei_range = str(self.specGgraphHeight.text()).strip() |
|
1569 | hei_range = str(self.specGgraphHeight.text()).strip() | |
1567 | db_range = str(self.specGgraphDbsrange.text()).strip() |
|
1570 | db_range = str(self.specGgraphDbsrange.text()).strip() | |
1568 |
|
1571 | |||
1569 | trange = str(self.specGgraphTminTmax.text()).strip() |
|
1572 | trange = str(self.specGgraphTminTmax.text()).strip() | |
1570 | magrange = str(self.specGgraphmagnitud.text()).strip() |
|
1573 | magrange = str(self.specGgraphmagnitud.text()).strip() | |
1571 | phaserange = str(self.specGgraphPhase.text()).strip() |
|
1574 | phaserange = str(self.specGgraphPhase.text()).strip() | |
1572 | # timerange = str(self.specGgraphTimeRange.text()).strip() |
|
1575 | # timerange = str(self.specGgraphTimeRange.text()).strip() | |
1573 |
|
1576 | |||
1574 | figpath = str(self.specGraphPath.text()).strip() |
|
1577 | figpath = str(self.specGraphPath.text()).strip() | |
1575 | figfile = str(self.specGraphPrefix.text()).strip() |
|
1578 | figfile = str(self.specGraphPrefix.text()).strip() | |
1576 |
|
1579 | |||
1577 | try: |
|
1580 | try: | |
1578 | wrperiod = int(str(self.specGgraphftpratio.text()).strip()) |
|
1581 | wrperiod = int(str(self.specGgraphftpratio.text()).strip()) | |
1579 | except: |
|
1582 | except: | |
1580 | wrperiod = None |
|
1583 | wrperiod = None | |
1581 |
|
1584 | |||
1582 | #-----Spectra Plot----- |
|
1585 | #-----Spectra Plot----- | |
1583 | if self.specGraphCebSpectraplot.isChecked(): |
|
1586 | if self.specGraphCebSpectraplot.isChecked(): | |
1584 |
|
1587 | |||
1585 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1588 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1586 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1589 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1587 |
|
1590 | |||
1588 | if channelList: |
|
1591 | if channelList: | |
1589 |
|
1592 | |||
1590 | if not isList(channelList): |
|
1593 | if not isList(channelList): | |
1591 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1594 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1592 | return 0 |
|
1595 | return 0 | |
1593 |
|
1596 | |||
1594 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1597 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1595 |
|
1598 | |||
1596 | if vel_range: |
|
1599 | if vel_range: | |
1597 |
|
1600 | |||
1598 | if not isFloatRange(vel_range): |
|
1601 | if not isFloatRange(vel_range): | |
1599 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) |
|
1602 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) | |
1600 | return 0 |
|
1603 | return 0 | |
1601 |
|
1604 | |||
1602 | xvalueList = vel_range.split(',') |
|
1605 | xvalueList = vel_range.split(',') | |
1603 | value1 = float(xvalueList[0]) |
|
1606 | value1 = float(xvalueList[0]) | |
1604 | value2 = float(xvalueList[1]) |
|
1607 | value2 = float(xvalueList[1]) | |
1605 |
|
1608 | |||
1606 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1609 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1607 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1610 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1608 |
|
1611 | |||
1609 | if hei_range: |
|
1612 | if hei_range: | |
1610 |
|
1613 | |||
1611 | if not isFloatRange(hei_range): |
|
1614 | if not isFloatRange(hei_range): | |
1612 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1615 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1613 | return 0 |
|
1616 | return 0 | |
1614 |
|
1617 | |||
1615 | yvalueList = hei_range.split(",") |
|
1618 | yvalueList = hei_range.split(",") | |
1616 | value1 = float(yvalueList[0]) |
|
1619 | value1 = float(yvalueList[0]) | |
1617 | value2 = float(yvalueList[1]) |
|
1620 | value2 = float(yvalueList[1]) | |
1618 |
|
1621 | |||
1619 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1622 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1620 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1623 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1621 |
|
1624 | |||
1622 | if db_range: |
|
1625 | if db_range: | |
1623 |
|
1626 | |||
1624 | if not isFloatRange(db_range): |
|
1627 | if not isFloatRange(db_range): | |
1625 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1628 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1626 | return 0 |
|
1629 | return 0 | |
1627 |
|
1630 | |||
1628 | zvalueList = db_range.split(",") |
|
1631 | zvalueList = db_range.split(",") | |
1629 | value1 = float(zvalueList[0]) |
|
1632 | value1 = float(zvalueList[0]) | |
1630 | value2 = float(zvalueList[1]) |
|
1633 | value2 = float(zvalueList[1]) | |
1631 |
|
1634 | |||
1632 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1635 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1633 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1636 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1634 |
|
1637 | |||
1635 | if self.specGraphSaveSpectra.isChecked(): |
|
1638 | if self.specGraphSaveSpectra.isChecked(): | |
1636 |
|
1639 | |||
1637 | checkPath = True |
|
1640 | checkPath = True | |
1638 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1641 | opObj.addParameter(name='save', value=1 , format='bool') | |
1639 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1642 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1640 | if figfile: |
|
1643 | if figfile: | |
1641 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1644 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1642 | if wrperiod: |
|
1645 | if wrperiod: | |
1643 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1646 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1644 |
|
1647 | |||
1645 | if self.specGraphftpSpectra.isChecked(): |
|
1648 | if self.specGraphftpSpectra.isChecked(): | |
1646 |
|
1649 | |||
1647 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1650 | opObj.addParameter(name='ftp', value='1', format='int') | |
1648 | self.addFTPConf2Operation(puObj, opObj) |
|
1651 | self.addFTPConf2Operation(puObj, opObj) | |
1649 | addFTP = True |
|
1652 | addFTP = True | |
1650 |
|
1653 | |||
1651 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1654 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1652 |
|
1655 | |||
1653 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1656 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1654 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1657 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1655 |
|
1658 | |||
1656 | if vel_range: |
|
1659 | if vel_range: | |
1657 |
|
1660 | |||
1658 | if not isFloatRange(vel_range): |
|
1661 | if not isFloatRange(vel_range): | |
1659 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) |
|
1662 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) | |
1660 | return 0 |
|
1663 | return 0 | |
1661 |
|
1664 | |||
1662 | xvalueList = vel_range.split(',') |
|
1665 | xvalueList = vel_range.split(',') | |
1663 | value1 = float(xvalueList[0]) |
|
1666 | value1 = float(xvalueList[0]) | |
1664 | value2 = float(xvalueList[1]) |
|
1667 | value2 = float(xvalueList[1]) | |
1665 |
|
1668 | |||
1666 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1669 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1667 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1670 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1668 |
|
1671 | |||
1669 | if hei_range: |
|
1672 | if hei_range: | |
1670 |
|
1673 | |||
1671 | if not isFloatRange(hei_range): |
|
1674 | if not isFloatRange(hei_range): | |
1672 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1675 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1673 | return 0 |
|
1676 | return 0 | |
1674 |
|
1677 | |||
1675 | yvalueList = hei_range.split(",") |
|
1678 | yvalueList = hei_range.split(",") | |
1676 | value1 = float(yvalueList[0]) |
|
1679 | value1 = float(yvalueList[0]) | |
1677 | value2 = float(yvalueList[1]) |
|
1680 | value2 = float(yvalueList[1]) | |
1678 |
|
1681 | |||
1679 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1682 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1680 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1683 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1681 |
|
1684 | |||
1682 | if db_range: |
|
1685 | if db_range: | |
1683 |
|
1686 | |||
1684 | if not isFloatRange(db_range): |
|
1687 | if not isFloatRange(db_range): | |
1685 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1688 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1686 | return 0 |
|
1689 | return 0 | |
1687 |
|
1690 | |||
1688 | zvalueList = db_range.split(",") |
|
1691 | zvalueList = db_range.split(",") | |
1689 | value1 = float(zvalueList[0]) |
|
1692 | value1 = float(zvalueList[0]) | |
1690 | value2 = float(zvalueList[1]) |
|
1693 | value2 = float(zvalueList[1]) | |
1691 |
|
1694 | |||
1692 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1695 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1693 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1696 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1694 |
|
1697 | |||
1695 | if magrange: |
|
1698 | if magrange: | |
1696 |
|
1699 | |||
1697 | if not isFloatRange(magrange): |
|
1700 | if not isFloatRange(magrange): | |
1698 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) |
|
1701 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) | |
1699 | return 0 |
|
1702 | return 0 | |
1700 |
|
1703 | |||
1701 | zvalueList = magrange.split(",") |
|
1704 | zvalueList = magrange.split(",") | |
1702 | value1 = float(zvalueList[0]) |
|
1705 | value1 = float(zvalueList[0]) | |
1703 | value2 = float(zvalueList[1]) |
|
1706 | value2 = float(zvalueList[1]) | |
1704 |
|
1707 | |||
1705 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1708 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1706 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1709 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1707 |
|
1710 | |||
1708 | if phaserange: |
|
1711 | if phaserange: | |
1709 |
|
1712 | |||
1710 | if not isFloatRange(phaserange): |
|
1713 | if not isFloatRange(phaserange): | |
1711 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) |
|
1714 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) | |
1712 | return 0 |
|
1715 | return 0 | |
1713 |
|
1716 | |||
1714 | zvalueList = phaserange.split(",") |
|
1717 | zvalueList = phaserange.split(",") | |
1715 | value1 = float(zvalueList[0]) |
|
1718 | value1 = float(zvalueList[0]) | |
1716 | value2 = float(zvalueList[1]) |
|
1719 | value2 = float(zvalueList[1]) | |
1717 |
|
1720 | |||
1718 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1721 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1719 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1722 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1720 |
|
1723 | |||
1721 | if self.specGraphSaveCross.isChecked(): |
|
1724 | if self.specGraphSaveCross.isChecked(): | |
1722 | checkPath = True |
|
1725 | checkPath = True | |
1723 | opObj.addParameter(name='save', value='1', format='bool') |
|
1726 | opObj.addParameter(name='save', value='1', format='bool') | |
1724 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1727 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1725 | if figfile: |
|
1728 | if figfile: | |
1726 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1729 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1727 | if wrperiod: |
|
1730 | if wrperiod: | |
1728 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1731 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1729 |
|
1732 | |||
1730 | if self.specGraphftpCross.isChecked(): |
|
1733 | if self.specGraphftpCross.isChecked(): | |
1731 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1734 | opObj.addParameter(name='ftp', value='1', format='int') | |
1732 | self.addFTPConf2Operation(puObj, opObj) |
|
1735 | self.addFTPConf2Operation(puObj, opObj) | |
1733 | addFTP = True |
|
1736 | addFTP = True | |
1734 |
|
1737 | |||
1735 | if self.specGraphCebRTIplot.isChecked(): |
|
1738 | if self.specGraphCebRTIplot.isChecked(): | |
1736 |
|
1739 | |||
1737 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1740 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1738 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1741 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1739 |
|
1742 | |||
1740 | if channelList: |
|
1743 | if channelList: | |
1741 |
|
1744 | |||
1742 | if not isIntList(channelList): |
|
1745 | if not isIntList(channelList): | |
1743 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1746 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1744 | return 0 |
|
1747 | return 0 | |
1745 |
|
1748 | |||
1746 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1749 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1747 |
|
1750 | |||
1748 | if trange: |
|
1751 | if trange: | |
1749 |
|
1752 | |||
1750 | if not isFloatRange(trange): |
|
1753 | if not isFloatRange(trange): | |
1751 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1754 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1752 | return 0 |
|
1755 | return 0 | |
1753 |
|
1756 | |||
1754 | zvalueList = trange.split(",") |
|
1757 | zvalueList = trange.split(",") | |
1755 | value1 = float(zvalueList[0]) |
|
1758 | value1 = float(zvalueList[0]) | |
1756 | value2 = float(zvalueList[1]) |
|
1759 | value2 = float(zvalueList[1]) | |
1757 |
|
1760 | |||
1758 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1761 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1759 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1762 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1760 |
|
1763 | |||
1761 | if hei_range: |
|
1764 | if hei_range: | |
1762 |
|
1765 | |||
1763 | if not isFloatRange(hei_range): |
|
1766 | if not isFloatRange(hei_range): | |
1764 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1767 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1765 | return 0 |
|
1768 | return 0 | |
1766 |
|
1769 | |||
1767 | yvalueList = hei_range.split(",") |
|
1770 | yvalueList = hei_range.split(",") | |
1768 | value1 = float(yvalueList[0]) |
|
1771 | value1 = float(yvalueList[0]) | |
1769 | value2 = float(yvalueList[1]) |
|
1772 | value2 = float(yvalueList[1]) | |
1770 |
|
1773 | |||
1771 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1774 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1772 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1775 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1773 |
|
1776 | |||
1774 | if db_range: |
|
1777 | if db_range: | |
1775 |
|
1778 | |||
1776 | if not isFloatRange(db_range): |
|
1779 | if not isFloatRange(db_range): | |
1777 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1780 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1778 | return 0 |
|
1781 | return 0 | |
1779 |
|
1782 | |||
1780 | zvalueList = db_range.split(",") |
|
1783 | zvalueList = db_range.split(",") | |
1781 | value1 = float(zvalueList[0]) |
|
1784 | value1 = float(zvalueList[0]) | |
1782 | value2 = float(zvalueList[1]) |
|
1785 | value2 = float(zvalueList[1]) | |
1783 |
|
1786 | |||
1784 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1787 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1785 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1788 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1786 |
|
1789 | |||
1787 | if self.specGraphSaveRTIplot.isChecked(): |
|
1790 | if self.specGraphSaveRTIplot.isChecked(): | |
1788 | checkPath = True |
|
1791 | checkPath = True | |
1789 | opObj.addParameter(name='save', value='1', format='bool') |
|
1792 | opObj.addParameter(name='save', value='1', format='bool') | |
1790 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1793 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1791 | if figfile: |
|
1794 | if figfile: | |
1792 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1795 | opObj.addParameter(name='figfile', value=value, format='str') | |
1793 | if wrperiod: |
|
1796 | if wrperiod: | |
1794 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1797 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1795 |
|
1798 | |||
1796 | if self.specGraphftpRTIplot.isChecked(): |
|
1799 | if self.specGraphftpRTIplot.isChecked(): | |
1797 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1800 | opObj.addParameter(name='ftp', value='1', format='int') | |
1798 | self.addFTPConf2Operation(puObj, opObj) |
|
1801 | self.addFTPConf2Operation(puObj, opObj) | |
1799 | addFTP = True |
|
1802 | addFTP = True | |
1800 |
|
1803 | |||
1801 | if self.specGraphCebCoherencmap.isChecked(): |
|
1804 | if self.specGraphCebCoherencmap.isChecked(): | |
1802 |
|
1805 | |||
1803 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1806 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1804 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1807 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1805 |
|
1808 | |||
1806 | if trange: |
|
1809 | if trange: | |
1807 |
|
1810 | |||
1808 | if not isFloatRange(trange): |
|
1811 | if not isFloatRange(trange): | |
1809 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1812 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1810 | return 0 |
|
1813 | return 0 | |
1811 |
|
1814 | |||
1812 | zvalueList = trange.split(",") |
|
1815 | zvalueList = trange.split(",") | |
1813 | value1 = float(zvalueList[0]) |
|
1816 | value1 = float(zvalueList[0]) | |
1814 | value2 = float(zvalueList[1]) |
|
1817 | value2 = float(zvalueList[1]) | |
1815 |
|
1818 | |||
1816 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1819 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1817 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1820 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1818 |
|
1821 | |||
1819 | if hei_range: |
|
1822 | if hei_range: | |
1820 |
|
1823 | |||
1821 | if not isFloatRange(hei_range): |
|
1824 | if not isFloatRange(hei_range): | |
1822 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1825 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1823 | return 0 |
|
1826 | return 0 | |
1824 |
|
1827 | |||
1825 | yvalueList = hei_range.split(",") |
|
1828 | yvalueList = hei_range.split(",") | |
1826 | value1 = float(yvalueList[0]) |
|
1829 | value1 = float(yvalueList[0]) | |
1827 | value2 = float(yvalueList[1]) |
|
1830 | value2 = float(yvalueList[1]) | |
1828 |
|
1831 | |||
1829 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1832 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1830 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1833 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1831 |
|
1834 | |||
1832 | if magrange: |
|
1835 | if magrange: | |
1833 |
|
1836 | |||
1834 | if not isFloatRange(magrange): |
|
1837 | if not isFloatRange(magrange): | |
1835 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) |
|
1838 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) | |
1836 | return 0 |
|
1839 | return 0 | |
1837 |
|
1840 | |||
1838 | zvalueList = magrange.split(",") |
|
1841 | zvalueList = magrange.split(",") | |
1839 | value1 = float(zvalueList[0]) |
|
1842 | value1 = float(zvalueList[0]) | |
1840 | value2 = float(zvalueList[1]) |
|
1843 | value2 = float(zvalueList[1]) | |
1841 |
|
1844 | |||
1842 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1845 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1843 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1846 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1844 |
|
1847 | |||
1845 | if phaserange: |
|
1848 | if phaserange: | |
1846 |
|
1849 | |||
1847 | if not isFloatRange(phaserange): |
|
1850 | if not isFloatRange(phaserange): | |
1848 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) |
|
1851 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) | |
1849 | return 0 |
|
1852 | return 0 | |
1850 |
|
1853 | |||
1851 | zvalueList = phaserange.split(",") |
|
1854 | zvalueList = phaserange.split(",") | |
1852 | value1 = float(zvalueList[0]) |
|
1855 | value1 = float(zvalueList[0]) | |
1853 | value2 = float(zvalueList[1]) |
|
1856 | value2 = float(zvalueList[1]) | |
1854 |
|
1857 | |||
1855 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1858 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1856 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1859 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1857 |
|
1860 | |||
1858 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1861 | if self.specGraphSaveCoherencemap.isChecked(): | |
1859 | checkPath = True |
|
1862 | checkPath = True | |
1860 | opObj.addParameter(name='save', value='1', format='bool') |
|
1863 | opObj.addParameter(name='save', value='1', format='bool') | |
1861 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1864 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1862 | if figfile: |
|
1865 | if figfile: | |
1863 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1866 | opObj.addParameter(name='figfile', value=value, format='str') | |
1864 | if wrperiod: |
|
1867 | if wrperiod: | |
1865 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1868 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1866 |
|
1869 | |||
1867 | if self.specGraphftpCoherencemap.isChecked(): |
|
1870 | if self.specGraphftpCoherencemap.isChecked(): | |
1868 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1871 | opObj.addParameter(name='ftp', value='1', format='int') | |
1869 | self.addFTPConf2Operation(puObj, opObj) |
|
1872 | self.addFTPConf2Operation(puObj, opObj) | |
1870 | addFTP = True |
|
1873 | addFTP = True | |
1871 |
|
1874 | |||
1872 | if self.specGraphPowerprofile.isChecked(): |
|
1875 | if self.specGraphPowerprofile.isChecked(): | |
1873 |
|
1876 | |||
1874 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1877 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1875 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1878 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1876 |
|
1879 | |||
1877 | if channelList: |
|
1880 | if channelList: | |
1878 |
|
1881 | |||
1879 | if not isList(channelList): |
|
1882 | if not isList(channelList): | |
1880 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1883 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1881 | return 0 |
|
1884 | return 0 | |
1882 |
|
1885 | |||
1883 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1886 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1884 |
|
1887 | |||
1885 | if hei_range: |
|
1888 | if hei_range: | |
1886 |
|
1889 | |||
1887 | if not isFloatRange(hei_range): |
|
1890 | if not isFloatRange(hei_range): | |
1888 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1891 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1889 | return 0 |
|
1892 | return 0 | |
1890 |
|
1893 | |||
1891 | yvalueList = hei_range.split(",") |
|
1894 | yvalueList = hei_range.split(",") | |
1892 | value1 = float(yvalueList[0]) |
|
1895 | value1 = float(yvalueList[0]) | |
1893 | value2 = float(yvalueList[1]) |
|
1896 | value2 = float(yvalueList[1]) | |
1894 |
|
1897 | |||
1895 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1898 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1896 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1899 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1897 |
|
1900 | |||
1898 | if db_range: |
|
1901 | if db_range: | |
1899 |
|
1902 | |||
1900 | if not isFloatRange(db_range): |
|
1903 | if not isFloatRange(db_range): | |
1901 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1904 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1902 | return 0 |
|
1905 | return 0 | |
1903 |
|
1906 | |||
1904 | zvalueList = db_range.split(",") |
|
1907 | zvalueList = db_range.split(",") | |
1905 | value1 = float(zvalueList[0]) |
|
1908 | value1 = float(zvalueList[0]) | |
1906 | value2 = float(zvalueList[1]) |
|
1909 | value2 = float(zvalueList[1]) | |
1907 |
|
1910 | |||
1908 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1911 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1909 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1912 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1910 |
|
1913 | |||
1911 | if self.specGraphSavePowerprofile.isChecked(): |
|
1914 | if self.specGraphSavePowerprofile.isChecked(): | |
1912 | checkPath = True |
|
1915 | checkPath = True | |
1913 | opObj.addParameter(name='save', value='1', format='bool') |
|
1916 | opObj.addParameter(name='save', value='1', format='bool') | |
1914 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1917 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1915 | if figfile: |
|
1918 | if figfile: | |
1916 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1919 | opObj.addParameter(name='figfile', value=value, format='str') | |
1917 | if wrperiod: |
|
1920 | if wrperiod: | |
1918 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1921 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1919 |
|
1922 | |||
1920 | if self.specGraphftpPowerprofile.isChecked(): |
|
1923 | if self.specGraphftpPowerprofile.isChecked(): | |
1921 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1924 | opObj.addParameter(name='ftp', value='1', format='int') | |
1922 | self.addFTPConf2Operation(puObj, opObj) |
|
1925 | self.addFTPConf2Operation(puObj, opObj) | |
1923 | addFTP = True |
|
1926 | addFTP = True | |
1924 | # rti noise |
|
1927 | # rti noise | |
1925 |
|
1928 | |||
1926 | if self.specGraphCebRTInoise.isChecked(): |
|
1929 | if self.specGraphCebRTInoise.isChecked(): | |
1927 |
|
1930 | |||
1928 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1931 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1929 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1932 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1930 |
|
1933 | |||
1931 | if channelList: |
|
1934 | if channelList: | |
1932 |
|
1935 | |||
1933 | if not isList(channelList): |
|
1936 | if not isList(channelList): | |
1934 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1937 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1935 | return 0 |
|
1938 | return 0 | |
1936 |
|
1939 | |||
1937 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1940 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1938 |
|
1941 | |||
1939 | if trange: |
|
1942 | if trange: | |
1940 |
|
1943 | |||
1941 | if not isFloatRange(trange): |
|
1944 | if not isFloatRange(trange): | |
1942 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1945 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1943 | return 0 |
|
1946 | return 0 | |
1944 |
|
1947 | |||
1945 | zvalueList = trange.split(",") |
|
1948 | zvalueList = trange.split(",") | |
1946 | value1 = float(zvalueList[0]) |
|
1949 | value1 = float(zvalueList[0]) | |
1947 | value2 = float(zvalueList[1]) |
|
1950 | value2 = float(zvalueList[1]) | |
1948 |
|
1951 | |||
1949 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1952 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1950 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1953 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1951 |
|
1954 | |||
1952 | if db_range: |
|
1955 | if db_range: | |
1953 |
|
1956 | |||
1954 | if not isFloatRange(db_range): |
|
1957 | if not isFloatRange(db_range): | |
1955 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1958 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1956 | return 0 |
|
1959 | return 0 | |
1957 |
|
1960 | |||
1958 | zvalueList = db_range.split(",") |
|
1961 | zvalueList = db_range.split(",") | |
1959 | value1 = float(zvalueList[0]) |
|
1962 | value1 = float(zvalueList[0]) | |
1960 | value2 = float(zvalueList[1]) |
|
1963 | value2 = float(zvalueList[1]) | |
1961 |
|
1964 | |||
1962 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1965 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1963 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1966 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1964 |
|
1967 | |||
1965 | if self.specGraphSaveRTInoise.isChecked(): |
|
1968 | if self.specGraphSaveRTInoise.isChecked(): | |
1966 | checkPath = True |
|
1969 | checkPath = True | |
1967 | opObj.addParameter(name='save', value='1', format='bool') |
|
1970 | opObj.addParameter(name='save', value='1', format='bool') | |
1968 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1971 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1969 | if figfile: |
|
1972 | if figfile: | |
1970 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1973 | opObj.addParameter(name='figfile', value=value, format='str') | |
1971 | if wrperiod: |
|
1974 | if wrperiod: | |
1972 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1975 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1973 |
|
1976 | |||
1974 | # test_ftp |
|
1977 | # test_ftp | |
1975 | if self.specGraphftpRTInoise.isChecked(): |
|
1978 | if self.specGraphftpRTInoise.isChecked(): | |
1976 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1979 | opObj.addParameter(name='ftp', value='1', format='int') | |
1977 | self.addFTPConf2Operation(puObj, opObj) |
|
1980 | self.addFTPConf2Operation(puObj, opObj) | |
1978 | addFTP = True |
|
1981 | addFTP = True | |
1979 |
|
1982 | |||
1980 | if checkPath: |
|
1983 | if checkPath: | |
1981 | if not figpath: |
|
1984 | if not figpath: | |
1982 | self.console.clear() |
|
1985 | self.console.clear() | |
1983 | self.console.append("Graphic path should be defined") |
|
1986 | self.console.append("Graphic path should be defined") | |
1984 | return 0 |
|
1987 | return 0 | |
1985 |
|
1988 | |||
1986 | if addFTP and not figpath: |
|
1989 | if addFTP and not figpath: | |
1987 | self.console.clear() |
|
1990 | self.console.clear() | |
1988 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1991 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1989 | return 0 |
|
1992 | return 0 | |
1990 |
|
1993 | |||
1991 | # if something happend |
|
1994 | # if something happend | |
1992 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1995 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1993 | if parms_ok: |
|
1996 | if parms_ok: | |
1994 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1997 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1995 | opObj.addParameter(name='path', value=output_path) |
|
1998 | opObj.addParameter(name='path', value=output_path) | |
1996 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1999 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1997 |
|
2000 | |||
1998 | self.console.clear() |
|
2001 | self.console.clear() | |
1999 | try: |
|
2002 | try: | |
2000 | self.refreshPUProperties(puObj) |
|
2003 | self.refreshPUProperties(puObj) | |
2001 | except: |
|
2004 | except: | |
2002 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2005 | self.console.append("An error reading input parameters was found ... Check them!") | |
2003 | return 0 |
|
2006 | return 0 | |
2004 |
|
2007 | |||
2005 | self.console.append("Save your project and press Play button to start signal processing") |
|
2008 | self.console.append("Save your project and press Play button to start signal processing") | |
2006 |
|
2009 | |||
2007 | self._enable_play_button() |
|
2010 | self._enable_play_button() | |
2008 | self._enable_save_button() |
|
2011 | self._enable_save_button() | |
2009 |
|
2012 | |||
2010 | return 1 |
|
2013 | return 1 | |
2011 |
|
2014 | |||
2012 |
|
2015 | |||
2013 | @pyqtSignature("") |
|
2016 | @pyqtSignature("") | |
2014 | def on_specGraphClear_clicked(self): |
|
2017 | def on_specGraphClear_clicked(self): | |
2015 |
|
2018 | |||
2016 | self.console.clear() |
|
2019 | self.console.clear() | |
2017 |
|
2020 | |||
2018 | """ |
|
2021 | """ | |
2019 | Spectra Graph |
|
2022 | Spectra Graph | |
2020 | """ |
|
2023 | """ | |
2021 | @pyqtSignature("int") |
|
2024 | @pyqtSignature("int") | |
2022 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
2025 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
2023 |
|
2026 | |||
2024 | self.__checkSpecGraphFilters() |
|
2027 | self.__checkSpecGraphFilters() | |
2025 |
|
2028 | |||
2026 |
|
2029 | |||
2027 | @pyqtSignature("int") |
|
2030 | @pyqtSignature("int") | |
2028 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
2031 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
2029 |
|
2032 | |||
2030 | self.__checkSpecGraphFilters() |
|
2033 | self.__checkSpecGraphFilters() | |
2031 |
|
2034 | |||
2032 | @pyqtSignature("int") |
|
2035 | @pyqtSignature("int") | |
2033 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
2036 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
2034 |
|
2037 | |||
2035 | self.__checkSpecGraphFilters() |
|
2038 | self.__checkSpecGraphFilters() | |
2036 |
|
2039 | |||
2037 |
|
2040 | |||
2038 | @pyqtSignature("int") |
|
2041 | @pyqtSignature("int") | |
2039 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
2042 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
2040 |
|
2043 | |||
2041 | self.__checkSpecGraphFilters() |
|
2044 | self.__checkSpecGraphFilters() | |
2042 |
|
2045 | |||
2043 |
|
2046 | |||
2044 | @pyqtSignature("int") |
|
2047 | @pyqtSignature("int") | |
2045 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
2048 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
2046 |
|
2049 | |||
2047 | self.__checkSpecGraphFilters() |
|
2050 | self.__checkSpecGraphFilters() | |
2048 |
|
2051 | |||
2049 | @pyqtSignature("int") |
|
2052 | @pyqtSignature("int") | |
2050 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
2053 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
2051 |
|
2054 | |||
2052 | self.__checkSpecGraphFilters() |
|
2055 | self.__checkSpecGraphFilters() | |
2053 |
|
2056 | |||
2054 | @pyqtSignature("int") |
|
2057 | @pyqtSignature("int") | |
2055 | def on_specGraphPhase_stateChanged(self, p0): |
|
2058 | def on_specGraphPhase_stateChanged(self, p0): | |
2056 |
|
2059 | |||
2057 | self.__checkSpecGraphFilters() |
|
2060 | self.__checkSpecGraphFilters() | |
2058 |
|
2061 | |||
2059 | @pyqtSignature("int") |
|
2062 | @pyqtSignature("int") | |
2060 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
2063 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
2061 | """ |
|
2064 | """ | |
2062 | """ |
|
2065 | """ | |
2063 | self.__checkSpecGraphSaving() |
|
2066 | self.__checkSpecGraphSaving() | |
2064 |
|
2067 | |||
2065 | @pyqtSignature("int") |
|
2068 | @pyqtSignature("int") | |
2066 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
2069 | def on_specGraphSaveCross_stateChanged(self, p0): | |
2067 |
|
2070 | |||
2068 | self.__checkSpecGraphSaving() |
|
2071 | self.__checkSpecGraphSaving() | |
2069 |
|
2072 | |||
2070 | @pyqtSignature("int") |
|
2073 | @pyqtSignature("int") | |
2071 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
2074 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
2072 |
|
2075 | |||
2073 | self.__checkSpecGraphSaving() |
|
2076 | self.__checkSpecGraphSaving() | |
2074 |
|
2077 | |||
2075 | @pyqtSignature("int") |
|
2078 | @pyqtSignature("int") | |
2076 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
2079 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
2077 |
|
2080 | |||
2078 | self.__checkSpecGraphSaving() |
|
2081 | self.__checkSpecGraphSaving() | |
2079 |
|
2082 | |||
2080 | @pyqtSignature("int") |
|
2083 | @pyqtSignature("int") | |
2081 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
2084 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
2082 |
|
2085 | |||
2083 | self.__checkSpecGraphSaving() |
|
2086 | self.__checkSpecGraphSaving() | |
2084 |
|
2087 | |||
2085 | @pyqtSignature("int") |
|
2088 | @pyqtSignature("int") | |
2086 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
2089 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
2087 |
|
2090 | |||
2088 | self.__checkSpecGraphSaving() |
|
2091 | self.__checkSpecGraphSaving() | |
2089 |
|
2092 | |||
2090 | @pyqtSignature("int") |
|
2093 | @pyqtSignature("int") | |
2091 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
2094 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
2092 | """ |
|
2095 | """ | |
2093 | """ |
|
2096 | """ | |
2094 | self.__checkSpecGraphFTP() |
|
2097 | self.__checkSpecGraphFTP() | |
2095 |
|
2098 | |||
2096 |
|
2099 | |||
2097 | @pyqtSignature("int") |
|
2100 | @pyqtSignature("int") | |
2098 | def on_specGraphftpCross_stateChanged(self, p0): |
|
2101 | def on_specGraphftpCross_stateChanged(self, p0): | |
2099 |
|
2102 | |||
2100 | self.__checkSpecGraphFTP() |
|
2103 | self.__checkSpecGraphFTP() | |
2101 |
|
2104 | |||
2102 | @pyqtSignature("int") |
|
2105 | @pyqtSignature("int") | |
2103 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
2106 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
2104 |
|
2107 | |||
2105 | self.__checkSpecGraphFTP() |
|
2108 | self.__checkSpecGraphFTP() | |
2106 |
|
2109 | |||
2107 | @pyqtSignature("int") |
|
2110 | @pyqtSignature("int") | |
2108 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
2111 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
2109 |
|
2112 | |||
2110 | self.__checkSpecGraphFTP() |
|
2113 | self.__checkSpecGraphFTP() | |
2111 |
|
2114 | |||
2112 | @pyqtSignature("int") |
|
2115 | @pyqtSignature("int") | |
2113 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
2116 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
2114 |
|
2117 | |||
2115 | self.__checkSpecGraphFTP() |
|
2118 | self.__checkSpecGraphFTP() | |
2116 |
|
2119 | |||
2117 | @pyqtSignature("int") |
|
2120 | @pyqtSignature("int") | |
2118 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
2121 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
2119 |
|
2122 | |||
2120 | self.__checkSpecGraphFTP() |
|
2123 | self.__checkSpecGraphFTP() | |
2121 |
|
2124 | |||
2122 | @pyqtSignature("") |
|
2125 | @pyqtSignature("") | |
2123 | def on_specGraphToolPath_clicked(self): |
|
2126 | def on_specGraphToolPath_clicked(self): | |
2124 | """ |
|
2127 | """ | |
2125 | """ |
|
2128 | """ | |
2126 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2129 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2127 | self.specGraphPath.setText(save_path) |
|
2130 | self.specGraphPath.setText(save_path) | |
2128 | if not os.path.exists(save_path): |
|
2131 | if not os.path.exists(save_path): | |
2129 | self.console.clear() |
|
2132 | self.console.clear() | |
2130 | self.console.append("Write a valid path") |
|
2133 | self.console.append("Write a valid path") | |
2131 | return |
|
2134 | return | |
2132 |
|
2135 | |||
2133 | @pyqtSignature("") |
|
2136 | @pyqtSignature("") | |
2134 | def on_specHeisGraphToolPath_clicked(self): |
|
2137 | def on_specHeisGraphToolPath_clicked(self): | |
2135 | """ |
|
2138 | """ | |
2136 | """ |
|
2139 | """ | |
2137 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2140 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2138 | self.specHeisGraphPath.setText(save_path) |
|
2141 | self.specHeisGraphPath.setText(save_path) | |
2139 | if not os.path.exists(save_path): |
|
2142 | if not os.path.exists(save_path): | |
2140 | self.console.clear() |
|
2143 | self.console.clear() | |
2141 | self.console.append("Write a valid path") |
|
2144 | self.console.append("Write a valid path") | |
2142 | return |
|
2145 | return | |
2143 |
|
2146 | |||
2144 | @pyqtSignature("int") |
|
2147 | @pyqtSignature("int") | |
2145 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2148 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2146 | """ |
|
2149 | """ | |
2147 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2150 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2148 | """ |
|
2151 | """ | |
2149 | if p0 == 2: |
|
2152 | if p0 == 2: | |
2150 | self.specHeisOpIncoherent.setEnabled(True) |
|
2153 | self.specHeisOpIncoherent.setEnabled(True) | |
2151 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2154 | self.specHeisOpCobIncInt.setEnabled(True) | |
2152 | if p0 == 0: |
|
2155 | if p0 == 0: | |
2153 | self.specHeisOpIncoherent.setEnabled(False) |
|
2156 | self.specHeisOpIncoherent.setEnabled(False) | |
2154 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2157 | self.specHeisOpCobIncInt.setEnabled(False) | |
2155 |
|
2158 | |||
2156 | @pyqtSignature("") |
|
2159 | @pyqtSignature("") | |
2157 | def on_specHeisOpOk_clicked(self): |
|
2160 | def on_specHeisOpOk_clicked(self): | |
2158 | """ |
|
2161 | """ | |
2159 | AΓADE OPERACION SPECTRAHEIS |
|
2162 | AΓADE OPERACION SPECTRAHEIS | |
2160 | """ |
|
2163 | """ | |
2161 | addFTP = False |
|
2164 | addFTP = False | |
2162 | checkPath = False |
|
2165 | checkPath = False | |
2163 |
|
2166 | |||
2164 | self._disable_play_button() |
|
2167 | self._disable_play_button() | |
2165 | self._disable_save_button() |
|
2168 | self._disable_save_button() | |
2166 |
|
2169 | |||
2167 | self.console.clear() |
|
2170 | self.console.clear() | |
2168 | self.console.append("Checking input parameters ...") |
|
2171 | self.console.append("Checking input parameters ...") | |
2169 |
|
2172 | |||
2170 | puObj = self.getSelectedItemObj() |
|
2173 | puObj = self.getSelectedItemObj() | |
2171 | puObj.removeOperations() |
|
2174 | puObj.removeOperations() | |
2172 |
|
2175 | |||
2173 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2176 | if self.specHeisOpCebIncoherent.isChecked(): | |
2174 | value = str(self.specHeisOpIncoherent.text()) |
|
2177 | value = str(self.specHeisOpIncoherent.text()) | |
2175 | name_operation = 'IncohInt4SpectraHeis' |
|
2178 | name_operation = 'IncohInt4SpectraHeis' | |
2176 | optype = 'other' |
|
2179 | optype = 'other' | |
2177 |
|
2180 | |||
2178 | name_parameter = 'timeInterval' |
|
2181 | name_parameter = 'timeInterval' | |
2179 | format = 'float' |
|
2182 | format = 'float' | |
2180 |
|
2183 | |||
2181 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2184 | if self.specOpCobIncInt.currentIndex() == 0: | |
2182 | name_parameter = 'timeInterval' |
|
2185 | name_parameter = 'timeInterval' | |
2183 | format = 'float' |
|
2186 | format = 'float' | |
2184 |
|
2187 | |||
2185 | if not isFloat(value): |
|
2188 | if not isFloat(value): | |
2186 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2189 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2187 | return 0 |
|
2190 | return 0 | |
2188 |
|
2191 | |||
2189 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2192 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2190 |
|
2193 | |||
2191 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2194 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2192 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2195 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2193 | return 0 |
|
2196 | return 0 | |
2194 |
|
2197 | |||
2195 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2198 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2196 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2199 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2197 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2200 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2198 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2201 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2199 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2202 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2200 |
|
2203 | |||
2201 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2204 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2202 |
|
2205 | |||
2203 | name_operation = 'SpectraHeisScope' |
|
2206 | name_operation = 'SpectraHeisScope' | |
2204 | optype = 'other' |
|
2207 | optype = 'other' | |
2205 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2208 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2206 |
|
2209 | |||
2207 | name_parameter = 'id' |
|
2210 | name_parameter = 'id' | |
2208 | format = 'int' |
|
2211 | format = 'int' | |
2209 | value = opObj.id |
|
2212 | value = opObj.id | |
2210 |
|
2213 | |||
2211 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2214 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2212 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2215 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2213 | return 0 |
|
2216 | return 0 | |
2214 |
|
2217 | |||
2215 | if not (channelList == ''): |
|
2218 | if not (channelList == ''): | |
2216 | name_parameter = 'channelList' |
|
2219 | name_parameter = 'channelList' | |
2217 | format = 'intlist' |
|
2220 | format = 'intlist' | |
2218 |
|
2221 | |||
2219 | if not isList(channelList): |
|
2222 | if not isList(channelList): | |
2220 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2223 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2221 | return 0 |
|
2224 | return 0 | |
2222 |
|
2225 | |||
2223 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2226 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2224 |
|
2227 | |||
2225 | if not freq_range == '': |
|
2228 | if not freq_range == '': | |
2226 | xvalueList = freq_range.split(',') |
|
2229 | xvalueList = freq_range.split(',') | |
2227 |
|
2230 | |||
2228 | if len(xvalueList) != 2: |
|
2231 | if len(xvalueList) != 2: | |
2229 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2232 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2230 | return 0 |
|
2233 | return 0 | |
2231 |
|
2234 | |||
2232 | value1 = xvalueList[0] |
|
2235 | value1 = xvalueList[0] | |
2233 | value2 = xvalueList[1] |
|
2236 | value2 = xvalueList[1] | |
2234 |
|
2237 | |||
2235 | if not isFloat(value1) or not isFloat(value2): |
|
2238 | if not isFloat(value1) or not isFloat(value2): | |
2236 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2239 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2237 | return 0 |
|
2240 | return 0 | |
2238 |
|
2241 | |||
2239 | name1 = 'xmin' |
|
2242 | name1 = 'xmin' | |
2240 | name2 = 'xmax' |
|
2243 | name2 = 'xmax' | |
2241 | format = 'float' |
|
2244 | format = 'float' | |
2242 |
|
2245 | |||
2243 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2246 | opObj.addParameter(name=name1, value=value1, format=format) | |
2244 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2247 | opObj.addParameter(name=name2, value=value2, format=format) | |
2245 |
|
2248 | |||
2246 | if not power_range == '': |
|
2249 | if not power_range == '': | |
2247 | yvalueList = power_range.split(",") |
|
2250 | yvalueList = power_range.split(",") | |
2248 |
|
2251 | |||
2249 | if len(yvalueList) != 2: |
|
2252 | if len(yvalueList) != 2: | |
2250 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2253 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2251 | return 0 |
|
2254 | return 0 | |
2252 |
|
2255 | |||
2253 | value1 = yvalueList[0] |
|
2256 | value1 = yvalueList[0] | |
2254 | value2 = yvalueList[1] |
|
2257 | value2 = yvalueList[1] | |
2255 |
|
2258 | |||
2256 | if not isFloat(value1) or not isFloat(value2): |
|
2259 | if not isFloat(value1) or not isFloat(value2): | |
2257 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2260 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2258 | return 0 |
|
2261 | return 0 | |
2259 |
|
2262 | |||
2260 | name1 = 'ymin' |
|
2263 | name1 = 'ymin' | |
2261 | name2 = 'ymax' |
|
2264 | name2 = 'ymax' | |
2262 | format = 'float' |
|
2265 | format = 'float' | |
2263 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2266 | opObj.addParameter(name=name1, value=value1, format=format) | |
2264 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2267 | opObj.addParameter(name=name2, value=value2, format=format) | |
2265 |
|
2268 | |||
2266 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2269 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2267 | checkPath = True |
|
2270 | checkPath = True | |
2268 | name_parameter1 = 'save' |
|
2271 | name_parameter1 = 'save' | |
2269 | name_parameter2 = 'figpath' |
|
2272 | name_parameter2 = 'figpath' | |
2270 | name_parameter3 = 'figfile' |
|
2273 | name_parameter3 = 'figfile' | |
2271 | value1 = '1' |
|
2274 | value1 = '1' | |
2272 | value2 = str(self.specHeisGraphPath.text()) |
|
2275 | value2 = str(self.specHeisGraphPath.text()) | |
2273 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2276 | value3 = str(self.specHeisGraphPrefix.text()) | |
2274 | format1 = 'bool' |
|
2277 | format1 = 'bool' | |
2275 | format2 = 'str' |
|
2278 | format2 = 'str' | |
2276 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2279 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2277 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2280 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2278 | if not value3 == "": |
|
2281 | if not value3 == "": | |
2279 | try: |
|
2282 | try: | |
2280 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2283 | value3 = str(self.specHeisGraphPrefix.text()) | |
2281 | except: |
|
2284 | except: | |
2282 | self.console.clear() |
|
2285 | self.console.clear() | |
2283 | self.console.append("Please Write prefix") |
|
2286 | self.console.append("Please Write prefix") | |
2284 | return 0 |
|
2287 | return 0 | |
2285 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2288 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2286 |
|
2289 | |||
2287 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2290 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2288 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2291 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2289 |
|
2292 | |||
2290 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2293 | if self.specHeisGraphftpSpectra.isChecked(): | |
2291 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2294 | opObj.addParameter(name='ftp', value='1', format='int') | |
2292 | self.addFTPConf2Operation(puObj, opObj) |
|
2295 | self.addFTPConf2Operation(puObj, opObj) | |
2293 | addFTP = True |
|
2296 | addFTP = True | |
2294 |
|
2297 | |||
2295 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2298 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2296 | name_operation = 'RTIfromSpectraHeis' |
|
2299 | name_operation = 'RTIfromSpectraHeis' | |
2297 | optype = 'other' |
|
2300 | optype = 'other' | |
2298 |
|
2301 | |||
2299 | name_parameter = 'id' |
|
2302 | name_parameter = 'id' | |
2300 | format = 'int' |
|
2303 | format = 'int' | |
2301 |
|
2304 | |||
2302 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2305 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2303 | value = opObj.id |
|
2306 | value = opObj.id | |
2304 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2307 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2305 |
|
2308 | |||
2306 | if not channelList == '': |
|
2309 | if not channelList == '': | |
2307 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2310 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2308 |
|
2311 | |||
2309 | if not time_range == '': |
|
2312 | if not time_range == '': | |
2310 | xvalueList = time_range.split(',') |
|
2313 | xvalueList = time_range.split(',') | |
2311 | try: |
|
2314 | try: | |
2312 | value = float(xvalueList[0]) |
|
2315 | value = float(xvalueList[0]) | |
2313 | value = float(xvalueList[1]) |
|
2316 | value = float(xvalueList[1]) | |
2314 | except: |
|
2317 | except: | |
2315 | return 0 |
|
2318 | return 0 | |
2316 | format = 'float' |
|
2319 | format = 'float' | |
2317 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2320 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2318 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2321 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2319 |
|
2322 | |||
2320 | if not timerange == '': |
|
2323 | if not timerange == '': | |
2321 | format = 'int' |
|
2324 | format = 'int' | |
2322 | try: |
|
2325 | try: | |
2323 | timerange = int(timerange) |
|
2326 | timerange = int(timerange) | |
2324 | except: |
|
2327 | except: | |
2325 | return 0 |
|
2328 | return 0 | |
2326 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2329 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2327 |
|
2330 | |||
2328 |
|
2331 | |||
2329 | if not power_range == '': |
|
2332 | if not power_range == '': | |
2330 | yvalueList = power_range.split(",") |
|
2333 | yvalueList = power_range.split(",") | |
2331 | try: |
|
2334 | try: | |
2332 | value = float(yvalueList[0]) |
|
2335 | value = float(yvalueList[0]) | |
2333 | value = float(yvalueList[1]) |
|
2336 | value = float(yvalueList[1]) | |
2334 | except: |
|
2337 | except: | |
2335 | return 0 |
|
2338 | return 0 | |
2336 |
|
2339 | |||
2337 | format = 'float' |
|
2340 | format = 'float' | |
2338 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2341 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2339 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2342 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2340 |
|
2343 | |||
2341 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2344 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2342 | checkPath = True |
|
2345 | checkPath = True | |
2343 | opObj.addParameter(name='save', value='1', format='bool') |
|
2346 | opObj.addParameter(name='save', value='1', format='bool') | |
2344 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2347 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2345 | value = str(self.specHeisGraphPrefix.text()) |
|
2348 | value = str(self.specHeisGraphPrefix.text()) | |
2346 | if not value == "": |
|
2349 | if not value == "": | |
2347 | try: |
|
2350 | try: | |
2348 | value = str(self.specHeisGraphPrefix.text()) |
|
2351 | value = str(self.specHeisGraphPrefix.text()) | |
2349 | except: |
|
2352 | except: | |
2350 | self.console.clear() |
|
2353 | self.console.clear() | |
2351 | self.console.append("Please Write prefix") |
|
2354 | self.console.append("Please Write prefix") | |
2352 | return 0 |
|
2355 | return 0 | |
2353 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2356 | opObj.addParameter(name='figfile', value=value, format='str') | |
2354 |
|
2357 | |||
2355 | # test_ftp |
|
2358 | # test_ftp | |
2356 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2359 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2357 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2360 | opObj.addParameter(name='ftp', value='1', format='int') | |
2358 | self.addFTPConf2Operation(puObj, opObj) |
|
2361 | self.addFTPConf2Operation(puObj, opObj) | |
2359 | addFTP = True |
|
2362 | addFTP = True | |
2360 |
|
2363 | |||
2361 | localfolder = None |
|
2364 | localfolder = None | |
2362 | if checkPath: |
|
2365 | if checkPath: | |
2363 | localfolder = str(self.specHeisGraphPath.text()) |
|
2366 | localfolder = str(self.specHeisGraphPath.text()) | |
2364 | if localfolder == '': |
|
2367 | if localfolder == '': | |
2365 | self.console.clear() |
|
2368 | self.console.clear() | |
2366 | self.console.append("Graphic path should be defined") |
|
2369 | self.console.append("Graphic path should be defined") | |
2367 | return 0 |
|
2370 | return 0 | |
2368 |
|
2371 | |||
2369 | if addFTP and not localfolder: |
|
2372 | if addFTP and not localfolder: | |
2370 | self.console.clear() |
|
2373 | self.console.clear() | |
2371 | self.console.append("You should save plots before send them to FTP Server") |
|
2374 | self.console.append("You should save plots before send them to FTP Server") | |
2372 | return 0 |
|
2375 | return 0 | |
2373 |
|
2376 | |||
2374 | # if something happened |
|
2377 | # if something happened | |
2375 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2378 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2376 | if parms_ok: |
|
2379 | if parms_ok: | |
2377 | name_operation = 'FitsWriter' |
|
2380 | name_operation = 'FitsWriter' | |
2378 | optype = 'other' |
|
2381 | optype = 'other' | |
2379 | name_parameter1 = 'path' |
|
2382 | name_parameter1 = 'path' | |
2380 | name_parameter2 = 'dataBlocksPerFile' |
|
2383 | name_parameter2 = 'dataBlocksPerFile' | |
2381 | name_parameter3 = 'metadatafile' |
|
2384 | name_parameter3 = 'metadatafile' | |
2382 | value1 = output_path |
|
2385 | value1 = output_path | |
2383 | value2 = blocksperfile |
|
2386 | value2 = blocksperfile | |
2384 | value3 = metadata_file |
|
2387 | value3 = metadata_file | |
2385 | format2 = "int" |
|
2388 | format2 = "int" | |
2386 | format3 = "str" |
|
2389 | format3 = "str" | |
2387 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2390 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2388 |
|
2391 | |||
2389 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2392 | opObj.addParameter(name=name_parameter1, value=value1) | |
2390 |
|
2393 | |||
2391 | if blocksperfile: |
|
2394 | if blocksperfile: | |
2392 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2395 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2393 |
|
2396 | |||
2394 | if metadata_file: |
|
2397 | if metadata_file: | |
2395 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2398 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2396 |
|
2399 | |||
2397 | self.console.clear() |
|
2400 | self.console.clear() | |
2398 | try: |
|
2401 | try: | |
2399 | self.refreshPUProperties(puObj) |
|
2402 | self.refreshPUProperties(puObj) | |
2400 | except: |
|
2403 | except: | |
2401 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2404 | self.console.append("An error reading input parameters was found ... Check them!") | |
2402 | return 0 |
|
2405 | return 0 | |
2403 |
|
2406 | |||
2404 | self.console.append("Save your project and press Play button to start signal processing") |
|
2407 | self.console.append("Save your project and press Play button to start signal processing") | |
2405 |
|
2408 | |||
2406 | self._enable_save_button() |
|
2409 | self._enable_save_button() | |
2407 | self._enable_play_button() |
|
2410 | self._enable_play_button() | |
2408 |
|
2411 | |||
2409 | return 1 |
|
2412 | return 1 | |
2410 |
|
2413 | |||
2411 | @pyqtSignature("") |
|
2414 | @pyqtSignature("") | |
2412 | def on_specHeisGraphClear_clicked(self): |
|
2415 | def on_specHeisGraphClear_clicked(self): | |
2413 |
|
2416 | |||
2414 | self.console.clear() |
|
2417 | self.console.clear() | |
2415 |
|
2418 | |||
2416 | @pyqtSignature("int") |
|
2419 | @pyqtSignature("int") | |
2417 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2420 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2418 |
|
2421 | |||
2419 | if p0 == 2: |
|
2422 | if p0 == 2: | |
2420 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2423 | self.specHeisGgraphChannelList.setEnabled(True) | |
2421 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2424 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2422 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2425 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2423 | if p0 == 0: |
|
2426 | if p0 == 0: | |
2424 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2427 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2425 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2428 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2426 |
|
2429 | |||
2427 | @pyqtSignature("int") |
|
2430 | @pyqtSignature("int") | |
2428 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2431 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2429 |
|
2432 | |||
2430 | if p0 == 2: |
|
2433 | if p0 == 2: | |
2431 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2434 | self.specHeisGgraphChannelList.setEnabled(True) | |
2432 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2435 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2433 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2436 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2434 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2437 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2435 |
|
2438 | |||
2436 | if p0 == 0: |
|
2439 | if p0 == 0: | |
2437 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2440 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2438 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2441 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2439 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2442 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2440 |
|
2443 | |||
2441 | @pyqtSignature("int") |
|
2444 | @pyqtSignature("int") | |
2442 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2445 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2443 | """ |
|
2446 | """ | |
2444 | """ |
|
2447 | """ | |
2445 | if p0 == 2: |
|
2448 | if p0 == 2: | |
2446 | self.specHeisGraphPath.setEnabled(True) |
|
2449 | self.specHeisGraphPath.setEnabled(True) | |
2447 | self.specHeisGraphPrefix.setEnabled(True) |
|
2450 | self.specHeisGraphPrefix.setEnabled(True) | |
2448 | self.specHeisGraphToolPath.setEnabled(True) |
|
2451 | self.specHeisGraphToolPath.setEnabled(True) | |
2449 | if p0 == 0: |
|
2452 | if p0 == 0: | |
2450 | self.specHeisGraphPath.setEnabled(False) |
|
2453 | self.specHeisGraphPath.setEnabled(False) | |
2451 | self.specHeisGraphPrefix.setEnabled(False) |
|
2454 | self.specHeisGraphPrefix.setEnabled(False) | |
2452 | self.specHeisGraphToolPath.setEnabled(False) |
|
2455 | self.specHeisGraphToolPath.setEnabled(False) | |
2453 |
|
2456 | |||
2454 | @pyqtSignature("int") |
|
2457 | @pyqtSignature("int") | |
2455 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2458 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2456 | if p0 == 2: |
|
2459 | if p0 == 2: | |
2457 | self.specHeisGraphPath.setEnabled(True) |
|
2460 | self.specHeisGraphPath.setEnabled(True) | |
2458 | self.specHeisGraphPrefix.setEnabled(True) |
|
2461 | self.specHeisGraphPrefix.setEnabled(True) | |
2459 | self.specHeisGraphToolPath.setEnabled(True) |
|
2462 | self.specHeisGraphToolPath.setEnabled(True) | |
2460 |
|
2463 | |||
2461 | @pyqtSignature("int") |
|
2464 | @pyqtSignature("int") | |
2462 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2465 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2463 | """ |
|
2466 | """ | |
2464 | """ |
|
2467 | """ | |
2465 | if p0 == 2: |
|
2468 | if p0 == 2: | |
2466 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2469 | self.specHeisGgraphftpratio.setEnabled(True) | |
2467 |
|
2470 | |||
2468 | if p0 == 0: |
|
2471 | if p0 == 0: | |
2469 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2472 | self.specHeisGgraphftpratio.setEnabled(False) | |
2470 |
|
2473 | |||
2471 | @pyqtSignature("int") |
|
2474 | @pyqtSignature("int") | |
2472 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2475 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2473 | if p0 == 2: |
|
2476 | if p0 == 2: | |
2474 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2477 | self.specHeisGgraphftpratio.setEnabled(True) | |
2475 |
|
2478 | |||
2476 | def __checkSpecGraphSaving(self): |
|
2479 | def __checkSpecGraphSaving(self): | |
2477 |
|
2480 | |||
2478 | enable = False |
|
2481 | enable = False | |
2479 |
|
2482 | |||
2480 | if self.specGraphSaveSpectra.checkState(): |
|
2483 | if self.specGraphSaveSpectra.checkState(): | |
2481 | enable = True |
|
2484 | enable = True | |
2482 |
|
2485 | |||
2483 | if self.specGraphSaveCross.checkState(): |
|
2486 | if self.specGraphSaveCross.checkState(): | |
2484 | enable = True |
|
2487 | enable = True | |
2485 |
|
2488 | |||
2486 | if self.specGraphSaveRTIplot.checkState(): |
|
2489 | if self.specGraphSaveRTIplot.checkState(): | |
2487 | enable = True |
|
2490 | enable = True | |
2488 |
|
2491 | |||
2489 | if self.specGraphSaveCoherencemap.checkState(): |
|
2492 | if self.specGraphSaveCoherencemap.checkState(): | |
2490 | enable = True |
|
2493 | enable = True | |
2491 |
|
2494 | |||
2492 | if self.specGraphSavePowerprofile.checkState(): |
|
2495 | if self.specGraphSavePowerprofile.checkState(): | |
2493 | enable = True |
|
2496 | enable = True | |
2494 |
|
2497 | |||
2495 | if self.specGraphSaveRTInoise.checkState(): |
|
2498 | if self.specGraphSaveRTInoise.checkState(): | |
2496 | enable = True |
|
2499 | enable = True | |
2497 |
|
2500 | |||
2498 | self.specGraphPath.setEnabled(enable) |
|
2501 | self.specGraphPath.setEnabled(enable) | |
2499 | self.specGraphPrefix.setEnabled(enable) |
|
2502 | self.specGraphPrefix.setEnabled(enable) | |
2500 | self.specGraphToolPath.setEnabled(enable) |
|
2503 | self.specGraphToolPath.setEnabled(enable) | |
2501 |
|
2504 | |||
2502 | self.specGgraphftpratio.setEnabled(enable) |
|
2505 | self.specGgraphftpratio.setEnabled(enable) | |
2503 |
|
2506 | |||
2504 | def __checkSpecGraphFTP(self): |
|
2507 | def __checkSpecGraphFTP(self): | |
2505 |
|
2508 | |||
2506 | enable = False |
|
2509 | enable = False | |
2507 |
|
2510 | |||
2508 | if self.specGraphftpSpectra.checkState(): |
|
2511 | if self.specGraphftpSpectra.checkState(): | |
2509 | enable = True |
|
2512 | enable = True | |
2510 |
|
2513 | |||
2511 | if self.specGraphftpCross.checkState(): |
|
2514 | if self.specGraphftpCross.checkState(): | |
2512 | enable = True |
|
2515 | enable = True | |
2513 |
|
2516 | |||
2514 | if self.specGraphftpRTIplot.checkState(): |
|
2517 | if self.specGraphftpRTIplot.checkState(): | |
2515 | enable = True |
|
2518 | enable = True | |
2516 |
|
2519 | |||
2517 | if self.specGraphftpCoherencemap.checkState(): |
|
2520 | if self.specGraphftpCoherencemap.checkState(): | |
2518 | enable = True |
|
2521 | enable = True | |
2519 |
|
2522 | |||
2520 | if self.specGraphftpPowerprofile.checkState(): |
|
2523 | if self.specGraphftpPowerprofile.checkState(): | |
2521 | enable = True |
|
2524 | enable = True | |
2522 |
|
2525 | |||
2523 | if self.specGraphftpRTInoise.checkState(): |
|
2526 | if self.specGraphftpRTInoise.checkState(): | |
2524 | enable = True |
|
2527 | enable = True | |
2525 |
|
2528 | |||
2526 | # self.specGgraphftpratio.setEnabled(enable) |
|
2529 | # self.specGgraphftpratio.setEnabled(enable) | |
2527 |
|
2530 | |||
2528 | def __checkSpecGraphFilters(self): |
|
2531 | def __checkSpecGraphFilters(self): | |
2529 |
|
2532 | |||
2530 | freq = False |
|
2533 | freq = False | |
2531 | height = False |
|
2534 | height = False | |
2532 | db = False |
|
2535 | db = False | |
2533 | timerange = False |
|
2536 | timerange = False | |
2534 | magnitud = False |
|
2537 | magnitud = False | |
2535 | phase = False |
|
2538 | phase = False | |
2536 | channelList = False |
|
2539 | channelList = False | |
2537 |
|
2540 | |||
2538 | if self.specGraphCebSpectraplot.checkState(): |
|
2541 | if self.specGraphCebSpectraplot.checkState(): | |
2539 | freq = True |
|
2542 | freq = True | |
2540 | height = True |
|
2543 | height = True | |
2541 | db = True |
|
2544 | db = True | |
2542 | channelList = True |
|
2545 | channelList = True | |
2543 |
|
2546 | |||
2544 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2547 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2545 | freq = True |
|
2548 | freq = True | |
2546 | height = True |
|
2549 | height = True | |
2547 | db = True |
|
2550 | db = True | |
2548 | magnitud = True |
|
2551 | magnitud = True | |
2549 | phase = True |
|
2552 | phase = True | |
2550 |
|
2553 | |||
2551 | if self.specGraphCebRTIplot.checkState(): |
|
2554 | if self.specGraphCebRTIplot.checkState(): | |
2552 | height = True |
|
2555 | height = True | |
2553 | db = True |
|
2556 | db = True | |
2554 | timerange = True |
|
2557 | timerange = True | |
2555 | channelList = True |
|
2558 | channelList = True | |
2556 |
|
2559 | |||
2557 | if self.specGraphCebCoherencmap.checkState(): |
|
2560 | if self.specGraphCebCoherencmap.checkState(): | |
2558 | height = True |
|
2561 | height = True | |
2559 | timerange = True |
|
2562 | timerange = True | |
2560 | magnitud = True |
|
2563 | magnitud = True | |
2561 | phase = True |
|
2564 | phase = True | |
2562 |
|
2565 | |||
2563 | if self.specGraphPowerprofile.checkState(): |
|
2566 | if self.specGraphPowerprofile.checkState(): | |
2564 | height = True |
|
2567 | height = True | |
2565 | db = True |
|
2568 | db = True | |
2566 | channelList = True |
|
2569 | channelList = True | |
2567 |
|
2570 | |||
2568 | if self.specGraphCebRTInoise.checkState(): |
|
2571 | if self.specGraphCebRTInoise.checkState(): | |
2569 | db = True |
|
2572 | db = True | |
2570 | timerange = True |
|
2573 | timerange = True | |
2571 | channelList = True |
|
2574 | channelList = True | |
2572 |
|
2575 | |||
2573 |
|
2576 | |||
2574 | self.specGgraphFreq.setEnabled(freq) |
|
2577 | self.specGgraphFreq.setEnabled(freq) | |
2575 | self.specGgraphHeight.setEnabled(height) |
|
2578 | self.specGgraphHeight.setEnabled(height) | |
2576 | self.specGgraphDbsrange.setEnabled(db) |
|
2579 | self.specGgraphDbsrange.setEnabled(db) | |
2577 | self.specGgraphTminTmax.setEnabled(timerange) |
|
2580 | self.specGgraphTminTmax.setEnabled(timerange) | |
2578 |
|
2581 | |||
2579 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2582 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2580 | self.specGgraphPhase.setEnabled(phase) |
|
2583 | self.specGgraphPhase.setEnabled(phase) | |
2581 | self.specGgraphChannelList.setEnabled(channelList) |
|
2584 | self.specGgraphChannelList.setEnabled(channelList) | |
2582 |
|
2585 | |||
2583 | def __getParmsFromProjectWindow(self): |
|
2586 | def __getParmsFromProjectWindow(self): | |
2584 | """ |
|
2587 | """ | |
2585 | Check Inputs Project: |
|
2588 | Check Inputs Project: | |
2586 | - project_name |
|
2589 | - project_name | |
2587 | - datatype |
|
2590 | - datatype | |
2588 | - ext |
|
2591 | - ext | |
2589 | - data_path |
|
2592 | - data_path | |
2590 | - readmode |
|
2593 | - readmode | |
2591 | - delay |
|
2594 | - delay | |
2592 | - set |
|
2595 | - set | |
2593 | - walk |
|
2596 | - walk | |
2594 | """ |
|
2597 | """ | |
2595 | parms_ok = True |
|
2598 | parms_ok = True | |
2596 |
|
2599 | |||
2597 | project_name = str(self.proName.text()) |
|
2600 | project_name = str(self.proName.text()) | |
2598 |
|
2601 | |||
2599 | if project_name == '' or project_name == None: |
|
2602 | if project_name == '' or project_name == None: | |
2600 | outputstr = "Enter a project Name" |
|
2603 | outputstr = "Enter a project Name" | |
2601 | self.console.append(outputstr) |
|
2604 | self.console.append(outputstr) | |
2602 | parms_ok = False |
|
2605 | parms_ok = False | |
2603 | project_name = None |
|
2606 | project_name = None | |
2604 |
|
2607 | |||
2605 | description = str(self.proDescription.toPlainText()) |
|
2608 | description = str(self.proDescription.toPlainText()) | |
2606 |
|
2609 | |||
2607 | datatype = str(self.proComDataType.currentText()) |
|
2610 | datatype = str(self.proComDataType.currentText()) | |
2608 |
|
2611 | |||
2609 | ext = str(self.proDataType.text()) |
|
2612 | ext = str(self.proDataType.text()) | |
2610 |
|
2613 | |||
2611 | dpath = str(self.proDataPath.text()) |
|
2614 | dpath = str(self.proDataPath.text()) | |
2612 |
|
2615 | |||
2613 | if dpath == '': |
|
2616 | if dpath == '': | |
2614 | outputstr = 'Datapath is empty' |
|
2617 | outputstr = 'Datapath is empty' | |
2615 | self.console.append(outputstr) |
|
2618 | self.console.append(outputstr) | |
2616 | parms_ok = False |
|
2619 | parms_ok = False | |
2617 | dpath = None |
|
2620 | dpath = None | |
2618 |
|
2621 | |||
2619 | if dpath != None: |
|
2622 | if dpath != None: | |
2620 | if not os.path.isdir(dpath): |
|
2623 | if not os.path.isdir(dpath): | |
2621 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2624 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2622 | self.console.append(outputstr) |
|
2625 | self.console.append(outputstr) | |
2623 | parms_ok = False |
|
2626 | parms_ok = False | |
2624 | dpath = None |
|
2627 | dpath = None | |
2625 |
|
2628 | |||
2626 | online = int(self.proComReadMode.currentIndex()) |
|
2629 | online = int(self.proComReadMode.currentIndex()) | |
2627 |
|
2630 | |||
2628 | delay = None |
|
2631 | delay = None | |
2629 | if online==1: |
|
2632 | if online==1: | |
2630 | try: |
|
2633 | try: | |
2631 | delay = int(str(self.proDelay.text())) |
|
2634 | delay = int(str(self.proDelay.text())) | |
2632 | except: |
|
2635 | except: | |
2633 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2636 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2634 | self.console.append(outputstr) |
|
2637 | self.console.append(outputstr) | |
2635 | parms_ok = False |
|
2638 | parms_ok = False | |
2636 |
|
2639 | |||
2637 |
|
2640 | |||
2638 | set = None |
|
2641 | set = None | |
2639 | value = str(self.proSet.text()) |
|
2642 | value = str(self.proSet.text()) | |
2640 | try: |
|
2643 | try: | |
2641 | set = int(value) |
|
2644 | set = int(value) | |
2642 | except: |
|
2645 | except: | |
2643 | pass |
|
2646 | pass | |
2644 |
|
2647 | |||
2645 | ippKm = None |
|
2648 | ippKm = None | |
2646 |
|
2649 | |||
2647 | value = str(self.proIPPKm.text()) |
|
2650 | value = str(self.proIPPKm.text()) | |
2648 |
|
2651 | |||
2649 | try: |
|
2652 | try: | |
2650 | ippKm = float(value) |
|
2653 | ippKm = float(value) | |
2651 | except: |
|
2654 | except: | |
2652 | if datatype=="USRP": |
|
2655 | if datatype=="USRP": | |
2653 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2656 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2654 | self.console.append(outputstr) |
|
2657 | self.console.append(outputstr) | |
2655 | parms_ok = False |
|
2658 | parms_ok = False | |
2656 |
|
2659 | |||
2657 | walk = int(self.proComWalk.currentIndex()) |
|
2660 | walk = int(self.proComWalk.currentIndex()) | |
2658 | expLabel = str(self.proExpLabel.text()) |
|
2661 | expLabel = str(self.proExpLabel.text()) | |
2659 |
|
2662 | |||
2660 | startDate = str(self.proComStartDate.currentText()).strip() |
|
2663 | startDate = str(self.proComStartDate.currentText()).strip() | |
2661 | endDate = str(self.proComEndDate.currentText()).strip() |
|
2664 | endDate = str(self.proComEndDate.currentText()).strip() | |
2662 |
|
2665 | |||
2663 | if not startDate: |
|
2666 | if not startDate: | |
2664 | parms_ok = False |
|
2667 | parms_ok = False | |
2665 |
|
2668 | |||
2666 | if not endDate: |
|
2669 | if not endDate: | |
2667 | parms_ok = False |
|
2670 | parms_ok = False | |
2668 |
|
2671 | |||
2669 | # startDateList = startDate.split("/") |
|
2672 | # startDateList = startDate.split("/") | |
2670 | # endDateList = endDate.split("/") |
|
2673 | # endDateList = endDate.split("/") | |
2671 | # |
|
2674 | # | |
2672 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2675 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2673 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2676 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2674 |
|
2677 | |||
2675 | startTime = self.proStartTime.time() |
|
2678 | startTime = self.proStartTime.time() | |
2676 | endTime = self.proEndTime.time() |
|
2679 | endTime = self.proEndTime.time() | |
2677 |
|
2680 | |||
2678 | startTime = str(startTime.toString("H:m:s")) |
|
2681 | startTime = str(startTime.toString("H:m:s")) | |
2679 | endTime = str(endTime.toString("H:m:s")) |
|
2682 | endTime = str(endTime.toString("H:m:s")) | |
2680 |
|
2683 | |||
2681 | projectParms = ProjectParms() |
|
2684 | projectParms = ProjectParms() | |
2682 |
|
2685 | |||
2683 | projectParms.name = project_name |
|
2686 | projectParms.name = project_name | |
2684 | projectParms.description = description |
|
2687 | projectParms.description = description | |
2685 | projectParms.datatype = datatype |
|
2688 | projectParms.datatype = datatype | |
2686 | projectParms.ext = ext |
|
2689 | projectParms.ext = ext | |
2687 | projectParms.dpath = dpath |
|
2690 | projectParms.dpath = dpath | |
2688 | projectParms.online = online |
|
2691 | projectParms.online = online | |
2689 | projectParms.startDate = startDate |
|
2692 | projectParms.startDate = startDate | |
2690 | projectParms.endDate = endDate |
|
2693 | projectParms.endDate = endDate | |
2691 | projectParms.startTime = startTime |
|
2694 | projectParms.startTime = startTime | |
2692 | projectParms.endTime = endTime |
|
2695 | projectParms.endTime = endTime | |
2693 | projectParms.delay = delay |
|
2696 | projectParms.delay = delay | |
2694 | projectParms.walk = walk |
|
2697 | projectParms.walk = walk | |
2695 | projectParms.expLabel = expLabel |
|
2698 | projectParms.expLabel = expLabel | |
2696 | projectParms.set = set |
|
2699 | projectParms.set = set | |
2697 | projectParms.ippKm = ippKm |
|
2700 | projectParms.ippKm = ippKm | |
2698 | projectParms.parmsOk = parms_ok |
|
2701 | projectParms.parmsOk = parms_ok | |
2699 |
|
2702 | |||
2700 | return projectParms |
|
2703 | return projectParms | |
2701 |
|
2704 | |||
2702 |
|
2705 | |||
2703 | def __getParmsFromProjectObj(self, projectObjView): |
|
2706 | def __getParmsFromProjectObj(self, projectObjView): | |
2704 |
|
2707 | |||
2705 | parms_ok = True |
|
2708 | parms_ok = True | |
2706 |
|
2709 | |||
2707 | project_name, description = projectObjView.name, projectObjView.description |
|
2710 | project_name, description = projectObjView.name, projectObjView.description | |
2708 |
|
2711 | |||
2709 | readUnitObj = projectObjView.getReadUnitObj() |
|
2712 | readUnitObj = projectObjView.getReadUnitObj() | |
2710 | datatype = readUnitObj.datatype |
|
2713 | datatype = readUnitObj.datatype | |
2711 |
|
2714 | |||
2712 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2715 | operationObj = readUnitObj.getOperationObj(name='run') | |
2713 |
|
2716 | |||
2714 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2717 | dpath = operationObj.getParameterValue(parameterName='path') | |
2715 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2718 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2716 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2719 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2717 |
|
2720 | |||
2718 | startDate = startDate.strftime("%Y/%m/%d") |
|
2721 | startDate = startDate.strftime("%Y/%m/%d") | |
2719 | endDate = endDate.strftime("%Y/%m/%d") |
|
2722 | endDate = endDate.strftime("%Y/%m/%d") | |
2720 |
|
2723 | |||
2721 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2724 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2722 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2725 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2723 |
|
2726 | |||
2724 | startTime = startTime.strftime("%H:%M:%S") |
|
2727 | startTime = startTime.strftime("%H:%M:%S") | |
2725 | endTime = endTime.strftime("%H:%M:%S") |
|
2728 | endTime = endTime.strftime("%H:%M:%S") | |
2726 |
|
2729 | |||
2727 | online = 0 |
|
2730 | online = 0 | |
2728 | try: |
|
2731 | try: | |
2729 | online = operationObj.getParameterValue(parameterName='online') |
|
2732 | online = operationObj.getParameterValue(parameterName='online') | |
2730 | except: |
|
2733 | except: | |
2731 | pass |
|
2734 | pass | |
2732 |
|
2735 | |||
2733 | delay = '' |
|
2736 | delay = '' | |
2734 | try: |
|
2737 | try: | |
2735 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2738 | delay = operationObj.getParameterValue(parameterName='delay') | |
2736 | except: |
|
2739 | except: | |
2737 | pass |
|
2740 | pass | |
2738 |
|
2741 | |||
2739 | walk = 0 |
|
2742 | walk = 0 | |
2740 | try: |
|
2743 | try: | |
2741 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2744 | walk = operationObj.getParameterValue(parameterName='walk') | |
2742 | except: |
|
2745 | except: | |
2743 | pass |
|
2746 | pass | |
2744 |
|
2747 | |||
2745 | set = '' |
|
2748 | set = '' | |
2746 | try: |
|
2749 | try: | |
2747 | set = operationObj.getParameterValue(parameterName='set') |
|
2750 | set = operationObj.getParameterValue(parameterName='set') | |
2748 | except: |
|
2751 | except: | |
2749 | pass |
|
2752 | pass | |
2750 |
|
2753 | |||
2751 | expLabel = '' |
|
2754 | expLabel = '' | |
2752 | try: |
|
2755 | try: | |
2753 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2756 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2754 | except: |
|
2757 | except: | |
2755 | pass |
|
2758 | pass | |
2756 |
|
2759 | |||
2757 | ippKm = '' |
|
2760 | ippKm = '' | |
2758 | if datatype.lower() == 'usrp': |
|
2761 | if datatype.lower() == 'usrp': | |
2759 | try: |
|
2762 | try: | |
2760 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2763 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2761 | except: |
|
2764 | except: | |
2762 | pass |
|
2765 | pass | |
2763 |
|
2766 | |||
2764 | projectParms = ProjectParms() |
|
2767 | projectParms = ProjectParms() | |
2765 |
|
2768 | |||
2766 | projectParms.name = project_name |
|
2769 | projectParms.name = project_name | |
2767 | projectParms.description = description |
|
2770 | projectParms.description = description | |
2768 | projectParms.datatype = datatype |
|
2771 | projectParms.datatype = datatype | |
2769 | projectParms.ext = None |
|
2772 | projectParms.ext = None | |
2770 | projectParms.dpath = dpath |
|
2773 | projectParms.dpath = dpath | |
2771 | projectParms.online = online |
|
2774 | projectParms.online = online | |
2772 | projectParms.startDate = startDate |
|
2775 | projectParms.startDate = startDate | |
2773 | projectParms.endDate = endDate |
|
2776 | projectParms.endDate = endDate | |
2774 | projectParms.startTime = startTime |
|
2777 | projectParms.startTime = startTime | |
2775 | projectParms.endTime = endTime |
|
2778 | projectParms.endTime = endTime | |
2776 | projectParms.delay=delay |
|
2779 | projectParms.delay=delay | |
2777 | projectParms.walk=walk |
|
2780 | projectParms.walk=walk | |
2778 | projectParms.set=set |
|
2781 | projectParms.set=set | |
2779 | projectParms.ippKm=ippKm |
|
2782 | projectParms.ippKm=ippKm | |
2780 | projectParms.expLabel = expLabel |
|
2783 | projectParms.expLabel = expLabel | |
2781 | projectParms.parmsOk=parms_ok |
|
2784 | projectParms.parmsOk=parms_ok | |
2782 |
|
2785 | |||
2783 | return projectParms |
|
2786 | return projectParms | |
2784 |
|
2787 | |||
2785 | def refreshProjectWindow(self, projectObjView): |
|
2788 | def refreshProjectWindow(self, projectObjView): | |
2786 |
|
2789 | |||
2787 | self.proOk.setEnabled(False) |
|
2790 | self.proOk.setEnabled(False) | |
2788 |
|
2791 | |||
2789 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2792 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2790 |
|
2793 | |||
2791 | index = projectParms.getDatatypeIndex() |
|
2794 | index = projectParms.getDatatypeIndex() | |
2792 |
|
2795 | |||
2793 | self.proName.setText(projectParms.name) |
|
2796 | self.proName.setText(projectParms.name) | |
2794 | self.proDescription.clear() |
|
2797 | self.proDescription.clear() | |
2795 | self.proDescription.append(projectParms.description) |
|
2798 | self.proDescription.append(projectParms.description) | |
2796 |
|
2799 | |||
2797 | self.on_proComDataType_activated(index=index) |
|
2800 | self.on_proComDataType_activated(index=index) | |
2798 | self.proDataPath.setText(projectParms.dpath) |
|
2801 | self.proDataPath.setText(projectParms.dpath) | |
2799 | self.proComDataType.setCurrentIndex(index) |
|
2802 | self.proComDataType.setCurrentIndex(index) | |
2800 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2803 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2801 | self.proDelay.setText(str(projectParms.delay)) |
|
2804 | self.proDelay.setText(str(projectParms.delay)) | |
2802 | self.proSet.setText(str(projectParms.set)) |
|
2805 | self.proSet.setText(str(projectParms.set)) | |
2803 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2806 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2804 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2807 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2805 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2808 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2806 |
|
2809 | |||
2807 | self.on_proComReadMode_activated(projectParms.online) |
|
2810 | self.on_proComReadMode_activated(projectParms.online) | |
2808 | self.on_proComWalk_activated(projectParms.walk) |
|
2811 | self.on_proComWalk_activated(projectParms.walk) | |
2809 |
|
2812 | |||
2810 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2813 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2811 | ext = projectParms.getExt(), |
|
2814 | ext = projectParms.getExt(), | |
2812 | walk = projectParms.walk, |
|
2815 | walk = projectParms.walk, | |
2813 | expLabel = projectParms.expLabel) |
|
2816 | expLabel = projectParms.expLabel) | |
2814 |
|
2817 | |||
2815 | if not dateList: |
|
2818 | if not dateList: | |
2816 | return 0 |
|
2819 | return 0 | |
2817 |
|
2820 | |||
2818 | try: |
|
2821 | try: | |
2819 | startDateIndex = dateList.index(projectParms.startDate) |
|
2822 | startDateIndex = dateList.index(projectParms.startDate) | |
2820 | except: |
|
2823 | except: | |
2821 | startDateIndex = 0 |
|
2824 | startDateIndex = 0 | |
2822 |
|
2825 | |||
2823 | try: |
|
2826 | try: | |
2824 | endDateIndex = dateList.index(projectParms.endDate) |
|
2827 | endDateIndex = dateList.index(projectParms.endDate) | |
2825 | except: |
|
2828 | except: | |
2826 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2829 | endDateIndex = int(self.proComEndDate.count()-1) | |
2827 |
|
2830 | |||
2828 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2831 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2829 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2832 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2830 |
|
2833 | |||
2831 | startlist = projectParms.startTime.split(":") |
|
2834 | startlist = projectParms.startTime.split(":") | |
2832 | endlist = projectParms.endTime.split(":") |
|
2835 | endlist = projectParms.endTime.split(":") | |
2833 |
|
2836 | |||
2834 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2837 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2835 | self.proStartTime.setTime(self.time) |
|
2838 | self.proStartTime.setTime(self.time) | |
2836 |
|
2839 | |||
2837 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2840 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2838 | self.proEndTime.setTime(self.time) |
|
2841 | self.proEndTime.setTime(self.time) | |
2839 |
|
2842 | |||
2840 | self.proOk.setEnabled(True) |
|
2843 | self.proOk.setEnabled(True) | |
2841 |
|
2844 | |||
2842 | return 1 |
|
2845 | return 1 | |
2843 |
|
2846 | |||
2844 | def __refreshVoltageWindow(self, puObj): |
|
2847 | def __refreshVoltageWindow(self, puObj): | |
2845 |
|
2848 | |||
2846 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2849 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2847 | if opObj == None: |
|
2850 | if opObj == None: | |
2848 | self.volOpRadarfrequency.clear() |
|
2851 | self.volOpRadarfrequency.clear() | |
2849 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2852 | self.volOpCebRadarfrequency.setCheckState(0) | |
2850 | else: |
|
2853 | else: | |
2851 | value = opObj.getParameterValue(parameterName='frequency') |
|
2854 | value = opObj.getParameterValue(parameterName='frequency') | |
2852 | value = str(float(value)/1e6) |
|
2855 | value = str(float(value)/1e6) | |
2853 | self.volOpRadarfrequency.setText(value) |
|
2856 | self.volOpRadarfrequency.setText(value) | |
2854 | self.volOpRadarfrequency.setEnabled(True) |
|
2857 | self.volOpRadarfrequency.setEnabled(True) | |
2855 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2858 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2856 |
|
2859 | |||
2857 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2860 | opObj = puObj.getOperationObj(name="selectChannels") | |
2858 |
|
2861 | |||
2859 | if opObj == None: |
|
2862 | if opObj == None: | |
2860 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2863 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2861 |
|
2864 | |||
2862 | if opObj == None: |
|
2865 | if opObj == None: | |
2863 | self.volOpChannel.clear() |
|
2866 | self.volOpChannel.clear() | |
2864 | self.volOpCebChannels.setCheckState(0) |
|
2867 | self.volOpCebChannels.setCheckState(0) | |
2865 | else: |
|
2868 | else: | |
2866 | channelEnabled = False |
|
2869 | channelEnabled = False | |
2867 | try: |
|
2870 | try: | |
2868 | value = opObj.getParameterValue(parameterName='channelList') |
|
2871 | value = opObj.getParameterValue(parameterName='channelList') | |
2869 | value = str(value)[1:-1] |
|
2872 | value = str(value)[1:-1] | |
2870 | channelEnabled = True |
|
2873 | channelEnabled = True | |
2871 | channelMode = 0 |
|
2874 | channelMode = 0 | |
2872 | except: |
|
2875 | except: | |
2873 | pass |
|
2876 | pass | |
2874 | try: |
|
2877 | try: | |
2875 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2878 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2876 | value = str(value)[1:-1] |
|
2879 | value = str(value)[1:-1] | |
2877 | channelEnabled = True |
|
2880 | channelEnabled = True | |
2878 | channelMode = 1 |
|
2881 | channelMode = 1 | |
2879 | except: |
|
2882 | except: | |
2880 | pass |
|
2883 | pass | |
2881 |
|
2884 | |||
2882 | if channelEnabled: |
|
2885 | if channelEnabled: | |
2883 | self.volOpChannel.setText(value) |
|
2886 | self.volOpChannel.setText(value) | |
2884 | self.volOpChannel.setEnabled(True) |
|
2887 | self.volOpChannel.setEnabled(True) | |
2885 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2888 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2886 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2889 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2887 |
|
2890 | |||
2888 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2891 | opObj = puObj.getOperationObj(name="selectHeights") | |
2889 | if opObj == None: |
|
2892 | if opObj == None: | |
2890 | self.volOpHeights.clear() |
|
2893 | self.volOpHeights.clear() | |
2891 | self.volOpCebHeights.setCheckState(0) |
|
2894 | self.volOpCebHeights.setCheckState(0) | |
2892 | else: |
|
2895 | else: | |
2893 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2896 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2894 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2897 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2895 | value = value1 + "," + value2 |
|
2898 | value = value1 + "," + value2 | |
2896 | self.volOpHeights.setText(value) |
|
2899 | self.volOpHeights.setText(value) | |
2897 | self.volOpHeights.setEnabled(True) |
|
2900 | self.volOpHeights.setEnabled(True) | |
2898 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2901 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2899 |
|
2902 | |||
2900 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2903 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2901 | if opObj == None: |
|
2904 | if opObj == None: | |
2902 | self.volOpFilter.clear() |
|
2905 | self.volOpFilter.clear() | |
2903 | self.volOpCebFilter.setCheckState(0) |
|
2906 | self.volOpCebFilter.setCheckState(0) | |
2904 | else: |
|
2907 | else: | |
2905 | value = opObj.getParameterValue(parameterName='window') |
|
2908 | value = opObj.getParameterValue(parameterName='window') | |
2906 | value = str(value) |
|
2909 | value = str(value) | |
2907 | self.volOpFilter.setText(value) |
|
2910 | self.volOpFilter.setText(value) | |
2908 | self.volOpFilter.setEnabled(True) |
|
2911 | self.volOpFilter.setEnabled(True) | |
2909 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2912 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2910 |
|
2913 | |||
2911 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2914 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2912 | if opObj == None: |
|
2915 | if opObj == None: | |
2913 | self.volOpProfile.clear() |
|
2916 | self.volOpProfile.clear() | |
2914 | self.volOpCebProfile.setCheckState(0) |
|
2917 | self.volOpCebProfile.setCheckState(0) | |
2915 | else: |
|
2918 | else: | |
2916 | for parmObj in opObj.getParameterObjList(): |
|
2919 | for parmObj in opObj.getParameterObjList(): | |
2917 |
|
2920 | |||
2918 | if parmObj.name == "profileList": |
|
2921 | if parmObj.name == "profileList": | |
2919 | value = parmObj.getValue() |
|
2922 | value = parmObj.getValue() | |
2920 | value = str(value)[1:-1] |
|
2923 | value = str(value)[1:-1] | |
2921 | self.volOpProfile.setText(value) |
|
2924 | self.volOpProfile.setText(value) | |
2922 | self.volOpProfile.setEnabled(True) |
|
2925 | self.volOpProfile.setEnabled(True) | |
2923 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2926 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2924 | self.volOpComProfile.setCurrentIndex(0) |
|
2927 | self.volOpComProfile.setCurrentIndex(0) | |
2925 |
|
2928 | |||
2926 | if parmObj.name == "profileRangeList": |
|
2929 | if parmObj.name == "profileRangeList": | |
2927 | value = parmObj.getValue() |
|
2930 | value = parmObj.getValue() | |
2928 | value = str(value)[1:-1] |
|
2931 | value = str(value)[1:-1] | |
2929 | self.volOpProfile.setText(value) |
|
2932 | self.volOpProfile.setText(value) | |
2930 | self.volOpProfile.setEnabled(True) |
|
2933 | self.volOpProfile.setEnabled(True) | |
2931 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2934 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2932 | self.volOpComProfile.setCurrentIndex(1) |
|
2935 | self.volOpComProfile.setCurrentIndex(1) | |
2933 |
|
2936 | |||
2934 | if parmObj.name == "rangeList": |
|
2937 | if parmObj.name == "rangeList": | |
2935 | value = parmObj.getValue() |
|
2938 | value = parmObj.getValue() | |
2936 | value = str(value)[1:-1] |
|
2939 | value = str(value)[1:-1] | |
2937 | self.volOpProfile.setText(value) |
|
2940 | self.volOpProfile.setText(value) | |
2938 | self.volOpProfile.setEnabled(True) |
|
2941 | self.volOpProfile.setEnabled(True) | |
2939 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2942 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2940 | self.volOpComProfile.setCurrentIndex(2) |
|
2943 | self.volOpComProfile.setCurrentIndex(2) | |
2941 |
|
2944 | |||
2942 | opObj = puObj.getOperationObj(name="Decoder") |
|
2945 | opObj = puObj.getOperationObj(name="Decoder") | |
2943 | self.volOpCode.setText("") |
|
2946 | self.volOpCode.setText("") | |
2944 | if opObj == None: |
|
2947 | if opObj == None: | |
2945 | self.volOpCebDecodification.setCheckState(0) |
|
2948 | self.volOpCebDecodification.setCheckState(0) | |
2946 | else: |
|
2949 | else: | |
2947 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2950 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2948 |
|
2951 | |||
2949 | parmObj = opObj.getParameterObj('code') |
|
2952 | parmObj = opObj.getParameterObj('code') | |
2950 |
|
2953 | |||
2951 | if parmObj == None: |
|
2954 | if parmObj == None: | |
2952 | self.volOpComCode.setCurrentIndex(0) |
|
2955 | self.volOpComCode.setCurrentIndex(0) | |
2953 | else: |
|
2956 | else: | |
2954 |
|
2957 | |||
2955 | parmObj1 = opObj.getParameterObj('nCode') |
|
2958 | parmObj1 = opObj.getParameterObj('nCode') | |
2956 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2959 | parmObj2 = opObj.getParameterObj('nBaud') | |
2957 |
|
2960 | |||
2958 | if parmObj1 == None or parmObj2 == None: |
|
2961 | if parmObj1 == None or parmObj2 == None: | |
2959 | self.volOpComCode.setCurrentIndex(0) |
|
2962 | self.volOpComCode.setCurrentIndex(0) | |
2960 | else: |
|
2963 | else: | |
2961 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2964 | code = ast.literal_eval(str(parmObj.getValue())) | |
2962 | nCode = parmObj1.getValue() |
|
2965 | nCode = parmObj1.getValue() | |
2963 | nBaud = parmObj2.getValue() |
|
2966 | nBaud = parmObj2.getValue() | |
2964 |
|
2967 | |||
2965 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2968 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2966 |
|
2969 | |||
2967 | #User defined by default |
|
2970 | #User defined by default | |
2968 | self.volOpComCode.setCurrentIndex(13) |
|
2971 | self.volOpComCode.setCurrentIndex(13) | |
2969 | self.volOpCode.setText(str(code)) |
|
2972 | self.volOpCode.setText(str(code)) | |
2970 |
|
2973 | |||
2971 | if nCode == 1: |
|
2974 | if nCode == 1: | |
2972 | if nBaud == 3: |
|
2975 | if nBaud == 3: | |
2973 | self.volOpComCode.setCurrentIndex(1) |
|
2976 | self.volOpComCode.setCurrentIndex(1) | |
2974 | if nBaud == 4: |
|
2977 | if nBaud == 4: | |
2975 | self.volOpComCode.setCurrentIndex(2) |
|
2978 | self.volOpComCode.setCurrentIndex(2) | |
2976 | if nBaud == 5: |
|
2979 | if nBaud == 5: | |
2977 | self.volOpComCode.setCurrentIndex(3) |
|
2980 | self.volOpComCode.setCurrentIndex(3) | |
2978 | if nBaud == 7: |
|
2981 | if nBaud == 7: | |
2979 | self.volOpComCode.setCurrentIndex(4) |
|
2982 | self.volOpComCode.setCurrentIndex(4) | |
2980 | if nBaud == 11: |
|
2983 | if nBaud == 11: | |
2981 | self.volOpComCode.setCurrentIndex(5) |
|
2984 | self.volOpComCode.setCurrentIndex(5) | |
2982 | if nBaud == 13: |
|
2985 | if nBaud == 13: | |
2983 | self.volOpComCode.setCurrentIndex(6) |
|
2986 | self.volOpComCode.setCurrentIndex(6) | |
2984 |
|
2987 | |||
2985 | if nCode == 2: |
|
2988 | if nCode == 2: | |
2986 | if nBaud == 3: |
|
2989 | if nBaud == 3: | |
2987 | self.volOpComCode.setCurrentIndex(7) |
|
2990 | self.volOpComCode.setCurrentIndex(7) | |
2988 | if nBaud == 4: |
|
2991 | if nBaud == 4: | |
2989 | self.volOpComCode.setCurrentIndex(8) |
|
2992 | self.volOpComCode.setCurrentIndex(8) | |
2990 | if nBaud == 5: |
|
2993 | if nBaud == 5: | |
2991 | self.volOpComCode.setCurrentIndex(9) |
|
2994 | self.volOpComCode.setCurrentIndex(9) | |
2992 | if nBaud == 7: |
|
2995 | if nBaud == 7: | |
2993 | self.volOpComCode.setCurrentIndex(10) |
|
2996 | self.volOpComCode.setCurrentIndex(10) | |
2994 | if nBaud == 11: |
|
2997 | if nBaud == 11: | |
2995 | self.volOpComCode.setCurrentIndex(11) |
|
2998 | self.volOpComCode.setCurrentIndex(11) | |
2996 | if nBaud == 13: |
|
2999 | if nBaud == 13: | |
2997 | self.volOpComCode.setCurrentIndex(12) |
|
3000 | self.volOpComCode.setCurrentIndex(12) | |
2998 |
|
3001 | |||
2999 |
|
3002 | |||
3000 | opObj = puObj.getOperationObj(name="deFlip") |
|
3003 | opObj = puObj.getOperationObj(name="deFlip") | |
3001 | if opObj == None: |
|
3004 | if opObj == None: | |
3002 | self.volOpFlip.clear() |
|
3005 | self.volOpFlip.clear() | |
3003 | self.volOpFlip.setEnabled(False) |
|
3006 | self.volOpFlip.setEnabled(False) | |
3004 | self.volOpCebFlip.setCheckState(0) |
|
3007 | self.volOpCebFlip.setCheckState(0) | |
3005 | else: |
|
3008 | else: | |
3006 | try: |
|
3009 | try: | |
3007 | value = opObj.getParameterValue(parameterName='channelList') |
|
3010 | value = opObj.getParameterValue(parameterName='channelList') | |
3008 | value = str(value)[1:-1] |
|
3011 | value = str(value)[1:-1] | |
3009 | except: |
|
3012 | except: | |
3010 | value = "" |
|
3013 | value = "" | |
3011 |
|
3014 | |||
3012 | self.volOpFlip.setText(value) |
|
3015 | self.volOpFlip.setText(value) | |
3013 | self.volOpFlip.setEnabled(True) |
|
3016 | self.volOpFlip.setEnabled(True) | |
3014 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
3017 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
3015 |
|
3018 | |||
3016 | opObj = puObj.getOperationObj(name="CohInt") |
|
3019 | opObj = puObj.getOperationObj(name="CohInt") | |
3017 | if opObj == None: |
|
3020 | if opObj == None: | |
3018 | self.volOpCohInt.clear() |
|
3021 | self.volOpCohInt.clear() | |
3019 | self.volOpCebCohInt.setCheckState(0) |
|
3022 | self.volOpCebCohInt.setCheckState(0) | |
3020 | else: |
|
3023 | else: | |
3021 | value = opObj.getParameterValue(parameterName='n') |
|
3024 | value = opObj.getParameterValue(parameterName='n') | |
3022 | self.volOpCohInt.setText(str(value)) |
|
3025 | self.volOpCohInt.setText(str(value)) | |
3023 | self.volOpCohInt.setEnabled(True) |
|
3026 | self.volOpCohInt.setEnabled(True) | |
3024 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
3027 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
3025 |
|
3028 | |||
3026 | opObj = puObj.getOperationObj(name='Scope') |
|
3029 | opObj = puObj.getOperationObj(name='Scope') | |
3027 | if opObj == None: |
|
3030 | if opObj == None: | |
3028 | self.volGraphCebshow.setCheckState(0) |
|
3031 | self.volGraphCebshow.setCheckState(0) | |
3029 | else: |
|
3032 | else: | |
3030 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
3033 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
3031 |
|
3034 | |||
3032 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3035 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3033 |
|
3036 | |||
3034 | if parmObj == None: |
|
3037 | if parmObj == None: | |
3035 | self.volGraphChannelList.clear() |
|
3038 | self.volGraphChannelList.clear() | |
3036 | else: |
|
3039 | else: | |
3037 | value = parmObj.getValue() |
|
3040 | value = parmObj.getValue() | |
3038 | value = str(value) |
|
3041 | value = str(value) | |
3039 | self.volGraphChannelList.setText(value) |
|
3042 | self.volGraphChannelList.setText(value) | |
3040 | # self.volOpChannel.setEnabled(True) |
|
3043 | # self.volOpChannel.setEnabled(True) | |
3041 |
|
3044 | |||
3042 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
3045 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
3043 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
3046 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
3044 |
|
3047 | |||
3045 | if parmObj1 == None or parmObj2 ==None: |
|
3048 | if parmObj1 == None or parmObj2 ==None: | |
3046 | self.volGraphIntensityRange.clear() |
|
3049 | self.volGraphIntensityRange.clear() | |
3047 | else: |
|
3050 | else: | |
3048 | value1 = parmObj1.getValue() |
|
3051 | value1 = parmObj1.getValue() | |
3049 | value1 = str(value1) |
|
3052 | value1 = str(value1) | |
3050 | value2 = parmObj2.getValue() |
|
3053 | value2 = parmObj2.getValue() | |
3051 | value2 = str(value2) |
|
3054 | value2 = str(value2) | |
3052 | value = value1 + "," + value2 |
|
3055 | value = value1 + "," + value2 | |
3053 | self.volGraphIntensityRange.setText(value) |
|
3056 | self.volGraphIntensityRange.setText(value) | |
3054 |
|
3057 | |||
3055 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
3058 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
3056 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
3059 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
3057 |
|
3060 | |||
3058 | if parmObj1 == None or parmObj2 ==None: |
|
3061 | if parmObj1 == None or parmObj2 ==None: | |
3059 | self.volGraphHeightrange.clear() |
|
3062 | self.volGraphHeightrange.clear() | |
3060 | else: |
|
3063 | else: | |
3061 | value1 = parmObj1.getValue() |
|
3064 | value1 = parmObj1.getValue() | |
3062 | value1 = str(value1) |
|
3065 | value1 = str(value1) | |
3063 | value2 = parmObj2.getValue() |
|
3066 | value2 = parmObj2.getValue() | |
3064 | value2 = str(value2) |
|
3067 | value2 = str(value2) | |
3065 | value = value1 + "," + value2 |
|
3068 | value = value1 + "," + value2 | |
3066 | value2 = str(value2) |
|
3069 | value2 = str(value2) | |
3067 | self.volGraphHeightrange.setText(value) |
|
3070 | self.volGraphHeightrange.setText(value) | |
3068 |
|
3071 | |||
3069 | parmObj = opObj.getParameterObj(parameterName='type') |
|
3072 | parmObj = opObj.getParameterObj(parameterName='type') | |
3070 |
|
3073 | |||
3071 | if parmObj == None: |
|
3074 | if parmObj == None: | |
3072 | self.volComScopeType.setCurrentIndex(0) |
|
3075 | self.volComScopeType.setCurrentIndex(0) | |
3073 | else: |
|
3076 | else: | |
3074 | value = parmObj.getValue() |
|
3077 | value = parmObj.getValue() | |
3075 | if value == "iq": |
|
3078 | if value == "iq": | |
3076 | self.volComScopeType.setCurrentIndex(0) |
|
3079 | self.volComScopeType.setCurrentIndex(0) | |
3077 | if value == "power": |
|
3080 | if value == "power": | |
3078 | self.volComScopeType.setCurrentIndex(1) |
|
3081 | self.volComScopeType.setCurrentIndex(1) | |
3079 |
|
3082 | |||
3080 | parmObj = opObj.getParameterObj(parameterName='save') |
|
3083 | parmObj = opObj.getParameterObj(parameterName='save') | |
3081 |
|
3084 | |||
3082 | if parmObj == None: |
|
3085 | if parmObj == None: | |
3083 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
3086 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
3084 | else: |
|
3087 | else: | |
3085 | value = parmObj.getValue() |
|
3088 | value = parmObj.getValue() | |
3086 | if value: |
|
3089 | if value: | |
3087 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
3090 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
3088 | else: |
|
3091 | else: | |
3089 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
3092 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
3090 |
|
3093 | |||
3091 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
3094 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
3092 | if parmObj == None: |
|
3095 | if parmObj == None: | |
3093 | self.volGraphPath.clear() |
|
3096 | self.volGraphPath.clear() | |
3094 | else: |
|
3097 | else: | |
3095 | value = parmObj.getValue() |
|
3098 | value = parmObj.getValue() | |
3096 | path = str(value) |
|
3099 | path = str(value) | |
3097 | self.volGraphPath.setText(path) |
|
3100 | self.volGraphPath.setText(path) | |
3098 |
|
3101 | |||
3099 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
3102 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
3100 | if parmObj == None: |
|
3103 | if parmObj == None: | |
3101 | self.volGraphPrefix.clear() |
|
3104 | self.volGraphPrefix.clear() | |
3102 | else: |
|
3105 | else: | |
3103 | value = parmObj.getValue() |
|
3106 | value = parmObj.getValue() | |
3104 | figfile = str(value) |
|
3107 | figfile = str(value) | |
3105 | self.volGraphPrefix.setText(figfile) |
|
3108 | self.volGraphPrefix.setText(figfile) | |
3106 |
|
3109 | |||
3107 | # outputVoltageWrite |
|
3110 | # outputVoltageWrite | |
3108 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
3111 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
3109 |
|
3112 | |||
3110 | if opObj == None: |
|
3113 | if opObj == None: | |
3111 | self.volOutputPath.clear() |
|
3114 | self.volOutputPath.clear() | |
3112 | self.volOutputblocksperfile.clear() |
|
3115 | self.volOutputblocksperfile.clear() | |
3113 | self.volOutputprofilesperblock.clear() |
|
3116 | self.volOutputprofilesperblock.clear() | |
3114 | else: |
|
3117 | else: | |
3115 | parmObj = opObj.getParameterObj(parameterName='path') |
|
3118 | parmObj = opObj.getParameterObj(parameterName='path') | |
3116 | if parmObj == None: |
|
3119 | if parmObj == None: | |
3117 | self.volOutputPath.clear() |
|
3120 | self.volOutputPath.clear() | |
3118 | else: |
|
3121 | else: | |
3119 | value = parmObj.getValue() |
|
3122 | value = parmObj.getValue() | |
3120 | path = str(value) |
|
3123 | path = str(value) | |
3121 | self.volOutputPath.setText(path) |
|
3124 | self.volOutputPath.setText(path) | |
3122 |
|
3125 | |||
3123 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3126 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
3124 | if parmObj == None: |
|
3127 | if parmObj == None: | |
3125 | self.volOutputblocksperfile.clear() |
|
3128 | self.volOutputblocksperfile.clear() | |
3126 | else: |
|
3129 | else: | |
3127 | value = parmObj.getValue() |
|
3130 | value = parmObj.getValue() | |
3128 | blocksperfile = str(value) |
|
3131 | blocksperfile = str(value) | |
3129 | self.volOutputblocksperfile.setText(blocksperfile) |
|
3132 | self.volOutputblocksperfile.setText(blocksperfile) | |
3130 |
|
3133 | |||
3131 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
3134 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
3132 | if parmObj == None: |
|
3135 | if parmObj == None: | |
3133 | self.volOutputprofilesperblock.clear() |
|
3136 | self.volOutputprofilesperblock.clear() | |
3134 | else: |
|
3137 | else: | |
3135 | value = parmObj.getValue() |
|
3138 | value = parmObj.getValue() | |
3136 | profilesPerBlock = str(value) |
|
3139 | profilesPerBlock = str(value) | |
3137 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
3140 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
3138 |
|
3141 | |||
3139 | return |
|
3142 | return | |
3140 |
|
3143 | |||
3141 | def __refreshSpectraWindow(self, puObj): |
|
3144 | def __refreshSpectraWindow(self, puObj): | |
3142 |
|
3145 | |||
3143 | inputId = puObj.getInputId() |
|
3146 | inputId = puObj.getInputId() | |
3144 | inputPUObj = self.__puObjDict[inputId] |
|
3147 | inputPUObj = self.__puObjDict[inputId] | |
3145 |
|
3148 | |||
3146 | if inputPUObj.datatype == 'Voltage': |
|
3149 | if inputPUObj.datatype == 'Voltage': | |
3147 | self.specOpnFFTpoints.setEnabled(True) |
|
3150 | self.specOpnFFTpoints.setEnabled(True) | |
3148 | self.specOpProfiles.setEnabled(True) |
|
3151 | self.specOpProfiles.setEnabled(True) | |
3149 | self.specOpippFactor.setEnabled(True) |
|
3152 | self.specOpippFactor.setEnabled(True) | |
3150 | else: |
|
3153 | else: | |
3151 | self.specOpnFFTpoints.setEnabled(False) |
|
3154 | self.specOpnFFTpoints.setEnabled(False) | |
3152 | self.specOpProfiles.setEnabled(False) |
|
3155 | self.specOpProfiles.setEnabled(False) | |
3153 | self.specOpippFactor.setEnabled(False) |
|
3156 | self.specOpippFactor.setEnabled(False) | |
3154 |
|
3157 | |||
3155 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3158 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3156 | if opObj == None: |
|
3159 | if opObj == None: | |
3157 | self.specOpRadarfrequency.clear() |
|
3160 | self.specOpRadarfrequency.clear() | |
3158 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3161 | self.specOpCebRadarfrequency.setCheckState(0) | |
3159 | else: |
|
3162 | else: | |
3160 | value = opObj.getParameterValue(parameterName='frequency') |
|
3163 | value = opObj.getParameterValue(parameterName='frequency') | |
3161 | value = str(float(value)/1e6) |
|
3164 | value = str(float(value)/1e6) | |
3162 | self.specOpRadarfrequency.setText(value) |
|
3165 | self.specOpRadarfrequency.setText(value) | |
3163 | self.specOpRadarfrequency.setEnabled(True) |
|
3166 | self.specOpRadarfrequency.setEnabled(True) | |
3164 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3167 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3165 |
|
3168 | |||
3166 | opObj = puObj.getOperationObj(name="run") |
|
3169 | opObj = puObj.getOperationObj(name="run") | |
3167 | if opObj == None: |
|
3170 | if opObj == None: | |
3168 | self.specOpnFFTpoints.clear() |
|
3171 | self.specOpnFFTpoints.clear() | |
3169 | self.specOpProfiles.clear() |
|
3172 | self.specOpProfiles.clear() | |
3170 | self.specOpippFactor.clear() |
|
3173 | self.specOpippFactor.clear() | |
3171 | else: |
|
3174 | else: | |
3172 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3175 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3173 | if parmObj == None: |
|
3176 | if parmObj == None: | |
3174 | self.specOpnFFTpoints.clear() |
|
3177 | self.specOpnFFTpoints.clear() | |
3175 | else: |
|
3178 | else: | |
3176 | self.specOpnFFTpoints.setEnabled(True) |
|
3179 | self.specOpnFFTpoints.setEnabled(True) | |
3177 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3180 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3178 | self.specOpnFFTpoints.setText(str(value)) |
|
3181 | self.specOpnFFTpoints.setText(str(value)) | |
3179 |
|
3182 | |||
3180 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3183 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3181 | if parmObj == None: |
|
3184 | if parmObj == None: | |
3182 | self.specOpProfiles.clear() |
|
3185 | self.specOpProfiles.clear() | |
3183 | else: |
|
3186 | else: | |
3184 | self.specOpProfiles.setEnabled(True) |
|
3187 | self.specOpProfiles.setEnabled(True) | |
3185 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3188 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3186 | self.specOpProfiles.setText(str(value)) |
|
3189 | self.specOpProfiles.setText(str(value)) | |
3187 |
|
3190 | |||
3188 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3191 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3189 | if parmObj == None: |
|
3192 | if parmObj == None: | |
3190 | self.specOpippFactor.clear() |
|
3193 | self.specOpippFactor.clear() | |
3191 | else: |
|
3194 | else: | |
3192 | self.specOpippFactor.setEnabled(True) |
|
3195 | self.specOpippFactor.setEnabled(True) | |
3193 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3196 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3194 | self.specOpippFactor.setText(str(value)) |
|
3197 | self.specOpippFactor.setText(str(value)) | |
3195 |
|
3198 | |||
3196 | opObj = puObj.getOperationObj(name="run") |
|
3199 | opObj = puObj.getOperationObj(name="run") | |
3197 | if opObj == None: |
|
3200 | if opObj == None: | |
3198 | self.specOppairsList.clear() |
|
3201 | self.specOppairsList.clear() | |
3199 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3202 | self.specOpCebCrossSpectra.setCheckState(0) | |
3200 | else: |
|
3203 | else: | |
3201 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3204 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3202 | if parmObj == None: |
|
3205 | if parmObj == None: | |
3203 | self.specOppairsList.clear() |
|
3206 | self.specOppairsList.clear() | |
3204 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3207 | self.specOpCebCrossSpectra.setCheckState(0) | |
3205 | else: |
|
3208 | else: | |
3206 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3209 | value = opObj.getParameterValue(parameterName='pairsList') | |
3207 | value = str(value)[1:-1] |
|
3210 | value = str(value)[1:-1] | |
3208 | self.specOppairsList.setText(str(value)) |
|
3211 | self.specOppairsList.setText(str(value)) | |
3209 | self.specOppairsList.setEnabled(True) |
|
3212 | self.specOppairsList.setEnabled(True) | |
3210 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3213 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3211 |
|
3214 | |||
3212 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3215 | opObj = puObj.getOperationObj(name="selectChannels") | |
3213 |
|
3216 | |||
3214 | if opObj == None: |
|
3217 | if opObj == None: | |
3215 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3218 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3216 |
|
3219 | |||
3217 | if opObj == None: |
|
3220 | if opObj == None: | |
3218 | self.specOpChannel.clear() |
|
3221 | self.specOpChannel.clear() | |
3219 | self.specOpCebChannel.setCheckState(0) |
|
3222 | self.specOpCebChannel.setCheckState(0) | |
3220 | else: |
|
3223 | else: | |
3221 | channelEnabled = False |
|
3224 | channelEnabled = False | |
3222 | try: |
|
3225 | try: | |
3223 | value = opObj.getParameterValue(parameterName='channelList') |
|
3226 | value = opObj.getParameterValue(parameterName='channelList') | |
3224 | value = str(value)[1:-1] |
|
3227 | value = str(value)[1:-1] | |
3225 | channelEnabled = True |
|
3228 | channelEnabled = True | |
3226 | channelMode = 0 |
|
3229 | channelMode = 0 | |
3227 | except: |
|
3230 | except: | |
3228 | pass |
|
3231 | pass | |
3229 | try: |
|
3232 | try: | |
3230 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3233 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3231 | value = str(value)[1:-1] |
|
3234 | value = str(value)[1:-1] | |
3232 | channelEnabled = True |
|
3235 | channelEnabled = True | |
3233 | channelMode = 1 |
|
3236 | channelMode = 1 | |
3234 | except: |
|
3237 | except: | |
3235 | pass |
|
3238 | pass | |
3236 |
|
3239 | |||
3237 | if channelEnabled: |
|
3240 | if channelEnabled: | |
3238 | self.specOpChannel.setText(value) |
|
3241 | self.specOpChannel.setText(value) | |
3239 | self.specOpChannel.setEnabled(True) |
|
3242 | self.specOpChannel.setEnabled(True) | |
3240 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3243 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3241 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3244 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3242 |
|
3245 | |||
3243 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3246 | opObj = puObj.getOperationObj(name="selectHeights") | |
3244 | if opObj == None: |
|
3247 | if opObj == None: | |
3245 | self.specOpHeights.clear() |
|
3248 | self.specOpHeights.clear() | |
3246 | self.specOpCebHeights.setCheckState(0) |
|
3249 | self.specOpCebHeights.setCheckState(0) | |
3247 | else: |
|
3250 | else: | |
3248 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3251 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3249 | value1 = str(value1) |
|
3252 | value1 = str(value1) | |
3250 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3253 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3251 | value2 = str(value2) |
|
3254 | value2 = str(value2) | |
3252 | value = value1 + "," + value2 |
|
3255 | value = value1 + "," + value2 | |
3253 | self.specOpHeights.setText(value) |
|
3256 | self.specOpHeights.setText(value) | |
3254 | self.specOpHeights.setEnabled(True) |
|
3257 | self.specOpHeights.setEnabled(True) | |
3255 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3258 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3256 |
|
3259 | |||
3257 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3260 | opObj = puObj.getOperationObj(name="IncohInt") | |
3258 | if opObj == None: |
|
3261 | if opObj == None: | |
3259 | self.specOpIncoherent.clear() |
|
3262 | self.specOpIncoherent.clear() | |
3260 | self.specOpCebIncoherent.setCheckState(0) |
|
3263 | self.specOpCebIncoherent.setCheckState(0) | |
3261 | else: |
|
3264 | else: | |
3262 | for parmObj in opObj.getParameterObjList(): |
|
3265 | for parmObj in opObj.getParameterObjList(): | |
3263 | if parmObj.name == 'timeInterval': |
|
3266 | if parmObj.name == 'timeInterval': | |
3264 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3267 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3265 | self.specOpIncoherent.setText(str(value)) |
|
3268 | self.specOpIncoherent.setText(str(value)) | |
3266 | self.specOpIncoherent.setEnabled(True) |
|
3269 | self.specOpIncoherent.setEnabled(True) | |
3267 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3270 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3268 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3271 | self.specOpCobIncInt.setCurrentIndex(0) | |
3269 |
|
3272 | |||
3270 | if parmObj.name == 'n': |
|
3273 | if parmObj.name == 'n': | |
3271 | value = opObj.getParameterValue(parameterName='n') |
|
3274 | value = opObj.getParameterValue(parameterName='n') | |
3272 | self.specOpIncoherent.setText(str(value)) |
|
3275 | self.specOpIncoherent.setText(str(value)) | |
3273 | self.specOpIncoherent.setEnabled(True) |
|
3276 | self.specOpIncoherent.setEnabled(True) | |
3274 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3277 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3275 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3278 | self.specOpCobIncInt.setCurrentIndex(1) | |
3276 |
|
3279 | |||
3277 | opObj = puObj.getOperationObj(name="removeDC") |
|
3280 | opObj = puObj.getOperationObj(name="removeDC") | |
3278 | if opObj == None: |
|
3281 | if opObj == None: | |
3279 | self.specOpCebRemoveDC.setCheckState(0) |
|
3282 | self.specOpCebRemoveDC.setCheckState(0) | |
3280 | else: |
|
3283 | else: | |
3281 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3284 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3282 |
|
3285 | |||
3283 | parmObj = opObj.getParameterObj(parameterName='mode') |
|
3286 | parmObj = opObj.getParameterObj(parameterName='mode') | |
3284 |
|
3287 | |||
3285 | value = 1 |
|
3288 | value = 1 | |
3286 | if parmObj: |
|
3289 | if parmObj: | |
3287 | value = parmObj.getValue() |
|
3290 | value = parmObj.getValue() | |
3288 |
|
3291 | |||
3289 | if value == 1: |
|
3292 | if value == 1: | |
3290 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3293 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3291 | elif value == 2: |
|
3294 | elif value == 2: | |
3292 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3295 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3293 |
|
3296 | |||
3294 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3297 | opObj = puObj.getOperationObj(name="removeInterference") | |
3295 | if opObj == None: |
|
3298 | if opObj == None: | |
3296 | self.specOpCebRemoveInt.setCheckState(0) |
|
3299 | self.specOpCebRemoveInt.setCheckState(0) | |
3297 | else: |
|
3300 | else: | |
3298 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3301 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3299 |
|
3302 | |||
3300 | opObj = puObj.getOperationObj(name='getNoise') |
|
3303 | opObj = puObj.getOperationObj(name='getNoise') | |
3301 | if opObj == None: |
|
3304 | if opObj == None: | |
3302 | self.specOpCebgetNoise.setCheckState(0) |
|
3305 | self.specOpCebgetNoise.setCheckState(0) | |
3303 | self.specOpgetNoise.clear() |
|
3306 | self.specOpgetNoise.clear() | |
3304 | else: |
|
3307 | else: | |
3305 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3308 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3306 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3309 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3307 | if parmObj == None: |
|
3310 | if parmObj == None: | |
3308 | self.specOpgetNoise.clear() |
|
3311 | self.specOpgetNoise.clear() | |
3309 | value1 = None |
|
3312 | value1 = None | |
3310 | else: |
|
3313 | else: | |
3311 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3314 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3312 | value1 = str(value1) |
|
3315 | value1 = str(value1) | |
3313 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3316 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3314 | if parmObj == None: |
|
3317 | if parmObj == None: | |
3315 | value2 = None |
|
3318 | value2 = None | |
3316 | value = value1 |
|
3319 | value = value1 | |
3317 | self.specOpgetNoise.setText(value) |
|
3320 | self.specOpgetNoise.setText(value) | |
3318 | self.specOpgetNoise.setEnabled(True) |
|
3321 | self.specOpgetNoise.setEnabled(True) | |
3319 | else: |
|
3322 | else: | |
3320 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3323 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3321 | value2 = str(value2) |
|
3324 | value2 = str(value2) | |
3322 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3325 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3323 | if parmObj == None: |
|
3326 | if parmObj == None: | |
3324 | value3 = None |
|
3327 | value3 = None | |
3325 | value = value1 + "," + value2 |
|
3328 | value = value1 + "," + value2 | |
3326 | self.specOpgetNoise.setText(value) |
|
3329 | self.specOpgetNoise.setText(value) | |
3327 | self.specOpgetNoise.setEnabled(True) |
|
3330 | self.specOpgetNoise.setEnabled(True) | |
3328 | else: |
|
3331 | else: | |
3329 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3332 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3330 | value3 = str(value3) |
|
3333 | value3 = str(value3) | |
3331 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3334 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3332 | if parmObj == None: |
|
3335 | if parmObj == None: | |
3333 | value4 = None |
|
3336 | value4 = None | |
3334 | value = value1 + "," + value2 + "," + value3 |
|
3337 | value = value1 + "," + value2 + "," + value3 | |
3335 | self.specOpgetNoise.setText(value) |
|
3338 | self.specOpgetNoise.setText(value) | |
3336 | self.specOpgetNoise.setEnabled(True) |
|
3339 | self.specOpgetNoise.setEnabled(True) | |
3337 | else: |
|
3340 | else: | |
3338 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3341 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3339 | value4 = str(value4) |
|
3342 | value4 = str(value4) | |
3340 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3343 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3341 | self.specOpgetNoise.setText(value) |
|
3344 | self.specOpgetNoise.setText(value) | |
3342 | self.specOpgetNoise.setEnabled(True) |
|
3345 | self.specOpgetNoise.setEnabled(True) | |
3343 |
|
3346 | |||
3344 | self.specGraphPath.clear() |
|
3347 | self.specGraphPath.clear() | |
3345 | self.specGraphPrefix.clear() |
|
3348 | self.specGraphPrefix.clear() | |
3346 | self.specGgraphFreq.clear() |
|
3349 | self.specGgraphFreq.clear() | |
3347 | self.specGgraphHeight.clear() |
|
3350 | self.specGgraphHeight.clear() | |
3348 | self.specGgraphDbsrange.clear() |
|
3351 | self.specGgraphDbsrange.clear() | |
3349 | self.specGgraphmagnitud.clear() |
|
3352 | self.specGgraphmagnitud.clear() | |
3350 | self.specGgraphPhase.clear() |
|
3353 | self.specGgraphPhase.clear() | |
3351 | self.specGgraphChannelList.clear() |
|
3354 | self.specGgraphChannelList.clear() | |
3352 | self.specGgraphTminTmax.clear() |
|
3355 | self.specGgraphTminTmax.clear() | |
3353 | self.specGgraphTimeRange.clear() |
|
3356 | self.specGgraphTimeRange.clear() | |
3354 | self.specGgraphftpratio.clear() |
|
3357 | self.specGgraphftpratio.clear() | |
3355 |
|
3358 | |||
3356 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3359 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3357 |
|
3360 | |||
3358 | if opObj == None: |
|
3361 | if opObj == None: | |
3359 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3362 | self.specGraphCebSpectraplot.setCheckState(0) | |
3360 | self.specGraphSaveSpectra.setCheckState(0) |
|
3363 | self.specGraphSaveSpectra.setCheckState(0) | |
3361 | self.specGraphftpSpectra.setCheckState(0) |
|
3364 | self.specGraphftpSpectra.setCheckState(0) | |
3362 | else: |
|
3365 | else: | |
3363 | operationSpectraPlot = "Enable" |
|
3366 | operationSpectraPlot = "Enable" | |
3364 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3367 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3365 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3368 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3366 | if parmObj == None: |
|
3369 | if parmObj == None: | |
3367 | self.specGgraphChannelList.clear() |
|
3370 | self.specGgraphChannelList.clear() | |
3368 | else: |
|
3371 | else: | |
3369 | value = opObj.getParameterValue(parameterName='channelList') |
|
3372 | value = opObj.getParameterValue(parameterName='channelList') | |
3370 | channelListSpectraPlot = str(value)[1:-1] |
|
3373 | channelListSpectraPlot = str(value)[1:-1] | |
3371 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3374 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3372 | self.specGgraphChannelList.setEnabled(True) |
|
3375 | self.specGgraphChannelList.setEnabled(True) | |
3373 |
|
3376 | |||
3374 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3377 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3375 | if parmObj == None: |
|
3378 | if parmObj == None: | |
3376 | self.specGgraphFreq.clear() |
|
3379 | self.specGgraphFreq.clear() | |
3377 | else: |
|
3380 | else: | |
3378 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3381 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3379 | value1 = str(value1) |
|
3382 | value1 = str(value1) | |
3380 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3383 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3381 | value2 = str(value2) |
|
3384 | value2 = str(value2) | |
3382 | value = value1 + "," + value2 |
|
3385 | value = value1 + "," + value2 | |
3383 | self.specGgraphFreq.setText(value) |
|
3386 | self.specGgraphFreq.setText(value) | |
3384 | self.specGgraphFreq.setEnabled(True) |
|
3387 | self.specGgraphFreq.setEnabled(True) | |
3385 |
|
3388 | |||
3386 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3389 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3387 | if parmObj == None: |
|
3390 | if parmObj == None: | |
3388 | self.specGgraphHeight.clear() |
|
3391 | self.specGgraphHeight.clear() | |
3389 | else: |
|
3392 | else: | |
3390 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3393 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3391 | value1 = str(value1) |
|
3394 | value1 = str(value1) | |
3392 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3395 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3393 | value2 = str(value2) |
|
3396 | value2 = str(value2) | |
3394 | value = value1 + "," + value2 |
|
3397 | value = value1 + "," + value2 | |
3395 | self.specGgraphHeight.setText(value) |
|
3398 | self.specGgraphHeight.setText(value) | |
3396 | self.specGgraphHeight.setEnabled(True) |
|
3399 | self.specGgraphHeight.setEnabled(True) | |
3397 |
|
3400 | |||
3398 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3401 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3399 | if parmObj == None: |
|
3402 | if parmObj == None: | |
3400 | self.specGgraphDbsrange.clear() |
|
3403 | self.specGgraphDbsrange.clear() | |
3401 | else: |
|
3404 | else: | |
3402 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3405 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3403 | value1 = str(value1) |
|
3406 | value1 = str(value1) | |
3404 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3407 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3405 | value2 = str(value2) |
|
3408 | value2 = str(value2) | |
3406 | value = value1 + "," + value2 |
|
3409 | value = value1 + "," + value2 | |
3407 | self.specGgraphDbsrange.setText(value) |
|
3410 | self.specGgraphDbsrange.setText(value) | |
3408 | self.specGgraphDbsrange.setEnabled(True) |
|
3411 | self.specGgraphDbsrange.setEnabled(True) | |
3409 |
|
3412 | |||
3410 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3413 | parmObj = opObj.getParameterObj(parameterName="save") | |
3411 | if parmObj == None: |
|
3414 | if parmObj == None: | |
3412 | self.specGraphSaveSpectra.setCheckState(0) |
|
3415 | self.specGraphSaveSpectra.setCheckState(0) | |
3413 | else: |
|
3416 | else: | |
3414 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3417 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3415 |
|
3418 | |||
3416 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3419 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3417 | if parmObj == None: |
|
3420 | if parmObj == None: | |
3418 | self.specGraphftpSpectra.setCheckState(0) |
|
3421 | self.specGraphftpSpectra.setCheckState(0) | |
3419 | else: |
|
3422 | else: | |
3420 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3423 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3421 |
|
3424 | |||
3422 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3425 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3423 | if parmObj: |
|
3426 | if parmObj: | |
3424 | value = parmObj.getValue() |
|
3427 | value = parmObj.getValue() | |
3425 | self.specGraphPath.setText(value) |
|
3428 | self.specGraphPath.setText(value) | |
3426 |
|
3429 | |||
3427 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3430 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3428 | if parmObj: |
|
3431 | if parmObj: | |
3429 | value = parmObj.getValue() |
|
3432 | value = parmObj.getValue() | |
3430 | self.specGgraphftpratio.setText(str(value)) |
|
3433 | self.specGgraphftpratio.setText(str(value)) | |
3431 |
|
3434 | |||
3432 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3435 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3433 |
|
3436 | |||
3434 | if opObj == None: |
|
3437 | if opObj == None: | |
3435 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3438 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3436 | self.specGraphSaveCross.setCheckState(0) |
|
3439 | self.specGraphSaveCross.setCheckState(0) | |
3437 | self.specGraphftpCross.setCheckState(0) |
|
3440 | self.specGraphftpCross.setCheckState(0) | |
3438 | else: |
|
3441 | else: | |
3439 | operationCrossSpectraPlot = "Enable" |
|
3442 | operationCrossSpectraPlot = "Enable" | |
3440 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3443 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3441 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3444 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3442 | if parmObj == None: |
|
3445 | if parmObj == None: | |
3443 | self.specGgraphFreq.clear() |
|
3446 | self.specGgraphFreq.clear() | |
3444 | else: |
|
3447 | else: | |
3445 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3448 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3446 | value1 = str(value1) |
|
3449 | value1 = str(value1) | |
3447 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3450 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3448 | value2 = str(value2) |
|
3451 | value2 = str(value2) | |
3449 | value = value1 + "," + value2 |
|
3452 | value = value1 + "," + value2 | |
3450 | self.specGgraphFreq.setText(value) |
|
3453 | self.specGgraphFreq.setText(value) | |
3451 | self.specGgraphFreq.setEnabled(True) |
|
3454 | self.specGgraphFreq.setEnabled(True) | |
3452 |
|
3455 | |||
3453 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3456 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3454 | if parmObj == None: |
|
3457 | if parmObj == None: | |
3455 | self.specGgraphHeight.clear() |
|
3458 | self.specGgraphHeight.clear() | |
3456 | else: |
|
3459 | else: | |
3457 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3460 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3458 | value1 = str(value1) |
|
3461 | value1 = str(value1) | |
3459 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3462 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3460 | value2 = str(value2) |
|
3463 | value2 = str(value2) | |
3461 | value = value1 + "," + value2 |
|
3464 | value = value1 + "," + value2 | |
3462 | self.specGgraphHeight.setText(value) |
|
3465 | self.specGgraphHeight.setText(value) | |
3463 | self.specGgraphHeight.setEnabled(True) |
|
3466 | self.specGgraphHeight.setEnabled(True) | |
3464 |
|
3467 | |||
3465 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3468 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3466 | if parmObj == None: |
|
3469 | if parmObj == None: | |
3467 | self.specGgraphDbsrange.clear() |
|
3470 | self.specGgraphDbsrange.clear() | |
3468 | else: |
|
3471 | else: | |
3469 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3472 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3470 | value1 = str(value1) |
|
3473 | value1 = str(value1) | |
3471 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3474 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3472 | value2 = str(value2) |
|
3475 | value2 = str(value2) | |
3473 | value = value1 + "," + value2 |
|
3476 | value = value1 + "," + value2 | |
3474 | self.specGgraphDbsrange.setText(value) |
|
3477 | self.specGgraphDbsrange.setText(value) | |
3475 | self.specGgraphDbsrange.setEnabled(True) |
|
3478 | self.specGgraphDbsrange.setEnabled(True) | |
3476 |
|
3479 | |||
3477 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3480 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3478 | if parmObj == None: |
|
3481 | if parmObj == None: | |
3479 | self.specGgraphmagnitud.clear() |
|
3482 | self.specGgraphmagnitud.clear() | |
3480 | else: |
|
3483 | else: | |
3481 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3484 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3482 | value1 = str(value1) |
|
3485 | value1 = str(value1) | |
3483 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3486 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3484 | value2 = str(value2) |
|
3487 | value2 = str(value2) | |
3485 | value = value1 + "," + value2 |
|
3488 | value = value1 + "," + value2 | |
3486 | self.specGgraphmagnitud.setText(value) |
|
3489 | self.specGgraphmagnitud.setText(value) | |
3487 | self.specGgraphmagnitud.setEnabled(True) |
|
3490 | self.specGgraphmagnitud.setEnabled(True) | |
3488 |
|
3491 | |||
3489 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3492 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3490 | if parmObj == None: |
|
3493 | if parmObj == None: | |
3491 | self.specGgraphPhase.clear() |
|
3494 | self.specGgraphPhase.clear() | |
3492 | else: |
|
3495 | else: | |
3493 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3496 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3494 | value1 = str(value1) |
|
3497 | value1 = str(value1) | |
3495 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3498 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3496 | value2 = str(value2) |
|
3499 | value2 = str(value2) | |
3497 | value = value1 + "," + value2 |
|
3500 | value = value1 + "," + value2 | |
3498 | self.specGgraphPhase.setText(value) |
|
3501 | self.specGgraphPhase.setText(value) | |
3499 | self.specGgraphPhase.setEnabled(True) |
|
3502 | self.specGgraphPhase.setEnabled(True) | |
3500 |
|
3503 | |||
3501 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3504 | parmObj = opObj.getParameterObj(parameterName="save") | |
3502 | if parmObj == None: |
|
3505 | if parmObj == None: | |
3503 | self.specGraphSaveCross.setCheckState(0) |
|
3506 | self.specGraphSaveCross.setCheckState(0) | |
3504 | else: |
|
3507 | else: | |
3505 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3508 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3506 |
|
3509 | |||
3507 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3510 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3508 | if parmObj == None: |
|
3511 | if parmObj == None: | |
3509 | self.specGraphftpCross.setCheckState(0) |
|
3512 | self.specGraphftpCross.setCheckState(0) | |
3510 | else: |
|
3513 | else: | |
3511 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3514 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3512 |
|
3515 | |||
3513 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3516 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3514 | if parmObj: |
|
3517 | if parmObj: | |
3515 | value = parmObj.getValue() |
|
3518 | value = parmObj.getValue() | |
3516 | self.specGraphPath.setText(value) |
|
3519 | self.specGraphPath.setText(value) | |
3517 |
|
3520 | |||
3518 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3521 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3519 | if parmObj: |
|
3522 | if parmObj: | |
3520 | value = parmObj.getValue() |
|
3523 | value = parmObj.getValue() | |
3521 | self.specGgraphftpratio.setText(str(value)) |
|
3524 | self.specGgraphftpratio.setText(str(value)) | |
3522 |
|
3525 | |||
3523 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3526 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3524 |
|
3527 | |||
3525 | if opObj == None: |
|
3528 | if opObj == None: | |
3526 | self.specGraphCebRTIplot.setCheckState(0) |
|
3529 | self.specGraphCebRTIplot.setCheckState(0) | |
3527 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3530 | self.specGraphSaveRTIplot.setCheckState(0) | |
3528 | self.specGraphftpRTIplot.setCheckState(0) |
|
3531 | self.specGraphftpRTIplot.setCheckState(0) | |
3529 | else: |
|
3532 | else: | |
3530 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3533 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3531 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3534 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3532 | if parmObj == None: |
|
3535 | if parmObj == None: | |
3533 | self.specGgraphChannelList.clear() |
|
3536 | self.specGgraphChannelList.clear() | |
3534 | else: |
|
3537 | else: | |
3535 | value = opObj.getParameterValue(parameterName='channelList') |
|
3538 | value = opObj.getParameterValue(parameterName='channelList') | |
3536 | channelListRTIPlot = str(value)[1:-1] |
|
3539 | channelListRTIPlot = str(value)[1:-1] | |
3537 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3540 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3538 | self.specGgraphChannelList.setEnabled(True) |
|
3541 | self.specGgraphChannelList.setEnabled(True) | |
3539 |
|
3542 | |||
3540 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3543 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3541 | if parmObj == None: |
|
3544 | if parmObj == None: | |
3542 | self.specGgraphTminTmax.clear() |
|
3545 | self.specGgraphTminTmax.clear() | |
3543 | else: |
|
3546 | else: | |
3544 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3547 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3545 | value1 = str(value1) |
|
3548 | value1 = str(value1) | |
3546 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3549 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3547 | value2 = str(value2) |
|
3550 | value2 = str(value2) | |
3548 | value = value1 + "," + value2 |
|
3551 | value = value1 + "," + value2 | |
3549 | self.specGgraphTminTmax.setText(value) |
|
3552 | self.specGgraphTminTmax.setText(value) | |
3550 | self.specGgraphTminTmax.setEnabled(True) |
|
3553 | self.specGgraphTminTmax.setEnabled(True) | |
3551 |
|
3554 | |||
3552 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3555 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3553 | if parmObj == None: |
|
3556 | if parmObj == None: | |
3554 | self.specGgraphTimeRange.clear() |
|
3557 | self.specGgraphTimeRange.clear() | |
3555 | else: |
|
3558 | else: | |
3556 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3559 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3557 | value1 = str(value1) |
|
3560 | value1 = str(value1) | |
3558 | self.specGgraphTimeRange.setText(value1) |
|
3561 | self.specGgraphTimeRange.setText(value1) | |
3559 | self.specGgraphTimeRange.setEnabled(True) |
|
3562 | self.specGgraphTimeRange.setEnabled(True) | |
3560 |
|
3563 | |||
3561 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3564 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3562 | if parmObj == None: |
|
3565 | if parmObj == None: | |
3563 | self.specGgraphHeight.clear() |
|
3566 | self.specGgraphHeight.clear() | |
3564 | else: |
|
3567 | else: | |
3565 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3568 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3566 | value1 = str(value1) |
|
3569 | value1 = str(value1) | |
3567 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3570 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3568 | value2 = str(value2) |
|
3571 | value2 = str(value2) | |
3569 | value = value1 + "," + value2 |
|
3572 | value = value1 + "," + value2 | |
3570 | self.specGgraphHeight.setText(value) |
|
3573 | self.specGgraphHeight.setText(value) | |
3571 | self.specGgraphHeight.setEnabled(True) |
|
3574 | self.specGgraphHeight.setEnabled(True) | |
3572 |
|
3575 | |||
3573 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3576 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3574 | if parmObj == None: |
|
3577 | if parmObj == None: | |
3575 | self.specGgraphDbsrange.clear() |
|
3578 | self.specGgraphDbsrange.clear() | |
3576 | else: |
|
3579 | else: | |
3577 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3580 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3578 | value1 = str(value1) |
|
3581 | value1 = str(value1) | |
3579 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3582 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3580 | value2 = str(value2) |
|
3583 | value2 = str(value2) | |
3581 | value = value1 + "," + value2 |
|
3584 | value = value1 + "," + value2 | |
3582 | self.specGgraphDbsrange.setText(value) |
|
3585 | self.specGgraphDbsrange.setText(value) | |
3583 | self.specGgraphDbsrange.setEnabled(True) |
|
3586 | self.specGgraphDbsrange.setEnabled(True) | |
3584 |
|
3587 | |||
3585 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3588 | parmObj = opObj.getParameterObj(parameterName="save") | |
3586 | if parmObj == None: |
|
3589 | if parmObj == None: | |
3587 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3590 | self.specGraphSaveRTIplot.setCheckState(0) | |
3588 | else: |
|
3591 | else: | |
3589 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3592 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3590 |
|
3593 | |||
3591 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3594 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3592 | if parmObj == None: |
|
3595 | if parmObj == None: | |
3593 | self.specGraphftpRTIplot.setCheckState(0) |
|
3596 | self.specGraphftpRTIplot.setCheckState(0) | |
3594 | else: |
|
3597 | else: | |
3595 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3598 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3596 |
|
3599 | |||
3597 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3600 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3598 | if parmObj: |
|
3601 | if parmObj: | |
3599 | value = parmObj.getValue() |
|
3602 | value = parmObj.getValue() | |
3600 | self.specGraphPath.setText(value) |
|
3603 | self.specGraphPath.setText(value) | |
3601 |
|
3604 | |||
3602 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3605 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3603 | if parmObj: |
|
3606 | if parmObj: | |
3604 | value = parmObj.getValue() |
|
3607 | value = parmObj.getValue() | |
3605 | self.specGgraphftpratio.setText(str(value)) |
|
3608 | self.specGgraphftpratio.setText(str(value)) | |
3606 |
|
3609 | |||
3607 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3610 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3608 |
|
3611 | |||
3609 | if opObj == None: |
|
3612 | if opObj == None: | |
3610 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3613 | self.specGraphCebCoherencmap.setCheckState(0) | |
3611 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3614 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3612 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3615 | self.specGraphftpCoherencemap.setCheckState(0) | |
3613 | else: |
|
3616 | else: | |
3614 | operationCoherenceMap = "Enable" |
|
3617 | operationCoherenceMap = "Enable" | |
3615 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3618 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3616 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3619 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3617 | if parmObj == None: |
|
3620 | if parmObj == None: | |
3618 | self.specGgraphTminTmax.clear() |
|
3621 | self.specGgraphTminTmax.clear() | |
3619 | else: |
|
3622 | else: | |
3620 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3623 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3621 | value1 = str(value1) |
|
3624 | value1 = str(value1) | |
3622 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3625 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3623 | value2 = str(value2) |
|
3626 | value2 = str(value2) | |
3624 | value = value1 + "," + value2 |
|
3627 | value = value1 + "," + value2 | |
3625 | self.specGgraphTminTmax.setText(value) |
|
3628 | self.specGgraphTminTmax.setText(value) | |
3626 | self.specGgraphTminTmax.setEnabled(True) |
|
3629 | self.specGgraphTminTmax.setEnabled(True) | |
3627 |
|
3630 | |||
3628 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3631 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3629 | if parmObj == None: |
|
3632 | if parmObj == None: | |
3630 | self.specGgraphTimeRange.clear() |
|
3633 | self.specGgraphTimeRange.clear() | |
3631 | else: |
|
3634 | else: | |
3632 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3635 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3633 | value1 = str(value1) |
|
3636 | value1 = str(value1) | |
3634 | self.specGgraphTimeRange.setText(value1) |
|
3637 | self.specGgraphTimeRange.setText(value1) | |
3635 | self.specGgraphTimeRange.setEnabled(True) |
|
3638 | self.specGgraphTimeRange.setEnabled(True) | |
3636 |
|
3639 | |||
3637 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3640 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3638 | if parmObj == None: |
|
3641 | if parmObj == None: | |
3639 | self.specGgraphHeight.clear() |
|
3642 | self.specGgraphHeight.clear() | |
3640 | else: |
|
3643 | else: | |
3641 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3644 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3642 | value1 = str(value1) |
|
3645 | value1 = str(value1) | |
3643 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3646 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3644 | value2 = str(value2) |
|
3647 | value2 = str(value2) | |
3645 | value = value1 + "," + value2 |
|
3648 | value = value1 + "," + value2 | |
3646 | self.specGgraphHeight.setText(value) |
|
3649 | self.specGgraphHeight.setText(value) | |
3647 | self.specGgraphHeight.setEnabled(True) |
|
3650 | self.specGgraphHeight.setEnabled(True) | |
3648 |
|
3651 | |||
3649 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3652 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3650 | if parmObj == None: |
|
3653 | if parmObj == None: | |
3651 | self.specGgraphmagnitud.clear() |
|
3654 | self.specGgraphmagnitud.clear() | |
3652 | else: |
|
3655 | else: | |
3653 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3656 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3654 | value1 = str(value1) |
|
3657 | value1 = str(value1) | |
3655 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3658 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3656 | value2 = str(value2) |
|
3659 | value2 = str(value2) | |
3657 | value = value1 + "," + value2 |
|
3660 | value = value1 + "," + value2 | |
3658 | self.specGgraphmagnitud.setText(value) |
|
3661 | self.specGgraphmagnitud.setText(value) | |
3659 | self.specGgraphmagnitud.setEnabled(True) |
|
3662 | self.specGgraphmagnitud.setEnabled(True) | |
3660 |
|
3663 | |||
3661 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3664 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3662 | if parmObj == None: |
|
3665 | if parmObj == None: | |
3663 | self.specGgraphmagnitud.clear() |
|
3666 | self.specGgraphmagnitud.clear() | |
3664 | else: |
|
3667 | else: | |
3665 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3668 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3666 | value1 = str(value1) |
|
3669 | value1 = str(value1) | |
3667 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3670 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3668 | value2 = str(value2) |
|
3671 | value2 = str(value2) | |
3669 | value = value1 + "," + value2 |
|
3672 | value = value1 + "," + value2 | |
3670 | self.specGgraphmagnitud.setText(value) |
|
3673 | self.specGgraphmagnitud.setText(value) | |
3671 | self.specGgraphmagnitud.setEnabled(True) |
|
3674 | self.specGgraphmagnitud.setEnabled(True) | |
3672 |
|
3675 | |||
3673 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3676 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3674 | if parmObj == None: |
|
3677 | if parmObj == None: | |
3675 | self.specGgraphPhase.clear() |
|
3678 | self.specGgraphPhase.clear() | |
3676 | else: |
|
3679 | else: | |
3677 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3680 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3678 | value1 = str(value1) |
|
3681 | value1 = str(value1) | |
3679 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3682 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3680 | value2 = str(value2) |
|
3683 | value2 = str(value2) | |
3681 | value = value1 + "," + value2 |
|
3684 | value = value1 + "," + value2 | |
3682 | self.specGgraphPhase.setText(value) |
|
3685 | self.specGgraphPhase.setText(value) | |
3683 | self.specGgraphPhase.setEnabled(True) |
|
3686 | self.specGgraphPhase.setEnabled(True) | |
3684 |
|
3687 | |||
3685 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3688 | parmObj = opObj.getParameterObj(parameterName="save") | |
3686 | if parmObj == None: |
|
3689 | if parmObj == None: | |
3687 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3690 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3688 | else: |
|
3691 | else: | |
3689 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3692 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3690 |
|
3693 | |||
3691 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3694 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3692 | if parmObj == None: |
|
3695 | if parmObj == None: | |
3693 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3696 | self.specGraphftpCoherencemap.setCheckState(0) | |
3694 | else: |
|
3697 | else: | |
3695 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3698 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3696 |
|
3699 | |||
3697 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3700 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3698 | if parmObj: |
|
3701 | if parmObj: | |
3699 | value = parmObj.getValue() |
|
3702 | value = parmObj.getValue() | |
3700 | self.specGraphPath.setText(value) |
|
3703 | self.specGraphPath.setText(value) | |
3701 |
|
3704 | |||
3702 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3705 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3703 | if parmObj: |
|
3706 | if parmObj: | |
3704 | value = parmObj.getValue() |
|
3707 | value = parmObj.getValue() | |
3705 | self.specGgraphftpratio.setText(str(value)) |
|
3708 | self.specGgraphftpratio.setText(str(value)) | |
3706 |
|
3709 | |||
3707 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3710 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3708 |
|
3711 | |||
3709 | if opObj == None: |
|
3712 | if opObj == None: | |
3710 | self.specGraphPowerprofile.setCheckState(0) |
|
3713 | self.specGraphPowerprofile.setCheckState(0) | |
3711 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3714 | self.specGraphSavePowerprofile.setCheckState(0) | |
3712 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3715 | self.specGraphftpPowerprofile.setCheckState(0) | |
3713 | operationPowerProfilePlot = "Disabled" |
|
3716 | operationPowerProfilePlot = "Disabled" | |
3714 | channelList = None |
|
3717 | channelList = None | |
3715 | freq_vel = None |
|
3718 | freq_vel = None | |
3716 | heightsrange = None |
|
3719 | heightsrange = None | |
3717 | else: |
|
3720 | else: | |
3718 | operationPowerProfilePlot = "Enable" |
|
3721 | operationPowerProfilePlot = "Enable" | |
3719 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3722 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3720 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3723 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3721 | if parmObj == None: |
|
3724 | if parmObj == None: | |
3722 | self.specGgraphDbsrange.clear() |
|
3725 | self.specGgraphDbsrange.clear() | |
3723 | else: |
|
3726 | else: | |
3724 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3727 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3725 | value1 = str(value1) |
|
3728 | value1 = str(value1) | |
3726 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3729 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3727 | value2 = str(value2) |
|
3730 | value2 = str(value2) | |
3728 | value = value1 + "," + value2 |
|
3731 | value = value1 + "," + value2 | |
3729 | self.specGgraphDbsrange.setText(value) |
|
3732 | self.specGgraphDbsrange.setText(value) | |
3730 | self.specGgraphDbsrange.setEnabled(True) |
|
3733 | self.specGgraphDbsrange.setEnabled(True) | |
3731 |
|
3734 | |||
3732 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3735 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3733 | if parmObj == None: |
|
3736 | if parmObj == None: | |
3734 | self.specGgraphHeight.clear() |
|
3737 | self.specGgraphHeight.clear() | |
3735 | else: |
|
3738 | else: | |
3736 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3739 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3737 | value1 = str(value1) |
|
3740 | value1 = str(value1) | |
3738 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3741 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3739 | value2 = str(value2) |
|
3742 | value2 = str(value2) | |
3740 | value = value1 + "," + value2 |
|
3743 | value = value1 + "," + value2 | |
3741 | self.specGgraphHeight.setText(value) |
|
3744 | self.specGgraphHeight.setText(value) | |
3742 | self.specGgraphHeight.setEnabled(True) |
|
3745 | self.specGgraphHeight.setEnabled(True) | |
3743 |
|
3746 | |||
3744 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3747 | parmObj = opObj.getParameterObj(parameterName="save") | |
3745 | if parmObj == None: |
|
3748 | if parmObj == None: | |
3746 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3749 | self.specGraphSavePowerprofile.setCheckState(0) | |
3747 | else: |
|
3750 | else: | |
3748 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3751 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3749 |
|
3752 | |||
3750 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3753 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3751 | if parmObj == None: |
|
3754 | if parmObj == None: | |
3752 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3755 | self.specGraphftpPowerprofile.setCheckState(0) | |
3753 | else: |
|
3756 | else: | |
3754 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3757 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3755 |
|
3758 | |||
3756 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3759 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3757 | if parmObj: |
|
3760 | if parmObj: | |
3758 | value = parmObj.getValue() |
|
3761 | value = parmObj.getValue() | |
3759 | self.specGraphPath.setText(value) |
|
3762 | self.specGraphPath.setText(value) | |
3760 |
|
3763 | |||
3761 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3764 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3762 | if parmObj: |
|
3765 | if parmObj: | |
3763 | value = parmObj.getValue() |
|
3766 | value = parmObj.getValue() | |
3764 | self.specGgraphftpratio.setText(str(value)) |
|
3767 | self.specGgraphftpratio.setText(str(value)) | |
3765 |
|
3768 | |||
3766 | opObj = puObj.getOperationObj(name='Noise') |
|
3769 | opObj = puObj.getOperationObj(name='Noise') | |
3767 |
|
3770 | |||
3768 | if opObj == None: |
|
3771 | if opObj == None: | |
3769 | self.specGraphCebRTInoise.setCheckState(0) |
|
3772 | self.specGraphCebRTInoise.setCheckState(0) | |
3770 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3773 | self.specGraphSaveRTInoise.setCheckState(0) | |
3771 | self.specGraphftpRTInoise.setCheckState(0) |
|
3774 | self.specGraphftpRTInoise.setCheckState(0) | |
3772 | else: |
|
3775 | else: | |
3773 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3776 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3774 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3777 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3775 | if parmObj == None: |
|
3778 | if parmObj == None: | |
3776 | self.specGgraphChannelList.clear() |
|
3779 | self.specGgraphChannelList.clear() | |
3777 | else: |
|
3780 | else: | |
3778 | value = opObj.getParameterValue(parameterName='channelList') |
|
3781 | value = opObj.getParameterValue(parameterName='channelList') | |
3779 | channelListRTINoise = str(value)[1:-1] |
|
3782 | channelListRTINoise = str(value)[1:-1] | |
3780 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3783 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3781 | self.specGgraphChannelList.setEnabled(True) |
|
3784 | self.specGgraphChannelList.setEnabled(True) | |
3782 |
|
3785 | |||
3783 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3786 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3784 | if parmObj == None: |
|
3787 | if parmObj == None: | |
3785 | self.specGgraphTminTmax.clear() |
|
3788 | self.specGgraphTminTmax.clear() | |
3786 | else: |
|
3789 | else: | |
3787 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3790 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3788 | value1 = str(value1) |
|
3791 | value1 = str(value1) | |
3789 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3792 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3790 | value2 = str(value2) |
|
3793 | value2 = str(value2) | |
3791 | value = value1 + "," + value2 |
|
3794 | value = value1 + "," + value2 | |
3792 | self.specGgraphTminTmax.setText(value) |
|
3795 | self.specGgraphTminTmax.setText(value) | |
3793 | self.specGgraphTminTmax.setEnabled(True) |
|
3796 | self.specGgraphTminTmax.setEnabled(True) | |
3794 |
|
3797 | |||
3795 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3798 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3796 | if parmObj == None: |
|
3799 | if parmObj == None: | |
3797 | self.specGgraphTimeRange.clear() |
|
3800 | self.specGgraphTimeRange.clear() | |
3798 | else: |
|
3801 | else: | |
3799 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3802 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3800 | value1 = str(value1) |
|
3803 | value1 = str(value1) | |
3801 | self.specGgraphTimeRange.setText(value1) |
|
3804 | self.specGgraphTimeRange.setText(value1) | |
3802 | self.specGgraphTimeRange.setEnabled(True) |
|
3805 | self.specGgraphTimeRange.setEnabled(True) | |
3803 |
|
3806 | |||
3804 |
|
3807 | |||
3805 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3808 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3806 | if parmObj == None: |
|
3809 | if parmObj == None: | |
3807 | self.specGgraphDbsrange.clear() |
|
3810 | self.specGgraphDbsrange.clear() | |
3808 | else: |
|
3811 | else: | |
3809 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3812 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3810 | value1 = str(value1) |
|
3813 | value1 = str(value1) | |
3811 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3814 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3812 | value2 = str(value2) |
|
3815 | value2 = str(value2) | |
3813 | value = value1 + "," + value2 |
|
3816 | value = value1 + "," + value2 | |
3814 | self.specGgraphDbsrange.setText(value) |
|
3817 | self.specGgraphDbsrange.setText(value) | |
3815 | self.specGgraphDbsrange.setEnabled(True) |
|
3818 | self.specGgraphDbsrange.setEnabled(True) | |
3816 |
|
3819 | |||
3817 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3820 | parmObj = opObj.getParameterObj(parameterName="save") | |
3818 | if parmObj == None: |
|
3821 | if parmObj == None: | |
3819 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3822 | self.specGraphSaveRTInoise.setCheckState(0) | |
3820 | else: |
|
3823 | else: | |
3821 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3824 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3822 |
|
3825 | |||
3823 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3826 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3824 | if parmObj == None: |
|
3827 | if parmObj == None: | |
3825 | self.specGraphftpRTInoise.setCheckState(0) |
|
3828 | self.specGraphftpRTInoise.setCheckState(0) | |
3826 | else: |
|
3829 | else: | |
3827 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3830 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3828 |
|
3831 | |||
3829 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3832 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3830 | if parmObj: |
|
3833 | if parmObj: | |
3831 | value = parmObj.getValue() |
|
3834 | value = parmObj.getValue() | |
3832 | self.specGraphPath.setText(value) |
|
3835 | self.specGraphPath.setText(value) | |
3833 |
|
3836 | |||
3834 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3837 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3835 | if parmObj: |
|
3838 | if parmObj: | |
3836 | value = parmObj.getValue() |
|
3839 | value = parmObj.getValue() | |
3837 | self.specGgraphftpratio.setText(str(value)) |
|
3840 | self.specGgraphftpratio.setText(str(value)) | |
3838 |
|
3841 | |||
3839 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3842 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3840 | if opObj == None: |
|
3843 | if opObj == None: | |
3841 | self.specOutputPath.clear() |
|
3844 | self.specOutputPath.clear() | |
3842 | self.specOutputblocksperfile.clear() |
|
3845 | self.specOutputblocksperfile.clear() | |
3843 | else: |
|
3846 | else: | |
3844 | value = opObj.getParameterObj(parameterName='path') |
|
3847 | value = opObj.getParameterObj(parameterName='path') | |
3845 | if value == None: |
|
3848 | if value == None: | |
3846 | self.specOutputPath.clear() |
|
3849 | self.specOutputPath.clear() | |
3847 | else: |
|
3850 | else: | |
3848 | value = opObj.getParameterValue(parameterName='path') |
|
3851 | value = opObj.getParameterValue(parameterName='path') | |
3849 | path = str(value) |
|
3852 | path = str(value) | |
3850 | self.specOutputPath.setText(path) |
|
3853 | self.specOutputPath.setText(path) | |
3851 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3854 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3852 | if value == None: |
|
3855 | if value == None: | |
3853 | self.specOutputblocksperfile.clear() |
|
3856 | self.specOutputblocksperfile.clear() | |
3854 | else: |
|
3857 | else: | |
3855 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3858 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3856 | blocksperfile = str(value) |
|
3859 | blocksperfile = str(value) | |
3857 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3860 | self.specOutputblocksperfile.setText(blocksperfile) | |
3858 |
|
3861 | |||
3859 | return |
|
3862 | return | |
3860 |
|
3863 | |||
3861 | def __refreshSpectraHeisWindow(self, puObj): |
|
3864 | def __refreshSpectraHeisWindow(self, puObj): | |
3862 |
|
3865 | |||
3863 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3866 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3864 | if opObj == None: |
|
3867 | if opObj == None: | |
3865 | self.specHeisOpIncoherent.clear() |
|
3868 | self.specHeisOpIncoherent.clear() | |
3866 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3869 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3867 | else: |
|
3870 | else: | |
3868 | for parmObj in opObj.getParameterObjList(): |
|
3871 | for parmObj in opObj.getParameterObjList(): | |
3869 | if parmObj.name == 'timeInterval': |
|
3872 | if parmObj.name == 'timeInterval': | |
3870 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3873 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3871 | self.specHeisOpIncoherent.setText(str(value)) |
|
3874 | self.specHeisOpIncoherent.setText(str(value)) | |
3872 | self.specHeisOpIncoherent.setEnabled(True) |
|
3875 | self.specHeisOpIncoherent.setEnabled(True) | |
3873 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3876 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3874 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3877 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3875 |
|
3878 | |||
3876 | # SpectraHeis Graph |
|
3879 | # SpectraHeis Graph | |
3877 |
|
3880 | |||
3878 | self.specHeisGgraphXminXmax.clear() |
|
3881 | self.specHeisGgraphXminXmax.clear() | |
3879 | self.specHeisGgraphYminYmax.clear() |
|
3882 | self.specHeisGgraphYminYmax.clear() | |
3880 |
|
3883 | |||
3881 | self.specHeisGgraphChannelList.clear() |
|
3884 | self.specHeisGgraphChannelList.clear() | |
3882 | self.specHeisGgraphTminTmax.clear() |
|
3885 | self.specHeisGgraphTminTmax.clear() | |
3883 | self.specHeisGgraphTimeRange.clear() |
|
3886 | self.specHeisGgraphTimeRange.clear() | |
3884 | self.specHeisGgraphftpratio.clear() |
|
3887 | self.specHeisGgraphftpratio.clear() | |
3885 |
|
3888 | |||
3886 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3889 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3887 | if opObj == None: |
|
3890 | if opObj == None: | |
3888 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3891 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3889 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3892 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3890 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3893 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3891 | else: |
|
3894 | else: | |
3892 | operationSpectraHeisScope = "Enable" |
|
3895 | operationSpectraHeisScope = "Enable" | |
3893 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3896 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3894 |
|
3897 | |||
3895 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3898 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3896 | if parmObj == None: |
|
3899 | if parmObj == None: | |
3897 | self.specHeisGgraphChannelList.clear() |
|
3900 | self.specHeisGgraphChannelList.clear() | |
3898 | else: |
|
3901 | else: | |
3899 | value = opObj.getParameterValue(parameterName='channelList') |
|
3902 | value = opObj.getParameterValue(parameterName='channelList') | |
3900 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3903 | channelListSpectraHeisScope = str(value)[1:-1] | |
3901 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3904 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3902 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3905 | self.specHeisGgraphChannelList.setEnabled(True) | |
3903 |
|
3906 | |||
3904 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3907 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3905 | if parmObj == None: |
|
3908 | if parmObj == None: | |
3906 | self.specHeisGgraphXminXmax.clear() |
|
3909 | self.specHeisGgraphXminXmax.clear() | |
3907 | else: |
|
3910 | else: | |
3908 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3911 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3909 | value1 = str(value1) |
|
3912 | value1 = str(value1) | |
3910 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3913 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3911 | value2 = str(value2) |
|
3914 | value2 = str(value2) | |
3912 | value = value1 + "," + value2 |
|
3915 | value = value1 + "," + value2 | |
3913 | self.specHeisGgraphXminXmax.setText(value) |
|
3916 | self.specHeisGgraphXminXmax.setText(value) | |
3914 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3917 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3915 |
|
3918 | |||
3916 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3919 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3917 | if parmObj == None: |
|
3920 | if parmObj == None: | |
3918 | self.specHeisGgraphYminYmax.clear() |
|
3921 | self.specHeisGgraphYminYmax.clear() | |
3919 | else: |
|
3922 | else: | |
3920 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3923 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3921 | value1 = str(value1) |
|
3924 | value1 = str(value1) | |
3922 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3925 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3923 | value2 = str(value2) |
|
3926 | value2 = str(value2) | |
3924 | value = value1 + "," + value2 |
|
3927 | value = value1 + "," + value2 | |
3925 | self.specHeisGgraphYminYmax.setText(value) |
|
3928 | self.specHeisGgraphYminYmax.setText(value) | |
3926 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3929 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3927 |
|
3930 | |||
3928 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3931 | parmObj = opObj.getParameterObj(parameterName="save") | |
3929 | if parmObj == None: |
|
3932 | if parmObj == None: | |
3930 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3933 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3931 | else: |
|
3934 | else: | |
3932 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3935 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3933 |
|
3936 | |||
3934 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3937 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3935 | if parmObj == None: |
|
3938 | if parmObj == None: | |
3936 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3939 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3937 | else: |
|
3940 | else: | |
3938 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3941 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3939 |
|
3942 | |||
3940 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3943 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3941 | if parmObj: |
|
3944 | if parmObj: | |
3942 | value = parmObj.getValue() |
|
3945 | value = parmObj.getValue() | |
3943 | self.specHeisGraphPath.setText(value) |
|
3946 | self.specHeisGraphPath.setText(value) | |
3944 |
|
3947 | |||
3945 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3948 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3946 | if parmObj: |
|
3949 | if parmObj: | |
3947 | value = parmObj.getValue() |
|
3950 | value = parmObj.getValue() | |
3948 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3951 | self.specHeisGgraphftpratio.setText(str(value)) | |
3949 |
|
3952 | |||
3950 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3953 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3951 |
|
3954 | |||
3952 | if opObj == None: |
|
3955 | if opObj == None: | |
3953 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3956 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3954 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3957 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3955 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3958 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3956 | else: |
|
3959 | else: | |
3957 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3960 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3958 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3961 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3959 | if parmObj == None: |
|
3962 | if parmObj == None: | |
3960 | self.specHeisGgraphChannelList.clear() |
|
3963 | self.specHeisGgraphChannelList.clear() | |
3961 | else: |
|
3964 | else: | |
3962 | value = opObj.getParameterValue(parameterName='channelList') |
|
3965 | value = opObj.getParameterValue(parameterName='channelList') | |
3963 | channelListRTIPlot = str(value)[1:-1] |
|
3966 | channelListRTIPlot = str(value)[1:-1] | |
3964 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3967 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3965 | self.specGgraphChannelList.setEnabled(True) |
|
3968 | self.specGgraphChannelList.setEnabled(True) | |
3966 |
|
3969 | |||
3967 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3970 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3968 | if parmObj == None: |
|
3971 | if parmObj == None: | |
3969 | self.specHeisGgraphTminTmax.clear() |
|
3972 | self.specHeisGgraphTminTmax.clear() | |
3970 | else: |
|
3973 | else: | |
3971 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3974 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3972 | value1 = str(value1) |
|
3975 | value1 = str(value1) | |
3973 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3976 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3974 | value2 = str(value2) |
|
3977 | value2 = str(value2) | |
3975 | value = value1 + "," + value2 |
|
3978 | value = value1 + "," + value2 | |
3976 | self.specHeisGgraphTminTmax.setText(value) |
|
3979 | self.specHeisGgraphTminTmax.setText(value) | |
3977 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3980 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3978 |
|
3981 | |||
3979 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3982 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3980 | if parmObj == None: |
|
3983 | if parmObj == None: | |
3981 | self.specGgraphTimeRange.clear() |
|
3984 | self.specGgraphTimeRange.clear() | |
3982 | else: |
|
3985 | else: | |
3983 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3986 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3984 | value1 = str(value1) |
|
3987 | value1 = str(value1) | |
3985 | self.specHeisGgraphTimeRange.setText(value1) |
|
3988 | self.specHeisGgraphTimeRange.setText(value1) | |
3986 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3989 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3987 |
|
3990 | |||
3988 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3991 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3989 | if parmObj == None: |
|
3992 | if parmObj == None: | |
3990 | self.specHeisGgraphYminYmax.clear() |
|
3993 | self.specHeisGgraphYminYmax.clear() | |
3991 | else: |
|
3994 | else: | |
3992 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3995 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3993 | value1 = str(value1) |
|
3996 | value1 = str(value1) | |
3994 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3997 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3995 | value2 = str(value2) |
|
3998 | value2 = str(value2) | |
3996 | value = value1 + "," + value2 |
|
3999 | value = value1 + "," + value2 | |
3997 | self.specHeisGgraphYminYmax.setText(value) |
|
4000 | self.specHeisGgraphYminYmax.setText(value) | |
3998 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
4001 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3999 |
|
4002 | |||
4000 | parmObj = opObj.getParameterObj(parameterName="save") |
|
4003 | parmObj = opObj.getParameterObj(parameterName="save") | |
4001 | if parmObj == None: |
|
4004 | if parmObj == None: | |
4002 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
4005 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
4003 | else: |
|
4006 | else: | |
4004 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
4007 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
4005 |
|
4008 | |||
4006 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4009 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
4007 | if parmObj == None: |
|
4010 | if parmObj == None: | |
4008 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
4011 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
4009 | else: |
|
4012 | else: | |
4010 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
4013 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
4011 |
|
4014 | |||
4012 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4015 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
4013 | if parmObj: |
|
4016 | if parmObj: | |
4014 | value = parmObj.getValue() |
|
4017 | value = parmObj.getValue() | |
4015 | self.specHeisGraphPath.setText(value) |
|
4018 | self.specHeisGraphPath.setText(value) | |
4016 |
|
4019 | |||
4017 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
4020 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
4018 | if parmObj: |
|
4021 | if parmObj: | |
4019 | value = parmObj.getValue() |
|
4022 | value = parmObj.getValue() | |
4020 | self.specHeisGgraphftpratio.setText(str(value)) |
|
4023 | self.specHeisGgraphftpratio.setText(str(value)) | |
4021 |
|
4024 | |||
4022 | # outputSpectraHeisWrite |
|
4025 | # outputSpectraHeisWrite | |
4023 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
4026 | opObj = puObj.getOperationObj(name='FitsWriter') | |
4024 | if opObj == None: |
|
4027 | if opObj == None: | |
4025 | self.specHeisOutputPath.clear() |
|
4028 | self.specHeisOutputPath.clear() | |
4026 | self.specHeisOutputblocksperfile.clear() |
|
4029 | self.specHeisOutputblocksperfile.clear() | |
4027 | self.specHeisOutputMetada.clear() |
|
4030 | self.specHeisOutputMetada.clear() | |
4028 | else: |
|
4031 | else: | |
4029 | value = opObj.getParameterObj(parameterName='path') |
|
4032 | value = opObj.getParameterObj(parameterName='path') | |
4030 | if value == None: |
|
4033 | if value == None: | |
4031 | self.specHeisOutputPath.clear() |
|
4034 | self.specHeisOutputPath.clear() | |
4032 | else: |
|
4035 | else: | |
4033 | value = opObj.getParameterValue(parameterName='path') |
|
4036 | value = opObj.getParameterValue(parameterName='path') | |
4034 | path = str(value) |
|
4037 | path = str(value) | |
4035 | self.specHeisOutputPath.setText(path) |
|
4038 | self.specHeisOutputPath.setText(path) | |
4036 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
4039 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
4037 | if value == None: |
|
4040 | if value == None: | |
4038 | self.specHeisOutputblocksperfile.clear() |
|
4041 | self.specHeisOutputblocksperfile.clear() | |
4039 | else: |
|
4042 | else: | |
4040 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
4043 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
4041 | blocksperfile = str(value) |
|
4044 | blocksperfile = str(value) | |
4042 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
4045 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
4043 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
4046 | value = opObj.getParameterObj(parameterName='metadatafile') | |
4044 | if value == None: |
|
4047 | if value == None: | |
4045 | self.specHeisOutputMetada.clear() |
|
4048 | self.specHeisOutputMetada.clear() | |
4046 | else: |
|
4049 | else: | |
4047 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
4050 | value = opObj.getParameterValue(parameterName='metadatafile') | |
4048 | metadata_file = str(value) |
|
4051 | metadata_file = str(value) | |
4049 | self.specHeisOutputMetada.setText(metadata_file) |
|
4052 | self.specHeisOutputMetada.setText(metadata_file) | |
4050 |
|
4053 | |||
4051 | return |
|
4054 | return | |
4052 |
|
4055 | |||
4053 | def __refreshCorrelationWindow(self, puObj): |
|
4056 | def __refreshCorrelationWindow(self, puObj): | |
4054 | pass |
|
4057 | pass | |
4055 |
|
4058 | |||
4056 | def refreshPUWindow(self, puObj): |
|
4059 | def refreshPUWindow(self, puObj): | |
4057 |
|
4060 | |||
4058 | if puObj.datatype == 'Voltage': |
|
4061 | if puObj.datatype == 'Voltage': | |
4059 | self.__refreshVoltageWindow(puObj) |
|
4062 | self.__refreshVoltageWindow(puObj) | |
4060 |
|
4063 | |||
4061 | if puObj.datatype == 'Spectra': |
|
4064 | if puObj.datatype == 'Spectra': | |
4062 | self.__refreshSpectraWindow(puObj) |
|
4065 | self.__refreshSpectraWindow(puObj) | |
4063 |
|
4066 | |||
4064 | if puObj.datatype == 'SpectraHeis': |
|
4067 | if puObj.datatype == 'SpectraHeis': | |
4065 | self.__refreshSpectraHeisWindow(puObj) |
|
4068 | self.__refreshSpectraHeisWindow(puObj) | |
4066 |
|
4069 | |||
4067 | def refreshProjectProperties(self, projectObjView): |
|
4070 | def refreshProjectProperties(self, projectObjView): | |
4068 |
|
4071 | |||
4069 | propertyBuffObj = PropertyBuffer() |
|
4072 | propertyBuffObj = PropertyBuffer() | |
4070 | name = projectObjView.name |
|
4073 | name = projectObjView.name | |
4071 |
|
4074 | |||
4072 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
4075 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
4073 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
4076 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
4074 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
4077 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
4075 |
|
4078 | |||
4076 | readUnitObj = projectObjView.getReadUnitObj() |
|
4079 | readUnitObj = projectObjView.getReadUnitObj() | |
4077 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
4080 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
4078 |
|
4081 | |||
4079 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
4082 | for thisParmObj in runOperationObj.getParameterObjList(): | |
4080 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
4083 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
4081 |
|
4084 | |||
4082 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
4085 | propertiesModel = propertyBuffObj.getPropertyModel() | |
4083 |
|
4086 | |||
4084 | self.treeProjectProperties.setModel(propertiesModel) |
|
4087 | self.treeProjectProperties.setModel(propertiesModel) | |
4085 | self.treeProjectProperties.expandAll() |
|
4088 | self.treeProjectProperties.expandAll() | |
4086 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4089 | self.treeProjectProperties.resizeColumnToContents(0) | |
4087 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4090 | self.treeProjectProperties.resizeColumnToContents(1) | |
4088 |
|
4091 | |||
4089 | def refreshPUProperties(self, puObjView): |
|
4092 | def refreshPUProperties(self, puObjView): | |
4090 |
|
4093 | |||
4091 | ############ FTP CONFIG ################################ |
|
4094 | ############ FTP CONFIG ################################ | |
4092 | #Deleting FTP Conf. This processing unit have not got any |
|
4095 | #Deleting FTP Conf. This processing unit have not got any | |
4093 | #FTP configuration by default |
|
4096 | #FTP configuration by default | |
4094 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
4097 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
4095 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
4098 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
4096 | ######################################################## |
|
4099 | ######################################################## | |
4097 |
|
4100 | |||
4098 | propertyBuffObj = PropertyBuffer() |
|
4101 | propertyBuffObj = PropertyBuffer() | |
4099 |
|
4102 | |||
4100 | for thisOp in puObjView.getOperationObjList(): |
|
4103 | for thisOp in puObjView.getOperationObjList(): | |
4101 |
|
4104 | |||
4102 | operationName = thisOp.name |
|
4105 | operationName = thisOp.name | |
4103 |
|
4106 | |||
4104 | if operationName == 'run': |
|
4107 | if operationName == 'run': | |
4105 | operationName = 'Properties' |
|
4108 | operationName = 'Properties' | |
4106 |
|
4109 | |||
4107 | else: |
|
4110 | else: | |
4108 | if not thisOp.getParameterObjList(): |
|
4111 | if not thisOp.getParameterObjList(): | |
4109 | propertyBuffObj.append(operationName, '--', '--') |
|
4112 | propertyBuffObj.append(operationName, '--', '--') | |
4110 | continue |
|
4113 | continue | |
4111 |
|
4114 | |||
4112 | for thisParmObj in thisOp.getParameterObjList(): |
|
4115 | for thisParmObj in thisOp.getParameterObjList(): | |
4113 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
4116 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
4114 |
|
4117 | |||
4115 | ############ FTP CONFIG ################################ |
|
4118 | ############ FTP CONFIG ################################ | |
4116 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
4119 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
4117 | value = thisParmObj.getValue() |
|
4120 | value = thisParmObj.getValue() | |
4118 | self.temporalFTP.ftp_wei = value |
|
4121 | self.temporalFTP.ftp_wei = value | |
4119 |
|
4122 | |||
4120 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
4123 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
4121 | value = thisParmObj.getValue() |
|
4124 | value = thisParmObj.getValue() | |
4122 | self.temporalFTP.exp_code = value |
|
4125 | self.temporalFTP.exp_code = value | |
4123 |
|
4126 | |||
4124 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
4127 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
4125 | value = thisParmObj.getValue() |
|
4128 | value = thisParmObj.getValue() | |
4126 | self.temporalFTP.sub_exp_code = value |
|
4129 | self.temporalFTP.sub_exp_code = value | |
4127 |
|
4130 | |||
4128 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
4131 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
4129 | value = thisParmObj.getValue() |
|
4132 | value = thisParmObj.getValue() | |
4130 | self.temporalFTP.plot_pos = value |
|
4133 | self.temporalFTP.plot_pos = value | |
4131 |
|
4134 | |||
4132 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
4135 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
4133 | figpathObj = thisOp.getParameterObj('figpath') |
|
4136 | figpathObj = thisOp.getParameterObj('figpath') | |
4134 | if figpathObj: |
|
4137 | if figpathObj: | |
4135 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
4138 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
4136 |
|
4139 | |||
4137 | ######################################################## |
|
4140 | ######################################################## | |
4138 |
|
4141 | |||
4139 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
4142 | propertiesModel = propertyBuffObj.getPropertyModel() | |
4140 |
|
4143 | |||
4141 | self.treeProjectProperties.setModel(propertiesModel) |
|
4144 | self.treeProjectProperties.setModel(propertiesModel) | |
4142 | self.treeProjectProperties.expandAll() |
|
4145 | self.treeProjectProperties.expandAll() | |
4143 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4146 | self.treeProjectProperties.resizeColumnToContents(0) | |
4144 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4147 | self.treeProjectProperties.resizeColumnToContents(1) | |
4145 |
|
4148 | |||
4146 | def refreshGraphicsId(self): |
|
4149 | def refreshGraphicsId(self): | |
4147 |
|
4150 | |||
4148 | projectObj = self.getSelectedProjectObj() |
|
4151 | projectObj = self.getSelectedProjectObj() | |
4149 |
|
4152 | |||
4150 | if not projectObj: |
|
4153 | if not projectObj: | |
4151 | return |
|
4154 | return | |
4152 |
|
4155 | |||
4153 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
4156 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
4154 |
|
4157 | |||
4155 | for opObj in puObj.getOperationObjList(): |
|
4158 | for opObj in puObj.getOperationObjList(): | |
4156 |
|
4159 | |||
4157 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
4160 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
4158 | continue |
|
4161 | continue | |
4159 |
|
4162 | |||
4160 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4163 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4161 |
|
4164 | |||
4162 | def on_click(self, index): |
|
4165 | def on_click(self, index): | |
4163 |
|
4166 | |||
4164 | self._disable_save_button() |
|
4167 | self._disable_save_button() | |
4165 | self._disable_play_button() |
|
4168 | self._disable_play_button() | |
4166 |
|
4169 | |||
4167 | self.console.clear() |
|
4170 | self.console.clear() | |
4168 |
|
4171 | |||
4169 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4172 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4170 |
|
4173 | |||
4171 | projectObjView = self.getSelectedProjectObj() |
|
4174 | projectObjView = self.getSelectedProjectObj() | |
4172 |
|
4175 | |||
4173 | if not projectObjView: |
|
4176 | if not projectObjView: | |
4174 | return |
|
4177 | return | |
4175 |
|
4178 | |||
4176 | self.create = False |
|
4179 | self.create = False | |
4177 | selectedObjView = self.getSelectedItemObj() |
|
4180 | selectedObjView = self.getSelectedItemObj() | |
4178 |
|
4181 | |||
4179 | self.refreshProjectWindow(projectObjView) |
|
4182 | self.refreshProjectWindow(projectObjView) | |
4180 | self.refreshProjectProperties(projectObjView) |
|
4183 | self.refreshProjectProperties(projectObjView) | |
4181 |
|
4184 | |||
4182 | #A project has been selected |
|
4185 | #A project has been selected | |
4183 | if projectObjView == selectedObjView: |
|
4186 | if projectObjView == selectedObjView: | |
4184 |
|
4187 | |||
4185 | self.tabProject.setEnabled(True) |
|
4188 | self.tabProject.setEnabled(True) | |
4186 | self.tabVoltage.setEnabled(False) |
|
4189 | self.tabVoltage.setEnabled(False) | |
4187 | self.tabSpectra.setEnabled(False) |
|
4190 | self.tabSpectra.setEnabled(False) | |
4188 | self.tabCorrelation.setEnabled(False) |
|
4191 | self.tabCorrelation.setEnabled(False) | |
4189 | self.tabSpectraHeis.setEnabled(False) |
|
4192 | self.tabSpectraHeis.setEnabled(False) | |
4190 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4193 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4191 |
|
4194 | |||
4192 | if self.dateList: |
|
4195 | if self.dateList: | |
4193 | self._enable_save_button() |
|
4196 | self._enable_save_button() | |
4194 | self._enable_play_button() |
|
4197 | self._enable_play_button() | |
4195 |
|
4198 | |||
4196 | return |
|
4199 | return | |
4197 |
|
4200 | |||
4198 | #A processing unit has been selected |
|
4201 | #A processing unit has been selected | |
4199 | voltEnable = False |
|
4202 | voltEnable = False | |
4200 | specEnable = False |
|
4203 | specEnable = False | |
4201 | corrEnable = False |
|
4204 | corrEnable = False | |
4202 | specHeisEnable = False |
|
4205 | specHeisEnable = False | |
4203 | tabSelected = self.tabProject |
|
4206 | tabSelected = self.tabProject | |
4204 |
|
4207 | |||
4205 | puObj = selectedObjView |
|
4208 | puObj = selectedObjView | |
4206 |
|
4209 | |||
4207 | self.refreshPUWindow(puObj) |
|
4210 | self.refreshPUWindow(puObj) | |
4208 | self.refreshPUProperties(puObj) |
|
4211 | self.refreshPUProperties(puObj) | |
4209 | self.showtabPUCreated(puObj.datatype) |
|
4212 | self.showtabPUCreated(puObj.datatype) | |
4210 |
|
4213 | |||
4211 | if self.dateList: |
|
4214 | if self.dateList: | |
4212 | self._enable_save_button() |
|
4215 | self._enable_save_button() | |
4213 | self._enable_play_button() |
|
4216 | self._enable_play_button() | |
4214 |
|
4217 | |||
4215 | def on_right_click(self, pos): |
|
4218 | def on_right_click(self, pos): | |
4216 |
|
4219 | |||
4217 | self.menu = QtGui.QMenu() |
|
4220 | self.menu = QtGui.QMenu() | |
4218 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4221 | quitAction0 = self.menu.addAction("Create a New Project") | |
4219 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4222 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4220 | quitAction2 = self.menu.addAction("Delete Item") |
|
4223 | quitAction2 = self.menu.addAction("Delete Item") | |
4221 | quitAction3 = self.menu.addAction("Quit") |
|
4224 | quitAction3 = self.menu.addAction("Quit") | |
4222 |
|
4225 | |||
4223 | if len(self.__itemTreeDict) == 0: |
|
4226 | if len(self.__itemTreeDict) == 0: | |
4224 | quitAction2.setEnabled(False) |
|
4227 | quitAction2.setEnabled(False) | |
4225 | else: |
|
4228 | else: | |
4226 | quitAction2.setEnabled(True) |
|
4229 | quitAction2.setEnabled(True) | |
4227 |
|
4230 | |||
4228 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4231 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4229 |
|
4232 | |||
4230 | if action == quitAction0: |
|
4233 | if action == quitAction0: | |
4231 | self. setInputsProject_View() |
|
4234 | self. setInputsProject_View() | |
4232 | self.create = True |
|
4235 | self.create = True | |
4233 |
|
4236 | |||
4234 | if action == quitAction1: |
|
4237 | if action == quitAction1: | |
4235 | if len(self.__projectObjDict) == 0: |
|
4238 | if len(self.__projectObjDict) == 0: | |
4236 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4239 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4237 | self.console.clear() |
|
4240 | self.console.clear() | |
4238 | self.console.append(outputstr) |
|
4241 | self.console.append(outputstr) | |
4239 | return 0 |
|
4242 | return 0 | |
4240 | else: |
|
4243 | else: | |
4241 | self.addPUWindow() |
|
4244 | self.addPUWindow() | |
4242 | self.console.clear() |
|
4245 | self.console.clear() | |
4243 | self.console.append("Please, Choose the type of Processing Unit") |
|
4246 | self.console.append("Please, Choose the type of Processing Unit") | |
4244 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4247 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4245 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4248 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4246 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4249 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4247 |
|
4250 | |||
4248 | if action == quitAction2: |
|
4251 | if action == quitAction2: | |
4249 | index = self.selectedItemTree |
|
4252 | index = self.selectedItemTree | |
4250 | try: |
|
4253 | try: | |
4251 | index.parent() |
|
4254 | index.parent() | |
4252 | except: |
|
4255 | except: | |
4253 | self.console.append('Please, first at all select a Project or Processing Unit') |
|
4256 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4254 | return 0 |
|
4257 | return 0 | |
4255 | # print index.parent(),index |
|
4258 | # print index.parent(),index | |
4256 | if index.parent() == None: |
|
4259 | if index.parent() == None: | |
4257 | self.projectExplorerModel.removeRow(index.row()) |
|
4260 | self.projectExplorerModel.removeRow(index.row()) | |
4258 | else: |
|
4261 | else: | |
4259 | index.parent().removeRow(index.row()) |
|
4262 | index.parent().removeRow(index.row()) | |
4260 | self.removeItemTreeFromProject() |
|
4263 | self.removeItemTreeFromProject() | |
4261 | self.console.clear() |
|
4264 | self.console.clear() | |
4262 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4265 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4263 | # print i.row() |
|
4266 | # print i.row() | |
4264 |
|
4267 | |||
4265 | if action == quitAction3: |
|
4268 | if action == quitAction3: | |
4266 | self.close() |
|
4269 | self.close() | |
4267 | return 0 |
|
4270 | return 0 | |
4268 |
|
4271 | |||
4269 | def createProjectView(self, id): |
|
4272 | def createProjectView(self, id): | |
4270 |
|
4273 | |||
4271 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4274 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4272 | id = str(id) |
|
4275 | id = str(id) | |
4273 | projectParms = self.__getParmsFromProjectWindow() |
|
4276 | projectParms = self.__getParmsFromProjectWindow() | |
4274 |
|
4277 | |||
4275 | if not projectParms.isValid(): |
|
4278 | if not projectParms.isValid(): | |
4276 | return None |
|
4279 | return None | |
4277 |
|
4280 | |||
4278 | projectObjView = Project() |
|
4281 | projectObjView = Project() | |
4279 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4282 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4280 |
|
4283 | |||
4281 | self.__projectObjDict[id] = projectObjView |
|
4284 | self.__projectObjDict[id] = projectObjView | |
4282 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4285 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4283 |
|
4286 | |||
4284 | return projectObjView |
|
4287 | return projectObjView | |
4285 |
|
4288 | |||
4286 | def updateProjectView(self): |
|
4289 | def updateProjectView(self): | |
4287 |
|
4290 | |||
4288 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4291 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4289 |
|
4292 | |||
4290 | projectParms = self.__getParmsFromProjectWindow() |
|
4293 | projectParms = self.__getParmsFromProjectWindow() | |
4291 |
|
4294 | |||
4292 | if not projectParms.isValid(): |
|
4295 | if not projectParms.isValid(): | |
4293 | return None |
|
4296 | return None | |
4294 |
|
4297 | |||
4295 | projectObjView = self.getSelectedProjectObj() |
|
4298 | projectObjView = self.getSelectedProjectObj() | |
4296 |
|
4299 | |||
4297 | if not projectObjView: |
|
4300 | if not projectObjView: | |
4298 | self.console.append("Please select a project before update it") |
|
4301 | self.console.append("Please select a project before update it") | |
4299 | return None |
|
4302 | return None | |
4300 |
|
4303 | |||
4301 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4304 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4302 |
|
4305 | |||
4303 | return projectObjView |
|
4306 | return projectObjView | |
4304 |
|
4307 | |||
4305 | def createReadUnitView(self, projectObjView, idReadUnit=None): |
|
4308 | def createReadUnitView(self, projectObjView, idReadUnit=None): | |
4306 |
|
4309 | |||
4307 | projectParms = self.__getParmsFromProjectWindow() |
|
4310 | projectParms = self.__getParmsFromProjectWindow() | |
4308 |
|
4311 | |||
4309 | if not projectParms.isValid(): |
|
4312 | if not projectParms.isValid(): | |
4310 | return None |
|
4313 | return None | |
4311 |
|
4314 | |||
4312 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4315 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4313 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4316 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4314 | datatype=projectParms.datatype, |
|
4317 | datatype=projectParms.datatype, | |
4315 | path=projectParms.dpath, |
|
4318 | path=projectParms.dpath, | |
4316 | startDate=projectParms.startDate, |
|
4319 | startDate=projectParms.startDate, | |
4317 | endDate=projectParms.endDate, |
|
4320 | endDate=projectParms.endDate, | |
4318 | startTime=projectParms.startTime, |
|
4321 | startTime=projectParms.startTime, | |
4319 | endTime=projectParms.endTime, |
|
4322 | endTime=projectParms.endTime, | |
4320 | online=projectParms.online, |
|
4323 | online=projectParms.online, | |
4321 | walk=projectParms.walk |
|
4324 | walk=projectParms.walk | |
4322 | ) |
|
4325 | ) | |
4323 |
|
4326 | |||
4324 | if projectParms.set: |
|
4327 | if projectParms.set: | |
4325 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4328 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4326 |
|
4329 | |||
4327 | if projectParms.delay: |
|
4330 | if projectParms.delay: | |
4328 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4331 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4329 |
|
4332 | |||
4330 | if projectParms.expLabel: |
|
4333 | if projectParms.expLabel: | |
4331 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4334 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4332 |
|
4335 | |||
4333 | readUnitConfObj.addOperation(name="printInfo") |
|
4336 | readUnitConfObj.addOperation(name="printInfo") | |
4334 |
|
4337 | |||
4335 | if projectParms.datatype == "USRP": |
|
4338 | if projectParms.datatype == "USRP": | |
4336 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4339 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4337 | datatype=projectParms.datatype, |
|
4340 | datatype=projectParms.datatype, | |
4338 | path=projectParms.dpath, |
|
4341 | path=projectParms.dpath, | |
4339 | startDate=projectParms.startDate, |
|
4342 | startDate=projectParms.startDate, | |
4340 | endDate=projectParms.endDate, |
|
4343 | endDate=projectParms.endDate, | |
4341 | startTime=projectParms.startTime, |
|
4344 | startTime=projectParms.startTime, | |
4342 | endTime=projectParms.endTime, |
|
4345 | endTime=projectParms.endTime, | |
4343 | online=projectParms.online, |
|
4346 | online=projectParms.online, | |
4344 | ippKm=projectParms.ippKm |
|
4347 | ippKm=projectParms.ippKm | |
4345 | ) |
|
4348 | ) | |
4346 |
|
4349 | |||
4347 | if projectParms.delay: |
|
4350 | if projectParms.delay: | |
4348 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4351 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4349 |
|
4352 | |||
4350 | return readUnitConfObj |
|
4353 | return readUnitConfObj | |
4351 |
|
4354 | |||
4352 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4355 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4353 |
|
4356 | |||
4354 | projectObjView.removeProcUnit(idReadUnit) |
|
4357 | projectObjView.removeProcUnit(idReadUnit) | |
4355 |
|
4358 | |||
4356 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) |
|
4359 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) | |
4357 |
|
4360 | |||
4358 | return readUnitConfObj |
|
4361 | return readUnitConfObj | |
4359 |
|
4362 | |||
4360 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4363 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4361 |
|
4364 | |||
4362 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4365 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4363 |
|
4366 | |||
4364 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4367 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4365 |
|
4368 | |||
4366 | return procUnitConfObj |
|
4369 | return procUnitConfObj | |
4367 |
|
4370 | |||
4368 | def updateProcUnitView(self, id): |
|
4371 | def updateProcUnitView(self, id): | |
4369 |
|
4372 | |||
4370 | pass |
|
4373 | pass | |
4371 |
|
4374 | |||
4372 | def addPUWindow(self): |
|
4375 | def addPUWindow(self): | |
4373 |
|
4376 | |||
4374 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4377 | self.configUPWindowObj = UnitProcessWindow(self) | |
4375 | fatherObj = self.getSelectedItemObj() |
|
4378 | fatherObj = self.getSelectedItemObj() | |
4376 | try: |
|
4379 | try: | |
4377 | fatherObj.getElementName() |
|
4380 | fatherObj.getElementName() | |
4378 | except: |
|
4381 | except: | |
4379 | self.console.append("First left click on Project or Processing Unit") |
|
4382 | self.console.append("First left click on Project or Processing Unit") | |
4380 | return 0 |
|
4383 | return 0 | |
4381 |
|
4384 | |||
4382 | if fatherObj.getElementName() == 'Project': |
|
4385 | if fatherObj.getElementName() == 'Project': | |
4383 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4386 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4384 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4387 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4385 |
|
4388 | |||
4386 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4389 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4387 | self.configUPWindowObj.loadTotalList() |
|
4390 | self.configUPWindowObj.loadTotalList() | |
4388 | self.configUPWindowObj.show() |
|
4391 | self.configUPWindowObj.show() | |
4389 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4392 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4390 |
|
4393 | |||
4391 | def createPUWindow(self): |
|
4394 | def createPUWindow(self): | |
4392 |
|
4395 | |||
4393 | if not self.configUPWindowObj.create: |
|
4396 | if not self.configUPWindowObj.create: | |
4394 | return |
|
4397 | return | |
4395 |
|
4398 | |||
4396 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4399 | fatherObj = self.configUPWindowObj.getFromWindow | |
4397 | datatype = self.configUPWindowObj.typeofUP |
|
4400 | datatype = self.configUPWindowObj.typeofUP | |
4398 |
|
4401 | |||
4399 | if fatherObj.getElementName() == 'Project': |
|
4402 | if fatherObj.getElementName() == 'Project': | |
4400 | inputId = fatherObj.getReadUnitId() |
|
4403 | inputId = fatherObj.getReadUnitId() | |
4401 | projectObjView = fatherObj |
|
4404 | projectObjView = fatherObj | |
4402 | else: |
|
4405 | else: | |
4403 | inputId = fatherObj.getId() |
|
4406 | inputId = fatherObj.getId() | |
4404 | projectObjView = self.getSelectedProjectObj() |
|
4407 | projectObjView = self.getSelectedProjectObj() | |
4405 |
|
4408 | |||
4406 | if not projectObjView: |
|
4409 | if not projectObjView: | |
4407 | return |
|
4410 | return | |
4408 |
|
4411 | |||
4409 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4412 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4410 |
|
4413 | |||
4411 | self.addPU2ProjectExplorer(puObj) |
|
4414 | self.addPU2ProjectExplorer(puObj) | |
4412 |
|
4415 | |||
4413 | self.showtabPUCreated(datatype) |
|
4416 | self.showtabPUCreated(datatype) | |
4414 |
|
4417 | |||
4415 | self.clearPUWindow(datatype) |
|
4418 | self.clearPUWindow(datatype) | |
4416 |
|
4419 | |||
4417 | self.showPUinitView() |
|
4420 | self.showPUinitView() | |
4418 |
|
4421 | |||
4419 | def addFTPConf2Operation(self, puObj, opObj): |
|
4422 | def addFTPConf2Operation(self, puObj, opObj): | |
4420 |
|
4423 | |||
4421 | if not self.temporalFTP.create: |
|
4424 | if not self.temporalFTP.create: | |
4422 | self.temporalFTP.setwithoutconfiguration() |
|
4425 | self.temporalFTP.setwithoutconfiguration() | |
4423 |
|
4426 | |||
4424 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4427 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4425 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4428 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4426 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4429 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4427 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4430 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4428 |
|
4431 | |||
4429 | if self.temporalFTP.ftp_wei: |
|
4432 | if self.temporalFTP.ftp_wei: | |
4430 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4433 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4431 | if self.temporalFTP.exp_code: |
|
4434 | if self.temporalFTP.exp_code: | |
4432 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4435 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4433 | if self.temporalFTP.sub_exp_code: |
|
4436 | if self.temporalFTP.sub_exp_code: | |
4434 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4437 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4435 | if self.temporalFTP.plot_pos: |
|
4438 | if self.temporalFTP.plot_pos: | |
4436 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4439 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4437 |
|
4440 | |||
4438 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4441 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4439 | # |
|
4442 | # | |
4440 | # puId = None |
|
4443 | # puId = None | |
4441 | # puObj = None |
|
4444 | # puObj = None | |
4442 | # |
|
4445 | # | |
4443 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4446 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4444 | # |
|
4447 | # | |
4445 | # if not thisPuObj.name == "SendToServer": |
|
4448 | # if not thisPuObj.name == "SendToServer": | |
4446 | # continue |
|
4449 | # continue | |
4447 | # |
|
4450 | # | |
4448 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4451 | # opObj = thisPuObj.getOperationObj(name='run') | |
4449 | # |
|
4452 | # | |
4450 | # parmObj = opObj.getParameterObj('localfolder') |
|
4453 | # parmObj = opObj.getParameterObj('localfolder') | |
4451 | # |
|
4454 | # | |
4452 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4455 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4453 | # if not parmObj: |
|
4456 | # if not parmObj: | |
4454 | # projectObj.removeProcUnit(thisPuId) |
|
4457 | # projectObj.removeProcUnit(thisPuId) | |
4455 | # continue |
|
4458 | # continue | |
4456 | # |
|
4459 | # | |
4457 | # thisLocalfolder = parmObj.getValue() |
|
4460 | # thisLocalfolder = parmObj.getValue() | |
4458 | # |
|
4461 | # | |
4459 | # if localfolder != thisLocalfolder: |
|
4462 | # if localfolder != thisLocalfolder: | |
4460 | # continue |
|
4463 | # continue | |
4461 | # |
|
4464 | # | |
4462 | # puId = thisPuId |
|
4465 | # puId = thisPuId | |
4463 | # puObj = thisPuObj |
|
4466 | # puObj = thisPuObj | |
4464 | # break |
|
4467 | # break | |
4465 | # |
|
4468 | # | |
4466 | # return puObj |
|
4469 | # return puObj | |
4467 |
|
4470 | |||
4468 | def createFTPProcUnitView(self): |
|
4471 | def createFTPProcUnitView(self): | |
4469 |
|
4472 | |||
4470 | if not self.temporalFTP.create: |
|
4473 | if not self.temporalFTP.create: | |
4471 | self.temporalFTP.setwithoutconfiguration() |
|
4474 | self.temporalFTP.setwithoutconfiguration() | |
4472 |
|
4475 | |||
4473 | projectObj = self.getSelectedProjectObj() |
|
4476 | projectObj = self.getSelectedProjectObj() | |
4474 |
|
4477 | |||
4475 | if not projectObj: |
|
4478 | if not projectObj: | |
4476 | return |
|
4479 | return | |
4477 |
|
4480 | |||
4478 | self.removeAllFTPProcUnitView(projectObj) |
|
4481 | self.removeAllFTPProcUnitView(projectObj) | |
4479 |
|
4482 | |||
4480 | if not self.__puLocalFolder2FTP: |
|
4483 | if not self.__puLocalFolder2FTP: | |
4481 | return |
|
4484 | return | |
4482 |
|
4485 | |||
4483 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4486 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4484 |
|
4487 | |||
4485 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4488 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4486 |
|
4489 | |||
4487 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4490 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4488 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4491 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4489 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4492 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4490 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4493 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4491 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4494 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4492 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4495 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4493 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4496 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4494 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4497 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4495 |
|
4498 | |||
4496 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4499 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4497 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4500 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4498 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4501 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4499 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4502 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4500 |
|
4503 | |||
4501 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4504 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4502 |
|
4505 | |||
4503 | def removeAllFTPProcUnitView(self, projectObj): |
|
4506 | def removeAllFTPProcUnitView(self, projectObj): | |
4504 |
|
4507 | |||
4505 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4508 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4506 |
|
4509 | |||
4507 | if not thisPuObj.name == "SendToServer": |
|
4510 | if not thisPuObj.name == "SendToServer": | |
4508 | continue |
|
4511 | continue | |
4509 |
|
4512 | |||
4510 | projectObj.removeProcUnit(thisPuId) |
|
4513 | projectObj.removeProcUnit(thisPuId) | |
4511 |
|
4514 | |||
4512 | if thisPuId not in self.__puObjDict.keys(): |
|
4515 | if thisPuId not in self.__puObjDict.keys(): | |
4513 | continue |
|
4516 | continue | |
4514 |
|
4517 | |||
4515 | self.__puObjDict.pop(thisPuId) |
|
4518 | self.__puObjDict.pop(thisPuId) | |
4516 |
|
4519 | |||
4517 | def showPUinitView(self): |
|
4520 | def showPUinitView(self): | |
4518 |
|
4521 | |||
4519 | self.propertiesModel = TreeModel() |
|
4522 | self.propertiesModel = TreeModel() | |
4520 | self.propertiesModel.initPUVoltageView() |
|
4523 | self.propertiesModel.initPUVoltageView() | |
4521 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4524 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4522 | self.treeProjectProperties.expandAll() |
|
4525 | self.treeProjectProperties.expandAll() | |
4523 | self.treeProjectProperties.allColumnsShowFocus() |
|
4526 | self.treeProjectProperties.allColumnsShowFocus() | |
4524 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4527 | self.treeProjectProperties.resizeColumnToContents(1) | |
4525 |
|
4528 | |||
4526 | def saveFTPFromOpObj(self, operationObj): |
|
4529 | def saveFTPFromOpObj(self, operationObj): | |
4527 |
|
4530 | |||
4528 | if operationObj.name != "SendByFTP": |
|
4531 | if operationObj.name != "SendByFTP": | |
4529 | return |
|
4532 | return | |
4530 |
|
4533 | |||
4531 | server = operationObj.getParameterValue("server") |
|
4534 | server = operationObj.getParameterValue("server") | |
4532 | username = operationObj.getParameterValue("username") |
|
4535 | username = operationObj.getParameterValue("username") | |
4533 | password = operationObj.getParameterValue("password") |
|
4536 | password = operationObj.getParameterValue("password") | |
4534 | localfolder = operationObj.getParameterValue("localfolder") |
|
4537 | localfolder = operationObj.getParameterValue("localfolder") | |
4535 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4538 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4536 | ext = operationObj.getParameterValue("ext") |
|
4539 | ext = operationObj.getParameterValue("ext") | |
4537 | period = operationObj.getParameterValue("period") |
|
4540 | period = operationObj.getParameterValue("period") | |
4538 |
|
4541 | |||
4539 | self.temporalFTP.save(server=server, |
|
4542 | self.temporalFTP.save(server=server, | |
4540 | remotefolder=remotefolder, |
|
4543 | remotefolder=remotefolder, | |
4541 | username=username, |
|
4544 | username=username, | |
4542 | password=password, |
|
4545 | password=password, | |
4543 | localfolder=localfolder, |
|
4546 | localfolder=localfolder, | |
4544 | extension=ext) |
|
4547 | extension=ext) | |
4545 |
|
4548 | |||
4546 | return |
|
4549 | return | |
4547 |
|
4550 | |||
4548 | def saveFTPFromProcUnitObj(self, puObj): |
|
4551 | def saveFTPFromProcUnitObj(self, puObj): | |
4549 |
|
4552 | |||
4550 | opObj = puObj.getOperationObj(name="run") |
|
4553 | opObj = puObj.getOperationObj(name="run") | |
4551 |
|
4554 | |||
4552 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4555 | parmObj = opObj.getParameterObj(parameterName="server") | |
4553 | if parmObj == None: |
|
4556 | if parmObj == None: | |
4554 | server = 'jro-app.igp.gob.pe' |
|
4557 | server = 'jro-app.igp.gob.pe' | |
4555 | else: |
|
4558 | else: | |
4556 | server = parmObj.getValue() |
|
4559 | server = parmObj.getValue() | |
4557 |
|
4560 | |||
4558 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4561 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4559 | if parmObj == None: |
|
4562 | if parmObj == None: | |
4560 | remotefolder = '/home/wmaster/graficos' |
|
4563 | remotefolder = '/home/wmaster/graficos' | |
4561 | else: |
|
4564 | else: | |
4562 | remotefolder = parmObj.getValue() |
|
4565 | remotefolder = parmObj.getValue() | |
4563 |
|
4566 | |||
4564 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4567 | parmObj = opObj.getParameterObj(parameterName="username") | |
4565 | if parmObj == None: |
|
4568 | if parmObj == None: | |
4566 | username = 'wmaster' |
|
4569 | username = 'wmaster' | |
4567 | else: |
|
4570 | else: | |
4568 | username = parmObj.getValue() |
|
4571 | username = parmObj.getValue() | |
4569 |
|
4572 | |||
4570 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4573 | parmObj = opObj.getParameterObj(parameterName="password") | |
4571 | if parmObj == None: |
|
4574 | if parmObj == None: | |
4572 | password = 'mst2010vhf' |
|
4575 | password = 'mst2010vhf' | |
4573 | else: |
|
4576 | else: | |
4574 | password = parmObj.getValue() |
|
4577 | password = parmObj.getValue() | |
4575 |
|
4578 | |||
4576 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4579 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4577 | if parmObj == None: |
|
4580 | if parmObj == None: | |
4578 | ftp_wei = 0 |
|
4581 | ftp_wei = 0 | |
4579 | else: |
|
4582 | else: | |
4580 | ftp_wei = parmObj.getValue() |
|
4583 | ftp_wei = parmObj.getValue() | |
4581 |
|
4584 | |||
4582 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4585 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4583 | if parmObj == None: |
|
4586 | if parmObj == None: | |
4584 | exp_code = 0 |
|
4587 | exp_code = 0 | |
4585 | else: |
|
4588 | else: | |
4586 | exp_code = parmObj.getValue() |
|
4589 | exp_code = parmObj.getValue() | |
4587 |
|
4590 | |||
4588 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4591 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4589 | if parmObj == None: |
|
4592 | if parmObj == None: | |
4590 | sub_exp_code = 0 |
|
4593 | sub_exp_code = 0 | |
4591 | else: |
|
4594 | else: | |
4592 | sub_exp_code = parmObj.getValue() |
|
4595 | sub_exp_code = parmObj.getValue() | |
4593 |
|
4596 | |||
4594 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4597 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4595 | if parmObj == None: |
|
4598 | if parmObj == None: | |
4596 | plot_pos = 0 |
|
4599 | plot_pos = 0 | |
4597 | else: |
|
4600 | else: | |
4598 | plot_pos = parmObj.getValue() |
|
4601 | plot_pos = parmObj.getValue() | |
4599 |
|
4602 | |||
4600 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4603 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4601 | if parmObj == None: |
|
4604 | if parmObj == None: | |
4602 | localfolder = None |
|
4605 | localfolder = None | |
4603 | else: |
|
4606 | else: | |
4604 | localfolder = parmObj.getValue() |
|
4607 | localfolder = parmObj.getValue() | |
4605 |
|
4608 | |||
4606 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4609 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4607 | if parmObj == None: |
|
4610 | if parmObj == None: | |
4608 | extension = '.png' |
|
4611 | extension = '.png' | |
4609 | else: |
|
4612 | else: | |
4610 | extension = parmObj.getValue() |
|
4613 | extension = parmObj.getValue() | |
4611 |
|
4614 | |||
4612 | self.temporalFTP.save(server=server, |
|
4615 | self.temporalFTP.save(server=server, | |
4613 | remotefolder=remotefolder, |
|
4616 | remotefolder=remotefolder, | |
4614 | username=username, |
|
4617 | username=username, | |
4615 | password=password, |
|
4618 | password=password, | |
4616 | ftp_wei=ftp_wei, |
|
4619 | ftp_wei=ftp_wei, | |
4617 | exp_code=exp_code, |
|
4620 | exp_code=exp_code, | |
4618 | sub_exp_code=sub_exp_code, |
|
4621 | sub_exp_code=sub_exp_code, | |
4619 | plot_pos=plot_pos, |
|
4622 | plot_pos=plot_pos, | |
4620 | localfolder=localfolder, |
|
4623 | localfolder=localfolder, | |
4621 | extension=extension) |
|
4624 | extension=extension) | |
4622 |
|
4625 | |||
4623 | def addProject2ProjectExplorer(self, id, name): |
|
4626 | def addProject2ProjectExplorer(self, id, name): | |
4624 |
|
4627 | |||
4625 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4628 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4626 |
|
4629 | |||
4627 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4630 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4628 | parentItem.appendRow(itemTree) |
|
4631 | parentItem.appendRow(itemTree) | |
4629 |
|
4632 | |||
4630 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4633 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4631 |
|
4634 | |||
4632 | self.selectedItemTree = itemTree |
|
4635 | self.selectedItemTree = itemTree | |
4633 |
|
4636 | |||
4634 | self.__itemTreeDict[id] = itemTree |
|
4637 | self.__itemTreeDict[id] = itemTree | |
4635 |
|
4638 | |||
4636 | def addPU2ProjectExplorer(self, puObj): |
|
4639 | def addPU2ProjectExplorer(self, puObj): | |
4637 |
|
4640 | |||
4638 | id, name = puObj.id, puObj.datatype |
|
4641 | id, name = puObj.id, puObj.datatype | |
4639 |
|
4642 | |||
4640 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4643 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4641 |
|
4644 | |||
4642 | parentItem = self.selectedItemTree |
|
4645 | parentItem = self.selectedItemTree | |
4643 | parentItem.appendRow(itemTree) |
|
4646 | parentItem.appendRow(itemTree) | |
4644 | self.projectExplorerTree.expandAll() |
|
4647 | self.projectExplorerTree.expandAll() | |
4645 |
|
4648 | |||
4646 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4649 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4647 |
|
4650 | |||
4648 | self.selectedItemTree = itemTree |
|
4651 | self.selectedItemTree = itemTree | |
4649 |
|
4652 | |||
4650 | self.__itemTreeDict[id] = itemTree |
|
4653 | self.__itemTreeDict[id] = itemTree | |
4651 |
|
4654 | |||
4652 | def addPU2PELoadXML(self, puObj): |
|
4655 | def addPU2PELoadXML(self, puObj): | |
4653 |
|
4656 | |||
4654 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4657 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4655 |
|
4658 | |||
4656 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4659 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4657 |
|
4660 | |||
4658 | if self.__itemTreeDict.has_key(inputId): |
|
4661 | if self.__itemTreeDict.has_key(inputId): | |
4659 | parentItem = self.__itemTreeDict[inputId] |
|
4662 | parentItem = self.__itemTreeDict[inputId] | |
4660 | else: |
|
4663 | else: | |
4661 | #If parent is a Reader object |
|
4664 | #If parent is a Reader object | |
4662 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4665 | parentItem = self.__itemTreeDict[id[:-1]] | |
4663 |
|
4666 | |||
4664 | parentItem.appendRow(itemTree) |
|
4667 | parentItem.appendRow(itemTree) | |
4665 | self.projectExplorerTree.expandAll() |
|
4668 | self.projectExplorerTree.expandAll() | |
4666 | parentItem = itemTree |
|
4669 | parentItem = itemTree | |
4667 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4670 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4668 |
|
4671 | |||
4669 | self.__itemTreeDict[id] = itemTree |
|
4672 | self.__itemTreeDict[id] = itemTree | |
4670 | self.selectedItemTree = itemTree |
|
4673 | self.selectedItemTree = itemTree | |
4671 |
|
4674 | |||
4672 | def getSelectedProjectObj(self): |
|
4675 | def getSelectedProjectObj(self): | |
4673 | """ |
|
4676 | """ | |
4674 | Return the current project object selected. If a processing unit is |
|
4677 | Return the current project object selected. If a processing unit is | |
4675 | actually selected this function returns associated project. |
|
4678 | actually selected this function returns associated project. | |
4676 |
|
4679 | |||
4677 | None if any project or processing unit is selected |
|
4680 | None if any project or processing unit is selected | |
4678 | """ |
|
4681 | """ | |
4679 | for key in self.__itemTreeDict.keys(): |
|
4682 | for key in self.__itemTreeDict.keys(): | |
4680 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4683 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4681 | continue |
|
4684 | continue | |
4682 |
|
4685 | |||
4683 | if self.__projectObjDict.has_key(key): |
|
4686 | if self.__projectObjDict.has_key(key): | |
4684 | projectObj = self.__projectObjDict[key] |
|
4687 | projectObj = self.__projectObjDict[key] | |
4685 | return projectObj |
|
4688 | return projectObj | |
4686 |
|
4689 | |||
4687 | puObj = self.__puObjDict[key] |
|
4690 | puObj = self.__puObjDict[key] | |
4688 |
|
4691 | |||
4689 | if puObj.parentId == None: |
|
4692 | if puObj.parentId == None: | |
4690 | projectId = puObj.getId()[0] |
|
4693 | projectId = puObj.getId()[0] | |
4691 | else: |
|
4694 | else: | |
4692 | projectId = puObj.parentId |
|
4695 | projectId = puObj.parentId | |
4693 |
|
4696 | |||
4694 | projectObj = self.__projectObjDict[projectId] |
|
4697 | projectObj = self.__projectObjDict[projectId] | |
4695 | return projectObj |
|
4698 | return projectObj | |
4696 |
|
4699 | |||
4697 | return None |
|
4700 | return None | |
4698 |
|
4701 | |||
4699 | def getSelectedItemObj(self): |
|
4702 | def getSelectedItemObj(self): | |
4700 | """ |
|
4703 | """ | |
4701 | Return the current project or processing unit object selected |
|
4704 | Return the current project or processing unit object selected | |
4702 |
|
4705 | |||
4703 | None if any project or processing unit is selected |
|
4706 | None if any project or processing unit is selected | |
4704 | """ |
|
4707 | """ | |
4705 | for key in self.__itemTreeDict.keys(): |
|
4708 | for key in self.__itemTreeDict.keys(): | |
4706 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4709 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4707 | continue |
|
4710 | continue | |
4708 |
|
4711 | |||
4709 | if self.__projectObjDict.has_key(key) == True: |
|
4712 | if self.__projectObjDict.has_key(key) == True: | |
4710 | fatherObj = self.__projectObjDict[key] |
|
4713 | fatherObj = self.__projectObjDict[key] | |
4711 | else: |
|
4714 | else: | |
4712 | fatherObj = self.__puObjDict[key] |
|
4715 | fatherObj = self.__puObjDict[key] | |
4713 |
|
4716 | |||
4714 | return fatherObj |
|
4717 | return fatherObj | |
4715 |
|
4718 | |||
4716 | return None |
|
4719 | return None | |
4717 |
|
4720 | |||
4718 | def _WarningWindow(self, text, information): |
|
4721 | def _WarningWindow(self, text, information): | |
4719 |
|
4722 | |||
4720 | msgBox = QtGui.QMessageBox() |
|
4723 | msgBox = QtGui.QMessageBox() | |
4721 | msgBox.setText(text) |
|
4724 | msgBox.setText(text) | |
4722 | msgBox.setInformativeText(information) |
|
4725 | msgBox.setInformativeText(information) | |
4723 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4726 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4724 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4727 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4725 | ret = msgBox.exec_() |
|
4728 | ret = msgBox.exec_() | |
4726 |
|
4729 | |||
4727 | answer = False |
|
4730 | answer = False | |
4728 |
|
4731 | |||
4729 | if ret == QtGui.QMessageBox.Ok: |
|
4732 | if ret == QtGui.QMessageBox.Ok: | |
4730 | answer = True |
|
4733 | answer = True | |
4731 |
|
4734 | |||
4732 | return answer |
|
4735 | return answer | |
4733 |
|
4736 | |||
4734 | def __getNewProjectId(self): |
|
4737 | def __getNewProjectId(self): | |
4735 |
|
4738 | |||
4736 | loadProject = False |
|
4739 | loadProject = False | |
4737 |
|
4740 | |||
4738 | for thisId in range(1,10): |
|
4741 | for thisId in range(1,10): | |
4739 | newId = str(thisId) |
|
4742 | newId = str(thisId) | |
4740 | if newId in self.__projectObjDict.keys(): |
|
4743 | if newId in self.__projectObjDict.keys(): | |
4741 | continue |
|
4744 | continue | |
4742 |
|
4745 | |||
4743 | loadProject = True |
|
4746 | loadProject = True | |
4744 | projectId = newId |
|
4747 | projectId = newId | |
4745 | break |
|
4748 | break | |
4746 |
|
4749 | |||
4747 | if not loadProject: |
|
4750 | if not loadProject: | |
4748 | self.console.clear() |
|
4751 | self.console.clear() | |
4749 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4752 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4750 | return None |
|
4753 | return None | |
4751 |
|
4754 | |||
4752 | return projectId |
|
4755 | return projectId | |
4753 |
|
4756 | |||
4754 | def openProject(self): |
|
4757 | def openProject(self): | |
4755 |
|
4758 | |||
4756 | self._disable_save_button() |
|
4759 | self._disable_save_button() | |
4757 | self._disable_play_button() |
|
4760 | self._disable_play_button() | |
4758 |
|
4761 | |||
4759 | self.console.clear() |
|
4762 | self.console.clear() | |
4760 |
|
4763 | |||
4761 | self.frame_2.setEnabled(True) |
|
4764 | self.frame_2.setEnabled(True) | |
4762 |
|
4765 | |||
4763 | # print self.dir |
|
4766 | # print self.dir | |
4764 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4767 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4765 |
|
4768 | |||
4766 | projectObjLoad = Project() |
|
4769 | projectObjLoad = Project() | |
4767 |
|
4770 | |||
4768 | if not projectObjLoad.readXml(filename): |
|
4771 | if not projectObjLoad.readXml(filename): | |
4769 | self.console.append("The selected xml file could not be loaded ...") |
|
4772 | self.console.append("The selected xml file could not be loaded ...") | |
4770 | return 0 |
|
4773 | return 0 | |
4771 |
|
4774 | |||
4772 | self.create = False |
|
4775 | self.create = False | |
4773 | self.refreshProjectWindow(projectObjLoad) |
|
4776 | self.refreshProjectWindow(projectObjLoad) | |
4774 | self.refreshProjectProperties(projectObjLoad) |
|
4777 | self.refreshProjectProperties(projectObjLoad) | |
4775 |
|
4778 | |||
4776 | projectId = projectObjLoad.id |
|
4779 | projectId = projectObjLoad.id | |
4777 |
|
4780 | |||
4778 | if projectId in self.__projectObjDict.keys(): |
|
4781 | if projectId in self.__projectObjDict.keys(): | |
4779 |
|
4782 | |||
4780 | projectId = self.__getNewProjectId() |
|
4783 | projectId = self.__getNewProjectId() | |
4781 |
|
4784 | |||
4782 | if not projectId: |
|
4785 | if not projectId: | |
4783 | return 0 |
|
4786 | return 0 | |
4784 |
|
4787 | |||
4785 | projectObjLoad.updateId(projectId) |
|
4788 | projectObjLoad.updateId(projectId) | |
4786 |
|
4789 | |||
4787 | self.__projectObjDict[projectId] = projectObjLoad |
|
4790 | self.__projectObjDict[projectId] = projectObjLoad | |
4788 |
|
4791 | |||
4789 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4792 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4790 |
|
4793 | |||
4791 | self.tabWidgetProject.setEnabled(True) |
|
4794 | self.tabWidgetProject.setEnabled(True) | |
4792 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4795 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4793 | # Disable tabProject after finish the creation |
|
4796 | # Disable tabProject after finish the creation | |
4794 | self.tabProject.setEnabled(True) |
|
4797 | self.tabProject.setEnabled(True) | |
4795 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4798 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4796 |
|
4799 | |||
4797 | for puId, puObj in puObjorderList.items(): |
|
4800 | for puId, puObj in puObjorderList.items(): | |
4798 |
|
4801 | |||
4799 | self.__puObjDict[puId] = puObj |
|
4802 | self.__puObjDict[puId] = puObj | |
4800 |
|
4803 | |||
4801 | if puObj.name == "SendToServer": |
|
4804 | if puObj.name == "SendToServer": | |
4802 | self.saveFTPFromProcUnitObj(puObj) |
|
4805 | self.saveFTPFromProcUnitObj(puObj) | |
4803 |
|
4806 | |||
4804 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4807 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4805 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4808 | operationObj = puObj.getOperationObj("SendByFTP") | |
4806 |
|
4809 | |||
4807 | if operationObj: |
|
4810 | if operationObj: | |
4808 | self.saveFTPFromOpObj(operationObj) |
|
4811 | self.saveFTPFromOpObj(operationObj) | |
4809 | ############################################################ |
|
4812 | ############################################################ | |
4810 |
|
4813 | |||
4811 | if puObj.inputId == '0': |
|
4814 | if puObj.inputId == '0': | |
4812 | continue |
|
4815 | continue | |
4813 |
|
4816 | |||
4814 | self.addPU2PELoadXML(puObj) |
|
4817 | self.addPU2PELoadXML(puObj) | |
4815 |
|
4818 | |||
4816 | self.refreshPUWindow(puObj) |
|
4819 | self.refreshPUWindow(puObj) | |
4817 | self.refreshPUProperties(puObj) |
|
4820 | self.refreshPUProperties(puObj) | |
4818 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4821 | self.showtabPUCreated(datatype=puObj.datatype) | |
4819 |
|
4822 | |||
4820 | # self.console.clear() |
|
4823 | # self.console.clear() | |
4821 | self.console.append("\nThe selected xml file has been loaded successfully") |
|
4824 | self.console.append("\nThe selected xml file has been loaded successfully") | |
4822 |
|
4825 | |||
4823 | if self.dateList: |
|
4826 | if self.dateList: | |
4824 | self._disable_save_button() |
|
4827 | self._disable_save_button() | |
4825 | self._enable_play_button() |
|
4828 | self._enable_play_button() | |
4826 |
|
4829 | |||
4827 | def create_updating_timer(self): |
|
4830 | def create_updating_timer(self): | |
4828 |
|
4831 | |||
4829 | self.comm_data_timer = QtCore.QTimer(self) |
|
4832 | self.comm_data_timer = QtCore.QTimer(self) | |
4830 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4833 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4831 | self.comm_data_timer.start(1000) |
|
4834 | self.comm_data_timer.start(1000) | |
4832 |
|
4835 | |||
4833 | def on_comm_updating_timer(self): |
|
4836 | def on_comm_updating_timer(self): | |
4834 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4837 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4835 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4838 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4836 | if not self.threadStarted: |
|
4839 | if not self.threadStarted: | |
4837 | return |
|
4840 | return | |
4838 |
|
4841 | |||
4839 | if self.controllerThread.isFinished(): |
|
4842 | if self.controllerThread.isFinished(): | |
4840 | self.stopProject() |
|
4843 | self.stopProject() | |
4841 | return |
|
4844 | return | |
4842 |
|
4845 | |||
4843 | def use_plotmanager(self, controllerThread): |
|
4846 | def use_plotmanager(self, controllerThread): | |
4844 |
|
4847 | |||
4845 | self.plotManager = controllerThread.useExternalPlotter() |
|
4848 | self.plotManager = controllerThread.useExternalPlotter() | |
4846 |
|
4849 | |||
4847 | self.plot_timer = QtCore.QTimer() |
|
4850 | self.plot_timer = QtCore.QTimer() | |
4848 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) |
|
4851 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) | |
4849 | self.plot_timer.start(10) |
|
4852 | self.plot_timer.start(10) | |
4850 |
|
4853 | |||
4851 | def on_plotmanager_timer(self): |
|
4854 | def on_plotmanager_timer(self): | |
4852 |
|
4855 | |||
4853 | if not self.plotManager: |
|
4856 | if not self.plotManager: | |
4854 | return |
|
4857 | return | |
4855 |
|
4858 | |||
4856 | self.plotManager.run() |
|
4859 | self.plotManager.run() | |
4857 |
|
4860 | |||
4858 | if self.plotManager.isErrorDetected(): |
|
4861 | if self.plotManager.isErrorDetected(): | |
4859 | self.stopProject() |
|
4862 | self.stopProject() | |
4860 | return |
|
4863 | return | |
4861 |
|
4864 | |||
4862 | def playProject(self, ext=".xml", save=1): |
|
4865 | def playProject(self, ext=".xml", save=1): | |
4863 |
|
4866 | |||
4864 | self._disable_play_button() |
|
4867 | self._disable_play_button() | |
4865 | self._disable_save_button() |
|
4868 | self._disable_save_button() | |
4866 |
|
4869 | |||
4867 | if self.controllerThread: |
|
4870 | if self.controllerThread: | |
4868 | if self.controllerThread.isRunning(): |
|
4871 | if self.controllerThread.isRunning(): | |
4869 | self.console.append("There is already another process running") |
|
4872 | self.console.append("There is already another process running") | |
4870 | self._enable_stop_button() |
|
4873 | self._enable_stop_button() | |
4871 | return |
|
4874 | return | |
4872 |
|
4875 | |||
4873 | if not self.dateList: |
|
4876 | if not self.dateList: | |
4874 | self.console.append("No data found, check datapath") |
|
4877 | self.console.append("No data found, check datapath") | |
4875 |
|
4878 | |||
4876 | projectObj = self.getSelectedProjectObj() |
|
4879 | projectObj = self.getSelectedProjectObj() | |
4877 |
|
4880 | |||
4878 | if not projectObj: |
|
4881 | if not projectObj: | |
4879 | self.console.append("Please, select a project to start it") |
|
4882 | self.console.append("Please, select a project to start it") | |
4880 | return |
|
4883 | return | |
4881 |
|
4884 | |||
4882 | if save: |
|
4885 | if save: | |
4883 | filename = self.saveProject() |
|
4886 | filename = self.saveProject() | |
4884 | if filename == None: |
|
4887 | if filename == None: | |
4885 | self.console.append("Process not initialized.") |
|
4888 | self.console.append("Process not initialized.") | |
4886 | return |
|
4889 | return | |
4887 | else: |
|
4890 | else: | |
4888 | filename = TEMPORAL_FILE |
|
4891 | filename = TEMPORAL_FILE | |
4889 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4892 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4890 |
|
4893 | |||
4891 | self.console.clear() |
|
4894 | self.console.clear() | |
4892 | self.console.append("Please wait...") |
|
4895 | self.console.append("Please wait...") | |
4893 |
|
4896 | |||
4894 | self.controllerThread = ControllerThread() |
|
4897 | self.controllerThread = ControllerThread() | |
4895 | self.controllerThread.readXml(filename) |
|
4898 | self.controllerThread.readXml(filename) | |
4896 |
|
4899 | |||
4897 | self.use_plotmanager(self.controllerThread) |
|
4900 | self.use_plotmanager(self.controllerThread) | |
4898 |
|
4901 | |||
4899 | self.console.clear() |
|
4902 | self.console.clear() | |
4900 |
|
4903 | |||
4901 | self.controllerThread.start() |
|
4904 | self.controllerThread.start() | |
4902 |
|
4905 | |||
4903 | sleep(0.5) |
|
4906 | sleep(0.5) | |
4904 |
|
4907 | |||
4905 |
|
4908 | |||
4906 | self.threadStarted = True |
|
4909 | self.threadStarted = True | |
4907 |
|
4910 | |||
4908 | self._disable_play_button() |
|
4911 | self._disable_play_button() | |
4909 | self._disable_save_button() |
|
4912 | self._disable_save_button() | |
4910 | self._enable_stop_button() |
|
4913 | self._enable_stop_button() | |
4911 |
|
4914 | |||
4912 | def stopProject(self): |
|
4915 | def stopProject(self): | |
4913 |
|
4916 | |||
4914 | self.threadStarted = False |
|
4917 | self.threadStarted = False | |
4915 | self.controllerThread.stop() |
|
4918 | self.controllerThread.stop() | |
4916 | self.plot_timer.stop() |
|
4919 | self.plot_timer.stop() | |
4917 |
|
4920 | |||
4918 | self.plotManager.join() |
|
4921 | self.plotManager.join() | |
4919 | self.plotManager = None |
|
4922 | self.plotManager = None | |
4920 |
|
4923 | |||
4921 | while self.controllerThread.isRunning(): |
|
4924 | while self.controllerThread.isRunning(): | |
4922 | sleep(0.5) |
|
4925 | sleep(0.5) | |
4923 |
|
4926 | |||
4924 | self._disable_stop_button() |
|
4927 | self._disable_stop_button() | |
4925 | self._enable_play_button() |
|
4928 | self._enable_play_button() | |
4926 |
|
4929 | |||
4927 | def pauseProject(self): |
|
4930 | def pauseProject(self): | |
4928 |
|
4931 | |||
4929 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4932 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4930 | paused = self.controllerThread.pause() |
|
4933 | paused = self.controllerThread.pause() | |
4931 |
|
4934 | |||
4932 | self.changePauseIcon(paused) |
|
4935 | self.changePauseIcon(paused) | |
4933 |
|
4936 | |||
4934 | def saveProject(self, filename=None): |
|
4937 | def saveProject(self, filename=None): | |
4935 |
|
4938 | |||
4936 | self._disable_save_button() |
|
4939 | self._disable_save_button() | |
4937 | self._disable_play_button() |
|
4940 | self._disable_play_button() | |
4938 |
|
4941 | |||
4939 | projectObj = self.getSelectedProjectObj() |
|
4942 | projectObj = self.getSelectedProjectObj() | |
4940 |
|
4943 | |||
4941 | if not projectObj: |
|
4944 | if not projectObj: | |
4942 |
|
4945 | |||
4943 | if self.create: |
|
4946 | if self.create: | |
4944 | self.console.append("Please press Ok before save it") |
|
4947 | self.console.append("Please press Ok before save it") | |
4945 | else: |
|
4948 | else: | |
4946 | self.console.append("Please select a project before save it") |
|
4949 | self.console.append("Please select a project before save it") | |
4947 | return |
|
4950 | return | |
4948 |
|
4951 | |||
4949 | self.refreshGraphicsId() |
|
4952 | self.refreshGraphicsId() | |
4950 |
|
4953 | |||
4951 | sts = True |
|
4954 | sts = True | |
4952 | selectedItemObj = self.getSelectedItemObj() |
|
4955 | selectedItemObj = self.getSelectedItemObj() | |
4953 |
|
4956 | |||
4954 | #A Processing Unit has been selected |
|
4957 | #A Processing Unit has been selected | |
4955 | if projectObj == selectedItemObj: |
|
4958 | if projectObj == selectedItemObj: | |
4956 | if not self.on_proOk_clicked(): |
|
4959 | if not self.on_proOk_clicked(): | |
4957 | return None |
|
4960 | return None | |
4958 |
|
4961 | |||
4959 | #A Processing Unit has been selected |
|
4962 | #A Processing Unit has been selected | |
4960 | if projectObj != selectedItemObj: |
|
4963 | if projectObj != selectedItemObj: | |
4961 | puObj = selectedItemObj |
|
4964 | puObj = selectedItemObj | |
4962 |
|
4965 | |||
4963 | if puObj.name == 'VoltageProc': |
|
4966 | if puObj.name == 'VoltageProc': | |
4964 | sts = self.on_volOpOk_clicked() |
|
4967 | sts = self.on_volOpOk_clicked() | |
4965 | if puObj.name == 'SpectraProc': |
|
4968 | if puObj.name == 'SpectraProc': | |
4966 | sts = self.on_specOpOk_clicked() |
|
4969 | sts = self.on_specOpOk_clicked() | |
4967 | if puObj.name == 'SpectraHeisProc': |
|
4970 | if puObj.name == 'SpectraHeisProc': | |
4968 | sts = self.on_specHeisOpOk_clicked() |
|
4971 | sts = self.on_specHeisOpOk_clicked() | |
4969 |
|
4972 | |||
4970 | if not sts: |
|
4973 | if not sts: | |
4971 | return None |
|
4974 | return None | |
4972 |
|
4975 | |||
4973 | self.createFTPProcUnitView() |
|
4976 | self.createFTPProcUnitView() | |
4974 |
|
4977 | |||
4975 | if not filename: |
|
4978 | if not filename: | |
4976 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4979 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4977 |
|
4980 | |||
4978 | projectObj.writeXml(filename) |
|
4981 | projectObj.writeXml(filename) | |
4979 | self.console.clear() |
|
4982 | self.console.clear() | |
4980 | self.console.append("Project saved") |
|
4983 | self.console.append("Project saved") | |
4981 | self.console.append("Press Play button to start data processing ...") |
|
4984 | self.console.append("Press Play button to start data processing ...") | |
4982 |
|
4985 | |||
4983 | self._disable_save_button() |
|
4986 | self._disable_save_button() | |
4984 | self._enable_play_button() |
|
4987 | self._enable_play_button() | |
4985 |
|
4988 | |||
4986 | return filename |
|
4989 | return filename | |
4987 |
|
4990 | |||
4988 | def removeItemTreeFromProject(self): |
|
4991 | def removeItemTreeFromProject(self): | |
4989 | """ |
|
4992 | """ | |
4990 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4993 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4991 | """ |
|
4994 | """ | |
4992 | for key in self.__itemTreeDict.keys(): |
|
4995 | for key in self.__itemTreeDict.keys(): | |
4993 |
|
4996 | |||
4994 | #Check again because an item can delete multiple items (childs) |
|
4997 | #Check again because an item can delete multiple items (childs) | |
4995 | if key not in self.__itemTreeDict.keys(): |
|
4998 | if key not in self.__itemTreeDict.keys(): | |
4996 | continue |
|
4999 | continue | |
4997 |
|
5000 | |||
4998 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
5001 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4999 | continue |
|
5002 | continue | |
5000 |
|
5003 | |||
5001 | if self.__projectObjDict.has_key(key) == True: |
|
5004 | if self.__projectObjDict.has_key(key) == True: | |
5002 |
|
5005 | |||
5003 | del self.__projectObjDict[key] |
|
5006 | del self.__projectObjDict[key] | |
5004 | del self.__itemTreeDict[key] |
|
5007 | del self.__itemTreeDict[key] | |
5005 |
|
5008 | |||
5006 | else: |
|
5009 | else: | |
5007 | puObj = self.__puObjDict[key] |
|
5010 | puObj = self.__puObjDict[key] | |
5008 | idProjectParent = puObj.parentId |
|
5011 | idProjectParent = puObj.parentId | |
5009 | projectObj = self.__projectObjDict[idProjectParent] |
|
5012 | projectObj = self.__projectObjDict[idProjectParent] | |
5010 |
|
5013 | |||
5011 | del self.__puObjDict[key] |
|
5014 | del self.__puObjDict[key] | |
5012 | del self.__itemTreeDict[key] |
|
5015 | del self.__itemTreeDict[key] | |
5013 | del projectObj.procUnitConfObjDict[key] |
|
5016 | del projectObj.procUnitConfObjDict[key] | |
5014 |
|
5017 | |||
5015 | for key in projectObj.procUnitConfObjDict.keys(): |
|
5018 | for key in projectObj.procUnitConfObjDict.keys(): | |
5016 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
5019 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
5017 | continue |
|
5020 | continue | |
5018 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5021 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
5019 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5022 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
5020 | del projectObj.procUnitConfObjDict[key] |
|
5023 | del projectObj.procUnitConfObjDict[key] | |
5021 | # print projectObj.procUnitConfObjDict |
|
5024 | # print projectObj.procUnitConfObjDict | |
5022 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
5025 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
5023 |
|
5026 | |||
5024 | def setInputsProject_View(self): |
|
5027 | def setInputsProject_View(self): | |
5025 |
|
5028 | |||
5026 | self.tabWidgetProject.setEnabled(True) |
|
5029 | self.tabWidgetProject.setEnabled(True) | |
5027 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
5030 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
5028 | self.tabProject.setEnabled(True) |
|
5031 | self.tabProject.setEnabled(True) | |
5029 | self.frame_2.setEnabled(False) |
|
5032 | self.frame_2.setEnabled(False) | |
5030 | self.proName.clear() |
|
5033 | self.proName.clear() | |
5031 | self.proName.setFocus() |
|
5034 | self.proName.setFocus() | |
5032 | self.proName.setSelection(0, 0) |
|
5035 | self.proName.setSelection(0, 0) | |
5033 | self.proName.setCursorPosition(0) |
|
5036 | self.proName.setCursorPosition(0) | |
5034 | self.proDataType.setText('.r') |
|
5037 | self.proDataType.setText('.r') | |
5035 | self.proDataPath.clear() |
|
5038 | self.proDataPath.clear() | |
5036 | self.proComDataType.clear() |
|
5039 | self.proComDataType.clear() | |
5037 | self.proComDataType.addItem("Voltage") |
|
5040 | self.proComDataType.addItem("Voltage") | |
5038 | self.proComDataType.addItem("Spectra") |
|
5041 | self.proComDataType.addItem("Spectra") | |
5039 | self.proComDataType.addItem("Fits") |
|
5042 | self.proComDataType.addItem("Fits") | |
5040 | self.proComDataType.addItem("USRP") |
|
5043 | self.proComDataType.addItem("USRP") | |
5041 |
|
5044 | |||
5042 | self.proComStartDate.clear() |
|
5045 | self.proComStartDate.clear() | |
5043 | self.proComEndDate.clear() |
|
5046 | self.proComEndDate.clear() | |
5044 |
|
5047 | |||
5045 | startTime = "00:00:00" |
|
5048 | startTime = "00:00:00" | |
5046 | endTime = "23:59:59" |
|
5049 | endTime = "23:59:59" | |
5047 | starlist = startTime.split(":") |
|
5050 | starlist = startTime.split(":") | |
5048 | endlist = endTime.split(":") |
|
5051 | endlist = endTime.split(":") | |
5049 | self.proDelay.setText("60") |
|
5052 | self.proDelay.setText("60") | |
5050 | self.proSet.setText("") |
|
5053 | self.proSet.setText("") | |
5051 |
|
5054 | |||
5052 | self.labelSet.show() |
|
5055 | self.labelSet.show() | |
5053 | self.proSet.show() |
|
5056 | self.proSet.show() | |
5054 |
|
5057 | |||
5055 | self.labelIPPKm.hide() |
|
5058 | self.labelIPPKm.hide() | |
5056 | self.proIPPKm.hide() |
|
5059 | self.proIPPKm.hide() | |
5057 |
|
5060 | |||
5058 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5061 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5059 | self.proStartTime.setTime(self.time) |
|
5062 | self.proStartTime.setTime(self.time) | |
5060 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5063 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5061 | self.proEndTime.setTime(self.time) |
|
5064 | self.proEndTime.setTime(self.time) | |
5062 | self.proDescription.clear() |
|
5065 | self.proDescription.clear() | |
5063 | self.proOk.setEnabled(False) |
|
5066 | self.proOk.setEnabled(False) | |
5064 | # self.console.append("Please, Write a name Project") |
|
5067 | # self.console.append("Please, Write a name Project") | |
5065 | # self.console.append("Introduce Project Parameters")DC |
|
5068 | # self.console.append("Introduce Project Parameters")DC | |
5066 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
5069 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
5067 |
|
5070 | |||
5068 | def clearPUWindow(self, datatype): |
|
5071 | def clearPUWindow(self, datatype): | |
5069 |
|
5072 | |||
5070 | projectObjView = self.getSelectedProjectObj() |
|
5073 | projectObjView = self.getSelectedProjectObj() | |
5071 |
|
5074 | |||
5072 | if not projectObjView: |
|
5075 | if not projectObjView: | |
5073 | return |
|
5076 | return | |
5074 |
|
5077 | |||
5075 | puObj = self.getSelectedItemObj() |
|
5078 | puObj = self.getSelectedItemObj() | |
5076 | inputId = puObj.getInputId() |
|
5079 | inputId = puObj.getInputId() | |
5077 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
5080 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
5078 |
|
5081 | |||
5079 | if datatype == 'Voltage': |
|
5082 | if datatype == 'Voltage': | |
5080 | self.volOpComChannels.setEnabled(False) |
|
5083 | self.volOpComChannels.setEnabled(False) | |
5081 | self.volOpComHeights.setEnabled(False) |
|
5084 | self.volOpComHeights.setEnabled(False) | |
5082 | self.volOpFilter.setEnabled(False) |
|
5085 | self.volOpFilter.setEnabled(False) | |
5083 | self.volOpComProfile.setEnabled(False) |
|
5086 | self.volOpComProfile.setEnabled(False) | |
5084 | self.volOpComCode.setEnabled(False) |
|
5087 | self.volOpComCode.setEnabled(False) | |
5085 | self.volOpCohInt.setEnabled(False) |
|
5088 | self.volOpCohInt.setEnabled(False) | |
5086 | self.volOpChannel.setEnabled(False) |
|
5089 | self.volOpChannel.setEnabled(False) | |
5087 | self.volOpHeights.setEnabled(False) |
|
5090 | self.volOpHeights.setEnabled(False) | |
5088 | self.volOpProfile.setEnabled(False) |
|
5091 | self.volOpProfile.setEnabled(False) | |
5089 | self.volOpRadarfrequency.setEnabled(False) |
|
5092 | self.volOpRadarfrequency.setEnabled(False) | |
5090 | self.volOpCebChannels.setCheckState(0) |
|
5093 | self.volOpCebChannels.setCheckState(0) | |
5091 | self.volOpCebRadarfrequency.setCheckState(0) |
|
5094 | self.volOpCebRadarfrequency.setCheckState(0) | |
5092 | self.volOpCebHeights.setCheckState(0) |
|
5095 | self.volOpCebHeights.setCheckState(0) | |
5093 | self.volOpCebFilter.setCheckState(0) |
|
5096 | self.volOpCebFilter.setCheckState(0) | |
5094 | self.volOpCebProfile.setCheckState(0) |
|
5097 | self.volOpCebProfile.setCheckState(0) | |
5095 | self.volOpCebDecodification.setCheckState(0) |
|
5098 | self.volOpCebDecodification.setCheckState(0) | |
5096 | self.volOpCebCohInt.setCheckState(0) |
|
5099 | self.volOpCebCohInt.setCheckState(0) | |
5097 |
|
5100 | |||
5098 | self.volOpChannel.clear() |
|
5101 | self.volOpChannel.clear() | |
5099 | self.volOpHeights.clear() |
|
5102 | self.volOpHeights.clear() | |
5100 | self.volOpProfile.clear() |
|
5103 | self.volOpProfile.clear() | |
5101 | self.volOpFilter.clear() |
|
5104 | self.volOpFilter.clear() | |
5102 | self.volOpCohInt.clear() |
|
5105 | self.volOpCohInt.clear() | |
5103 | self.volOpRadarfrequency.clear() |
|
5106 | self.volOpRadarfrequency.clear() | |
5104 |
|
5107 | |||
5105 | if datatype == 'Spectra': |
|
5108 | if datatype == 'Spectra': | |
5106 |
|
5109 | |||
5107 | if inputPUObj.datatype == 'Spectra': |
|
5110 | if inputPUObj.datatype == 'Spectra': | |
5108 | self.specOpnFFTpoints.setEnabled(False) |
|
5111 | self.specOpnFFTpoints.setEnabled(False) | |
5109 | self.specOpProfiles.setEnabled(False) |
|
5112 | self.specOpProfiles.setEnabled(False) | |
5110 | self.specOpippFactor.setEnabled(False) |
|
5113 | self.specOpippFactor.setEnabled(False) | |
5111 | else: |
|
5114 | else: | |
5112 | self.specOpnFFTpoints.setEnabled(True) |
|
5115 | self.specOpnFFTpoints.setEnabled(True) | |
5113 | self.specOpProfiles.setEnabled(True) |
|
5116 | self.specOpProfiles.setEnabled(True) | |
5114 | self.specOpippFactor.setEnabled(True) |
|
5117 | self.specOpippFactor.setEnabled(True) | |
5115 |
|
5118 | |||
5116 | self.specOpCebCrossSpectra.setCheckState(0) |
|
5119 | self.specOpCebCrossSpectra.setCheckState(0) | |
5117 | self.specOpCebChannel.setCheckState(0) |
|
5120 | self.specOpCebChannel.setCheckState(0) | |
5118 | self.specOpCebHeights.setCheckState(0) |
|
5121 | self.specOpCebHeights.setCheckState(0) | |
5119 | self.specOpCebIncoherent.setCheckState(0) |
|
5122 | self.specOpCebIncoherent.setCheckState(0) | |
5120 | self.specOpCebRemoveDC.setCheckState(0) |
|
5123 | self.specOpCebRemoveDC.setCheckState(0) | |
5121 | self.specOpCebRemoveInt.setCheckState(0) |
|
5124 | self.specOpCebRemoveInt.setCheckState(0) | |
5122 | self.specOpCebgetNoise.setCheckState(0) |
|
5125 | self.specOpCebgetNoise.setCheckState(0) | |
5123 | self.specOpCebRadarfrequency.setCheckState(0) |
|
5126 | self.specOpCebRadarfrequency.setCheckState(0) | |
5124 |
|
5127 | |||
5125 | self.specOpRadarfrequency.setEnabled(False) |
|
5128 | self.specOpRadarfrequency.setEnabled(False) | |
5126 | self.specOppairsList.setEnabled(False) |
|
5129 | self.specOppairsList.setEnabled(False) | |
5127 | self.specOpChannel.setEnabled(False) |
|
5130 | self.specOpChannel.setEnabled(False) | |
5128 | self.specOpHeights.setEnabled(False) |
|
5131 | self.specOpHeights.setEnabled(False) | |
5129 | self.specOpIncoherent.setEnabled(False) |
|
5132 | self.specOpIncoherent.setEnabled(False) | |
5130 | self.specOpgetNoise.setEnabled(False) |
|
5133 | self.specOpgetNoise.setEnabled(False) | |
5131 |
|
5134 | |||
5132 | self.specOpRadarfrequency.clear() |
|
5135 | self.specOpRadarfrequency.clear() | |
5133 | self.specOpnFFTpoints.clear() |
|
5136 | self.specOpnFFTpoints.clear() | |
5134 | self.specOpProfiles.clear() |
|
5137 | self.specOpProfiles.clear() | |
5135 | self.specOpippFactor.clear |
|
5138 | self.specOpippFactor.clear | |
5136 | self.specOppairsList.clear() |
|
5139 | self.specOppairsList.clear() | |
5137 | self.specOpChannel.clear() |
|
5140 | self.specOpChannel.clear() | |
5138 | self.specOpHeights.clear() |
|
5141 | self.specOpHeights.clear() | |
5139 | self.specOpIncoherent.clear() |
|
5142 | self.specOpIncoherent.clear() | |
5140 | self.specOpgetNoise.clear() |
|
5143 | self.specOpgetNoise.clear() | |
5141 |
|
5144 | |||
5142 | self.specGraphCebSpectraplot.setCheckState(0) |
|
5145 | self.specGraphCebSpectraplot.setCheckState(0) | |
5143 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
5146 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
5144 | self.specGraphCebRTIplot.setCheckState(0) |
|
5147 | self.specGraphCebRTIplot.setCheckState(0) | |
5145 | self.specGraphCebRTInoise.setCheckState(0) |
|
5148 | self.specGraphCebRTInoise.setCheckState(0) | |
5146 | self.specGraphCebCoherencmap.setCheckState(0) |
|
5149 | self.specGraphCebCoherencmap.setCheckState(0) | |
5147 | self.specGraphPowerprofile.setCheckState(0) |
|
5150 | self.specGraphPowerprofile.setCheckState(0) | |
5148 |
|
5151 | |||
5149 | self.specGraphSaveSpectra.setCheckState(0) |
|
5152 | self.specGraphSaveSpectra.setCheckState(0) | |
5150 | self.specGraphSaveCross.setCheckState(0) |
|
5153 | self.specGraphSaveCross.setCheckState(0) | |
5151 | self.specGraphSaveRTIplot.setCheckState(0) |
|
5154 | self.specGraphSaveRTIplot.setCheckState(0) | |
5152 | self.specGraphSaveRTInoise.setCheckState(0) |
|
5155 | self.specGraphSaveRTInoise.setCheckState(0) | |
5153 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
5156 | self.specGraphSaveCoherencemap.setCheckState(0) | |
5154 | self.specGraphSavePowerprofile.setCheckState(0) |
|
5157 | self.specGraphSavePowerprofile.setCheckState(0) | |
5155 |
|
5158 | |||
5156 | self.specGraphftpRTIplot.setCheckState(0) |
|
5159 | self.specGraphftpRTIplot.setCheckState(0) | |
5157 | self.specGraphftpRTInoise.setCheckState(0) |
|
5160 | self.specGraphftpRTInoise.setCheckState(0) | |
5158 | self.specGraphftpCoherencemap.setCheckState(0) |
|
5161 | self.specGraphftpCoherencemap.setCheckState(0) | |
5159 |
|
5162 | |||
5160 | self.specGraphPath.clear() |
|
5163 | self.specGraphPath.clear() | |
5161 | self.specGraphPrefix.clear() |
|
5164 | self.specGraphPrefix.clear() | |
5162 |
|
5165 | |||
5163 | self.specGgraphftpratio.clear() |
|
5166 | self.specGgraphftpratio.clear() | |
5164 |
|
5167 | |||
5165 | self.specGgraphChannelList.clear() |
|
5168 | self.specGgraphChannelList.clear() | |
5166 | self.specGgraphFreq.clear() |
|
5169 | self.specGgraphFreq.clear() | |
5167 | self.specGgraphHeight.clear() |
|
5170 | self.specGgraphHeight.clear() | |
5168 | self.specGgraphDbsrange.clear() |
|
5171 | self.specGgraphDbsrange.clear() | |
5169 | self.specGgraphmagnitud.clear() |
|
5172 | self.specGgraphmagnitud.clear() | |
5170 | self.specGgraphTminTmax.clear() |
|
5173 | self.specGgraphTminTmax.clear() | |
5171 | self.specGgraphTimeRange.clear() |
|
5174 | self.specGgraphTimeRange.clear() | |
5172 |
|
5175 | |||
5173 | if datatype == 'SpectraHeis': |
|
5176 | if datatype == 'SpectraHeis': | |
5174 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5177 | self.specHeisOpCebIncoherent.setCheckState(0) | |
5175 | self.specHeisOpIncoherent.setEnabled(False) |
|
5178 | self.specHeisOpIncoherent.setEnabled(False) | |
5176 | self.specHeisOpIncoherent.clear() |
|
5179 | self.specHeisOpIncoherent.clear() | |
5177 |
|
5180 | |||
5178 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5181 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5179 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5182 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5180 |
|
5183 | |||
5181 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5184 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5182 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5185 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5183 |
|
5186 | |||
5184 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5187 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5185 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5188 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5186 |
|
5189 | |||
5187 | self.specHeisGraphPath.clear() |
|
5190 | self.specHeisGraphPath.clear() | |
5188 | self.specHeisGraphPrefix.clear() |
|
5191 | self.specHeisGraphPrefix.clear() | |
5189 | self.specHeisGgraphChannelList.clear() |
|
5192 | self.specHeisGgraphChannelList.clear() | |
5190 | self.specHeisGgraphXminXmax.clear() |
|
5193 | self.specHeisGgraphXminXmax.clear() | |
5191 | self.specHeisGgraphYminYmax.clear() |
|
5194 | self.specHeisGgraphYminYmax.clear() | |
5192 | self.specHeisGgraphTminTmax.clear() |
|
5195 | self.specHeisGgraphTminTmax.clear() | |
5193 | self.specHeisGgraphTimeRange.clear() |
|
5196 | self.specHeisGgraphTimeRange.clear() | |
5194 | self.specHeisGgraphftpratio.clear() |
|
5197 | self.specHeisGgraphftpratio.clear() | |
5195 |
|
5198 | |||
5196 | def showtabPUCreated(self, datatype): |
|
5199 | def showtabPUCreated(self, datatype): | |
5197 |
|
5200 | |||
5198 | if datatype == "Voltage": |
|
5201 | if datatype == "Voltage": | |
5199 | self.tabVoltage.setEnabled(True) |
|
5202 | self.tabVoltage.setEnabled(True) | |
5200 | self.tabProject.setEnabled(False) |
|
5203 | self.tabProject.setEnabled(False) | |
5201 | self.tabSpectra.setEnabled(False) |
|
5204 | self.tabSpectra.setEnabled(False) | |
5202 | self.tabCorrelation.setEnabled(False) |
|
5205 | self.tabCorrelation.setEnabled(False) | |
5203 | self.tabSpectraHeis.setEnabled(False) |
|
5206 | self.tabSpectraHeis.setEnabled(False) | |
5204 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5207 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5205 |
|
5208 | |||
5206 | if datatype == "Spectra": |
|
5209 | if datatype == "Spectra": | |
5207 | self.tabVoltage.setEnabled(False) |
|
5210 | self.tabVoltage.setEnabled(False) | |
5208 | self.tabProject.setEnabled(False) |
|
5211 | self.tabProject.setEnabled(False) | |
5209 | self.tabSpectra.setEnabled(True) |
|
5212 | self.tabSpectra.setEnabled(True) | |
5210 | self.tabCorrelation.setEnabled(False) |
|
5213 | self.tabCorrelation.setEnabled(False) | |
5211 | self.tabSpectraHeis.setEnabled(False) |
|
5214 | self.tabSpectraHeis.setEnabled(False) | |
5212 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5215 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5213 |
|
5216 | |||
5214 | if datatype == "SpectraHeis": |
|
5217 | if datatype == "SpectraHeis": | |
5215 | self.tabVoltage.setEnabled(False) |
|
5218 | self.tabVoltage.setEnabled(False) | |
5216 | self.tabProject.setEnabled(False) |
|
5219 | self.tabProject.setEnabled(False) | |
5217 | self.tabSpectra.setEnabled(False) |
|
5220 | self.tabSpectra.setEnabled(False) | |
5218 | self.tabCorrelation.setEnabled(False) |
|
5221 | self.tabCorrelation.setEnabled(False) | |
5219 | self.tabSpectraHeis.setEnabled(True) |
|
5222 | self.tabSpectraHeis.setEnabled(True) | |
5220 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5223 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5221 |
|
5224 | |||
5222 | def checkInputsProject(self): |
|
5225 | def checkInputsProject(self): | |
5223 | """ |
|
5226 | """ | |
5224 | Check Inputs Project: |
|
5227 | Check Inputs Project: | |
5225 | - project_name |
|
5228 | - project_name | |
5226 | - datatype |
|
5229 | - datatype | |
5227 | - ext |
|
5230 | - ext | |
5228 | - data_path |
|
5231 | - data_path | |
5229 | - readmode |
|
5232 | - readmode | |
5230 | - delay |
|
5233 | - delay | |
5231 | - set |
|
5234 | - set | |
5232 | - walk |
|
5235 | - walk | |
5233 | """ |
|
5236 | """ | |
5234 | parms_ok = True |
|
5237 | parms_ok = True | |
5235 | project_name = str(self.proName.text()) |
|
5238 | project_name = str(self.proName.text()) | |
5236 | if project_name == '' or project_name == None: |
|
5239 | if project_name == '' or project_name == None: | |
5237 | outputstr = "Enter the Project Name" |
|
5240 | outputstr = "Enter the Project Name" | |
5238 | self.console.append(outputstr) |
|
5241 | self.console.append(outputstr) | |
5239 | parms_ok = False |
|
5242 | parms_ok = False | |
5240 | project_name = None |
|
5243 | project_name = None | |
5241 |
|
5244 | |||
5242 | datatype = str(self.proComDataType.currentText()) |
|
5245 | datatype = str(self.proComDataType.currentText()) | |
5243 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5246 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5244 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5247 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5245 | self.console.append(outputstr) |
|
5248 | self.console.append(outputstr) | |
5246 | parms_ok = False |
|
5249 | parms_ok = False | |
5247 | datatype = None |
|
5250 | datatype = None | |
5248 |
|
5251 | |||
5249 | ext = str(self.proDataType.text()) |
|
5252 | ext = str(self.proDataType.text()) | |
5250 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5253 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5251 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5254 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5252 | self.console.append(outputstr) |
|
5255 | self.console.append(outputstr) | |
5253 | parms_ok = False |
|
5256 | parms_ok = False | |
5254 | ext = None |
|
5257 | ext = None | |
5255 |
|
5258 | |||
5256 | data_path = str(self.proDataPath.text()) |
|
5259 | data_path = str(self.proDataPath.text()) | |
5257 |
|
5260 | |||
5258 | if data_path == '': |
|
5261 | if data_path == '': | |
5259 | outputstr = 'Datapath is empty' |
|
5262 | outputstr = 'Datapath is empty' | |
5260 | self.console.append(outputstr) |
|
5263 | self.console.append(outputstr) | |
5261 | parms_ok = False |
|
5264 | parms_ok = False | |
5262 | data_path = None |
|
5265 | data_path = None | |
5263 |
|
5266 | |||
5264 | if data_path != None: |
|
5267 | if data_path != None: | |
5265 | if not os.path.isdir(data_path): |
|
5268 | if not os.path.isdir(data_path): | |
5266 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5269 | outputstr = 'Datapath:%s does not exists' % data_path | |
5267 | self.console.append(outputstr) |
|
5270 | self.console.append(outputstr) | |
5268 | parms_ok = False |
|
5271 | parms_ok = False | |
5269 | data_path = None |
|
5272 | data_path = None | |
5270 |
|
5273 | |||
5271 | read_mode = str(self.proComReadMode.currentText()) |
|
5274 | read_mode = str(self.proComReadMode.currentText()) | |
5272 | if not(read_mode in ['Online', 'Offline']): |
|
5275 | if not(read_mode in ['Online', 'Offline']): | |
5273 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5276 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5274 | self.console.append(outputstr) |
|
5277 | self.console.append(outputstr) | |
5275 | parms_ok = False |
|
5278 | parms_ok = False | |
5276 | read_mode = None |
|
5279 | read_mode = None | |
5277 |
|
5280 | |||
5278 | delay = None |
|
5281 | delay = None | |
5279 | if read_mode == "Online": |
|
5282 | if read_mode == "Online": | |
5280 | parms_ok = False |
|
5283 | parms_ok = False | |
5281 | try: |
|
5284 | try: | |
5282 | delay = int(str(self.proDelay.text())) |
|
5285 | delay = int(str(self.proDelay.text())) | |
5283 | parms_ok = True |
|
5286 | parms_ok = True | |
5284 | except: |
|
5287 | except: | |
5285 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5288 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5286 | self.console.append(outputstr) |
|
5289 | self.console.append(outputstr) | |
5287 |
|
5290 | |||
5288 | try: |
|
5291 | try: | |
5289 | set = int(str(self.proSet.text())) |
|
5292 | set = int(str(self.proSet.text())) | |
5290 | except: |
|
5293 | except: | |
5291 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5294 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5292 | # self.console.append(outputstr) |
|
5295 | # self.console.append(outputstr) | |
5293 | # parms_ok = False |
|
5296 | # parms_ok = False | |
5294 | set = None |
|
5297 | set = None | |
5295 |
|
5298 | |||
5296 | walk = int(self.proComWalk.currentIndex()) |
|
5299 | walk = int(self.proComWalk.currentIndex()) | |
5297 | expLabel = str(self.proExpLabel.text()) |
|
5300 | expLabel = str(self.proExpLabel.text()) | |
5298 |
|
5301 | |||
5299 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5302 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5300 |
|
5303 | |||
5301 | def checkInputsPUSave(self, datatype): |
|
5304 | def checkInputsPUSave(self, datatype): | |
5302 | """ |
|
5305 | """ | |
5303 | Check Inputs Spectra Save: |
|
5306 | Check Inputs Spectra Save: | |
5304 | - path |
|
5307 | - path | |
5305 | - blocks Per File |
|
5308 | - blocks Per File | |
5306 | - sufix |
|
5309 | - sufix | |
5307 | - dataformat |
|
5310 | - dataformat | |
5308 | """ |
|
5311 | """ | |
5309 | parms_ok = True |
|
5312 | parms_ok = True | |
5310 |
|
5313 | |||
5311 | if datatype == "Voltage": |
|
5314 | if datatype == "Voltage": | |
5312 | output_path = str(self.volOutputPath.text()) |
|
5315 | output_path = str(self.volOutputPath.text()) | |
5313 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5316 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5314 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5317 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5315 |
|
5318 | |||
5316 | if datatype == "Spectra": |
|
5319 | if datatype == "Spectra": | |
5317 | output_path = str(self.specOutputPath.text()) |
|
5320 | output_path = str(self.specOutputPath.text()) | |
5318 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5321 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5319 | profilesperblock = 0 |
|
5322 | profilesperblock = 0 | |
5320 |
|
5323 | |||
5321 | if datatype == "SpectraHeis": |
|
5324 | if datatype == "SpectraHeis": | |
5322 | output_path = str(self.specHeisOutputPath.text()) |
|
5325 | output_path = str(self.specHeisOutputPath.text()) | |
5323 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5326 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5324 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5327 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5325 |
|
5328 | |||
5326 | if output_path == '': |
|
5329 | if output_path == '': | |
5327 | outputstr = 'Outputpath is empty' |
|
5330 | outputstr = 'Outputpath is empty' | |
5328 | self.console.append(outputstr) |
|
5331 | self.console.append(outputstr) | |
5329 | parms_ok = False |
|
5332 | parms_ok = False | |
5330 |
|
5333 | |||
5331 | if not os.path.isdir(output_path): |
|
5334 | if not os.path.isdir(output_path): | |
5332 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5335 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5333 | self.console.append(outputstr) |
|
5336 | self.console.append(outputstr) | |
5334 | parms_ok = False |
|
5337 | parms_ok = False | |
5335 |
|
5338 | |||
5336 | try: |
|
5339 | try: | |
5337 | profilesperblock = int(profilesperblock) |
|
5340 | profilesperblock = int(profilesperblock) | |
5338 | except: |
|
5341 | except: | |
5339 | if datatype == "Voltage": |
|
5342 | if datatype == "Voltage": | |
5340 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5343 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5341 | self.console.append(outputstr) |
|
5344 | self.console.append(outputstr) | |
5342 | parms_ok = False |
|
5345 | parms_ok = False | |
5343 | profilesperblock = None |
|
5346 | profilesperblock = None | |
5344 |
|
5347 | |||
5345 | try: |
|
5348 | try: | |
5346 | blocksperfile = int(blocksperfile) |
|
5349 | blocksperfile = int(blocksperfile) | |
5347 | except: |
|
5350 | except: | |
5348 | if datatype == "Voltage": |
|
5351 | if datatype == "Voltage": | |
5349 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5352 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5350 | elif datatype == "Spectra": |
|
5353 | elif datatype == "Spectra": | |
5351 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5354 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5352 | elif datatype == "SpectraHeis": |
|
5355 | elif datatype == "SpectraHeis": | |
5353 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5356 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5354 |
|
5357 | |||
5355 | self.console.append(outputstr) |
|
5358 | self.console.append(outputstr) | |
5356 | parms_ok = False |
|
5359 | parms_ok = False | |
5357 | blocksperfile = None |
|
5360 | blocksperfile = None | |
5358 |
|
5361 | |||
5359 | if datatype == "SpectraHeis": |
|
5362 | if datatype == "SpectraHeis": | |
5360 | if metadata_file != '': |
|
5363 | if metadata_file != '': | |
5361 | if not os.path.isfile(metadata_file): |
|
5364 | if not os.path.isfile(metadata_file): | |
5362 | outputstr = 'Metadata file %s does not exist' % metadata_file |
|
5365 | outputstr = 'Metadata file %s does not exist' % metadata_file | |
5363 | self.console.append(outputstr) |
|
5366 | self.console.append(outputstr) | |
5364 | parms_ok = False |
|
5367 | parms_ok = False | |
5365 |
|
5368 | |||
5366 | if datatype == "Voltage": |
|
5369 | if datatype == "Voltage": | |
5367 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5370 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5368 |
|
5371 | |||
5369 |
|
5372 | |||
5370 | if datatype == "Spectra": |
|
5373 | if datatype == "Spectra": | |
5371 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5374 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5372 |
|
5375 | |||
5373 |
|
5376 | |||
5374 | if datatype == "SpectraHeis": |
|
5377 | if datatype == "SpectraHeis": | |
5375 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5378 | return parms_ok, output_path, blocksperfile, metadata_file | |
5376 |
|
5379 | |||
5377 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5380 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5378 |
|
5381 | |||
5379 | dateList = [] |
|
5382 | dateList = [] | |
5380 | fileList = [] |
|
5383 | fileList = [] | |
5381 |
|
5384 | |||
5382 | if ext == ".r": |
|
5385 | if ext == ".r": | |
5383 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5386 | from schainpy.model.io.jroIO_base import JRODataReader | |
5384 |
|
5387 | |||
5385 | readerObj = JRODataReader() |
|
5388 | readerObj = JRODataReader() | |
5386 | dateList = readerObj.findDatafiles(path=data_path, |
|
5389 | dateList = readerObj.findDatafiles(path=data_path, | |
5387 | expLabel=expLabel, |
|
5390 | expLabel=expLabel, | |
5388 | ext=ext, |
|
5391 | ext=ext, | |
5389 | walk=walk) |
|
5392 | walk=walk) | |
5390 |
|
5393 | |||
5391 | if ext == ".pdata": |
|
5394 | if ext == ".pdata": | |
5392 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5395 | from schainpy.model.io.jroIO_base import JRODataReader | |
5393 |
|
5396 | |||
5394 | readerObj = JRODataReader() |
|
5397 | readerObj = JRODataReader() | |
5395 | dateList = readerObj.findDatafiles(path=data_path, |
|
5398 | dateList = readerObj.findDatafiles(path=data_path, | |
5396 | expLabel=expLabel, |
|
5399 | expLabel=expLabel, | |
5397 | ext=ext, |
|
5400 | ext=ext, | |
5398 | walk=walk) |
|
5401 | walk=walk) | |
5399 |
|
5402 | |||
5400 | if ext == ".fits": |
|
5403 | if ext == ".fits": | |
5401 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5404 | from schainpy.model.io.jroIO_base import JRODataReader | |
5402 |
|
5405 | |||
5403 | readerObj = JRODataReader() |
|
5406 | readerObj = JRODataReader() | |
5404 | dateList = readerObj.findDatafiles(path=data_path, |
|
5407 | dateList = readerObj.findDatafiles(path=data_path, | |
5405 | expLabel=expLabel, |
|
5408 | expLabel=expLabel, | |
5406 | ext=ext, |
|
5409 | ext=ext, | |
5407 | walk=walk) |
|
5410 | walk=walk) | |
5408 |
|
5411 | |||
5409 | if ext == ".hdf5": |
|
5412 | if ext == ".hdf5": | |
5410 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5413 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5411 |
|
5414 | |||
5412 | readerObj = USRPReader() |
|
5415 | readerObj = USRPReader() | |
5413 | dateList = readerObj.findDatafiles(path=data_path) |
|
5416 | dateList = readerObj.findDatafiles(path=data_path) | |
5414 |
|
5417 | |||
5415 | return dateList |
|
5418 | return dateList | |
5416 |
|
5419 | |||
5417 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5420 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5418 | """ |
|
5421 | """ | |
5419 | Method to loads day |
|
5422 | Method to loads day | |
5420 | """ |
|
5423 | """ | |
5421 | # self._disable_save_button() |
|
5424 | # self._disable_save_button() | |
5422 | # self._disable_play_button() |
|
5425 | # self._disable_play_button() | |
5423 | # self.proOk.setEnabled(False) |
|
5426 | # self.proOk.setEnabled(False) | |
5424 |
|
5427 | |||
5425 | self.proComStartDate.clear() |
|
5428 | self.proComStartDate.clear() | |
5426 | self.proComEndDate.clear() |
|
5429 | self.proComEndDate.clear() | |
5427 |
|
5430 | |||
5428 | self.dateList = [] |
|
5431 | self.dateList = [] | |
5429 |
|
5432 | |||
5430 | if not data_path: |
|
5433 | if not data_path: | |
5431 | self.console.append("Datapath has not been set") |
|
5434 | self.console.append("Datapath has not been set") | |
5432 | return [] |
|
5435 | return [] | |
5433 |
|
5436 | |||
5434 | if not os.path.isdir(data_path): |
|
5437 | if not os.path.isdir(data_path): | |
5435 | self.console.append("Directory %s does not exist" %data_path) |
|
5438 | self.console.append("Directory %s does not exist" %data_path) | |
5436 | return [] |
|
5439 | return [] | |
5437 |
|
5440 | |||
5438 | self.dataPath = data_path |
|
5441 | self.dataPath = data_path | |
5439 |
|
5442 | |||
5440 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5443 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5441 |
|
5444 | |||
5442 | if not dateList: |
|
5445 | if not dateList: | |
5443 | # self.console.clear() |
|
5446 | # self.console.clear() | |
5444 | if walk: |
|
5447 | if walk: | |
5445 | if expLabel: |
|
5448 | if expLabel: | |
5446 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5449 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5447 | else: |
|
5450 | else: | |
5448 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5451 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5449 | else: |
|
5452 | else: | |
5450 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5453 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5451 |
|
5454 | |||
5452 | self.console.append(outputstr) |
|
5455 | self.console.append(outputstr) | |
5453 | return [] |
|
5456 | return [] | |
5454 |
|
5457 | |||
5455 | dateStrList = [] |
|
5458 | dateStrList = [] | |
5456 | for thisDate in dateList: |
|
5459 | for thisDate in dateList: | |
5457 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5460 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5458 |
|
5461 | |||
5459 | self.proComStartDate.addItem(dateStr) |
|
5462 | self.proComStartDate.addItem(dateStr) | |
5460 | self.proComEndDate.addItem(dateStr) |
|
5463 | self.proComEndDate.addItem(dateStr) | |
5461 | dateStrList.append(dateStr) |
|
5464 | dateStrList.append(dateStr) | |
5462 |
|
5465 | |||
5463 | self.proComStartDate.setCurrentIndex(0) |
|
5466 | self.proComStartDate.setCurrentIndex(0) | |
5464 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5467 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5465 |
|
5468 | |||
5466 | self.dateList = dateStrList |
|
5469 | self.dateList = dateStrList | |
5467 |
|
5470 | |||
5468 | self.console.clear() |
|
5471 | self.console.clear() | |
5469 | self.console.append("Successful load") |
|
5472 | self.console.append("Successful load") | |
5470 |
|
5473 | |||
5471 | # self.proOk.setEnabled(True) |
|
5474 | # self.proOk.setEnabled(True) | |
5472 | # self._enable_play_button() |
|
5475 | # self._enable_play_button() | |
5473 | # self._enable_save_button() |
|
5476 | # self._enable_save_button() | |
5474 |
|
5477 | |||
5475 | return self.dateList |
|
5478 | return self.dateList | |
5476 |
|
5479 | |||
5477 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5480 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5478 |
|
5481 | |||
5479 | if pathWorkSpace == None: |
|
5482 | if pathWorkSpace == None: | |
5480 | home = os.path.expanduser("~") |
|
5483 | home = os.path.expanduser("~") | |
5481 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5484 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5482 |
|
5485 | |||
5483 | self.pathWorkSpace = pathWorkSpace |
|
5486 | self.pathWorkSpace = pathWorkSpace | |
5484 |
|
5487 | |||
5485 | """ |
|
5488 | """ | |
5486 | Comandos Usados en Console |
|
5489 | Comandos Usados en Console | |
5487 | """ |
|
5490 | """ | |
5488 | def __del__(self): |
|
5491 | def __del__(self): | |
5489 | sys.stdout = sys.__stdout__ |
|
5492 | sys.stdout = sys.__stdout__ | |
5490 | sys.stderr = sys.__stderr__ |
|
5493 | sys.stderr = sys.__stderr__ | |
5491 |
|
5494 | |||
5492 | def normalOutputWritten(self, text): |
|
5495 | def normalOutputWritten(self, text): | |
5493 | color_black = QtGui.QColor(0,0,0) |
|
5496 | color_black = QtGui.QColor(0,0,0) | |
5494 | self.console.setTextColor(color_black) |
|
5497 | self.console.setTextColor(color_black) | |
5495 | self.console.append(text) |
|
5498 | self.console.append(text) | |
5496 |
|
5499 | |||
5497 | def errorOutputWritten(self, text): |
|
5500 | def errorOutputWritten(self, text): | |
5498 | color_red = QtGui.QColor(255,0,0) |
|
5501 | color_red = QtGui.QColor(255,0,0) | |
5499 | color_black = QtGui.QColor(0,0,0) |
|
5502 | color_black = QtGui.QColor(0,0,0) | |
5500 |
|
5503 | |||
5501 | self.console.setTextColor(color_red) |
|
5504 | self.console.setTextColor(color_red) | |
5502 | self.console.append(text) |
|
5505 | self.console.append(text) | |
5503 | self.console.setTextColor(color_black) |
|
5506 | self.console.setTextColor(color_black) | |
5504 |
|
5507 | |||
5505 | def _enable_save_button(self): |
|
5508 | def _enable_save_button(self): | |
5506 |
|
5509 | |||
5507 | self.actionSaveToolbar.setEnabled(True) |
|
5510 | self.actionSaveToolbar.setEnabled(True) | |
5508 | self.actionSave.setEnabled(True) |
|
5511 | self.actionSave.setEnabled(True) | |
5509 |
|
5512 | |||
5510 | def _disable_save_button(self): |
|
5513 | def _disable_save_button(self): | |
5511 |
|
5514 | |||
5512 | self.actionSaveToolbar.setEnabled(False) |
|
5515 | self.actionSaveToolbar.setEnabled(False) | |
5513 | self.actionSave.setEnabled(False) |
|
5516 | self.actionSave.setEnabled(False) | |
5514 |
|
5517 | |||
5515 | def _enable_play_button(self): |
|
5518 | def _enable_play_button(self): | |
5516 |
|
5519 | |||
5517 | if self.controllerThread: |
|
5520 | if self.controllerThread: | |
5518 | if self.controllerThread.isRunning(): |
|
5521 | if self.controllerThread.isRunning(): | |
5519 | return |
|
5522 | return | |
5520 |
|
5523 | |||
5521 | self.actionStart.setEnabled(True) |
|
5524 | self.actionStart.setEnabled(True) | |
5522 | self.actionStarToolbar.setEnabled(True) |
|
5525 | self.actionStarToolbar.setEnabled(True) | |
5523 |
|
5526 | |||
5524 | self.changeStartIcon(started=False) |
|
5527 | self.changeStartIcon(started=False) | |
5525 |
|
5528 | |||
5526 | def _disable_play_button(self): |
|
5529 | def _disable_play_button(self): | |
5527 |
|
5530 | |||
5528 | self.actionStart.setEnabled(False) |
|
5531 | self.actionStart.setEnabled(False) | |
5529 | self.actionStarToolbar.setEnabled(False) |
|
5532 | self.actionStarToolbar.setEnabled(False) | |
5530 |
|
5533 | |||
5531 | self.changeStartIcon(started=True) |
|
5534 | self.changeStartIcon(started=True) | |
5532 |
|
5535 | |||
5533 | def _enable_stop_button(self): |
|
5536 | def _enable_stop_button(self): | |
5534 |
|
5537 | |||
5535 | self.actionPause.setEnabled(True) |
|
5538 | self.actionPause.setEnabled(True) | |
5536 | self.actionStop.setEnabled(True) |
|
5539 | self.actionStop.setEnabled(True) | |
5537 |
|
5540 | |||
5538 | self.actionPauseToolbar.setEnabled(True) |
|
5541 | self.actionPauseToolbar.setEnabled(True) | |
5539 | self.actionStopToolbar.setEnabled(True) |
|
5542 | self.actionStopToolbar.setEnabled(True) | |
5540 |
|
5543 | |||
5541 | self.changePauseIcon(paused=False) |
|
5544 | self.changePauseIcon(paused=False) | |
5542 | self.changeStopIcon(started=True) |
|
5545 | self.changeStopIcon(started=True) | |
5543 |
|
5546 | |||
5544 | def _disable_stop_button(self): |
|
5547 | def _disable_stop_button(self): | |
5545 |
|
5548 | |||
5546 | self.actionPause.setEnabled(False) |
|
5549 | self.actionPause.setEnabled(False) | |
5547 | self.actionStop.setEnabled(False) |
|
5550 | self.actionStop.setEnabled(False) | |
5548 |
|
5551 | |||
5549 | self.actionPauseToolbar.setEnabled(False) |
|
5552 | self.actionPauseToolbar.setEnabled(False) | |
5550 | self.actionStopToolbar.setEnabled(False) |
|
5553 | self.actionStopToolbar.setEnabled(False) | |
5551 |
|
5554 | |||
5552 | self.changePauseIcon(paused=False) |
|
5555 | self.changePauseIcon(paused=False) | |
5553 | self.changeStopIcon(started=False) |
|
5556 | self.changeStopIcon(started=False) | |
5554 |
|
5557 | |||
5555 | def setGUIStatus(self): |
|
5558 | def setGUIStatus(self): | |
5556 |
|
5559 | |||
5557 | self.setWindowTitle("ROJ-Signal Chain") |
|
5560 | self.setWindowTitle("ROJ-Signal Chain") | |
5558 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5561 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5559 |
|
5562 | |||
5560 | self.tabWidgetProject.setEnabled(False) |
|
5563 | self.tabWidgetProject.setEnabled(False) | |
5561 | self.tabVoltage.setEnabled(False) |
|
5564 | self.tabVoltage.setEnabled(False) | |
5562 | self.tabSpectra.setEnabled(False) |
|
5565 | self.tabSpectra.setEnabled(False) | |
5563 | self.tabCorrelation.setEnabled(False) |
|
5566 | self.tabCorrelation.setEnabled(False) | |
5564 | self.frame_2.setEnabled(False) |
|
5567 | self.frame_2.setEnabled(False) | |
5565 |
|
5568 | |||
5566 | self.actionCreate.setShortcut('Ctrl+N') |
|
5569 | self.actionCreate.setShortcut('Ctrl+N') | |
5567 | self.actionOpen.setShortcut('Ctrl+O') |
|
5570 | self.actionOpen.setShortcut('Ctrl+O') | |
5568 | self.actionSave.setShortcut('Ctrl+S') |
|
5571 | self.actionSave.setShortcut('Ctrl+S') | |
5569 | self.actionClose.setShortcut('Ctrl+X') |
|
5572 | self.actionClose.setShortcut('Ctrl+X') | |
5570 |
|
5573 | |||
5571 | self.actionStart.setShortcut('Ctrl+1') |
|
5574 | self.actionStart.setShortcut('Ctrl+1') | |
5572 | self.actionPause.setShortcut('Ctrl+2') |
|
5575 | self.actionPause.setShortcut('Ctrl+2') | |
5573 | self.actionStop.setShortcut('Ctrl+3') |
|
5576 | self.actionStop.setShortcut('Ctrl+3') | |
5574 |
|
5577 | |||
5575 | self.actionFTP.setShortcut('Ctrl+F') |
|
5578 | self.actionFTP.setShortcut('Ctrl+F') | |
5576 |
|
5579 | |||
5577 | self.actionStart.setEnabled(False) |
|
5580 | self.actionStart.setEnabled(False) | |
5578 | self.actionPause.setEnabled(False) |
|
5581 | self.actionPause.setEnabled(False) | |
5579 | self.actionStop.setEnabled(False) |
|
5582 | self.actionStop.setEnabled(False) | |
5580 |
|
5583 | |||
5581 | self.actionStarToolbar.setEnabled(False) |
|
5584 | self.actionStarToolbar.setEnabled(False) | |
5582 | self.actionPauseToolbar.setEnabled(False) |
|
5585 | self.actionPauseToolbar.setEnabled(False) | |
5583 | self.actionStopToolbar.setEnabled(False) |
|
5586 | self.actionStopToolbar.setEnabled(False) | |
5584 |
|
5587 | |||
5585 | self.proName.clear() |
|
5588 | self.proName.clear() | |
5586 | self.proDataPath.setText('') |
|
5589 | self.proDataPath.setText('') | |
5587 | self.console.setReadOnly(True) |
|
5590 | self.console.setReadOnly(True) | |
5588 | self.console.append("Welcome to Signal Chain\n\n") |
|
5591 | self.console.append("Welcome to Signal Chain\n\n") | |
5589 | self.console.append("Open a project or Create a new one\n") |
|
5592 | self.console.append("Open a project or Create a new one\n") | |
5590 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5593 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5591 | self.proDataType.setEnabled(False) |
|
5594 | self.proDataType.setEnabled(False) | |
5592 | self.time = QtCore.QTime() |
|
5595 | self.time = QtCore.QTime() | |
5593 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5596 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5594 | startTime = "00:00:00" |
|
5597 | startTime = "00:00:00" | |
5595 | endTime = "23:59:59" |
|
5598 | endTime = "23:59:59" | |
5596 | starlist = startTime.split(":") |
|
5599 | starlist = startTime.split(":") | |
5597 | endlist = endTime.split(":") |
|
5600 | endlist = endTime.split(":") | |
5598 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5601 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5599 | self.proStartTime.setTime(self.time) |
|
5602 | self.proStartTime.setTime(self.time) | |
5600 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5603 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5601 | self.proEndTime.setTime(self.time) |
|
5604 | self.proEndTime.setTime(self.time) | |
5602 | self.proOk.setEnabled(False) |
|
5605 | self.proOk.setEnabled(False) | |
5603 | # set model Project Explorer |
|
5606 | # set model Project Explorer | |
5604 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5607 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5605 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5608 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5606 | layout = QtGui.QVBoxLayout() |
|
5609 | layout = QtGui.QVBoxLayout() | |
5607 | layout.addWidget(self.projectExplorerTree) |
|
5610 | layout.addWidget(self.projectExplorerTree) | |
5608 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5611 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5609 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5612 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5610 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5613 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5611 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5614 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5612 | self.projectExplorerTree.expandAll() |
|
5615 | self.projectExplorerTree.expandAll() | |
5613 | # set model Project Properties |
|
5616 | # set model Project Properties | |
5614 |
|
5617 | |||
5615 | self.propertiesModel = TreeModel() |
|
5618 | self.propertiesModel = TreeModel() | |
5616 | self.propertiesModel.initProjectView() |
|
5619 | self.propertiesModel.initProjectView() | |
5617 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5620 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5618 | self.treeProjectProperties.expandAll() |
|
5621 | self.treeProjectProperties.expandAll() | |
5619 | self.treeProjectProperties.allColumnsShowFocus() |
|
5622 | self.treeProjectProperties.allColumnsShowFocus() | |
5620 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5623 | self.treeProjectProperties.resizeColumnToContents(1) | |
5621 |
|
5624 | |||
5622 | # set Project |
|
5625 | # set Project | |
5623 | self.pronTxs.setEnabled(False) |
|
5626 | self.pronTxs.setEnabled(False) | |
5624 | self.proComByBlock.setEnabled(False) |
|
5627 | self.proComByBlock.setEnabled(False) | |
5625 | self.proExpLabel.setEnabled(False) |
|
5628 | self.proExpLabel.setEnabled(False) | |
5626 | self.proDelay.setEnabled(False) |
|
5629 | self.proDelay.setEnabled(False) | |
5627 | self.proSet.setEnabled(True) |
|
5630 | self.proSet.setEnabled(True) | |
5628 | self.proDataType.setReadOnly(True) |
|
5631 | self.proDataType.setReadOnly(True) | |
5629 |
|
5632 | |||
5630 | # set Operation Voltage |
|
5633 | # set Operation Voltage | |
5631 | self.volOpComChannels.setEnabled(False) |
|
5634 | self.volOpComChannels.setEnabled(False) | |
5632 | self.volOpComHeights.setEnabled(False) |
|
5635 | self.volOpComHeights.setEnabled(False) | |
5633 | self.volOpFilter.setEnabled(False) |
|
5636 | self.volOpFilter.setEnabled(False) | |
5634 | self.volOpComProfile.setEnabled(False) |
|
5637 | self.volOpComProfile.setEnabled(False) | |
5635 | self.volOpComCode.setEnabled(False) |
|
5638 | self.volOpComCode.setEnabled(False) | |
5636 | self.volOpFlip.setEnabled(False) |
|
5639 | self.volOpFlip.setEnabled(False) | |
5637 | self.volOpCohInt.setEnabled(False) |
|
5640 | self.volOpCohInt.setEnabled(False) | |
5638 | self.volOpRadarfrequency.setEnabled(False) |
|
5641 | self.volOpRadarfrequency.setEnabled(False) | |
5639 |
|
5642 | |||
5640 | self.volOpChannel.setEnabled(False) |
|
5643 | self.volOpChannel.setEnabled(False) | |
5641 | self.volOpHeights.setEnabled(False) |
|
5644 | self.volOpHeights.setEnabled(False) | |
5642 | self.volOpProfile.setEnabled(False) |
|
5645 | self.volOpProfile.setEnabled(False) | |
5643 | self.volOpComMode.setEnabled(False) |
|
5646 | self.volOpComMode.setEnabled(False) | |
5644 |
|
5647 | |||
5645 | self.volOpReshaper.setEnabled(False) |
|
5648 | self.volOpReshaper.setEnabled(False) | |
5646 | self.volOpAdjustHei.setEnabled(False) |
|
5649 | self.volOpAdjustHei.setEnabled(False) | |
5647 |
|
5650 | |||
5648 | self.volOpCebReshaper.setEnabled(False) |
|
5651 | self.volOpCebReshaper.setEnabled(False) | |
5649 | self.volOpCebAdjustHei.setEnabled(False) |
|
5652 | self.volOpCebAdjustHei.setEnabled(False) | |
5650 |
|
5653 | |||
5651 | self.volGraphPath.setEnabled(False) |
|
5654 | self.volGraphPath.setEnabled(False) | |
5652 | self.volGraphPrefix.setEnabled(False) |
|
5655 | self.volGraphPrefix.setEnabled(False) | |
5653 | self.volGraphToolPath.setEnabled(False) |
|
5656 | self.volGraphToolPath.setEnabled(False) | |
5654 |
|
5657 | |||
5655 | # set Graph Voltage |
|
5658 | # set Graph Voltage | |
5656 | self.volGraphChannelList.setEnabled(False) |
|
5659 | self.volGraphChannelList.setEnabled(False) | |
5657 | self.volGraphIntensityRange.setEnabled(False) |
|
5660 | self.volGraphIntensityRange.setEnabled(False) | |
5658 | self.volGraphHeightrange.setEnabled(False) |
|
5661 | self.volGraphHeightrange.setEnabled(False) | |
5659 |
|
5662 | |||
5660 | # set Operation Spectra |
|
5663 | # set Operation Spectra | |
5661 | self.specOpnFFTpoints.setEnabled(False) |
|
5664 | self.specOpnFFTpoints.setEnabled(False) | |
5662 | self.specOpProfiles.setEnabled(False) |
|
5665 | self.specOpProfiles.setEnabled(False) | |
5663 | self.specOpippFactor.setEnabled(False) |
|
5666 | self.specOpippFactor.setEnabled(False) | |
5664 | self.specOppairsList.setEnabled(False) |
|
5667 | self.specOppairsList.setEnabled(False) | |
5665 |
|
5668 | |||
5666 | self.specOpComCrossSpectra.setEnabled(False) |
|
5669 | self.specOpComCrossSpectra.setEnabled(False) | |
5667 | self.specOpComChannel.setEnabled(False) |
|
5670 | self.specOpComChannel.setEnabled(False) | |
5668 | self.specOpComHeights.setEnabled(False) |
|
5671 | self.specOpComHeights.setEnabled(False) | |
5669 | self.specOpIncoherent.setEnabled(False) |
|
5672 | self.specOpIncoherent.setEnabled(False) | |
5670 | self.specOpgetNoise.setEnabled(False) |
|
5673 | self.specOpgetNoise.setEnabled(False) | |
5671 | self.specOpRadarfrequency.setEnabled(False) |
|
5674 | self.specOpRadarfrequency.setEnabled(False) | |
5672 |
|
5675 | |||
5673 |
|
5676 | |||
5674 | self.specOpChannel.setEnabled(False) |
|
5677 | self.specOpChannel.setEnabled(False) | |
5675 | self.specOpHeights.setEnabled(False) |
|
5678 | self.specOpHeights.setEnabled(False) | |
5676 | # set Graph Spectra |
|
5679 | # set Graph Spectra | |
5677 | self.specGgraphChannelList.setEnabled(False) |
|
5680 | self.specGgraphChannelList.setEnabled(False) | |
5678 | self.specGgraphFreq.setEnabled(False) |
|
5681 | self.specGgraphFreq.setEnabled(False) | |
5679 | self.specGgraphHeight.setEnabled(False) |
|
5682 | self.specGgraphHeight.setEnabled(False) | |
5680 | self.specGgraphDbsrange.setEnabled(False) |
|
5683 | self.specGgraphDbsrange.setEnabled(False) | |
5681 | self.specGgraphmagnitud.setEnabled(False) |
|
5684 | self.specGgraphmagnitud.setEnabled(False) | |
5682 | self.specGgraphTminTmax.setEnabled(False) |
|
5685 | self.specGgraphTminTmax.setEnabled(False) | |
5683 | self.specGgraphTimeRange.setEnabled(False) |
|
5686 | self.specGgraphTimeRange.setEnabled(False) | |
5684 | self.specGraphPath.setEnabled(False) |
|
5687 | self.specGraphPath.setEnabled(False) | |
5685 | self.specGraphToolPath.setEnabled(False) |
|
5688 | self.specGraphToolPath.setEnabled(False) | |
5686 | self.specGraphPrefix.setEnabled(False) |
|
5689 | self.specGraphPrefix.setEnabled(False) | |
5687 |
|
5690 | |||
5688 | self.specGgraphftpratio.setEnabled(False) |
|
5691 | self.specGgraphftpratio.setEnabled(False) | |
5689 | # set Operation SpectraHeis |
|
5692 | # set Operation SpectraHeis | |
5690 | self.specHeisOpIncoherent.setEnabled(False) |
|
5693 | self.specHeisOpIncoherent.setEnabled(False) | |
5691 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5694 | self.specHeisOpCobIncInt.setEnabled(False) | |
5692 | # set Graph SpectraHeis |
|
5695 | # set Graph SpectraHeis | |
5693 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5696 | self.specHeisGgraphChannelList.setEnabled(False) | |
5694 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5697 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5695 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5698 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5696 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5699 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5697 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5700 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5698 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5701 | self.specHeisGgraphftpratio.setEnabled(False) | |
5699 | self.specHeisGraphPath.setEnabled(False) |
|
5702 | self.specHeisGraphPath.setEnabled(False) | |
5700 | self.specHeisGraphPrefix.setEnabled(False) |
|
5703 | self.specHeisGraphPrefix.setEnabled(False) | |
5701 | self.specHeisGraphToolPath.setEnabled(False) |
|
5704 | self.specHeisGraphToolPath.setEnabled(False) | |
5702 |
|
5705 | |||
5703 | self.proComWalk.setCurrentIndex(0) |
|
5706 | self.proComWalk.setCurrentIndex(0) | |
5704 |
|
5707 | |||
5705 | # tool tip gui |
|
5708 | # tool tip gui | |
5706 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5709 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5707 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5710 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5708 | # tool tip gui project |
|
5711 | # tool tip gui project | |
5709 |
|
5712 | |||
5710 | # tool tip gui volOp |
|
5713 | # tool tip gui volOp | |
5711 | # self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5714 | # self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5712 | # self.volOpHeights.setToolTip('Example: 90,180') |
|
5715 | # self.volOpHeights.setToolTip('Example: 90,180') | |
5713 | # self.volOpFilter.setToolTip('Example: 2') |
|
5716 | # self.volOpFilter.setToolTip('Example: 2') | |
5714 | # self.volOpProfile.setToolTip('Example:0,127') |
|
5717 | # self.volOpProfile.setToolTip('Example:0,127') | |
5715 | # self.volOpCohInt.setToolTip('Example: 128') |
|
5718 | # self.volOpCohInt.setToolTip('Example: 128') | |
5716 | # self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5719 | # self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5717 | # self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5720 | # self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5718 | # # tool tip gui volGraph |
|
5721 | # # tool tip gui volGraph | |
5719 | # self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') |
|
5722 | # self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') | |
5720 | # self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5723 | # self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5721 | # tool tip gui specOp |
|
5724 | # tool tip gui specOp | |
5722 | # self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5725 | # self.specOpnFFTpoints.setToolTip('Example: 128') | |
5723 | # self.specOpProfiles.setToolTip('Example: 128') |
|
5726 | # self.specOpProfiles.setToolTip('Example: 128') | |
5724 | # self.specOpippFactor.setToolTip('Example:1.0') |
|
5727 | # self.specOpippFactor.setToolTip('Example:1.0') | |
5725 | # self.specOpIncoherent.setToolTip('Example: 10') |
|
5728 | # self.specOpIncoherent.setToolTip('Example: 10') | |
5726 | # self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5729 | # self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5727 | # |
|
5730 | # | |
5728 | # self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5731 | # self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5729 | # self.specOpHeights.setToolTip('Example: 90,180') |
|
5732 | # self.specOpHeights.setToolTip('Example: 90,180') | |
5730 | # self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5733 | # self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5731 | # # tool tip gui specGraph |
|
5734 | # # tool tip gui specGraph | |
5732 | # |
|
5735 | # | |
5733 | # self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5736 | # self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5734 | # self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5737 | # self.specGgraphFreq.setToolTip('Example: -20,20') | |
5735 | # self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5738 | # self.specGgraphHeight.setToolTip('Example: 100,400') | |
5736 | # self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5739 | # self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5737 | # |
|
5740 | # | |
5738 | # self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5741 | # self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5739 | # |
|
5742 | # | |
5740 | # |
|
5743 | # | |
5741 | # self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5744 | # self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5742 | # |
|
5745 | # | |
5743 | # self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5746 | # self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5744 | # self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5747 | # self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5745 | # self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5748 | # self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5746 | # self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5749 | # self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5747 | # self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5750 | # self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5748 |
|
5751 | |||
5749 | self.labelSet.show() |
|
5752 | self.labelSet.show() | |
5750 | self.proSet.show() |
|
5753 | self.proSet.show() | |
5751 |
|
5754 | |||
5752 | self.labelIPPKm.hide() |
|
5755 | self.labelIPPKm.hide() | |
5753 | self.proIPPKm.hide() |
|
5756 | self.proIPPKm.hide() | |
5754 |
|
5757 | |||
5755 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5758 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5756 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5759 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5757 |
|
5760 | |||
5758 |
|
5761 | |||
5759 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5762 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5760 | """ |
|
5763 | """ | |
5761 | Class documentation goes here. |
|
5764 | Class documentation goes here. | |
5762 | """ |
|
5765 | """ | |
5763 | closed = pyqtSignal() |
|
5766 | closed = pyqtSignal() | |
5764 | create = False |
|
5767 | create = False | |
5765 |
|
5768 | |||
5766 | def __init__(self, parent=None): |
|
5769 | def __init__(self, parent=None): | |
5767 | """ |
|
5770 | """ | |
5768 | Constructor |
|
5771 | Constructor | |
5769 | """ |
|
5772 | """ | |
5770 | QMainWindow.__init__(self, parent) |
|
5773 | QMainWindow.__init__(self, parent) | |
5771 | self.setupUi(self) |
|
5774 | self.setupUi(self) | |
5772 | self.getFromWindow = None |
|
5775 | self.getFromWindow = None | |
5773 | self.getfromWindowList = [] |
|
5776 | self.getfromWindowList = [] | |
5774 | self.dataTypeProject = None |
|
5777 | self.dataTypeProject = None | |
5775 |
|
5778 | |||
5776 | self.listUP = None |
|
5779 | self.listUP = None | |
5777 |
|
5780 | |||
5778 | @pyqtSignature("") |
|
5781 | @pyqtSignature("") | |
5779 | def on_unitPokbut_clicked(self): |
|
5782 | def on_unitPokbut_clicked(self): | |
5780 | """ |
|
5783 | """ | |
5781 | Slot documentation goes here. |
|
5784 | Slot documentation goes here. | |
5782 | """ |
|
5785 | """ | |
5783 | self.create = True |
|
5786 | self.create = True | |
5784 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5787 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5785 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5788 | # self.nameofUP= str(self.nameUptxt.text()) | |
5786 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5789 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5787 | self.close() |
|
5790 | self.close() | |
5788 |
|
5791 | |||
5789 |
|
5792 | |||
5790 | @pyqtSignature("") |
|
5793 | @pyqtSignature("") | |
5791 | def on_unitPcancelbut_clicked(self): |
|
5794 | def on_unitPcancelbut_clicked(self): | |
5792 | """ |
|
5795 | """ | |
5793 | Slot documentation goes here. |
|
5796 | Slot documentation goes here. | |
5794 | """ |
|
5797 | """ | |
5795 | self.create = False |
|
5798 | self.create = False | |
5796 | self.close() |
|
5799 | self.close() | |
5797 |
|
5800 | |||
5798 | def loadTotalList(self): |
|
5801 | def loadTotalList(self): | |
5799 | self.comboInputBox.clear() |
|
5802 | self.comboInputBox.clear() | |
5800 | for i in self.getfromWindowList: |
|
5803 | for i in self.getfromWindowList: | |
5801 |
|
5804 | |||
5802 | name = i.getElementName() |
|
5805 | name = i.getElementName() | |
5803 | if name == 'Project': |
|
5806 | if name == 'Project': | |
5804 | id = i.id |
|
5807 | id = i.id | |
5805 | name = i.name |
|
5808 | name = i.name | |
5806 | if self.dataTypeProject == 'Voltage': |
|
5809 | if self.dataTypeProject == 'Voltage': | |
5807 | self.comboTypeBox.clear() |
|
5810 | self.comboTypeBox.clear() | |
5808 | self.comboTypeBox.addItem("Voltage") |
|
5811 | self.comboTypeBox.addItem("Voltage") | |
5809 |
|
5812 | |||
5810 | if self.dataTypeProject == 'Spectra': |
|
5813 | if self.dataTypeProject == 'Spectra': | |
5811 | self.comboTypeBox.clear() |
|
5814 | self.comboTypeBox.clear() | |
5812 | self.comboTypeBox.addItem("Spectra") |
|
5815 | self.comboTypeBox.addItem("Spectra") | |
5813 | self.comboTypeBox.addItem("Correlation") |
|
5816 | self.comboTypeBox.addItem("Correlation") | |
5814 | if self.dataTypeProject == 'Fits': |
|
5817 | if self.dataTypeProject == 'Fits': | |
5815 | self.comboTypeBox.clear() |
|
5818 | self.comboTypeBox.clear() | |
5816 | self.comboTypeBox.addItem("SpectraHeis") |
|
5819 | self.comboTypeBox.addItem("SpectraHeis") | |
5817 |
|
5820 | |||
5818 |
|
5821 | |||
5819 | if name == 'ProcUnit': |
|
5822 | if name == 'ProcUnit': | |
5820 | id = int(i.id) - 1 |
|
5823 | id = int(i.id) - 1 | |
5821 | name = i.datatype |
|
5824 | name = i.datatype | |
5822 | if name == 'Voltage': |
|
5825 | if name == 'Voltage': | |
5823 | self.comboTypeBox.clear() |
|
5826 | self.comboTypeBox.clear() | |
5824 | self.comboTypeBox.addItem("Spectra") |
|
5827 | self.comboTypeBox.addItem("Spectra") | |
5825 | self.comboTypeBox.addItem("SpectraHeis") |
|
5828 | self.comboTypeBox.addItem("SpectraHeis") | |
5826 | self.comboTypeBox.addItem("Correlation") |
|
5829 | self.comboTypeBox.addItem("Correlation") | |
5827 | if name == 'Spectra': |
|
5830 | if name == 'Spectra': | |
5828 | self.comboTypeBox.clear() |
|
5831 | self.comboTypeBox.clear() | |
5829 | self.comboTypeBox.addItem("Spectra") |
|
5832 | self.comboTypeBox.addItem("Spectra") | |
5830 | self.comboTypeBox.addItem("SpectraHeis") |
|
5833 | self.comboTypeBox.addItem("SpectraHeis") | |
5831 | self.comboTypeBox.addItem("Correlation") |
|
5834 | self.comboTypeBox.addItem("Correlation") | |
5832 | if name == 'SpectraHeis': |
|
5835 | if name == 'SpectraHeis': | |
5833 | self.comboTypeBox.clear() |
|
5836 | self.comboTypeBox.clear() | |
5834 | self.comboTypeBox.addItem("SpectraHeis") |
|
5837 | self.comboTypeBox.addItem("SpectraHeis") | |
5835 |
|
5838 | |||
5836 | self.comboInputBox.addItem(str(name)) |
|
5839 | self.comboInputBox.addItem(str(name)) | |
5837 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5840 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5838 |
|
5841 | |||
5839 | def closeEvent(self, event): |
|
5842 | def closeEvent(self, event): | |
5840 | self.closed.emit() |
|
5843 | self.closed.emit() | |
5841 | event.accept() |
|
5844 | event.accept() | |
5842 |
|
5845 | |||
5843 | class Ftp(QMainWindow, Ui_Ftp): |
|
5846 | class Ftp(QMainWindow, Ui_Ftp): | |
5844 | """ |
|
5847 | """ | |
5845 | Class documentation goes here. |
|
5848 | Class documentation goes here. | |
5846 | """ |
|
5849 | """ | |
5847 | create = False |
|
5850 | create = False | |
5848 | closed = pyqtSignal() |
|
5851 | closed = pyqtSignal() | |
5849 | server = None |
|
5852 | server = None | |
5850 | remotefolder = None |
|
5853 | remotefolder = None | |
5851 | username = None |
|
5854 | username = None | |
5852 | password = None |
|
5855 | password = None | |
5853 | ftp_wei = None |
|
5856 | ftp_wei = None | |
5854 | exp_code = None |
|
5857 | exp_code = None | |
5855 | sub_exp_code = None |
|
5858 | sub_exp_code = None | |
5856 | plot_pos = None |
|
5859 | plot_pos = None | |
5857 |
|
5860 | |||
5858 | def __init__(self, parent=None): |
|
5861 | def __init__(self, parent=None): | |
5859 | """ |
|
5862 | """ | |
5860 | Constructor |
|
5863 | Constructor | |
5861 | """ |
|
5864 | """ | |
5862 | QMainWindow.__init__(self, parent) |
|
5865 | QMainWindow.__init__(self, parent) | |
5863 | self.setupUi(self) |
|
5866 | self.setupUi(self) | |
5864 | self.setGUIStatus() |
|
5867 | self.setGUIStatus() | |
5865 |
|
5868 | |||
5866 | def setGUIStatus(self): |
|
5869 | def setGUIStatus(self): | |
5867 | self.setWindowTitle("ROJ-Signal Chain") |
|
5870 | self.setWindowTitle("ROJ-Signal Chain") | |
5868 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5871 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5869 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5872 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5870 | self.usernameFTP.setToolTip('Example: myusername') |
|
5873 | self.usernameFTP.setToolTip('Example: myusername') | |
5871 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5874 | self.passwordFTP.setToolTip('Example: mypass ') | |
5872 | self.weightFTP.setToolTip('Example: 0') |
|
5875 | self.weightFTP.setToolTip('Example: 0') | |
5873 | self.expcodeFTP.setToolTip('Example: 0') |
|
5876 | self.expcodeFTP.setToolTip('Example: 0') | |
5874 | self.subexpFTP.setToolTip('Example: 0') |
|
5877 | self.subexpFTP.setToolTip('Example: 0') | |
5875 | self.plotposFTP.setToolTip('Example: 0') |
|
5878 | self.plotposFTP.setToolTip('Example: 0') | |
5876 |
|
5879 | |||
5877 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5880 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5878 | self.serverFTP.setText(str(server)) |
|
5881 | self.serverFTP.setText(str(server)) | |
5879 | self.folderFTP.setText(str(remotefolder)) |
|
5882 | self.folderFTP.setText(str(remotefolder)) | |
5880 | self.usernameFTP.setText(str(username)) |
|
5883 | self.usernameFTP.setText(str(username)) | |
5881 | self.passwordFTP.setText(str(password)) |
|
5884 | self.passwordFTP.setText(str(password)) | |
5882 | self.weightFTP.setText(str(ftp_wei)) |
|
5885 | self.weightFTP.setText(str(ftp_wei)) | |
5883 | self.expcodeFTP.setText(str(exp_code)) |
|
5886 | self.expcodeFTP.setText(str(exp_code)) | |
5884 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5887 | self.subexpFTP.setText(str(sub_exp_code)) | |
5885 | self.plotposFTP.setText(str(plot_pos)) |
|
5888 | self.plotposFTP.setText(str(plot_pos)) | |
5886 |
|
5889 | |||
5887 | def getParmsFromFtpWindow(self): |
|
5890 | def getParmsFromFtpWindow(self): | |
5888 | """ |
|
5891 | """ | |
5889 | Return Inputs Project: |
|
5892 | Return Inputs Project: | |
5890 | - server |
|
5893 | - server | |
5891 | - remotefolder |
|
5894 | - remotefolder | |
5892 | - username |
|
5895 | - username | |
5893 | - password |
|
5896 | - password | |
5894 | - ftp_wei |
|
5897 | - ftp_wei | |
5895 | - exp_code |
|
5898 | - exp_code | |
5896 | - sub_exp_code |
|
5899 | - sub_exp_code | |
5897 | - plot_pos |
|
5900 | - plot_pos | |
5898 | """ |
|
5901 | """ | |
5899 | name_server_ftp = str(self.serverFTP.text()) |
|
5902 | name_server_ftp = str(self.serverFTP.text()) | |
5900 | if not name_server_ftp: |
|
5903 | if not name_server_ftp: | |
5901 | self.console.clear() |
|
5904 | self.console.clear() | |
5902 | self.console.append("Please Write a FTP Server") |
|
5905 | self.console.append("Please Write a FTP Server") | |
5903 | return 0 |
|
5906 | return 0 | |
5904 |
|
5907 | |||
5905 | folder_server_ftp = str(self.folderFTP.text()) |
|
5908 | folder_server_ftp = str(self.folderFTP.text()) | |
5906 | if not folder_server_ftp: |
|
5909 | if not folder_server_ftp: | |
5907 | self.console.clear() |
|
5910 | self.console.clear() | |
5908 | self.console.append("Please Write a Folder") |
|
5911 | self.console.append("Please Write a Folder") | |
5909 | return 0 |
|
5912 | return 0 | |
5910 |
|
5913 | |||
5911 | username_ftp = str(self.usernameFTP.text()) |
|
5914 | username_ftp = str(self.usernameFTP.text()) | |
5912 | if not username_ftp: |
|
5915 | if not username_ftp: | |
5913 | self.console.clear() |
|
5916 | self.console.clear() | |
5914 | self.console.append("Please Write a User Name") |
|
5917 | self.console.append("Please Write a User Name") | |
5915 | return 0 |
|
5918 | return 0 | |
5916 |
|
5919 | |||
5917 | password_ftp = str(self.passwordFTP.text()) |
|
5920 | password_ftp = str(self.passwordFTP.text()) | |
5918 | if not password_ftp: |
|
5921 | if not password_ftp: | |
5919 | self.console.clear() |
|
5922 | self.console.clear() | |
5920 | self.console.append("Please Write a passwordFTP") |
|
5923 | self.console.append("Please Write a passwordFTP") | |
5921 | return 0 |
|
5924 | return 0 | |
5922 |
|
5925 | |||
5923 | ftp_wei = str(self.weightFTP.text()) |
|
5926 | ftp_wei = str(self.weightFTP.text()) | |
5924 | if not ftp_wei == "": |
|
5927 | if not ftp_wei == "": | |
5925 | try: |
|
5928 | try: | |
5926 | ftp_wei = int(self.weightFTP.text()) |
|
5929 | ftp_wei = int(self.weightFTP.text()) | |
5927 | except: |
|
5930 | except: | |
5928 | self.console.clear() |
|
5931 | self.console.clear() | |
5929 | self.console.append("Please Write a ftp_wei number") |
|
5932 | self.console.append("Please Write a ftp_wei number") | |
5930 | return 0 |
|
5933 | return 0 | |
5931 |
|
5934 | |||
5932 | exp_code = str(self.expcodeFTP.text()) |
|
5935 | exp_code = str(self.expcodeFTP.text()) | |
5933 | if not exp_code == "": |
|
5936 | if not exp_code == "": | |
5934 | try: |
|
5937 | try: | |
5935 | exp_code = int(self.expcodeFTP.text()) |
|
5938 | exp_code = int(self.expcodeFTP.text()) | |
5936 | except: |
|
5939 | except: | |
5937 | self.console.clear() |
|
5940 | self.console.clear() | |
5938 | self.console.append("Please Write a exp_code number") |
|
5941 | self.console.append("Please Write a exp_code number") | |
5939 | return 0 |
|
5942 | return 0 | |
5940 |
|
5943 | |||
5941 |
|
5944 | |||
5942 | sub_exp_code = str(self.subexpFTP.text()) |
|
5945 | sub_exp_code = str(self.subexpFTP.text()) | |
5943 | if not sub_exp_code == "": |
|
5946 | if not sub_exp_code == "": | |
5944 | try: |
|
5947 | try: | |
5945 | sub_exp_code = int(self.subexpFTP.text()) |
|
5948 | sub_exp_code = int(self.subexpFTP.text()) | |
5946 | except: |
|
5949 | except: | |
5947 | self.console.clear() |
|
5950 | self.console.clear() | |
5948 | self.console.append("Please Write a sub_exp_code number") |
|
5951 | self.console.append("Please Write a sub_exp_code number") | |
5949 | return 0 |
|
5952 | return 0 | |
5950 |
|
5953 | |||
5951 | plot_pos = str(self.plotposFTP.text()) |
|
5954 | plot_pos = str(self.plotposFTP.text()) | |
5952 | if not plot_pos == "": |
|
5955 | if not plot_pos == "": | |
5953 | try: |
|
5956 | try: | |
5954 | plot_pos = int(self.plotposFTP.text()) |
|
5957 | plot_pos = int(self.plotposFTP.text()) | |
5955 | except: |
|
5958 | except: | |
5956 | self.console.clear() |
|
5959 | self.console.clear() | |
5957 | self.console.append("Please Write a plot_pos number") |
|
5960 | self.console.append("Please Write a plot_pos number") | |
5958 | return 0 |
|
5961 | return 0 | |
5959 |
|
5962 | |||
5960 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5963 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5961 |
|
5964 | |||
5962 | @pyqtSignature("") |
|
5965 | @pyqtSignature("") | |
5963 | def on_ftpOkButton_clicked(self): |
|
5966 | def on_ftpOkButton_clicked(self): | |
5964 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5967 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5965 | self.create = True |
|
5968 | self.create = True | |
5966 | self.close() |
|
5969 | self.close() | |
5967 |
|
5970 | |||
5968 | @pyqtSignature("") |
|
5971 | @pyqtSignature("") | |
5969 | def on_ftpCancelButton_clicked(self): |
|
5972 | def on_ftpCancelButton_clicked(self): | |
5970 | self.create = False |
|
5973 | self.create = False | |
5971 | self.close() |
|
5974 | self.close() | |
5972 |
|
5975 | |||
5973 | def closeEvent(self, event): |
|
5976 | def closeEvent(self, event): | |
5974 | self.closed.emit() |
|
5977 | self.closed.emit() | |
5975 | event.accept() |
|
5978 | event.accept() | |
5976 |
|
5979 | |||
5977 | class ftpBuffer(): |
|
5980 | class ftpBuffer(): | |
5978 |
|
5981 | |||
5979 | server = None |
|
5982 | server = None | |
5980 | remotefolder = None |
|
5983 | remotefolder = None | |
5981 | username = None |
|
5984 | username = None | |
5982 | password = None |
|
5985 | password = None | |
5983 | ftp_wei = None |
|
5986 | ftp_wei = None | |
5984 | exp_code = None |
|
5987 | exp_code = None | |
5985 | sub_exp_code = None |
|
5988 | sub_exp_code = None | |
5986 | plot_pos = None |
|
5989 | plot_pos = None | |
5987 | create = False |
|
5990 | create = False | |
5988 | withoutconfig = False |
|
5991 | withoutconfig = False | |
5989 | createforView = False |
|
5992 | createforView = False | |
5990 | localfolder = None |
|
5993 | localfolder = None | |
5991 | extension = None |
|
5994 | extension = None | |
5992 | period = None |
|
5995 | period = None | |
5993 | protocol = None |
|
5996 | protocol = None | |
5994 |
|
5997 | |||
5995 | def __init__(self): |
|
5998 | def __init__(self): | |
5996 |
|
5999 | |||
5997 | self.create = False |
|
6000 | self.create = False | |
5998 | self.server = None |
|
6001 | self.server = None | |
5999 | self.remotefolder = None |
|
6002 | self.remotefolder = None | |
6000 | self.username = None |
|
6003 | self.username = None | |
6001 | self.password = None |
|
6004 | self.password = None | |
6002 | self.ftp_wei = None |
|
6005 | self.ftp_wei = None | |
6003 | self.exp_code = None |
|
6006 | self.exp_code = None | |
6004 | self.sub_exp_code = None |
|
6007 | self.sub_exp_code = None | |
6005 | self.plot_pos = None |
|
6008 | self.plot_pos = None | |
6006 | # self.create = False |
|
6009 | # self.create = False | |
6007 | self.localfolder = None |
|
6010 | self.localfolder = None | |
6008 | self.extension = None |
|
6011 | self.extension = None | |
6009 | self.period = None |
|
6012 | self.period = None | |
6010 | self.protocol = None |
|
6013 | self.protocol = None | |
6011 |
|
6014 | |||
6012 | def setwithoutconfiguration(self): |
|
6015 | def setwithoutconfiguration(self): | |
6013 |
|
6016 | |||
6014 | self.create = False |
|
6017 | self.create = False | |
6015 | self.server = "jro-app.igp.gob.pe" |
|
6018 | self.server = "jro-app.igp.gob.pe" | |
6016 | self.remotefolder = "/home/wmaster/graficos" |
|
6019 | self.remotefolder = "/home/wmaster/graficos" | |
6017 | self.username = "wmaster" |
|
6020 | self.username = "wmaster" | |
6018 | self.password = "mst2010vhf" |
|
6021 | self.password = "mst2010vhf" | |
6019 | self.withoutconfig = True |
|
6022 | self.withoutconfig = True | |
6020 | self.localfolder = './' |
|
6023 | self.localfolder = './' | |
6021 | self.extension = '.png' |
|
6024 | self.extension = '.png' | |
6022 | self.period = 60 |
|
6025 | self.period = 60 | |
6023 | self.protocol = 'ftp' |
|
6026 | self.protocol = 'ftp' | |
6024 | self.createforView = True |
|
6027 | self.createforView = True | |
6025 |
|
6028 | |||
6026 | if not self.ftp_wei: |
|
6029 | if not self.ftp_wei: | |
6027 | self.ftp_wei = 0 |
|
6030 | self.ftp_wei = 0 | |
6028 |
|
6031 | |||
6029 | if not self.exp_code: |
|
6032 | if not self.exp_code: | |
6030 | self.exp_code = 0 |
|
6033 | self.exp_code = 0 | |
6031 |
|
6034 | |||
6032 | if not self.sub_exp_code: |
|
6035 | if not self.sub_exp_code: | |
6033 | self.sub_exp_code = 0 |
|
6036 | self.sub_exp_code = 0 | |
6034 |
|
6037 | |||
6035 | if not self.plot_pos: |
|
6038 | if not self.plot_pos: | |
6036 | self.plot_pos = 0 |
|
6039 | self.plot_pos = 0 | |
6037 |
|
6040 | |||
6038 | def save(self, server, remotefolder, username, password, ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, localfolder='./', extension='.png', period=60, protocol='ftp'): |
|
6041 | def save(self, server, remotefolder, username, password, ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, localfolder='./', extension='.png', period=60, protocol='ftp'): | |
6039 |
|
6042 | |||
6040 | self.server = server |
|
6043 | self.server = server | |
6041 | self.remotefolder = remotefolder |
|
6044 | self.remotefolder = remotefolder | |
6042 | self.username = username |
|
6045 | self.username = username | |
6043 | self.password = password |
|
6046 | self.password = password | |
6044 | self.ftp_wei = ftp_wei |
|
6047 | self.ftp_wei = ftp_wei | |
6045 | self.exp_code = exp_code |
|
6048 | self.exp_code = exp_code | |
6046 | self.sub_exp_code = sub_exp_code |
|
6049 | self.sub_exp_code = sub_exp_code | |
6047 | self.plot_pos = plot_pos |
|
6050 | self.plot_pos = plot_pos | |
6048 | self.create = True |
|
6051 | self.create = True | |
6049 | self.withoutconfig = False |
|
6052 | self.withoutconfig = False | |
6050 | self.createforView = True |
|
6053 | self.createforView = True | |
6051 | self.localfolder = localfolder |
|
6054 | self.localfolder = localfolder | |
6052 | self.extension = extension |
|
6055 | self.extension = extension | |
6053 | self.period = period |
|
6056 | self.period = period | |
6054 | self.protocol = protocol |
|
6057 | self.protocol = protocol | |
6055 |
|
6058 | |||
6056 | def recover(self): |
|
6059 | def recover(self): | |
6057 |
|
6060 | |||
6058 | return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol |
|
6061 | return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol | |
6059 |
|
6062 | |||
6060 | class ShowMeConsole(QtCore.QObject): |
|
6063 | class ShowMeConsole(QtCore.QObject): | |
6061 |
|
6064 | |||
6062 | textWritten = QtCore.pyqtSignal(str) |
|
6065 | textWritten = QtCore.pyqtSignal(str) | |
6063 |
|
6066 | |||
6064 | def write(self, text): |
|
6067 | def write(self, text): | |
6065 |
|
6068 | |||
6066 | if len(text) == 0: |
|
6069 | if len(text) == 0: | |
6067 | self.textWritten.emit("\n") |
|
6070 | self.textWritten.emit("\n") | |
6068 | return |
|
6071 | return | |
6069 |
|
6072 | |||
6070 | if text[-1] == "\n": |
|
6073 | if text[-1] == "\n": | |
6071 | text = text[:-1] |
|
6074 | text = text[:-1] | |
6072 |
|
6075 | |||
6073 | self.textWritten.emit(str(text)) |
|
6076 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now