@@ -1,6074 +1,6074 | |||||
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 | value = str(self.volOpFlip.text()) |
|
1062 | value = str(self.volOpFlip.text()) | |
1063 |
|
1063 | |||
1064 | if value: |
|
1064 | if value: | |
1065 |
|
1065 | |||
1066 | name_parameter = 'channelList' |
|
1066 | name_parameter = 'channelList' | |
1067 | format = 'intlist' |
|
1067 | format = 'intlist' | |
1068 |
|
1068 | |||
1069 | if not isIntList(value): |
|
1069 | if not isIntList(value): | |
1070 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1070 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1071 | return 0 |
|
1071 | return 0 | |
1072 |
|
1072 | |||
1073 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1073 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1074 |
|
1074 | |||
1075 | if self.volOpCebCohInt.isChecked(): |
|
1075 | if self.volOpCebCohInt.isChecked(): | |
1076 | name_operation = 'CohInt' |
|
1076 | name_operation = 'CohInt' | |
1077 | optype = 'other' |
|
1077 | optype = 'other' | |
1078 | value = str(self.volOpCohInt.text()) |
|
1078 | value = str(self.volOpCohInt.text()) | |
1079 |
|
1079 | |||
1080 | if not isInt(value): |
|
1080 | if not isInt(value): | |
1081 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1081 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1082 | return 0 |
|
1082 | return 0 | |
1083 |
|
1083 | |||
1084 | name_parameter = 'n' |
|
1084 | name_parameter = 'n' | |
1085 | format = 'int' |
|
1085 | format = 'int' | |
1086 |
|
1086 | |||
1087 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1087 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1088 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1088 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1089 |
|
1089 | |||
1090 | if self.volGraphCebshow.isChecked(): |
|
1090 | if self.volGraphCebshow.isChecked(): | |
1091 | name_operation = 'Scope' |
|
1091 | name_operation = 'Scope' | |
1092 | optype = 'other' |
|
1092 | optype = 'other' | |
1093 |
|
1093 | |||
1094 | name_parameter1 = 'id' |
|
1094 | name_parameter1 = 'id' | |
1095 | format1 = 'int' |
|
1095 | format1 = 'int' | |
1096 |
|
1096 | |||
1097 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1097 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1098 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
1098 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
1099 |
|
1099 | |||
1100 | channelList = str(self.volGraphChannelList.text()).strip() |
|
1100 | channelList = str(self.volGraphChannelList.text()).strip() | |
1101 | xvalue = str(self.volGraphHeightrange.text()).strip() |
|
1101 | xvalue = str(self.volGraphHeightrange.text()).strip() | |
1102 | yvalue = str(self.volGraphIntensityRange.text()).strip() |
|
1102 | yvalue = str(self.volGraphIntensityRange.text()).strip() | |
1103 | figpath = str(self.volGraphPath.text()).strip() |
|
1103 | figpath = str(self.volGraphPath.text()).strip() | |
1104 | figfile = str(self.volGraphPrefix.text()).strip() |
|
1104 | figfile = str(self.volGraphPrefix.text()).strip() | |
1105 |
|
1105 | |||
1106 | if channelList != "": |
|
1106 | if channelList != "": | |
1107 | if not isIntList(channelList): |
|
1107 | if not isIntList(channelList): | |
1108 | self.console.append("Invalid value '%s' for 'Graphics:ChannelList'" %(channelList)) |
|
1108 | self.console.append("Invalid value '%s' for 'Graphics:ChannelList'" %(channelList)) | |
1109 | return 0 |
|
1109 | return 0 | |
1110 |
|
1110 | |||
1111 | if xvalue != "": |
|
1111 | if xvalue != "": | |
1112 | if not isFloatRange(xvalue): |
|
1112 | if not isFloatRange(xvalue): | |
1113 | self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(xvalue)) |
|
1113 | self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(xvalue)) | |
1114 | return 0 |
|
1114 | return 0 | |
1115 |
|
1115 | |||
1116 | if yvalue != "": |
|
1116 | if yvalue != "": | |
1117 | if not isFloatRange(yvalue): |
|
1117 | if not isFloatRange(yvalue): | |
1118 | self.console.append("Invalid value '%s' for 'Graphics:Amplitude-Range'" %(yvalue)) |
|
1118 | self.console.append("Invalid value '%s' for 'Graphics:Amplitude-Range'" %(yvalue)) | |
1119 | return 0 |
|
1119 | return 0 | |
1120 |
|
1120 | |||
1121 |
|
1121 | |||
1122 | if channelList: |
|
1122 | if channelList: | |
1123 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1123 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1124 |
|
1124 | |||
1125 | if xvalue: |
|
1125 | if xvalue: | |
1126 | xvalueList = xvalue.split(',') |
|
1126 | xvalueList = xvalue.split(',') | |
1127 |
|
1127 | |||
1128 | opObj.addParameter(name='xmin', value=xvalueList[0], format='float') |
|
1128 | opObj.addParameter(name='xmin', value=xvalueList[0], format='float') | |
1129 | opObj.addParameter(name='xmax', value=xvalueList[1], format='float') |
|
1129 | opObj.addParameter(name='xmax', value=xvalueList[1], format='float') | |
1130 |
|
1130 | |||
1131 | if yvalue: |
|
1131 | if yvalue: | |
1132 | yvalueList = yvalue.split(",") |
|
1132 | yvalueList = yvalue.split(",") | |
1133 |
|
1133 | |||
1134 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') |
|
1134 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') | |
1135 | opObj.addParameter(name='ymax', value=yvalueList[1], format='int') |
|
1135 | opObj.addParameter(name='ymax', value=yvalueList[1], format='int') | |
1136 |
|
1136 | |||
1137 | plot_type = self.volComScopeType.currentIndex() |
|
1137 | plot_type = self.volComScopeType.currentIndex() | |
1138 |
|
1138 | |||
1139 | if plot_type == 0: |
|
1139 | if plot_type == 0: | |
1140 | opObj.addParameter(name='type', value="iq") |
|
1140 | opObj.addParameter(name='type', value="iq") | |
1141 | if plot_type == 1: |
|
1141 | if plot_type == 1: | |
1142 | opObj.addParameter(name='type', value="power") |
|
1142 | opObj.addParameter(name='type', value="power") | |
1143 |
|
1143 | |||
1144 | if self.volGraphCebSave.isChecked(): |
|
1144 | if self.volGraphCebSave.isChecked(): | |
1145 | checkPath = True |
|
1145 | checkPath = True | |
1146 |
|
1146 | |||
1147 | opObj.addParameter(name='save', value='1', format='int') |
|
1147 | opObj.addParameter(name='save', value='1', format='int') | |
1148 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1148 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1149 |
|
1149 | |||
1150 | if figfile: |
|
1150 | if figfile: | |
1151 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1151 | opObj.addParameter(name='figfile', value=value, format='str') | |
1152 |
|
1152 | |||
1153 | if checkPath: |
|
1153 | if checkPath: | |
1154 |
|
1154 | |||
1155 | if not figpath: |
|
1155 | if not figpath: | |
1156 | self.console.clear() |
|
1156 | self.console.clear() | |
1157 | self.console.append("Graphic path should be defined") |
|
1157 | self.console.append("Graphic path should be defined") | |
1158 | return 0 |
|
1158 | return 0 | |
1159 |
|
1159 | |||
1160 | if os.path.isdir(figpath): |
|
1160 | # if os.path.isdir(figpath): | |
1161 | self.console.clear() |
|
1161 | # self.console.clear() | |
1162 | 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") | |
1163 | return 0 |
|
1163 | # return 0 | |
1164 |
|
1164 | |||
1165 | self.console.clear() |
|
1165 | self.console.clear() | |
1166 |
|
1166 | |||
1167 | # if something happend |
|
1167 | # if something happend | |
1168 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1168 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1169 | if parms_ok: |
|
1169 | if parms_ok: | |
1170 | name_operation = 'VoltageWriter' |
|
1170 | name_operation = 'VoltageWriter' | |
1171 | optype = 'other' |
|
1171 | optype = 'other' | |
1172 | name_parameter1 = 'path' |
|
1172 | name_parameter1 = 'path' | |
1173 | name_parameter2 = 'blocksPerFile' |
|
1173 | name_parameter2 = 'blocksPerFile' | |
1174 | name_parameter3 = 'profilesPerBlock' |
|
1174 | name_parameter3 = 'profilesPerBlock' | |
1175 | value1 = output_path |
|
1175 | value1 = output_path | |
1176 | value2 = blocksperfile |
|
1176 | value2 = blocksperfile | |
1177 | value3 = profilesperblock |
|
1177 | value3 = profilesperblock | |
1178 | format = "int" |
|
1178 | format = "int" | |
1179 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1179 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1180 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1180 | opObj.addParameter(name=name_parameter1, value=value1) | |
1181 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1181 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1182 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1182 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1183 |
|
1183 | |||
1184 | try: |
|
1184 | try: | |
1185 | self.refreshPUProperties(puObj) |
|
1185 | self.refreshPUProperties(puObj) | |
1186 | except: |
|
1186 | except: | |
1187 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1187 | self.console.append("An error reading input parameters was found ...Check them!") | |
1188 | return 0 |
|
1188 | return 0 | |
1189 |
|
1189 | |||
1190 | self.console.append("Save your project and press Play button to start signal processing") |
|
1190 | self.console.append("Save your project and press Play button to start signal processing") | |
1191 |
|
1191 | |||
1192 | self._enable_play_button() |
|
1192 | self._enable_play_button() | |
1193 | self._enable_save_button() |
|
1193 | self._enable_save_button() | |
1194 |
|
1194 | |||
1195 | return 1 |
|
1195 | return 1 | |
1196 |
|
1196 | |||
1197 | @pyqtSignature("") |
|
1197 | @pyqtSignature("") | |
1198 | def on_volGraphClear_clicked(self): |
|
1198 | def on_volGraphClear_clicked(self): | |
1199 |
|
1199 | |||
1200 | self.console.clear() |
|
1200 | self.console.clear() | |
1201 |
|
1201 | |||
1202 | """ |
|
1202 | """ | |
1203 | Voltage Graph |
|
1203 | Voltage Graph | |
1204 | """ |
|
1204 | """ | |
1205 | @pyqtSignature("int") |
|
1205 | @pyqtSignature("int") | |
1206 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1206 | def on_volGraphCebSave_stateChanged(self, p0): | |
1207 | """ |
|
1207 | """ | |
1208 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1208 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1209 | """ |
|
1209 | """ | |
1210 | if p0 == 2: |
|
1210 | if p0 == 2: | |
1211 | self.volGraphPath.setEnabled(True) |
|
1211 | self.volGraphPath.setEnabled(True) | |
1212 | self.volGraphPrefix.setEnabled(True) |
|
1212 | self.volGraphPrefix.setEnabled(True) | |
1213 | self.volGraphToolPath.setEnabled(True) |
|
1213 | self.volGraphToolPath.setEnabled(True) | |
1214 |
|
1214 | |||
1215 | if p0 == 0: |
|
1215 | if p0 == 0: | |
1216 | self.volGraphPath.setEnabled(False) |
|
1216 | self.volGraphPath.setEnabled(False) | |
1217 | self.volGraphPrefix.setEnabled(False) |
|
1217 | self.volGraphPrefix.setEnabled(False) | |
1218 | self.volGraphToolPath.setEnabled(False) |
|
1218 | self.volGraphToolPath.setEnabled(False) | |
1219 |
|
1219 | |||
1220 | @pyqtSignature("") |
|
1220 | @pyqtSignature("") | |
1221 | def on_volGraphToolPath_clicked(self): |
|
1221 | def on_volGraphToolPath_clicked(self): | |
1222 | """ |
|
1222 | """ | |
1223 | Donde se guardan los DATOS |
|
1223 | Donde se guardan los DATOS | |
1224 | """ |
|
1224 | """ | |
1225 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1225 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1226 | self.volGraphPath.setText(save_path) |
|
1226 | self.volGraphPath.setText(save_path) | |
1227 |
|
1227 | |||
1228 | if not os.path.exists(save_path): |
|
1228 | if not os.path.exists(save_path): | |
1229 | self.console.clear() |
|
1229 | self.console.clear() | |
1230 | self.console.append("Set a valid path") |
|
1230 | self.console.append("Set a valid path") | |
1231 | self.volGraphOk.setEnabled(False) |
|
1231 | self.volGraphOk.setEnabled(False) | |
1232 | return |
|
1232 | return | |
1233 |
|
1233 | |||
1234 | @pyqtSignature("int") |
|
1234 | @pyqtSignature("int") | |
1235 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1235 | def on_volGraphCebshow_stateChanged(self, p0): | |
1236 | """ |
|
1236 | """ | |
1237 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1237 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1238 | """ |
|
1238 | """ | |
1239 | if p0 == 0: |
|
1239 | if p0 == 0: | |
1240 |
|
1240 | |||
1241 | self.volGraphChannelList.setEnabled(False) |
|
1241 | self.volGraphChannelList.setEnabled(False) | |
1242 | self.volGraphIntensityRange.setEnabled(False) |
|
1242 | self.volGraphIntensityRange.setEnabled(False) | |
1243 | self.volGraphHeightrange.setEnabled(False) |
|
1243 | self.volGraphHeightrange.setEnabled(False) | |
1244 | if p0 == 2: |
|
1244 | if p0 == 2: | |
1245 |
|
1245 | |||
1246 | self.volGraphChannelList.setEnabled(True) |
|
1246 | self.volGraphChannelList.setEnabled(True) | |
1247 | self.volGraphIntensityRange.setEnabled(True) |
|
1247 | self.volGraphIntensityRange.setEnabled(True) | |
1248 | self.volGraphHeightrange.setEnabled(True) |
|
1248 | self.volGraphHeightrange.setEnabled(True) | |
1249 |
|
1249 | |||
1250 | """ |
|
1250 | """ | |
1251 | Spectra operation |
|
1251 | Spectra operation | |
1252 | """ |
|
1252 | """ | |
1253 | @pyqtSignature("int") |
|
1253 | @pyqtSignature("int") | |
1254 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1254 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1255 | """ |
|
1255 | """ | |
1256 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1256 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1257 | """ |
|
1257 | """ | |
1258 | if p0 == 2: |
|
1258 | if p0 == 2: | |
1259 | self.specOpRadarfrequency.setEnabled(True) |
|
1259 | self.specOpRadarfrequency.setEnabled(True) | |
1260 | if p0 == 0: |
|
1260 | if p0 == 0: | |
1261 | # self.specOpRadarfrequency.clear() |
|
1261 | # self.specOpRadarfrequency.clear() | |
1262 | self.specOpRadarfrequency.setEnabled(False) |
|
1262 | self.specOpRadarfrequency.setEnabled(False) | |
1263 |
|
1263 | |||
1264 |
|
1264 | |||
1265 | @pyqtSignature("int") |
|
1265 | @pyqtSignature("int") | |
1266 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1266 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1267 | """ |
|
1267 | """ | |
1268 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1268 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1269 | """ |
|
1269 | """ | |
1270 | if p0 == 2: |
|
1270 | if p0 == 2: | |
1271 | # self.specOpnFFTpoints.setEnabled(True) |
|
1271 | # self.specOpnFFTpoints.setEnabled(True) | |
1272 | self.specOpComCrossSpectra.setEnabled(True) |
|
1272 | self.specOpComCrossSpectra.setEnabled(True) | |
1273 | self.specOppairsList.setEnabled(True) |
|
1273 | self.specOppairsList.setEnabled(True) | |
1274 |
|
1274 | |||
1275 | if p0 == 0: |
|
1275 | if p0 == 0: | |
1276 | # self.specOpnFFTpoints.setEnabled(False) |
|
1276 | # self.specOpnFFTpoints.setEnabled(False) | |
1277 | self.specOpComCrossSpectra.setEnabled(False) |
|
1277 | self.specOpComCrossSpectra.setEnabled(False) | |
1278 | self.specOppairsList.setEnabled(False) |
|
1278 | self.specOppairsList.setEnabled(False) | |
1279 |
|
1279 | |||
1280 | @pyqtSignature("int") |
|
1280 | @pyqtSignature("int") | |
1281 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1281 | def on_specOpCebChannel_stateChanged(self, p0): | |
1282 | """ |
|
1282 | """ | |
1283 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1283 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1284 | """ |
|
1284 | """ | |
1285 | if p0 == 2: |
|
1285 | if p0 == 2: | |
1286 | self.specOpChannel.setEnabled(True) |
|
1286 | self.specOpChannel.setEnabled(True) | |
1287 | self.specOpComChannel.setEnabled(True) |
|
1287 | self.specOpComChannel.setEnabled(True) | |
1288 | if p0 == 0: |
|
1288 | if p0 == 0: | |
1289 | self.specOpChannel.setEnabled(False) |
|
1289 | self.specOpChannel.setEnabled(False) | |
1290 | self.specOpComChannel.setEnabled(False) |
|
1290 | self.specOpComChannel.setEnabled(False) | |
1291 |
|
1291 | |||
1292 | @pyqtSignature("int") |
|
1292 | @pyqtSignature("int") | |
1293 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1293 | def on_specOpCebHeights_stateChanged(self, p0): | |
1294 | """ |
|
1294 | """ | |
1295 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1295 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1296 | """ |
|
1296 | """ | |
1297 | if p0 == 2: |
|
1297 | if p0 == 2: | |
1298 | self.specOpComHeights.setEnabled(True) |
|
1298 | self.specOpComHeights.setEnabled(True) | |
1299 | self.specOpHeights.setEnabled(True) |
|
1299 | self.specOpHeights.setEnabled(True) | |
1300 | if p0 == 0: |
|
1300 | if p0 == 0: | |
1301 | self.specOpComHeights.setEnabled(False) |
|
1301 | self.specOpComHeights.setEnabled(False) | |
1302 | self.specOpHeights.setEnabled(False) |
|
1302 | self.specOpHeights.setEnabled(False) | |
1303 |
|
1303 | |||
1304 |
|
1304 | |||
1305 | @pyqtSignature("int") |
|
1305 | @pyqtSignature("int") | |
1306 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1306 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1307 | """ |
|
1307 | """ | |
1308 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1308 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1309 | """ |
|
1309 | """ | |
1310 | if p0 == 2: |
|
1310 | if p0 == 2: | |
1311 | self.specOpIncoherent.setEnabled(True) |
|
1311 | self.specOpIncoherent.setEnabled(True) | |
1312 | if p0 == 0: |
|
1312 | if p0 == 0: | |
1313 | self.specOpIncoherent.setEnabled(False) |
|
1313 | self.specOpIncoherent.setEnabled(False) | |
1314 |
|
1314 | |||
1315 | @pyqtSignature("int") |
|
1315 | @pyqtSignature("int") | |
1316 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1316 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1317 | """ |
|
1317 | """ | |
1318 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1318 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1319 | """ |
|
1319 | """ | |
1320 | if p0 == 2: |
|
1320 | if p0 == 2: | |
1321 | self.specOpComRemoveDC.setEnabled(True) |
|
1321 | self.specOpComRemoveDC.setEnabled(True) | |
1322 | if p0 == 0: |
|
1322 | if p0 == 0: | |
1323 | self.specOpComRemoveDC.setEnabled(False) |
|
1323 | self.specOpComRemoveDC.setEnabled(False) | |
1324 |
|
1324 | |||
1325 | @pyqtSignature("int") |
|
1325 | @pyqtSignature("int") | |
1326 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1326 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1327 | """ |
|
1327 | """ | |
1328 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1328 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1329 | """ |
|
1329 | """ | |
1330 | if p0 == 2: |
|
1330 | if p0 == 2: | |
1331 | self.specOpgetNoise.setEnabled(True) |
|
1331 | self.specOpgetNoise.setEnabled(True) | |
1332 |
|
1332 | |||
1333 | if p0 == 0: |
|
1333 | if p0 == 0: | |
1334 | self.specOpgetNoise.setEnabled(False) |
|
1334 | self.specOpgetNoise.setEnabled(False) | |
1335 |
|
1335 | |||
1336 | @pyqtSignature("") |
|
1336 | @pyqtSignature("") | |
1337 | def on_specOpOk_clicked(self): |
|
1337 | def on_specOpOk_clicked(self): | |
1338 | """ |
|
1338 | """ | |
1339 | AΓADE OPERACION SPECTRA |
|
1339 | AΓADE OPERACION SPECTRA | |
1340 | """ |
|
1340 | """ | |
1341 |
|
1341 | |||
1342 | addFTP = False |
|
1342 | addFTP = False | |
1343 | checkPath = False |
|
1343 | checkPath = False | |
1344 |
|
1344 | |||
1345 | self._disable_play_button() |
|
1345 | self._disable_play_button() | |
1346 | self._disable_save_button() |
|
1346 | self._disable_save_button() | |
1347 |
|
1347 | |||
1348 | self.console.clear() |
|
1348 | self.console.clear() | |
1349 | self.console.append("Checking input parameters:\n") |
|
1349 | self.console.append("Checking input parameters:\n") | |
1350 |
|
1350 | |||
1351 | projectObj = self.getSelectedProjectObj() |
|
1351 | projectObj = self.getSelectedProjectObj() | |
1352 |
|
1352 | |||
1353 | if not projectObj: |
|
1353 | if not projectObj: | |
1354 | self.console.append("Please select a project before update it") |
|
1354 | self.console.append("Please select a project before update it") | |
1355 | return |
|
1355 | return | |
1356 |
|
1356 | |||
1357 | puObj = self.getSelectedItemObj() |
|
1357 | puObj = self.getSelectedItemObj() | |
1358 |
|
1358 | |||
1359 | puObj.removeOperations() |
|
1359 | puObj.removeOperations() | |
1360 |
|
1360 | |||
1361 | if self.specOpCebRadarfrequency.isChecked(): |
|
1361 | if self.specOpCebRadarfrequency.isChecked(): | |
1362 | value = str(self.specOpRadarfrequency.text()) |
|
1362 | value = str(self.specOpRadarfrequency.text()) | |
1363 | format = 'float' |
|
1363 | format = 'float' | |
1364 | name_operation = 'setRadarFrequency' |
|
1364 | name_operation = 'setRadarFrequency' | |
1365 | name_parameter = 'frequency' |
|
1365 | name_parameter = 'frequency' | |
1366 |
|
1366 | |||
1367 | if not isFloat(value): |
|
1367 | if not isFloat(value): | |
1368 | self.console.clear() |
|
1368 | self.console.clear() | |
1369 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1369 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1370 | return 0 |
|
1370 | return 0 | |
1371 |
|
1371 | |||
1372 | radarfreq = float(value)*1e6 |
|
1372 | radarfreq = float(value)*1e6 | |
1373 | opObj = puObj.addOperation(name=name_operation) |
|
1373 | opObj = puObj.addOperation(name=name_operation) | |
1374 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1374 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1375 |
|
1375 | |||
1376 | inputId = puObj.getInputId() |
|
1376 | inputId = puObj.getInputId() | |
1377 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1377 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1378 |
|
1378 | |||
1379 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1379 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1380 |
|
1380 | |||
1381 | value = str(self.specOpnFFTpoints.text()) |
|
1381 | value = str(self.specOpnFFTpoints.text()) | |
1382 |
|
1382 | |||
1383 | if not isInt(value): |
|
1383 | if not isInt(value): | |
1384 | self.console.append("Invalid value [%s] for '%s'" %(value, 'nFFTPoints')) |
|
1384 | self.console.append("Invalid value [%s] for '%s'" %(value, 'nFFTPoints')) | |
1385 | return 0 |
|
1385 | return 0 | |
1386 |
|
1386 | |||
1387 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1387 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1388 |
|
1388 | |||
1389 | value = str(self.specOpProfiles.text()) |
|
1389 | value = str(self.specOpProfiles.text()) | |
1390 | if not isInt(value): |
|
1390 | if not isInt(value): | |
1391 | self.console.append("Please write a value on Profiles field") |
|
1391 | self.console.append("Please write a value on Profiles field") | |
1392 | else: |
|
1392 | else: | |
1393 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1393 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1394 |
|
1394 | |||
1395 | value = str(self.specOpippFactor.text()) |
|
1395 | value = str(self.specOpippFactor.text()) | |
1396 | if not isInt(value): |
|
1396 | if not isInt(value): | |
1397 | self.console.append("Please write a value on IppFactor field") |
|
1397 | self.console.append("Please write a value on IppFactor field") | |
1398 | else: |
|
1398 | else: | |
1399 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1399 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1400 |
|
1400 | |||
1401 | if self.specOpCebCrossSpectra.isChecked(): |
|
1401 | if self.specOpCebCrossSpectra.isChecked(): | |
1402 | name_parameter = 'pairsList' |
|
1402 | name_parameter = 'pairsList' | |
1403 | format = 'pairslist' |
|
1403 | format = 'pairslist' | |
1404 | value = str(self.specOppairsList.text()) |
|
1404 | value = str(self.specOppairsList.text()) | |
1405 |
|
1405 | |||
1406 | if not isPairList(value): |
|
1406 | if not isPairList(value): | |
1407 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1407 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1408 | return 0 |
|
1408 | return 0 | |
1409 |
|
1409 | |||
1410 | puObj.addParameter(name=name_parameter, value=value, format=format) |
|
1410 | puObj.addParameter(name=name_parameter, value=value, format=format) | |
1411 |
|
1411 | |||
1412 | if self.specOpCebHeights.isChecked(): |
|
1412 | if self.specOpCebHeights.isChecked(): | |
1413 | value = str(self.specOpHeights.text()) |
|
1413 | value = str(self.specOpHeights.text()) | |
1414 |
|
1414 | |||
1415 | if not isFloatRange(value): |
|
1415 | if not isFloatRange(value): | |
1416 | self.console.append("Invalid value [%s] for Height range" %value) |
|
1416 | self.console.append("Invalid value [%s] for Height range" %value) | |
1417 | return 0 |
|
1417 | return 0 | |
1418 |
|
1418 | |||
1419 | valueList = value.split(',') |
|
1419 | valueList = value.split(',') | |
1420 | value0 = valueList[0] |
|
1420 | value0 = valueList[0] | |
1421 | value1 = valueList[1] |
|
1421 | value1 = valueList[1] | |
1422 |
|
1422 | |||
1423 | if self.specOpComHeights.currentIndex() == 0: |
|
1423 | if self.specOpComHeights.currentIndex() == 0: | |
1424 | name_operation = 'selectHeights' |
|
1424 | name_operation = 'selectHeights' | |
1425 | name_parameter1 = 'minHei' |
|
1425 | name_parameter1 = 'minHei' | |
1426 | name_parameter2 = 'maxHei' |
|
1426 | name_parameter2 = 'maxHei' | |
1427 | else: |
|
1427 | else: | |
1428 | name_operation = 'selectHeightsByIndex' |
|
1428 | name_operation = 'selectHeightsByIndex' | |
1429 | name_parameter1 = 'minIndex' |
|
1429 | name_parameter1 = 'minIndex' | |
1430 | name_parameter2 = 'maxIndex' |
|
1430 | name_parameter2 = 'maxIndex' | |
1431 |
|
1431 | |||
1432 | format = 'float' |
|
1432 | format = 'float' | |
1433 |
|
1433 | |||
1434 | opObj = puObj.addOperation(name=name_operation) |
|
1434 | opObj = puObj.addOperation(name=name_operation) | |
1435 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1435 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1436 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1436 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1437 |
|
1437 | |||
1438 | if self.specOpCebChannel.isChecked(): |
|
1438 | if self.specOpCebChannel.isChecked(): | |
1439 |
|
1439 | |||
1440 | if self.specOpComChannel.currentIndex() == 0: |
|
1440 | if self.specOpComChannel.currentIndex() == 0: | |
1441 | name_operation = "selectChannels" |
|
1441 | name_operation = "selectChannels" | |
1442 | name_parameter = 'channelList' |
|
1442 | name_parameter = 'channelList' | |
1443 | else: |
|
1443 | else: | |
1444 | name_operation = "selectChannelsByIndex" |
|
1444 | name_operation = "selectChannelsByIndex" | |
1445 | name_parameter = 'channelIndexList' |
|
1445 | name_parameter = 'channelIndexList' | |
1446 |
|
1446 | |||
1447 | format = 'intlist' |
|
1447 | format = 'intlist' | |
1448 | value = str(self.specOpChannel.text()) |
|
1448 | value = str(self.specOpChannel.text()) | |
1449 |
|
1449 | |||
1450 | if not isIntList(value): |
|
1450 | if not isIntList(value): | |
1451 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1451 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1452 | return 0 |
|
1452 | return 0 | |
1453 |
|
1453 | |||
1454 | opObj = puObj.addOperation(name=name_operation) |
|
1454 | opObj = puObj.addOperation(name=name_operation) | |
1455 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1455 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1456 |
|
1456 | |||
1457 | if self.specOpCebIncoherent.isChecked(): |
|
1457 | if self.specOpCebIncoherent.isChecked(): | |
1458 |
|
1458 | |||
1459 | name_operation = 'IncohInt' |
|
1459 | name_operation = 'IncohInt' | |
1460 | optype = 'other' |
|
1460 | optype = 'other' | |
1461 |
|
1461 | |||
1462 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1462 | if self.specOpCobIncInt.currentIndex() == 0: | |
1463 | name_parameter = 'timeInterval' |
|
1463 | name_parameter = 'timeInterval' | |
1464 | format = 'float' |
|
1464 | format = 'float' | |
1465 | else: |
|
1465 | else: | |
1466 | name_parameter = 'n' |
|
1466 | name_parameter = 'n' | |
1467 | format = 'int' |
|
1467 | format = 'int' | |
1468 |
|
1468 | |||
1469 | value = str(self.specOpIncoherent.text()) |
|
1469 | value = str(self.specOpIncoherent.text()) | |
1470 |
|
1470 | |||
1471 | if not isFloat(value): |
|
1471 | if not isFloat(value): | |
1472 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) |
|
1472 | self.console.append("Invalid value [%s] for '%s'" %(value, name_parameter)) | |
1473 | return 0 |
|
1473 | return 0 | |
1474 |
|
1474 | |||
1475 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1475 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1476 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1476 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1477 |
|
1477 | |||
1478 | if self.specOpCebRemoveDC.isChecked(): |
|
1478 | if self.specOpCebRemoveDC.isChecked(): | |
1479 | name_operation = 'removeDC' |
|
1479 | name_operation = 'removeDC' | |
1480 | name_parameter = 'mode' |
|
1480 | name_parameter = 'mode' | |
1481 | format = 'int' |
|
1481 | format = 'int' | |
1482 |
|
1482 | |||
1483 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1483 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1484 | value = 1 |
|
1484 | value = 1 | |
1485 | else: |
|
1485 | else: | |
1486 | value = 2 |
|
1486 | value = 2 | |
1487 |
|
1487 | |||
1488 | opObj = puObj.addOperation(name=name_operation) |
|
1488 | opObj = puObj.addOperation(name=name_operation) | |
1489 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1489 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1490 |
|
1490 | |||
1491 | if self.specOpCebRemoveInt.isChecked(): |
|
1491 | if self.specOpCebRemoveInt.isChecked(): | |
1492 | name_operation = 'removeInterference' |
|
1492 | name_operation = 'removeInterference' | |
1493 | opObj = puObj.addOperation(name=name_operation) |
|
1493 | opObj = puObj.addOperation(name=name_operation) | |
1494 |
|
1494 | |||
1495 |
|
1495 | |||
1496 | if self.specOpCebgetNoise.isChecked(): |
|
1496 | if self.specOpCebgetNoise.isChecked(): | |
1497 | value = str(self.specOpgetNoise.text()) |
|
1497 | value = str(self.specOpgetNoise.text()) | |
1498 | valueList = value.split(',') |
|
1498 | valueList = value.split(',') | |
1499 | format = 'float' |
|
1499 | format = 'float' | |
1500 | name_operation = "getNoise" |
|
1500 | name_operation = "getNoise" | |
1501 | opObj = puObj.addOperation(name=name_operation) |
|
1501 | opObj = puObj.addOperation(name=name_operation) | |
1502 |
|
1502 | |||
1503 | if not value == '': |
|
1503 | if not value == '': | |
1504 | valueList = value.split(',') |
|
1504 | valueList = value.split(',') | |
1505 | length = len(valueList) |
|
1505 | length = len(valueList) | |
1506 | if length == 1: |
|
1506 | if length == 1: | |
1507 | try: |
|
1507 | try: | |
1508 | value1 = float(valueList[0]) |
|
1508 | value1 = float(valueList[0]) | |
1509 | except: |
|
1509 | except: | |
1510 | self.console.clear() |
|
1510 | self.console.clear() | |
1511 | self.console.append("Please Write correct parameter Get Noise") |
|
1511 | self.console.append("Please Write correct parameter Get Noise") | |
1512 | return 0 |
|
1512 | return 0 | |
1513 | name1 = 'minHei' |
|
1513 | name1 = 'minHei' | |
1514 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1514 | opObj.addParameter(name=name1, value=value1, format=format) | |
1515 | elif length == 2: |
|
1515 | elif length == 2: | |
1516 | try: |
|
1516 | try: | |
1517 | value1 = float(valueList[0]) |
|
1517 | value1 = float(valueList[0]) | |
1518 | value2 = float(valueList[1]) |
|
1518 | value2 = float(valueList[1]) | |
1519 | except: |
|
1519 | except: | |
1520 | self.console.clear() |
|
1520 | self.console.clear() | |
1521 | self.console.append("Please Write corrects parameter Get Noise") |
|
1521 | self.console.append("Please Write corrects parameter Get Noise") | |
1522 | return 0 |
|
1522 | return 0 | |
1523 | name1 = 'minHei' |
|
1523 | name1 = 'minHei' | |
1524 | name2 = 'maxHei' |
|
1524 | name2 = 'maxHei' | |
1525 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1525 | opObj.addParameter(name=name1, value=value1, format=format) | |
1526 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1526 | opObj.addParameter(name=name2, value=value2, format=format) | |
1527 |
|
1527 | |||
1528 | elif length == 3: |
|
1528 | elif length == 3: | |
1529 | try: |
|
1529 | try: | |
1530 | value1 = float(valueList[0]) |
|
1530 | value1 = float(valueList[0]) | |
1531 | value2 = float(valueList[1]) |
|
1531 | value2 = float(valueList[1]) | |
1532 | value3 = float(valueList[2]) |
|
1532 | value3 = float(valueList[2]) | |
1533 | except: |
|
1533 | except: | |
1534 | self.console.clear() |
|
1534 | self.console.clear() | |
1535 | self.console.append("Please Write corrects parameter Get Noise") |
|
1535 | self.console.append("Please Write corrects parameter Get Noise") | |
1536 | return 0 |
|
1536 | return 0 | |
1537 | name1 = 'minHei' |
|
1537 | name1 = 'minHei' | |
1538 | name2 = 'maxHei' |
|
1538 | name2 = 'maxHei' | |
1539 | name3 = 'minVel' |
|
1539 | name3 = 'minVel' | |
1540 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1540 | opObj.addParameter(name=name1, value=value1, format=format) | |
1541 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1541 | opObj.addParameter(name=name2, value=value2, format=format) | |
1542 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1542 | opObj.addParameter(name=name3, value=value3, format=format) | |
1543 |
|
1543 | |||
1544 | elif length == 4: |
|
1544 | elif length == 4: | |
1545 | try: |
|
1545 | try: | |
1546 | value1 = float(valueList[0]) |
|
1546 | value1 = float(valueList[0]) | |
1547 | value2 = float(valueList[1]) |
|
1547 | value2 = float(valueList[1]) | |
1548 | value3 = float(valueList[2]) |
|
1548 | value3 = float(valueList[2]) | |
1549 | value4 = float(valueList[3]) |
|
1549 | value4 = float(valueList[3]) | |
1550 | except: |
|
1550 | except: | |
1551 | self.console.clear() |
|
1551 | self.console.clear() | |
1552 | self.console.append("Please Write corrects parameter Get Noise") |
|
1552 | self.console.append("Please Write corrects parameter Get Noise") | |
1553 | return 0 |
|
1553 | return 0 | |
1554 | name1 = 'minHei' |
|
1554 | name1 = 'minHei' | |
1555 | name2 = 'maxHei' |
|
1555 | name2 = 'maxHei' | |
1556 | name3 = 'minVel' |
|
1556 | name3 = 'minVel' | |
1557 | name4 = 'maxVel' |
|
1557 | name4 = 'maxVel' | |
1558 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1558 | opObj.addParameter(name=name1, value=value1, format=format) | |
1559 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1559 | opObj.addParameter(name=name2, value=value2, format=format) | |
1560 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1560 | opObj.addParameter(name=name3, value=value3, format=format) | |
1561 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1561 | opObj.addParameter(name=name4, value=value4, format=format) | |
1562 |
|
1562 | |||
1563 | elif length > 4: |
|
1563 | elif length > 4: | |
1564 | self.console.clear() |
|
1564 | self.console.clear() | |
1565 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1565 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1566 | return 0 |
|
1566 | return 0 | |
1567 |
|
1567 | |||
1568 | channelList = str(self.specGgraphChannelList.text()).strip() |
|
1568 | channelList = str(self.specGgraphChannelList.text()).strip() | |
1569 | vel_range = str(self.specGgraphFreq.text()).strip() |
|
1569 | vel_range = str(self.specGgraphFreq.text()).strip() | |
1570 | hei_range = str(self.specGgraphHeight.text()).strip() |
|
1570 | hei_range = str(self.specGgraphHeight.text()).strip() | |
1571 | db_range = str(self.specGgraphDbsrange.text()).strip() |
|
1571 | db_range = str(self.specGgraphDbsrange.text()).strip() | |
1572 |
|
1572 | |||
1573 | trange = str(self.specGgraphTminTmax.text()).strip() |
|
1573 | trange = str(self.specGgraphTminTmax.text()).strip() | |
1574 | magrange = str(self.specGgraphmagnitud.text()).strip() |
|
1574 | magrange = str(self.specGgraphmagnitud.text()).strip() | |
1575 | phaserange = str(self.specGgraphPhase.text()).strip() |
|
1575 | phaserange = str(self.specGgraphPhase.text()).strip() | |
1576 | # timerange = str(self.specGgraphTimeRange.text()).strip() |
|
1576 | # timerange = str(self.specGgraphTimeRange.text()).strip() | |
1577 |
|
1577 | |||
1578 | figpath = str(self.specGraphPath.text()).strip() |
|
1578 | figpath = str(self.specGraphPath.text()).strip() | |
1579 | figfile = str(self.specGraphPrefix.text()).strip() |
|
1579 | figfile = str(self.specGraphPrefix.text()).strip() | |
1580 |
|
1580 | |||
1581 | try: |
|
1581 | try: | |
1582 | wrperiod = int(str(self.specGgraphftpratio.text()).strip()) |
|
1582 | wrperiod = int(str(self.specGgraphftpratio.text()).strip()) | |
1583 | except: |
|
1583 | except: | |
1584 | wrperiod = None |
|
1584 | wrperiod = None | |
1585 |
|
1585 | |||
1586 | #-----Spectra Plot----- |
|
1586 | #-----Spectra Plot----- | |
1587 | if self.specGraphCebSpectraplot.isChecked(): |
|
1587 | if self.specGraphCebSpectraplot.isChecked(): | |
1588 |
|
1588 | |||
1589 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1589 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1590 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1590 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1591 |
|
1591 | |||
1592 | if channelList: |
|
1592 | if channelList: | |
1593 |
|
1593 | |||
1594 | if not isList(channelList): |
|
1594 | if not isList(channelList): | |
1595 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1595 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1596 | return 0 |
|
1596 | return 0 | |
1597 |
|
1597 | |||
1598 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1598 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1599 |
|
1599 | |||
1600 | if vel_range: |
|
1600 | if vel_range: | |
1601 |
|
1601 | |||
1602 | if not isFloatRange(vel_range): |
|
1602 | if not isFloatRange(vel_range): | |
1603 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) |
|
1603 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) | |
1604 | return 0 |
|
1604 | return 0 | |
1605 |
|
1605 | |||
1606 | xvalueList = vel_range.split(',') |
|
1606 | xvalueList = vel_range.split(',') | |
1607 | value1 = float(xvalueList[0]) |
|
1607 | value1 = float(xvalueList[0]) | |
1608 | value2 = float(xvalueList[1]) |
|
1608 | value2 = float(xvalueList[1]) | |
1609 |
|
1609 | |||
1610 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1610 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1611 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1611 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1612 |
|
1612 | |||
1613 | if hei_range: |
|
1613 | if hei_range: | |
1614 |
|
1614 | |||
1615 | if not isFloatRange(hei_range): |
|
1615 | if not isFloatRange(hei_range): | |
1616 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1616 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1617 | return 0 |
|
1617 | return 0 | |
1618 |
|
1618 | |||
1619 | yvalueList = hei_range.split(",") |
|
1619 | yvalueList = hei_range.split(",") | |
1620 | value1 = float(yvalueList[0]) |
|
1620 | value1 = float(yvalueList[0]) | |
1621 | value2 = float(yvalueList[1]) |
|
1621 | value2 = float(yvalueList[1]) | |
1622 |
|
1622 | |||
1623 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1623 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1624 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1624 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1625 |
|
1625 | |||
1626 | if db_range: |
|
1626 | if db_range: | |
1627 |
|
1627 | |||
1628 | if not isFloatRange(db_range): |
|
1628 | if not isFloatRange(db_range): | |
1629 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1629 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1630 | return 0 |
|
1630 | return 0 | |
1631 |
|
1631 | |||
1632 | zvalueList = db_range.split(",") |
|
1632 | zvalueList = db_range.split(",") | |
1633 | value1 = float(zvalueList[0]) |
|
1633 | value1 = float(zvalueList[0]) | |
1634 | value2 = float(zvalueList[1]) |
|
1634 | value2 = float(zvalueList[1]) | |
1635 |
|
1635 | |||
1636 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1636 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1637 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1637 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1638 |
|
1638 | |||
1639 | if self.specGraphSaveSpectra.isChecked(): |
|
1639 | if self.specGraphSaveSpectra.isChecked(): | |
1640 |
|
1640 | |||
1641 | checkPath = True |
|
1641 | checkPath = True | |
1642 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1642 | opObj.addParameter(name='save', value=1 , format='bool') | |
1643 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1643 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1644 | if figfile: |
|
1644 | if figfile: | |
1645 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1645 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1646 | if wrperiod: |
|
1646 | if wrperiod: | |
1647 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1647 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1648 |
|
1648 | |||
1649 | if self.specGraphftpSpectra.isChecked(): |
|
1649 | if self.specGraphftpSpectra.isChecked(): | |
1650 |
|
1650 | |||
1651 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1651 | opObj.addParameter(name='ftp', value='1', format='int') | |
1652 | self.addFTPConf2Operation(puObj, opObj) |
|
1652 | self.addFTPConf2Operation(puObj, opObj) | |
1653 | addFTP = True |
|
1653 | addFTP = True | |
1654 |
|
1654 | |||
1655 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1655 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1656 |
|
1656 | |||
1657 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1657 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1658 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1658 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1659 |
|
1659 | |||
1660 | if vel_range: |
|
1660 | if vel_range: | |
1661 |
|
1661 | |||
1662 | if not isFloatRange(vel_range): |
|
1662 | if not isFloatRange(vel_range): | |
1663 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) |
|
1663 | self.console.append("Invalid value [%s] for 'Graphic:Velocity-Range" %(vel_range)) | |
1664 | return 0 |
|
1664 | return 0 | |
1665 |
|
1665 | |||
1666 | xvalueList = vel_range.split(',') |
|
1666 | xvalueList = vel_range.split(',') | |
1667 | value1 = float(xvalueList[0]) |
|
1667 | value1 = float(xvalueList[0]) | |
1668 | value2 = float(xvalueList[1]) |
|
1668 | value2 = float(xvalueList[1]) | |
1669 |
|
1669 | |||
1670 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1670 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1671 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1671 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1672 |
|
1672 | |||
1673 | if hei_range: |
|
1673 | if hei_range: | |
1674 |
|
1674 | |||
1675 | if not isFloatRange(hei_range): |
|
1675 | if not isFloatRange(hei_range): | |
1676 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1676 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1677 | return 0 |
|
1677 | return 0 | |
1678 |
|
1678 | |||
1679 | yvalueList = hei_range.split(",") |
|
1679 | yvalueList = hei_range.split(",") | |
1680 | value1 = float(yvalueList[0]) |
|
1680 | value1 = float(yvalueList[0]) | |
1681 | value2 = float(yvalueList[1]) |
|
1681 | value2 = float(yvalueList[1]) | |
1682 |
|
1682 | |||
1683 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1683 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1684 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1684 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1685 |
|
1685 | |||
1686 | if db_range: |
|
1686 | if db_range: | |
1687 |
|
1687 | |||
1688 | if not isFloatRange(db_range): |
|
1688 | if not isFloatRange(db_range): | |
1689 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1689 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1690 | return 0 |
|
1690 | return 0 | |
1691 |
|
1691 | |||
1692 | zvalueList = db_range.split(",") |
|
1692 | zvalueList = db_range.split(",") | |
1693 | value1 = float(zvalueList[0]) |
|
1693 | value1 = float(zvalueList[0]) | |
1694 | value2 = float(zvalueList[1]) |
|
1694 | value2 = float(zvalueList[1]) | |
1695 |
|
1695 | |||
1696 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1696 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1697 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1697 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1698 |
|
1698 | |||
1699 | if magrange: |
|
1699 | if magrange: | |
1700 |
|
1700 | |||
1701 | if not isFloatRange(magrange): |
|
1701 | if not isFloatRange(magrange): | |
1702 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) |
|
1702 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) | |
1703 | return 0 |
|
1703 | return 0 | |
1704 |
|
1704 | |||
1705 | zvalueList = magrange.split(",") |
|
1705 | zvalueList = magrange.split(",") | |
1706 | value1 = float(zvalueList[0]) |
|
1706 | value1 = float(zvalueList[0]) | |
1707 | value2 = float(zvalueList[1]) |
|
1707 | value2 = float(zvalueList[1]) | |
1708 |
|
1708 | |||
1709 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1709 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1710 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1710 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1711 |
|
1711 | |||
1712 | if phaserange: |
|
1712 | if phaserange: | |
1713 |
|
1713 | |||
1714 | if not isFloatRange(phaserange): |
|
1714 | if not isFloatRange(phaserange): | |
1715 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) |
|
1715 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) | |
1716 | return 0 |
|
1716 | return 0 | |
1717 |
|
1717 | |||
1718 | zvalueList = phaserange.split(",") |
|
1718 | zvalueList = phaserange.split(",") | |
1719 | value1 = float(zvalueList[0]) |
|
1719 | value1 = float(zvalueList[0]) | |
1720 | value2 = float(zvalueList[1]) |
|
1720 | value2 = float(zvalueList[1]) | |
1721 |
|
1721 | |||
1722 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1722 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1723 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1723 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1724 |
|
1724 | |||
1725 | if self.specGraphSaveCross.isChecked(): |
|
1725 | if self.specGraphSaveCross.isChecked(): | |
1726 | checkPath = True |
|
1726 | checkPath = True | |
1727 | opObj.addParameter(name='save', value='1', format='bool') |
|
1727 | opObj.addParameter(name='save', value='1', format='bool') | |
1728 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1728 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1729 | if figfile: |
|
1729 | if figfile: | |
1730 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1730 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1731 | if wrperiod: |
|
1731 | if wrperiod: | |
1732 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1732 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1733 |
|
1733 | |||
1734 | if self.specGraphftpCross.isChecked(): |
|
1734 | if self.specGraphftpCross.isChecked(): | |
1735 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1735 | opObj.addParameter(name='ftp', value='1', format='int') | |
1736 | self.addFTPConf2Operation(puObj, opObj) |
|
1736 | self.addFTPConf2Operation(puObj, opObj) | |
1737 | addFTP = True |
|
1737 | addFTP = True | |
1738 |
|
1738 | |||
1739 | if self.specGraphCebRTIplot.isChecked(): |
|
1739 | if self.specGraphCebRTIplot.isChecked(): | |
1740 |
|
1740 | |||
1741 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1741 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1742 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1742 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1743 |
|
1743 | |||
1744 | if channelList: |
|
1744 | if channelList: | |
1745 |
|
1745 | |||
1746 | if not isIntList(channelList): |
|
1746 | if not isIntList(channelList): | |
1747 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1747 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1748 | return 0 |
|
1748 | return 0 | |
1749 |
|
1749 | |||
1750 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1750 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1751 |
|
1751 | |||
1752 | if trange: |
|
1752 | if trange: | |
1753 |
|
1753 | |||
1754 | if not isFloatRange(trange): |
|
1754 | if not isFloatRange(trange): | |
1755 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1755 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1756 | return 0 |
|
1756 | return 0 | |
1757 |
|
1757 | |||
1758 | zvalueList = trange.split(",") |
|
1758 | zvalueList = trange.split(",") | |
1759 | value1 = float(zvalueList[0]) |
|
1759 | value1 = float(zvalueList[0]) | |
1760 | value2 = float(zvalueList[1]) |
|
1760 | value2 = float(zvalueList[1]) | |
1761 |
|
1761 | |||
1762 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1762 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1763 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1763 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1764 |
|
1764 | |||
1765 | if hei_range: |
|
1765 | if hei_range: | |
1766 |
|
1766 | |||
1767 | if not isFloatRange(hei_range): |
|
1767 | if not isFloatRange(hei_range): | |
1768 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1768 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1769 | return 0 |
|
1769 | return 0 | |
1770 |
|
1770 | |||
1771 | yvalueList = hei_range.split(",") |
|
1771 | yvalueList = hei_range.split(",") | |
1772 | value1 = float(yvalueList[0]) |
|
1772 | value1 = float(yvalueList[0]) | |
1773 | value2 = float(yvalueList[1]) |
|
1773 | value2 = float(yvalueList[1]) | |
1774 |
|
1774 | |||
1775 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1775 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1776 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1776 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1777 |
|
1777 | |||
1778 | if db_range: |
|
1778 | if db_range: | |
1779 |
|
1779 | |||
1780 | if not isFloatRange(db_range): |
|
1780 | if not isFloatRange(db_range): | |
1781 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1781 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1782 | return 0 |
|
1782 | return 0 | |
1783 |
|
1783 | |||
1784 | zvalueList = db_range.split(",") |
|
1784 | zvalueList = db_range.split(",") | |
1785 | value1 = float(zvalueList[0]) |
|
1785 | value1 = float(zvalueList[0]) | |
1786 | value2 = float(zvalueList[1]) |
|
1786 | value2 = float(zvalueList[1]) | |
1787 |
|
1787 | |||
1788 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1788 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1789 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1789 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1790 |
|
1790 | |||
1791 | if self.specGraphSaveRTIplot.isChecked(): |
|
1791 | if self.specGraphSaveRTIplot.isChecked(): | |
1792 | checkPath = True |
|
1792 | checkPath = True | |
1793 | opObj.addParameter(name='save', value='1', format='bool') |
|
1793 | opObj.addParameter(name='save', value='1', format='bool') | |
1794 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1794 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1795 | if figfile: |
|
1795 | if figfile: | |
1796 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1796 | opObj.addParameter(name='figfile', value=value, format='str') | |
1797 | if wrperiod: |
|
1797 | if wrperiod: | |
1798 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1798 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1799 |
|
1799 | |||
1800 | if self.specGraphftpRTIplot.isChecked(): |
|
1800 | if self.specGraphftpRTIplot.isChecked(): | |
1801 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1801 | opObj.addParameter(name='ftp', value='1', format='int') | |
1802 | self.addFTPConf2Operation(puObj, opObj) |
|
1802 | self.addFTPConf2Operation(puObj, opObj) | |
1803 | addFTP = True |
|
1803 | addFTP = True | |
1804 |
|
1804 | |||
1805 | if self.specGraphCebCoherencmap.isChecked(): |
|
1805 | if self.specGraphCebCoherencmap.isChecked(): | |
1806 |
|
1806 | |||
1807 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1807 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1808 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1808 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1809 |
|
1809 | |||
1810 | if trange: |
|
1810 | if trange: | |
1811 |
|
1811 | |||
1812 | if not isFloatRange(trange): |
|
1812 | if not isFloatRange(trange): | |
1813 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1813 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1814 | return 0 |
|
1814 | return 0 | |
1815 |
|
1815 | |||
1816 | zvalueList = trange.split(",") |
|
1816 | zvalueList = trange.split(",") | |
1817 | value1 = float(zvalueList[0]) |
|
1817 | value1 = float(zvalueList[0]) | |
1818 | value2 = float(zvalueList[1]) |
|
1818 | value2 = float(zvalueList[1]) | |
1819 |
|
1819 | |||
1820 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1820 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1821 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1821 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1822 |
|
1822 | |||
1823 | if hei_range: |
|
1823 | if hei_range: | |
1824 |
|
1824 | |||
1825 | if not isFloatRange(hei_range): |
|
1825 | if not isFloatRange(hei_range): | |
1826 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1826 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1827 | return 0 |
|
1827 | return 0 | |
1828 |
|
1828 | |||
1829 | yvalueList = hei_range.split(",") |
|
1829 | yvalueList = hei_range.split(",") | |
1830 | value1 = float(yvalueList[0]) |
|
1830 | value1 = float(yvalueList[0]) | |
1831 | value2 = float(yvalueList[1]) |
|
1831 | value2 = float(yvalueList[1]) | |
1832 |
|
1832 | |||
1833 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1833 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1834 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1834 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1835 |
|
1835 | |||
1836 | if magrange: |
|
1836 | if magrange: | |
1837 |
|
1837 | |||
1838 | if not isFloatRange(magrange): |
|
1838 | if not isFloatRange(magrange): | |
1839 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) |
|
1839 | self.console.append("Invalid value [%s] for 'Graphic:Magnitud-Range" %(magrange)) | |
1840 | return 0 |
|
1840 | return 0 | |
1841 |
|
1841 | |||
1842 | zvalueList = magrange.split(",") |
|
1842 | zvalueList = magrange.split(",") | |
1843 | value1 = float(zvalueList[0]) |
|
1843 | value1 = float(zvalueList[0]) | |
1844 | value2 = float(zvalueList[1]) |
|
1844 | value2 = float(zvalueList[1]) | |
1845 |
|
1845 | |||
1846 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1846 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1847 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1847 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1848 |
|
1848 | |||
1849 | if phaserange: |
|
1849 | if phaserange: | |
1850 |
|
1850 | |||
1851 | if not isFloatRange(phaserange): |
|
1851 | if not isFloatRange(phaserange): | |
1852 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) |
|
1852 | self.console.append("Invalid value [%s] for 'Graphic:Phase-Range" %(phaserange)) | |
1853 | return 0 |
|
1853 | return 0 | |
1854 |
|
1854 | |||
1855 | zvalueList = phaserange.split(",") |
|
1855 | zvalueList = phaserange.split(",") | |
1856 | value1 = float(zvalueList[0]) |
|
1856 | value1 = float(zvalueList[0]) | |
1857 | value2 = float(zvalueList[1]) |
|
1857 | value2 = float(zvalueList[1]) | |
1858 |
|
1858 | |||
1859 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1859 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1860 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1860 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1861 |
|
1861 | |||
1862 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1862 | if self.specGraphSaveCoherencemap.isChecked(): | |
1863 | checkPath = True |
|
1863 | checkPath = True | |
1864 | opObj.addParameter(name='save', value='1', format='bool') |
|
1864 | opObj.addParameter(name='save', value='1', format='bool') | |
1865 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1865 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1866 | if figfile: |
|
1866 | if figfile: | |
1867 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1867 | opObj.addParameter(name='figfile', value=value, format='str') | |
1868 | if wrperiod: |
|
1868 | if wrperiod: | |
1869 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1869 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1870 |
|
1870 | |||
1871 | if self.specGraphftpCoherencemap.isChecked(): |
|
1871 | if self.specGraphftpCoherencemap.isChecked(): | |
1872 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1872 | opObj.addParameter(name='ftp', value='1', format='int') | |
1873 | self.addFTPConf2Operation(puObj, opObj) |
|
1873 | self.addFTPConf2Operation(puObj, opObj) | |
1874 | addFTP = True |
|
1874 | addFTP = True | |
1875 |
|
1875 | |||
1876 | if self.specGraphPowerprofile.isChecked(): |
|
1876 | if self.specGraphPowerprofile.isChecked(): | |
1877 |
|
1877 | |||
1878 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1878 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1879 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1879 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1880 |
|
1880 | |||
1881 | if channelList: |
|
1881 | if channelList: | |
1882 |
|
1882 | |||
1883 | if not isList(channelList): |
|
1883 | if not isList(channelList): | |
1884 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1884 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1885 | return 0 |
|
1885 | return 0 | |
1886 |
|
1886 | |||
1887 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1887 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1888 |
|
1888 | |||
1889 | if hei_range: |
|
1889 | if hei_range: | |
1890 |
|
1890 | |||
1891 | if not isFloatRange(hei_range): |
|
1891 | if not isFloatRange(hei_range): | |
1892 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) |
|
1892 | self.console.append("Invalid value [%s] for 'Graphic:Height-Range" %(hei_range)) | |
1893 | return 0 |
|
1893 | return 0 | |
1894 |
|
1894 | |||
1895 | yvalueList = hei_range.split(",") |
|
1895 | yvalueList = hei_range.split(",") | |
1896 | value1 = float(yvalueList[0]) |
|
1896 | value1 = float(yvalueList[0]) | |
1897 | value2 = float(yvalueList[1]) |
|
1897 | value2 = float(yvalueList[1]) | |
1898 |
|
1898 | |||
1899 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1899 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1900 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1900 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1901 |
|
1901 | |||
1902 | if db_range: |
|
1902 | if db_range: | |
1903 |
|
1903 | |||
1904 | if not isFloatRange(db_range): |
|
1904 | if not isFloatRange(db_range): | |
1905 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1905 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1906 | return 0 |
|
1906 | return 0 | |
1907 |
|
1907 | |||
1908 | zvalueList = db_range.split(",") |
|
1908 | zvalueList = db_range.split(",") | |
1909 | value1 = float(zvalueList[0]) |
|
1909 | value1 = float(zvalueList[0]) | |
1910 | value2 = float(zvalueList[1]) |
|
1910 | value2 = float(zvalueList[1]) | |
1911 |
|
1911 | |||
1912 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1912 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1913 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1913 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1914 |
|
1914 | |||
1915 | if self.specGraphSavePowerprofile.isChecked(): |
|
1915 | if self.specGraphSavePowerprofile.isChecked(): | |
1916 | checkPath = True |
|
1916 | checkPath = True | |
1917 | opObj.addParameter(name='save', value='1', format='bool') |
|
1917 | opObj.addParameter(name='save', value='1', format='bool') | |
1918 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1918 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1919 | if figfile: |
|
1919 | if figfile: | |
1920 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1920 | opObj.addParameter(name='figfile', value=value, format='str') | |
1921 | if wrperiod: |
|
1921 | if wrperiod: | |
1922 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1922 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1923 |
|
1923 | |||
1924 | if self.specGraphftpPowerprofile.isChecked(): |
|
1924 | if self.specGraphftpPowerprofile.isChecked(): | |
1925 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1925 | opObj.addParameter(name='ftp', value='1', format='int') | |
1926 | self.addFTPConf2Operation(puObj, opObj) |
|
1926 | self.addFTPConf2Operation(puObj, opObj) | |
1927 | addFTP = True |
|
1927 | addFTP = True | |
1928 | # rti noise |
|
1928 | # rti noise | |
1929 |
|
1929 | |||
1930 | if self.specGraphCebRTInoise.isChecked(): |
|
1930 | if self.specGraphCebRTInoise.isChecked(): | |
1931 |
|
1931 | |||
1932 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1932 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1933 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1933 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1934 |
|
1934 | |||
1935 | if channelList: |
|
1935 | if channelList: | |
1936 |
|
1936 | |||
1937 | if not isList(channelList): |
|
1937 | if not isList(channelList): | |
1938 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) |
|
1938 | self.console.append("Invalid value [%s] for 'Graphic:ChannelList" %(channelList)) | |
1939 | return 0 |
|
1939 | return 0 | |
1940 |
|
1940 | |||
1941 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1941 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1942 |
|
1942 | |||
1943 | if trange: |
|
1943 | if trange: | |
1944 |
|
1944 | |||
1945 | if not isFloatRange(trange): |
|
1945 | if not isFloatRange(trange): | |
1946 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) |
|
1946 | self.console.append("Invalid value [%s] for 'Graphic:Time-Range" %(trange)) | |
1947 | return 0 |
|
1947 | return 0 | |
1948 |
|
1948 | |||
1949 | zvalueList = trange.split(",") |
|
1949 | zvalueList = trange.split(",") | |
1950 | value1 = float(zvalueList[0]) |
|
1950 | value1 = float(zvalueList[0]) | |
1951 | value2 = float(zvalueList[1]) |
|
1951 | value2 = float(zvalueList[1]) | |
1952 |
|
1952 | |||
1953 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1953 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1954 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1954 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1955 |
|
1955 | |||
1956 | if db_range: |
|
1956 | if db_range: | |
1957 |
|
1957 | |||
1958 | if not isFloatRange(db_range): |
|
1958 | if not isFloatRange(db_range): | |
1959 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) |
|
1959 | self.console.append("Invalid value [%s] for 'Graphic:dB-Range" %(db_range)) | |
1960 | return 0 |
|
1960 | return 0 | |
1961 |
|
1961 | |||
1962 | zvalueList = db_range.split(",") |
|
1962 | zvalueList = db_range.split(",") | |
1963 | value1 = float(zvalueList[0]) |
|
1963 | value1 = float(zvalueList[0]) | |
1964 | value2 = float(zvalueList[1]) |
|
1964 | value2 = float(zvalueList[1]) | |
1965 |
|
1965 | |||
1966 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1966 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1967 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1967 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1968 |
|
1968 | |||
1969 | if self.specGraphSaveRTInoise.isChecked(): |
|
1969 | if self.specGraphSaveRTInoise.isChecked(): | |
1970 | checkPath = True |
|
1970 | checkPath = True | |
1971 | opObj.addParameter(name='save', value='1', format='bool') |
|
1971 | opObj.addParameter(name='save', value='1', format='bool') | |
1972 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1972 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1973 | if figfile: |
|
1973 | if figfile: | |
1974 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1974 | opObj.addParameter(name='figfile', value=value, format='str') | |
1975 | if wrperiod: |
|
1975 | if wrperiod: | |
1976 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1976 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1977 |
|
1977 | |||
1978 | # test_ftp |
|
1978 | # test_ftp | |
1979 | if self.specGraphftpRTInoise.isChecked(): |
|
1979 | if self.specGraphftpRTInoise.isChecked(): | |
1980 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1980 | opObj.addParameter(name='ftp', value='1', format='int') | |
1981 | self.addFTPConf2Operation(puObj, opObj) |
|
1981 | self.addFTPConf2Operation(puObj, opObj) | |
1982 | addFTP = True |
|
1982 | addFTP = True | |
1983 |
|
1983 | |||
1984 | if checkPath: |
|
1984 | if checkPath: | |
1985 | if not figpath: |
|
1985 | if not figpath: | |
1986 | self.console.clear() |
|
1986 | self.console.clear() | |
1987 | self.console.append("Graphic path should be defined") |
|
1987 | self.console.append("Graphic path should be defined") | |
1988 | return 0 |
|
1988 | return 0 | |
1989 |
|
1989 | |||
1990 | if addFTP and not figpath: |
|
1990 | if addFTP and not figpath: | |
1991 | self.console.clear() |
|
1991 | self.console.clear() | |
1992 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1992 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1993 | return 0 |
|
1993 | return 0 | |
1994 |
|
1994 | |||
1995 | self.console.clear() |
|
1995 | self.console.clear() | |
1996 |
|
1996 | |||
1997 | # if something happend |
|
1997 | # if something happend | |
1998 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1998 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1999 | if parms_ok: |
|
1999 | if parms_ok: | |
2000 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
2000 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
2001 | opObj.addParameter(name='path', value=output_path) |
|
2001 | opObj.addParameter(name='path', value=output_path) | |
2002 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
2002 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
2003 |
|
2003 | |||
2004 | try: |
|
2004 | try: | |
2005 | self.refreshPUProperties(puObj) |
|
2005 | self.refreshPUProperties(puObj) | |
2006 | except: |
|
2006 | except: | |
2007 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2007 | self.console.append("An error reading input parameters was found ... Check them!") | |
2008 | return 0 |
|
2008 | return 0 | |
2009 |
|
2009 | |||
2010 | self.console.append("Save your project and press Play button to start signal processing") |
|
2010 | self.console.append("Save your project and press Play button to start signal processing") | |
2011 |
|
2011 | |||
2012 | self._enable_play_button() |
|
2012 | self._enable_play_button() | |
2013 | self._enable_save_button() |
|
2013 | self._enable_save_button() | |
2014 |
|
2014 | |||
2015 | return 1 |
|
2015 | return 1 | |
2016 |
|
2016 | |||
2017 |
|
2017 | |||
2018 | @pyqtSignature("") |
|
2018 | @pyqtSignature("") | |
2019 | def on_specGraphClear_clicked(self): |
|
2019 | def on_specGraphClear_clicked(self): | |
2020 |
|
2020 | |||
2021 | self.console.clear() |
|
2021 | self.console.clear() | |
2022 |
|
2022 | |||
2023 | """ |
|
2023 | """ | |
2024 | Spectra Graph |
|
2024 | Spectra Graph | |
2025 | """ |
|
2025 | """ | |
2026 | @pyqtSignature("int") |
|
2026 | @pyqtSignature("int") | |
2027 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
2027 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
2028 |
|
2028 | |||
2029 | self.__checkSpecGraphFilters() |
|
2029 | self.__checkSpecGraphFilters() | |
2030 |
|
2030 | |||
2031 |
|
2031 | |||
2032 | @pyqtSignature("int") |
|
2032 | @pyqtSignature("int") | |
2033 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
2033 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
2034 |
|
2034 | |||
2035 | self.__checkSpecGraphFilters() |
|
2035 | self.__checkSpecGraphFilters() | |
2036 |
|
2036 | |||
2037 | @pyqtSignature("int") |
|
2037 | @pyqtSignature("int") | |
2038 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
2038 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
2039 |
|
2039 | |||
2040 | self.__checkSpecGraphFilters() |
|
2040 | self.__checkSpecGraphFilters() | |
2041 |
|
2041 | |||
2042 |
|
2042 | |||
2043 | @pyqtSignature("int") |
|
2043 | @pyqtSignature("int") | |
2044 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
2044 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
2045 |
|
2045 | |||
2046 | self.__checkSpecGraphFilters() |
|
2046 | self.__checkSpecGraphFilters() | |
2047 |
|
2047 | |||
2048 |
|
2048 | |||
2049 | @pyqtSignature("int") |
|
2049 | @pyqtSignature("int") | |
2050 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
2050 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
2051 |
|
2051 | |||
2052 | self.__checkSpecGraphFilters() |
|
2052 | self.__checkSpecGraphFilters() | |
2053 |
|
2053 | |||
2054 | @pyqtSignature("int") |
|
2054 | @pyqtSignature("int") | |
2055 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
2055 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
2056 |
|
2056 | |||
2057 | self.__checkSpecGraphFilters() |
|
2057 | self.__checkSpecGraphFilters() | |
2058 |
|
2058 | |||
2059 | @pyqtSignature("int") |
|
2059 | @pyqtSignature("int") | |
2060 | def on_specGraphPhase_stateChanged(self, p0): |
|
2060 | def on_specGraphPhase_stateChanged(self, p0): | |
2061 |
|
2061 | |||
2062 | self.__checkSpecGraphFilters() |
|
2062 | self.__checkSpecGraphFilters() | |
2063 |
|
2063 | |||
2064 | @pyqtSignature("int") |
|
2064 | @pyqtSignature("int") | |
2065 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
2065 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
2066 | """ |
|
2066 | """ | |
2067 | """ |
|
2067 | """ | |
2068 | self.__checkSpecGraphSaving() |
|
2068 | self.__checkSpecGraphSaving() | |
2069 |
|
2069 | |||
2070 | @pyqtSignature("int") |
|
2070 | @pyqtSignature("int") | |
2071 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
2071 | def on_specGraphSaveCross_stateChanged(self, p0): | |
2072 |
|
2072 | |||
2073 | self.__checkSpecGraphSaving() |
|
2073 | self.__checkSpecGraphSaving() | |
2074 |
|
2074 | |||
2075 | @pyqtSignature("int") |
|
2075 | @pyqtSignature("int") | |
2076 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
2076 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
2077 |
|
2077 | |||
2078 | self.__checkSpecGraphSaving() |
|
2078 | self.__checkSpecGraphSaving() | |
2079 |
|
2079 | |||
2080 | @pyqtSignature("int") |
|
2080 | @pyqtSignature("int") | |
2081 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
2081 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
2082 |
|
2082 | |||
2083 | self.__checkSpecGraphSaving() |
|
2083 | self.__checkSpecGraphSaving() | |
2084 |
|
2084 | |||
2085 | @pyqtSignature("int") |
|
2085 | @pyqtSignature("int") | |
2086 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
2086 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
2087 |
|
2087 | |||
2088 | self.__checkSpecGraphSaving() |
|
2088 | self.__checkSpecGraphSaving() | |
2089 |
|
2089 | |||
2090 | @pyqtSignature("int") |
|
2090 | @pyqtSignature("int") | |
2091 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
2091 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
2092 |
|
2092 | |||
2093 | self.__checkSpecGraphSaving() |
|
2093 | self.__checkSpecGraphSaving() | |
2094 |
|
2094 | |||
2095 | @pyqtSignature("int") |
|
2095 | @pyqtSignature("int") | |
2096 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
2096 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
2097 | """ |
|
2097 | """ | |
2098 | """ |
|
2098 | """ | |
2099 | self.__checkSpecGraphFTP() |
|
2099 | self.__checkSpecGraphFTP() | |
2100 |
|
2100 | |||
2101 |
|
2101 | |||
2102 | @pyqtSignature("int") |
|
2102 | @pyqtSignature("int") | |
2103 | def on_specGraphftpCross_stateChanged(self, p0): |
|
2103 | def on_specGraphftpCross_stateChanged(self, p0): | |
2104 |
|
2104 | |||
2105 | self.__checkSpecGraphFTP() |
|
2105 | self.__checkSpecGraphFTP() | |
2106 |
|
2106 | |||
2107 | @pyqtSignature("int") |
|
2107 | @pyqtSignature("int") | |
2108 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
2108 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
2109 |
|
2109 | |||
2110 | self.__checkSpecGraphFTP() |
|
2110 | self.__checkSpecGraphFTP() | |
2111 |
|
2111 | |||
2112 | @pyqtSignature("int") |
|
2112 | @pyqtSignature("int") | |
2113 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
2113 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
2114 |
|
2114 | |||
2115 | self.__checkSpecGraphFTP() |
|
2115 | self.__checkSpecGraphFTP() | |
2116 |
|
2116 | |||
2117 | @pyqtSignature("int") |
|
2117 | @pyqtSignature("int") | |
2118 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
2118 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
2119 |
|
2119 | |||
2120 | self.__checkSpecGraphFTP() |
|
2120 | self.__checkSpecGraphFTP() | |
2121 |
|
2121 | |||
2122 | @pyqtSignature("int") |
|
2122 | @pyqtSignature("int") | |
2123 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
2123 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
2124 |
|
2124 | |||
2125 | self.__checkSpecGraphFTP() |
|
2125 | self.__checkSpecGraphFTP() | |
2126 |
|
2126 | |||
2127 | @pyqtSignature("") |
|
2127 | @pyqtSignature("") | |
2128 | def on_specGraphToolPath_clicked(self): |
|
2128 | def on_specGraphToolPath_clicked(self): | |
2129 | """ |
|
2129 | """ | |
2130 | """ |
|
2130 | """ | |
2131 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2131 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2132 | self.specGraphPath.setText(save_path) |
|
2132 | self.specGraphPath.setText(save_path) | |
2133 | if not os.path.exists(save_path): |
|
2133 | if not os.path.exists(save_path): | |
2134 | self.console.clear() |
|
2134 | self.console.clear() | |
2135 | self.console.append("Write a valid path") |
|
2135 | self.console.append("Write a valid path") | |
2136 | return |
|
2136 | return | |
2137 |
|
2137 | |||
2138 | @pyqtSignature("") |
|
2138 | @pyqtSignature("") | |
2139 | def on_specHeisGraphToolPath_clicked(self): |
|
2139 | def on_specHeisGraphToolPath_clicked(self): | |
2140 | """ |
|
2140 | """ | |
2141 | """ |
|
2141 | """ | |
2142 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2142 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2143 | self.specHeisGraphPath.setText(save_path) |
|
2143 | self.specHeisGraphPath.setText(save_path) | |
2144 | if not os.path.exists(save_path): |
|
2144 | if not os.path.exists(save_path): | |
2145 | self.console.clear() |
|
2145 | self.console.clear() | |
2146 | self.console.append("Write a valid path") |
|
2146 | self.console.append("Write a valid path") | |
2147 | return |
|
2147 | return | |
2148 |
|
2148 | |||
2149 | @pyqtSignature("int") |
|
2149 | @pyqtSignature("int") | |
2150 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2150 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2151 | """ |
|
2151 | """ | |
2152 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2152 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2153 | """ |
|
2153 | """ | |
2154 | if p0 == 2: |
|
2154 | if p0 == 2: | |
2155 | self.specHeisOpIncoherent.setEnabled(True) |
|
2155 | self.specHeisOpIncoherent.setEnabled(True) | |
2156 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2156 | self.specHeisOpCobIncInt.setEnabled(True) | |
2157 | if p0 == 0: |
|
2157 | if p0 == 0: | |
2158 | self.specHeisOpIncoherent.setEnabled(False) |
|
2158 | self.specHeisOpIncoherent.setEnabled(False) | |
2159 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2159 | self.specHeisOpCobIncInt.setEnabled(False) | |
2160 |
|
2160 | |||
2161 | @pyqtSignature("") |
|
2161 | @pyqtSignature("") | |
2162 | def on_specHeisOpOk_clicked(self): |
|
2162 | def on_specHeisOpOk_clicked(self): | |
2163 | """ |
|
2163 | """ | |
2164 | AΓADE OPERACION SPECTRAHEIS |
|
2164 | AΓADE OPERACION SPECTRAHEIS | |
2165 | """ |
|
2165 | """ | |
2166 | addFTP = False |
|
2166 | addFTP = False | |
2167 | checkPath = False |
|
2167 | checkPath = False | |
2168 |
|
2168 | |||
2169 | self._disable_play_button() |
|
2169 | self._disable_play_button() | |
2170 | self._disable_save_button() |
|
2170 | self._disable_save_button() | |
2171 |
|
2171 | |||
2172 | self.console.clear() |
|
2172 | self.console.clear() | |
2173 | self.console.append("Checking input parameters ...") |
|
2173 | self.console.append("Checking input parameters ...") | |
2174 |
|
2174 | |||
2175 | puObj = self.getSelectedItemObj() |
|
2175 | puObj = self.getSelectedItemObj() | |
2176 | puObj.removeOperations() |
|
2176 | puObj.removeOperations() | |
2177 |
|
2177 | |||
2178 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2178 | if self.specHeisOpCebIncoherent.isChecked(): | |
2179 | value = str(self.specHeisOpIncoherent.text()) |
|
2179 | value = str(self.specHeisOpIncoherent.text()) | |
2180 | name_operation = 'IncohInt4SpectraHeis' |
|
2180 | name_operation = 'IncohInt4SpectraHeis' | |
2181 | optype = 'other' |
|
2181 | optype = 'other' | |
2182 |
|
2182 | |||
2183 | name_parameter = 'timeInterval' |
|
2183 | name_parameter = 'timeInterval' | |
2184 | format = 'float' |
|
2184 | format = 'float' | |
2185 |
|
2185 | |||
2186 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2186 | if self.specOpCobIncInt.currentIndex() == 0: | |
2187 | name_parameter = 'timeInterval' |
|
2187 | name_parameter = 'timeInterval' | |
2188 | format = 'float' |
|
2188 | format = 'float' | |
2189 |
|
2189 | |||
2190 | if not isFloat(value): |
|
2190 | if not isFloat(value): | |
2191 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2191 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2192 | return 0 |
|
2192 | return 0 | |
2193 |
|
2193 | |||
2194 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2194 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2195 |
|
2195 | |||
2196 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2196 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2197 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2197 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2198 | return 0 |
|
2198 | return 0 | |
2199 |
|
2199 | |||
2200 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2200 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2201 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2201 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2202 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2202 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2203 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2203 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2204 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2204 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2205 |
|
2205 | |||
2206 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2206 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2207 |
|
2207 | |||
2208 | name_operation = 'SpectraHeisScope' |
|
2208 | name_operation = 'SpectraHeisScope' | |
2209 | optype = 'other' |
|
2209 | optype = 'other' | |
2210 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2210 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2211 |
|
2211 | |||
2212 | name_parameter = 'id' |
|
2212 | name_parameter = 'id' | |
2213 | format = 'int' |
|
2213 | format = 'int' | |
2214 | value = opObj.id |
|
2214 | value = opObj.id | |
2215 |
|
2215 | |||
2216 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2216 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2217 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2217 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2218 | return 0 |
|
2218 | return 0 | |
2219 |
|
2219 | |||
2220 | if not (channelList == ''): |
|
2220 | if not (channelList == ''): | |
2221 | name_parameter = 'channelList' |
|
2221 | name_parameter = 'channelList' | |
2222 | format = 'intlist' |
|
2222 | format = 'intlist' | |
2223 |
|
2223 | |||
2224 | if not isList(channelList): |
|
2224 | if not isList(channelList): | |
2225 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2225 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2226 | return 0 |
|
2226 | return 0 | |
2227 |
|
2227 | |||
2228 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2228 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2229 |
|
2229 | |||
2230 | if not freq_range == '': |
|
2230 | if not freq_range == '': | |
2231 | xvalueList = freq_range.split(',') |
|
2231 | xvalueList = freq_range.split(',') | |
2232 |
|
2232 | |||
2233 | if len(xvalueList) != 2: |
|
2233 | if len(xvalueList) != 2: | |
2234 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2234 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2235 | return 0 |
|
2235 | return 0 | |
2236 |
|
2236 | |||
2237 | value1 = xvalueList[0] |
|
2237 | value1 = xvalueList[0] | |
2238 | value2 = xvalueList[1] |
|
2238 | value2 = xvalueList[1] | |
2239 |
|
2239 | |||
2240 | if not isFloat(value1) or not isFloat(value2): |
|
2240 | if not isFloat(value1) or not isFloat(value2): | |
2241 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2241 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2242 | return 0 |
|
2242 | return 0 | |
2243 |
|
2243 | |||
2244 | name1 = 'xmin' |
|
2244 | name1 = 'xmin' | |
2245 | name2 = 'xmax' |
|
2245 | name2 = 'xmax' | |
2246 | format = 'float' |
|
2246 | format = 'float' | |
2247 |
|
2247 | |||
2248 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2248 | opObj.addParameter(name=name1, value=value1, format=format) | |
2249 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2249 | opObj.addParameter(name=name2, value=value2, format=format) | |
2250 |
|
2250 | |||
2251 | if not power_range == '': |
|
2251 | if not power_range == '': | |
2252 | yvalueList = power_range.split(",") |
|
2252 | yvalueList = power_range.split(",") | |
2253 |
|
2253 | |||
2254 | if len(yvalueList) != 2: |
|
2254 | if len(yvalueList) != 2: | |
2255 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2255 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2256 | return 0 |
|
2256 | return 0 | |
2257 |
|
2257 | |||
2258 | value1 = yvalueList[0] |
|
2258 | value1 = yvalueList[0] | |
2259 | value2 = yvalueList[1] |
|
2259 | value2 = yvalueList[1] | |
2260 |
|
2260 | |||
2261 | if not isFloat(value1) or not isFloat(value2): |
|
2261 | if not isFloat(value1) or not isFloat(value2): | |
2262 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2262 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2263 | return 0 |
|
2263 | return 0 | |
2264 |
|
2264 | |||
2265 | name1 = 'ymin' |
|
2265 | name1 = 'ymin' | |
2266 | name2 = 'ymax' |
|
2266 | name2 = 'ymax' | |
2267 | format = 'float' |
|
2267 | format = 'float' | |
2268 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2268 | opObj.addParameter(name=name1, value=value1, format=format) | |
2269 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2269 | opObj.addParameter(name=name2, value=value2, format=format) | |
2270 |
|
2270 | |||
2271 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2271 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2272 | checkPath = True |
|
2272 | checkPath = True | |
2273 | name_parameter1 = 'save' |
|
2273 | name_parameter1 = 'save' | |
2274 | name_parameter2 = 'figpath' |
|
2274 | name_parameter2 = 'figpath' | |
2275 | name_parameter3 = 'figfile' |
|
2275 | name_parameter3 = 'figfile' | |
2276 | value1 = '1' |
|
2276 | value1 = '1' | |
2277 | value2 = str(self.specHeisGraphPath.text()) |
|
2277 | value2 = str(self.specHeisGraphPath.text()) | |
2278 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2278 | value3 = str(self.specHeisGraphPrefix.text()) | |
2279 | format1 = 'bool' |
|
2279 | format1 = 'bool' | |
2280 | format2 = 'str' |
|
2280 | format2 = 'str' | |
2281 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2281 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2282 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2282 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2283 | if not value3 == "": |
|
2283 | if not value3 == "": | |
2284 | try: |
|
2284 | try: | |
2285 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2285 | value3 = str(self.specHeisGraphPrefix.text()) | |
2286 | except: |
|
2286 | except: | |
2287 | self.console.clear() |
|
2287 | self.console.clear() | |
2288 | self.console.append("Please Write prefix") |
|
2288 | self.console.append("Please Write prefix") | |
2289 | return 0 |
|
2289 | return 0 | |
2290 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2290 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2291 |
|
2291 | |||
2292 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2292 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2293 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2293 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2294 |
|
2294 | |||
2295 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2295 | if self.specHeisGraphftpSpectra.isChecked(): | |
2296 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2296 | opObj.addParameter(name='ftp', value='1', format='int') | |
2297 | self.addFTPConf2Operation(puObj, opObj) |
|
2297 | self.addFTPConf2Operation(puObj, opObj) | |
2298 | addFTP = True |
|
2298 | addFTP = True | |
2299 |
|
2299 | |||
2300 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2300 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2301 | name_operation = 'RTIfromSpectraHeis' |
|
2301 | name_operation = 'RTIfromSpectraHeis' | |
2302 | optype = 'other' |
|
2302 | optype = 'other' | |
2303 |
|
2303 | |||
2304 | name_parameter = 'id' |
|
2304 | name_parameter = 'id' | |
2305 | format = 'int' |
|
2305 | format = 'int' | |
2306 |
|
2306 | |||
2307 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2307 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2308 | value = opObj.id |
|
2308 | value = opObj.id | |
2309 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2309 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2310 |
|
2310 | |||
2311 | if not channelList == '': |
|
2311 | if not channelList == '': | |
2312 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2312 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2313 |
|
2313 | |||
2314 | if not time_range == '': |
|
2314 | if not time_range == '': | |
2315 | xvalueList = time_range.split(',') |
|
2315 | xvalueList = time_range.split(',') | |
2316 | try: |
|
2316 | try: | |
2317 | value = float(xvalueList[0]) |
|
2317 | value = float(xvalueList[0]) | |
2318 | value = float(xvalueList[1]) |
|
2318 | value = float(xvalueList[1]) | |
2319 | except: |
|
2319 | except: | |
2320 | return 0 |
|
2320 | return 0 | |
2321 | format = 'float' |
|
2321 | format = 'float' | |
2322 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2322 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2323 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2323 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2324 |
|
2324 | |||
2325 | if not timerange == '': |
|
2325 | if not timerange == '': | |
2326 | format = 'int' |
|
2326 | format = 'int' | |
2327 | try: |
|
2327 | try: | |
2328 | timerange = int(timerange) |
|
2328 | timerange = int(timerange) | |
2329 | except: |
|
2329 | except: | |
2330 | return 0 |
|
2330 | return 0 | |
2331 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2331 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2332 |
|
2332 | |||
2333 |
|
2333 | |||
2334 | if not power_range == '': |
|
2334 | if not power_range == '': | |
2335 | yvalueList = power_range.split(",") |
|
2335 | yvalueList = power_range.split(",") | |
2336 | try: |
|
2336 | try: | |
2337 | value = float(yvalueList[0]) |
|
2337 | value = float(yvalueList[0]) | |
2338 | value = float(yvalueList[1]) |
|
2338 | value = float(yvalueList[1]) | |
2339 | except: |
|
2339 | except: | |
2340 | return 0 |
|
2340 | return 0 | |
2341 |
|
2341 | |||
2342 | format = 'float' |
|
2342 | format = 'float' | |
2343 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2343 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2344 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2344 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2345 |
|
2345 | |||
2346 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2346 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2347 | checkPath = True |
|
2347 | checkPath = True | |
2348 | opObj.addParameter(name='save', value='1', format='bool') |
|
2348 | opObj.addParameter(name='save', value='1', format='bool') | |
2349 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2349 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2350 | value = str(self.specHeisGraphPrefix.text()) |
|
2350 | value = str(self.specHeisGraphPrefix.text()) | |
2351 | if not value == "": |
|
2351 | if not value == "": | |
2352 | try: |
|
2352 | try: | |
2353 | value = str(self.specHeisGraphPrefix.text()) |
|
2353 | value = str(self.specHeisGraphPrefix.text()) | |
2354 | except: |
|
2354 | except: | |
2355 | self.console.clear() |
|
2355 | self.console.clear() | |
2356 | self.console.append("Please Write prefix") |
|
2356 | self.console.append("Please Write prefix") | |
2357 | return 0 |
|
2357 | return 0 | |
2358 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2358 | opObj.addParameter(name='figfile', value=value, format='str') | |
2359 |
|
2359 | |||
2360 | # test_ftp |
|
2360 | # test_ftp | |
2361 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2361 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2362 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2362 | opObj.addParameter(name='ftp', value='1', format='int') | |
2363 | self.addFTPConf2Operation(puObj, opObj) |
|
2363 | self.addFTPConf2Operation(puObj, opObj) | |
2364 | addFTP = True |
|
2364 | addFTP = True | |
2365 |
|
2365 | |||
2366 | localfolder = None |
|
2366 | localfolder = None | |
2367 | if checkPath: |
|
2367 | if checkPath: | |
2368 | localfolder = str(self.specHeisGraphPath.text()) |
|
2368 | localfolder = str(self.specHeisGraphPath.text()) | |
2369 | if localfolder == '': |
|
2369 | if localfolder == '': | |
2370 | self.console.clear() |
|
2370 | self.console.clear() | |
2371 | self.console.append("Graphic path should be defined") |
|
2371 | self.console.append("Graphic path should be defined") | |
2372 | return 0 |
|
2372 | return 0 | |
2373 |
|
2373 | |||
2374 | if addFTP and not localfolder: |
|
2374 | if addFTP and not localfolder: | |
2375 | self.console.clear() |
|
2375 | self.console.clear() | |
2376 | self.console.append("You should save plots before send them to FTP Server") |
|
2376 | self.console.append("You should save plots before send them to FTP Server") | |
2377 | return 0 |
|
2377 | return 0 | |
2378 |
|
2378 | |||
2379 | # if something happened |
|
2379 | # if something happened | |
2380 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2380 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2381 | if parms_ok: |
|
2381 | if parms_ok: | |
2382 | name_operation = 'FitsWriter' |
|
2382 | name_operation = 'FitsWriter' | |
2383 | optype = 'other' |
|
2383 | optype = 'other' | |
2384 | name_parameter1 = 'path' |
|
2384 | name_parameter1 = 'path' | |
2385 | name_parameter2 = 'dataBlocksPerFile' |
|
2385 | name_parameter2 = 'dataBlocksPerFile' | |
2386 | name_parameter3 = 'metadatafile' |
|
2386 | name_parameter3 = 'metadatafile' | |
2387 | value1 = output_path |
|
2387 | value1 = output_path | |
2388 | value2 = blocksperfile |
|
2388 | value2 = blocksperfile | |
2389 | value3 = metadata_file |
|
2389 | value3 = metadata_file | |
2390 | format2 = "int" |
|
2390 | format2 = "int" | |
2391 | format3 = "str" |
|
2391 | format3 = "str" | |
2392 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2392 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2393 |
|
2393 | |||
2394 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2394 | opObj.addParameter(name=name_parameter1, value=value1) | |
2395 |
|
2395 | |||
2396 | if blocksperfile: |
|
2396 | if blocksperfile: | |
2397 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2397 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2398 |
|
2398 | |||
2399 | if metadata_file: |
|
2399 | if metadata_file: | |
2400 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2400 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2401 |
|
2401 | |||
2402 | self.console.clear() |
|
2402 | self.console.clear() | |
2403 | try: |
|
2403 | try: | |
2404 | self.refreshPUProperties(puObj) |
|
2404 | self.refreshPUProperties(puObj) | |
2405 | except: |
|
2405 | except: | |
2406 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2406 | self.console.append("An error reading input parameters was found ... Check them!") | |
2407 | return 0 |
|
2407 | return 0 | |
2408 |
|
2408 | |||
2409 | self.console.append("Save your project and press Play button to start signal processing") |
|
2409 | self.console.append("Save your project and press Play button to start signal processing") | |
2410 |
|
2410 | |||
2411 | self._enable_save_button() |
|
2411 | self._enable_save_button() | |
2412 | self._enable_play_button() |
|
2412 | self._enable_play_button() | |
2413 |
|
2413 | |||
2414 | return 1 |
|
2414 | return 1 | |
2415 |
|
2415 | |||
2416 | @pyqtSignature("") |
|
2416 | @pyqtSignature("") | |
2417 | def on_specHeisGraphClear_clicked(self): |
|
2417 | def on_specHeisGraphClear_clicked(self): | |
2418 |
|
2418 | |||
2419 | self.console.clear() |
|
2419 | self.console.clear() | |
2420 |
|
2420 | |||
2421 | @pyqtSignature("int") |
|
2421 | @pyqtSignature("int") | |
2422 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2422 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2423 |
|
2423 | |||
2424 | if p0 == 2: |
|
2424 | if p0 == 2: | |
2425 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2425 | self.specHeisGgraphChannelList.setEnabled(True) | |
2426 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2426 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2427 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2427 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2428 | if p0 == 0: |
|
2428 | if p0 == 0: | |
2429 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2429 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2430 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2430 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2431 |
|
2431 | |||
2432 | @pyqtSignature("int") |
|
2432 | @pyqtSignature("int") | |
2433 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2433 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2434 |
|
2434 | |||
2435 | if p0 == 2: |
|
2435 | if p0 == 2: | |
2436 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2436 | self.specHeisGgraphChannelList.setEnabled(True) | |
2437 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2437 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2438 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2438 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2439 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2439 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2440 |
|
2440 | |||
2441 | if p0 == 0: |
|
2441 | if p0 == 0: | |
2442 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2442 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2443 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2443 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2444 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2444 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2445 |
|
2445 | |||
2446 | @pyqtSignature("int") |
|
2446 | @pyqtSignature("int") | |
2447 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2447 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2448 | """ |
|
2448 | """ | |
2449 | """ |
|
2449 | """ | |
2450 | if p0 == 2: |
|
2450 | if p0 == 2: | |
2451 | self.specHeisGraphPath.setEnabled(True) |
|
2451 | self.specHeisGraphPath.setEnabled(True) | |
2452 | self.specHeisGraphPrefix.setEnabled(True) |
|
2452 | self.specHeisGraphPrefix.setEnabled(True) | |
2453 | self.specHeisGraphToolPath.setEnabled(True) |
|
2453 | self.specHeisGraphToolPath.setEnabled(True) | |
2454 | if p0 == 0: |
|
2454 | if p0 == 0: | |
2455 | self.specHeisGraphPath.setEnabled(False) |
|
2455 | self.specHeisGraphPath.setEnabled(False) | |
2456 | self.specHeisGraphPrefix.setEnabled(False) |
|
2456 | self.specHeisGraphPrefix.setEnabled(False) | |
2457 | self.specHeisGraphToolPath.setEnabled(False) |
|
2457 | self.specHeisGraphToolPath.setEnabled(False) | |
2458 |
|
2458 | |||
2459 | @pyqtSignature("int") |
|
2459 | @pyqtSignature("int") | |
2460 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2460 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2461 | if p0 == 2: |
|
2461 | if p0 == 2: | |
2462 | self.specHeisGraphPath.setEnabled(True) |
|
2462 | self.specHeisGraphPath.setEnabled(True) | |
2463 | self.specHeisGraphPrefix.setEnabled(True) |
|
2463 | self.specHeisGraphPrefix.setEnabled(True) | |
2464 | self.specHeisGraphToolPath.setEnabled(True) |
|
2464 | self.specHeisGraphToolPath.setEnabled(True) | |
2465 |
|
2465 | |||
2466 | @pyqtSignature("int") |
|
2466 | @pyqtSignature("int") | |
2467 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2467 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2468 | """ |
|
2468 | """ | |
2469 | """ |
|
2469 | """ | |
2470 | if p0 == 2: |
|
2470 | if p0 == 2: | |
2471 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2471 | self.specHeisGgraphftpratio.setEnabled(True) | |
2472 |
|
2472 | |||
2473 | if p0 == 0: |
|
2473 | if p0 == 0: | |
2474 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2474 | self.specHeisGgraphftpratio.setEnabled(False) | |
2475 |
|
2475 | |||
2476 | @pyqtSignature("int") |
|
2476 | @pyqtSignature("int") | |
2477 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2477 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2478 | if p0 == 2: |
|
2478 | if p0 == 2: | |
2479 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2479 | self.specHeisGgraphftpratio.setEnabled(True) | |
2480 |
|
2480 | |||
2481 | def __checkSpecGraphSaving(self): |
|
2481 | def __checkSpecGraphSaving(self): | |
2482 |
|
2482 | |||
2483 | enable = False |
|
2483 | enable = False | |
2484 |
|
2484 | |||
2485 | if self.specGraphSaveSpectra.checkState(): |
|
2485 | if self.specGraphSaveSpectra.checkState(): | |
2486 | enable = True |
|
2486 | enable = True | |
2487 |
|
2487 | |||
2488 | if self.specGraphSaveCross.checkState(): |
|
2488 | if self.specGraphSaveCross.checkState(): | |
2489 | enable = True |
|
2489 | enable = True | |
2490 |
|
2490 | |||
2491 | if self.specGraphSaveRTIplot.checkState(): |
|
2491 | if self.specGraphSaveRTIplot.checkState(): | |
2492 | enable = True |
|
2492 | enable = True | |
2493 |
|
2493 | |||
2494 | if self.specGraphSaveCoherencemap.checkState(): |
|
2494 | if self.specGraphSaveCoherencemap.checkState(): | |
2495 | enable = True |
|
2495 | enable = True | |
2496 |
|
2496 | |||
2497 | if self.specGraphSavePowerprofile.checkState(): |
|
2497 | if self.specGraphSavePowerprofile.checkState(): | |
2498 | enable = True |
|
2498 | enable = True | |
2499 |
|
2499 | |||
2500 | if self.specGraphSaveRTInoise.checkState(): |
|
2500 | if self.specGraphSaveRTInoise.checkState(): | |
2501 | enable = True |
|
2501 | enable = True | |
2502 |
|
2502 | |||
2503 | self.specGraphPath.setEnabled(enable) |
|
2503 | self.specGraphPath.setEnabled(enable) | |
2504 | self.specGraphPrefix.setEnabled(enable) |
|
2504 | self.specGraphPrefix.setEnabled(enable) | |
2505 | self.specGraphToolPath.setEnabled(enable) |
|
2505 | self.specGraphToolPath.setEnabled(enable) | |
2506 |
|
2506 | |||
2507 | self.specGgraphftpratio.setEnabled(enable) |
|
2507 | self.specGgraphftpratio.setEnabled(enable) | |
2508 |
|
2508 | |||
2509 | def __checkSpecGraphFTP(self): |
|
2509 | def __checkSpecGraphFTP(self): | |
2510 |
|
2510 | |||
2511 | enable = False |
|
2511 | enable = False | |
2512 |
|
2512 | |||
2513 | if self.specGraphftpSpectra.checkState(): |
|
2513 | if self.specGraphftpSpectra.checkState(): | |
2514 | enable = True |
|
2514 | enable = True | |
2515 |
|
2515 | |||
2516 | if self.specGraphftpCross.checkState(): |
|
2516 | if self.specGraphftpCross.checkState(): | |
2517 | enable = True |
|
2517 | enable = True | |
2518 |
|
2518 | |||
2519 | if self.specGraphftpRTIplot.checkState(): |
|
2519 | if self.specGraphftpRTIplot.checkState(): | |
2520 | enable = True |
|
2520 | enable = True | |
2521 |
|
2521 | |||
2522 | if self.specGraphftpCoherencemap.checkState(): |
|
2522 | if self.specGraphftpCoherencemap.checkState(): | |
2523 | enable = True |
|
2523 | enable = True | |
2524 |
|
2524 | |||
2525 | if self.specGraphftpPowerprofile.checkState(): |
|
2525 | if self.specGraphftpPowerprofile.checkState(): | |
2526 | enable = True |
|
2526 | enable = True | |
2527 |
|
2527 | |||
2528 | if self.specGraphftpRTInoise.checkState(): |
|
2528 | if self.specGraphftpRTInoise.checkState(): | |
2529 | enable = True |
|
2529 | enable = True | |
2530 |
|
2530 | |||
2531 | # self.specGgraphftpratio.setEnabled(enable) |
|
2531 | # self.specGgraphftpratio.setEnabled(enable) | |
2532 |
|
2532 | |||
2533 | def __checkSpecGraphFilters(self): |
|
2533 | def __checkSpecGraphFilters(self): | |
2534 |
|
2534 | |||
2535 | freq = False |
|
2535 | freq = False | |
2536 | height = False |
|
2536 | height = False | |
2537 | db = False |
|
2537 | db = False | |
2538 | timerange = False |
|
2538 | timerange = False | |
2539 | magnitud = False |
|
2539 | magnitud = False | |
2540 | phase = False |
|
2540 | phase = False | |
2541 | channelList = False |
|
2541 | channelList = False | |
2542 |
|
2542 | |||
2543 | if self.specGraphCebSpectraplot.checkState(): |
|
2543 | if self.specGraphCebSpectraplot.checkState(): | |
2544 | freq = True |
|
2544 | freq = True | |
2545 | height = True |
|
2545 | height = True | |
2546 | db = True |
|
2546 | db = True | |
2547 | channelList = True |
|
2547 | channelList = True | |
2548 |
|
2548 | |||
2549 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2549 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2550 | freq = True |
|
2550 | freq = True | |
2551 | height = True |
|
2551 | height = True | |
2552 | db = True |
|
2552 | db = True | |
2553 | magnitud = True |
|
2553 | magnitud = True | |
2554 | phase = True |
|
2554 | phase = True | |
2555 |
|
2555 | |||
2556 | if self.specGraphCebRTIplot.checkState(): |
|
2556 | if self.specGraphCebRTIplot.checkState(): | |
2557 | height = True |
|
2557 | height = True | |
2558 | db = True |
|
2558 | db = True | |
2559 | timerange = True |
|
2559 | timerange = True | |
2560 | channelList = True |
|
2560 | channelList = True | |
2561 |
|
2561 | |||
2562 | if self.specGraphCebCoherencmap.checkState(): |
|
2562 | if self.specGraphCebCoherencmap.checkState(): | |
2563 | height = True |
|
2563 | height = True | |
2564 | timerange = True |
|
2564 | timerange = True | |
2565 | magnitud = True |
|
2565 | magnitud = True | |
2566 | phase = True |
|
2566 | phase = True | |
2567 |
|
2567 | |||
2568 | if self.specGraphPowerprofile.checkState(): |
|
2568 | if self.specGraphPowerprofile.checkState(): | |
2569 | height = True |
|
2569 | height = True | |
2570 | db = True |
|
2570 | db = True | |
2571 | channelList = True |
|
2571 | channelList = True | |
2572 |
|
2572 | |||
2573 | if self.specGraphCebRTInoise.checkState(): |
|
2573 | if self.specGraphCebRTInoise.checkState(): | |
2574 | db = True |
|
2574 | db = True | |
2575 | timerange = True |
|
2575 | timerange = True | |
2576 | channelList = True |
|
2576 | channelList = True | |
2577 |
|
2577 | |||
2578 |
|
2578 | |||
2579 | self.specGgraphFreq.setEnabled(freq) |
|
2579 | self.specGgraphFreq.setEnabled(freq) | |
2580 | self.specGgraphHeight.setEnabled(height) |
|
2580 | self.specGgraphHeight.setEnabled(height) | |
2581 | self.specGgraphDbsrange.setEnabled(db) |
|
2581 | self.specGgraphDbsrange.setEnabled(db) | |
2582 | self.specGgraphTminTmax.setEnabled(timerange) |
|
2582 | self.specGgraphTminTmax.setEnabled(timerange) | |
2583 |
|
2583 | |||
2584 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2584 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2585 | self.specGgraphPhase.setEnabled(phase) |
|
2585 | self.specGgraphPhase.setEnabled(phase) | |
2586 | self.specGgraphChannelList.setEnabled(channelList) |
|
2586 | self.specGgraphChannelList.setEnabled(channelList) | |
2587 |
|
2587 | |||
2588 | def __getParmsFromProjectWindow(self): |
|
2588 | def __getParmsFromProjectWindow(self): | |
2589 | """ |
|
2589 | """ | |
2590 | Check Inputs Project: |
|
2590 | Check Inputs Project: | |
2591 | - project_name |
|
2591 | - project_name | |
2592 | - datatype |
|
2592 | - datatype | |
2593 | - ext |
|
2593 | - ext | |
2594 | - data_path |
|
2594 | - data_path | |
2595 | - readmode |
|
2595 | - readmode | |
2596 | - delay |
|
2596 | - delay | |
2597 | - set |
|
2597 | - set | |
2598 | - walk |
|
2598 | - walk | |
2599 | """ |
|
2599 | """ | |
2600 | parms_ok = True |
|
2600 | parms_ok = True | |
2601 |
|
2601 | |||
2602 | project_name = str(self.proName.text()) |
|
2602 | project_name = str(self.proName.text()) | |
2603 |
|
2603 | |||
2604 | if project_name == '' or project_name == None: |
|
2604 | if project_name == '' or project_name == None: | |
2605 | outputstr = "Enter a project Name" |
|
2605 | outputstr = "Enter a project Name" | |
2606 | self.console.append(outputstr) |
|
2606 | self.console.append(outputstr) | |
2607 | parms_ok = False |
|
2607 | parms_ok = False | |
2608 | project_name = None |
|
2608 | project_name = None | |
2609 |
|
2609 | |||
2610 | description = str(self.proDescription.toPlainText()) |
|
2610 | description = str(self.proDescription.toPlainText()) | |
2611 |
|
2611 | |||
2612 | datatype = str(self.proComDataType.currentText()) |
|
2612 | datatype = str(self.proComDataType.currentText()) | |
2613 |
|
2613 | |||
2614 | ext = str(self.proDataType.text()) |
|
2614 | ext = str(self.proDataType.text()) | |
2615 |
|
2615 | |||
2616 | dpath = str(self.proDataPath.text()) |
|
2616 | dpath = str(self.proDataPath.text()) | |
2617 |
|
2617 | |||
2618 | if dpath == '': |
|
2618 | if dpath == '': | |
2619 | outputstr = 'Datapath is empty' |
|
2619 | outputstr = 'Datapath is empty' | |
2620 | self.console.append(outputstr) |
|
2620 | self.console.append(outputstr) | |
2621 | parms_ok = False |
|
2621 | parms_ok = False | |
2622 | dpath = None |
|
2622 | dpath = None | |
2623 |
|
2623 | |||
2624 | if dpath != None: |
|
2624 | if dpath != None: | |
2625 | if not os.path.isdir(dpath): |
|
2625 | if not os.path.isdir(dpath): | |
2626 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2626 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2627 | self.console.append(outputstr) |
|
2627 | self.console.append(outputstr) | |
2628 | parms_ok = False |
|
2628 | parms_ok = False | |
2629 | dpath = None |
|
2629 | dpath = None | |
2630 |
|
2630 | |||
2631 | online = int(self.proComReadMode.currentIndex()) |
|
2631 | online = int(self.proComReadMode.currentIndex()) | |
2632 |
|
2632 | |||
2633 | delay = None |
|
2633 | delay = None | |
2634 | if online==1: |
|
2634 | if online==1: | |
2635 | try: |
|
2635 | try: | |
2636 | delay = int(str(self.proDelay.text())) |
|
2636 | delay = int(str(self.proDelay.text())) | |
2637 | except: |
|
2637 | except: | |
2638 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2638 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2639 | self.console.append(outputstr) |
|
2639 | self.console.append(outputstr) | |
2640 | parms_ok = False |
|
2640 | parms_ok = False | |
2641 |
|
2641 | |||
2642 |
|
2642 | |||
2643 | set = None |
|
2643 | set = None | |
2644 | value = str(self.proSet.text()) |
|
2644 | value = str(self.proSet.text()) | |
2645 | try: |
|
2645 | try: | |
2646 | set = int(value) |
|
2646 | set = int(value) | |
2647 | except: |
|
2647 | except: | |
2648 | pass |
|
2648 | pass | |
2649 |
|
2649 | |||
2650 | ippKm = None |
|
2650 | ippKm = None | |
2651 |
|
2651 | |||
2652 | value = str(self.proIPPKm.text()) |
|
2652 | value = str(self.proIPPKm.text()) | |
2653 |
|
2653 | |||
2654 | try: |
|
2654 | try: | |
2655 | ippKm = float(value) |
|
2655 | ippKm = float(value) | |
2656 | except: |
|
2656 | except: | |
2657 | if datatype=="USRP": |
|
2657 | if datatype=="USRP": | |
2658 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2658 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2659 | self.console.append(outputstr) |
|
2659 | self.console.append(outputstr) | |
2660 | parms_ok = False |
|
2660 | parms_ok = False | |
2661 |
|
2661 | |||
2662 | walk = int(self.proComWalk.currentIndex()) |
|
2662 | walk = int(self.proComWalk.currentIndex()) | |
2663 | expLabel = str(self.proExpLabel.text()) |
|
2663 | expLabel = str(self.proExpLabel.text()) | |
2664 |
|
2664 | |||
2665 | startDate = str(self.proComStartDate.currentText()).strip() |
|
2665 | startDate = str(self.proComStartDate.currentText()).strip() | |
2666 | endDate = str(self.proComEndDate.currentText()).strip() |
|
2666 | endDate = str(self.proComEndDate.currentText()).strip() | |
2667 |
|
2667 | |||
2668 | if not startDate: |
|
2668 | if not startDate: | |
2669 | parms_ok = False |
|
2669 | parms_ok = False | |
2670 |
|
2670 | |||
2671 | if not endDate: |
|
2671 | if not endDate: | |
2672 | parms_ok = False |
|
2672 | parms_ok = False | |
2673 |
|
2673 | |||
2674 | # startDateList = startDate.split("/") |
|
2674 | # startDateList = startDate.split("/") | |
2675 | # endDateList = endDate.split("/") |
|
2675 | # endDateList = endDate.split("/") | |
2676 | # |
|
2676 | # | |
2677 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2677 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2678 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2678 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2679 |
|
2679 | |||
2680 | startTime = self.proStartTime.time() |
|
2680 | startTime = self.proStartTime.time() | |
2681 | endTime = self.proEndTime.time() |
|
2681 | endTime = self.proEndTime.time() | |
2682 |
|
2682 | |||
2683 | startTime = str(startTime.toString("H:m:s")) |
|
2683 | startTime = str(startTime.toString("H:m:s")) | |
2684 | endTime = str(endTime.toString("H:m:s")) |
|
2684 | endTime = str(endTime.toString("H:m:s")) | |
2685 |
|
2685 | |||
2686 | projectParms = ProjectParms() |
|
2686 | projectParms = ProjectParms() | |
2687 |
|
2687 | |||
2688 | projectParms.name = project_name |
|
2688 | projectParms.name = project_name | |
2689 | projectParms.description = description |
|
2689 | projectParms.description = description | |
2690 | projectParms.datatype = datatype |
|
2690 | projectParms.datatype = datatype | |
2691 | projectParms.ext = ext |
|
2691 | projectParms.ext = ext | |
2692 | projectParms.dpath = dpath |
|
2692 | projectParms.dpath = dpath | |
2693 | projectParms.online = online |
|
2693 | projectParms.online = online | |
2694 | projectParms.startDate = startDate |
|
2694 | projectParms.startDate = startDate | |
2695 | projectParms.endDate = endDate |
|
2695 | projectParms.endDate = endDate | |
2696 | projectParms.startTime = startTime |
|
2696 | projectParms.startTime = startTime | |
2697 | projectParms.endTime = endTime |
|
2697 | projectParms.endTime = endTime | |
2698 | projectParms.delay = delay |
|
2698 | projectParms.delay = delay | |
2699 | projectParms.walk = walk |
|
2699 | projectParms.walk = walk | |
2700 | projectParms.expLabel = expLabel |
|
2700 | projectParms.expLabel = expLabel | |
2701 | projectParms.set = set |
|
2701 | projectParms.set = set | |
2702 | projectParms.ippKm = ippKm |
|
2702 | projectParms.ippKm = ippKm | |
2703 | projectParms.parmsOk = parms_ok |
|
2703 | projectParms.parmsOk = parms_ok | |
2704 |
|
2704 | |||
2705 | return projectParms |
|
2705 | return projectParms | |
2706 |
|
2706 | |||
2707 |
|
2707 | |||
2708 | def __getParmsFromProjectObj(self, projectObjView): |
|
2708 | def __getParmsFromProjectObj(self, projectObjView): | |
2709 |
|
2709 | |||
2710 | parms_ok = True |
|
2710 | parms_ok = True | |
2711 |
|
2711 | |||
2712 | project_name, description = projectObjView.name, projectObjView.description |
|
2712 | project_name, description = projectObjView.name, projectObjView.description | |
2713 |
|
2713 | |||
2714 | readUnitObj = projectObjView.getReadUnitObj() |
|
2714 | readUnitObj = projectObjView.getReadUnitObj() | |
2715 | datatype = readUnitObj.datatype |
|
2715 | datatype = readUnitObj.datatype | |
2716 |
|
2716 | |||
2717 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2717 | operationObj = readUnitObj.getOperationObj(name='run') | |
2718 |
|
2718 | |||
2719 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2719 | dpath = operationObj.getParameterValue(parameterName='path') | |
2720 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2720 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2721 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2721 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2722 |
|
2722 | |||
2723 | startDate = startDate.strftime("%Y/%m/%d") |
|
2723 | startDate = startDate.strftime("%Y/%m/%d") | |
2724 | endDate = endDate.strftime("%Y/%m/%d") |
|
2724 | endDate = endDate.strftime("%Y/%m/%d") | |
2725 |
|
2725 | |||
2726 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2726 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2727 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2727 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2728 |
|
2728 | |||
2729 | startTime = startTime.strftime("%H:%M:%S") |
|
2729 | startTime = startTime.strftime("%H:%M:%S") | |
2730 | endTime = endTime.strftime("%H:%M:%S") |
|
2730 | endTime = endTime.strftime("%H:%M:%S") | |
2731 |
|
2731 | |||
2732 | online = 0 |
|
2732 | online = 0 | |
2733 | try: |
|
2733 | try: | |
2734 | online = operationObj.getParameterValue(parameterName='online') |
|
2734 | online = operationObj.getParameterValue(parameterName='online') | |
2735 | except: |
|
2735 | except: | |
2736 | pass |
|
2736 | pass | |
2737 |
|
2737 | |||
2738 | delay = '' |
|
2738 | delay = '' | |
2739 | try: |
|
2739 | try: | |
2740 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2740 | delay = operationObj.getParameterValue(parameterName='delay') | |
2741 | except: |
|
2741 | except: | |
2742 | pass |
|
2742 | pass | |
2743 |
|
2743 | |||
2744 | walk = 0 |
|
2744 | walk = 0 | |
2745 | try: |
|
2745 | try: | |
2746 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2746 | walk = operationObj.getParameterValue(parameterName='walk') | |
2747 | except: |
|
2747 | except: | |
2748 | pass |
|
2748 | pass | |
2749 |
|
2749 | |||
2750 | set = '' |
|
2750 | set = '' | |
2751 | try: |
|
2751 | try: | |
2752 | set = operationObj.getParameterValue(parameterName='set') |
|
2752 | set = operationObj.getParameterValue(parameterName='set') | |
2753 | except: |
|
2753 | except: | |
2754 | pass |
|
2754 | pass | |
2755 |
|
2755 | |||
2756 | expLabel = '' |
|
2756 | expLabel = '' | |
2757 | try: |
|
2757 | try: | |
2758 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2758 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2759 | except: |
|
2759 | except: | |
2760 | pass |
|
2760 | pass | |
2761 |
|
2761 | |||
2762 | ippKm = '' |
|
2762 | ippKm = '' | |
2763 | if datatype.lower() == 'usrp': |
|
2763 | if datatype.lower() == 'usrp': | |
2764 | try: |
|
2764 | try: | |
2765 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2765 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2766 | except: |
|
2766 | except: | |
2767 | pass |
|
2767 | pass | |
2768 |
|
2768 | |||
2769 | projectParms = ProjectParms() |
|
2769 | projectParms = ProjectParms() | |
2770 |
|
2770 | |||
2771 | projectParms.name = project_name |
|
2771 | projectParms.name = project_name | |
2772 | projectParms.description = description |
|
2772 | projectParms.description = description | |
2773 | projectParms.datatype = datatype |
|
2773 | projectParms.datatype = datatype | |
2774 | projectParms.ext = None |
|
2774 | projectParms.ext = None | |
2775 | projectParms.dpath = dpath |
|
2775 | projectParms.dpath = dpath | |
2776 | projectParms.online = online |
|
2776 | projectParms.online = online | |
2777 | projectParms.startDate = startDate |
|
2777 | projectParms.startDate = startDate | |
2778 | projectParms.endDate = endDate |
|
2778 | projectParms.endDate = endDate | |
2779 | projectParms.startTime = startTime |
|
2779 | projectParms.startTime = startTime | |
2780 | projectParms.endTime = endTime |
|
2780 | projectParms.endTime = endTime | |
2781 | projectParms.delay=delay |
|
2781 | projectParms.delay=delay | |
2782 | projectParms.walk=walk |
|
2782 | projectParms.walk=walk | |
2783 | projectParms.set=set |
|
2783 | projectParms.set=set | |
2784 | projectParms.ippKm=ippKm |
|
2784 | projectParms.ippKm=ippKm | |
2785 | projectParms.expLabel = expLabel |
|
2785 | projectParms.expLabel = expLabel | |
2786 | projectParms.parmsOk=parms_ok |
|
2786 | projectParms.parmsOk=parms_ok | |
2787 |
|
2787 | |||
2788 | return projectParms |
|
2788 | return projectParms | |
2789 |
|
2789 | |||
2790 | def refreshProjectWindow(self, projectObjView): |
|
2790 | def refreshProjectWindow(self, projectObjView): | |
2791 |
|
2791 | |||
2792 | self.proOk.setEnabled(False) |
|
2792 | self.proOk.setEnabled(False) | |
2793 |
|
2793 | |||
2794 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2794 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2795 |
|
2795 | |||
2796 | index = projectParms.getDatatypeIndex() |
|
2796 | index = projectParms.getDatatypeIndex() | |
2797 |
|
2797 | |||
2798 | self.proName.setText(projectParms.name) |
|
2798 | self.proName.setText(projectParms.name) | |
2799 | self.proDescription.clear() |
|
2799 | self.proDescription.clear() | |
2800 | self.proDescription.append(projectParms.description) |
|
2800 | self.proDescription.append(projectParms.description) | |
2801 |
|
2801 | |||
2802 | self.on_proComDataType_activated(index=index) |
|
2802 | self.on_proComDataType_activated(index=index) | |
2803 | self.proDataPath.setText(projectParms.dpath) |
|
2803 | self.proDataPath.setText(projectParms.dpath) | |
2804 | self.proComDataType.setCurrentIndex(index) |
|
2804 | self.proComDataType.setCurrentIndex(index) | |
2805 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2805 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2806 | self.proDelay.setText(str(projectParms.delay)) |
|
2806 | self.proDelay.setText(str(projectParms.delay)) | |
2807 | self.proSet.setText(str(projectParms.set)) |
|
2807 | self.proSet.setText(str(projectParms.set)) | |
2808 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2808 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2809 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2809 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2810 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2810 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2811 |
|
2811 | |||
2812 | self.on_proComReadMode_activated(projectParms.online) |
|
2812 | self.on_proComReadMode_activated(projectParms.online) | |
2813 | self.on_proComWalk_activated(projectParms.walk) |
|
2813 | self.on_proComWalk_activated(projectParms.walk) | |
2814 |
|
2814 | |||
2815 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2815 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2816 | ext = projectParms.getExt(), |
|
2816 | ext = projectParms.getExt(), | |
2817 | walk = projectParms.walk, |
|
2817 | walk = projectParms.walk, | |
2818 | expLabel = projectParms.expLabel) |
|
2818 | expLabel = projectParms.expLabel) | |
2819 |
|
2819 | |||
2820 | if not dateList: |
|
2820 | if not dateList: | |
2821 | return 0 |
|
2821 | return 0 | |
2822 |
|
2822 | |||
2823 | try: |
|
2823 | try: | |
2824 | startDateIndex = dateList.index(projectParms.startDate) |
|
2824 | startDateIndex = dateList.index(projectParms.startDate) | |
2825 | except: |
|
2825 | except: | |
2826 | startDateIndex = 0 |
|
2826 | startDateIndex = 0 | |
2827 |
|
2827 | |||
2828 | try: |
|
2828 | try: | |
2829 | endDateIndex = dateList.index(projectParms.endDate) |
|
2829 | endDateIndex = dateList.index(projectParms.endDate) | |
2830 | except: |
|
2830 | except: | |
2831 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2831 | endDateIndex = int(self.proComEndDate.count()-1) | |
2832 |
|
2832 | |||
2833 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2833 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2834 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2834 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2835 |
|
2835 | |||
2836 | startlist = projectParms.startTime.split(":") |
|
2836 | startlist = projectParms.startTime.split(":") | |
2837 | endlist = projectParms.endTime.split(":") |
|
2837 | endlist = projectParms.endTime.split(":") | |
2838 |
|
2838 | |||
2839 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2839 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2840 | self.proStartTime.setTime(self.time) |
|
2840 | self.proStartTime.setTime(self.time) | |
2841 |
|
2841 | |||
2842 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2842 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2843 | self.proEndTime.setTime(self.time) |
|
2843 | self.proEndTime.setTime(self.time) | |
2844 |
|
2844 | |||
2845 | self.proOk.setEnabled(True) |
|
2845 | self.proOk.setEnabled(True) | |
2846 |
|
2846 | |||
2847 | return 1 |
|
2847 | return 1 | |
2848 |
|
2848 | |||
2849 | def __refreshVoltageWindow(self, puObj): |
|
2849 | def __refreshVoltageWindow(self, puObj): | |
2850 |
|
2850 | |||
2851 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2851 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2852 | if opObj == None: |
|
2852 | if opObj == None: | |
2853 | self.volOpRadarfrequency.clear() |
|
2853 | self.volOpRadarfrequency.clear() | |
2854 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2854 | self.volOpCebRadarfrequency.setCheckState(0) | |
2855 | else: |
|
2855 | else: | |
2856 | value = opObj.getParameterValue(parameterName='frequency') |
|
2856 | value = opObj.getParameterValue(parameterName='frequency') | |
2857 | value = str(float(value)/1e6) |
|
2857 | value = str(float(value)/1e6) | |
2858 | self.volOpRadarfrequency.setText(value) |
|
2858 | self.volOpRadarfrequency.setText(value) | |
2859 | self.volOpRadarfrequency.setEnabled(True) |
|
2859 | self.volOpRadarfrequency.setEnabled(True) | |
2860 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2860 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2861 |
|
2861 | |||
2862 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2862 | opObj = puObj.getOperationObj(name="selectChannels") | |
2863 |
|
2863 | |||
2864 | if opObj == None: |
|
2864 | if opObj == None: | |
2865 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2865 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2866 |
|
2866 | |||
2867 | if opObj == None: |
|
2867 | if opObj == None: | |
2868 | self.volOpChannel.clear() |
|
2868 | self.volOpChannel.clear() | |
2869 | self.volOpCebChannels.setCheckState(0) |
|
2869 | self.volOpCebChannels.setCheckState(0) | |
2870 | else: |
|
2870 | else: | |
2871 | channelEnabled = False |
|
2871 | channelEnabled = False | |
2872 | try: |
|
2872 | try: | |
2873 | value = opObj.getParameterValue(parameterName='channelList') |
|
2873 | value = opObj.getParameterValue(parameterName='channelList') | |
2874 | value = str(value)[1:-1] |
|
2874 | value = str(value)[1:-1] | |
2875 | channelEnabled = True |
|
2875 | channelEnabled = True | |
2876 | channelMode = 0 |
|
2876 | channelMode = 0 | |
2877 | except: |
|
2877 | except: | |
2878 | pass |
|
2878 | pass | |
2879 | try: |
|
2879 | try: | |
2880 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2880 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2881 | value = str(value)[1:-1] |
|
2881 | value = str(value)[1:-1] | |
2882 | channelEnabled = True |
|
2882 | channelEnabled = True | |
2883 | channelMode = 1 |
|
2883 | channelMode = 1 | |
2884 | except: |
|
2884 | except: | |
2885 | pass |
|
2885 | pass | |
2886 |
|
2886 | |||
2887 | if channelEnabled: |
|
2887 | if channelEnabled: | |
2888 | self.volOpChannel.setText(value) |
|
2888 | self.volOpChannel.setText(value) | |
2889 | self.volOpChannel.setEnabled(True) |
|
2889 | self.volOpChannel.setEnabled(True) | |
2890 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2890 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2891 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2891 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2892 |
|
2892 | |||
2893 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2893 | opObj = puObj.getOperationObj(name="selectHeights") | |
2894 | if opObj == None: |
|
2894 | if opObj == None: | |
2895 | self.volOpHeights.clear() |
|
2895 | self.volOpHeights.clear() | |
2896 | self.volOpCebHeights.setCheckState(0) |
|
2896 | self.volOpCebHeights.setCheckState(0) | |
2897 | else: |
|
2897 | else: | |
2898 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2898 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2899 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2899 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2900 | value = value1 + "," + value2 |
|
2900 | value = value1 + "," + value2 | |
2901 | self.volOpHeights.setText(value) |
|
2901 | self.volOpHeights.setText(value) | |
2902 | self.volOpHeights.setEnabled(True) |
|
2902 | self.volOpHeights.setEnabled(True) | |
2903 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2903 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2904 |
|
2904 | |||
2905 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2905 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2906 | if opObj == None: |
|
2906 | if opObj == None: | |
2907 | self.volOpFilter.clear() |
|
2907 | self.volOpFilter.clear() | |
2908 | self.volOpCebFilter.setCheckState(0) |
|
2908 | self.volOpCebFilter.setCheckState(0) | |
2909 | else: |
|
2909 | else: | |
2910 | value = opObj.getParameterValue(parameterName='window') |
|
2910 | value = opObj.getParameterValue(parameterName='window') | |
2911 | value = str(value) |
|
2911 | value = str(value) | |
2912 | self.volOpFilter.setText(value) |
|
2912 | self.volOpFilter.setText(value) | |
2913 | self.volOpFilter.setEnabled(True) |
|
2913 | self.volOpFilter.setEnabled(True) | |
2914 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2914 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2915 |
|
2915 | |||
2916 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2916 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2917 | if opObj == None: |
|
2917 | if opObj == None: | |
2918 | self.volOpProfile.clear() |
|
2918 | self.volOpProfile.clear() | |
2919 | self.volOpCebProfile.setCheckState(0) |
|
2919 | self.volOpCebProfile.setCheckState(0) | |
2920 | else: |
|
2920 | else: | |
2921 | for parmObj in opObj.getParameterObjList(): |
|
2921 | for parmObj in opObj.getParameterObjList(): | |
2922 |
|
2922 | |||
2923 | if parmObj.name == "profileList": |
|
2923 | if parmObj.name == "profileList": | |
2924 | value = parmObj.getValue() |
|
2924 | value = parmObj.getValue() | |
2925 | value = str(value)[1:-1] |
|
2925 | value = str(value)[1:-1] | |
2926 | self.volOpProfile.setText(value) |
|
2926 | self.volOpProfile.setText(value) | |
2927 | self.volOpProfile.setEnabled(True) |
|
2927 | self.volOpProfile.setEnabled(True) | |
2928 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2928 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2929 | self.volOpComProfile.setCurrentIndex(0) |
|
2929 | self.volOpComProfile.setCurrentIndex(0) | |
2930 |
|
2930 | |||
2931 | if parmObj.name == "profileRangeList": |
|
2931 | if parmObj.name == "profileRangeList": | |
2932 | value = parmObj.getValue() |
|
2932 | value = parmObj.getValue() | |
2933 | value = str(value)[1:-1] |
|
2933 | value = str(value)[1:-1] | |
2934 | self.volOpProfile.setText(value) |
|
2934 | self.volOpProfile.setText(value) | |
2935 | self.volOpProfile.setEnabled(True) |
|
2935 | self.volOpProfile.setEnabled(True) | |
2936 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2936 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2937 | self.volOpComProfile.setCurrentIndex(1) |
|
2937 | self.volOpComProfile.setCurrentIndex(1) | |
2938 |
|
2938 | |||
2939 | if parmObj.name == "rangeList": |
|
2939 | if parmObj.name == "rangeList": | |
2940 | value = parmObj.getValue() |
|
2940 | value = parmObj.getValue() | |
2941 | value = str(value)[1:-1] |
|
2941 | value = str(value)[1:-1] | |
2942 | self.volOpProfile.setText(value) |
|
2942 | self.volOpProfile.setText(value) | |
2943 | self.volOpProfile.setEnabled(True) |
|
2943 | self.volOpProfile.setEnabled(True) | |
2944 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2944 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2945 | self.volOpComProfile.setCurrentIndex(2) |
|
2945 | self.volOpComProfile.setCurrentIndex(2) | |
2946 |
|
2946 | |||
2947 | opObj = puObj.getOperationObj(name="Decoder") |
|
2947 | opObj = puObj.getOperationObj(name="Decoder") | |
2948 | self.volOpCode.setText("") |
|
2948 | self.volOpCode.setText("") | |
2949 | if opObj == None: |
|
2949 | if opObj == None: | |
2950 | self.volOpCebDecodification.setCheckState(0) |
|
2950 | self.volOpCebDecodification.setCheckState(0) | |
2951 | else: |
|
2951 | else: | |
2952 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2952 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2953 |
|
2953 | |||
2954 | parmObj = opObj.getParameterObj('code') |
|
2954 | parmObj = opObj.getParameterObj('code') | |
2955 |
|
2955 | |||
2956 | if parmObj == None: |
|
2956 | if parmObj == None: | |
2957 | self.volOpComCode.setCurrentIndex(0) |
|
2957 | self.volOpComCode.setCurrentIndex(0) | |
2958 | else: |
|
2958 | else: | |
2959 |
|
2959 | |||
2960 | parmObj1 = opObj.getParameterObj('nCode') |
|
2960 | parmObj1 = opObj.getParameterObj('nCode') | |
2961 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2961 | parmObj2 = opObj.getParameterObj('nBaud') | |
2962 |
|
2962 | |||
2963 | if parmObj1 == None or parmObj2 == None: |
|
2963 | if parmObj1 == None or parmObj2 == None: | |
2964 | self.volOpComCode.setCurrentIndex(0) |
|
2964 | self.volOpComCode.setCurrentIndex(0) | |
2965 | else: |
|
2965 | else: | |
2966 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2966 | code = ast.literal_eval(str(parmObj.getValue())) | |
2967 | nCode = parmObj1.getValue() |
|
2967 | nCode = parmObj1.getValue() | |
2968 | nBaud = parmObj2.getValue() |
|
2968 | nBaud = parmObj2.getValue() | |
2969 |
|
2969 | |||
2970 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2970 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2971 |
|
2971 | |||
2972 | #User defined by default |
|
2972 | #User defined by default | |
2973 | self.volOpComCode.setCurrentIndex(13) |
|
2973 | self.volOpComCode.setCurrentIndex(13) | |
2974 | self.volOpCode.setText(str(code)) |
|
2974 | self.volOpCode.setText(str(code)) | |
2975 |
|
2975 | |||
2976 | if nCode == 1: |
|
2976 | if nCode == 1: | |
2977 | if nBaud == 3: |
|
2977 | if nBaud == 3: | |
2978 | self.volOpComCode.setCurrentIndex(1) |
|
2978 | self.volOpComCode.setCurrentIndex(1) | |
2979 | if nBaud == 4: |
|
2979 | if nBaud == 4: | |
2980 | self.volOpComCode.setCurrentIndex(2) |
|
2980 | self.volOpComCode.setCurrentIndex(2) | |
2981 | if nBaud == 5: |
|
2981 | if nBaud == 5: | |
2982 | self.volOpComCode.setCurrentIndex(3) |
|
2982 | self.volOpComCode.setCurrentIndex(3) | |
2983 | if nBaud == 7: |
|
2983 | if nBaud == 7: | |
2984 | self.volOpComCode.setCurrentIndex(4) |
|
2984 | self.volOpComCode.setCurrentIndex(4) | |
2985 | if nBaud == 11: |
|
2985 | if nBaud == 11: | |
2986 | self.volOpComCode.setCurrentIndex(5) |
|
2986 | self.volOpComCode.setCurrentIndex(5) | |
2987 | if nBaud == 13: |
|
2987 | if nBaud == 13: | |
2988 | self.volOpComCode.setCurrentIndex(6) |
|
2988 | self.volOpComCode.setCurrentIndex(6) | |
2989 |
|
2989 | |||
2990 | if nCode == 2: |
|
2990 | if nCode == 2: | |
2991 | if nBaud == 3: |
|
2991 | if nBaud == 3: | |
2992 | self.volOpComCode.setCurrentIndex(7) |
|
2992 | self.volOpComCode.setCurrentIndex(7) | |
2993 | if nBaud == 4: |
|
2993 | if nBaud == 4: | |
2994 | self.volOpComCode.setCurrentIndex(8) |
|
2994 | self.volOpComCode.setCurrentIndex(8) | |
2995 | if nBaud == 5: |
|
2995 | if nBaud == 5: | |
2996 | self.volOpComCode.setCurrentIndex(9) |
|
2996 | self.volOpComCode.setCurrentIndex(9) | |
2997 | if nBaud == 7: |
|
2997 | if nBaud == 7: | |
2998 | self.volOpComCode.setCurrentIndex(10) |
|
2998 | self.volOpComCode.setCurrentIndex(10) | |
2999 | if nBaud == 11: |
|
2999 | if nBaud == 11: | |
3000 | self.volOpComCode.setCurrentIndex(11) |
|
3000 | self.volOpComCode.setCurrentIndex(11) | |
3001 | if nBaud == 13: |
|
3001 | if nBaud == 13: | |
3002 | self.volOpComCode.setCurrentIndex(12) |
|
3002 | self.volOpComCode.setCurrentIndex(12) | |
3003 |
|
3003 | |||
3004 |
|
3004 | |||
3005 | opObj = puObj.getOperationObj(name="deFlip") |
|
3005 | opObj = puObj.getOperationObj(name="deFlip") | |
3006 | if opObj == None: |
|
3006 | if opObj == None: | |
3007 | self.volOpFlip.clear() |
|
3007 | self.volOpFlip.clear() | |
3008 | self.volOpFlip.setEnabled(False) |
|
3008 | self.volOpFlip.setEnabled(False) | |
3009 | self.volOpCebFlip.setCheckState(0) |
|
3009 | self.volOpCebFlip.setCheckState(0) | |
3010 | else: |
|
3010 | else: | |
3011 | try: |
|
3011 | try: | |
3012 | value = opObj.getParameterValue(parameterName='channelList') |
|
3012 | value = opObj.getParameterValue(parameterName='channelList') | |
3013 | value = str(value)[1:-1] |
|
3013 | value = str(value)[1:-1] | |
3014 | except: |
|
3014 | except: | |
3015 | value = "" |
|
3015 | value = "" | |
3016 |
|
3016 | |||
3017 | self.volOpFlip.setText(value) |
|
3017 | self.volOpFlip.setText(value) | |
3018 | self.volOpFlip.setEnabled(True) |
|
3018 | self.volOpFlip.setEnabled(True) | |
3019 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
3019 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
3020 |
|
3020 | |||
3021 | opObj = puObj.getOperationObj(name="CohInt") |
|
3021 | opObj = puObj.getOperationObj(name="CohInt") | |
3022 | if opObj == None: |
|
3022 | if opObj == None: | |
3023 | self.volOpCohInt.clear() |
|
3023 | self.volOpCohInt.clear() | |
3024 | self.volOpCebCohInt.setCheckState(0) |
|
3024 | self.volOpCebCohInt.setCheckState(0) | |
3025 | else: |
|
3025 | else: | |
3026 | value = opObj.getParameterValue(parameterName='n') |
|
3026 | value = opObj.getParameterValue(parameterName='n') | |
3027 | self.volOpCohInt.setText(str(value)) |
|
3027 | self.volOpCohInt.setText(str(value)) | |
3028 | self.volOpCohInt.setEnabled(True) |
|
3028 | self.volOpCohInt.setEnabled(True) | |
3029 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
3029 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
3030 |
|
3030 | |||
3031 | opObj = puObj.getOperationObj(name='Scope') |
|
3031 | opObj = puObj.getOperationObj(name='Scope') | |
3032 | if opObj == None: |
|
3032 | if opObj == None: | |
3033 | self.volGraphCebshow.setCheckState(0) |
|
3033 | self.volGraphCebshow.setCheckState(0) | |
3034 | else: |
|
3034 | else: | |
3035 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
3035 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
3036 |
|
3036 | |||
3037 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3037 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3038 |
|
3038 | |||
3039 | if parmObj == None: |
|
3039 | if parmObj == None: | |
3040 | self.volGraphChannelList.clear() |
|
3040 | self.volGraphChannelList.clear() | |
3041 | else: |
|
3041 | else: | |
3042 | value = parmObj.getValue() |
|
3042 | value = parmObj.getValue() | |
3043 | value = str(value) |
|
3043 | value = str(value) | |
3044 | self.volGraphChannelList.setText(value) |
|
3044 | self.volGraphChannelList.setText(value) | |
3045 | # self.volOpChannel.setEnabled(True) |
|
3045 | # self.volOpChannel.setEnabled(True) | |
3046 |
|
3046 | |||
3047 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
3047 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
3048 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
3048 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
3049 |
|
3049 | |||
3050 | if parmObj1 == None or parmObj2 ==None: |
|
3050 | if parmObj1 == None or parmObj2 ==None: | |
3051 | self.volGraphIntensityRange.clear() |
|
3051 | self.volGraphIntensityRange.clear() | |
3052 | else: |
|
3052 | else: | |
3053 | value1 = parmObj1.getValue() |
|
3053 | value1 = parmObj1.getValue() | |
3054 | value1 = str(value1) |
|
3054 | value1 = str(value1) | |
3055 | value2 = parmObj2.getValue() |
|
3055 | value2 = parmObj2.getValue() | |
3056 | value2 = str(value2) |
|
3056 | value2 = str(value2) | |
3057 | value = value1 + "," + value2 |
|
3057 | value = value1 + "," + value2 | |
3058 | self.volGraphIntensityRange.setText(value) |
|
3058 | self.volGraphIntensityRange.setText(value) | |
3059 |
|
3059 | |||
3060 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
3060 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
3061 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
3061 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
3062 |
|
3062 | |||
3063 | if parmObj1 == None or parmObj2 ==None: |
|
3063 | if parmObj1 == None or parmObj2 ==None: | |
3064 | self.volGraphHeightrange.clear() |
|
3064 | self.volGraphHeightrange.clear() | |
3065 | else: |
|
3065 | else: | |
3066 | value1 = parmObj1.getValue() |
|
3066 | value1 = parmObj1.getValue() | |
3067 | value1 = str(value1) |
|
3067 | value1 = str(value1) | |
3068 | value2 = parmObj2.getValue() |
|
3068 | value2 = parmObj2.getValue() | |
3069 | value2 = str(value2) |
|
3069 | value2 = str(value2) | |
3070 | value = value1 + "," + value2 |
|
3070 | value = value1 + "," + value2 | |
3071 | value2 = str(value2) |
|
3071 | value2 = str(value2) | |
3072 | self.volGraphHeightrange.setText(value) |
|
3072 | self.volGraphHeightrange.setText(value) | |
3073 |
|
3073 | |||
3074 | parmObj = opObj.getParameterObj(parameterName='type') |
|
3074 | parmObj = opObj.getParameterObj(parameterName='type') | |
3075 |
|
3075 | |||
3076 | if parmObj == None: |
|
3076 | if parmObj == None: | |
3077 | self.volComScopeType.setCurrentIndex(0) |
|
3077 | self.volComScopeType.setCurrentIndex(0) | |
3078 | else: |
|
3078 | else: | |
3079 | value = parmObj.getValue() |
|
3079 | value = parmObj.getValue() | |
3080 | if value == "iq": |
|
3080 | if value == "iq": | |
3081 | self.volComScopeType.setCurrentIndex(0) |
|
3081 | self.volComScopeType.setCurrentIndex(0) | |
3082 | if value == "power": |
|
3082 | if value == "power": | |
3083 | self.volComScopeType.setCurrentIndex(1) |
|
3083 | self.volComScopeType.setCurrentIndex(1) | |
3084 |
|
3084 | |||
3085 | parmObj = opObj.getParameterObj(parameterName='save') |
|
3085 | parmObj = opObj.getParameterObj(parameterName='save') | |
3086 |
|
3086 | |||
3087 | if parmObj == None: |
|
3087 | if parmObj == None: | |
3088 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
3088 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
3089 | else: |
|
3089 | else: | |
3090 | value = parmObj.getValue() |
|
3090 | value = parmObj.getValue() | |
3091 | if value: |
|
3091 | if value: | |
3092 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
3092 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
3093 | else: |
|
3093 | else: | |
3094 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
3094 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
3095 |
|
3095 | |||
3096 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
3096 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
3097 | if parmObj == None: |
|
3097 | if parmObj == None: | |
3098 | self.volGraphPath.clear() |
|
3098 | self.volGraphPath.clear() | |
3099 | else: |
|
3099 | else: | |
3100 | value = parmObj.getValue() |
|
3100 | value = parmObj.getValue() | |
3101 | path = str(value) |
|
3101 | path = str(value) | |
3102 | self.volGraphPath.setText(path) |
|
3102 | self.volGraphPath.setText(path) | |
3103 |
|
3103 | |||
3104 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
3104 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
3105 | if parmObj == None: |
|
3105 | if parmObj == None: | |
3106 | self.volGraphPrefix.clear() |
|
3106 | self.volGraphPrefix.clear() | |
3107 | else: |
|
3107 | else: | |
3108 | value = parmObj.getValue() |
|
3108 | value = parmObj.getValue() | |
3109 | figfile = str(value) |
|
3109 | figfile = str(value) | |
3110 | self.volGraphPrefix.setText(figfile) |
|
3110 | self.volGraphPrefix.setText(figfile) | |
3111 |
|
3111 | |||
3112 | # outputVoltageWrite |
|
3112 | # outputVoltageWrite | |
3113 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
3113 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
3114 |
|
3114 | |||
3115 | if opObj == None: |
|
3115 | if opObj == None: | |
3116 | self.volOutputPath.clear() |
|
3116 | self.volOutputPath.clear() | |
3117 | self.volOutputblocksperfile.clear() |
|
3117 | self.volOutputblocksperfile.clear() | |
3118 | self.volOutputprofilesperblock.clear() |
|
3118 | self.volOutputprofilesperblock.clear() | |
3119 | else: |
|
3119 | else: | |
3120 | parmObj = opObj.getParameterObj(parameterName='path') |
|
3120 | parmObj = opObj.getParameterObj(parameterName='path') | |
3121 | if parmObj == None: |
|
3121 | if parmObj == None: | |
3122 | self.volOutputPath.clear() |
|
3122 | self.volOutputPath.clear() | |
3123 | else: |
|
3123 | else: | |
3124 | value = parmObj.getValue() |
|
3124 | value = parmObj.getValue() | |
3125 | path = str(value) |
|
3125 | path = str(value) | |
3126 | self.volOutputPath.setText(path) |
|
3126 | self.volOutputPath.setText(path) | |
3127 |
|
3127 | |||
3128 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3128 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
3129 | if parmObj == None: |
|
3129 | if parmObj == None: | |
3130 | self.volOutputblocksperfile.clear() |
|
3130 | self.volOutputblocksperfile.clear() | |
3131 | else: |
|
3131 | else: | |
3132 | value = parmObj.getValue() |
|
3132 | value = parmObj.getValue() | |
3133 | blocksperfile = str(value) |
|
3133 | blocksperfile = str(value) | |
3134 | self.volOutputblocksperfile.setText(blocksperfile) |
|
3134 | self.volOutputblocksperfile.setText(blocksperfile) | |
3135 |
|
3135 | |||
3136 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
3136 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
3137 | if parmObj == None: |
|
3137 | if parmObj == None: | |
3138 | self.volOutputprofilesperblock.clear() |
|
3138 | self.volOutputprofilesperblock.clear() | |
3139 | else: |
|
3139 | else: | |
3140 | value = parmObj.getValue() |
|
3140 | value = parmObj.getValue() | |
3141 | profilesPerBlock = str(value) |
|
3141 | profilesPerBlock = str(value) | |
3142 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
3142 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
3143 |
|
3143 | |||
3144 | return |
|
3144 | return | |
3145 |
|
3145 | |||
3146 | def __refreshSpectraWindow(self, puObj): |
|
3146 | def __refreshSpectraWindow(self, puObj): | |
3147 |
|
3147 | |||
3148 | inputId = puObj.getInputId() |
|
3148 | inputId = puObj.getInputId() | |
3149 | inputPUObj = self.__puObjDict[inputId] |
|
3149 | inputPUObj = self.__puObjDict[inputId] | |
3150 |
|
3150 | |||
3151 | if inputPUObj.datatype == 'Voltage': |
|
3151 | if inputPUObj.datatype == 'Voltage': | |
3152 | self.specOpnFFTpoints.setEnabled(True) |
|
3152 | self.specOpnFFTpoints.setEnabled(True) | |
3153 | self.specOpProfiles.setEnabled(True) |
|
3153 | self.specOpProfiles.setEnabled(True) | |
3154 | self.specOpippFactor.setEnabled(True) |
|
3154 | self.specOpippFactor.setEnabled(True) | |
3155 | else: |
|
3155 | else: | |
3156 | self.specOpnFFTpoints.setEnabled(False) |
|
3156 | self.specOpnFFTpoints.setEnabled(False) | |
3157 | self.specOpProfiles.setEnabled(False) |
|
3157 | self.specOpProfiles.setEnabled(False) | |
3158 | self.specOpippFactor.setEnabled(False) |
|
3158 | self.specOpippFactor.setEnabled(False) | |
3159 |
|
3159 | |||
3160 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3160 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3161 | if opObj == None: |
|
3161 | if opObj == None: | |
3162 | self.specOpRadarfrequency.clear() |
|
3162 | self.specOpRadarfrequency.clear() | |
3163 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3163 | self.specOpCebRadarfrequency.setCheckState(0) | |
3164 | else: |
|
3164 | else: | |
3165 | value = opObj.getParameterValue(parameterName='frequency') |
|
3165 | value = opObj.getParameterValue(parameterName='frequency') | |
3166 | value = str(float(value)/1e6) |
|
3166 | value = str(float(value)/1e6) | |
3167 | self.specOpRadarfrequency.setText(value) |
|
3167 | self.specOpRadarfrequency.setText(value) | |
3168 | self.specOpRadarfrequency.setEnabled(True) |
|
3168 | self.specOpRadarfrequency.setEnabled(True) | |
3169 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3169 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3170 |
|
3170 | |||
3171 | opObj = puObj.getOperationObj(name="run") |
|
3171 | opObj = puObj.getOperationObj(name="run") | |
3172 | if opObj == None: |
|
3172 | if opObj == None: | |
3173 | self.specOpnFFTpoints.clear() |
|
3173 | self.specOpnFFTpoints.clear() | |
3174 | self.specOpProfiles.clear() |
|
3174 | self.specOpProfiles.clear() | |
3175 | self.specOpippFactor.clear() |
|
3175 | self.specOpippFactor.clear() | |
3176 | else: |
|
3176 | else: | |
3177 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3177 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3178 | if parmObj == None: |
|
3178 | if parmObj == None: | |
3179 | self.specOpnFFTpoints.clear() |
|
3179 | self.specOpnFFTpoints.clear() | |
3180 | else: |
|
3180 | else: | |
3181 | self.specOpnFFTpoints.setEnabled(True) |
|
3181 | self.specOpnFFTpoints.setEnabled(True) | |
3182 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3182 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3183 | self.specOpnFFTpoints.setText(str(value)) |
|
3183 | self.specOpnFFTpoints.setText(str(value)) | |
3184 |
|
3184 | |||
3185 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3185 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3186 | if parmObj == None: |
|
3186 | if parmObj == None: | |
3187 | self.specOpProfiles.clear() |
|
3187 | self.specOpProfiles.clear() | |
3188 | else: |
|
3188 | else: | |
3189 | self.specOpProfiles.setEnabled(True) |
|
3189 | self.specOpProfiles.setEnabled(True) | |
3190 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3190 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3191 | self.specOpProfiles.setText(str(value)) |
|
3191 | self.specOpProfiles.setText(str(value)) | |
3192 |
|
3192 | |||
3193 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3193 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3194 | if parmObj == None: |
|
3194 | if parmObj == None: | |
3195 | self.specOpippFactor.clear() |
|
3195 | self.specOpippFactor.clear() | |
3196 | else: |
|
3196 | else: | |
3197 | self.specOpippFactor.setEnabled(True) |
|
3197 | self.specOpippFactor.setEnabled(True) | |
3198 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3198 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3199 | self.specOpippFactor.setText(str(value)) |
|
3199 | self.specOpippFactor.setText(str(value)) | |
3200 |
|
3200 | |||
3201 | opObj = puObj.getOperationObj(name="run") |
|
3201 | opObj = puObj.getOperationObj(name="run") | |
3202 | if opObj == None: |
|
3202 | if opObj == None: | |
3203 | self.specOppairsList.clear() |
|
3203 | self.specOppairsList.clear() | |
3204 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3204 | self.specOpCebCrossSpectra.setCheckState(0) | |
3205 | else: |
|
3205 | else: | |
3206 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3206 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3207 | if parmObj == None: |
|
3207 | if parmObj == None: | |
3208 | self.specOppairsList.clear() |
|
3208 | self.specOppairsList.clear() | |
3209 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3209 | self.specOpCebCrossSpectra.setCheckState(0) | |
3210 | else: |
|
3210 | else: | |
3211 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3211 | value = opObj.getParameterValue(parameterName='pairsList') | |
3212 | value = str(value)[1:-1] |
|
3212 | value = str(value)[1:-1] | |
3213 | self.specOppairsList.setText(str(value)) |
|
3213 | self.specOppairsList.setText(str(value)) | |
3214 | self.specOppairsList.setEnabled(True) |
|
3214 | self.specOppairsList.setEnabled(True) | |
3215 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3215 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3216 |
|
3216 | |||
3217 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3217 | opObj = puObj.getOperationObj(name="selectChannels") | |
3218 |
|
3218 | |||
3219 | if opObj == None: |
|
3219 | if opObj == None: | |
3220 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3220 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3221 |
|
3221 | |||
3222 | if opObj == None: |
|
3222 | if opObj == None: | |
3223 | self.specOpChannel.clear() |
|
3223 | self.specOpChannel.clear() | |
3224 | self.specOpCebChannel.setCheckState(0) |
|
3224 | self.specOpCebChannel.setCheckState(0) | |
3225 | else: |
|
3225 | else: | |
3226 | channelEnabled = False |
|
3226 | channelEnabled = False | |
3227 | try: |
|
3227 | try: | |
3228 | value = opObj.getParameterValue(parameterName='channelList') |
|
3228 | value = opObj.getParameterValue(parameterName='channelList') | |
3229 | value = str(value)[1:-1] |
|
3229 | value = str(value)[1:-1] | |
3230 | channelEnabled = True |
|
3230 | channelEnabled = True | |
3231 | channelMode = 0 |
|
3231 | channelMode = 0 | |
3232 | except: |
|
3232 | except: | |
3233 | pass |
|
3233 | pass | |
3234 | try: |
|
3234 | try: | |
3235 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3235 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3236 | value = str(value)[1:-1] |
|
3236 | value = str(value)[1:-1] | |
3237 | channelEnabled = True |
|
3237 | channelEnabled = True | |
3238 | channelMode = 1 |
|
3238 | channelMode = 1 | |
3239 | except: |
|
3239 | except: | |
3240 | pass |
|
3240 | pass | |
3241 |
|
3241 | |||
3242 | if channelEnabled: |
|
3242 | if channelEnabled: | |
3243 | self.specOpChannel.setText(value) |
|
3243 | self.specOpChannel.setText(value) | |
3244 | self.specOpChannel.setEnabled(True) |
|
3244 | self.specOpChannel.setEnabled(True) | |
3245 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3245 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3246 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3246 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3247 |
|
3247 | |||
3248 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3248 | opObj = puObj.getOperationObj(name="selectHeights") | |
3249 | if opObj == None: |
|
3249 | if opObj == None: | |
3250 | self.specOpHeights.clear() |
|
3250 | self.specOpHeights.clear() | |
3251 | self.specOpCebHeights.setCheckState(0) |
|
3251 | self.specOpCebHeights.setCheckState(0) | |
3252 | else: |
|
3252 | else: | |
3253 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3253 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3254 | value1 = str(value1) |
|
3254 | value1 = str(value1) | |
3255 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3255 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3256 | value2 = str(value2) |
|
3256 | value2 = str(value2) | |
3257 | value = value1 + "," + value2 |
|
3257 | value = value1 + "," + value2 | |
3258 | self.specOpHeights.setText(value) |
|
3258 | self.specOpHeights.setText(value) | |
3259 | self.specOpHeights.setEnabled(True) |
|
3259 | self.specOpHeights.setEnabled(True) | |
3260 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3260 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3261 |
|
3261 | |||
3262 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3262 | opObj = puObj.getOperationObj(name="IncohInt") | |
3263 | if opObj == None: |
|
3263 | if opObj == None: | |
3264 | self.specOpIncoherent.clear() |
|
3264 | self.specOpIncoherent.clear() | |
3265 | self.specOpCebIncoherent.setCheckState(0) |
|
3265 | self.specOpCebIncoherent.setCheckState(0) | |
3266 | else: |
|
3266 | else: | |
3267 | for parmObj in opObj.getParameterObjList(): |
|
3267 | for parmObj in opObj.getParameterObjList(): | |
3268 | if parmObj.name == 'timeInterval': |
|
3268 | if parmObj.name == 'timeInterval': | |
3269 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3269 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3270 | self.specOpIncoherent.setText(str(value)) |
|
3270 | self.specOpIncoherent.setText(str(value)) | |
3271 | self.specOpIncoherent.setEnabled(True) |
|
3271 | self.specOpIncoherent.setEnabled(True) | |
3272 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3272 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3273 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3273 | self.specOpCobIncInt.setCurrentIndex(0) | |
3274 |
|
3274 | |||
3275 | if parmObj.name == 'n': |
|
3275 | if parmObj.name == 'n': | |
3276 | value = opObj.getParameterValue(parameterName='n') |
|
3276 | value = opObj.getParameterValue(parameterName='n') | |
3277 | self.specOpIncoherent.setText(str(value)) |
|
3277 | self.specOpIncoherent.setText(str(value)) | |
3278 | self.specOpIncoherent.setEnabled(True) |
|
3278 | self.specOpIncoherent.setEnabled(True) | |
3279 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3279 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3280 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3280 | self.specOpCobIncInt.setCurrentIndex(1) | |
3281 |
|
3281 | |||
3282 | opObj = puObj.getOperationObj(name="removeDC") |
|
3282 | opObj = puObj.getOperationObj(name="removeDC") | |
3283 | if opObj == None: |
|
3283 | if opObj == None: | |
3284 | self.specOpCebRemoveDC.setCheckState(0) |
|
3284 | self.specOpCebRemoveDC.setCheckState(0) | |
3285 | else: |
|
3285 | else: | |
3286 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3286 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3287 |
|
3287 | |||
3288 | parmObj = opObj.getParameterObj(parameterName='mode') |
|
3288 | parmObj = opObj.getParameterObj(parameterName='mode') | |
3289 |
|
3289 | |||
3290 | value = 1 |
|
3290 | value = 1 | |
3291 | if parmObj: |
|
3291 | if parmObj: | |
3292 | value = parmObj.getValue() |
|
3292 | value = parmObj.getValue() | |
3293 |
|
3293 | |||
3294 | if value == 1: |
|
3294 | if value == 1: | |
3295 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3295 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3296 | elif value == 2: |
|
3296 | elif value == 2: | |
3297 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3297 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3298 |
|
3298 | |||
3299 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3299 | opObj = puObj.getOperationObj(name="removeInterference") | |
3300 | if opObj == None: |
|
3300 | if opObj == None: | |
3301 | self.specOpCebRemoveInt.setCheckState(0) |
|
3301 | self.specOpCebRemoveInt.setCheckState(0) | |
3302 | else: |
|
3302 | else: | |
3303 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3303 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3304 |
|
3304 | |||
3305 | opObj = puObj.getOperationObj(name='getNoise') |
|
3305 | opObj = puObj.getOperationObj(name='getNoise') | |
3306 | if opObj == None: |
|
3306 | if opObj == None: | |
3307 | self.specOpCebgetNoise.setCheckState(0) |
|
3307 | self.specOpCebgetNoise.setCheckState(0) | |
3308 | self.specOpgetNoise.clear() |
|
3308 | self.specOpgetNoise.clear() | |
3309 | else: |
|
3309 | else: | |
3310 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3310 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3311 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3311 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3312 | if parmObj == None: |
|
3312 | if parmObj == None: | |
3313 | self.specOpgetNoise.clear() |
|
3313 | self.specOpgetNoise.clear() | |
3314 | value1 = None |
|
3314 | value1 = None | |
3315 | else: |
|
3315 | else: | |
3316 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3316 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3317 | value1 = str(value1) |
|
3317 | value1 = str(value1) | |
3318 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3318 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3319 | if parmObj == None: |
|
3319 | if parmObj == None: | |
3320 | value2 = None |
|
3320 | value2 = None | |
3321 | value = value1 |
|
3321 | value = value1 | |
3322 | self.specOpgetNoise.setText(value) |
|
3322 | self.specOpgetNoise.setText(value) | |
3323 | self.specOpgetNoise.setEnabled(True) |
|
3323 | self.specOpgetNoise.setEnabled(True) | |
3324 | else: |
|
3324 | else: | |
3325 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3325 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3326 | value2 = str(value2) |
|
3326 | value2 = str(value2) | |
3327 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3327 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3328 | if parmObj == None: |
|
3328 | if parmObj == None: | |
3329 | value3 = None |
|
3329 | value3 = None | |
3330 | value = value1 + "," + value2 |
|
3330 | value = value1 + "," + value2 | |
3331 | self.specOpgetNoise.setText(value) |
|
3331 | self.specOpgetNoise.setText(value) | |
3332 | self.specOpgetNoise.setEnabled(True) |
|
3332 | self.specOpgetNoise.setEnabled(True) | |
3333 | else: |
|
3333 | else: | |
3334 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3334 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3335 | value3 = str(value3) |
|
3335 | value3 = str(value3) | |
3336 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3336 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3337 | if parmObj == None: |
|
3337 | if parmObj == None: | |
3338 | value4 = None |
|
3338 | value4 = None | |
3339 | value = value1 + "," + value2 + "," + value3 |
|
3339 | value = value1 + "," + value2 + "," + value3 | |
3340 | self.specOpgetNoise.setText(value) |
|
3340 | self.specOpgetNoise.setText(value) | |
3341 | self.specOpgetNoise.setEnabled(True) |
|
3341 | self.specOpgetNoise.setEnabled(True) | |
3342 | else: |
|
3342 | else: | |
3343 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3343 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3344 | value4 = str(value4) |
|
3344 | value4 = str(value4) | |
3345 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3345 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3346 | self.specOpgetNoise.setText(value) |
|
3346 | self.specOpgetNoise.setText(value) | |
3347 | self.specOpgetNoise.setEnabled(True) |
|
3347 | self.specOpgetNoise.setEnabled(True) | |
3348 |
|
3348 | |||
3349 | self.specGraphPath.clear() |
|
3349 | self.specGraphPath.clear() | |
3350 | self.specGraphPrefix.clear() |
|
3350 | self.specGraphPrefix.clear() | |
3351 | self.specGgraphFreq.clear() |
|
3351 | self.specGgraphFreq.clear() | |
3352 | self.specGgraphHeight.clear() |
|
3352 | self.specGgraphHeight.clear() | |
3353 | self.specGgraphDbsrange.clear() |
|
3353 | self.specGgraphDbsrange.clear() | |
3354 | self.specGgraphmagnitud.clear() |
|
3354 | self.specGgraphmagnitud.clear() | |
3355 | self.specGgraphPhase.clear() |
|
3355 | self.specGgraphPhase.clear() | |
3356 | self.specGgraphChannelList.clear() |
|
3356 | self.specGgraphChannelList.clear() | |
3357 | self.specGgraphTminTmax.clear() |
|
3357 | self.specGgraphTminTmax.clear() | |
3358 | self.specGgraphTimeRange.clear() |
|
3358 | self.specGgraphTimeRange.clear() | |
3359 | self.specGgraphftpratio.clear() |
|
3359 | self.specGgraphftpratio.clear() | |
3360 |
|
3360 | |||
3361 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3361 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3362 |
|
3362 | |||
3363 | if opObj == None: |
|
3363 | if opObj == None: | |
3364 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3364 | self.specGraphCebSpectraplot.setCheckState(0) | |
3365 | self.specGraphSaveSpectra.setCheckState(0) |
|
3365 | self.specGraphSaveSpectra.setCheckState(0) | |
3366 | self.specGraphftpSpectra.setCheckState(0) |
|
3366 | self.specGraphftpSpectra.setCheckState(0) | |
3367 | else: |
|
3367 | else: | |
3368 | operationSpectraPlot = "Enable" |
|
3368 | operationSpectraPlot = "Enable" | |
3369 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3369 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3370 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3370 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3371 | if parmObj == None: |
|
3371 | if parmObj == None: | |
3372 | self.specGgraphChannelList.clear() |
|
3372 | self.specGgraphChannelList.clear() | |
3373 | else: |
|
3373 | else: | |
3374 | value = opObj.getParameterValue(parameterName='channelList') |
|
3374 | value = opObj.getParameterValue(parameterName='channelList') | |
3375 | channelListSpectraPlot = str(value)[1:-1] |
|
3375 | channelListSpectraPlot = str(value)[1:-1] | |
3376 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3376 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3377 | self.specGgraphChannelList.setEnabled(True) |
|
3377 | self.specGgraphChannelList.setEnabled(True) | |
3378 |
|
3378 | |||
3379 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3379 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3380 | if parmObj == None: |
|
3380 | if parmObj == None: | |
3381 | self.specGgraphFreq.clear() |
|
3381 | self.specGgraphFreq.clear() | |
3382 | else: |
|
3382 | else: | |
3383 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3383 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3384 | value1 = str(value1) |
|
3384 | value1 = str(value1) | |
3385 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3385 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3386 | value2 = str(value2) |
|
3386 | value2 = str(value2) | |
3387 | value = value1 + "," + value2 |
|
3387 | value = value1 + "," + value2 | |
3388 | self.specGgraphFreq.setText(value) |
|
3388 | self.specGgraphFreq.setText(value) | |
3389 | self.specGgraphFreq.setEnabled(True) |
|
3389 | self.specGgraphFreq.setEnabled(True) | |
3390 |
|
3390 | |||
3391 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3391 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3392 | if parmObj == None: |
|
3392 | if parmObj == None: | |
3393 | self.specGgraphHeight.clear() |
|
3393 | self.specGgraphHeight.clear() | |
3394 | else: |
|
3394 | else: | |
3395 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3395 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3396 | value1 = str(value1) |
|
3396 | value1 = str(value1) | |
3397 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3397 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3398 | value2 = str(value2) |
|
3398 | value2 = str(value2) | |
3399 | value = value1 + "," + value2 |
|
3399 | value = value1 + "," + value2 | |
3400 | self.specGgraphHeight.setText(value) |
|
3400 | self.specGgraphHeight.setText(value) | |
3401 | self.specGgraphHeight.setEnabled(True) |
|
3401 | self.specGgraphHeight.setEnabled(True) | |
3402 |
|
3402 | |||
3403 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3403 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3404 | if parmObj == None: |
|
3404 | if parmObj == None: | |
3405 | self.specGgraphDbsrange.clear() |
|
3405 | self.specGgraphDbsrange.clear() | |
3406 | else: |
|
3406 | else: | |
3407 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3407 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3408 | value1 = str(value1) |
|
3408 | value1 = str(value1) | |
3409 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3409 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3410 | value2 = str(value2) |
|
3410 | value2 = str(value2) | |
3411 | value = value1 + "," + value2 |
|
3411 | value = value1 + "," + value2 | |
3412 | self.specGgraphDbsrange.setText(value) |
|
3412 | self.specGgraphDbsrange.setText(value) | |
3413 | self.specGgraphDbsrange.setEnabled(True) |
|
3413 | self.specGgraphDbsrange.setEnabled(True) | |
3414 |
|
3414 | |||
3415 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3415 | parmObj = opObj.getParameterObj(parameterName="save") | |
3416 | if parmObj == None: |
|
3416 | if parmObj == None: | |
3417 | self.specGraphSaveSpectra.setCheckState(0) |
|
3417 | self.specGraphSaveSpectra.setCheckState(0) | |
3418 | else: |
|
3418 | else: | |
3419 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3419 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3420 |
|
3420 | |||
3421 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3421 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3422 | if parmObj == None: |
|
3422 | if parmObj == None: | |
3423 | self.specGraphftpSpectra.setCheckState(0) |
|
3423 | self.specGraphftpSpectra.setCheckState(0) | |
3424 | else: |
|
3424 | else: | |
3425 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3425 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3426 |
|
3426 | |||
3427 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3427 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3428 | if parmObj: |
|
3428 | if parmObj: | |
3429 | value = parmObj.getValue() |
|
3429 | value = parmObj.getValue() | |
3430 | self.specGraphPath.setText(value) |
|
3430 | self.specGraphPath.setText(value) | |
3431 |
|
3431 | |||
3432 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3432 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3433 | if parmObj: |
|
3433 | if parmObj: | |
3434 | value = parmObj.getValue() |
|
3434 | value = parmObj.getValue() | |
3435 | self.specGgraphftpratio.setText(str(value)) |
|
3435 | self.specGgraphftpratio.setText(str(value)) | |
3436 |
|
3436 | |||
3437 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3437 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3438 |
|
3438 | |||
3439 | if opObj == None: |
|
3439 | if opObj == None: | |
3440 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3440 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3441 | self.specGraphSaveCross.setCheckState(0) |
|
3441 | self.specGraphSaveCross.setCheckState(0) | |
3442 | self.specGraphftpCross.setCheckState(0) |
|
3442 | self.specGraphftpCross.setCheckState(0) | |
3443 | else: |
|
3443 | else: | |
3444 | operationCrossSpectraPlot = "Enable" |
|
3444 | operationCrossSpectraPlot = "Enable" | |
3445 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3445 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3446 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3446 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3447 | if parmObj == None: |
|
3447 | if parmObj == None: | |
3448 | self.specGgraphFreq.clear() |
|
3448 | self.specGgraphFreq.clear() | |
3449 | else: |
|
3449 | else: | |
3450 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3450 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3451 | value1 = str(value1) |
|
3451 | value1 = str(value1) | |
3452 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3452 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3453 | value2 = str(value2) |
|
3453 | value2 = str(value2) | |
3454 | value = value1 + "," + value2 |
|
3454 | value = value1 + "," + value2 | |
3455 | self.specGgraphFreq.setText(value) |
|
3455 | self.specGgraphFreq.setText(value) | |
3456 | self.specGgraphFreq.setEnabled(True) |
|
3456 | self.specGgraphFreq.setEnabled(True) | |
3457 |
|
3457 | |||
3458 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3458 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3459 | if parmObj == None: |
|
3459 | if parmObj == None: | |
3460 | self.specGgraphHeight.clear() |
|
3460 | self.specGgraphHeight.clear() | |
3461 | else: |
|
3461 | else: | |
3462 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3462 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3463 | value1 = str(value1) |
|
3463 | value1 = str(value1) | |
3464 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3464 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3465 | value2 = str(value2) |
|
3465 | value2 = str(value2) | |
3466 | value = value1 + "," + value2 |
|
3466 | value = value1 + "," + value2 | |
3467 | self.specGgraphHeight.setText(value) |
|
3467 | self.specGgraphHeight.setText(value) | |
3468 | self.specGgraphHeight.setEnabled(True) |
|
3468 | self.specGgraphHeight.setEnabled(True) | |
3469 |
|
3469 | |||
3470 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3470 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3471 | if parmObj == None: |
|
3471 | if parmObj == None: | |
3472 | self.specGgraphDbsrange.clear() |
|
3472 | self.specGgraphDbsrange.clear() | |
3473 | else: |
|
3473 | else: | |
3474 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3474 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3475 | value1 = str(value1) |
|
3475 | value1 = str(value1) | |
3476 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3476 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3477 | value2 = str(value2) |
|
3477 | value2 = str(value2) | |
3478 | value = value1 + "," + value2 |
|
3478 | value = value1 + "," + value2 | |
3479 | self.specGgraphDbsrange.setText(value) |
|
3479 | self.specGgraphDbsrange.setText(value) | |
3480 | self.specGgraphDbsrange.setEnabled(True) |
|
3480 | self.specGgraphDbsrange.setEnabled(True) | |
3481 |
|
3481 | |||
3482 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3482 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3483 | if parmObj == None: |
|
3483 | if parmObj == None: | |
3484 | self.specGgraphmagnitud.clear() |
|
3484 | self.specGgraphmagnitud.clear() | |
3485 | else: |
|
3485 | else: | |
3486 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3486 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3487 | value1 = str(value1) |
|
3487 | value1 = str(value1) | |
3488 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3488 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3489 | value2 = str(value2) |
|
3489 | value2 = str(value2) | |
3490 | value = value1 + "," + value2 |
|
3490 | value = value1 + "," + value2 | |
3491 | self.specGgraphmagnitud.setText(value) |
|
3491 | self.specGgraphmagnitud.setText(value) | |
3492 | self.specGgraphmagnitud.setEnabled(True) |
|
3492 | self.specGgraphmagnitud.setEnabled(True) | |
3493 |
|
3493 | |||
3494 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3494 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3495 | if parmObj == None: |
|
3495 | if parmObj == None: | |
3496 | self.specGgraphPhase.clear() |
|
3496 | self.specGgraphPhase.clear() | |
3497 | else: |
|
3497 | else: | |
3498 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3498 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3499 | value1 = str(value1) |
|
3499 | value1 = str(value1) | |
3500 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3500 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3501 | value2 = str(value2) |
|
3501 | value2 = str(value2) | |
3502 | value = value1 + "," + value2 |
|
3502 | value = value1 + "," + value2 | |
3503 | self.specGgraphPhase.setText(value) |
|
3503 | self.specGgraphPhase.setText(value) | |
3504 | self.specGgraphPhase.setEnabled(True) |
|
3504 | self.specGgraphPhase.setEnabled(True) | |
3505 |
|
3505 | |||
3506 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3506 | parmObj = opObj.getParameterObj(parameterName="save") | |
3507 | if parmObj == None: |
|
3507 | if parmObj == None: | |
3508 | self.specGraphSaveCross.setCheckState(0) |
|
3508 | self.specGraphSaveCross.setCheckState(0) | |
3509 | else: |
|
3509 | else: | |
3510 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3510 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3511 |
|
3511 | |||
3512 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3512 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3513 | if parmObj == None: |
|
3513 | if parmObj == None: | |
3514 | self.specGraphftpCross.setCheckState(0) |
|
3514 | self.specGraphftpCross.setCheckState(0) | |
3515 | else: |
|
3515 | else: | |
3516 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3516 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3517 |
|
3517 | |||
3518 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3518 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3519 | if parmObj: |
|
3519 | if parmObj: | |
3520 | value = parmObj.getValue() |
|
3520 | value = parmObj.getValue() | |
3521 | self.specGraphPath.setText(value) |
|
3521 | self.specGraphPath.setText(value) | |
3522 |
|
3522 | |||
3523 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3523 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3524 | if parmObj: |
|
3524 | if parmObj: | |
3525 | value = parmObj.getValue() |
|
3525 | value = parmObj.getValue() | |
3526 | self.specGgraphftpratio.setText(str(value)) |
|
3526 | self.specGgraphftpratio.setText(str(value)) | |
3527 |
|
3527 | |||
3528 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3528 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3529 |
|
3529 | |||
3530 | if opObj == None: |
|
3530 | if opObj == None: | |
3531 | self.specGraphCebRTIplot.setCheckState(0) |
|
3531 | self.specGraphCebRTIplot.setCheckState(0) | |
3532 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3532 | self.specGraphSaveRTIplot.setCheckState(0) | |
3533 | self.specGraphftpRTIplot.setCheckState(0) |
|
3533 | self.specGraphftpRTIplot.setCheckState(0) | |
3534 | else: |
|
3534 | else: | |
3535 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3535 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3536 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3536 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3537 | if parmObj == None: |
|
3537 | if parmObj == None: | |
3538 | self.specGgraphChannelList.clear() |
|
3538 | self.specGgraphChannelList.clear() | |
3539 | else: |
|
3539 | else: | |
3540 | value = opObj.getParameterValue(parameterName='channelList') |
|
3540 | value = opObj.getParameterValue(parameterName='channelList') | |
3541 | channelListRTIPlot = str(value)[1:-1] |
|
3541 | channelListRTIPlot = str(value)[1:-1] | |
3542 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3542 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3543 | self.specGgraphChannelList.setEnabled(True) |
|
3543 | self.specGgraphChannelList.setEnabled(True) | |
3544 |
|
3544 | |||
3545 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3545 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3546 | if parmObj == None: |
|
3546 | if parmObj == None: | |
3547 | self.specGgraphTminTmax.clear() |
|
3547 | self.specGgraphTminTmax.clear() | |
3548 | else: |
|
3548 | else: | |
3549 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3549 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3550 | value1 = str(value1) |
|
3550 | value1 = str(value1) | |
3551 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3551 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3552 | value2 = str(value2) |
|
3552 | value2 = str(value2) | |
3553 | value = value1 + "," + value2 |
|
3553 | value = value1 + "," + value2 | |
3554 | self.specGgraphTminTmax.setText(value) |
|
3554 | self.specGgraphTminTmax.setText(value) | |
3555 | self.specGgraphTminTmax.setEnabled(True) |
|
3555 | self.specGgraphTminTmax.setEnabled(True) | |
3556 |
|
3556 | |||
3557 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3557 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3558 | if parmObj == None: |
|
3558 | if parmObj == None: | |
3559 | self.specGgraphTimeRange.clear() |
|
3559 | self.specGgraphTimeRange.clear() | |
3560 | else: |
|
3560 | else: | |
3561 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3561 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3562 | value1 = str(value1) |
|
3562 | value1 = str(value1) | |
3563 | self.specGgraphTimeRange.setText(value1) |
|
3563 | self.specGgraphTimeRange.setText(value1) | |
3564 | self.specGgraphTimeRange.setEnabled(True) |
|
3564 | self.specGgraphTimeRange.setEnabled(True) | |
3565 |
|
3565 | |||
3566 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3566 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3567 | if parmObj == None: |
|
3567 | if parmObj == None: | |
3568 | self.specGgraphHeight.clear() |
|
3568 | self.specGgraphHeight.clear() | |
3569 | else: |
|
3569 | else: | |
3570 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3570 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3571 | value1 = str(value1) |
|
3571 | value1 = str(value1) | |
3572 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3572 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3573 | value2 = str(value2) |
|
3573 | value2 = str(value2) | |
3574 | value = value1 + "," + value2 |
|
3574 | value = value1 + "," + value2 | |
3575 | self.specGgraphHeight.setText(value) |
|
3575 | self.specGgraphHeight.setText(value) | |
3576 | self.specGgraphHeight.setEnabled(True) |
|
3576 | self.specGgraphHeight.setEnabled(True) | |
3577 |
|
3577 | |||
3578 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3578 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3579 | if parmObj == None: |
|
3579 | if parmObj == None: | |
3580 | self.specGgraphDbsrange.clear() |
|
3580 | self.specGgraphDbsrange.clear() | |
3581 | else: |
|
3581 | else: | |
3582 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3582 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3583 | value1 = str(value1) |
|
3583 | value1 = str(value1) | |
3584 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3584 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3585 | value2 = str(value2) |
|
3585 | value2 = str(value2) | |
3586 | value = value1 + "," + value2 |
|
3586 | value = value1 + "," + value2 | |
3587 | self.specGgraphDbsrange.setText(value) |
|
3587 | self.specGgraphDbsrange.setText(value) | |
3588 | self.specGgraphDbsrange.setEnabled(True) |
|
3588 | self.specGgraphDbsrange.setEnabled(True) | |
3589 |
|
3589 | |||
3590 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3590 | parmObj = opObj.getParameterObj(parameterName="save") | |
3591 | if parmObj == None: |
|
3591 | if parmObj == None: | |
3592 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3592 | self.specGraphSaveRTIplot.setCheckState(0) | |
3593 | else: |
|
3593 | else: | |
3594 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3594 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3595 |
|
3595 | |||
3596 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3596 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3597 | if parmObj == None: |
|
3597 | if parmObj == None: | |
3598 | self.specGraphftpRTIplot.setCheckState(0) |
|
3598 | self.specGraphftpRTIplot.setCheckState(0) | |
3599 | else: |
|
3599 | else: | |
3600 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3600 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3601 |
|
3601 | |||
3602 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3602 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3603 | if parmObj: |
|
3603 | if parmObj: | |
3604 | value = parmObj.getValue() |
|
3604 | value = parmObj.getValue() | |
3605 | self.specGraphPath.setText(value) |
|
3605 | self.specGraphPath.setText(value) | |
3606 |
|
3606 | |||
3607 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3607 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3608 | if parmObj: |
|
3608 | if parmObj: | |
3609 | value = parmObj.getValue() |
|
3609 | value = parmObj.getValue() | |
3610 | self.specGgraphftpratio.setText(str(value)) |
|
3610 | self.specGgraphftpratio.setText(str(value)) | |
3611 |
|
3611 | |||
3612 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3612 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3613 |
|
3613 | |||
3614 | if opObj == None: |
|
3614 | if opObj == None: | |
3615 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3615 | self.specGraphCebCoherencmap.setCheckState(0) | |
3616 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3616 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3617 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3617 | self.specGraphftpCoherencemap.setCheckState(0) | |
3618 | else: |
|
3618 | else: | |
3619 | operationCoherenceMap = "Enable" |
|
3619 | operationCoherenceMap = "Enable" | |
3620 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3620 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3621 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3621 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3622 | if parmObj == None: |
|
3622 | if parmObj == None: | |
3623 | self.specGgraphTminTmax.clear() |
|
3623 | self.specGgraphTminTmax.clear() | |
3624 | else: |
|
3624 | else: | |
3625 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3625 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3626 | value1 = str(value1) |
|
3626 | value1 = str(value1) | |
3627 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3627 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3628 | value2 = str(value2) |
|
3628 | value2 = str(value2) | |
3629 | value = value1 + "," + value2 |
|
3629 | value = value1 + "," + value2 | |
3630 | self.specGgraphTminTmax.setText(value) |
|
3630 | self.specGgraphTminTmax.setText(value) | |
3631 | self.specGgraphTminTmax.setEnabled(True) |
|
3631 | self.specGgraphTminTmax.setEnabled(True) | |
3632 |
|
3632 | |||
3633 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3633 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3634 | if parmObj == None: |
|
3634 | if parmObj == None: | |
3635 | self.specGgraphTimeRange.clear() |
|
3635 | self.specGgraphTimeRange.clear() | |
3636 | else: |
|
3636 | else: | |
3637 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3637 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3638 | value1 = str(value1) |
|
3638 | value1 = str(value1) | |
3639 | self.specGgraphTimeRange.setText(value1) |
|
3639 | self.specGgraphTimeRange.setText(value1) | |
3640 | self.specGgraphTimeRange.setEnabled(True) |
|
3640 | self.specGgraphTimeRange.setEnabled(True) | |
3641 |
|
3641 | |||
3642 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3642 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3643 | if parmObj == None: |
|
3643 | if parmObj == None: | |
3644 | self.specGgraphHeight.clear() |
|
3644 | self.specGgraphHeight.clear() | |
3645 | else: |
|
3645 | else: | |
3646 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3646 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3647 | value1 = str(value1) |
|
3647 | value1 = str(value1) | |
3648 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3648 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3649 | value2 = str(value2) |
|
3649 | value2 = str(value2) | |
3650 | value = value1 + "," + value2 |
|
3650 | value = value1 + "," + value2 | |
3651 | self.specGgraphHeight.setText(value) |
|
3651 | self.specGgraphHeight.setText(value) | |
3652 | self.specGgraphHeight.setEnabled(True) |
|
3652 | self.specGgraphHeight.setEnabled(True) | |
3653 |
|
3653 | |||
3654 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3654 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3655 | if parmObj == None: |
|
3655 | if parmObj == None: | |
3656 | self.specGgraphmagnitud.clear() |
|
3656 | self.specGgraphmagnitud.clear() | |
3657 | else: |
|
3657 | else: | |
3658 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3658 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3659 | value1 = str(value1) |
|
3659 | value1 = str(value1) | |
3660 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3660 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3661 | value2 = str(value2) |
|
3661 | value2 = str(value2) | |
3662 | value = value1 + "," + value2 |
|
3662 | value = value1 + "," + value2 | |
3663 | self.specGgraphmagnitud.setText(value) |
|
3663 | self.specGgraphmagnitud.setText(value) | |
3664 | self.specGgraphmagnitud.setEnabled(True) |
|
3664 | self.specGgraphmagnitud.setEnabled(True) | |
3665 |
|
3665 | |||
3666 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3666 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3667 | if parmObj == None: |
|
3667 | if parmObj == None: | |
3668 | self.specGgraphmagnitud.clear() |
|
3668 | self.specGgraphmagnitud.clear() | |
3669 | else: |
|
3669 | else: | |
3670 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3670 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3671 | value1 = str(value1) |
|
3671 | value1 = str(value1) | |
3672 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3672 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3673 | value2 = str(value2) |
|
3673 | value2 = str(value2) | |
3674 | value = value1 + "," + value2 |
|
3674 | value = value1 + "," + value2 | |
3675 | self.specGgraphmagnitud.setText(value) |
|
3675 | self.specGgraphmagnitud.setText(value) | |
3676 | self.specGgraphmagnitud.setEnabled(True) |
|
3676 | self.specGgraphmagnitud.setEnabled(True) | |
3677 |
|
3677 | |||
3678 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3678 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3679 | if parmObj == None: |
|
3679 | if parmObj == None: | |
3680 | self.specGgraphPhase.clear() |
|
3680 | self.specGgraphPhase.clear() | |
3681 | else: |
|
3681 | else: | |
3682 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3682 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3683 | value1 = str(value1) |
|
3683 | value1 = str(value1) | |
3684 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3684 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3685 | value2 = str(value2) |
|
3685 | value2 = str(value2) | |
3686 | value = value1 + "," + value2 |
|
3686 | value = value1 + "," + value2 | |
3687 | self.specGgraphPhase.setText(value) |
|
3687 | self.specGgraphPhase.setText(value) | |
3688 | self.specGgraphPhase.setEnabled(True) |
|
3688 | self.specGgraphPhase.setEnabled(True) | |
3689 |
|
3689 | |||
3690 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3690 | parmObj = opObj.getParameterObj(parameterName="save") | |
3691 | if parmObj == None: |
|
3691 | if parmObj == None: | |
3692 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3692 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3693 | else: |
|
3693 | else: | |
3694 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3694 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3695 |
|
3695 | |||
3696 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3696 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3697 | if parmObj == None: |
|
3697 | if parmObj == None: | |
3698 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3698 | self.specGraphftpCoherencemap.setCheckState(0) | |
3699 | else: |
|
3699 | else: | |
3700 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3700 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3701 |
|
3701 | |||
3702 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3702 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3703 | if parmObj: |
|
3703 | if parmObj: | |
3704 | value = parmObj.getValue() |
|
3704 | value = parmObj.getValue() | |
3705 | self.specGraphPath.setText(value) |
|
3705 | self.specGraphPath.setText(value) | |
3706 |
|
3706 | |||
3707 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3707 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3708 | if parmObj: |
|
3708 | if parmObj: | |
3709 | value = parmObj.getValue() |
|
3709 | value = parmObj.getValue() | |
3710 | self.specGgraphftpratio.setText(str(value)) |
|
3710 | self.specGgraphftpratio.setText(str(value)) | |
3711 |
|
3711 | |||
3712 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3712 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3713 |
|
3713 | |||
3714 | if opObj == None: |
|
3714 | if opObj == None: | |
3715 | self.specGraphPowerprofile.setCheckState(0) |
|
3715 | self.specGraphPowerprofile.setCheckState(0) | |
3716 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3716 | self.specGraphSavePowerprofile.setCheckState(0) | |
3717 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3717 | self.specGraphftpPowerprofile.setCheckState(0) | |
3718 | operationPowerProfilePlot = "Disabled" |
|
3718 | operationPowerProfilePlot = "Disabled" | |
3719 | channelList = None |
|
3719 | channelList = None | |
3720 | freq_vel = None |
|
3720 | freq_vel = None | |
3721 | heightsrange = None |
|
3721 | heightsrange = None | |
3722 | else: |
|
3722 | else: | |
3723 | operationPowerProfilePlot = "Enable" |
|
3723 | operationPowerProfilePlot = "Enable" | |
3724 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3724 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3725 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3725 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3726 | if parmObj == None: |
|
3726 | if parmObj == None: | |
3727 | self.specGgraphDbsrange.clear() |
|
3727 | self.specGgraphDbsrange.clear() | |
3728 | else: |
|
3728 | else: | |
3729 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3729 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3730 | value1 = str(value1) |
|
3730 | value1 = str(value1) | |
3731 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3731 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3732 | value2 = str(value2) |
|
3732 | value2 = str(value2) | |
3733 | value = value1 + "," + value2 |
|
3733 | value = value1 + "," + value2 | |
3734 | self.specGgraphDbsrange.setText(value) |
|
3734 | self.specGgraphDbsrange.setText(value) | |
3735 | self.specGgraphDbsrange.setEnabled(True) |
|
3735 | self.specGgraphDbsrange.setEnabled(True) | |
3736 |
|
3736 | |||
3737 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3737 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3738 | if parmObj == None: |
|
3738 | if parmObj == None: | |
3739 | self.specGgraphHeight.clear() |
|
3739 | self.specGgraphHeight.clear() | |
3740 | else: |
|
3740 | else: | |
3741 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3741 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3742 | value1 = str(value1) |
|
3742 | value1 = str(value1) | |
3743 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3743 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3744 | value2 = str(value2) |
|
3744 | value2 = str(value2) | |
3745 | value = value1 + "," + value2 |
|
3745 | value = value1 + "," + value2 | |
3746 | self.specGgraphHeight.setText(value) |
|
3746 | self.specGgraphHeight.setText(value) | |
3747 | self.specGgraphHeight.setEnabled(True) |
|
3747 | self.specGgraphHeight.setEnabled(True) | |
3748 |
|
3748 | |||
3749 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3749 | parmObj = opObj.getParameterObj(parameterName="save") | |
3750 | if parmObj == None: |
|
3750 | if parmObj == None: | |
3751 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3751 | self.specGraphSavePowerprofile.setCheckState(0) | |
3752 | else: |
|
3752 | else: | |
3753 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3753 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3754 |
|
3754 | |||
3755 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3755 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3756 | if parmObj == None: |
|
3756 | if parmObj == None: | |
3757 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3757 | self.specGraphftpPowerprofile.setCheckState(0) | |
3758 | else: |
|
3758 | else: | |
3759 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3759 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3760 |
|
3760 | |||
3761 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3761 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3762 | if parmObj: |
|
3762 | if parmObj: | |
3763 | value = parmObj.getValue() |
|
3763 | value = parmObj.getValue() | |
3764 | self.specGraphPath.setText(value) |
|
3764 | self.specGraphPath.setText(value) | |
3765 |
|
3765 | |||
3766 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3766 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3767 | if parmObj: |
|
3767 | if parmObj: | |
3768 | value = parmObj.getValue() |
|
3768 | value = parmObj.getValue() | |
3769 | self.specGgraphftpratio.setText(str(value)) |
|
3769 | self.specGgraphftpratio.setText(str(value)) | |
3770 |
|
3770 | |||
3771 | opObj = puObj.getOperationObj(name='Noise') |
|
3771 | opObj = puObj.getOperationObj(name='Noise') | |
3772 |
|
3772 | |||
3773 | if opObj == None: |
|
3773 | if opObj == None: | |
3774 | self.specGraphCebRTInoise.setCheckState(0) |
|
3774 | self.specGraphCebRTInoise.setCheckState(0) | |
3775 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3775 | self.specGraphSaveRTInoise.setCheckState(0) | |
3776 | self.specGraphftpRTInoise.setCheckState(0) |
|
3776 | self.specGraphftpRTInoise.setCheckState(0) | |
3777 | else: |
|
3777 | else: | |
3778 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3778 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3779 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3779 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3780 | if parmObj == None: |
|
3780 | if parmObj == None: | |
3781 | self.specGgraphChannelList.clear() |
|
3781 | self.specGgraphChannelList.clear() | |
3782 | else: |
|
3782 | else: | |
3783 | value = opObj.getParameterValue(parameterName='channelList') |
|
3783 | value = opObj.getParameterValue(parameterName='channelList') | |
3784 | channelListRTINoise = str(value)[1:-1] |
|
3784 | channelListRTINoise = str(value)[1:-1] | |
3785 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3785 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3786 | self.specGgraphChannelList.setEnabled(True) |
|
3786 | self.specGgraphChannelList.setEnabled(True) | |
3787 |
|
3787 | |||
3788 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3788 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3789 | if parmObj == None: |
|
3789 | if parmObj == None: | |
3790 | self.specGgraphTminTmax.clear() |
|
3790 | self.specGgraphTminTmax.clear() | |
3791 | else: |
|
3791 | else: | |
3792 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3792 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3793 | value1 = str(value1) |
|
3793 | value1 = str(value1) | |
3794 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3794 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3795 | value2 = str(value2) |
|
3795 | value2 = str(value2) | |
3796 | value = value1 + "," + value2 |
|
3796 | value = value1 + "," + value2 | |
3797 | self.specGgraphTminTmax.setText(value) |
|
3797 | self.specGgraphTminTmax.setText(value) | |
3798 | self.specGgraphTminTmax.setEnabled(True) |
|
3798 | self.specGgraphTminTmax.setEnabled(True) | |
3799 |
|
3799 | |||
3800 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3800 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3801 | if parmObj == None: |
|
3801 | if parmObj == None: | |
3802 | self.specGgraphTimeRange.clear() |
|
3802 | self.specGgraphTimeRange.clear() | |
3803 | else: |
|
3803 | else: | |
3804 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3804 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3805 | value1 = str(value1) |
|
3805 | value1 = str(value1) | |
3806 | self.specGgraphTimeRange.setText(value1) |
|
3806 | self.specGgraphTimeRange.setText(value1) | |
3807 | self.specGgraphTimeRange.setEnabled(True) |
|
3807 | self.specGgraphTimeRange.setEnabled(True) | |
3808 |
|
3808 | |||
3809 |
|
3809 | |||
3810 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3810 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3811 | if parmObj == None: |
|
3811 | if parmObj == None: | |
3812 | self.specGgraphDbsrange.clear() |
|
3812 | self.specGgraphDbsrange.clear() | |
3813 | else: |
|
3813 | else: | |
3814 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3814 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3815 | value1 = str(value1) |
|
3815 | value1 = str(value1) | |
3816 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3816 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3817 | value2 = str(value2) |
|
3817 | value2 = str(value2) | |
3818 | value = value1 + "," + value2 |
|
3818 | value = value1 + "," + value2 | |
3819 | self.specGgraphDbsrange.setText(value) |
|
3819 | self.specGgraphDbsrange.setText(value) | |
3820 | self.specGgraphDbsrange.setEnabled(True) |
|
3820 | self.specGgraphDbsrange.setEnabled(True) | |
3821 |
|
3821 | |||
3822 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3822 | parmObj = opObj.getParameterObj(parameterName="save") | |
3823 | if parmObj == None: |
|
3823 | if parmObj == None: | |
3824 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3824 | self.specGraphSaveRTInoise.setCheckState(0) | |
3825 | else: |
|
3825 | else: | |
3826 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3826 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3827 |
|
3827 | |||
3828 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3828 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3829 | if parmObj == None: |
|
3829 | if parmObj == None: | |
3830 | self.specGraphftpRTInoise.setCheckState(0) |
|
3830 | self.specGraphftpRTInoise.setCheckState(0) | |
3831 | else: |
|
3831 | else: | |
3832 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3832 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3833 |
|
3833 | |||
3834 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3834 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3835 | if parmObj: |
|
3835 | if parmObj: | |
3836 | value = parmObj.getValue() |
|
3836 | value = parmObj.getValue() | |
3837 | self.specGraphPath.setText(value) |
|
3837 | self.specGraphPath.setText(value) | |
3838 |
|
3838 | |||
3839 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3839 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3840 | if parmObj: |
|
3840 | if parmObj: | |
3841 | value = parmObj.getValue() |
|
3841 | value = parmObj.getValue() | |
3842 | self.specGgraphftpratio.setText(str(value)) |
|
3842 | self.specGgraphftpratio.setText(str(value)) | |
3843 |
|
3843 | |||
3844 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3844 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3845 | if opObj == None: |
|
3845 | if opObj == None: | |
3846 | self.specOutputPath.clear() |
|
3846 | self.specOutputPath.clear() | |
3847 | self.specOutputblocksperfile.clear() |
|
3847 | self.specOutputblocksperfile.clear() | |
3848 | else: |
|
3848 | else: | |
3849 | value = opObj.getParameterObj(parameterName='path') |
|
3849 | value = opObj.getParameterObj(parameterName='path') | |
3850 | if value == None: |
|
3850 | if value == None: | |
3851 | self.specOutputPath.clear() |
|
3851 | self.specOutputPath.clear() | |
3852 | else: |
|
3852 | else: | |
3853 | value = opObj.getParameterValue(parameterName='path') |
|
3853 | value = opObj.getParameterValue(parameterName='path') | |
3854 | path = str(value) |
|
3854 | path = str(value) | |
3855 | self.specOutputPath.setText(path) |
|
3855 | self.specOutputPath.setText(path) | |
3856 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3856 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3857 | if value == None: |
|
3857 | if value == None: | |
3858 | self.specOutputblocksperfile.clear() |
|
3858 | self.specOutputblocksperfile.clear() | |
3859 | else: |
|
3859 | else: | |
3860 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3860 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3861 | blocksperfile = str(value) |
|
3861 | blocksperfile = str(value) | |
3862 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3862 | self.specOutputblocksperfile.setText(blocksperfile) | |
3863 |
|
3863 | |||
3864 | return |
|
3864 | return | |
3865 |
|
3865 | |||
3866 | def __refreshSpectraHeisWindow(self, puObj): |
|
3866 | def __refreshSpectraHeisWindow(self, puObj): | |
3867 |
|
3867 | |||
3868 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3868 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3869 | if opObj == None: |
|
3869 | if opObj == None: | |
3870 | self.specHeisOpIncoherent.clear() |
|
3870 | self.specHeisOpIncoherent.clear() | |
3871 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3871 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3872 | else: |
|
3872 | else: | |
3873 | for parmObj in opObj.getParameterObjList(): |
|
3873 | for parmObj in opObj.getParameterObjList(): | |
3874 | if parmObj.name == 'timeInterval': |
|
3874 | if parmObj.name == 'timeInterval': | |
3875 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3875 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3876 | self.specHeisOpIncoherent.setText(str(value)) |
|
3876 | self.specHeisOpIncoherent.setText(str(value)) | |
3877 | self.specHeisOpIncoherent.setEnabled(True) |
|
3877 | self.specHeisOpIncoherent.setEnabled(True) | |
3878 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3878 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3879 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3879 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3880 |
|
3880 | |||
3881 | # SpectraHeis Graph |
|
3881 | # SpectraHeis Graph | |
3882 |
|
3882 | |||
3883 | self.specHeisGgraphXminXmax.clear() |
|
3883 | self.specHeisGgraphXminXmax.clear() | |
3884 | self.specHeisGgraphYminYmax.clear() |
|
3884 | self.specHeisGgraphYminYmax.clear() | |
3885 |
|
3885 | |||
3886 | self.specHeisGgraphChannelList.clear() |
|
3886 | self.specHeisGgraphChannelList.clear() | |
3887 | self.specHeisGgraphTminTmax.clear() |
|
3887 | self.specHeisGgraphTminTmax.clear() | |
3888 | self.specHeisGgraphTimeRange.clear() |
|
3888 | self.specHeisGgraphTimeRange.clear() | |
3889 | self.specHeisGgraphftpratio.clear() |
|
3889 | self.specHeisGgraphftpratio.clear() | |
3890 |
|
3890 | |||
3891 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3891 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3892 | if opObj == None: |
|
3892 | if opObj == None: | |
3893 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3893 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3894 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3894 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3895 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3895 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3896 | else: |
|
3896 | else: | |
3897 | operationSpectraHeisScope = "Enable" |
|
3897 | operationSpectraHeisScope = "Enable" | |
3898 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3898 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3899 |
|
3899 | |||
3900 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3900 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3901 | if parmObj == None: |
|
3901 | if parmObj == None: | |
3902 | self.specHeisGgraphChannelList.clear() |
|
3902 | self.specHeisGgraphChannelList.clear() | |
3903 | else: |
|
3903 | else: | |
3904 | value = opObj.getParameterValue(parameterName='channelList') |
|
3904 | value = opObj.getParameterValue(parameterName='channelList') | |
3905 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3905 | channelListSpectraHeisScope = str(value)[1:-1] | |
3906 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3906 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3907 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3907 | self.specHeisGgraphChannelList.setEnabled(True) | |
3908 |
|
3908 | |||
3909 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3909 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3910 | if parmObj == None: |
|
3910 | if parmObj == None: | |
3911 | self.specHeisGgraphXminXmax.clear() |
|
3911 | self.specHeisGgraphXminXmax.clear() | |
3912 | else: |
|
3912 | else: | |
3913 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3913 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3914 | value1 = str(value1) |
|
3914 | value1 = str(value1) | |
3915 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3915 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3916 | value2 = str(value2) |
|
3916 | value2 = str(value2) | |
3917 | value = value1 + "," + value2 |
|
3917 | value = value1 + "," + value2 | |
3918 | self.specHeisGgraphXminXmax.setText(value) |
|
3918 | self.specHeisGgraphXminXmax.setText(value) | |
3919 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3919 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3920 |
|
3920 | |||
3921 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3921 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3922 | if parmObj == None: |
|
3922 | if parmObj == None: | |
3923 | self.specHeisGgraphYminYmax.clear() |
|
3923 | self.specHeisGgraphYminYmax.clear() | |
3924 | else: |
|
3924 | else: | |
3925 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3925 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3926 | value1 = str(value1) |
|
3926 | value1 = str(value1) | |
3927 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3927 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3928 | value2 = str(value2) |
|
3928 | value2 = str(value2) | |
3929 | value = value1 + "," + value2 |
|
3929 | value = value1 + "," + value2 | |
3930 | self.specHeisGgraphYminYmax.setText(value) |
|
3930 | self.specHeisGgraphYminYmax.setText(value) | |
3931 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3931 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3932 |
|
3932 | |||
3933 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3933 | parmObj = opObj.getParameterObj(parameterName="save") | |
3934 | if parmObj == None: |
|
3934 | if parmObj == None: | |
3935 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3935 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3936 | else: |
|
3936 | else: | |
3937 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3937 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3938 |
|
3938 | |||
3939 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3939 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3940 | if parmObj == None: |
|
3940 | if parmObj == None: | |
3941 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3941 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3942 | else: |
|
3942 | else: | |
3943 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3943 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3944 |
|
3944 | |||
3945 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3945 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3946 | if parmObj: |
|
3946 | if parmObj: | |
3947 | value = parmObj.getValue() |
|
3947 | value = parmObj.getValue() | |
3948 | self.specHeisGraphPath.setText(value) |
|
3948 | self.specHeisGraphPath.setText(value) | |
3949 |
|
3949 | |||
3950 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3950 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3951 | if parmObj: |
|
3951 | if parmObj: | |
3952 | value = parmObj.getValue() |
|
3952 | value = parmObj.getValue() | |
3953 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3953 | self.specHeisGgraphftpratio.setText(str(value)) | |
3954 |
|
3954 | |||
3955 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3955 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3956 |
|
3956 | |||
3957 | if opObj == None: |
|
3957 | if opObj == None: | |
3958 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3958 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3959 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3959 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3960 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3960 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3961 | else: |
|
3961 | else: | |
3962 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3962 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3963 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3963 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3964 | if parmObj == None: |
|
3964 | if parmObj == None: | |
3965 | self.specHeisGgraphChannelList.clear() |
|
3965 | self.specHeisGgraphChannelList.clear() | |
3966 | else: |
|
3966 | else: | |
3967 | value = opObj.getParameterValue(parameterName='channelList') |
|
3967 | value = opObj.getParameterValue(parameterName='channelList') | |
3968 | channelListRTIPlot = str(value)[1:-1] |
|
3968 | channelListRTIPlot = str(value)[1:-1] | |
3969 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3969 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3970 | self.specGgraphChannelList.setEnabled(True) |
|
3970 | self.specGgraphChannelList.setEnabled(True) | |
3971 |
|
3971 | |||
3972 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3972 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3973 | if parmObj == None: |
|
3973 | if parmObj == None: | |
3974 | self.specHeisGgraphTminTmax.clear() |
|
3974 | self.specHeisGgraphTminTmax.clear() | |
3975 | else: |
|
3975 | else: | |
3976 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3976 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3977 | value1 = str(value1) |
|
3977 | value1 = str(value1) | |
3978 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3978 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3979 | value2 = str(value2) |
|
3979 | value2 = str(value2) | |
3980 | value = value1 + "," + value2 |
|
3980 | value = value1 + "," + value2 | |
3981 | self.specHeisGgraphTminTmax.setText(value) |
|
3981 | self.specHeisGgraphTminTmax.setText(value) | |
3982 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3982 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3983 |
|
3983 | |||
3984 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3984 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3985 | if parmObj == None: |
|
3985 | if parmObj == None: | |
3986 | self.specGgraphTimeRange.clear() |
|
3986 | self.specGgraphTimeRange.clear() | |
3987 | else: |
|
3987 | else: | |
3988 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3988 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3989 | value1 = str(value1) |
|
3989 | value1 = str(value1) | |
3990 | self.specHeisGgraphTimeRange.setText(value1) |
|
3990 | self.specHeisGgraphTimeRange.setText(value1) | |
3991 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3991 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3992 |
|
3992 | |||
3993 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3993 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3994 | if parmObj == None: |
|
3994 | if parmObj == None: | |
3995 | self.specHeisGgraphYminYmax.clear() |
|
3995 | self.specHeisGgraphYminYmax.clear() | |
3996 | else: |
|
3996 | else: | |
3997 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3997 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3998 | value1 = str(value1) |
|
3998 | value1 = str(value1) | |
3999 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3999 | value2 = opObj.getParameterValue(parameterName='ymax') | |
4000 | value2 = str(value2) |
|
4000 | value2 = str(value2) | |
4001 | value = value1 + "," + value2 |
|
4001 | value = value1 + "," + value2 | |
4002 | self.specHeisGgraphYminYmax.setText(value) |
|
4002 | self.specHeisGgraphYminYmax.setText(value) | |
4003 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
4003 | self.specHeisGgraphYminYmax.setEnabled(True) | |
4004 |
|
4004 | |||
4005 | parmObj = opObj.getParameterObj(parameterName="save") |
|
4005 | parmObj = opObj.getParameterObj(parameterName="save") | |
4006 | if parmObj == None: |
|
4006 | if parmObj == None: | |
4007 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
4007 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
4008 | else: |
|
4008 | else: | |
4009 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
4009 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
4010 |
|
4010 | |||
4011 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
4011 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
4012 | if parmObj == None: |
|
4012 | if parmObj == None: | |
4013 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
4013 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
4014 | else: |
|
4014 | else: | |
4015 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
4015 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
4016 |
|
4016 | |||
4017 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
4017 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
4018 | if parmObj: |
|
4018 | if parmObj: | |
4019 | value = parmObj.getValue() |
|
4019 | value = parmObj.getValue() | |
4020 | self.specHeisGraphPath.setText(value) |
|
4020 | self.specHeisGraphPath.setText(value) | |
4021 |
|
4021 | |||
4022 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
4022 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
4023 | if parmObj: |
|
4023 | if parmObj: | |
4024 | value = parmObj.getValue() |
|
4024 | value = parmObj.getValue() | |
4025 | self.specHeisGgraphftpratio.setText(str(value)) |
|
4025 | self.specHeisGgraphftpratio.setText(str(value)) | |
4026 |
|
4026 | |||
4027 | # outputSpectraHeisWrite |
|
4027 | # outputSpectraHeisWrite | |
4028 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
4028 | opObj = puObj.getOperationObj(name='FitsWriter') | |
4029 | if opObj == None: |
|
4029 | if opObj == None: | |
4030 | self.specHeisOutputPath.clear() |
|
4030 | self.specHeisOutputPath.clear() | |
4031 | self.specHeisOutputblocksperfile.clear() |
|
4031 | self.specHeisOutputblocksperfile.clear() | |
4032 | self.specHeisOutputMetada.clear() |
|
4032 | self.specHeisOutputMetada.clear() | |
4033 | else: |
|
4033 | else: | |
4034 | value = opObj.getParameterObj(parameterName='path') |
|
4034 | value = opObj.getParameterObj(parameterName='path') | |
4035 | if value == None: |
|
4035 | if value == None: | |
4036 | self.specHeisOutputPath.clear() |
|
4036 | self.specHeisOutputPath.clear() | |
4037 | else: |
|
4037 | else: | |
4038 | value = opObj.getParameterValue(parameterName='path') |
|
4038 | value = opObj.getParameterValue(parameterName='path') | |
4039 | path = str(value) |
|
4039 | path = str(value) | |
4040 | self.specHeisOutputPath.setText(path) |
|
4040 | self.specHeisOutputPath.setText(path) | |
4041 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
4041 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
4042 | if value == None: |
|
4042 | if value == None: | |
4043 | self.specHeisOutputblocksperfile.clear() |
|
4043 | self.specHeisOutputblocksperfile.clear() | |
4044 | else: |
|
4044 | else: | |
4045 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
4045 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
4046 | blocksperfile = str(value) |
|
4046 | blocksperfile = str(value) | |
4047 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
4047 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
4048 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
4048 | value = opObj.getParameterObj(parameterName='metadatafile') | |
4049 | if value == None: |
|
4049 | if value == None: | |
4050 | self.specHeisOutputMetada.clear() |
|
4050 | self.specHeisOutputMetada.clear() | |
4051 | else: |
|
4051 | else: | |
4052 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
4052 | value = opObj.getParameterValue(parameterName='metadatafile') | |
4053 | metadata_file = str(value) |
|
4053 | metadata_file = str(value) | |
4054 | self.specHeisOutputMetada.setText(metadata_file) |
|
4054 | self.specHeisOutputMetada.setText(metadata_file) | |
4055 |
|
4055 | |||
4056 | return |
|
4056 | return | |
4057 |
|
4057 | |||
4058 | def __refreshCorrelationWindow(self, puObj): |
|
4058 | def __refreshCorrelationWindow(self, puObj): | |
4059 | pass |
|
4059 | pass | |
4060 |
|
4060 | |||
4061 | def refreshPUWindow(self, puObj): |
|
4061 | def refreshPUWindow(self, puObj): | |
4062 |
|
4062 | |||
4063 | if puObj.datatype == 'Voltage': |
|
4063 | if puObj.datatype == 'Voltage': | |
4064 | self.__refreshVoltageWindow(puObj) |
|
4064 | self.__refreshVoltageWindow(puObj) | |
4065 |
|
4065 | |||
4066 | if puObj.datatype == 'Spectra': |
|
4066 | if puObj.datatype == 'Spectra': | |
4067 | self.__refreshSpectraWindow(puObj) |
|
4067 | self.__refreshSpectraWindow(puObj) | |
4068 |
|
4068 | |||
4069 | if puObj.datatype == 'SpectraHeis': |
|
4069 | if puObj.datatype == 'SpectraHeis': | |
4070 | self.__refreshSpectraHeisWindow(puObj) |
|
4070 | self.__refreshSpectraHeisWindow(puObj) | |
4071 |
|
4071 | |||
4072 | def refreshProjectProperties(self, projectObjView): |
|
4072 | def refreshProjectProperties(self, projectObjView): | |
4073 |
|
4073 | |||
4074 | propertyBuffObj = PropertyBuffer() |
|
4074 | propertyBuffObj = PropertyBuffer() | |
4075 | name = projectObjView.name |
|
4075 | name = projectObjView.name | |
4076 |
|
4076 | |||
4077 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
4077 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
4078 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
4078 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
4079 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
4079 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
4080 |
|
4080 | |||
4081 | readUnitObj = projectObjView.getReadUnitObj() |
|
4081 | readUnitObj = projectObjView.getReadUnitObj() | |
4082 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
4082 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
4083 |
|
4083 | |||
4084 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
4084 | for thisParmObj in runOperationObj.getParameterObjList(): | |
4085 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
4085 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
4086 |
|
4086 | |||
4087 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
4087 | propertiesModel = propertyBuffObj.getPropertyModel() | |
4088 |
|
4088 | |||
4089 | self.treeProjectProperties.setModel(propertiesModel) |
|
4089 | self.treeProjectProperties.setModel(propertiesModel) | |
4090 | self.treeProjectProperties.expandAll() |
|
4090 | self.treeProjectProperties.expandAll() | |
4091 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4091 | self.treeProjectProperties.resizeColumnToContents(0) | |
4092 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4092 | self.treeProjectProperties.resizeColumnToContents(1) | |
4093 |
|
4093 | |||
4094 | def refreshPUProperties(self, puObjView): |
|
4094 | def refreshPUProperties(self, puObjView): | |
4095 |
|
4095 | |||
4096 | ############ FTP CONFIG ################################ |
|
4096 | ############ FTP CONFIG ################################ | |
4097 | #Deleting FTP Conf. This processing unit have not got any |
|
4097 | #Deleting FTP Conf. This processing unit have not got any | |
4098 | #FTP configuration by default |
|
4098 | #FTP configuration by default | |
4099 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
4099 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
4100 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
4100 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
4101 | ######################################################## |
|
4101 | ######################################################## | |
4102 |
|
4102 | |||
4103 | propertyBuffObj = PropertyBuffer() |
|
4103 | propertyBuffObj = PropertyBuffer() | |
4104 |
|
4104 | |||
4105 | for thisOp in puObjView.getOperationObjList(): |
|
4105 | for thisOp in puObjView.getOperationObjList(): | |
4106 |
|
4106 | |||
4107 | operationName = thisOp.name |
|
4107 | operationName = thisOp.name | |
4108 |
|
4108 | |||
4109 | if operationName == 'run': |
|
4109 | if operationName == 'run': | |
4110 | operationName = 'Properties' |
|
4110 | operationName = 'Properties' | |
4111 |
|
4111 | |||
4112 | else: |
|
4112 | else: | |
4113 | if not thisOp.getParameterObjList(): |
|
4113 | if not thisOp.getParameterObjList(): | |
4114 | propertyBuffObj.append(operationName, '--', '--') |
|
4114 | propertyBuffObj.append(operationName, '--', '--') | |
4115 | continue |
|
4115 | continue | |
4116 |
|
4116 | |||
4117 | for thisParmObj in thisOp.getParameterObjList(): |
|
4117 | for thisParmObj in thisOp.getParameterObjList(): | |
4118 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
4118 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
4119 |
|
4119 | |||
4120 | ############ FTP CONFIG ################################ |
|
4120 | ############ FTP CONFIG ################################ | |
4121 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
4121 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
4122 | value = thisParmObj.getValue() |
|
4122 | value = thisParmObj.getValue() | |
4123 | self.temporalFTP.ftp_wei = value |
|
4123 | self.temporalFTP.ftp_wei = value | |
4124 |
|
4124 | |||
4125 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
4125 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
4126 | value = thisParmObj.getValue() |
|
4126 | value = thisParmObj.getValue() | |
4127 | self.temporalFTP.exp_code = value |
|
4127 | self.temporalFTP.exp_code = value | |
4128 |
|
4128 | |||
4129 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
4129 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
4130 | value = thisParmObj.getValue() |
|
4130 | value = thisParmObj.getValue() | |
4131 | self.temporalFTP.sub_exp_code = value |
|
4131 | self.temporalFTP.sub_exp_code = value | |
4132 |
|
4132 | |||
4133 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
4133 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
4134 | value = thisParmObj.getValue() |
|
4134 | value = thisParmObj.getValue() | |
4135 | self.temporalFTP.plot_pos = value |
|
4135 | self.temporalFTP.plot_pos = value | |
4136 |
|
4136 | |||
4137 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
4137 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
4138 | figpathObj = thisOp.getParameterObj('figpath') |
|
4138 | figpathObj = thisOp.getParameterObj('figpath') | |
4139 | if figpathObj: |
|
4139 | if figpathObj: | |
4140 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
4140 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
4141 |
|
4141 | |||
4142 | ######################################################## |
|
4142 | ######################################################## | |
4143 |
|
4143 | |||
4144 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
4144 | propertiesModel = propertyBuffObj.getPropertyModel() | |
4145 |
|
4145 | |||
4146 | self.treeProjectProperties.setModel(propertiesModel) |
|
4146 | self.treeProjectProperties.setModel(propertiesModel) | |
4147 | self.treeProjectProperties.expandAll() |
|
4147 | self.treeProjectProperties.expandAll() | |
4148 | self.treeProjectProperties.resizeColumnToContents(0) |
|
4148 | self.treeProjectProperties.resizeColumnToContents(0) | |
4149 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4149 | self.treeProjectProperties.resizeColumnToContents(1) | |
4150 |
|
4150 | |||
4151 | def refreshGraphicsId(self): |
|
4151 | def refreshGraphicsId(self): | |
4152 |
|
4152 | |||
4153 | projectObj = self.getSelectedProjectObj() |
|
4153 | projectObj = self.getSelectedProjectObj() | |
4154 |
|
4154 | |||
4155 | if not projectObj: |
|
4155 | if not projectObj: | |
4156 | return |
|
4156 | return | |
4157 |
|
4157 | |||
4158 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
4158 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
4159 |
|
4159 | |||
4160 | for opObj in puObj.getOperationObjList(): |
|
4160 | for opObj in puObj.getOperationObjList(): | |
4161 |
|
4161 | |||
4162 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
4162 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
4163 | continue |
|
4163 | continue | |
4164 |
|
4164 | |||
4165 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4165 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4166 |
|
4166 | |||
4167 | def on_click(self, index): |
|
4167 | def on_click(self, index): | |
4168 |
|
4168 | |||
4169 | self._disable_save_button() |
|
4169 | self._disable_save_button() | |
4170 | self._disable_play_button() |
|
4170 | self._disable_play_button() | |
4171 |
|
4171 | |||
4172 | self.console.clear() |
|
4172 | self.console.clear() | |
4173 |
|
4173 | |||
4174 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4174 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4175 |
|
4175 | |||
4176 | projectObjView = self.getSelectedProjectObj() |
|
4176 | projectObjView = self.getSelectedProjectObj() | |
4177 |
|
4177 | |||
4178 | if not projectObjView: |
|
4178 | if not projectObjView: | |
4179 | return |
|
4179 | return | |
4180 |
|
4180 | |||
4181 | self.create = False |
|
4181 | self.create = False | |
4182 | selectedObjView = self.getSelectedItemObj() |
|
4182 | selectedObjView = self.getSelectedItemObj() | |
4183 |
|
4183 | |||
4184 | self.refreshProjectWindow(projectObjView) |
|
4184 | self.refreshProjectWindow(projectObjView) | |
4185 | self.refreshProjectProperties(projectObjView) |
|
4185 | self.refreshProjectProperties(projectObjView) | |
4186 |
|
4186 | |||
4187 | #A project has been selected |
|
4187 | #A project has been selected | |
4188 | if projectObjView == selectedObjView: |
|
4188 | if projectObjView == selectedObjView: | |
4189 |
|
4189 | |||
4190 | self.tabProject.setEnabled(True) |
|
4190 | self.tabProject.setEnabled(True) | |
4191 | self.tabVoltage.setEnabled(False) |
|
4191 | self.tabVoltage.setEnabled(False) | |
4192 | self.tabSpectra.setEnabled(False) |
|
4192 | self.tabSpectra.setEnabled(False) | |
4193 | self.tabCorrelation.setEnabled(False) |
|
4193 | self.tabCorrelation.setEnabled(False) | |
4194 | self.tabSpectraHeis.setEnabled(False) |
|
4194 | self.tabSpectraHeis.setEnabled(False) | |
4195 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4195 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4196 |
|
4196 | |||
4197 | if self.dateList: |
|
4197 | if self.dateList: | |
4198 | self._enable_save_button() |
|
4198 | self._enable_save_button() | |
4199 | self._enable_play_button() |
|
4199 | self._enable_play_button() | |
4200 |
|
4200 | |||
4201 | return |
|
4201 | return | |
4202 |
|
4202 | |||
4203 | #A processing unit has been selected |
|
4203 | #A processing unit has been selected | |
4204 | voltEnable = False |
|
4204 | voltEnable = False | |
4205 | specEnable = False |
|
4205 | specEnable = False | |
4206 | corrEnable = False |
|
4206 | corrEnable = False | |
4207 | specHeisEnable = False |
|
4207 | specHeisEnable = False | |
4208 | tabSelected = self.tabProject |
|
4208 | tabSelected = self.tabProject | |
4209 |
|
4209 | |||
4210 | puObj = selectedObjView |
|
4210 | puObj = selectedObjView | |
4211 |
|
4211 | |||
4212 | self.refreshPUWindow(puObj) |
|
4212 | self.refreshPUWindow(puObj) | |
4213 | self.refreshPUProperties(puObj) |
|
4213 | self.refreshPUProperties(puObj) | |
4214 | self.showtabPUCreated(puObj.datatype) |
|
4214 | self.showtabPUCreated(puObj.datatype) | |
4215 |
|
4215 | |||
4216 | if self.dateList: |
|
4216 | if self.dateList: | |
4217 | self._enable_save_button() |
|
4217 | self._enable_save_button() | |
4218 | self._enable_play_button() |
|
4218 | self._enable_play_button() | |
4219 |
|
4219 | |||
4220 | def on_right_click(self, pos): |
|
4220 | def on_right_click(self, pos): | |
4221 |
|
4221 | |||
4222 | self.menu = QtGui.QMenu() |
|
4222 | self.menu = QtGui.QMenu() | |
4223 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4223 | quitAction0 = self.menu.addAction("Create a New Project") | |
4224 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4224 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4225 | quitAction2 = self.menu.addAction("Delete Item") |
|
4225 | quitAction2 = self.menu.addAction("Delete Item") | |
4226 | quitAction3 = self.menu.addAction("Quit") |
|
4226 | quitAction3 = self.menu.addAction("Quit") | |
4227 |
|
4227 | |||
4228 | if len(self.__itemTreeDict) == 0: |
|
4228 | if len(self.__itemTreeDict) == 0: | |
4229 | quitAction2.setEnabled(False) |
|
4229 | quitAction2.setEnabled(False) | |
4230 | else: |
|
4230 | else: | |
4231 | quitAction2.setEnabled(True) |
|
4231 | quitAction2.setEnabled(True) | |
4232 |
|
4232 | |||
4233 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4233 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4234 |
|
4234 | |||
4235 | if action == quitAction0: |
|
4235 | if action == quitAction0: | |
4236 | self. setInputsProject_View() |
|
4236 | self. setInputsProject_View() | |
4237 | self.create = True |
|
4237 | self.create = True | |
4238 |
|
4238 | |||
4239 | if action == quitAction1: |
|
4239 | if action == quitAction1: | |
4240 | if len(self.__projectObjDict) == 0: |
|
4240 | if len(self.__projectObjDict) == 0: | |
4241 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4241 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4242 | self.console.clear() |
|
4242 | self.console.clear() | |
4243 | self.console.append(outputstr) |
|
4243 | self.console.append(outputstr) | |
4244 | return 0 |
|
4244 | return 0 | |
4245 | else: |
|
4245 | else: | |
4246 | self.addPUWindow() |
|
4246 | self.addPUWindow() | |
4247 | self.console.clear() |
|
4247 | self.console.clear() | |
4248 | self.console.append("Please, Choose the type of Processing Unit") |
|
4248 | self.console.append("Please, Choose the type of Processing Unit") | |
4249 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4249 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4250 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4250 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4251 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4251 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4252 |
|
4252 | |||
4253 | if action == quitAction2: |
|
4253 | if action == quitAction2: | |
4254 | index = self.selectedItemTree |
|
4254 | index = self.selectedItemTree | |
4255 | try: |
|
4255 | try: | |
4256 | index.parent() |
|
4256 | index.parent() | |
4257 | except: |
|
4257 | except: | |
4258 | self.console.append('Please, first at all select a Project or Processing Unit') |
|
4258 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4259 | return 0 |
|
4259 | return 0 | |
4260 | # print index.parent(),index |
|
4260 | # print index.parent(),index | |
4261 | if index.parent() == None: |
|
4261 | if index.parent() == None: | |
4262 | self.projectExplorerModel.removeRow(index.row()) |
|
4262 | self.projectExplorerModel.removeRow(index.row()) | |
4263 | else: |
|
4263 | else: | |
4264 | index.parent().removeRow(index.row()) |
|
4264 | index.parent().removeRow(index.row()) | |
4265 | self.removeItemTreeFromProject() |
|
4265 | self.removeItemTreeFromProject() | |
4266 | self.console.clear() |
|
4266 | self.console.clear() | |
4267 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4267 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4268 | # print i.row() |
|
4268 | # print i.row() | |
4269 |
|
4269 | |||
4270 | if action == quitAction3: |
|
4270 | if action == quitAction3: | |
4271 | self.close() |
|
4271 | self.close() | |
4272 | return 0 |
|
4272 | return 0 | |
4273 |
|
4273 | |||
4274 | def createProjectView(self, id): |
|
4274 | def createProjectView(self, id): | |
4275 |
|
4275 | |||
4276 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4276 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4277 | id = str(id) |
|
4277 | id = str(id) | |
4278 | projectParms = self.__getParmsFromProjectWindow() |
|
4278 | projectParms = self.__getParmsFromProjectWindow() | |
4279 |
|
4279 | |||
4280 | if not projectParms.isValid(): |
|
4280 | if not projectParms.isValid(): | |
4281 | return None |
|
4281 | return None | |
4282 |
|
4282 | |||
4283 | projectObjView = Project() |
|
4283 | projectObjView = Project() | |
4284 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4284 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4285 |
|
4285 | |||
4286 | self.__projectObjDict[id] = projectObjView |
|
4286 | self.__projectObjDict[id] = projectObjView | |
4287 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4287 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4288 |
|
4288 | |||
4289 | return projectObjView |
|
4289 | return projectObjView | |
4290 |
|
4290 | |||
4291 | def updateProjectView(self): |
|
4291 | def updateProjectView(self): | |
4292 |
|
4292 | |||
4293 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4293 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4294 |
|
4294 | |||
4295 | projectParms = self.__getParmsFromProjectWindow() |
|
4295 | projectParms = self.__getParmsFromProjectWindow() | |
4296 |
|
4296 | |||
4297 | if not projectParms.isValid(): |
|
4297 | if not projectParms.isValid(): | |
4298 | return None |
|
4298 | return None | |
4299 |
|
4299 | |||
4300 | projectObjView = self.getSelectedProjectObj() |
|
4300 | projectObjView = self.getSelectedProjectObj() | |
4301 |
|
4301 | |||
4302 | if not projectObjView: |
|
4302 | if not projectObjView: | |
4303 | self.console.append("Please select a project before update it") |
|
4303 | self.console.append("Please select a project before update it") | |
4304 | return None |
|
4304 | return None | |
4305 |
|
4305 | |||
4306 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4306 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4307 |
|
4307 | |||
4308 | return projectObjView |
|
4308 | return projectObjView | |
4309 |
|
4309 | |||
4310 | def createReadUnitView(self, projectObjView, idReadUnit=None): |
|
4310 | def createReadUnitView(self, projectObjView, idReadUnit=None): | |
4311 |
|
4311 | |||
4312 | projectParms = self.__getParmsFromProjectWindow() |
|
4312 | projectParms = self.__getParmsFromProjectWindow() | |
4313 |
|
4313 | |||
4314 | if not projectParms.isValid(): |
|
4314 | if not projectParms.isValid(): | |
4315 | return None |
|
4315 | return None | |
4316 |
|
4316 | |||
4317 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4317 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4318 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4318 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4319 | datatype=projectParms.datatype, |
|
4319 | datatype=projectParms.datatype, | |
4320 | path=projectParms.dpath, |
|
4320 | path=projectParms.dpath, | |
4321 | startDate=projectParms.startDate, |
|
4321 | startDate=projectParms.startDate, | |
4322 | endDate=projectParms.endDate, |
|
4322 | endDate=projectParms.endDate, | |
4323 | startTime=projectParms.startTime, |
|
4323 | startTime=projectParms.startTime, | |
4324 | endTime=projectParms.endTime, |
|
4324 | endTime=projectParms.endTime, | |
4325 | online=projectParms.online, |
|
4325 | online=projectParms.online, | |
4326 | walk=projectParms.walk |
|
4326 | walk=projectParms.walk | |
4327 | ) |
|
4327 | ) | |
4328 |
|
4328 | |||
4329 | if projectParms.set: |
|
4329 | if projectParms.set: | |
4330 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4330 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4331 |
|
4331 | |||
4332 | if projectParms.delay: |
|
4332 | if projectParms.delay: | |
4333 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4333 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4334 |
|
4334 | |||
4335 | if projectParms.expLabel: |
|
4335 | if projectParms.expLabel: | |
4336 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4336 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4337 |
|
4337 | |||
4338 | readUnitConfObj.addOperation(name="printInfo") |
|
4338 | readUnitConfObj.addOperation(name="printInfo") | |
4339 |
|
4339 | |||
4340 | if projectParms.datatype == "USRP": |
|
4340 | if projectParms.datatype == "USRP": | |
4341 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4341 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4342 | datatype=projectParms.datatype, |
|
4342 | datatype=projectParms.datatype, | |
4343 | path=projectParms.dpath, |
|
4343 | path=projectParms.dpath, | |
4344 | startDate=projectParms.startDate, |
|
4344 | startDate=projectParms.startDate, | |
4345 | endDate=projectParms.endDate, |
|
4345 | endDate=projectParms.endDate, | |
4346 | startTime=projectParms.startTime, |
|
4346 | startTime=projectParms.startTime, | |
4347 | endTime=projectParms.endTime, |
|
4347 | endTime=projectParms.endTime, | |
4348 | online=projectParms.online, |
|
4348 | online=projectParms.online, | |
4349 | ippKm=projectParms.ippKm |
|
4349 | ippKm=projectParms.ippKm | |
4350 | ) |
|
4350 | ) | |
4351 |
|
4351 | |||
4352 | if projectParms.delay: |
|
4352 | if projectParms.delay: | |
4353 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4353 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4354 |
|
4354 | |||
4355 | return readUnitConfObj |
|
4355 | return readUnitConfObj | |
4356 |
|
4356 | |||
4357 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4357 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4358 |
|
4358 | |||
4359 | projectObjView.removeProcUnit(idReadUnit) |
|
4359 | projectObjView.removeProcUnit(idReadUnit) | |
4360 |
|
4360 | |||
4361 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) |
|
4361 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) | |
4362 |
|
4362 | |||
4363 | return readUnitConfObj |
|
4363 | return readUnitConfObj | |
4364 |
|
4364 | |||
4365 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4365 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4366 |
|
4366 | |||
4367 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4367 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4368 |
|
4368 | |||
4369 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4369 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4370 |
|
4370 | |||
4371 | return procUnitConfObj |
|
4371 | return procUnitConfObj | |
4372 |
|
4372 | |||
4373 | def updateProcUnitView(self, id): |
|
4373 | def updateProcUnitView(self, id): | |
4374 |
|
4374 | |||
4375 | pass |
|
4375 | pass | |
4376 |
|
4376 | |||
4377 | def addPUWindow(self): |
|
4377 | def addPUWindow(self): | |
4378 |
|
4378 | |||
4379 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4379 | self.configUPWindowObj = UnitProcessWindow(self) | |
4380 | fatherObj = self.getSelectedItemObj() |
|
4380 | fatherObj = self.getSelectedItemObj() | |
4381 | try: |
|
4381 | try: | |
4382 | fatherObj.getElementName() |
|
4382 | fatherObj.getElementName() | |
4383 | except: |
|
4383 | except: | |
4384 | self.console.append("First left click on Project or Processing Unit") |
|
4384 | self.console.append("First left click on Project or Processing Unit") | |
4385 | return 0 |
|
4385 | return 0 | |
4386 |
|
4386 | |||
4387 | if fatherObj.getElementName() == 'Project': |
|
4387 | if fatherObj.getElementName() == 'Project': | |
4388 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4388 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4389 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4389 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4390 |
|
4390 | |||
4391 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4391 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4392 | self.configUPWindowObj.loadTotalList() |
|
4392 | self.configUPWindowObj.loadTotalList() | |
4393 | self.configUPWindowObj.show() |
|
4393 | self.configUPWindowObj.show() | |
4394 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4394 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4395 |
|
4395 | |||
4396 | def createPUWindow(self): |
|
4396 | def createPUWindow(self): | |
4397 |
|
4397 | |||
4398 | if not self.configUPWindowObj.create: |
|
4398 | if not self.configUPWindowObj.create: | |
4399 | return |
|
4399 | return | |
4400 |
|
4400 | |||
4401 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4401 | fatherObj = self.configUPWindowObj.getFromWindow | |
4402 | datatype = self.configUPWindowObj.typeofUP |
|
4402 | datatype = self.configUPWindowObj.typeofUP | |
4403 |
|
4403 | |||
4404 | if fatherObj.getElementName() == 'Project': |
|
4404 | if fatherObj.getElementName() == 'Project': | |
4405 | inputId = fatherObj.getReadUnitId() |
|
4405 | inputId = fatherObj.getReadUnitId() | |
4406 | projectObjView = fatherObj |
|
4406 | projectObjView = fatherObj | |
4407 | else: |
|
4407 | else: | |
4408 | inputId = fatherObj.getId() |
|
4408 | inputId = fatherObj.getId() | |
4409 | projectObjView = self.getSelectedProjectObj() |
|
4409 | projectObjView = self.getSelectedProjectObj() | |
4410 |
|
4410 | |||
4411 | if not projectObjView: |
|
4411 | if not projectObjView: | |
4412 | return |
|
4412 | return | |
4413 |
|
4413 | |||
4414 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4414 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4415 |
|
4415 | |||
4416 | self.addPU2ProjectExplorer(puObj) |
|
4416 | self.addPU2ProjectExplorer(puObj) | |
4417 |
|
4417 | |||
4418 | self.showtabPUCreated(datatype) |
|
4418 | self.showtabPUCreated(datatype) | |
4419 |
|
4419 | |||
4420 | self.clearPUWindow(datatype) |
|
4420 | self.clearPUWindow(datatype) | |
4421 |
|
4421 | |||
4422 | self.showPUinitView() |
|
4422 | self.showPUinitView() | |
4423 |
|
4423 | |||
4424 | def addFTPConf2Operation(self, puObj, opObj): |
|
4424 | def addFTPConf2Operation(self, puObj, opObj): | |
4425 |
|
4425 | |||
4426 | if not self.temporalFTP.create: |
|
4426 | if not self.temporalFTP.create: | |
4427 | self.temporalFTP.setwithoutconfiguration() |
|
4427 | self.temporalFTP.setwithoutconfiguration() | |
4428 |
|
4428 | |||
4429 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4429 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4430 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4430 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4431 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4431 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4432 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4432 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4433 |
|
4433 | |||
4434 | if self.temporalFTP.ftp_wei: |
|
4434 | if self.temporalFTP.ftp_wei: | |
4435 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4435 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4436 | if self.temporalFTP.exp_code: |
|
4436 | if self.temporalFTP.exp_code: | |
4437 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4437 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4438 | if self.temporalFTP.sub_exp_code: |
|
4438 | if self.temporalFTP.sub_exp_code: | |
4439 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4439 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4440 | if self.temporalFTP.plot_pos: |
|
4440 | if self.temporalFTP.plot_pos: | |
4441 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4441 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4442 |
|
4442 | |||
4443 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4443 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4444 | # |
|
4444 | # | |
4445 | # puId = None |
|
4445 | # puId = None | |
4446 | # puObj = None |
|
4446 | # puObj = None | |
4447 | # |
|
4447 | # | |
4448 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4448 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4449 | # |
|
4449 | # | |
4450 | # if not thisPuObj.name == "SendToServer": |
|
4450 | # if not thisPuObj.name == "SendToServer": | |
4451 | # continue |
|
4451 | # continue | |
4452 | # |
|
4452 | # | |
4453 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4453 | # opObj = thisPuObj.getOperationObj(name='run') | |
4454 | # |
|
4454 | # | |
4455 | # parmObj = opObj.getParameterObj('localfolder') |
|
4455 | # parmObj = opObj.getParameterObj('localfolder') | |
4456 | # |
|
4456 | # | |
4457 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4457 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4458 | # if not parmObj: |
|
4458 | # if not parmObj: | |
4459 | # projectObj.removeProcUnit(thisPuId) |
|
4459 | # projectObj.removeProcUnit(thisPuId) | |
4460 | # continue |
|
4460 | # continue | |
4461 | # |
|
4461 | # | |
4462 | # thisLocalfolder = parmObj.getValue() |
|
4462 | # thisLocalfolder = parmObj.getValue() | |
4463 | # |
|
4463 | # | |
4464 | # if localfolder != thisLocalfolder: |
|
4464 | # if localfolder != thisLocalfolder: | |
4465 | # continue |
|
4465 | # continue | |
4466 | # |
|
4466 | # | |
4467 | # puId = thisPuId |
|
4467 | # puId = thisPuId | |
4468 | # puObj = thisPuObj |
|
4468 | # puObj = thisPuObj | |
4469 | # break |
|
4469 | # break | |
4470 | # |
|
4470 | # | |
4471 | # return puObj |
|
4471 | # return puObj | |
4472 |
|
4472 | |||
4473 | def createFTPProcUnitView(self): |
|
4473 | def createFTPProcUnitView(self): | |
4474 |
|
4474 | |||
4475 | if not self.temporalFTP.create: |
|
4475 | if not self.temporalFTP.create: | |
4476 | self.temporalFTP.setwithoutconfiguration() |
|
4476 | self.temporalFTP.setwithoutconfiguration() | |
4477 |
|
4477 | |||
4478 | projectObj = self.getSelectedProjectObj() |
|
4478 | projectObj = self.getSelectedProjectObj() | |
4479 |
|
4479 | |||
4480 | if not projectObj: |
|
4480 | if not projectObj: | |
4481 | return |
|
4481 | return | |
4482 |
|
4482 | |||
4483 | self.removeAllFTPProcUnitView(projectObj) |
|
4483 | self.removeAllFTPProcUnitView(projectObj) | |
4484 |
|
4484 | |||
4485 | if not self.__puLocalFolder2FTP: |
|
4485 | if not self.__puLocalFolder2FTP: | |
4486 | return |
|
4486 | return | |
4487 |
|
4487 | |||
4488 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4488 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4489 |
|
4489 | |||
4490 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4490 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4491 |
|
4491 | |||
4492 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4492 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4493 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4493 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4494 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4494 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4495 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4495 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4496 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4496 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4497 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4497 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4498 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4498 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4499 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4499 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4500 |
|
4500 | |||
4501 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4501 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4502 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4502 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4503 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4503 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4504 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4504 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4505 |
|
4505 | |||
4506 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4506 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4507 |
|
4507 | |||
4508 | def removeAllFTPProcUnitView(self, projectObj): |
|
4508 | def removeAllFTPProcUnitView(self, projectObj): | |
4509 |
|
4509 | |||
4510 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4510 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4511 |
|
4511 | |||
4512 | if not thisPuObj.name == "SendToServer": |
|
4512 | if not thisPuObj.name == "SendToServer": | |
4513 | continue |
|
4513 | continue | |
4514 |
|
4514 | |||
4515 | projectObj.removeProcUnit(thisPuId) |
|
4515 | projectObj.removeProcUnit(thisPuId) | |
4516 |
|
4516 | |||
4517 | if thisPuId not in self.__puObjDict.keys(): |
|
4517 | if thisPuId not in self.__puObjDict.keys(): | |
4518 | continue |
|
4518 | continue | |
4519 |
|
4519 | |||
4520 | self.__puObjDict.pop(thisPuId) |
|
4520 | self.__puObjDict.pop(thisPuId) | |
4521 |
|
4521 | |||
4522 | def showPUinitView(self): |
|
4522 | def showPUinitView(self): | |
4523 |
|
4523 | |||
4524 | self.propertiesModel = TreeModel() |
|
4524 | self.propertiesModel = TreeModel() | |
4525 | self.propertiesModel.initPUVoltageView() |
|
4525 | self.propertiesModel.initPUVoltageView() | |
4526 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4526 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4527 | self.treeProjectProperties.expandAll() |
|
4527 | self.treeProjectProperties.expandAll() | |
4528 | self.treeProjectProperties.allColumnsShowFocus() |
|
4528 | self.treeProjectProperties.allColumnsShowFocus() | |
4529 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4529 | self.treeProjectProperties.resizeColumnToContents(1) | |
4530 |
|
4530 | |||
4531 | def saveFTPFromOpObj(self, operationObj): |
|
4531 | def saveFTPFromOpObj(self, operationObj): | |
4532 |
|
4532 | |||
4533 | if operationObj.name != "SendByFTP": |
|
4533 | if operationObj.name != "SendByFTP": | |
4534 | return |
|
4534 | return | |
4535 |
|
4535 | |||
4536 | server = operationObj.getParameterValue("server") |
|
4536 | server = operationObj.getParameterValue("server") | |
4537 | username = operationObj.getParameterValue("username") |
|
4537 | username = operationObj.getParameterValue("username") | |
4538 | password = operationObj.getParameterValue("password") |
|
4538 | password = operationObj.getParameterValue("password") | |
4539 | localfolder = operationObj.getParameterValue("localfolder") |
|
4539 | localfolder = operationObj.getParameterValue("localfolder") | |
4540 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4540 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4541 | ext = operationObj.getParameterValue("ext") |
|
4541 | ext = operationObj.getParameterValue("ext") | |
4542 | period = operationObj.getParameterValue("period") |
|
4542 | period = operationObj.getParameterValue("period") | |
4543 |
|
4543 | |||
4544 | self.temporalFTP.save(server=server, |
|
4544 | self.temporalFTP.save(server=server, | |
4545 | remotefolder=remotefolder, |
|
4545 | remotefolder=remotefolder, | |
4546 | username=username, |
|
4546 | username=username, | |
4547 | password=password, |
|
4547 | password=password, | |
4548 | localfolder=localfolder, |
|
4548 | localfolder=localfolder, | |
4549 | extension=ext) |
|
4549 | extension=ext) | |
4550 |
|
4550 | |||
4551 | return |
|
4551 | return | |
4552 |
|
4552 | |||
4553 | def saveFTPFromProcUnitObj(self, puObj): |
|
4553 | def saveFTPFromProcUnitObj(self, puObj): | |
4554 |
|
4554 | |||
4555 | opObj = puObj.getOperationObj(name="run") |
|
4555 | opObj = puObj.getOperationObj(name="run") | |
4556 |
|
4556 | |||
4557 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4557 | parmObj = opObj.getParameterObj(parameterName="server") | |
4558 | if parmObj == None: |
|
4558 | if parmObj == None: | |
4559 | server = 'jro-app.igp.gob.pe' |
|
4559 | server = 'jro-app.igp.gob.pe' | |
4560 | else: |
|
4560 | else: | |
4561 | server = parmObj.getValue() |
|
4561 | server = parmObj.getValue() | |
4562 |
|
4562 | |||
4563 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4563 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4564 | if parmObj == None: |
|
4564 | if parmObj == None: | |
4565 | remotefolder = '/home/wmaster/graficos' |
|
4565 | remotefolder = '/home/wmaster/graficos' | |
4566 | else: |
|
4566 | else: | |
4567 | remotefolder = parmObj.getValue() |
|
4567 | remotefolder = parmObj.getValue() | |
4568 |
|
4568 | |||
4569 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4569 | parmObj = opObj.getParameterObj(parameterName="username") | |
4570 | if parmObj == None: |
|
4570 | if parmObj == None: | |
4571 | username = 'wmaster' |
|
4571 | username = 'wmaster' | |
4572 | else: |
|
4572 | else: | |
4573 | username = parmObj.getValue() |
|
4573 | username = parmObj.getValue() | |
4574 |
|
4574 | |||
4575 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4575 | parmObj = opObj.getParameterObj(parameterName="password") | |
4576 | if parmObj == None: |
|
4576 | if parmObj == None: | |
4577 | password = 'mst2010vhf' |
|
4577 | password = 'mst2010vhf' | |
4578 | else: |
|
4578 | else: | |
4579 | password = parmObj.getValue() |
|
4579 | password = parmObj.getValue() | |
4580 |
|
4580 | |||
4581 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4581 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4582 | if parmObj == None: |
|
4582 | if parmObj == None: | |
4583 | ftp_wei = 0 |
|
4583 | ftp_wei = 0 | |
4584 | else: |
|
4584 | else: | |
4585 | ftp_wei = parmObj.getValue() |
|
4585 | ftp_wei = parmObj.getValue() | |
4586 |
|
4586 | |||
4587 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4587 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4588 | if parmObj == None: |
|
4588 | if parmObj == None: | |
4589 | exp_code = 0 |
|
4589 | exp_code = 0 | |
4590 | else: |
|
4590 | else: | |
4591 | exp_code = parmObj.getValue() |
|
4591 | exp_code = parmObj.getValue() | |
4592 |
|
4592 | |||
4593 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4593 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4594 | if parmObj == None: |
|
4594 | if parmObj == None: | |
4595 | sub_exp_code = 0 |
|
4595 | sub_exp_code = 0 | |
4596 | else: |
|
4596 | else: | |
4597 | sub_exp_code = parmObj.getValue() |
|
4597 | sub_exp_code = parmObj.getValue() | |
4598 |
|
4598 | |||
4599 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4599 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4600 | if parmObj == None: |
|
4600 | if parmObj == None: | |
4601 | plot_pos = 0 |
|
4601 | plot_pos = 0 | |
4602 | else: |
|
4602 | else: | |
4603 | plot_pos = parmObj.getValue() |
|
4603 | plot_pos = parmObj.getValue() | |
4604 |
|
4604 | |||
4605 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4605 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4606 | if parmObj == None: |
|
4606 | if parmObj == None: | |
4607 | localfolder = None |
|
4607 | localfolder = None | |
4608 | else: |
|
4608 | else: | |
4609 | localfolder = parmObj.getValue() |
|
4609 | localfolder = parmObj.getValue() | |
4610 |
|
4610 | |||
4611 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4611 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4612 | if parmObj == None: |
|
4612 | if parmObj == None: | |
4613 | extension = '.png' |
|
4613 | extension = '.png' | |
4614 | else: |
|
4614 | else: | |
4615 | extension = parmObj.getValue() |
|
4615 | extension = parmObj.getValue() | |
4616 |
|
4616 | |||
4617 | self.temporalFTP.save(server=server, |
|
4617 | self.temporalFTP.save(server=server, | |
4618 | remotefolder=remotefolder, |
|
4618 | remotefolder=remotefolder, | |
4619 | username=username, |
|
4619 | username=username, | |
4620 | password=password, |
|
4620 | password=password, | |
4621 | ftp_wei=ftp_wei, |
|
4621 | ftp_wei=ftp_wei, | |
4622 | exp_code=exp_code, |
|
4622 | exp_code=exp_code, | |
4623 | sub_exp_code=sub_exp_code, |
|
4623 | sub_exp_code=sub_exp_code, | |
4624 | plot_pos=plot_pos, |
|
4624 | plot_pos=plot_pos, | |
4625 | localfolder=localfolder, |
|
4625 | localfolder=localfolder, | |
4626 | extension=extension) |
|
4626 | extension=extension) | |
4627 |
|
4627 | |||
4628 | def addProject2ProjectExplorer(self, id, name): |
|
4628 | def addProject2ProjectExplorer(self, id, name): | |
4629 |
|
4629 | |||
4630 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4630 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4631 |
|
4631 | |||
4632 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4632 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4633 | parentItem.appendRow(itemTree) |
|
4633 | parentItem.appendRow(itemTree) | |
4634 |
|
4634 | |||
4635 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4635 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4636 |
|
4636 | |||
4637 | self.selectedItemTree = itemTree |
|
4637 | self.selectedItemTree = itemTree | |
4638 |
|
4638 | |||
4639 | self.__itemTreeDict[id] = itemTree |
|
4639 | self.__itemTreeDict[id] = itemTree | |
4640 |
|
4640 | |||
4641 | def addPU2ProjectExplorer(self, puObj): |
|
4641 | def addPU2ProjectExplorer(self, puObj): | |
4642 |
|
4642 | |||
4643 | id, name = puObj.id, puObj.datatype |
|
4643 | id, name = puObj.id, puObj.datatype | |
4644 |
|
4644 | |||
4645 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4645 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4646 |
|
4646 | |||
4647 | parentItem = self.selectedItemTree |
|
4647 | parentItem = self.selectedItemTree | |
4648 | parentItem.appendRow(itemTree) |
|
4648 | parentItem.appendRow(itemTree) | |
4649 | self.projectExplorerTree.expandAll() |
|
4649 | self.projectExplorerTree.expandAll() | |
4650 |
|
4650 | |||
4651 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4651 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4652 |
|
4652 | |||
4653 | self.selectedItemTree = itemTree |
|
4653 | self.selectedItemTree = itemTree | |
4654 |
|
4654 | |||
4655 | self.__itemTreeDict[id] = itemTree |
|
4655 | self.__itemTreeDict[id] = itemTree | |
4656 |
|
4656 | |||
4657 | def addPU2PELoadXML(self, puObj): |
|
4657 | def addPU2PELoadXML(self, puObj): | |
4658 |
|
4658 | |||
4659 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4659 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4660 |
|
4660 | |||
4661 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4661 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4662 |
|
4662 | |||
4663 | if self.__itemTreeDict.has_key(inputId): |
|
4663 | if self.__itemTreeDict.has_key(inputId): | |
4664 | parentItem = self.__itemTreeDict[inputId] |
|
4664 | parentItem = self.__itemTreeDict[inputId] | |
4665 | else: |
|
4665 | else: | |
4666 | #If parent is a Reader object |
|
4666 | #If parent is a Reader object | |
4667 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4667 | parentItem = self.__itemTreeDict[id[:-1]] | |
4668 |
|
4668 | |||
4669 | parentItem.appendRow(itemTree) |
|
4669 | parentItem.appendRow(itemTree) | |
4670 | self.projectExplorerTree.expandAll() |
|
4670 | self.projectExplorerTree.expandAll() | |
4671 | parentItem = itemTree |
|
4671 | parentItem = itemTree | |
4672 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4672 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4673 |
|
4673 | |||
4674 | self.__itemTreeDict[id] = itemTree |
|
4674 | self.__itemTreeDict[id] = itemTree | |
4675 | self.selectedItemTree = itemTree |
|
4675 | self.selectedItemTree = itemTree | |
4676 |
|
4676 | |||
4677 | def getSelectedProjectObj(self): |
|
4677 | def getSelectedProjectObj(self): | |
4678 | """ |
|
4678 | """ | |
4679 | Return the current project object selected. If a processing unit is |
|
4679 | Return the current project object selected. If a processing unit is | |
4680 | actually selected this function returns associated project. |
|
4680 | actually selected this function returns associated project. | |
4681 |
|
4681 | |||
4682 | None if any project or processing unit is selected |
|
4682 | None if any project or processing unit is selected | |
4683 | """ |
|
4683 | """ | |
4684 | for key in self.__itemTreeDict.keys(): |
|
4684 | for key in self.__itemTreeDict.keys(): | |
4685 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4685 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4686 | continue |
|
4686 | continue | |
4687 |
|
4687 | |||
4688 | if self.__projectObjDict.has_key(key): |
|
4688 | if self.__projectObjDict.has_key(key): | |
4689 | projectObj = self.__projectObjDict[key] |
|
4689 | projectObj = self.__projectObjDict[key] | |
4690 | return projectObj |
|
4690 | return projectObj | |
4691 |
|
4691 | |||
4692 | puObj = self.__puObjDict[key] |
|
4692 | puObj = self.__puObjDict[key] | |
4693 |
|
4693 | |||
4694 | if puObj.parentId == None: |
|
4694 | if puObj.parentId == None: | |
4695 | projectId = puObj.getId()[0] |
|
4695 | projectId = puObj.getId()[0] | |
4696 | else: |
|
4696 | else: | |
4697 | projectId = puObj.parentId |
|
4697 | projectId = puObj.parentId | |
4698 |
|
4698 | |||
4699 | projectObj = self.__projectObjDict[projectId] |
|
4699 | projectObj = self.__projectObjDict[projectId] | |
4700 | return projectObj |
|
4700 | return projectObj | |
4701 |
|
4701 | |||
4702 | return None |
|
4702 | return None | |
4703 |
|
4703 | |||
4704 | def getSelectedItemObj(self): |
|
4704 | def getSelectedItemObj(self): | |
4705 | """ |
|
4705 | """ | |
4706 | Return the current project or processing unit object selected |
|
4706 | Return the current project or processing unit object selected | |
4707 |
|
4707 | |||
4708 | None if any project or processing unit is selected |
|
4708 | None if any project or processing unit is selected | |
4709 | """ |
|
4709 | """ | |
4710 | for key in self.__itemTreeDict.keys(): |
|
4710 | for key in self.__itemTreeDict.keys(): | |
4711 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4711 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4712 | continue |
|
4712 | continue | |
4713 |
|
4713 | |||
4714 | if self.__projectObjDict.has_key(key) == True: |
|
4714 | if self.__projectObjDict.has_key(key) == True: | |
4715 | fatherObj = self.__projectObjDict[key] |
|
4715 | fatherObj = self.__projectObjDict[key] | |
4716 | else: |
|
4716 | else: | |
4717 | fatherObj = self.__puObjDict[key] |
|
4717 | fatherObj = self.__puObjDict[key] | |
4718 |
|
4718 | |||
4719 | return fatherObj |
|
4719 | return fatherObj | |
4720 |
|
4720 | |||
4721 | return None |
|
4721 | return None | |
4722 |
|
4722 | |||
4723 | def _WarningWindow(self, text, information): |
|
4723 | def _WarningWindow(self, text, information): | |
4724 |
|
4724 | |||
4725 | msgBox = QtGui.QMessageBox() |
|
4725 | msgBox = QtGui.QMessageBox() | |
4726 | msgBox.setText(text) |
|
4726 | msgBox.setText(text) | |
4727 | msgBox.setInformativeText(information) |
|
4727 | msgBox.setInformativeText(information) | |
4728 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4728 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4729 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4729 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4730 | ret = msgBox.exec_() |
|
4730 | ret = msgBox.exec_() | |
4731 |
|
4731 | |||
4732 | answer = False |
|
4732 | answer = False | |
4733 |
|
4733 | |||
4734 | if ret == QtGui.QMessageBox.Ok: |
|
4734 | if ret == QtGui.QMessageBox.Ok: | |
4735 | answer = True |
|
4735 | answer = True | |
4736 |
|
4736 | |||
4737 | return answer |
|
4737 | return answer | |
4738 |
|
4738 | |||
4739 | def __getNewProjectId(self): |
|
4739 | def __getNewProjectId(self): | |
4740 |
|
4740 | |||
4741 | loadProject = False |
|
4741 | loadProject = False | |
4742 |
|
4742 | |||
4743 | for thisId in range(1,10): |
|
4743 | for thisId in range(1,10): | |
4744 | newId = str(thisId) |
|
4744 | newId = str(thisId) | |
4745 | if newId in self.__projectObjDict.keys(): |
|
4745 | if newId in self.__projectObjDict.keys(): | |
4746 | continue |
|
4746 | continue | |
4747 |
|
4747 | |||
4748 | loadProject = True |
|
4748 | loadProject = True | |
4749 | projectId = newId |
|
4749 | projectId = newId | |
4750 | break |
|
4750 | break | |
4751 |
|
4751 | |||
4752 | if not loadProject: |
|
4752 | if not loadProject: | |
4753 | self.console.clear() |
|
4753 | self.console.clear() | |
4754 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4754 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4755 | return None |
|
4755 | return None | |
4756 |
|
4756 | |||
4757 | return projectId |
|
4757 | return projectId | |
4758 |
|
4758 | |||
4759 | def openProject(self): |
|
4759 | def openProject(self): | |
4760 |
|
4760 | |||
4761 | self._disable_save_button() |
|
4761 | self._disable_save_button() | |
4762 | self._disable_play_button() |
|
4762 | self._disable_play_button() | |
4763 |
|
4763 | |||
4764 | self.console.clear() |
|
4764 | self.console.clear() | |
4765 |
|
4765 | |||
4766 | self.frame_2.setEnabled(True) |
|
4766 | self.frame_2.setEnabled(True) | |
4767 |
|
4767 | |||
4768 | # print self.dir |
|
4768 | # print self.dir | |
4769 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4769 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4770 |
|
4770 | |||
4771 | projectObjLoad = Project() |
|
4771 | projectObjLoad = Project() | |
4772 |
|
4772 | |||
4773 | if not projectObjLoad.readXml(filename): |
|
4773 | if not projectObjLoad.readXml(filename): | |
4774 | self.console.append("The selected xml file could not be loaded ...") |
|
4774 | self.console.append("The selected xml file could not be loaded ...") | |
4775 | return 0 |
|
4775 | return 0 | |
4776 |
|
4776 | |||
4777 | self.create = False |
|
4777 | self.create = False | |
4778 | self.refreshProjectWindow(projectObjLoad) |
|
4778 | self.refreshProjectWindow(projectObjLoad) | |
4779 | self.refreshProjectProperties(projectObjLoad) |
|
4779 | self.refreshProjectProperties(projectObjLoad) | |
4780 |
|
4780 | |||
4781 | projectId = projectObjLoad.id |
|
4781 | projectId = projectObjLoad.id | |
4782 |
|
4782 | |||
4783 | if projectId in self.__projectObjDict.keys(): |
|
4783 | if projectId in self.__projectObjDict.keys(): | |
4784 |
|
4784 | |||
4785 | projectId = self.__getNewProjectId() |
|
4785 | projectId = self.__getNewProjectId() | |
4786 |
|
4786 | |||
4787 | if not projectId: |
|
4787 | if not projectId: | |
4788 | return 0 |
|
4788 | return 0 | |
4789 |
|
4789 | |||
4790 | projectObjLoad.updateId(projectId) |
|
4790 | projectObjLoad.updateId(projectId) | |
4791 |
|
4791 | |||
4792 | self.__projectObjDict[projectId] = projectObjLoad |
|
4792 | self.__projectObjDict[projectId] = projectObjLoad | |
4793 |
|
4793 | |||
4794 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4794 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4795 |
|
4795 | |||
4796 | self.tabWidgetProject.setEnabled(True) |
|
4796 | self.tabWidgetProject.setEnabled(True) | |
4797 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4797 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4798 | # Disable tabProject after finish the creation |
|
4798 | # Disable tabProject after finish the creation | |
4799 | self.tabProject.setEnabled(True) |
|
4799 | self.tabProject.setEnabled(True) | |
4800 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4800 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4801 |
|
4801 | |||
4802 | for puId, puObj in puObjorderList.items(): |
|
4802 | for puId, puObj in puObjorderList.items(): | |
4803 |
|
4803 | |||
4804 | self.__puObjDict[puId] = puObj |
|
4804 | self.__puObjDict[puId] = puObj | |
4805 |
|
4805 | |||
4806 | if puObj.name == "SendToServer": |
|
4806 | if puObj.name == "SendToServer": | |
4807 | self.saveFTPFromProcUnitObj(puObj) |
|
4807 | self.saveFTPFromProcUnitObj(puObj) | |
4808 |
|
4808 | |||
4809 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4809 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4810 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4810 | operationObj = puObj.getOperationObj("SendByFTP") | |
4811 |
|
4811 | |||
4812 | if operationObj: |
|
4812 | if operationObj: | |
4813 | self.saveFTPFromOpObj(operationObj) |
|
4813 | self.saveFTPFromOpObj(operationObj) | |
4814 | ############################################################ |
|
4814 | ############################################################ | |
4815 |
|
4815 | |||
4816 | if puObj.inputId == '0': |
|
4816 | if puObj.inputId == '0': | |
4817 | continue |
|
4817 | continue | |
4818 |
|
4818 | |||
4819 | self.addPU2PELoadXML(puObj) |
|
4819 | self.addPU2PELoadXML(puObj) | |
4820 |
|
4820 | |||
4821 | self.refreshPUWindow(puObj) |
|
4821 | self.refreshPUWindow(puObj) | |
4822 | self.refreshPUProperties(puObj) |
|
4822 | self.refreshPUProperties(puObj) | |
4823 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4823 | self.showtabPUCreated(datatype=puObj.datatype) | |
4824 |
|
4824 | |||
4825 | # self.console.clear() |
|
4825 | # self.console.clear() | |
4826 | self.console.append("\nThe selected xml file has been loaded successfully") |
|
4826 | self.console.append("\nThe selected xml file has been loaded successfully") | |
4827 |
|
4827 | |||
4828 | if self.dateList: |
|
4828 | if self.dateList: | |
4829 | self._disable_save_button() |
|
4829 | self._disable_save_button() | |
4830 | self._enable_play_button() |
|
4830 | self._enable_play_button() | |
4831 |
|
4831 | |||
4832 | def create_updating_timer(self): |
|
4832 | def create_updating_timer(self): | |
4833 |
|
4833 | |||
4834 | self.comm_data_timer = QtCore.QTimer(self) |
|
4834 | self.comm_data_timer = QtCore.QTimer(self) | |
4835 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4835 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4836 | self.comm_data_timer.start(1000) |
|
4836 | self.comm_data_timer.start(1000) | |
4837 |
|
4837 | |||
4838 | def on_comm_updating_timer(self): |
|
4838 | def on_comm_updating_timer(self): | |
4839 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4839 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4840 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4840 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4841 | if not self.threadStarted: |
|
4841 | if not self.threadStarted: | |
4842 | return |
|
4842 | return | |
4843 |
|
4843 | |||
4844 | if self.controllerThread.isFinished(): |
|
4844 | if self.controllerThread.isFinished(): | |
4845 | self.stopProject() |
|
4845 | self.stopProject() | |
4846 | return |
|
4846 | return | |
4847 |
|
4847 | |||
4848 | def use_plotmanager(self, controllerThread): |
|
4848 | def use_plotmanager(self, controllerThread): | |
4849 |
|
4849 | |||
4850 | self.plotManager = controllerThread.useExternalPlotter() |
|
4850 | self.plotManager = controllerThread.useExternalPlotter() | |
4851 |
|
4851 | |||
4852 | self.plot_timer = QtCore.QTimer() |
|
4852 | self.plot_timer = QtCore.QTimer() | |
4853 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) |
|
4853 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) | |
4854 | self.plot_timer.start(10) |
|
4854 | self.plot_timer.start(10) | |
4855 |
|
4855 | |||
4856 | def on_plotmanager_timer(self): |
|
4856 | def on_plotmanager_timer(self): | |
4857 |
|
4857 | |||
4858 | if not self.plotManager: |
|
4858 | if not self.plotManager: | |
4859 | return |
|
4859 | return | |
4860 |
|
4860 | |||
4861 | self.plotManager.run() |
|
4861 | self.plotManager.run() | |
4862 |
|
4862 | |||
4863 | if self.plotManager.isErrorDetected(): |
|
4863 | if self.plotManager.isErrorDetected(): | |
4864 | self.stopProject() |
|
4864 | self.stopProject() | |
4865 | return |
|
4865 | return | |
4866 |
|
4866 | |||
4867 | def playProject(self, ext=".xml", save=1): |
|
4867 | def playProject(self, ext=".xml", save=1): | |
4868 |
|
4868 | |||
4869 | self._disable_play_button() |
|
4869 | self._disable_play_button() | |
4870 | self._disable_save_button() |
|
4870 | self._disable_save_button() | |
4871 |
|
4871 | |||
4872 | if self.controllerThread: |
|
4872 | if self.controllerThread: | |
4873 | if self.controllerThread.isRunning(): |
|
4873 | if self.controllerThread.isRunning(): | |
4874 | self.console.append("There is already another process running") |
|
4874 | self.console.append("There is already another process running") | |
4875 | self._enable_stop_button() |
|
4875 | self._enable_stop_button() | |
4876 | return |
|
4876 | return | |
4877 |
|
4877 | |||
4878 | if not self.dateList: |
|
4878 | if not self.dateList: | |
4879 | self.console.append("No data found, check datapath") |
|
4879 | self.console.append("No data found, check datapath") | |
4880 |
|
4880 | |||
4881 | projectObj = self.getSelectedProjectObj() |
|
4881 | projectObj = self.getSelectedProjectObj() | |
4882 |
|
4882 | |||
4883 | if not projectObj: |
|
4883 | if not projectObj: | |
4884 | self.console.append("Please, select a project to start it") |
|
4884 | self.console.append("Please, select a project to start it") | |
4885 | return |
|
4885 | return | |
4886 |
|
4886 | |||
4887 | if save: |
|
4887 | if save: | |
4888 | filename = self.saveProject() |
|
4888 | filename = self.saveProject() | |
4889 | if filename == None: |
|
4889 | if filename == None: | |
4890 | self.console.append("Process not initialized.") |
|
4890 | self.console.append("Process not initialized.") | |
4891 | return |
|
4891 | return | |
4892 | else: |
|
4892 | else: | |
4893 | filename = TEMPORAL_FILE |
|
4893 | filename = TEMPORAL_FILE | |
4894 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4894 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4895 |
|
4895 | |||
4896 | self.console.clear() |
|
4896 | self.console.clear() | |
4897 | self.console.append("Please wait...") |
|
4897 | self.console.append("Please wait...") | |
4898 |
|
4898 | |||
4899 | self.controllerThread = ControllerThread() |
|
4899 | self.controllerThread = ControllerThread() | |
4900 | self.controllerThread.readXml(filename) |
|
4900 | self.controllerThread.readXml(filename) | |
4901 |
|
4901 | |||
4902 | self.use_plotmanager(self.controllerThread) |
|
4902 | self.use_plotmanager(self.controllerThread) | |
4903 |
|
4903 | |||
4904 | self.console.clear() |
|
4904 | self.console.clear() | |
4905 |
|
4905 | |||
4906 | self.controllerThread.start() |
|
4906 | self.controllerThread.start() | |
4907 |
|
4907 | |||
4908 | sleep(0.5) |
|
4908 | sleep(0.5) | |
4909 |
|
4909 | |||
4910 |
|
4910 | |||
4911 | self.threadStarted = True |
|
4911 | self.threadStarted = True | |
4912 |
|
4912 | |||
4913 | self._disable_play_button() |
|
4913 | self._disable_play_button() | |
4914 | self._disable_save_button() |
|
4914 | self._disable_save_button() | |
4915 | self._enable_stop_button() |
|
4915 | self._enable_stop_button() | |
4916 |
|
4916 | |||
4917 | def stopProject(self): |
|
4917 | def stopProject(self): | |
4918 |
|
4918 | |||
4919 | self.threadStarted = False |
|
4919 | self.threadStarted = False | |
4920 | self.controllerThread.stop() |
|
4920 | self.controllerThread.stop() | |
4921 | self.plot_timer.stop() |
|
4921 | self.plot_timer.stop() | |
4922 |
|
4922 | |||
4923 | self.plotManager.join() |
|
4923 | self.plotManager.join() | |
4924 | self.plotManager = None |
|
4924 | self.plotManager = None | |
4925 |
|
4925 | |||
4926 | while self.controllerThread.isRunning(): |
|
4926 | while self.controllerThread.isRunning(): | |
4927 | sleep(0.5) |
|
4927 | sleep(0.5) | |
4928 |
|
4928 | |||
4929 | self._disable_stop_button() |
|
4929 | self._disable_stop_button() | |
4930 | self._enable_play_button() |
|
4930 | self._enable_play_button() | |
4931 |
|
4931 | |||
4932 | def pauseProject(self): |
|
4932 | def pauseProject(self): | |
4933 |
|
4933 | |||
4934 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4934 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4935 | paused = self.controllerThread.pause() |
|
4935 | paused = self.controllerThread.pause() | |
4936 |
|
4936 | |||
4937 | self.changePauseIcon(paused) |
|
4937 | self.changePauseIcon(paused) | |
4938 |
|
4938 | |||
4939 | def saveProject(self, filename=None): |
|
4939 | def saveProject(self, filename=None): | |
4940 |
|
4940 | |||
4941 | self._disable_save_button() |
|
4941 | self._disable_save_button() | |
4942 | self._disable_play_button() |
|
4942 | self._disable_play_button() | |
4943 |
|
4943 | |||
4944 | projectObj = self.getSelectedProjectObj() |
|
4944 | projectObj = self.getSelectedProjectObj() | |
4945 |
|
4945 | |||
4946 | if not projectObj: |
|
4946 | if not projectObj: | |
4947 |
|
4947 | |||
4948 | if self.create: |
|
4948 | if self.create: | |
4949 | self.console.append("Please press Ok before save it") |
|
4949 | self.console.append("Please press Ok before save it") | |
4950 | else: |
|
4950 | else: | |
4951 | self.console.append("Please select a project before save it") |
|
4951 | self.console.append("Please select a project before save it") | |
4952 | return |
|
4952 | return | |
4953 |
|
4953 | |||
4954 | self.refreshGraphicsId() |
|
4954 | self.refreshGraphicsId() | |
4955 |
|
4955 | |||
4956 | sts = True |
|
4956 | sts = True | |
4957 | selectedItemObj = self.getSelectedItemObj() |
|
4957 | selectedItemObj = self.getSelectedItemObj() | |
4958 |
|
4958 | |||
4959 | #A Processing Unit has been selected |
|
4959 | #A Processing Unit has been selected | |
4960 | if projectObj == selectedItemObj: |
|
4960 | if projectObj == selectedItemObj: | |
4961 | if not self.on_proOk_clicked(): |
|
4961 | if not self.on_proOk_clicked(): | |
4962 | return None |
|
4962 | return None | |
4963 |
|
4963 | |||
4964 | #A Processing Unit has been selected |
|
4964 | #A Processing Unit has been selected | |
4965 | if projectObj != selectedItemObj: |
|
4965 | if projectObj != selectedItemObj: | |
4966 | puObj = selectedItemObj |
|
4966 | puObj = selectedItemObj | |
4967 |
|
4967 | |||
4968 | if puObj.name == 'VoltageProc': |
|
4968 | if puObj.name == 'VoltageProc': | |
4969 | sts = self.on_volOpOk_clicked() |
|
4969 | sts = self.on_volOpOk_clicked() | |
4970 | if puObj.name == 'SpectraProc': |
|
4970 | if puObj.name == 'SpectraProc': | |
4971 | sts = self.on_specOpOk_clicked() |
|
4971 | sts = self.on_specOpOk_clicked() | |
4972 | if puObj.name == 'SpectraHeisProc': |
|
4972 | if puObj.name == 'SpectraHeisProc': | |
4973 | sts = self.on_specHeisOpOk_clicked() |
|
4973 | sts = self.on_specHeisOpOk_clicked() | |
4974 |
|
4974 | |||
4975 | if not sts: |
|
4975 | if not sts: | |
4976 | return None |
|
4976 | return None | |
4977 |
|
4977 | |||
4978 | self.createFTPProcUnitView() |
|
4978 | self.createFTPProcUnitView() | |
4979 |
|
4979 | |||
4980 | if not filename: |
|
4980 | if not filename: | |
4981 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4981 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4982 |
|
4982 | |||
4983 | projectObj.writeXml(filename) |
|
4983 | projectObj.writeXml(filename) | |
4984 | self.console.clear() |
|
4984 | self.console.clear() | |
4985 | self.console.append("Project saved") |
|
4985 | self.console.append("Project saved") | |
4986 | self.console.append("Press Play button to start data processing ...") |
|
4986 | self.console.append("Press Play button to start data processing ...") | |
4987 |
|
4987 | |||
4988 | self._disable_save_button() |
|
4988 | self._disable_save_button() | |
4989 | self._enable_play_button() |
|
4989 | self._enable_play_button() | |
4990 |
|
4990 | |||
4991 | return filename |
|
4991 | return filename | |
4992 |
|
4992 | |||
4993 | def removeItemTreeFromProject(self): |
|
4993 | def removeItemTreeFromProject(self): | |
4994 | """ |
|
4994 | """ | |
4995 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4995 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4996 | """ |
|
4996 | """ | |
4997 | for key in self.__itemTreeDict.keys(): |
|
4997 | for key in self.__itemTreeDict.keys(): | |
4998 |
|
4998 | |||
4999 | #Check again because an item can delete multiple items (childs) |
|
4999 | #Check again because an item can delete multiple items (childs) | |
5000 | if key not in self.__itemTreeDict.keys(): |
|
5000 | if key not in self.__itemTreeDict.keys(): | |
5001 | continue |
|
5001 | continue | |
5002 |
|
5002 | |||
5003 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
5003 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
5004 | continue |
|
5004 | continue | |
5005 |
|
5005 | |||
5006 | if self.__projectObjDict.has_key(key) == True: |
|
5006 | if self.__projectObjDict.has_key(key) == True: | |
5007 |
|
5007 | |||
5008 | del self.__projectObjDict[key] |
|
5008 | del self.__projectObjDict[key] | |
5009 | del self.__itemTreeDict[key] |
|
5009 | del self.__itemTreeDict[key] | |
5010 |
|
5010 | |||
5011 | else: |
|
5011 | else: | |
5012 | puObj = self.__puObjDict[key] |
|
5012 | puObj = self.__puObjDict[key] | |
5013 | idProjectParent = puObj.parentId |
|
5013 | idProjectParent = puObj.parentId | |
5014 | projectObj = self.__projectObjDict[idProjectParent] |
|
5014 | projectObj = self.__projectObjDict[idProjectParent] | |
5015 |
|
5015 | |||
5016 | del self.__puObjDict[key] |
|
5016 | del self.__puObjDict[key] | |
5017 | del self.__itemTreeDict[key] |
|
5017 | del self.__itemTreeDict[key] | |
5018 | del projectObj.procUnitConfObjDict[key] |
|
5018 | del projectObj.procUnitConfObjDict[key] | |
5019 |
|
5019 | |||
5020 | for key in projectObj.procUnitConfObjDict.keys(): |
|
5020 | for key in projectObj.procUnitConfObjDict.keys(): | |
5021 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
5021 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
5022 | continue |
|
5022 | continue | |
5023 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5023 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
5024 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
5024 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
5025 | del projectObj.procUnitConfObjDict[key] |
|
5025 | del projectObj.procUnitConfObjDict[key] | |
5026 | # print projectObj.procUnitConfObjDict |
|
5026 | # print projectObj.procUnitConfObjDict | |
5027 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
5027 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
5028 |
|
5028 | |||
5029 | def setInputsProject_View(self): |
|
5029 | def setInputsProject_View(self): | |
5030 |
|
5030 | |||
5031 | self.tabWidgetProject.setEnabled(True) |
|
5031 | self.tabWidgetProject.setEnabled(True) | |
5032 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
5032 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
5033 | self.tabProject.setEnabled(True) |
|
5033 | self.tabProject.setEnabled(True) | |
5034 | self.frame_2.setEnabled(False) |
|
5034 | self.frame_2.setEnabled(False) | |
5035 | self.proName.clear() |
|
5035 | self.proName.clear() | |
5036 | self.proName.setFocus() |
|
5036 | self.proName.setFocus() | |
5037 | self.proName.setSelection(0, 0) |
|
5037 | self.proName.setSelection(0, 0) | |
5038 | self.proName.setCursorPosition(0) |
|
5038 | self.proName.setCursorPosition(0) | |
5039 | self.proDataType.setText('.r') |
|
5039 | self.proDataType.setText('.r') | |
5040 | self.proDataPath.clear() |
|
5040 | self.proDataPath.clear() | |
5041 | self.proComDataType.clear() |
|
5041 | self.proComDataType.clear() | |
5042 | self.proComDataType.addItem("Voltage") |
|
5042 | self.proComDataType.addItem("Voltage") | |
5043 | self.proComDataType.addItem("Spectra") |
|
5043 | self.proComDataType.addItem("Spectra") | |
5044 | self.proComDataType.addItem("Fits") |
|
5044 | self.proComDataType.addItem("Fits") | |
5045 | self.proComDataType.addItem("USRP") |
|
5045 | self.proComDataType.addItem("USRP") | |
5046 |
|
5046 | |||
5047 | self.proComStartDate.clear() |
|
5047 | self.proComStartDate.clear() | |
5048 | self.proComEndDate.clear() |
|
5048 | self.proComEndDate.clear() | |
5049 |
|
5049 | |||
5050 | startTime = "00:00:00" |
|
5050 | startTime = "00:00:00" | |
5051 | endTime = "23:59:59" |
|
5051 | endTime = "23:59:59" | |
5052 | starlist = startTime.split(":") |
|
5052 | starlist = startTime.split(":") | |
5053 | endlist = endTime.split(":") |
|
5053 | endlist = endTime.split(":") | |
5054 | self.proDelay.setText("60") |
|
5054 | self.proDelay.setText("60") | |
5055 | self.proSet.setText("") |
|
5055 | self.proSet.setText("") | |
5056 |
|
5056 | |||
5057 | self.labelSet.show() |
|
5057 | self.labelSet.show() | |
5058 | self.proSet.show() |
|
5058 | self.proSet.show() | |
5059 |
|
5059 | |||
5060 | self.labelIPPKm.hide() |
|
5060 | self.labelIPPKm.hide() | |
5061 | self.proIPPKm.hide() |
|
5061 | self.proIPPKm.hide() | |
5062 |
|
5062 | |||
5063 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5063 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5064 | self.proStartTime.setTime(self.time) |
|
5064 | self.proStartTime.setTime(self.time) | |
5065 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5065 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5066 | self.proEndTime.setTime(self.time) |
|
5066 | self.proEndTime.setTime(self.time) | |
5067 | self.proDescription.clear() |
|
5067 | self.proDescription.clear() | |
5068 | self.proOk.setEnabled(False) |
|
5068 | self.proOk.setEnabled(False) | |
5069 | # self.console.append("Please, Write a name Project") |
|
5069 | # self.console.append("Please, Write a name Project") | |
5070 | # self.console.append("Introduce Project Parameters")DC |
|
5070 | # self.console.append("Introduce Project Parameters")DC | |
5071 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
5071 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
5072 |
|
5072 | |||
5073 | def clearPUWindow(self, datatype): |
|
5073 | def clearPUWindow(self, datatype): | |
5074 |
|
5074 | |||
5075 | projectObjView = self.getSelectedProjectObj() |
|
5075 | projectObjView = self.getSelectedProjectObj() | |
5076 |
|
5076 | |||
5077 | if not projectObjView: |
|
5077 | if not projectObjView: | |
5078 | return |
|
5078 | return | |
5079 |
|
5079 | |||
5080 | puObj = self.getSelectedItemObj() |
|
5080 | puObj = self.getSelectedItemObj() | |
5081 | inputId = puObj.getInputId() |
|
5081 | inputId = puObj.getInputId() | |
5082 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
5082 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
5083 |
|
5083 | |||
5084 | if datatype == 'Voltage': |
|
5084 | if datatype == 'Voltage': | |
5085 | self.volOpComChannels.setEnabled(False) |
|
5085 | self.volOpComChannels.setEnabled(False) | |
5086 | self.volOpComHeights.setEnabled(False) |
|
5086 | self.volOpComHeights.setEnabled(False) | |
5087 | self.volOpFilter.setEnabled(False) |
|
5087 | self.volOpFilter.setEnabled(False) | |
5088 | self.volOpComProfile.setEnabled(False) |
|
5088 | self.volOpComProfile.setEnabled(False) | |
5089 | self.volOpComCode.setEnabled(False) |
|
5089 | self.volOpComCode.setEnabled(False) | |
5090 | self.volOpCohInt.setEnabled(False) |
|
5090 | self.volOpCohInt.setEnabled(False) | |
5091 | self.volOpChannel.setEnabled(False) |
|
5091 | self.volOpChannel.setEnabled(False) | |
5092 | self.volOpHeights.setEnabled(False) |
|
5092 | self.volOpHeights.setEnabled(False) | |
5093 | self.volOpProfile.setEnabled(False) |
|
5093 | self.volOpProfile.setEnabled(False) | |
5094 | self.volOpRadarfrequency.setEnabled(False) |
|
5094 | self.volOpRadarfrequency.setEnabled(False) | |
5095 | self.volOpCebChannels.setCheckState(0) |
|
5095 | self.volOpCebChannels.setCheckState(0) | |
5096 | self.volOpCebRadarfrequency.setCheckState(0) |
|
5096 | self.volOpCebRadarfrequency.setCheckState(0) | |
5097 | self.volOpCebHeights.setCheckState(0) |
|
5097 | self.volOpCebHeights.setCheckState(0) | |
5098 | self.volOpCebFilter.setCheckState(0) |
|
5098 | self.volOpCebFilter.setCheckState(0) | |
5099 | self.volOpCebProfile.setCheckState(0) |
|
5099 | self.volOpCebProfile.setCheckState(0) | |
5100 | self.volOpCebDecodification.setCheckState(0) |
|
5100 | self.volOpCebDecodification.setCheckState(0) | |
5101 | self.volOpCebCohInt.setCheckState(0) |
|
5101 | self.volOpCebCohInt.setCheckState(0) | |
5102 |
|
5102 | |||
5103 | self.volOpChannel.clear() |
|
5103 | self.volOpChannel.clear() | |
5104 | self.volOpHeights.clear() |
|
5104 | self.volOpHeights.clear() | |
5105 | self.volOpProfile.clear() |
|
5105 | self.volOpProfile.clear() | |
5106 | self.volOpFilter.clear() |
|
5106 | self.volOpFilter.clear() | |
5107 | self.volOpCohInt.clear() |
|
5107 | self.volOpCohInt.clear() | |
5108 | self.volOpRadarfrequency.clear() |
|
5108 | self.volOpRadarfrequency.clear() | |
5109 |
|
5109 | |||
5110 | if datatype == 'Spectra': |
|
5110 | if datatype == 'Spectra': | |
5111 |
|
5111 | |||
5112 | if inputPUObj.datatype == 'Spectra': |
|
5112 | if inputPUObj.datatype == 'Spectra': | |
5113 | self.specOpnFFTpoints.setEnabled(False) |
|
5113 | self.specOpnFFTpoints.setEnabled(False) | |
5114 | self.specOpProfiles.setEnabled(False) |
|
5114 | self.specOpProfiles.setEnabled(False) | |
5115 | self.specOpippFactor.setEnabled(False) |
|
5115 | self.specOpippFactor.setEnabled(False) | |
5116 | else: |
|
5116 | else: | |
5117 | self.specOpnFFTpoints.setEnabled(True) |
|
5117 | self.specOpnFFTpoints.setEnabled(True) | |
5118 | self.specOpProfiles.setEnabled(True) |
|
5118 | self.specOpProfiles.setEnabled(True) | |
5119 | self.specOpippFactor.setEnabled(True) |
|
5119 | self.specOpippFactor.setEnabled(True) | |
5120 |
|
5120 | |||
5121 | self.specOpCebCrossSpectra.setCheckState(0) |
|
5121 | self.specOpCebCrossSpectra.setCheckState(0) | |
5122 | self.specOpCebChannel.setCheckState(0) |
|
5122 | self.specOpCebChannel.setCheckState(0) | |
5123 | self.specOpCebHeights.setCheckState(0) |
|
5123 | self.specOpCebHeights.setCheckState(0) | |
5124 | self.specOpCebIncoherent.setCheckState(0) |
|
5124 | self.specOpCebIncoherent.setCheckState(0) | |
5125 | self.specOpCebRemoveDC.setCheckState(0) |
|
5125 | self.specOpCebRemoveDC.setCheckState(0) | |
5126 | self.specOpCebRemoveInt.setCheckState(0) |
|
5126 | self.specOpCebRemoveInt.setCheckState(0) | |
5127 | self.specOpCebgetNoise.setCheckState(0) |
|
5127 | self.specOpCebgetNoise.setCheckState(0) | |
5128 | self.specOpCebRadarfrequency.setCheckState(0) |
|
5128 | self.specOpCebRadarfrequency.setCheckState(0) | |
5129 |
|
5129 | |||
5130 | self.specOpRadarfrequency.setEnabled(False) |
|
5130 | self.specOpRadarfrequency.setEnabled(False) | |
5131 | self.specOppairsList.setEnabled(False) |
|
5131 | self.specOppairsList.setEnabled(False) | |
5132 | self.specOpChannel.setEnabled(False) |
|
5132 | self.specOpChannel.setEnabled(False) | |
5133 | self.specOpHeights.setEnabled(False) |
|
5133 | self.specOpHeights.setEnabled(False) | |
5134 | self.specOpIncoherent.setEnabled(False) |
|
5134 | self.specOpIncoherent.setEnabled(False) | |
5135 | self.specOpgetNoise.setEnabled(False) |
|
5135 | self.specOpgetNoise.setEnabled(False) | |
5136 |
|
5136 | |||
5137 | self.specOpRadarfrequency.clear() |
|
5137 | self.specOpRadarfrequency.clear() | |
5138 | self.specOpnFFTpoints.clear() |
|
5138 | self.specOpnFFTpoints.clear() | |
5139 | self.specOpProfiles.clear() |
|
5139 | self.specOpProfiles.clear() | |
5140 | self.specOpippFactor.clear |
|
5140 | self.specOpippFactor.clear | |
5141 | self.specOppairsList.clear() |
|
5141 | self.specOppairsList.clear() | |
5142 | self.specOpChannel.clear() |
|
5142 | self.specOpChannel.clear() | |
5143 | self.specOpHeights.clear() |
|
5143 | self.specOpHeights.clear() | |
5144 | self.specOpIncoherent.clear() |
|
5144 | self.specOpIncoherent.clear() | |
5145 | self.specOpgetNoise.clear() |
|
5145 | self.specOpgetNoise.clear() | |
5146 |
|
5146 | |||
5147 | self.specGraphCebSpectraplot.setCheckState(0) |
|
5147 | self.specGraphCebSpectraplot.setCheckState(0) | |
5148 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
5148 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
5149 | self.specGraphCebRTIplot.setCheckState(0) |
|
5149 | self.specGraphCebRTIplot.setCheckState(0) | |
5150 | self.specGraphCebRTInoise.setCheckState(0) |
|
5150 | self.specGraphCebRTInoise.setCheckState(0) | |
5151 | self.specGraphCebCoherencmap.setCheckState(0) |
|
5151 | self.specGraphCebCoherencmap.setCheckState(0) | |
5152 | self.specGraphPowerprofile.setCheckState(0) |
|
5152 | self.specGraphPowerprofile.setCheckState(0) | |
5153 |
|
5153 | |||
5154 | self.specGraphSaveSpectra.setCheckState(0) |
|
5154 | self.specGraphSaveSpectra.setCheckState(0) | |
5155 | self.specGraphSaveCross.setCheckState(0) |
|
5155 | self.specGraphSaveCross.setCheckState(0) | |
5156 | self.specGraphSaveRTIplot.setCheckState(0) |
|
5156 | self.specGraphSaveRTIplot.setCheckState(0) | |
5157 | self.specGraphSaveRTInoise.setCheckState(0) |
|
5157 | self.specGraphSaveRTInoise.setCheckState(0) | |
5158 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
5158 | self.specGraphSaveCoherencemap.setCheckState(0) | |
5159 | self.specGraphSavePowerprofile.setCheckState(0) |
|
5159 | self.specGraphSavePowerprofile.setCheckState(0) | |
5160 |
|
5160 | |||
5161 | self.specGraphftpRTIplot.setCheckState(0) |
|
5161 | self.specGraphftpRTIplot.setCheckState(0) | |
5162 | self.specGraphftpRTInoise.setCheckState(0) |
|
5162 | self.specGraphftpRTInoise.setCheckState(0) | |
5163 | self.specGraphftpCoherencemap.setCheckState(0) |
|
5163 | self.specGraphftpCoherencemap.setCheckState(0) | |
5164 |
|
5164 | |||
5165 | self.specGraphPath.clear() |
|
5165 | self.specGraphPath.clear() | |
5166 | self.specGraphPrefix.clear() |
|
5166 | self.specGraphPrefix.clear() | |
5167 |
|
5167 | |||
5168 | self.specGgraphftpratio.clear() |
|
5168 | self.specGgraphftpratio.clear() | |
5169 |
|
5169 | |||
5170 | self.specGgraphChannelList.clear() |
|
5170 | self.specGgraphChannelList.clear() | |
5171 | self.specGgraphFreq.clear() |
|
5171 | self.specGgraphFreq.clear() | |
5172 | self.specGgraphHeight.clear() |
|
5172 | self.specGgraphHeight.clear() | |
5173 | self.specGgraphDbsrange.clear() |
|
5173 | self.specGgraphDbsrange.clear() | |
5174 | self.specGgraphmagnitud.clear() |
|
5174 | self.specGgraphmagnitud.clear() | |
5175 | self.specGgraphTminTmax.clear() |
|
5175 | self.specGgraphTminTmax.clear() | |
5176 | self.specGgraphTimeRange.clear() |
|
5176 | self.specGgraphTimeRange.clear() | |
5177 |
|
5177 | |||
5178 | if datatype == 'SpectraHeis': |
|
5178 | if datatype == 'SpectraHeis': | |
5179 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5179 | self.specHeisOpCebIncoherent.setCheckState(0) | |
5180 | self.specHeisOpIncoherent.setEnabled(False) |
|
5180 | self.specHeisOpIncoherent.setEnabled(False) | |
5181 | self.specHeisOpIncoherent.clear() |
|
5181 | self.specHeisOpIncoherent.clear() | |
5182 |
|
5182 | |||
5183 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5183 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5184 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5184 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5185 |
|
5185 | |||
5186 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5186 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5187 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5187 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5188 |
|
5188 | |||
5189 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5189 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5190 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5190 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5191 |
|
5191 | |||
5192 | self.specHeisGraphPath.clear() |
|
5192 | self.specHeisGraphPath.clear() | |
5193 | self.specHeisGraphPrefix.clear() |
|
5193 | self.specHeisGraphPrefix.clear() | |
5194 | self.specHeisGgraphChannelList.clear() |
|
5194 | self.specHeisGgraphChannelList.clear() | |
5195 | self.specHeisGgraphXminXmax.clear() |
|
5195 | self.specHeisGgraphXminXmax.clear() | |
5196 | self.specHeisGgraphYminYmax.clear() |
|
5196 | self.specHeisGgraphYminYmax.clear() | |
5197 | self.specHeisGgraphTminTmax.clear() |
|
5197 | self.specHeisGgraphTminTmax.clear() | |
5198 | self.specHeisGgraphTimeRange.clear() |
|
5198 | self.specHeisGgraphTimeRange.clear() | |
5199 | self.specHeisGgraphftpratio.clear() |
|
5199 | self.specHeisGgraphftpratio.clear() | |
5200 |
|
5200 | |||
5201 | def showtabPUCreated(self, datatype): |
|
5201 | def showtabPUCreated(self, datatype): | |
5202 |
|
5202 | |||
5203 | if datatype == "Voltage": |
|
5203 | if datatype == "Voltage": | |
5204 | self.tabVoltage.setEnabled(True) |
|
5204 | self.tabVoltage.setEnabled(True) | |
5205 | self.tabProject.setEnabled(False) |
|
5205 | self.tabProject.setEnabled(False) | |
5206 | self.tabSpectra.setEnabled(False) |
|
5206 | self.tabSpectra.setEnabled(False) | |
5207 | self.tabCorrelation.setEnabled(False) |
|
5207 | self.tabCorrelation.setEnabled(False) | |
5208 | self.tabSpectraHeis.setEnabled(False) |
|
5208 | self.tabSpectraHeis.setEnabled(False) | |
5209 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5209 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5210 |
|
5210 | |||
5211 | if datatype == "Spectra": |
|
5211 | if datatype == "Spectra": | |
5212 | self.tabVoltage.setEnabled(False) |
|
5212 | self.tabVoltage.setEnabled(False) | |
5213 | self.tabProject.setEnabled(False) |
|
5213 | self.tabProject.setEnabled(False) | |
5214 | self.tabSpectra.setEnabled(True) |
|
5214 | self.tabSpectra.setEnabled(True) | |
5215 | self.tabCorrelation.setEnabled(False) |
|
5215 | self.tabCorrelation.setEnabled(False) | |
5216 | self.tabSpectraHeis.setEnabled(False) |
|
5216 | self.tabSpectraHeis.setEnabled(False) | |
5217 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5217 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5218 |
|
5218 | |||
5219 | if datatype == "SpectraHeis": |
|
5219 | if datatype == "SpectraHeis": | |
5220 | self.tabVoltage.setEnabled(False) |
|
5220 | self.tabVoltage.setEnabled(False) | |
5221 | self.tabProject.setEnabled(False) |
|
5221 | self.tabProject.setEnabled(False) | |
5222 | self.tabSpectra.setEnabled(False) |
|
5222 | self.tabSpectra.setEnabled(False) | |
5223 | self.tabCorrelation.setEnabled(False) |
|
5223 | self.tabCorrelation.setEnabled(False) | |
5224 | self.tabSpectraHeis.setEnabled(True) |
|
5224 | self.tabSpectraHeis.setEnabled(True) | |
5225 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5225 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5226 |
|
5226 | |||
5227 | def checkInputsProject(self): |
|
5227 | def checkInputsProject(self): | |
5228 | """ |
|
5228 | """ | |
5229 | Check Inputs Project: |
|
5229 | Check Inputs Project: | |
5230 | - project_name |
|
5230 | - project_name | |
5231 | - datatype |
|
5231 | - datatype | |
5232 | - ext |
|
5232 | - ext | |
5233 | - data_path |
|
5233 | - data_path | |
5234 | - readmode |
|
5234 | - readmode | |
5235 | - delay |
|
5235 | - delay | |
5236 | - set |
|
5236 | - set | |
5237 | - walk |
|
5237 | - walk | |
5238 | """ |
|
5238 | """ | |
5239 | parms_ok = True |
|
5239 | parms_ok = True | |
5240 | project_name = str(self.proName.text()) |
|
5240 | project_name = str(self.proName.text()) | |
5241 | if project_name == '' or project_name == None: |
|
5241 | if project_name == '' or project_name == None: | |
5242 | outputstr = "Enter the Project Name" |
|
5242 | outputstr = "Enter the Project Name" | |
5243 | self.console.append(outputstr) |
|
5243 | self.console.append(outputstr) | |
5244 | parms_ok = False |
|
5244 | parms_ok = False | |
5245 | project_name = None |
|
5245 | project_name = None | |
5246 |
|
5246 | |||
5247 | datatype = str(self.proComDataType.currentText()) |
|
5247 | datatype = str(self.proComDataType.currentText()) | |
5248 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5248 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5249 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5249 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5250 | self.console.append(outputstr) |
|
5250 | self.console.append(outputstr) | |
5251 | parms_ok = False |
|
5251 | parms_ok = False | |
5252 | datatype = None |
|
5252 | datatype = None | |
5253 |
|
5253 | |||
5254 | ext = str(self.proDataType.text()) |
|
5254 | ext = str(self.proDataType.text()) | |
5255 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5255 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5256 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5256 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5257 | self.console.append(outputstr) |
|
5257 | self.console.append(outputstr) | |
5258 | parms_ok = False |
|
5258 | parms_ok = False | |
5259 | ext = None |
|
5259 | ext = None | |
5260 |
|
5260 | |||
5261 | data_path = str(self.proDataPath.text()) |
|
5261 | data_path = str(self.proDataPath.text()) | |
5262 |
|
5262 | |||
5263 | if data_path == '': |
|
5263 | if data_path == '': | |
5264 | outputstr = 'Datapath is empty' |
|
5264 | outputstr = 'Datapath is empty' | |
5265 | self.console.append(outputstr) |
|
5265 | self.console.append(outputstr) | |
5266 | parms_ok = False |
|
5266 | parms_ok = False | |
5267 | data_path = None |
|
5267 | data_path = None | |
5268 |
|
5268 | |||
5269 | if data_path != None: |
|
5269 | if data_path != None: | |
5270 | if not os.path.isdir(data_path): |
|
5270 | if not os.path.isdir(data_path): | |
5271 | outputstr = 'Datapath:%s does not exist' % data_path |
|
5271 | outputstr = 'Datapath:%s does not exist' % data_path | |
5272 | self.console.append(outputstr) |
|
5272 | self.console.append(outputstr) | |
5273 | parms_ok = False |
|
5273 | parms_ok = False | |
5274 | data_path = None |
|
5274 | data_path = None | |
5275 |
|
5275 | |||
5276 | read_mode = str(self.proComReadMode.currentText()) |
|
5276 | read_mode = str(self.proComReadMode.currentText()) | |
5277 | if not(read_mode in ['Online', 'Offline']): |
|
5277 | if not(read_mode in ['Online', 'Offline']): | |
5278 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5278 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5279 | self.console.append(outputstr) |
|
5279 | self.console.append(outputstr) | |
5280 | parms_ok = False |
|
5280 | parms_ok = False | |
5281 | read_mode = None |
|
5281 | read_mode = None | |
5282 |
|
5282 | |||
5283 | delay = None |
|
5283 | delay = None | |
5284 | if read_mode == "Online": |
|
5284 | if read_mode == "Online": | |
5285 | parms_ok = False |
|
5285 | parms_ok = False | |
5286 | try: |
|
5286 | try: | |
5287 | delay = int(str(self.proDelay.text())) |
|
5287 | delay = int(str(self.proDelay.text())) | |
5288 | parms_ok = True |
|
5288 | parms_ok = True | |
5289 | except: |
|
5289 | except: | |
5290 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5290 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5291 | self.console.append(outputstr) |
|
5291 | self.console.append(outputstr) | |
5292 |
|
5292 | |||
5293 | try: |
|
5293 | try: | |
5294 | set = int(str(self.proSet.text())) |
|
5294 | set = int(str(self.proSet.text())) | |
5295 | except: |
|
5295 | except: | |
5296 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5296 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5297 | # self.console.append(outputstr) |
|
5297 | # self.console.append(outputstr) | |
5298 | # parms_ok = False |
|
5298 | # parms_ok = False | |
5299 | set = None |
|
5299 | set = None | |
5300 |
|
5300 | |||
5301 | walk = int(self.proComWalk.currentIndex()) |
|
5301 | walk = int(self.proComWalk.currentIndex()) | |
5302 | expLabel = str(self.proExpLabel.text()) |
|
5302 | expLabel = str(self.proExpLabel.text()) | |
5303 |
|
5303 | |||
5304 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5304 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5305 |
|
5305 | |||
5306 | def checkInputsPUSave(self, datatype): |
|
5306 | def checkInputsPUSave(self, datatype): | |
5307 | """ |
|
5307 | """ | |
5308 | Check Inputs Spectra Save: |
|
5308 | Check Inputs Spectra Save: | |
5309 | - path |
|
5309 | - path | |
5310 | - blocks Per File |
|
5310 | - blocks Per File | |
5311 | - sufix |
|
5311 | - sufix | |
5312 | - dataformat |
|
5312 | - dataformat | |
5313 | """ |
|
5313 | """ | |
5314 | parms_ok = True |
|
5314 | parms_ok = True | |
5315 |
|
5315 | |||
5316 | if datatype == "Voltage": |
|
5316 | if datatype == "Voltage": | |
5317 | output_path = str(self.volOutputPath.text()) |
|
5317 | output_path = str(self.volOutputPath.text()) | |
5318 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5318 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5319 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5319 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5320 |
|
5320 | |||
5321 | if datatype == "Spectra": |
|
5321 | if datatype == "Spectra": | |
5322 | output_path = str(self.specOutputPath.text()) |
|
5322 | output_path = str(self.specOutputPath.text()) | |
5323 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5323 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5324 | profilesperblock = 0 |
|
5324 | profilesperblock = 0 | |
5325 |
|
5325 | |||
5326 | if datatype == "SpectraHeis": |
|
5326 | if datatype == "SpectraHeis": | |
5327 | output_path = str(self.specHeisOutputPath.text()) |
|
5327 | output_path = str(self.specHeisOutputPath.text()) | |
5328 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5328 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5329 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5329 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5330 |
|
5330 | |||
5331 | message = '' |
|
5331 | message = '' | |
5332 |
|
5332 | |||
5333 | if not os.path.isdir(output_path): |
|
5333 | if not os.path.isdir(output_path): | |
5334 | message += 'OutputPath:%s does not exist\n' % output_path |
|
5334 | message += 'OutputPath:%s does not exist\n' % output_path | |
5335 | parms_ok = False |
|
5335 | parms_ok = False | |
5336 |
|
5336 | |||
5337 | try: |
|
5337 | try: | |
5338 | profilesperblock = int(profilesperblock) |
|
5338 | profilesperblock = int(profilesperblock) | |
5339 | except: |
|
5339 | except: | |
5340 | if datatype == "Voltage": |
|
5340 | if datatype == "Voltage": | |
5341 | message += 'Profilesperblock: %s, this must be a integer number\n' % str(self.volOutputprofilesperblock.text()) |
|
5341 | message += 'Profilesperblock: %s, this must be a integer number\n' % str(self.volOutputprofilesperblock.text()) | |
5342 | parms_ok = False |
|
5342 | parms_ok = False | |
5343 | profilesperblock = None |
|
5343 | profilesperblock = None | |
5344 |
|
5344 | |||
5345 | try: |
|
5345 | try: | |
5346 | blocksperfile = int(blocksperfile) |
|
5346 | blocksperfile = int(blocksperfile) | |
5347 | except: |
|
5347 | except: | |
5348 | if datatype == "Voltage": |
|
5348 | if datatype == "Voltage": | |
5349 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.volOutputblocksperfile.text()) |
|
5349 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.volOutputblocksperfile.text()) | |
5350 | elif datatype == "Spectra": |
|
5350 | elif datatype == "Spectra": | |
5351 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specOutputblocksperfile.text()) |
|
5351 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specOutputblocksperfile.text()) | |
5352 | elif datatype == "SpectraHeis": |
|
5352 | elif datatype == "SpectraHeis": | |
5353 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specHeisOutputblocksperfile.text()) |
|
5353 | message += 'Blocksperfile: %s, this must be a integer number\n' % str(self.specHeisOutputblocksperfile.text()) | |
5354 |
|
5354 | |||
5355 | parms_ok = False |
|
5355 | parms_ok = False | |
5356 | blocksperfile = None |
|
5356 | blocksperfile = None | |
5357 |
|
5357 | |||
5358 | if datatype == "SpectraHeis": |
|
5358 | if datatype == "SpectraHeis": | |
5359 | if metadata_file != '': |
|
5359 | if metadata_file != '': | |
5360 | if not os.path.isfile(metadata_file): |
|
5360 | if not os.path.isfile(metadata_file): | |
5361 | message += 'Metadata file %s does not exist\n' % metadata_file |
|
5361 | message += 'Metadata file %s does not exist\n' % metadata_file | |
5362 | parms_ok = False |
|
5362 | parms_ok = False | |
5363 |
|
5363 | |||
5364 | if str.strip(output_path) != '': |
|
5364 | if str.strip(output_path) != '': | |
5365 | self.console.append(message) |
|
5365 | self.console.append(message) | |
5366 |
|
5366 | |||
5367 | if datatype == "Voltage": |
|
5367 | if datatype == "Voltage": | |
5368 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5368 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5369 |
|
5369 | |||
5370 |
|
5370 | |||
5371 | if datatype == "Spectra": |
|
5371 | if datatype == "Spectra": | |
5372 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5372 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5373 |
|
5373 | |||
5374 |
|
5374 | |||
5375 | if datatype == "SpectraHeis": |
|
5375 | if datatype == "SpectraHeis": | |
5376 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5376 | return parms_ok, output_path, blocksperfile, metadata_file | |
5377 |
|
5377 | |||
5378 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5378 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5379 |
|
5379 | |||
5380 | dateList = [] |
|
5380 | dateList = [] | |
5381 | fileList = [] |
|
5381 | fileList = [] | |
5382 |
|
5382 | |||
5383 | if ext == ".r": |
|
5383 | if ext == ".r": | |
5384 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5384 | from schainpy.model.io.jroIO_base import JRODataReader | |
5385 |
|
5385 | |||
5386 | readerObj = JRODataReader() |
|
5386 | readerObj = JRODataReader() | |
5387 | dateList = readerObj.findDatafiles(path=data_path, |
|
5387 | dateList = readerObj.findDatafiles(path=data_path, | |
5388 | expLabel=expLabel, |
|
5388 | expLabel=expLabel, | |
5389 | ext=ext, |
|
5389 | ext=ext, | |
5390 | walk=walk) |
|
5390 | walk=walk) | |
5391 |
|
5391 | |||
5392 | if ext == ".pdata": |
|
5392 | if ext == ".pdata": | |
5393 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5393 | from schainpy.model.io.jroIO_base import JRODataReader | |
5394 |
|
5394 | |||
5395 | readerObj = JRODataReader() |
|
5395 | readerObj = JRODataReader() | |
5396 | dateList = readerObj.findDatafiles(path=data_path, |
|
5396 | dateList = readerObj.findDatafiles(path=data_path, | |
5397 | expLabel=expLabel, |
|
5397 | expLabel=expLabel, | |
5398 | ext=ext, |
|
5398 | ext=ext, | |
5399 | walk=walk) |
|
5399 | walk=walk) | |
5400 |
|
5400 | |||
5401 | if ext == ".fits": |
|
5401 | if ext == ".fits": | |
5402 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5402 | from schainpy.model.io.jroIO_base import JRODataReader | |
5403 |
|
5403 | |||
5404 | readerObj = JRODataReader() |
|
5404 | readerObj = JRODataReader() | |
5405 | dateList = readerObj.findDatafiles(path=data_path, |
|
5405 | dateList = readerObj.findDatafiles(path=data_path, | |
5406 | expLabel=expLabel, |
|
5406 | expLabel=expLabel, | |
5407 | ext=ext, |
|
5407 | ext=ext, | |
5408 | walk=walk) |
|
5408 | walk=walk) | |
5409 |
|
5409 | |||
5410 | if ext == ".hdf5": |
|
5410 | if ext == ".hdf5": | |
5411 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5411 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5412 |
|
5412 | |||
5413 | readerObj = USRPReader() |
|
5413 | readerObj = USRPReader() | |
5414 | dateList = readerObj.findDatafiles(path=data_path) |
|
5414 | dateList = readerObj.findDatafiles(path=data_path) | |
5415 |
|
5415 | |||
5416 | return dateList |
|
5416 | return dateList | |
5417 |
|
5417 | |||
5418 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5418 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5419 | """ |
|
5419 | """ | |
5420 | Method to loads day |
|
5420 | Method to loads day | |
5421 | """ |
|
5421 | """ | |
5422 | # self._disable_save_button() |
|
5422 | # self._disable_save_button() | |
5423 | # self._disable_play_button() |
|
5423 | # self._disable_play_button() | |
5424 | # self.proOk.setEnabled(False) |
|
5424 | # self.proOk.setEnabled(False) | |
5425 |
|
5425 | |||
5426 | self.proComStartDate.clear() |
|
5426 | self.proComStartDate.clear() | |
5427 | self.proComEndDate.clear() |
|
5427 | self.proComEndDate.clear() | |
5428 |
|
5428 | |||
5429 | self.dateList = [] |
|
5429 | self.dateList = [] | |
5430 |
|
5430 | |||
5431 | if not data_path: |
|
5431 | if not data_path: | |
5432 | self.console.append("Datapath has not been set") |
|
5432 | self.console.append("Datapath has not been set") | |
5433 | return [] |
|
5433 | return [] | |
5434 |
|
5434 | |||
5435 | if not os.path.isdir(data_path): |
|
5435 | if not os.path.isdir(data_path): | |
5436 | self.console.append("Directory %s does not exist" %data_path) |
|
5436 | self.console.append("Directory %s does not exist" %data_path) | |
5437 | return [] |
|
5437 | return [] | |
5438 |
|
5438 | |||
5439 | self.dataPath = data_path |
|
5439 | self.dataPath = data_path | |
5440 |
|
5440 | |||
5441 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5441 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5442 |
|
5442 | |||
5443 | if not dateList: |
|
5443 | if not dateList: | |
5444 | # self.console.clear() |
|
5444 | # self.console.clear() | |
5445 | if walk: |
|
5445 | if walk: | |
5446 | if expLabel: |
|
5446 | if expLabel: | |
5447 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5447 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5448 | else: |
|
5448 | else: | |
5449 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5449 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5450 | else: |
|
5450 | else: | |
5451 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5451 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5452 |
|
5452 | |||
5453 | self.console.append(outputstr) |
|
5453 | self.console.append(outputstr) | |
5454 | return [] |
|
5454 | return [] | |
5455 |
|
5455 | |||
5456 | dateStrList = [] |
|
5456 | dateStrList = [] | |
5457 | for thisDate in dateList: |
|
5457 | for thisDate in dateList: | |
5458 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5458 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5459 |
|
5459 | |||
5460 | self.proComStartDate.addItem(dateStr) |
|
5460 | self.proComStartDate.addItem(dateStr) | |
5461 | self.proComEndDate.addItem(dateStr) |
|
5461 | self.proComEndDate.addItem(dateStr) | |
5462 | dateStrList.append(dateStr) |
|
5462 | dateStrList.append(dateStr) | |
5463 |
|
5463 | |||
5464 | self.proComStartDate.setCurrentIndex(0) |
|
5464 | self.proComStartDate.setCurrentIndex(0) | |
5465 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5465 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5466 |
|
5466 | |||
5467 | self.dateList = dateStrList |
|
5467 | self.dateList = dateStrList | |
5468 |
|
5468 | |||
5469 | self.console.clear() |
|
5469 | self.console.clear() | |
5470 | self.console.append("Successful load") |
|
5470 | self.console.append("Successful load") | |
5471 |
|
5471 | |||
5472 | # self.proOk.setEnabled(True) |
|
5472 | # self.proOk.setEnabled(True) | |
5473 | # self._enable_play_button() |
|
5473 | # self._enable_play_button() | |
5474 | # self._enable_save_button() |
|
5474 | # self._enable_save_button() | |
5475 |
|
5475 | |||
5476 | return self.dateList |
|
5476 | return self.dateList | |
5477 |
|
5477 | |||
5478 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5478 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5479 |
|
5479 | |||
5480 | if pathWorkSpace == None: |
|
5480 | if pathWorkSpace == None: | |
5481 | home = os.path.expanduser("~") |
|
5481 | home = os.path.expanduser("~") | |
5482 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5482 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5483 |
|
5483 | |||
5484 | self.pathWorkSpace = pathWorkSpace |
|
5484 | self.pathWorkSpace = pathWorkSpace | |
5485 |
|
5485 | |||
5486 | """ |
|
5486 | """ | |
5487 | Comandos Usados en Console |
|
5487 | Comandos Usados en Console | |
5488 | """ |
|
5488 | """ | |
5489 | def __del__(self): |
|
5489 | def __del__(self): | |
5490 | sys.stdout = sys.__stdout__ |
|
5490 | sys.stdout = sys.__stdout__ | |
5491 | sys.stderr = sys.__stderr__ |
|
5491 | sys.stderr = sys.__stderr__ | |
5492 |
|
5492 | |||
5493 | def normalOutputWritten(self, text): |
|
5493 | def normalOutputWritten(self, text): | |
5494 | color_black = QtGui.QColor(0,0,0) |
|
5494 | color_black = QtGui.QColor(0,0,0) | |
5495 | self.console.setTextColor(color_black) |
|
5495 | self.console.setTextColor(color_black) | |
5496 | self.console.append(text) |
|
5496 | self.console.append(text) | |
5497 |
|
5497 | |||
5498 | def errorOutputWritten(self, text): |
|
5498 | def errorOutputWritten(self, text): | |
5499 | color_red = QtGui.QColor(255,0,0) |
|
5499 | color_red = QtGui.QColor(255,0,0) | |
5500 | color_black = QtGui.QColor(0,0,0) |
|
5500 | color_black = QtGui.QColor(0,0,0) | |
5501 |
|
5501 | |||
5502 | self.console.setTextColor(color_red) |
|
5502 | self.console.setTextColor(color_red) | |
5503 | self.console.append(text) |
|
5503 | self.console.append(text) | |
5504 | self.console.setTextColor(color_black) |
|
5504 | self.console.setTextColor(color_black) | |
5505 |
|
5505 | |||
5506 | def _enable_save_button(self): |
|
5506 | def _enable_save_button(self): | |
5507 |
|
5507 | |||
5508 | self.actionSaveToolbar.setEnabled(True) |
|
5508 | self.actionSaveToolbar.setEnabled(True) | |
5509 | self.actionSave.setEnabled(True) |
|
5509 | self.actionSave.setEnabled(True) | |
5510 |
|
5510 | |||
5511 | def _disable_save_button(self): |
|
5511 | def _disable_save_button(self): | |
5512 |
|
5512 | |||
5513 | self.actionSaveToolbar.setEnabled(False) |
|
5513 | self.actionSaveToolbar.setEnabled(False) | |
5514 | self.actionSave.setEnabled(False) |
|
5514 | self.actionSave.setEnabled(False) | |
5515 |
|
5515 | |||
5516 | def _enable_play_button(self): |
|
5516 | def _enable_play_button(self): | |
5517 |
|
5517 | |||
5518 | if self.controllerThread: |
|
5518 | if self.controllerThread: | |
5519 | if self.controllerThread.isRunning(): |
|
5519 | if self.controllerThread.isRunning(): | |
5520 | return |
|
5520 | return | |
5521 |
|
5521 | |||
5522 | self.actionStart.setEnabled(True) |
|
5522 | self.actionStart.setEnabled(True) | |
5523 | self.actionStarToolbar.setEnabled(True) |
|
5523 | self.actionStarToolbar.setEnabled(True) | |
5524 |
|
5524 | |||
5525 | self.changeStartIcon(started=False) |
|
5525 | self.changeStartIcon(started=False) | |
5526 |
|
5526 | |||
5527 | def _disable_play_button(self): |
|
5527 | def _disable_play_button(self): | |
5528 |
|
5528 | |||
5529 | self.actionStart.setEnabled(False) |
|
5529 | self.actionStart.setEnabled(False) | |
5530 | self.actionStarToolbar.setEnabled(False) |
|
5530 | self.actionStarToolbar.setEnabled(False) | |
5531 |
|
5531 | |||
5532 | self.changeStartIcon(started=True) |
|
5532 | self.changeStartIcon(started=True) | |
5533 |
|
5533 | |||
5534 | def _enable_stop_button(self): |
|
5534 | def _enable_stop_button(self): | |
5535 |
|
5535 | |||
5536 | self.actionPause.setEnabled(True) |
|
5536 | self.actionPause.setEnabled(True) | |
5537 | self.actionStop.setEnabled(True) |
|
5537 | self.actionStop.setEnabled(True) | |
5538 |
|
5538 | |||
5539 | self.actionPauseToolbar.setEnabled(True) |
|
5539 | self.actionPauseToolbar.setEnabled(True) | |
5540 | self.actionStopToolbar.setEnabled(True) |
|
5540 | self.actionStopToolbar.setEnabled(True) | |
5541 |
|
5541 | |||
5542 | self.changePauseIcon(paused=False) |
|
5542 | self.changePauseIcon(paused=False) | |
5543 | self.changeStopIcon(started=True) |
|
5543 | self.changeStopIcon(started=True) | |
5544 |
|
5544 | |||
5545 | def _disable_stop_button(self): |
|
5545 | def _disable_stop_button(self): | |
5546 |
|
5546 | |||
5547 | self.actionPause.setEnabled(False) |
|
5547 | self.actionPause.setEnabled(False) | |
5548 | self.actionStop.setEnabled(False) |
|
5548 | self.actionStop.setEnabled(False) | |
5549 |
|
5549 | |||
5550 | self.actionPauseToolbar.setEnabled(False) |
|
5550 | self.actionPauseToolbar.setEnabled(False) | |
5551 | self.actionStopToolbar.setEnabled(False) |
|
5551 | self.actionStopToolbar.setEnabled(False) | |
5552 |
|
5552 | |||
5553 | self.changePauseIcon(paused=False) |
|
5553 | self.changePauseIcon(paused=False) | |
5554 | self.changeStopIcon(started=False) |
|
5554 | self.changeStopIcon(started=False) | |
5555 |
|
5555 | |||
5556 | def setGUIStatus(self): |
|
5556 | def setGUIStatus(self): | |
5557 |
|
5557 | |||
5558 | self.setWindowTitle("ROJ-Signal Chain") |
|
5558 | self.setWindowTitle("ROJ-Signal Chain") | |
5559 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5559 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5560 |
|
5560 | |||
5561 | self.tabWidgetProject.setEnabled(False) |
|
5561 | self.tabWidgetProject.setEnabled(False) | |
5562 | self.tabVoltage.setEnabled(False) |
|
5562 | self.tabVoltage.setEnabled(False) | |
5563 | self.tabSpectra.setEnabled(False) |
|
5563 | self.tabSpectra.setEnabled(False) | |
5564 | self.tabCorrelation.setEnabled(False) |
|
5564 | self.tabCorrelation.setEnabled(False) | |
5565 | self.frame_2.setEnabled(False) |
|
5565 | self.frame_2.setEnabled(False) | |
5566 |
|
5566 | |||
5567 | self.actionCreate.setShortcut('Ctrl+N') |
|
5567 | self.actionCreate.setShortcut('Ctrl+N') | |
5568 | self.actionOpen.setShortcut('Ctrl+O') |
|
5568 | self.actionOpen.setShortcut('Ctrl+O') | |
5569 | self.actionSave.setShortcut('Ctrl+S') |
|
5569 | self.actionSave.setShortcut('Ctrl+S') | |
5570 | self.actionClose.setShortcut('Ctrl+X') |
|
5570 | self.actionClose.setShortcut('Ctrl+X') | |
5571 |
|
5571 | |||
5572 | self.actionStart.setShortcut('Ctrl+1') |
|
5572 | self.actionStart.setShortcut('Ctrl+1') | |
5573 | self.actionPause.setShortcut('Ctrl+2') |
|
5573 | self.actionPause.setShortcut('Ctrl+2') | |
5574 | self.actionStop.setShortcut('Ctrl+3') |
|
5574 | self.actionStop.setShortcut('Ctrl+3') | |
5575 |
|
5575 | |||
5576 | self.actionFTP.setShortcut('Ctrl+F') |
|
5576 | self.actionFTP.setShortcut('Ctrl+F') | |
5577 |
|
5577 | |||
5578 | self.actionStart.setEnabled(False) |
|
5578 | self.actionStart.setEnabled(False) | |
5579 | self.actionPause.setEnabled(False) |
|
5579 | self.actionPause.setEnabled(False) | |
5580 | self.actionStop.setEnabled(False) |
|
5580 | self.actionStop.setEnabled(False) | |
5581 |
|
5581 | |||
5582 | self.actionStarToolbar.setEnabled(False) |
|
5582 | self.actionStarToolbar.setEnabled(False) | |
5583 | self.actionPauseToolbar.setEnabled(False) |
|
5583 | self.actionPauseToolbar.setEnabled(False) | |
5584 | self.actionStopToolbar.setEnabled(False) |
|
5584 | self.actionStopToolbar.setEnabled(False) | |
5585 |
|
5585 | |||
5586 | self.proName.clear() |
|
5586 | self.proName.clear() | |
5587 | self.proDataPath.setText('') |
|
5587 | self.proDataPath.setText('') | |
5588 | self.console.setReadOnly(True) |
|
5588 | self.console.setReadOnly(True) | |
5589 | self.console.append("Welcome to Signal Chain\n\n") |
|
5589 | self.console.append("Welcome to Signal Chain\n\n") | |
5590 | self.console.append("Open a project or Create a new one\n") |
|
5590 | self.console.append("Open a project or Create a new one\n") | |
5591 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5591 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5592 | self.proDataType.setEnabled(False) |
|
5592 | self.proDataType.setEnabled(False) | |
5593 | self.time = QtCore.QTime() |
|
5593 | self.time = QtCore.QTime() | |
5594 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5594 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5595 | startTime = "00:00:00" |
|
5595 | startTime = "00:00:00" | |
5596 | endTime = "23:59:59" |
|
5596 | endTime = "23:59:59" | |
5597 | starlist = startTime.split(":") |
|
5597 | starlist = startTime.split(":") | |
5598 | endlist = endTime.split(":") |
|
5598 | endlist = endTime.split(":") | |
5599 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5599 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5600 | self.proStartTime.setTime(self.time) |
|
5600 | self.proStartTime.setTime(self.time) | |
5601 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5601 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5602 | self.proEndTime.setTime(self.time) |
|
5602 | self.proEndTime.setTime(self.time) | |
5603 | self.proOk.setEnabled(False) |
|
5603 | self.proOk.setEnabled(False) | |
5604 | # set model Project Explorer |
|
5604 | # set model Project Explorer | |
5605 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5605 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5606 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5606 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5607 | layout = QtGui.QVBoxLayout() |
|
5607 | layout = QtGui.QVBoxLayout() | |
5608 | layout.addWidget(self.projectExplorerTree) |
|
5608 | layout.addWidget(self.projectExplorerTree) | |
5609 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5609 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5610 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5610 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5611 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5611 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5612 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5612 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5613 | self.projectExplorerTree.expandAll() |
|
5613 | self.projectExplorerTree.expandAll() | |
5614 | # set model Project Properties |
|
5614 | # set model Project Properties | |
5615 |
|
5615 | |||
5616 | self.propertiesModel = TreeModel() |
|
5616 | self.propertiesModel = TreeModel() | |
5617 | self.propertiesModel.initProjectView() |
|
5617 | self.propertiesModel.initProjectView() | |
5618 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5618 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5619 | self.treeProjectProperties.expandAll() |
|
5619 | self.treeProjectProperties.expandAll() | |
5620 | self.treeProjectProperties.allColumnsShowFocus() |
|
5620 | self.treeProjectProperties.allColumnsShowFocus() | |
5621 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5621 | self.treeProjectProperties.resizeColumnToContents(1) | |
5622 |
|
5622 | |||
5623 | # set Project |
|
5623 | # set Project | |
5624 | self.pronTxs.setEnabled(False) |
|
5624 | self.pronTxs.setEnabled(False) | |
5625 | self.proComByBlock.setEnabled(False) |
|
5625 | self.proComByBlock.setEnabled(False) | |
5626 | self.proExpLabel.setEnabled(False) |
|
5626 | self.proExpLabel.setEnabled(False) | |
5627 | self.proDelay.setEnabled(False) |
|
5627 | self.proDelay.setEnabled(False) | |
5628 | self.proSet.setEnabled(True) |
|
5628 | self.proSet.setEnabled(True) | |
5629 | self.proDataType.setReadOnly(True) |
|
5629 | self.proDataType.setReadOnly(True) | |
5630 |
|
5630 | |||
5631 | # set Operation Voltage |
|
5631 | # set Operation Voltage | |
5632 | self.volOpComChannels.setEnabled(False) |
|
5632 | self.volOpComChannels.setEnabled(False) | |
5633 | self.volOpComHeights.setEnabled(False) |
|
5633 | self.volOpComHeights.setEnabled(False) | |
5634 | self.volOpFilter.setEnabled(False) |
|
5634 | self.volOpFilter.setEnabled(False) | |
5635 | self.volOpComProfile.setEnabled(False) |
|
5635 | self.volOpComProfile.setEnabled(False) | |
5636 | self.volOpComCode.setEnabled(False) |
|
5636 | self.volOpComCode.setEnabled(False) | |
5637 | self.volOpFlip.setEnabled(False) |
|
5637 | self.volOpFlip.setEnabled(False) | |
5638 | self.volOpCohInt.setEnabled(False) |
|
5638 | self.volOpCohInt.setEnabled(False) | |
5639 | self.volOpRadarfrequency.setEnabled(False) |
|
5639 | self.volOpRadarfrequency.setEnabled(False) | |
5640 |
|
5640 | |||
5641 | self.volOpChannel.setEnabled(False) |
|
5641 | self.volOpChannel.setEnabled(False) | |
5642 | self.volOpHeights.setEnabled(False) |
|
5642 | self.volOpHeights.setEnabled(False) | |
5643 | self.volOpProfile.setEnabled(False) |
|
5643 | self.volOpProfile.setEnabled(False) | |
5644 | self.volOpComMode.setEnabled(False) |
|
5644 | self.volOpComMode.setEnabled(False) | |
5645 |
|
5645 | |||
5646 | self.volOpReshaper.setEnabled(False) |
|
5646 | self.volOpReshaper.setEnabled(False) | |
5647 | self.volOpAdjustHei.setEnabled(False) |
|
5647 | self.volOpAdjustHei.setEnabled(False) | |
5648 |
|
5648 | |||
5649 | self.volOpCebReshaper.setEnabled(False) |
|
5649 | self.volOpCebReshaper.setEnabled(False) | |
5650 | self.volOpCebAdjustHei.setEnabled(False) |
|
5650 | self.volOpCebAdjustHei.setEnabled(False) | |
5651 |
|
5651 | |||
5652 | self.volGraphPath.setEnabled(False) |
|
5652 | self.volGraphPath.setEnabled(False) | |
5653 | self.volGraphPrefix.setEnabled(False) |
|
5653 | self.volGraphPrefix.setEnabled(False) | |
5654 | self.volGraphToolPath.setEnabled(False) |
|
5654 | self.volGraphToolPath.setEnabled(False) | |
5655 |
|
5655 | |||
5656 | # set Graph Voltage |
|
5656 | # set Graph Voltage | |
5657 | self.volGraphChannelList.setEnabled(False) |
|
5657 | self.volGraphChannelList.setEnabled(False) | |
5658 | self.volGraphIntensityRange.setEnabled(False) |
|
5658 | self.volGraphIntensityRange.setEnabled(False) | |
5659 | self.volGraphHeightrange.setEnabled(False) |
|
5659 | self.volGraphHeightrange.setEnabled(False) | |
5660 |
|
5660 | |||
5661 | # set Operation Spectra |
|
5661 | # set Operation Spectra | |
5662 | self.specOpnFFTpoints.setEnabled(False) |
|
5662 | self.specOpnFFTpoints.setEnabled(False) | |
5663 | self.specOpProfiles.setEnabled(False) |
|
5663 | self.specOpProfiles.setEnabled(False) | |
5664 | self.specOpippFactor.setEnabled(False) |
|
5664 | self.specOpippFactor.setEnabled(False) | |
5665 | self.specOppairsList.setEnabled(False) |
|
5665 | self.specOppairsList.setEnabled(False) | |
5666 |
|
5666 | |||
5667 | self.specOpComCrossSpectra.setEnabled(False) |
|
5667 | self.specOpComCrossSpectra.setEnabled(False) | |
5668 | self.specOpComChannel.setEnabled(False) |
|
5668 | self.specOpComChannel.setEnabled(False) | |
5669 | self.specOpComHeights.setEnabled(False) |
|
5669 | self.specOpComHeights.setEnabled(False) | |
5670 | self.specOpIncoherent.setEnabled(False) |
|
5670 | self.specOpIncoherent.setEnabled(False) | |
5671 | self.specOpgetNoise.setEnabled(False) |
|
5671 | self.specOpgetNoise.setEnabled(False) | |
5672 | self.specOpRadarfrequency.setEnabled(False) |
|
5672 | self.specOpRadarfrequency.setEnabled(False) | |
5673 |
|
5673 | |||
5674 |
|
5674 | |||
5675 | self.specOpChannel.setEnabled(False) |
|
5675 | self.specOpChannel.setEnabled(False) | |
5676 | self.specOpHeights.setEnabled(False) |
|
5676 | self.specOpHeights.setEnabled(False) | |
5677 | # set Graph Spectra |
|
5677 | # set Graph Spectra | |
5678 | self.specGgraphChannelList.setEnabled(False) |
|
5678 | self.specGgraphChannelList.setEnabled(False) | |
5679 | self.specGgraphFreq.setEnabled(False) |
|
5679 | self.specGgraphFreq.setEnabled(False) | |
5680 | self.specGgraphHeight.setEnabled(False) |
|
5680 | self.specGgraphHeight.setEnabled(False) | |
5681 | self.specGgraphDbsrange.setEnabled(False) |
|
5681 | self.specGgraphDbsrange.setEnabled(False) | |
5682 | self.specGgraphmagnitud.setEnabled(False) |
|
5682 | self.specGgraphmagnitud.setEnabled(False) | |
5683 | self.specGgraphTminTmax.setEnabled(False) |
|
5683 | self.specGgraphTminTmax.setEnabled(False) | |
5684 | self.specGgraphTimeRange.setEnabled(False) |
|
5684 | self.specGgraphTimeRange.setEnabled(False) | |
5685 | self.specGraphPath.setEnabled(False) |
|
5685 | self.specGraphPath.setEnabled(False) | |
5686 | self.specGraphToolPath.setEnabled(False) |
|
5686 | self.specGraphToolPath.setEnabled(False) | |
5687 | self.specGraphPrefix.setEnabled(False) |
|
5687 | self.specGraphPrefix.setEnabled(False) | |
5688 |
|
5688 | |||
5689 | self.specGgraphftpratio.setEnabled(False) |
|
5689 | self.specGgraphftpratio.setEnabled(False) | |
5690 | # set Operation SpectraHeis |
|
5690 | # set Operation SpectraHeis | |
5691 | self.specHeisOpIncoherent.setEnabled(False) |
|
5691 | self.specHeisOpIncoherent.setEnabled(False) | |
5692 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5692 | self.specHeisOpCobIncInt.setEnabled(False) | |
5693 | # set Graph SpectraHeis |
|
5693 | # set Graph SpectraHeis | |
5694 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5694 | self.specHeisGgraphChannelList.setEnabled(False) | |
5695 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5695 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5696 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5696 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5697 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5697 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5698 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5698 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5699 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5699 | self.specHeisGgraphftpratio.setEnabled(False) | |
5700 | self.specHeisGraphPath.setEnabled(False) |
|
5700 | self.specHeisGraphPath.setEnabled(False) | |
5701 | self.specHeisGraphPrefix.setEnabled(False) |
|
5701 | self.specHeisGraphPrefix.setEnabled(False) | |
5702 | self.specHeisGraphToolPath.setEnabled(False) |
|
5702 | self.specHeisGraphToolPath.setEnabled(False) | |
5703 |
|
5703 | |||
5704 | self.proComWalk.setCurrentIndex(0) |
|
5704 | self.proComWalk.setCurrentIndex(0) | |
5705 |
|
5705 | |||
5706 | # tool tip gui |
|
5706 | # tool tip gui | |
5707 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5707 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5708 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5708 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5709 | # tool tip gui project |
|
5709 | # tool tip gui project | |
5710 |
|
5710 | |||
5711 | # tool tip gui volOp |
|
5711 | # tool tip gui volOp | |
5712 | # self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5712 | # self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5713 | # self.volOpHeights.setToolTip('Example: 90,180') |
|
5713 | # self.volOpHeights.setToolTip('Example: 90,180') | |
5714 | # self.volOpFilter.setToolTip('Example: 2') |
|
5714 | # self.volOpFilter.setToolTip('Example: 2') | |
5715 | # self.volOpProfile.setToolTip('Example:0,127') |
|
5715 | # self.volOpProfile.setToolTip('Example:0,127') | |
5716 | # self.volOpCohInt.setToolTip('Example: 128') |
|
5716 | # self.volOpCohInt.setToolTip('Example: 128') | |
5717 | # self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5717 | # self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5718 | # self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5718 | # self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5719 | # # tool tip gui volGraph |
|
5719 | # # tool tip gui volGraph | |
5720 | # self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') |
|
5720 | # self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') | |
5721 | # self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5721 | # self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5722 | # tool tip gui specOp |
|
5722 | # tool tip gui specOp | |
5723 | # self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5723 | # self.specOpnFFTpoints.setToolTip('Example: 128') | |
5724 | # self.specOpProfiles.setToolTip('Example: 128') |
|
5724 | # self.specOpProfiles.setToolTip('Example: 128') | |
5725 | # self.specOpippFactor.setToolTip('Example:1.0') |
|
5725 | # self.specOpippFactor.setToolTip('Example:1.0') | |
5726 | # self.specOpIncoherent.setToolTip('Example: 10') |
|
5726 | # self.specOpIncoherent.setToolTip('Example: 10') | |
5727 | # self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5727 | # self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5728 | # |
|
5728 | # | |
5729 | # self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5729 | # self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5730 | # self.specOpHeights.setToolTip('Example: 90,180') |
|
5730 | # self.specOpHeights.setToolTip('Example: 90,180') | |
5731 | # self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5731 | # self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5732 | # # tool tip gui specGraph |
|
5732 | # # tool tip gui specGraph | |
5733 | # |
|
5733 | # | |
5734 | # self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5734 | # self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5735 | # self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5735 | # self.specGgraphFreq.setToolTip('Example: -20,20') | |
5736 | # self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5736 | # self.specGgraphHeight.setToolTip('Example: 100,400') | |
5737 | # self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5737 | # self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5738 | # |
|
5738 | # | |
5739 | # self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5739 | # self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5740 | # |
|
5740 | # | |
5741 | # |
|
5741 | # | |
5742 | # self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5742 | # self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5743 | # |
|
5743 | # | |
5744 | # self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5744 | # self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5745 | # self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5745 | # self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5746 | # self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5746 | # self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5747 | # self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5747 | # self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5748 | # self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5748 | # self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5749 |
|
5749 | |||
5750 | self.labelSet.show() |
|
5750 | self.labelSet.show() | |
5751 | self.proSet.show() |
|
5751 | self.proSet.show() | |
5752 |
|
5752 | |||
5753 | self.labelIPPKm.hide() |
|
5753 | self.labelIPPKm.hide() | |
5754 | self.proIPPKm.hide() |
|
5754 | self.proIPPKm.hide() | |
5755 |
|
5755 | |||
5756 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5756 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5757 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5757 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5758 |
|
5758 | |||
5759 |
|
5759 | |||
5760 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5760 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5761 | """ |
|
5761 | """ | |
5762 | Class documentation goes here. |
|
5762 | Class documentation goes here. | |
5763 | """ |
|
5763 | """ | |
5764 | closed = pyqtSignal() |
|
5764 | closed = pyqtSignal() | |
5765 | create = False |
|
5765 | create = False | |
5766 |
|
5766 | |||
5767 | def __init__(self, parent=None): |
|
5767 | def __init__(self, parent=None): | |
5768 | """ |
|
5768 | """ | |
5769 | Constructor |
|
5769 | Constructor | |
5770 | """ |
|
5770 | """ | |
5771 | QMainWindow.__init__(self, parent) |
|
5771 | QMainWindow.__init__(self, parent) | |
5772 | self.setupUi(self) |
|
5772 | self.setupUi(self) | |
5773 | self.getFromWindow = None |
|
5773 | self.getFromWindow = None | |
5774 | self.getfromWindowList = [] |
|
5774 | self.getfromWindowList = [] | |
5775 | self.dataTypeProject = None |
|
5775 | self.dataTypeProject = None | |
5776 |
|
5776 | |||
5777 | self.listUP = None |
|
5777 | self.listUP = None | |
5778 |
|
5778 | |||
5779 | @pyqtSignature("") |
|
5779 | @pyqtSignature("") | |
5780 | def on_unitPokbut_clicked(self): |
|
5780 | def on_unitPokbut_clicked(self): | |
5781 | """ |
|
5781 | """ | |
5782 | Slot documentation goes here. |
|
5782 | Slot documentation goes here. | |
5783 | """ |
|
5783 | """ | |
5784 | self.create = True |
|
5784 | self.create = True | |
5785 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5785 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5786 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5786 | # self.nameofUP= str(self.nameUptxt.text()) | |
5787 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5787 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5788 | self.close() |
|
5788 | self.close() | |
5789 |
|
5789 | |||
5790 |
|
5790 | |||
5791 | @pyqtSignature("") |
|
5791 | @pyqtSignature("") | |
5792 | def on_unitPcancelbut_clicked(self): |
|
5792 | def on_unitPcancelbut_clicked(self): | |
5793 | """ |
|
5793 | """ | |
5794 | Slot documentation goes here. |
|
5794 | Slot documentation goes here. | |
5795 | """ |
|
5795 | """ | |
5796 | self.create = False |
|
5796 | self.create = False | |
5797 | self.close() |
|
5797 | self.close() | |
5798 |
|
5798 | |||
5799 | def loadTotalList(self): |
|
5799 | def loadTotalList(self): | |
5800 | self.comboInputBox.clear() |
|
5800 | self.comboInputBox.clear() | |
5801 | for i in self.getfromWindowList: |
|
5801 | for i in self.getfromWindowList: | |
5802 |
|
5802 | |||
5803 | name = i.getElementName() |
|
5803 | name = i.getElementName() | |
5804 | if name == 'Project': |
|
5804 | if name == 'Project': | |
5805 | id = i.id |
|
5805 | id = i.id | |
5806 | name = i.name |
|
5806 | name = i.name | |
5807 | if self.dataTypeProject == 'Voltage': |
|
5807 | if self.dataTypeProject == 'Voltage': | |
5808 | self.comboTypeBox.clear() |
|
5808 | self.comboTypeBox.clear() | |
5809 | self.comboTypeBox.addItem("Voltage") |
|
5809 | self.comboTypeBox.addItem("Voltage") | |
5810 |
|
5810 | |||
5811 | if self.dataTypeProject == 'Spectra': |
|
5811 | if self.dataTypeProject == 'Spectra': | |
5812 | self.comboTypeBox.clear() |
|
5812 | self.comboTypeBox.clear() | |
5813 | self.comboTypeBox.addItem("Spectra") |
|
5813 | self.comboTypeBox.addItem("Spectra") | |
5814 | self.comboTypeBox.addItem("Correlation") |
|
5814 | self.comboTypeBox.addItem("Correlation") | |
5815 | if self.dataTypeProject == 'Fits': |
|
5815 | if self.dataTypeProject == 'Fits': | |
5816 | self.comboTypeBox.clear() |
|
5816 | self.comboTypeBox.clear() | |
5817 | self.comboTypeBox.addItem("SpectraHeis") |
|
5817 | self.comboTypeBox.addItem("SpectraHeis") | |
5818 |
|
5818 | |||
5819 |
|
5819 | |||
5820 | if name == 'ProcUnit': |
|
5820 | if name == 'ProcUnit': | |
5821 | id = int(i.id) - 1 |
|
5821 | id = int(i.id) - 1 | |
5822 | name = i.datatype |
|
5822 | name = i.datatype | |
5823 | if name == 'Voltage': |
|
5823 | if name == 'Voltage': | |
5824 | self.comboTypeBox.clear() |
|
5824 | self.comboTypeBox.clear() | |
5825 | self.comboTypeBox.addItem("Spectra") |
|
5825 | self.comboTypeBox.addItem("Spectra") | |
5826 | self.comboTypeBox.addItem("SpectraHeis") |
|
5826 | self.comboTypeBox.addItem("SpectraHeis") | |
5827 | self.comboTypeBox.addItem("Correlation") |
|
5827 | self.comboTypeBox.addItem("Correlation") | |
5828 | if name == 'Spectra': |
|
5828 | if name == 'Spectra': | |
5829 | self.comboTypeBox.clear() |
|
5829 | self.comboTypeBox.clear() | |
5830 | self.comboTypeBox.addItem("Spectra") |
|
5830 | self.comboTypeBox.addItem("Spectra") | |
5831 | self.comboTypeBox.addItem("SpectraHeis") |
|
5831 | self.comboTypeBox.addItem("SpectraHeis") | |
5832 | self.comboTypeBox.addItem("Correlation") |
|
5832 | self.comboTypeBox.addItem("Correlation") | |
5833 | if name == 'SpectraHeis': |
|
5833 | if name == 'SpectraHeis': | |
5834 | self.comboTypeBox.clear() |
|
5834 | self.comboTypeBox.clear() | |
5835 | self.comboTypeBox.addItem("SpectraHeis") |
|
5835 | self.comboTypeBox.addItem("SpectraHeis") | |
5836 |
|
5836 | |||
5837 | self.comboInputBox.addItem(str(name)) |
|
5837 | self.comboInputBox.addItem(str(name)) | |
5838 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5838 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5839 |
|
5839 | |||
5840 | def closeEvent(self, event): |
|
5840 | def closeEvent(self, event): | |
5841 | self.closed.emit() |
|
5841 | self.closed.emit() | |
5842 | event.accept() |
|
5842 | event.accept() | |
5843 |
|
5843 | |||
5844 | class Ftp(QMainWindow, Ui_Ftp): |
|
5844 | class Ftp(QMainWindow, Ui_Ftp): | |
5845 | """ |
|
5845 | """ | |
5846 | Class documentation goes here. |
|
5846 | Class documentation goes here. | |
5847 | """ |
|
5847 | """ | |
5848 | create = False |
|
5848 | create = False | |
5849 | closed = pyqtSignal() |
|
5849 | closed = pyqtSignal() | |
5850 | server = None |
|
5850 | server = None | |
5851 | remotefolder = None |
|
5851 | remotefolder = None | |
5852 | username = None |
|
5852 | username = None | |
5853 | password = None |
|
5853 | password = None | |
5854 | ftp_wei = None |
|
5854 | ftp_wei = None | |
5855 | exp_code = None |
|
5855 | exp_code = None | |
5856 | sub_exp_code = None |
|
5856 | sub_exp_code = None | |
5857 | plot_pos = None |
|
5857 | plot_pos = None | |
5858 |
|
5858 | |||
5859 | def __init__(self, parent=None): |
|
5859 | def __init__(self, parent=None): | |
5860 | """ |
|
5860 | """ | |
5861 | Constructor |
|
5861 | Constructor | |
5862 | """ |
|
5862 | """ | |
5863 | QMainWindow.__init__(self, parent) |
|
5863 | QMainWindow.__init__(self, parent) | |
5864 | self.setupUi(self) |
|
5864 | self.setupUi(self) | |
5865 | self.setGUIStatus() |
|
5865 | self.setGUIStatus() | |
5866 |
|
5866 | |||
5867 | def setGUIStatus(self): |
|
5867 | def setGUIStatus(self): | |
5868 | self.setWindowTitle("ROJ-Signal Chain") |
|
5868 | self.setWindowTitle("ROJ-Signal Chain") | |
5869 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5869 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5870 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5870 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5871 | self.usernameFTP.setToolTip('Example: myusername') |
|
5871 | self.usernameFTP.setToolTip('Example: myusername') | |
5872 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5872 | self.passwordFTP.setToolTip('Example: mypass ') | |
5873 | self.weightFTP.setToolTip('Example: 0') |
|
5873 | self.weightFTP.setToolTip('Example: 0') | |
5874 | self.expcodeFTP.setToolTip('Example: 0') |
|
5874 | self.expcodeFTP.setToolTip('Example: 0') | |
5875 | self.subexpFTP.setToolTip('Example: 0') |
|
5875 | self.subexpFTP.setToolTip('Example: 0') | |
5876 | self.plotposFTP.setToolTip('Example: 0') |
|
5876 | self.plotposFTP.setToolTip('Example: 0') | |
5877 |
|
5877 | |||
5878 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5878 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5879 | self.serverFTP.setText(str(server)) |
|
5879 | self.serverFTP.setText(str(server)) | |
5880 | self.folderFTP.setText(str(remotefolder)) |
|
5880 | self.folderFTP.setText(str(remotefolder)) | |
5881 | self.usernameFTP.setText(str(username)) |
|
5881 | self.usernameFTP.setText(str(username)) | |
5882 | self.passwordFTP.setText(str(password)) |
|
5882 | self.passwordFTP.setText(str(password)) | |
5883 | self.weightFTP.setText(str(ftp_wei)) |
|
5883 | self.weightFTP.setText(str(ftp_wei)) | |
5884 | self.expcodeFTP.setText(str(exp_code)) |
|
5884 | self.expcodeFTP.setText(str(exp_code)) | |
5885 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5885 | self.subexpFTP.setText(str(sub_exp_code)) | |
5886 | self.plotposFTP.setText(str(plot_pos)) |
|
5886 | self.plotposFTP.setText(str(plot_pos)) | |
5887 |
|
5887 | |||
5888 | def getParmsFromFtpWindow(self): |
|
5888 | def getParmsFromFtpWindow(self): | |
5889 | """ |
|
5889 | """ | |
5890 | Return Inputs Project: |
|
5890 | Return Inputs Project: | |
5891 | - server |
|
5891 | - server | |
5892 | - remotefolder |
|
5892 | - remotefolder | |
5893 | - username |
|
5893 | - username | |
5894 | - password |
|
5894 | - password | |
5895 | - ftp_wei |
|
5895 | - ftp_wei | |
5896 | - exp_code |
|
5896 | - exp_code | |
5897 | - sub_exp_code |
|
5897 | - sub_exp_code | |
5898 | - plot_pos |
|
5898 | - plot_pos | |
5899 | """ |
|
5899 | """ | |
5900 | name_server_ftp = str(self.serverFTP.text()) |
|
5900 | name_server_ftp = str(self.serverFTP.text()) | |
5901 | if not name_server_ftp: |
|
5901 | if not name_server_ftp: | |
5902 | self.console.clear() |
|
5902 | self.console.clear() | |
5903 | self.console.append("Please Write a FTP Server") |
|
5903 | self.console.append("Please Write a FTP Server") | |
5904 | return 0 |
|
5904 | return 0 | |
5905 |
|
5905 | |||
5906 | folder_server_ftp = str(self.folderFTP.text()) |
|
5906 | folder_server_ftp = str(self.folderFTP.text()) | |
5907 | if not folder_server_ftp: |
|
5907 | if not folder_server_ftp: | |
5908 | self.console.clear() |
|
5908 | self.console.clear() | |
5909 | self.console.append("Please Write a Folder") |
|
5909 | self.console.append("Please Write a Folder") | |
5910 | return 0 |
|
5910 | return 0 | |
5911 |
|
5911 | |||
5912 | username_ftp = str(self.usernameFTP.text()) |
|
5912 | username_ftp = str(self.usernameFTP.text()) | |
5913 | if not username_ftp: |
|
5913 | if not username_ftp: | |
5914 | self.console.clear() |
|
5914 | self.console.clear() | |
5915 | self.console.append("Please Write a User Name") |
|
5915 | self.console.append("Please Write a User Name") | |
5916 | return 0 |
|
5916 | return 0 | |
5917 |
|
5917 | |||
5918 | password_ftp = str(self.passwordFTP.text()) |
|
5918 | password_ftp = str(self.passwordFTP.text()) | |
5919 | if not password_ftp: |
|
5919 | if not password_ftp: | |
5920 | self.console.clear() |
|
5920 | self.console.clear() | |
5921 | self.console.append("Please Write a passwordFTP") |
|
5921 | self.console.append("Please Write a passwordFTP") | |
5922 | return 0 |
|
5922 | return 0 | |
5923 |
|
5923 | |||
5924 | ftp_wei = str(self.weightFTP.text()) |
|
5924 | ftp_wei = str(self.weightFTP.text()) | |
5925 | if not ftp_wei == "": |
|
5925 | if not ftp_wei == "": | |
5926 | try: |
|
5926 | try: | |
5927 | ftp_wei = int(self.weightFTP.text()) |
|
5927 | ftp_wei = int(self.weightFTP.text()) | |
5928 | except: |
|
5928 | except: | |
5929 | self.console.clear() |
|
5929 | self.console.clear() | |
5930 | self.console.append("Please Write a ftp_wei number") |
|
5930 | self.console.append("Please Write a ftp_wei number") | |
5931 | return 0 |
|
5931 | return 0 | |
5932 |
|
5932 | |||
5933 | exp_code = str(self.expcodeFTP.text()) |
|
5933 | exp_code = str(self.expcodeFTP.text()) | |
5934 | if not exp_code == "": |
|
5934 | if not exp_code == "": | |
5935 | try: |
|
5935 | try: | |
5936 | exp_code = int(self.expcodeFTP.text()) |
|
5936 | exp_code = int(self.expcodeFTP.text()) | |
5937 | except: |
|
5937 | except: | |
5938 | self.console.clear() |
|
5938 | self.console.clear() | |
5939 | self.console.append("Please Write a exp_code number") |
|
5939 | self.console.append("Please Write a exp_code number") | |
5940 | return 0 |
|
5940 | return 0 | |
5941 |
|
5941 | |||
5942 |
|
5942 | |||
5943 | sub_exp_code = str(self.subexpFTP.text()) |
|
5943 | sub_exp_code = str(self.subexpFTP.text()) | |
5944 | if not sub_exp_code == "": |
|
5944 | if not sub_exp_code == "": | |
5945 | try: |
|
5945 | try: | |
5946 | sub_exp_code = int(self.subexpFTP.text()) |
|
5946 | sub_exp_code = int(self.subexpFTP.text()) | |
5947 | except: |
|
5947 | except: | |
5948 | self.console.clear() |
|
5948 | self.console.clear() | |
5949 | self.console.append("Please Write a sub_exp_code number") |
|
5949 | self.console.append("Please Write a sub_exp_code number") | |
5950 | return 0 |
|
5950 | return 0 | |
5951 |
|
5951 | |||
5952 | plot_pos = str(self.plotposFTP.text()) |
|
5952 | plot_pos = str(self.plotposFTP.text()) | |
5953 | if not plot_pos == "": |
|
5953 | if not plot_pos == "": | |
5954 | try: |
|
5954 | try: | |
5955 | plot_pos = int(self.plotposFTP.text()) |
|
5955 | plot_pos = int(self.plotposFTP.text()) | |
5956 | except: |
|
5956 | except: | |
5957 | self.console.clear() |
|
5957 | self.console.clear() | |
5958 | self.console.append("Please Write a plot_pos number") |
|
5958 | self.console.append("Please Write a plot_pos number") | |
5959 | return 0 |
|
5959 | return 0 | |
5960 |
|
5960 | |||
5961 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5961 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5962 |
|
5962 | |||
5963 | @pyqtSignature("") |
|
5963 | @pyqtSignature("") | |
5964 | def on_ftpOkButton_clicked(self): |
|
5964 | def on_ftpOkButton_clicked(self): | |
5965 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5965 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5966 | self.create = True |
|
5966 | self.create = True | |
5967 | self.close() |
|
5967 | self.close() | |
5968 |
|
5968 | |||
5969 | @pyqtSignature("") |
|
5969 | @pyqtSignature("") | |
5970 | def on_ftpCancelButton_clicked(self): |
|
5970 | def on_ftpCancelButton_clicked(self): | |
5971 | self.create = False |
|
5971 | self.create = False | |
5972 | self.close() |
|
5972 | self.close() | |
5973 |
|
5973 | |||
5974 | def closeEvent(self, event): |
|
5974 | def closeEvent(self, event): | |
5975 | self.closed.emit() |
|
5975 | self.closed.emit() | |
5976 | event.accept() |
|
5976 | event.accept() | |
5977 |
|
5977 | |||
5978 | class ftpBuffer(): |
|
5978 | class ftpBuffer(): | |
5979 |
|
5979 | |||
5980 | server = None |
|
5980 | server = None | |
5981 | remotefolder = None |
|
5981 | remotefolder = None | |
5982 | username = None |
|
5982 | username = None | |
5983 | password = None |
|
5983 | password = None | |
5984 | ftp_wei = None |
|
5984 | ftp_wei = None | |
5985 | exp_code = None |
|
5985 | exp_code = None | |
5986 | sub_exp_code = None |
|
5986 | sub_exp_code = None | |
5987 | plot_pos = None |
|
5987 | plot_pos = None | |
5988 | create = False |
|
5988 | create = False | |
5989 | withoutconfig = False |
|
5989 | withoutconfig = False | |
5990 | createforView = False |
|
5990 | createforView = False | |
5991 | localfolder = None |
|
5991 | localfolder = None | |
5992 | extension = None |
|
5992 | extension = None | |
5993 | period = None |
|
5993 | period = None | |
5994 | protocol = None |
|
5994 | protocol = None | |
5995 |
|
5995 | |||
5996 | def __init__(self): |
|
5996 | def __init__(self): | |
5997 |
|
5997 | |||
5998 | self.create = False |
|
5998 | self.create = False | |
5999 | self.server = None |
|
5999 | self.server = None | |
6000 | self.remotefolder = None |
|
6000 | self.remotefolder = None | |
6001 | self.username = None |
|
6001 | self.username = None | |
6002 | self.password = None |
|
6002 | self.password = None | |
6003 | self.ftp_wei = None |
|
6003 | self.ftp_wei = None | |
6004 | self.exp_code = None |
|
6004 | self.exp_code = None | |
6005 | self.sub_exp_code = None |
|
6005 | self.sub_exp_code = None | |
6006 | self.plot_pos = None |
|
6006 | self.plot_pos = None | |
6007 | # self.create = False |
|
6007 | # self.create = False | |
6008 | self.localfolder = None |
|
6008 | self.localfolder = None | |
6009 | self.extension = None |
|
6009 | self.extension = None | |
6010 | self.period = None |
|
6010 | self.period = None | |
6011 | self.protocol = None |
|
6011 | self.protocol = None | |
6012 |
|
6012 | |||
6013 | def setwithoutconfiguration(self): |
|
6013 | def setwithoutconfiguration(self): | |
6014 |
|
6014 | |||
6015 | self.create = False |
|
6015 | self.create = False | |
6016 | self.server = "jro-app.igp.gob.pe" |
|
6016 | self.server = "jro-app.igp.gob.pe" | |
6017 | self.remotefolder = "/home/wmaster/graficos" |
|
6017 | self.remotefolder = "/home/wmaster/graficos" | |
6018 | self.username = "wmaster" |
|
6018 | self.username = "wmaster" | |
6019 | self.password = "mst2010vhf" |
|
6019 | self.password = "mst2010vhf" | |
6020 | self.withoutconfig = True |
|
6020 | self.withoutconfig = True | |
6021 | self.localfolder = './' |
|
6021 | self.localfolder = './' | |
6022 | self.extension = '.png' |
|
6022 | self.extension = '.png' | |
6023 | self.period = 60 |
|
6023 | self.period = 60 | |
6024 | self.protocol = 'ftp' |
|
6024 | self.protocol = 'ftp' | |
6025 | self.createforView = True |
|
6025 | self.createforView = True | |
6026 |
|
6026 | |||
6027 | if not self.ftp_wei: |
|
6027 | if not self.ftp_wei: | |
6028 | self.ftp_wei = 0 |
|
6028 | self.ftp_wei = 0 | |
6029 |
|
6029 | |||
6030 | if not self.exp_code: |
|
6030 | if not self.exp_code: | |
6031 | self.exp_code = 0 |
|
6031 | self.exp_code = 0 | |
6032 |
|
6032 | |||
6033 | if not self.sub_exp_code: |
|
6033 | if not self.sub_exp_code: | |
6034 | self.sub_exp_code = 0 |
|
6034 | self.sub_exp_code = 0 | |
6035 |
|
6035 | |||
6036 | if not self.plot_pos: |
|
6036 | if not self.plot_pos: | |
6037 | self.plot_pos = 0 |
|
6037 | self.plot_pos = 0 | |
6038 |
|
6038 | |||
6039 | 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 | 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'): | |
6040 |
|
6040 | |||
6041 | self.server = server |
|
6041 | self.server = server | |
6042 | self.remotefolder = remotefolder |
|
6042 | self.remotefolder = remotefolder | |
6043 | self.username = username |
|
6043 | self.username = username | |
6044 | self.password = password |
|
6044 | self.password = password | |
6045 | self.ftp_wei = ftp_wei |
|
6045 | self.ftp_wei = ftp_wei | |
6046 | self.exp_code = exp_code |
|
6046 | self.exp_code = exp_code | |
6047 | self.sub_exp_code = sub_exp_code |
|
6047 | self.sub_exp_code = sub_exp_code | |
6048 | self.plot_pos = plot_pos |
|
6048 | self.plot_pos = plot_pos | |
6049 | self.create = True |
|
6049 | self.create = True | |
6050 | self.withoutconfig = False |
|
6050 | self.withoutconfig = False | |
6051 | self.createforView = True |
|
6051 | self.createforView = True | |
6052 | self.localfolder = localfolder |
|
6052 | self.localfolder = localfolder | |
6053 | self.extension = extension |
|
6053 | self.extension = extension | |
6054 | self.period = period |
|
6054 | self.period = period | |
6055 | self.protocol = protocol |
|
6055 | self.protocol = protocol | |
6056 |
|
6056 | |||
6057 | def recover(self): |
|
6057 | def recover(self): | |
6058 |
|
6058 | |||
6059 | 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 | 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 | |
6060 |
|
6060 | |||
6061 | class ShowMeConsole(QtCore.QObject): |
|
6061 | class ShowMeConsole(QtCore.QObject): | |
6062 |
|
6062 | |||
6063 | textWritten = QtCore.pyqtSignal(str) |
|
6063 | textWritten = QtCore.pyqtSignal(str) | |
6064 |
|
6064 | |||
6065 | def write(self, text): |
|
6065 | def write(self, text): | |
6066 |
|
6066 | |||
6067 | if len(text) == 0: |
|
6067 | if len(text) == 0: | |
6068 | self.textWritten.emit("\n") |
|
6068 | self.textWritten.emit("\n") | |
6069 | return |
|
6069 | return | |
6070 |
|
6070 | |||
6071 | if text[-1] == "\n": |
|
6071 | if text[-1] == "\n": | |
6072 | text = text[:-1] |
|
6072 | text = text[:-1] | |
6073 |
|
6073 | |||
6074 | self.textWritten.emit(str(text)) |
|
6074 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now