@@ -1,5898 +1,5898 | |||||
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(value): |
|
62 | def isInt(value): | |
63 |
|
63 | |||
64 | try: |
|
64 | try: | |
65 | int(value) |
|
65 | int(value) | |
66 | except: |
|
66 | except: | |
67 | return 0 |
|
67 | return 0 | |
68 |
|
68 | |||
69 | return 1 |
|
69 | return 1 | |
70 |
|
70 | |||
71 | def isFloat(value): |
|
71 | def isFloat(value): | |
72 |
|
72 | |||
73 | try: |
|
73 | try: | |
74 | float(value) |
|
74 | float(value) | |
75 | except: |
|
75 | except: | |
76 | return 0 |
|
76 | return 0 | |
77 |
|
77 | |||
78 | return 1 |
|
78 | return 1 | |
79 |
|
79 | |||
80 | def isList(value): |
|
80 | def isList(value): | |
81 |
|
81 | |||
82 | x = ast.literal_eval(value) |
|
82 | x = ast.literal_eval(value) | |
83 |
|
83 | |||
84 | if type(x) in (int, float, tuple, list): |
|
84 | if type(x) in (int, float, tuple, list): | |
85 | return 1 |
|
85 | return 1 | |
86 |
|
86 | |||
87 | return 0 |
|
87 | return 0 | |
88 |
|
88 | |||
89 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
89 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
90 | """ |
|
90 | """ | |
91 | """ |
|
91 | """ | |
92 | def __init__(self, parent=None): |
|
92 | def __init__(self, parent=None): | |
93 | """ |
|
93 | """ | |
94 |
|
94 | |||
95 | """ |
|
95 | """ | |
96 | QMainWindow.__init__(self, parent) |
|
96 | QMainWindow.__init__(self, parent) | |
97 | self.setupUi(self) |
|
97 | self.setupUi(self) | |
98 | self.__puObjDict = {} |
|
98 | self.__puObjDict = {} | |
99 | self.__itemTreeDict = {} |
|
99 | self.__itemTreeDict = {} | |
100 | self.readUnitConfObjList = [] |
|
100 | self.readUnitConfObjList = [] | |
101 | self.operObjList = [] |
|
101 | self.operObjList = [] | |
102 | self.projecObjView = None |
|
102 | self.projecObjView = None | |
103 | self.idProject = 0 |
|
103 | self.idProject = 0 | |
104 | # self.idImag = 0 |
|
104 | # self.idImag = 0 | |
105 |
|
105 | |||
106 | self.idImagscope = 0 |
|
106 | self.idImagscope = 0 | |
107 | self.idImagspectra = 0 |
|
107 | self.idImagspectra = 0 | |
108 | self.idImagcross = 0 |
|
108 | self.idImagcross = 0 | |
109 | self.idImagrti = 0 |
|
109 | self.idImagrti = 0 | |
110 | self.idImagcoherence = 0 |
|
110 | self.idImagcoherence = 0 | |
111 | self.idImagpower = 0 |
|
111 | self.idImagpower = 0 | |
112 | self.idImagrtinoise = 0 |
|
112 | self.idImagrtinoise = 0 | |
113 | self.idImagspectraHeis = 0 |
|
113 | self.idImagspectraHeis = 0 | |
114 | self.idImagrtiHeis = 0 |
|
114 | self.idImagrtiHeis = 0 | |
115 |
|
115 | |||
116 | self.dataPath = None |
|
116 | self.dataPath = None | |
117 | self.online = 0 |
|
117 | self.online = 0 | |
118 | self.walk = 0 |
|
118 | self.walk = 0 | |
119 | self.create = False |
|
119 | self.create = False | |
120 | self.selectedItemTree = None |
|
120 | self.selectedItemTree = None | |
121 | self.controllerThread = None |
|
121 | self.controllerThread = None | |
122 | # self.commCtrlPThread = None |
|
122 | # self.commCtrlPThread = None | |
123 | # self.create_figure() |
|
123 | # self.create_figure() | |
124 | self.temporalFTP = ftpBuffer() |
|
124 | self.temporalFTP = ftpBuffer() | |
125 | self.projectProperCaracteristica = [] |
|
125 | self.projectProperCaracteristica = [] | |
126 | self.projectProperPrincipal = [] |
|
126 | self.projectProperPrincipal = [] | |
127 | self.projectProperDescripcion = [] |
|
127 | self.projectProperDescripcion = [] | |
128 | self.volProperCaracteristica = [] |
|
128 | self.volProperCaracteristica = [] | |
129 | self.volProperPrincipal = [] |
|
129 | self.volProperPrincipal = [] | |
130 | self.volProperDescripcion = [] |
|
130 | self.volProperDescripcion = [] | |
131 | self.specProperCaracteristica = [] |
|
131 | self.specProperCaracteristica = [] | |
132 | self.specProperPrincipal = [] |
|
132 | self.specProperPrincipal = [] | |
133 | self.specProperDescripcion = [] |
|
133 | self.specProperDescripcion = [] | |
134 |
|
134 | |||
135 | self.specHeisProperCaracteristica = [] |
|
135 | self.specHeisProperCaracteristica = [] | |
136 | self.specHeisProperPrincipal = [] |
|
136 | self.specHeisProperPrincipal = [] | |
137 | self.specHeisProperDescripcion = [] |
|
137 | self.specHeisProperDescripcion = [] | |
138 |
|
138 | |||
139 | # self.pathWorkSpace = './' |
|
139 | # self.pathWorkSpace = './' | |
140 |
|
140 | |||
141 | self.__projectObjDict = {} |
|
141 | self.__projectObjDict = {} | |
142 | self.__operationObjDict = {} |
|
142 | self.__operationObjDict = {} | |
143 |
|
143 | |||
144 | self.__puLocalFolder2FTP = {} |
|
144 | self.__puLocalFolder2FTP = {} | |
145 | self.threadStarted = False |
|
145 | self.threadStarted = False | |
146 |
|
146 | |||
147 | self.plotManager = None |
|
147 | self.plotManager = None | |
148 |
|
148 | |||
149 | # self.create_comm() |
|
149 | # self.create_comm() | |
150 | self.create_updating_timer() |
|
150 | self.create_updating_timer() | |
151 | self.setGUIStatus() |
|
151 | self.setGUIStatus() | |
152 |
|
152 | |||
153 | @pyqtSignature("") |
|
153 | @pyqtSignature("") | |
154 | def on_actionOpen_triggered(self): |
|
154 | def on_actionOpen_triggered(self): | |
155 | """ |
|
155 | """ | |
156 | Slot documentation goes here. |
|
156 | Slot documentation goes here. | |
157 | """ |
|
157 | """ | |
158 | self.openProject() |
|
158 | self.openProject() | |
159 |
|
159 | |||
160 | @pyqtSignature("") |
|
160 | @pyqtSignature("") | |
161 | def on_actionCreate_triggered(self): |
|
161 | def on_actionCreate_triggered(self): | |
162 | """ |
|
162 | """ | |
163 | Slot documentation goes here. |
|
163 | Slot documentation goes here. | |
164 | """ |
|
164 | """ | |
165 | self.setInputsProject_View() |
|
165 | self.setInputsProject_View() | |
166 | self.create = True |
|
166 | self.create = True | |
167 |
|
167 | |||
168 | @pyqtSignature("") |
|
168 | @pyqtSignature("") | |
169 | def on_actionSave_triggered(self): |
|
169 | def on_actionSave_triggered(self): | |
170 | """ |
|
170 | """ | |
171 | Slot documentation goes here. |
|
171 | Slot documentation goes here. | |
172 | """ |
|
172 | """ | |
173 | self.saveProject() |
|
173 | self.saveProject() | |
174 |
|
174 | |||
175 | @pyqtSignature("") |
|
175 | @pyqtSignature("") | |
176 | def on_actionClose_triggered(self): |
|
176 | def on_actionClose_triggered(self): | |
177 | """ |
|
177 | """ | |
178 | Slot documentation goes here. |
|
178 | Slot documentation goes here. | |
179 | """ |
|
179 | """ | |
180 | self.close() |
|
180 | self.close() | |
181 |
|
181 | |||
182 | @pyqtSignature("") |
|
182 | @pyqtSignature("") | |
183 | def on_actionStart_triggered(self): |
|
183 | def on_actionStart_triggered(self): | |
184 | """ |
|
184 | """ | |
185 | """ |
|
185 | """ | |
186 | self.playProject() |
|
186 | self.playProject() | |
187 |
|
187 | |||
188 | @pyqtSignature("") |
|
188 | @pyqtSignature("") | |
189 | def on_actionPause_triggered(self): |
|
189 | def on_actionPause_triggered(self): | |
190 | """ |
|
190 | """ | |
191 | """ |
|
191 | """ | |
192 | self.pauseProject() |
|
192 | self.pauseProject() | |
193 |
|
193 | |||
194 | @pyqtSignature("") |
|
194 | @pyqtSignature("") | |
195 | def on_actionStop_triggered(self): |
|
195 | def on_actionStop_triggered(self): | |
196 | """ |
|
196 | """ | |
197 | """ |
|
197 | """ | |
198 | self.stopProject() |
|
198 | self.stopProject() | |
199 |
|
199 | |||
200 | @pyqtSignature("") |
|
200 | @pyqtSignature("") | |
201 | def on_actionAbout_triggered(self): |
|
201 | def on_actionAbout_triggered(self): | |
202 | """ |
|
202 | """ | |
203 | """ |
|
203 | """ | |
204 | self.aboutEvent() |
|
204 | self.aboutEvent() | |
205 |
|
205 | |||
206 | @pyqtSignature("") |
|
206 | @pyqtSignature("") | |
207 | def on_actionFTP_triggered(self): |
|
207 | def on_actionFTP_triggered(self): | |
208 | """ |
|
208 | """ | |
209 | """ |
|
209 | """ | |
210 | self.configFTPWindowObj = Ftp(self) |
|
210 | self.configFTPWindowObj = Ftp(self) | |
211 |
|
211 | |||
212 | if not self.temporalFTP.create: |
|
212 | if not self.temporalFTP.create: | |
213 | self.temporalFTP.setwithoutconfiguration() |
|
213 | self.temporalFTP.setwithoutconfiguration() | |
214 |
|
214 | |||
215 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, |
|
215 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |
216 | self.temporalFTP.remotefolder, |
|
216 | self.temporalFTP.remotefolder, | |
217 | self.temporalFTP.username, |
|
217 | self.temporalFTP.username, | |
218 | self.temporalFTP.password, |
|
218 | self.temporalFTP.password, | |
219 | self.temporalFTP.ftp_wei, |
|
219 | self.temporalFTP.ftp_wei, | |
220 | self.temporalFTP.exp_code, |
|
220 | self.temporalFTP.exp_code, | |
221 | self.temporalFTP.sub_exp_code, |
|
221 | self.temporalFTP.sub_exp_code, | |
222 | self.temporalFTP.plot_pos) |
|
222 | self.temporalFTP.plot_pos) | |
223 |
|
223 | |||
224 | self.configFTPWindowObj.show() |
|
224 | self.configFTPWindowObj.show() | |
225 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
225 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
226 |
|
226 | |||
227 | def createFTPConfig(self): |
|
227 | def createFTPConfig(self): | |
228 |
|
228 | |||
229 | if not self.configFTPWindowObj.create: |
|
229 | if not self.configFTPWindowObj.create: | |
230 | self.console.clear() |
|
230 | self.console.clear() | |
231 | self.console.append("There is no FTP configuration") |
|
231 | self.console.append("There is no FTP configuration") | |
232 | return |
|
232 | return | |
233 |
|
233 | |||
234 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
234 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
235 |
|
235 | |||
236 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
236 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
237 | self.temporalFTP.save(server=server, |
|
237 | self.temporalFTP.save(server=server, | |
238 | remotefolder=remotefolder, |
|
238 | remotefolder=remotefolder, | |
239 | username=username, |
|
239 | username=username, | |
240 | password=password, |
|
240 | password=password, | |
241 | ftp_wei=ftp_wei, |
|
241 | ftp_wei=ftp_wei, | |
242 | exp_code=exp_code, |
|
242 | exp_code=exp_code, | |
243 | sub_exp_code=sub_exp_code, |
|
243 | sub_exp_code=sub_exp_code, | |
244 | plot_pos=plot_pos) |
|
244 | plot_pos=plot_pos) | |
245 |
|
245 | |||
246 | @pyqtSignature("") |
|
246 | @pyqtSignature("") | |
247 | def on_actionOpenToolbar_triggered(self): |
|
247 | def on_actionOpenToolbar_triggered(self): | |
248 | """ |
|
248 | """ | |
249 | Slot documentation goes here. |
|
249 | Slot documentation goes here. | |
250 | """ |
|
250 | """ | |
251 | self.openProject() |
|
251 | self.openProject() | |
252 |
|
252 | |||
253 | @pyqtSignature("") |
|
253 | @pyqtSignature("") | |
254 | def on_actionCreateToolbar_triggered(self): |
|
254 | def on_actionCreateToolbar_triggered(self): | |
255 | """ |
|
255 | """ | |
256 | Slot documentation goes here. |
|
256 | Slot documentation goes here. | |
257 | """ |
|
257 | """ | |
258 | self.setInputsProject_View() |
|
258 | self.setInputsProject_View() | |
259 | self.create = True |
|
259 | self.create = True | |
260 |
|
260 | |||
261 | @pyqtSignature("") |
|
261 | @pyqtSignature("") | |
262 | def on_actionAddPU_triggered(self): |
|
262 | def on_actionAddPU_triggered(self): | |
263 |
|
263 | |||
264 | if len(self.__projectObjDict) == 0: |
|
264 | if len(self.__projectObjDict) == 0: | |
265 | outputstr = "First create a Project before add any Processing Unit" |
|
265 | outputstr = "First create a Project before add any Processing Unit" | |
266 | self.console.clear() |
|
266 | self.console.clear() | |
267 | self.console.append(outputstr) |
|
267 | self.console.append(outputstr) | |
268 | return |
|
268 | return | |
269 | else: |
|
269 | else: | |
270 | self.addPUWindow() |
|
270 | self.addPUWindow() | |
271 | self.console.clear() |
|
271 | self.console.clear() | |
272 | self.console.append("Please, Choose the type of Processing Unit") |
|
272 | self.console.append("Please, Choose the type of Processing Unit") | |
273 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
273 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
274 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
274 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
275 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
275 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
276 |
|
276 | |||
277 |
|
277 | |||
278 | @pyqtSignature("") |
|
278 | @pyqtSignature("") | |
279 | def on_actionSaveToolbar_triggered(self): |
|
279 | def on_actionSaveToolbar_triggered(self): | |
280 | """ |
|
280 | """ | |
281 | Slot documentation goes here. |
|
281 | Slot documentation goes here. | |
282 | """ |
|
282 | """ | |
283 | self.saveProject() |
|
283 | self.saveProject() | |
284 |
|
284 | |||
285 | @pyqtSignature("") |
|
285 | @pyqtSignature("") | |
286 | def on_actionStarToolbar_triggered(self): |
|
286 | def on_actionStarToolbar_triggered(self): | |
287 | """ |
|
287 | """ | |
288 | Slot documentation goes here. |
|
288 | Slot documentation goes here. | |
289 | """ |
|
289 | """ | |
290 | self.playProject() |
|
290 | self.playProject() | |
291 |
|
291 | |||
292 | @pyqtSignature("") |
|
292 | @pyqtSignature("") | |
293 | def on_actionPauseToolbar_triggered(self): |
|
293 | def on_actionPauseToolbar_triggered(self): | |
294 |
|
294 | |||
295 | self.pauseProject() |
|
295 | self.pauseProject() | |
296 |
|
296 | |||
297 | @pyqtSignature("") |
|
297 | @pyqtSignature("") | |
298 | def on_actionStopToolbar_triggered(self): |
|
298 | def on_actionStopToolbar_triggered(self): | |
299 | """ |
|
299 | """ | |
300 | Slot documentation goes here. |
|
300 | Slot documentation goes here. | |
301 | """ |
|
301 | """ | |
302 | self.stopProject() |
|
302 | self.stopProject() | |
303 |
|
303 | |||
304 | @pyqtSignature("int") |
|
304 | @pyqtSignature("int") | |
305 | def on_proComReadMode_activated(self, index): |
|
305 | def on_proComReadMode_activated(self, index): | |
306 | """ |
|
306 | """ | |
307 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
307 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
308 | """ |
|
308 | """ | |
309 | if index == 0: |
|
309 | if index == 0: | |
310 | self.online = 0 |
|
310 | self.online = 0 | |
311 | self.proDelay.setText("0") |
|
311 | self.proDelay.setText("0") | |
312 | self.proSet.setText("") |
|
312 | self.proSet.setText("") | |
313 | self.proSet.setEnabled(False) |
|
313 | self.proSet.setEnabled(False) | |
314 | self.proDelay.setEnabled(False) |
|
314 | self.proDelay.setEnabled(False) | |
315 | elif index == 1: |
|
315 | elif index == 1: | |
316 | self.online = 1 |
|
316 | self.online = 1 | |
317 | self.proSet.setText("") |
|
317 | self.proSet.setText("") | |
318 | self.proDelay.setText("5") |
|
318 | self.proDelay.setText("5") | |
319 | self.proSet.setEnabled(True) |
|
319 | self.proSet.setEnabled(True) | |
320 | self.proDelay.setEnabled(True) |
|
320 | self.proDelay.setEnabled(True) | |
321 |
|
321 | |||
322 | @pyqtSignature("int") |
|
322 | @pyqtSignature("int") | |
323 | def on_proComDataType_activated(self, index): |
|
323 | def on_proComDataType_activated(self, index): | |
324 | """ |
|
324 | """ | |
325 | Voltage or Spectra |
|
325 | Voltage or Spectra | |
326 | """ |
|
326 | """ | |
327 | self.labelSet.show() |
|
327 | self.labelSet.show() | |
328 | self.proSet.show() |
|
328 | self.proSet.show() | |
329 |
|
329 | |||
330 | self.labExpLabel.show() |
|
330 | self.labExpLabel.show() | |
331 | self.proExpLabel.show() |
|
331 | self.proExpLabel.show() | |
332 |
|
332 | |||
333 | self.labelIPPKm.hide() |
|
333 | self.labelIPPKm.hide() | |
334 | self.proIPPKm.hide() |
|
334 | self.proIPPKm.hide() | |
335 |
|
335 | |||
336 | if index == 0: |
|
336 | if index == 0: | |
337 | extension = '.r' |
|
337 | extension = '.r' | |
338 | elif index == 1: |
|
338 | elif index == 1: | |
339 | extension = '.pdata' |
|
339 | extension = '.pdata' | |
340 | elif index == 2: |
|
340 | elif index == 2: | |
341 | extension = '.fits' |
|
341 | extension = '.fits' | |
342 | elif index == 3: |
|
342 | elif index == 3: | |
343 | extension = '.hdf5' |
|
343 | extension = '.hdf5' | |
344 |
|
344 | |||
345 | self.labelIPPKm.show() |
|
345 | self.labelIPPKm.show() | |
346 | self.proIPPKm.show() |
|
346 | self.proIPPKm.show() | |
347 |
|
347 | |||
348 | self.labelSet.hide() |
|
348 | self.labelSet.hide() | |
349 | self.proSet.hide() |
|
349 | self.proSet.hide() | |
350 |
|
350 | |||
351 | self.labExpLabel.hide() |
|
351 | self.labExpLabel.hide() | |
352 | self.proExpLabel.hide() |
|
352 | self.proExpLabel.hide() | |
353 |
|
353 | |||
354 | self.proDataType.setText(extension) |
|
354 | self.proDataType.setText(extension) | |
355 |
|
355 | |||
356 | @pyqtSignature("int") |
|
356 | @pyqtSignature("int") | |
357 | def on_proComWalk_activated(self, index): |
|
357 | def on_proComWalk_activated(self, index): | |
358 | """ |
|
358 | """ | |
359 |
|
359 | |||
360 | """ |
|
360 | """ | |
361 | if index == 0: |
|
361 | if index == 0: | |
362 | self.walk = 0 |
|
362 | self.walk = 0 | |
363 | elif index == 1: |
|
363 | elif index == 1: | |
364 | self.walk = 1 |
|
364 | self.walk = 1 | |
365 |
|
365 | |||
366 | @pyqtSignature("") |
|
366 | @pyqtSignature("") | |
367 | def on_proToolPath_clicked(self): |
|
367 | def on_proToolPath_clicked(self): | |
368 | """ |
|
368 | """ | |
369 | Choose your path |
|
369 | Choose your path | |
370 | """ |
|
370 | """ | |
371 |
|
371 | |||
372 | current_dpath = './' |
|
372 | current_dpath = './' | |
373 | if self.dataPath: |
|
373 | if self.dataPath: | |
374 | current_dpath = self.dataPath |
|
374 | current_dpath = self.dataPath | |
375 |
|
375 | |||
376 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
376 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
377 |
|
377 | |||
378 | #If it was canceled |
|
378 | #If it was canceled | |
379 | if not datapath: |
|
379 | if not datapath: | |
380 | return |
|
380 | return | |
381 |
|
381 | |||
382 | #If any change was done |
|
382 | #If any change was done | |
383 | if datapath == self.dataPath: |
|
383 | if datapath == self.dataPath: | |
384 | return |
|
384 | return | |
385 |
|
385 | |||
386 | self.proDataPath.setText(datapath) |
|
386 | self.proDataPath.setText(datapath) | |
387 |
|
387 | |||
388 | self._disable_play_button() |
|
388 | self._disable_play_button() | |
389 | self._disable_save_button() |
|
389 | self._disable_save_button() | |
390 | self.proOk.setEnabled(False) |
|
390 | self.proOk.setEnabled(False) | |
391 |
|
391 | |||
392 | self.proComStartDate.clear() |
|
392 | self.proComStartDate.clear() | |
393 | self.proComEndDate.clear() |
|
393 | self.proComEndDate.clear() | |
394 |
|
394 | |||
395 | if not os.path.exists(datapath): |
|
395 | if not os.path.exists(datapath): | |
396 |
|
396 | |||
397 | self.console.clear() |
|
397 | self.console.clear() | |
398 | self.console.append("Write a valid path") |
|
398 | self.console.append("Write a valid path") | |
399 | return |
|
399 | return | |
400 |
|
400 | |||
401 | self.dataPath = datapath |
|
401 | self.dataPath = datapath | |
402 |
|
402 | |||
403 | self.console.clear() |
|
403 | self.console.clear() | |
404 | self.console.append("Select the read mode and press 'load button'") |
|
404 | self.console.append("Select the read mode and press 'load button'") | |
405 |
|
405 | |||
406 |
|
406 | |||
407 | @pyqtSignature("") |
|
407 | @pyqtSignature("") | |
408 | def on_proLoadButton_clicked(self): |
|
408 | def on_proLoadButton_clicked(self): | |
409 |
|
409 | |||
410 | self.console.clear() |
|
410 | self.console.clear() | |
411 |
|
411 | |||
412 | parameter_list = self.checkInputsProject() |
|
412 | parameter_list = self.checkInputsProject() | |
413 |
|
413 | |||
414 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list |
|
414 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list | |
415 |
|
415 | |||
416 | if read_mode == "Offline": |
|
416 | if read_mode == "Offline": | |
417 | self.proComStartDate.clear() |
|
417 | self.proComStartDate.clear() | |
418 | self.proComEndDate.clear() |
|
418 | self.proComEndDate.clear() | |
419 | self.proComStartDate.setEnabled(True) |
|
419 | self.proComStartDate.setEnabled(True) | |
420 | self.proComEndDate.setEnabled(True) |
|
420 | self.proComEndDate.setEnabled(True) | |
421 | self.proStartTime.setEnabled(True) |
|
421 | self.proStartTime.setEnabled(True) | |
422 | self.proEndTime.setEnabled(True) |
|
422 | self.proEndTime.setEnabled(True) | |
423 | self.frame_2.setEnabled(True) |
|
423 | self.frame_2.setEnabled(True) | |
424 |
|
424 | |||
425 | if read_mode == "Online": |
|
425 | if read_mode == "Online": | |
426 | self.proComStartDate.addItem("1960/01/30") |
|
426 | self.proComStartDate.addItem("1960/01/30") | |
427 | self.proComEndDate.addItem("2018/12/31") |
|
427 | self.proComEndDate.addItem("2018/12/31") | |
428 | self.proComStartDate.setEnabled(False) |
|
428 | self.proComStartDate.setEnabled(False) | |
429 | self.proComEndDate.setEnabled(False) |
|
429 | self.proComEndDate.setEnabled(False) | |
430 | self.proStartTime.setEnabled(False) |
|
430 | self.proStartTime.setEnabled(False) | |
431 | self.proEndTime.setEnabled(False) |
|
431 | self.proEndTime.setEnabled(False) | |
432 | self.frame_2.setEnabled(True) |
|
432 | self.frame_2.setEnabled(True) | |
433 |
|
433 | |||
434 | if self.loadDays(data_path, ext, walk, expLabel) == []: |
|
434 | if self.loadDays(data_path, ext, walk, expLabel) == []: | |
435 | self._disable_save_button() |
|
435 | self._disable_save_button() | |
436 | self._disable_play_button() |
|
436 | self._disable_play_button() | |
437 | self.proOk.setEnabled(False) |
|
437 | self.proOk.setEnabled(False) | |
438 | else: |
|
438 | else: | |
439 | self._enable_save_button() |
|
439 | self._enable_save_button() | |
440 | self._enable_play_button() |
|
440 | self._enable_play_button() | |
441 | self.proOk.setEnabled(True) |
|
441 | self.proOk.setEnabled(True) | |
442 |
|
442 | |||
443 | @pyqtSignature("int") |
|
443 | @pyqtSignature("int") | |
444 | def on_proComStartDate_activated(self, index): |
|
444 | def on_proComStartDate_activated(self, index): | |
445 | """ |
|
445 | """ | |
446 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
446 | SELECCION DEL RANGO DE FECHAS -START DATE | |
447 | """ |
|
447 | """ | |
448 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
448 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
449 |
|
449 | |||
450 | self.proComEndDate.clear() |
|
450 | self.proComEndDate.clear() | |
451 | for i in self.dateList[index:]: |
|
451 | for i in self.dateList[index:]: | |
452 | self.proComEndDate.addItem(i) |
|
452 | self.proComEndDate.addItem(i) | |
453 |
|
453 | |||
454 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
454 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
455 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
455 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
456 | else: |
|
456 | else: | |
457 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
457 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
458 |
|
458 | |||
459 | @pyqtSignature("int") |
|
459 | @pyqtSignature("int") | |
460 | def on_proComEndDate_activated(self, index): |
|
460 | def on_proComEndDate_activated(self, index): | |
461 | """ |
|
461 | """ | |
462 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
462 | SELECCION DEL RANGO DE FECHAS-END DATE | |
463 | """ |
|
463 | """ | |
464 | pass |
|
464 | pass | |
465 |
|
465 | |||
466 | @pyqtSignature("") |
|
466 | @pyqtSignature("") | |
467 | def on_proOk_clicked(self): |
|
467 | def on_proOk_clicked(self): | |
468 | """ |
|
468 | """ | |
469 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
469 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
470 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
470 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
471 | """ |
|
471 | """ | |
472 |
|
472 | |||
473 | self._disable_play_button() |
|
473 | self._disable_play_button() | |
474 | self._disable_save_button() |
|
474 | self._disable_save_button() | |
475 |
|
475 | |||
476 | self.console.clear() |
|
476 | self.console.clear() | |
477 |
|
477 | |||
478 | if self.create: |
|
478 | if self.create: | |
479 |
|
479 | |||
480 | projectId = self.__getNewProjectId() |
|
480 | projectId = self.__getNewProjectId() | |
481 |
|
481 | |||
482 | if not projectId: |
|
482 | if not projectId: | |
483 | return 0 |
|
483 | return 0 | |
484 |
|
484 | |||
485 | projectObjView = self.createProjectView(projectId) |
|
485 | projectObjView = self.createProjectView(projectId) | |
486 |
|
486 | |||
487 | if not projectObjView: |
|
487 | if not projectObjView: | |
488 | return 0 |
|
488 | return 0 | |
489 |
|
489 | |||
490 | self.create = False |
|
490 | self.create = False | |
491 |
|
491 | |||
492 | readUnitObj = self.createReadUnitView(projectObjView) |
|
492 | readUnitObj = self.createReadUnitView(projectObjView) | |
493 |
|
493 | |||
494 | if not readUnitObj: |
|
494 | if not readUnitObj: | |
495 | return 0 |
|
495 | return 0 | |
496 |
|
496 | |||
497 | else: |
|
497 | else: | |
498 | projectObjView = self.updateProjectView() |
|
498 | projectObjView = self.updateProjectView() | |
499 |
|
499 | |||
500 | if not projectObjView: |
|
500 | if not projectObjView: | |
501 | return 0 |
|
501 | return 0 | |
502 |
|
502 | |||
503 | projectId = projectObjView.getId() |
|
503 | projectId = projectObjView.getId() | |
504 | idReadUnit = projectObjView.getReadUnitId() |
|
504 | idReadUnit = projectObjView.getReadUnitId() | |
505 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
505 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
506 |
|
506 | |||
507 | if not readUnitObj: |
|
507 | if not readUnitObj: | |
508 | return 0 |
|
508 | return 0 | |
509 |
|
509 | |||
510 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
510 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
511 | # Project Properties |
|
511 | # Project Properties | |
512 | self.refreshProjectProperties(projectObjView) |
|
512 | self.refreshProjectProperties(projectObjView) | |
513 | # Disable tabProject after finish the creation |
|
513 | # Disable tabProject after finish the creation | |
514 |
|
514 | |||
515 | self._enable_play_button() |
|
515 | self._enable_play_button() | |
516 | self._enable_save_button() |
|
516 | self._enable_save_button() | |
517 |
|
517 | |||
518 | self.console.clear() |
|
518 | self.console.clear() | |
519 | self.console.append("The project parameters were validated") |
|
519 | self.console.append("The project parameters were validated") | |
520 |
|
520 | |||
521 | return 1 |
|
521 | return 1 | |
522 |
|
522 | |||
523 | @pyqtSignature("") |
|
523 | @pyqtSignature("") | |
524 | def on_proClear_clicked(self): |
|
524 | def on_proClear_clicked(self): | |
525 |
|
525 | |||
526 | self.console.clear() |
|
526 | self.console.clear() | |
527 |
|
527 | |||
528 | @pyqtSignature("int") |
|
528 | @pyqtSignature("int") | |
529 | def on_volOpCebChannels_stateChanged(self, p0): |
|
529 | def on_volOpCebChannels_stateChanged(self, p0): | |
530 | """ |
|
530 | """ | |
531 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
531 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
532 | """ |
|
532 | """ | |
533 | if p0 == 2: |
|
533 | if p0 == 2: | |
534 | self.volOpComChannels.setEnabled(True) |
|
534 | self.volOpComChannels.setEnabled(True) | |
535 | self.volOpChannel.setEnabled(True) |
|
535 | self.volOpChannel.setEnabled(True) | |
536 |
|
536 | |||
537 | if p0 == 0: |
|
537 | if p0 == 0: | |
538 | self.volOpComChannels.setEnabled(False) |
|
538 | self.volOpComChannels.setEnabled(False) | |
539 | self.volOpChannel.setEnabled(False) |
|
539 | self.volOpChannel.setEnabled(False) | |
540 | self.volOpChannel.clear() |
|
540 | self.volOpChannel.clear() | |
541 |
|
541 | |||
542 | @pyqtSignature("int") |
|
542 | @pyqtSignature("int") | |
543 | def on_volOpCebHeights_stateChanged(self, p0): |
|
543 | def on_volOpCebHeights_stateChanged(self, p0): | |
544 | """ |
|
544 | """ | |
545 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
545 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
546 | """ |
|
546 | """ | |
547 | if p0 == 2: |
|
547 | if p0 == 2: | |
548 | self.volOpHeights.setEnabled(True) |
|
548 | self.volOpHeights.setEnabled(True) | |
549 | self.volOpComHeights.setEnabled(True) |
|
549 | self.volOpComHeights.setEnabled(True) | |
550 |
|
550 | |||
551 | if p0 == 0: |
|
551 | if p0 == 0: | |
552 | self.volOpHeights.setEnabled(False) |
|
552 | self.volOpHeights.setEnabled(False) | |
553 | self.volOpHeights.clear() |
|
553 | self.volOpHeights.clear() | |
554 | self.volOpComHeights.setEnabled(False) |
|
554 | self.volOpComHeights.setEnabled(False) | |
555 |
|
555 | |||
556 | @pyqtSignature("int") |
|
556 | @pyqtSignature("int") | |
557 | def on_volOpCebFilter_stateChanged(self, p0): |
|
557 | def on_volOpCebFilter_stateChanged(self, p0): | |
558 | """ |
|
558 | """ | |
559 | Name='Decoder', optype='other' |
|
559 | Name='Decoder', optype='other' | |
560 | """ |
|
560 | """ | |
561 | if p0 == 2: |
|
561 | if p0 == 2: | |
562 | self.volOpFilter.setEnabled(True) |
|
562 | self.volOpFilter.setEnabled(True) | |
563 |
|
563 | |||
564 | if p0 == 0: |
|
564 | if p0 == 0: | |
565 | self.volOpFilter.setEnabled(False) |
|
565 | self.volOpFilter.setEnabled(False) | |
566 | self.volOpFilter.clear() |
|
566 | self.volOpFilter.clear() | |
567 |
|
567 | |||
568 | @pyqtSignature("int") |
|
568 | @pyqtSignature("int") | |
569 | def on_volOpCebProfile_stateChanged(self, p0): |
|
569 | def on_volOpCebProfile_stateChanged(self, p0): | |
570 | """ |
|
570 | """ | |
571 | Check Box habilita ingreso del rango de Perfiles |
|
571 | Check Box habilita ingreso del rango de Perfiles | |
572 | """ |
|
572 | """ | |
573 | if p0 == 2: |
|
573 | if p0 == 2: | |
574 | self.volOpComProfile.setEnabled(True) |
|
574 | self.volOpComProfile.setEnabled(True) | |
575 | self.volOpProfile.setEnabled(True) |
|
575 | self.volOpProfile.setEnabled(True) | |
576 |
|
576 | |||
577 | if p0 == 0: |
|
577 | if p0 == 0: | |
578 | self.volOpComProfile.setEnabled(False) |
|
578 | self.volOpComProfile.setEnabled(False) | |
579 | self.volOpProfile.setEnabled(False) |
|
579 | self.volOpProfile.setEnabled(False) | |
580 | self.volOpProfile.clear() |
|
580 | self.volOpProfile.clear() | |
581 |
|
581 | |||
582 | @pyqtSignature("int") |
|
582 | @pyqtSignature("int") | |
583 | def on_volOpComProfile_activated(self, index): |
|
583 | def on_volOpComProfile_activated(self, index): | |
584 | """ |
|
584 | """ | |
585 | Check Box habilita ingreso del rango de Perfiles |
|
585 | Check Box habilita ingreso del rango de Perfiles | |
586 | """ |
|
586 | """ | |
587 | #Profile List |
|
587 | #Profile List | |
588 | if index == 0: |
|
588 | if index == 0: | |
589 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
589 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
590 |
|
590 | |||
591 | #Profile Range |
|
591 | #Profile Range | |
592 | if index == 1: |
|
592 | if index == 1: | |
593 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
593 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
594 |
|
594 | |||
595 | #Profile Range List |
|
595 | #Profile Range List | |
596 | if index == 2: |
|
596 | if index == 2: | |
597 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
597 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
598 |
|
598 | |||
599 | @pyqtSignature("int") |
|
599 | @pyqtSignature("int") | |
600 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
600 | def on_volOpCebDecodification_stateChanged(self, p0): | |
601 | """ |
|
601 | """ | |
602 | Check Box habilita |
|
602 | Check Box habilita | |
603 | """ |
|
603 | """ | |
604 | if p0 == 2: |
|
604 | if p0 == 2: | |
605 | self.volOpComCode.setEnabled(True) |
|
605 | self.volOpComCode.setEnabled(True) | |
606 | self.volOpComMode.setEnabled(True) |
|
606 | self.volOpComMode.setEnabled(True) | |
607 | if p0 == 0: |
|
607 | if p0 == 0: | |
608 | self.volOpComCode.setEnabled(False) |
|
608 | self.volOpComCode.setEnabled(False) | |
609 | self.volOpComMode.setEnabled(False) |
|
609 | self.volOpComMode.setEnabled(False) | |
610 |
|
610 | |||
611 | @pyqtSignature("int") |
|
611 | @pyqtSignature("int") | |
612 | def on_volOpComCode_activated(self, index): |
|
612 | def on_volOpComCode_activated(self, index): | |
613 | """ |
|
613 | """ | |
614 | Check Box habilita ingreso |
|
614 | Check Box habilita ingreso | |
615 | """ |
|
615 | """ | |
616 | if index == 13: |
|
616 | if index == 13: | |
617 | self.volOpCode.setEnabled(True) |
|
617 | self.volOpCode.setEnabled(True) | |
618 | else: |
|
618 | else: | |
619 | self.volOpCode.setEnabled(False) |
|
619 | self.volOpCode.setEnabled(False) | |
620 |
|
620 | |||
621 | if index == 0: |
|
621 | if index == 0: | |
622 | code = '' |
|
622 | code = '' | |
623 | self.volOpCode.setText(str(code)) |
|
623 | self.volOpCode.setText(str(code)) | |
624 | return |
|
624 | return | |
625 |
|
625 | |||
626 | if index == 1: |
|
626 | if index == 1: | |
627 | code = '(1,1,-1)' |
|
627 | code = '(1,1,-1)' | |
628 | nCode = '1' |
|
628 | nCode = '1' | |
629 | nBaud = '3' |
|
629 | nBaud = '3' | |
630 | if index == 2: |
|
630 | if index == 2: | |
631 | code = '(1,1,-1,1)' |
|
631 | code = '(1,1,-1,1)' | |
632 | nCode = '1' |
|
632 | nCode = '1' | |
633 | nBaud = '4' |
|
633 | nBaud = '4' | |
634 | if index == 3: |
|
634 | if index == 3: | |
635 | code = '(1,1,1,-1,1)' |
|
635 | code = '(1,1,1,-1,1)' | |
636 | nCode = '1' |
|
636 | nCode = '1' | |
637 | nBaud = '5' |
|
637 | nBaud = '5' | |
638 | if index == 4: |
|
638 | if index == 4: | |
639 | code = '(1,1,1,-1,-1,1,-1)' |
|
639 | code = '(1,1,1,-1,-1,1,-1)' | |
640 | nCode = '1' |
|
640 | nCode = '1' | |
641 | nBaud = '7' |
|
641 | nBaud = '7' | |
642 | if index == 5: |
|
642 | if index == 5: | |
643 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
643 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
644 | nCode = '1' |
|
644 | nCode = '1' | |
645 | nBaud = '11' |
|
645 | nBaud = '11' | |
646 | if index == 6: |
|
646 | if index == 6: | |
647 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
647 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
648 | nCode = '1' |
|
648 | nCode = '1' | |
649 | nBaud = '13' |
|
649 | nBaud = '13' | |
650 | if index == 7: |
|
650 | if index == 7: | |
651 | code = '(1,1,-1,-1,-1,1)' |
|
651 | code = '(1,1,-1,-1,-1,1)' | |
652 | nCode = '2' |
|
652 | nCode = '2' | |
653 | nBaud = '3' |
|
653 | nBaud = '3' | |
654 | if index == 8: |
|
654 | if index == 8: | |
655 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
655 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
656 | nCode = '2' |
|
656 | nCode = '2' | |
657 | nBaud = '4' |
|
657 | nBaud = '4' | |
658 | if index == 9: |
|
658 | if index == 9: | |
659 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
659 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
660 | nCode = '2' |
|
660 | nCode = '2' | |
661 | nBaud = '5' |
|
661 | nBaud = '5' | |
662 | if index == 10: |
|
662 | if index == 10: | |
663 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
663 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
664 | nCode = '2' |
|
664 | nCode = '2' | |
665 | nBaud = '7' |
|
665 | nBaud = '7' | |
666 | if index == 11: |
|
666 | if index == 11: | |
667 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' |
|
667 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
668 | nCode = '2' |
|
668 | nCode = '2' | |
669 | nBaud = '11' |
|
669 | nBaud = '11' | |
670 | if index == 12: |
|
670 | if index == 12: | |
671 | 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)' |
|
671 | 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)' | |
672 | nCode = '2' |
|
672 | nCode = '2' | |
673 | nBaud = '13' |
|
673 | nBaud = '13' | |
674 |
|
674 | |||
675 | code = ast.literal_eval(code) |
|
675 | code = ast.literal_eval(code) | |
676 | nCode = int(nCode) |
|
676 | nCode = int(nCode) | |
677 | nBaud = int(nBaud) |
|
677 | nBaud = int(nBaud) | |
678 |
|
678 | |||
679 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
679 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
680 |
|
680 | |||
681 | self.volOpCode.setText(str(code)) |
|
681 | self.volOpCode.setText(str(code)) | |
682 |
|
682 | |||
683 | @pyqtSignature("int") |
|
683 | @pyqtSignature("int") | |
684 | def on_volOpCebFlip_stateChanged(self, p0): |
|
684 | def on_volOpCebFlip_stateChanged(self, p0): | |
685 | """ |
|
685 | """ | |
686 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
686 | Check Box habilita ingresode del numero de Integraciones a realizar | |
687 | """ |
|
687 | """ | |
688 | if p0 == 2: |
|
688 | if p0 == 2: | |
689 | self.volOpFlip.setEnabled(True) |
|
689 | self.volOpFlip.setEnabled(True) | |
690 | if p0 == 0: |
|
690 | if p0 == 0: | |
691 | self.volOpFlip.setEnabled(False) |
|
691 | self.volOpFlip.setEnabled(False) | |
692 | self.volOpFlip.clear() |
|
692 | self.volOpFlip.clear() | |
693 |
|
693 | |||
694 | @pyqtSignature("int") |
|
694 | @pyqtSignature("int") | |
695 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
695 | def on_volOpCebCohInt_stateChanged(self, p0): | |
696 | """ |
|
696 | """ | |
697 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
697 | Check Box habilita ingresode del numero de Integraciones a realizar | |
698 | """ |
|
698 | """ | |
699 | if p0 == 2: |
|
699 | if p0 == 2: | |
700 | self.volOpCohInt.setEnabled(True) |
|
700 | self.volOpCohInt.setEnabled(True) | |
701 | if p0 == 0: |
|
701 | if p0 == 0: | |
702 | self.volOpCohInt.setEnabled(False) |
|
702 | self.volOpCohInt.setEnabled(False) | |
703 | self.volOpCohInt.clear() |
|
703 | self.volOpCohInt.clear() | |
704 |
|
704 | |||
705 | @pyqtSignature("int") |
|
705 | @pyqtSignature("int") | |
706 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
706 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
707 | """ |
|
707 | """ | |
708 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
708 | Check Box habilita ingresode del numero de Integraciones a realizar | |
709 | """ |
|
709 | """ | |
710 | if p0 == 2: |
|
710 | if p0 == 2: | |
711 | self.volOpRadarfrequency.setEnabled(True) |
|
711 | self.volOpRadarfrequency.setEnabled(True) | |
712 | if p0 == 0: |
|
712 | if p0 == 0: | |
713 | self.volOpRadarfrequency.clear() |
|
713 | self.volOpRadarfrequency.clear() | |
714 | self.volOpRadarfrequency.setEnabled(False) |
|
714 | self.volOpRadarfrequency.setEnabled(False) | |
715 |
|
715 | |||
716 | @pyqtSignature("") |
|
716 | @pyqtSignature("") | |
717 | def on_volOutputToolPath_clicked(self): |
|
717 | def on_volOutputToolPath_clicked(self): | |
718 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
718 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
719 | self.volOutputPath.setText(dirOutPath) |
|
719 | self.volOutputPath.setText(dirOutPath) | |
720 |
|
720 | |||
721 | @pyqtSignature("") |
|
721 | @pyqtSignature("") | |
722 | def on_specOutputToolPath_clicked(self): |
|
722 | def on_specOutputToolPath_clicked(self): | |
723 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
723 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
724 | self.specOutputPath.setText(dirOutPath) |
|
724 | self.specOutputPath.setText(dirOutPath) | |
725 |
|
725 | |||
726 | @pyqtSignature("") |
|
726 | @pyqtSignature("") | |
727 | def on_specHeisOutputToolPath_clicked(self): |
|
727 | def on_specHeisOutputToolPath_clicked(self): | |
728 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
728 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
729 | self.specHeisOutputPath.setText(dirOutPath) |
|
729 | self.specHeisOutputPath.setText(dirOutPath) | |
730 |
|
730 | |||
731 | @pyqtSignature("") |
|
731 | @pyqtSignature("") | |
732 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
732 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
733 |
|
733 | |||
734 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
734 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
735 | self.specHeisOutputMetada.setText(filename) |
|
735 | self.specHeisOutputMetada.setText(filename) | |
736 |
|
736 | |||
737 | @pyqtSignature("") |
|
737 | @pyqtSignature("") | |
738 | def on_volOpOk_clicked(self): |
|
738 | def on_volOpOk_clicked(self): | |
739 | """ |
|
739 | """ | |
740 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
740 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
741 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
741 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
742 | """ |
|
742 | """ | |
743 |
|
743 | |||
744 | checkPath = False |
|
744 | checkPath = False | |
745 |
|
745 | |||
746 | self._disable_play_button() |
|
746 | self._disable_play_button() | |
747 | self._disable_save_button() |
|
747 | self._disable_save_button() | |
748 |
|
748 | |||
749 | self.console.clear() |
|
749 | self.console.clear() | |
750 | self.console.append("Checking input parameters ...") |
|
750 | self.console.append("Checking input parameters ...") | |
751 |
|
751 | |||
752 | puObj = self.getSelectedItemObj() |
|
752 | puObj = self.getSelectedItemObj() | |
753 | puObj.removeOperations() |
|
753 | puObj.removeOperations() | |
754 |
|
754 | |||
755 | if self.volOpCebRadarfrequency.isChecked(): |
|
755 | if self.volOpCebRadarfrequency.isChecked(): | |
756 | value = str(self.volOpRadarfrequency.text()) |
|
756 | value = str(self.volOpRadarfrequency.text()) | |
757 | format = 'float' |
|
757 | format = 'float' | |
758 | name_operation = 'setRadarFrequency' |
|
758 | name_operation = 'setRadarFrequency' | |
759 | name_parameter = 'frequency' |
|
759 | name_parameter = 'frequency' | |
760 | if not value == "": |
|
760 | if not value == "": | |
761 | try: |
|
761 | try: | |
762 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 |
|
762 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
763 | except: |
|
763 | except: | |
764 | self.console.clear() |
|
764 | self.console.clear() | |
765 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
765 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
766 | return 0 |
|
766 | return 0 | |
767 |
|
767 | |||
768 | opObj = puObj.addOperation(name=name_operation) |
|
768 | opObj = puObj.addOperation(name=name_operation) | |
769 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): |
|
769 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): | |
770 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
770 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
771 | return 0 |
|
771 | return 0 | |
772 |
|
772 | |||
773 | if self.volOpCebChannels.isChecked(): |
|
773 | if self.volOpCebChannels.isChecked(): | |
774 | value = str(self.volOpChannel.text()) |
|
774 | value = str(self.volOpChannel.text()) | |
775 |
|
775 | |||
776 | if value == "": |
|
776 | if value == "": | |
777 | print "Please fill channel list" |
|
777 | print "Please fill channel list" | |
778 | return 0 |
|
778 | return 0 | |
779 |
|
779 | |||
780 | format = 'intlist' |
|
780 | format = 'intlist' | |
781 | if self.volOpComChannels.currentIndex() == 0: |
|
781 | if self.volOpComChannels.currentIndex() == 0: | |
782 | name_operation = "selectChannels" |
|
782 | name_operation = "selectChannels" | |
783 | name_parameter = 'channelList' |
|
783 | name_parameter = 'channelList' | |
784 | else: |
|
784 | else: | |
785 | name_operation = "selectChannelsByIndex" |
|
785 | name_operation = "selectChannelsByIndex" | |
786 | name_parameter = 'channelIndexList' |
|
786 | name_parameter = 'channelIndexList' | |
787 |
|
787 | |||
788 | opObj = puObj.addOperation(name=name_operation) |
|
788 | opObj = puObj.addOperation(name=name_operation) | |
789 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
789 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
790 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
790 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
791 | return 0 |
|
791 | return 0 | |
792 |
|
792 | |||
793 | if self.volOpCebHeights.isChecked(): |
|
793 | if self.volOpCebHeights.isChecked(): | |
794 | value = str(self.volOpHeights.text()) |
|
794 | value = str(self.volOpHeights.text()) | |
795 |
|
795 | |||
796 | if value == "": |
|
796 | if value == "": | |
797 | print "Please fill height range" |
|
797 | print "Please fill height range" | |
798 | return 0 |
|
798 | return 0 | |
799 |
|
799 | |||
800 | valueList = value.split(',') |
|
800 | valueList = value.split(',') | |
801 |
|
801 | |||
802 | if self.volOpComHeights.currentIndex() == 0: |
|
802 | if self.volOpComHeights.currentIndex() == 0: | |
803 | format = 'float' |
|
803 | format = 'float' | |
804 | name_operation = 'selectHeights' |
|
804 | name_operation = 'selectHeights' | |
805 | name_parameter1 = 'minHei' |
|
805 | name_parameter1 = 'minHei' | |
806 | name_parameter2 = 'maxHei' |
|
806 | name_parameter2 = 'maxHei' | |
807 | else: |
|
807 | else: | |
808 | format = 'int' |
|
808 | format = 'int' | |
809 | name_operation = 'selectHeightsByIndex' |
|
809 | name_operation = 'selectHeightsByIndex' | |
810 | name_parameter1 = 'minIndex' |
|
810 | name_parameter1 = 'minIndex' | |
811 | name_parameter2 = 'maxIndex' |
|
811 | name_parameter2 = 'maxIndex' | |
812 |
|
812 | |||
813 | opObj = puObj.addOperation(name=name_operation) |
|
813 | opObj = puObj.addOperation(name=name_operation) | |
814 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
814 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
815 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
815 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
816 |
|
816 | |||
817 | if self.volOpCebFilter.isChecked(): |
|
817 | if self.volOpCebFilter.isChecked(): | |
818 | value = str(self.volOpFilter.text()) |
|
818 | value = str(self.volOpFilter.text()) | |
819 | if value == "": |
|
819 | if value == "": | |
820 | print "Please fill filter value" |
|
820 | print "Please fill filter value" | |
821 | return 0 |
|
821 | return 0 | |
822 |
|
822 | |||
823 | format = 'int' |
|
823 | format = 'int' | |
824 | name_operation = 'filterByHeights' |
|
824 | name_operation = 'filterByHeights' | |
825 | name_parameter = 'window' |
|
825 | name_parameter = 'window' | |
826 | opObj = puObj.addOperation(name=name_operation) |
|
826 | opObj = puObj.addOperation(name=name_operation) | |
827 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
827 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
828 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
828 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
829 | return 0 |
|
829 | return 0 | |
830 |
|
830 | |||
831 | if self.volOpCebProfile.isChecked(): |
|
831 | if self.volOpCebProfile.isChecked(): | |
832 | value = str(self.volOpProfile.text()) |
|
832 | value = str(self.volOpProfile.text()) | |
833 |
|
833 | |||
834 | if value == "": |
|
834 | if value == "": | |
835 | print "Please fill profile value" |
|
835 | print "Please fill profile value" | |
836 | return 0 |
|
836 | return 0 | |
837 |
|
837 | |||
838 | format = 'intlist' |
|
838 | format = 'intlist' | |
839 | optype = 'other' |
|
839 | optype = 'other' | |
840 | name_operation = 'ProfileSelector' |
|
840 | name_operation = 'ProfileSelector' | |
841 | if self.volOpComProfile.currentIndex() == 0: |
|
841 | if self.volOpComProfile.currentIndex() == 0: | |
842 | name_parameter = 'profileList' |
|
842 | name_parameter = 'profileList' | |
843 | if self.volOpComProfile.currentIndex() == 1: |
|
843 | if self.volOpComProfile.currentIndex() == 1: | |
844 | name_parameter = 'profileRangeList' |
|
844 | name_parameter = 'profileRangeList' | |
845 | if self.volOpComProfile.currentIndex() == 2: |
|
845 | if self.volOpComProfile.currentIndex() == 2: | |
846 | name_parameter = 'rangeList' |
|
846 | name_parameter = 'rangeList' | |
847 |
|
847 | |||
848 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
848 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
849 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
849 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
850 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
850 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
851 | return 0 |
|
851 | return 0 | |
852 |
|
852 | |||
853 | if self.volOpCebDecodification.isChecked(): |
|
853 | if self.volOpCebDecodification.isChecked(): | |
854 | name_operation = 'Decoder' |
|
854 | name_operation = 'Decoder' | |
855 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
855 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
856 |
|
856 | |||
857 | #User defined |
|
857 | #User defined | |
858 | nBaud = None |
|
858 | nBaud = None | |
859 | nCode = None |
|
859 | nCode = None | |
860 |
|
860 | |||
861 | code = str(self.volOpCode.text()) |
|
861 | code = str(self.volOpCode.text()) | |
862 | try: |
|
862 | try: | |
863 | code_tmp = ast.literal_eval(code) |
|
863 | code_tmp = ast.literal_eval(code) | |
864 | except: |
|
864 | except: | |
865 | code_tmp = [] |
|
865 | code_tmp = [] | |
866 |
|
866 | |||
867 | if len(code_tmp) > 0: |
|
867 | if len(code_tmp) > 0: | |
868 |
|
868 | |||
869 | if type(code_tmp) not in (tuple, list): |
|
869 | if type(code_tmp) not in (tuple, list): | |
870 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
870 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
871 | return 0 |
|
871 | return 0 | |
872 |
|
872 | |||
873 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] |
|
873 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] | |
874 | nBaud = len(code_tmp[0]) |
|
874 | nBaud = len(code_tmp[0]) | |
875 | nCode = len(code_tmp) |
|
875 | nCode = len(code_tmp) | |
876 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] |
|
876 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] | |
877 | nBaud = len(code_tmp[0]) |
|
877 | nBaud = len(code_tmp[0]) | |
878 | nCode = 1 |
|
878 | nCode = 1 | |
879 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) |
|
879 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) | |
880 | nBaud = len(code_tmp) |
|
880 | nBaud = len(code_tmp) | |
881 | nCode = 1 |
|
881 | nCode = 1 | |
882 | else: |
|
882 | else: | |
883 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
883 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
884 | return 0 |
|
884 | return 0 | |
885 |
|
885 | |||
886 | if not nBaud or not nCode: |
|
886 | if not nBaud or not nCode: | |
887 | self.console.append("Please write a right value for Code") |
|
887 | self.console.append("Please write a right value for Code") | |
888 | return 0 |
|
888 | return 0 | |
889 |
|
889 | |||
890 | code = code.replace("(", "") |
|
890 | code = code.replace("(", "") | |
891 | code = code.replace(")", "") |
|
891 | code = code.replace(")", "") | |
892 | code = code.replace("[", "") |
|
892 | code = code.replace("[", "") | |
893 | code = code.replace("]", "") |
|
893 | code = code.replace("]", "") | |
894 |
|
894 | |||
895 | if not opObj.addParameter(name='code', value=code, format='intlist'): |
|
895 | if not opObj.addParameter(name='code', value=code, format='intlist'): | |
896 | self.console.append("Please write a right value for Code") |
|
896 | self.console.append("Please write a right value for Code") | |
897 | return 0 |
|
897 | return 0 | |
898 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): |
|
898 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): | |
899 | self.console.append("Please write a right value for Code") |
|
899 | self.console.append("Please write a right value for Code") | |
900 | return 0 |
|
900 | return 0 | |
901 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): |
|
901 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): | |
902 | self.console.append("Please write a right value for Code") |
|
902 | self.console.append("Please write a right value for Code") | |
903 | return 0 |
|
903 | return 0 | |
904 |
|
904 | |||
905 | name_parameter = 'mode' |
|
905 | name_parameter = 'mode' | |
906 | format = 'int' |
|
906 | format = 'int' | |
907 |
|
907 | |||
908 | value = str(self.volOpComMode.currentIndex()) |
|
908 | value = str(self.volOpComMode.currentIndex()) | |
909 |
|
909 | |||
910 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
910 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
911 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
911 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
912 | return 0 |
|
912 | return 0 | |
913 |
|
913 | |||
914 |
|
914 | |||
915 | if self.volOpCebFlip.isChecked(): |
|
915 | if self.volOpCebFlip.isChecked(): | |
916 | name_operation = 'deFlip' |
|
916 | name_operation = 'deFlip' | |
917 | optype = 'self' |
|
917 | optype = 'self' | |
918 |
|
918 | |||
919 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
919 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
920 |
|
920 | |||
921 | name_parameter = 'channelList' |
|
921 | name_parameter = 'channelList' | |
922 | format = 'intlist' |
|
922 | format = 'intlist' | |
923 | value = str(self.volOpFlip.text()) |
|
923 | value = str(self.volOpFlip.text()) | |
924 |
|
924 | |||
925 | if value != "": |
|
925 | if value != "": | |
926 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
926 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
927 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
927 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
928 | return 0 |
|
928 | return 0 | |
929 |
|
929 | |||
930 | if self.volOpCebCohInt.isChecked(): |
|
930 | if self.volOpCebCohInt.isChecked(): | |
931 | name_operation = 'CohInt' |
|
931 | name_operation = 'CohInt' | |
932 | optype = 'other' |
|
932 | optype = 'other' | |
933 | value = str(self.volOpCohInt.text()) |
|
933 | value = str(self.volOpCohInt.text()) | |
934 |
|
934 | |||
935 | if value == "": |
|
935 | if value == "": | |
936 | print "Please fill number of coherent integrations" |
|
936 | print "Please fill number of coherent integrations" | |
937 | return 0 |
|
937 | return 0 | |
938 |
|
938 | |||
939 | name_parameter = 'n' |
|
939 | name_parameter = 'n' | |
940 | format = 'int' |
|
940 | format = 'int' | |
941 |
|
941 | |||
942 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
942 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
943 |
|
943 | |||
944 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
944 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
945 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
945 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
946 | return 0 |
|
946 | return 0 | |
947 |
|
947 | |||
948 | if self.volGraphCebshow.isChecked(): |
|
948 | if self.volGraphCebshow.isChecked(): | |
949 | name_operation = 'Scope' |
|
949 | name_operation = 'Scope' | |
950 | optype = 'other' |
|
950 | optype = 'other' | |
951 | name_parameter = 'type' |
|
951 | name_parameter = 'type' | |
952 | value = 'Scope' |
|
952 | value = 'Scope' | |
953 | if self.idImagscope == 0: |
|
953 | if self.idImagscope == 0: | |
954 | self.idImagscope = 100 |
|
954 | self.idImagscope = 100 | |
955 | else: |
|
955 | else: | |
956 | self.idImagscope = self.idImagscope + 1 |
|
956 | self.idImagscope = self.idImagscope + 1 | |
957 |
|
957 | |||
958 | name_parameter1 = 'id' |
|
958 | name_parameter1 = 'id' | |
959 | value1 = int(self.idImagscope) |
|
959 | value1 = int(self.idImagscope) | |
960 | format1 = 'int' |
|
960 | format1 = 'int' | |
961 | format = 'str' |
|
961 | format = 'str' | |
962 |
|
962 | |||
963 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
963 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
964 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
964 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
965 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
965 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
966 |
|
966 | |||
967 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
967 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
968 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
968 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
969 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
969 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
970 |
|
970 | |||
971 | if channelList: |
|
971 | if channelList: | |
972 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
972 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
973 |
|
973 | |||
974 | if xvalue: |
|
974 | if xvalue: | |
975 | xvalueList = xvalue.split(',') |
|
975 | xvalueList = xvalue.split(',') | |
976 | try: |
|
976 | try: | |
977 | value0 = float(xvalueList[0]) |
|
977 | value0 = float(xvalueList[0]) | |
978 | value1 = float(xvalueList[1]) |
|
978 | value1 = float(xvalueList[1]) | |
979 | except: |
|
979 | except: | |
980 | return 0 |
|
980 | return 0 | |
981 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
981 | opObj.addParameter(name='xmin', value=value0, format='float') | |
982 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
982 | opObj.addParameter(name='xmax', value=value1, format='float') | |
983 |
|
983 | |||
984 |
|
984 | |||
985 | if not yvalue == "": |
|
985 | if not yvalue == "": | |
986 | yvalueList = yvalue.split(",") |
|
986 | yvalueList = yvalue.split(",") | |
987 | try: |
|
987 | try: | |
988 | value0 = int(yvalueList[0]) |
|
988 | value0 = int(yvalueList[0]) | |
989 | value1 = int(yvalueList[1]) |
|
989 | value1 = int(yvalueList[1]) | |
990 | except: |
|
990 | except: | |
991 | return 0 |
|
991 | return 0 | |
992 |
|
992 | |||
993 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
993 | opObj.addParameter(name='ymin', value=value0, format='int') | |
994 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
994 | opObj.addParameter(name='ymax', value=value1, format='int') | |
995 |
|
995 | |||
996 | if self.volGraphCebSave.isChecked(): |
|
996 | if self.volGraphCebSave.isChecked(): | |
997 | checkPath = True |
|
997 | checkPath = True | |
998 | opObj.addParameter(name='save', value='1', format='int') |
|
998 | opObj.addParameter(name='save', value='1', format='int') | |
999 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') |
|
999 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') | |
1000 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
1000 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
1001 | if value: |
|
1001 | if value: | |
1002 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1002 | opObj.addParameter(name='figfile', value=value, format='str') | |
1003 |
|
1003 | |||
1004 | localfolder = None |
|
1004 | localfolder = None | |
1005 | if checkPath: |
|
1005 | if checkPath: | |
1006 | localfolder = str(self.volGraphPath.text()) |
|
1006 | localfolder = str(self.volGraphPath.text()) | |
1007 | if localfolder == '': |
|
1007 | if localfolder == '': | |
1008 | self.console.clear() |
|
1008 | self.console.clear() | |
1009 | self.console.append("Graphic path should be defined") |
|
1009 | self.console.append("Graphic path should be defined") | |
1010 | return 0 |
|
1010 | return 0 | |
1011 |
|
1011 | |||
1012 | # if something happend |
|
1012 | # if something happend | |
1013 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1013 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1014 | if parms_ok: |
|
1014 | if parms_ok: | |
1015 | name_operation = 'VoltageWriter' |
|
1015 | name_operation = 'VoltageWriter' | |
1016 | optype = 'other' |
|
1016 | optype = 'other' | |
1017 | name_parameter1 = 'path' |
|
1017 | name_parameter1 = 'path' | |
1018 | name_parameter2 = 'blocksPerFile' |
|
1018 | name_parameter2 = 'blocksPerFile' | |
1019 | name_parameter3 = 'profilesPerBlock' |
|
1019 | name_parameter3 = 'profilesPerBlock' | |
1020 | value1 = output_path |
|
1020 | value1 = output_path | |
1021 | value2 = blocksperfile |
|
1021 | value2 = blocksperfile | |
1022 | value3 = profilesperblock |
|
1022 | value3 = profilesperblock | |
1023 | format = "int" |
|
1023 | format = "int" | |
1024 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1024 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1025 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1025 | opObj.addParameter(name=name_parameter1, value=value1) | |
1026 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1026 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1027 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1027 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1028 |
|
1028 | |||
1029 | self.console.clear() |
|
1029 | self.console.clear() | |
1030 | try: |
|
1030 | try: | |
1031 | self.refreshPUProperties(puObj) |
|
1031 | self.refreshPUProperties(puObj) | |
1032 | except: |
|
1032 | except: | |
1033 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1033 | self.console.append("An error reading input parameters was found ...Check them!") | |
1034 | return 0 |
|
1034 | return 0 | |
1035 |
|
1035 | |||
1036 | self.console.append("Save your project and press Play button to start signal processing") |
|
1036 | self.console.append("Save your project and press Play button to start signal processing") | |
1037 |
|
1037 | |||
1038 | self._enable_play_button() |
|
1038 | self._enable_play_button() | |
1039 | self._enable_save_button() |
|
1039 | self._enable_save_button() | |
1040 |
|
1040 | |||
1041 | return 1 |
|
1041 | return 1 | |
1042 |
|
1042 | |||
1043 | """ |
|
1043 | """ | |
1044 | Voltage Graph |
|
1044 | Voltage Graph | |
1045 | """ |
|
1045 | """ | |
1046 | @pyqtSignature("int") |
|
1046 | @pyqtSignature("int") | |
1047 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1047 | def on_volGraphCebSave_stateChanged(self, p0): | |
1048 | """ |
|
1048 | """ | |
1049 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1049 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1050 | """ |
|
1050 | """ | |
1051 | if p0 == 2: |
|
1051 | if p0 == 2: | |
1052 | self.volGraphPath.setEnabled(True) |
|
1052 | self.volGraphPath.setEnabled(True) | |
1053 | self.volGraphPrefix.setEnabled(True) |
|
1053 | self.volGraphPrefix.setEnabled(True) | |
1054 | self.volGraphToolPath.setEnabled(True) |
|
1054 | self.volGraphToolPath.setEnabled(True) | |
1055 |
|
1055 | |||
1056 | if p0 == 0: |
|
1056 | if p0 == 0: | |
1057 | self.volGraphPath.setEnabled(False) |
|
1057 | self.volGraphPath.setEnabled(False) | |
1058 | self.volGraphPrefix.setEnabled(False) |
|
1058 | self.volGraphPrefix.setEnabled(False) | |
1059 | self.volGraphToolPath.setEnabled(False) |
|
1059 | self.volGraphToolPath.setEnabled(False) | |
1060 |
|
1060 | |||
1061 | @pyqtSignature("") |
|
1061 | @pyqtSignature("") | |
1062 | def on_volGraphToolPath_clicked(self): |
|
1062 | def on_volGraphToolPath_clicked(self): | |
1063 | """ |
|
1063 | """ | |
1064 | Donde se guardan los DATOS |
|
1064 | Donde se guardan los DATOS | |
1065 | """ |
|
1065 | """ | |
1066 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1066 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1067 | self.volGraphPath.setText(save_path) |
|
1067 | self.volGraphPath.setText(save_path) | |
1068 |
|
1068 | |||
1069 | if not os.path.exists(save_path): |
|
1069 | if not os.path.exists(save_path): | |
1070 | self.console.clear() |
|
1070 | self.console.clear() | |
1071 | self.console.append("Set a valid path") |
|
1071 | self.console.append("Set a valid path") | |
1072 | self.volGraphOk.setEnabled(False) |
|
1072 | self.volGraphOk.setEnabled(False) | |
1073 | return |
|
1073 | return | |
1074 |
|
1074 | |||
1075 | @pyqtSignature("int") |
|
1075 | @pyqtSignature("int") | |
1076 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1076 | def on_volGraphCebshow_stateChanged(self, p0): | |
1077 | """ |
|
1077 | """ | |
1078 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1078 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1079 | """ |
|
1079 | """ | |
1080 | if p0 == 0: |
|
1080 | if p0 == 0: | |
1081 |
|
1081 | |||
1082 | self.volGraphChannelList.setEnabled(False) |
|
1082 | self.volGraphChannelList.setEnabled(False) | |
1083 | self.volGraphfreqrange.setEnabled(False) |
|
1083 | self.volGraphfreqrange.setEnabled(False) | |
1084 | self.volGraphHeightrange.setEnabled(False) |
|
1084 | self.volGraphHeightrange.setEnabled(False) | |
1085 | if p0 == 2: |
|
1085 | if p0 == 2: | |
1086 |
|
1086 | |||
1087 | self.volGraphChannelList.setEnabled(True) |
|
1087 | self.volGraphChannelList.setEnabled(True) | |
1088 | self.volGraphfreqrange.setEnabled(True) |
|
1088 | self.volGraphfreqrange.setEnabled(True) | |
1089 | self.volGraphHeightrange.setEnabled(True) |
|
1089 | self.volGraphHeightrange.setEnabled(True) | |
1090 |
|
1090 | |||
1091 | """ |
|
1091 | """ | |
1092 | Spectra operation |
|
1092 | Spectra operation | |
1093 | """ |
|
1093 | """ | |
1094 | @pyqtSignature("int") |
|
1094 | @pyqtSignature("int") | |
1095 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1095 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1096 | """ |
|
1096 | """ | |
1097 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1097 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1098 | """ |
|
1098 | """ | |
1099 | if p0 == 2: |
|
1099 | if p0 == 2: | |
1100 | self.specOpRadarfrequency.setEnabled(True) |
|
1100 | self.specOpRadarfrequency.setEnabled(True) | |
1101 | if p0 == 0: |
|
1101 | if p0 == 0: | |
1102 | self.specOpRadarfrequency.clear() |
|
1102 | self.specOpRadarfrequency.clear() | |
1103 | self.specOpRadarfrequency.setEnabled(False) |
|
1103 | self.specOpRadarfrequency.setEnabled(False) | |
1104 |
|
1104 | |||
1105 |
|
1105 | |||
1106 | @pyqtSignature("int") |
|
1106 | @pyqtSignature("int") | |
1107 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1107 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1108 | """ |
|
1108 | """ | |
1109 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1109 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1110 | """ |
|
1110 | """ | |
1111 | if p0 == 2: |
|
1111 | if p0 == 2: | |
1112 | # self.specOpnFFTpoints.setEnabled(True) |
|
1112 | # self.specOpnFFTpoints.setEnabled(True) | |
1113 | self.specOppairsList.setEnabled(True) |
|
1113 | self.specOppairsList.setEnabled(True) | |
1114 | if p0 == 0: |
|
1114 | if p0 == 0: | |
1115 | # self.specOpnFFTpoints.setEnabled(False) |
|
1115 | # self.specOpnFFTpoints.setEnabled(False) | |
1116 | self.specOppairsList.setEnabled(False) |
|
1116 | self.specOppairsList.setEnabled(False) | |
1117 |
|
1117 | |||
1118 | @pyqtSignature("int") |
|
1118 | @pyqtSignature("int") | |
1119 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1119 | def on_specOpCebChannel_stateChanged(self, p0): | |
1120 | """ |
|
1120 | """ | |
1121 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1121 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1122 | """ |
|
1122 | """ | |
1123 | if p0 == 2: |
|
1123 | if p0 == 2: | |
1124 | self.specOpChannel.setEnabled(True) |
|
1124 | self.specOpChannel.setEnabled(True) | |
1125 | self.specOpComChannel.setEnabled(True) |
|
1125 | self.specOpComChannel.setEnabled(True) | |
1126 | if p0 == 0: |
|
1126 | if p0 == 0: | |
1127 | self.specOpChannel.setEnabled(False) |
|
1127 | self.specOpChannel.setEnabled(False) | |
1128 | self.specOpComChannel.setEnabled(False) |
|
1128 | self.specOpComChannel.setEnabled(False) | |
1129 |
|
1129 | |||
1130 | @pyqtSignature("int") |
|
1130 | @pyqtSignature("int") | |
1131 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1131 | def on_specOpCebHeights_stateChanged(self, p0): | |
1132 | """ |
|
1132 | """ | |
1133 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1133 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1134 | """ |
|
1134 | """ | |
1135 | if p0 == 2: |
|
1135 | if p0 == 2: | |
1136 | self.specOpComHeights.setEnabled(True) |
|
1136 | self.specOpComHeights.setEnabled(True) | |
1137 | self.specOpHeights.setEnabled(True) |
|
1137 | self.specOpHeights.setEnabled(True) | |
1138 | if p0 == 0: |
|
1138 | if p0 == 0: | |
1139 | self.specOpComHeights.setEnabled(False) |
|
1139 | self.specOpComHeights.setEnabled(False) | |
1140 | self.specOpHeights.setEnabled(False) |
|
1140 | self.specOpHeights.setEnabled(False) | |
1141 |
|
1141 | |||
1142 |
|
1142 | |||
1143 | @pyqtSignature("int") |
|
1143 | @pyqtSignature("int") | |
1144 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1144 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1145 | """ |
|
1145 | """ | |
1146 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1146 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1147 | """ |
|
1147 | """ | |
1148 | if p0 == 2: |
|
1148 | if p0 == 2: | |
1149 | self.specOpIncoherent.setEnabled(True) |
|
1149 | self.specOpIncoherent.setEnabled(True) | |
1150 | if p0 == 0: |
|
1150 | if p0 == 0: | |
1151 | self.specOpIncoherent.setEnabled(False) |
|
1151 | self.specOpIncoherent.setEnabled(False) | |
1152 |
|
1152 | |||
1153 | @pyqtSignature("int") |
|
1153 | @pyqtSignature("int") | |
1154 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1154 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1155 | """ |
|
1155 | """ | |
1156 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1156 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1157 | """ |
|
1157 | """ | |
1158 | if p0 == 2: |
|
1158 | if p0 == 2: | |
1159 | self.specOpComRemoveDC.setEnabled(True) |
|
1159 | self.specOpComRemoveDC.setEnabled(True) | |
1160 | if p0 == 0: |
|
1160 | if p0 == 0: | |
1161 | self.specOpComRemoveDC.setEnabled(False) |
|
1161 | self.specOpComRemoveDC.setEnabled(False) | |
1162 |
|
1162 | |||
1163 | @pyqtSignature("int") |
|
1163 | @pyqtSignature("int") | |
1164 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1164 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1165 | """ |
|
1165 | """ | |
1166 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1166 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1167 | """ |
|
1167 | """ | |
1168 | if p0 == 2: |
|
1168 | if p0 == 2: | |
1169 | self.specOpgetNoise.setEnabled(True) |
|
1169 | self.specOpgetNoise.setEnabled(True) | |
1170 |
|
1170 | |||
1171 | if p0 == 0: |
|
1171 | if p0 == 0: | |
1172 | self.specOpgetNoise.setEnabled(False) |
|
1172 | self.specOpgetNoise.setEnabled(False) | |
1173 |
|
1173 | |||
1174 | @pyqtSignature("") |
|
1174 | @pyqtSignature("") | |
1175 | def on_specOpOk_clicked(self): |
|
1175 | def on_specOpOk_clicked(self): | |
1176 | """ |
|
1176 | """ | |
1177 | AΓADE OPERACION SPECTRA |
|
1177 | AΓADE OPERACION SPECTRA | |
1178 | """ |
|
1178 | """ | |
1179 |
|
1179 | |||
1180 | addFTP = False |
|
1180 | addFTP = False | |
1181 | checkPath = False |
|
1181 | checkPath = False | |
1182 |
|
1182 | |||
1183 | self._disable_play_button() |
|
1183 | self._disable_play_button() | |
1184 | self._disable_save_button() |
|
1184 | self._disable_save_button() | |
1185 |
|
1185 | |||
1186 | self.console.clear() |
|
1186 | self.console.clear() | |
1187 | self.console.append("Checking input parameters ...") |
|
1187 | self.console.append("Checking input parameters ...") | |
1188 |
|
1188 | |||
1189 | projectObj = self.getSelectedProjectObj() |
|
1189 | projectObj = self.getSelectedProjectObj() | |
1190 |
|
1190 | |||
1191 | if not projectObj: |
|
1191 | if not projectObj: | |
1192 | self.console.append("Please select a project before update it") |
|
1192 | self.console.append("Please select a project before update it") | |
1193 | return |
|
1193 | return | |
1194 |
|
1194 | |||
1195 | puObj = self.getSelectedItemObj() |
|
1195 | puObj = self.getSelectedItemObj() | |
1196 |
|
1196 | |||
1197 | puObj.removeOperations() |
|
1197 | puObj.removeOperations() | |
1198 |
|
1198 | |||
1199 | if self.specOpCebRadarfrequency.isChecked(): |
|
1199 | if self.specOpCebRadarfrequency.isChecked(): | |
1200 | value = str(self.specOpRadarfrequency.text()) |
|
1200 | value = str(self.specOpRadarfrequency.text()) | |
1201 | format = 'float' |
|
1201 | format = 'float' | |
1202 | name_operation = 'setRadarFrequency' |
|
1202 | name_operation = 'setRadarFrequency' | |
1203 | name_parameter = 'frequency' |
|
1203 | name_parameter = 'frequency' | |
1204 |
|
1204 | |||
1205 | if not isFloat(value): |
|
1205 | if not isFloat(value): | |
1206 | self.console.clear() |
|
1206 | self.console.clear() | |
1207 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1207 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1208 | return 0 |
|
1208 | return 0 | |
1209 |
|
1209 | |||
1210 | radarfreq = float(value)*1e6 |
|
1210 | radarfreq = float(value)*1e6 | |
1211 | opObj = puObj.addOperation(name=name_operation) |
|
1211 | opObj = puObj.addOperation(name=name_operation) | |
1212 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1212 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1213 |
|
1213 | |||
1214 | inputId = puObj.getInputId() |
|
1214 | inputId = puObj.getInputId() | |
1215 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1215 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1216 |
|
1216 | |||
1217 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1217 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1218 |
|
1218 | |||
1219 | value = str(self.specOpnFFTpoints.text()) |
|
1219 | value = str(self.specOpnFFTpoints.text()) | |
1220 |
|
1220 | |||
1221 | if not isInt(value): |
|
1221 | if not isInt(value): | |
1222 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) |
|
1222 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) | |
1223 | return 0 |
|
1223 | return 0 | |
1224 |
|
1224 | |||
1225 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1225 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1226 |
|
1226 | |||
1227 | value = str(self.specOpProfiles.text()) |
|
1227 | value = str(self.specOpProfiles.text()) | |
1228 | if not isInt(value): |
|
1228 | if not isInt(value): | |
1229 | self.console.append("Please write a value on Profiles field") |
|
1229 | self.console.append("Please write a value on Profiles field") | |
1230 | else: |
|
1230 | else: | |
1231 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1231 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1232 |
|
1232 | |||
1233 | value = str(self.specOpippFactor.text()) |
|
1233 | value = str(self.specOpippFactor.text()) | |
1234 | if not isInt(value): |
|
1234 | if not isInt(value): | |
1235 | self.console.append("Please write a value on IppFactor field") |
|
1235 | self.console.append("Please write a value on IppFactor field") | |
1236 | else: |
|
1236 | else: | |
1237 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1237 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1238 |
|
1238 | |||
1239 | if self.specOpCebCrossSpectra.isChecked(): |
|
1239 | if self.specOpCebCrossSpectra.isChecked(): | |
1240 | name_parameter = 'pairsList' |
|
1240 | name_parameter = 'pairsList' | |
1241 | format = 'pairslist' |
|
1241 | format = 'pairslist' | |
1242 | value = str(self.specOppairsList.text()) |
|
1242 | value = str(self.specOppairsList.text()) | |
1243 |
|
1243 | |||
1244 | if value == "": |
|
1244 | if value == "": | |
1245 | print "Please fill the pairs list field" |
|
1245 | print "Please fill the pairs list field" | |
1246 | return 0 |
|
1246 | return 0 | |
1247 |
|
1247 | |||
1248 |
if not |
|
1248 | if not puObj.addParameter(name=name_parameter, value=value, format=format): | |
1249 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1249 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1250 | return 0 |
|
1250 | return 0 | |
1251 |
|
1251 | |||
1252 | if self.specOpCebHeights.isChecked(): |
|
1252 | if self.specOpCebHeights.isChecked(): | |
1253 | value = str(self.specOpHeights.text()) |
|
1253 | value = str(self.specOpHeights.text()) | |
1254 |
|
1254 | |||
1255 | if value == "": |
|
1255 | if value == "": | |
1256 | self.console.append("Empty value for '%s'" %(value, "Height range")) |
|
1256 | self.console.append("Empty value for '%s'" %(value, "Height range")) | |
1257 | return 0 |
|
1257 | return 0 | |
1258 |
|
1258 | |||
1259 | valueList = value.split(',') |
|
1259 | valueList = value.split(',') | |
1260 | format = 'float' |
|
1260 | format = 'float' | |
1261 | value0 = valueList[0] |
|
1261 | value0 = valueList[0] | |
1262 | value1 = valueList[1] |
|
1262 | value1 = valueList[1] | |
1263 |
|
1263 | |||
1264 | if not isFloat(value0) or not isFloat(value1): |
|
1264 | if not isFloat(value0) or not isFloat(value1): | |
1265 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) |
|
1265 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) | |
1266 | return 0 |
|
1266 | return 0 | |
1267 |
|
1267 | |||
1268 | if self.specOpComHeights.currentIndex() == 0: |
|
1268 | if self.specOpComHeights.currentIndex() == 0: | |
1269 | name_operation = 'selectHeights' |
|
1269 | name_operation = 'selectHeights' | |
1270 | name_parameter1 = 'minHei' |
|
1270 | name_parameter1 = 'minHei' | |
1271 | name_parameter2 = 'maxHei' |
|
1271 | name_parameter2 = 'maxHei' | |
1272 | else: |
|
1272 | else: | |
1273 | name_operation = 'selectHeightsByIndex' |
|
1273 | name_operation = 'selectHeightsByIndex' | |
1274 | name_parameter1 = 'minIndex' |
|
1274 | name_parameter1 = 'minIndex' | |
1275 | name_parameter2 = 'maxIndex' |
|
1275 | name_parameter2 = 'maxIndex' | |
1276 |
|
1276 | |||
1277 | opObj = puObj.addOperation(name=name_operation) |
|
1277 | opObj = puObj.addOperation(name=name_operation) | |
1278 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1278 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1279 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1279 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1280 |
|
1280 | |||
1281 | if self.specOpCebChannel.isChecked(): |
|
1281 | if self.specOpCebChannel.isChecked(): | |
1282 |
|
1282 | |||
1283 | if self.specOpComChannel.currentIndex() == 0: |
|
1283 | if self.specOpComChannel.currentIndex() == 0: | |
1284 | name_operation = "selectChannels" |
|
1284 | name_operation = "selectChannels" | |
1285 | name_parameter = 'channelList' |
|
1285 | name_parameter = 'channelList' | |
1286 | else: |
|
1286 | else: | |
1287 | name_operation = "selectChannelsByIndex" |
|
1287 | name_operation = "selectChannelsByIndex" | |
1288 | name_parameter = 'channelIndexList' |
|
1288 | name_parameter = 'channelIndexList' | |
1289 |
|
1289 | |||
1290 | format = 'intlist' |
|
1290 | format = 'intlist' | |
1291 | value = str(self.specOpChannel.text()) |
|
1291 | value = str(self.specOpChannel.text()) | |
1292 |
|
1292 | |||
1293 | if value == "": |
|
1293 | if value == "": | |
1294 | print "Please fill channel list" |
|
1294 | print "Please fill channel list" | |
1295 | return 0 |
|
1295 | return 0 | |
1296 |
|
1296 | |||
1297 | if not isList(value): |
|
1297 | if not isList(value): | |
1298 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1298 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1299 | return 0 |
|
1299 | return 0 | |
1300 |
|
1300 | |||
1301 | opObj = puObj.addOperation(name=name_operation) |
|
1301 | opObj = puObj.addOperation(name=name_operation) | |
1302 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1302 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1303 |
|
1303 | |||
1304 | if self.specOpCebIncoherent.isChecked(): |
|
1304 | if self.specOpCebIncoherent.isChecked(): | |
1305 |
|
1305 | |||
1306 | name_operation = 'IncohInt' |
|
1306 | name_operation = 'IncohInt' | |
1307 | optype = 'other' |
|
1307 | optype = 'other' | |
1308 |
|
1308 | |||
1309 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1309 | if self.specOpCobIncInt.currentIndex() == 0: | |
1310 | name_parameter = 'timeInterval' |
|
1310 | name_parameter = 'timeInterval' | |
1311 | format = 'float' |
|
1311 | format = 'float' | |
1312 | else: |
|
1312 | else: | |
1313 | name_parameter = 'n' |
|
1313 | name_parameter = 'n' | |
1314 | format = 'int' |
|
1314 | format = 'int' | |
1315 |
|
1315 | |||
1316 | value = str(self.specOpIncoherent.text()) |
|
1316 | value = str(self.specOpIncoherent.text()) | |
1317 |
|
1317 | |||
1318 | if value == "": |
|
1318 | if value == "": | |
1319 | print "Please fill Incoherent integration value" |
|
1319 | print "Please fill Incoherent integration value" | |
1320 | return 0 |
|
1320 | return 0 | |
1321 |
|
1321 | |||
1322 | if not isFloat(value): |
|
1322 | if not isFloat(value): | |
1323 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1323 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1324 | return 0 |
|
1324 | return 0 | |
1325 |
|
1325 | |||
1326 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1326 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1327 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1327 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1328 |
|
1328 | |||
1329 | if self.specOpCebRemoveDC.isChecked(): |
|
1329 | if self.specOpCebRemoveDC.isChecked(): | |
1330 | name_operation = 'removeDC' |
|
1330 | name_operation = 'removeDC' | |
1331 | name_parameter = 'mode' |
|
1331 | name_parameter = 'mode' | |
1332 | format = 'int' |
|
1332 | format = 'int' | |
1333 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1333 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1334 | value = 1 |
|
1334 | value = 1 | |
1335 | else: |
|
1335 | else: | |
1336 | value = 2 |
|
1336 | value = 2 | |
1337 | opObj = puObj.addOperation(name=name_operation) |
|
1337 | opObj = puObj.addOperation(name=name_operation) | |
1338 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1338 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1339 |
|
1339 | |||
1340 | if self.specOpCebRemoveInt.isChecked(): |
|
1340 | if self.specOpCebRemoveInt.isChecked(): | |
1341 | name_operation = 'removeInterference' |
|
1341 | name_operation = 'removeInterference' | |
1342 | opObj = puObj.addOperation(name=name_operation) |
|
1342 | opObj = puObj.addOperation(name=name_operation) | |
1343 |
|
1343 | |||
1344 |
|
1344 | |||
1345 | if self.specOpCebgetNoise.isChecked(): |
|
1345 | if self.specOpCebgetNoise.isChecked(): | |
1346 | value = str(self.specOpgetNoise.text()) |
|
1346 | value = str(self.specOpgetNoise.text()) | |
1347 | valueList = value.split(',') |
|
1347 | valueList = value.split(',') | |
1348 | format = 'float' |
|
1348 | format = 'float' | |
1349 | name_operation = "getNoise" |
|
1349 | name_operation = "getNoise" | |
1350 | opObj = puObj.addOperation(name=name_operation) |
|
1350 | opObj = puObj.addOperation(name=name_operation) | |
1351 |
|
1351 | |||
1352 | if not value == '': |
|
1352 | if not value == '': | |
1353 | valueList = value.split(',') |
|
1353 | valueList = value.split(',') | |
1354 | length = len(valueList) |
|
1354 | length = len(valueList) | |
1355 | if length == 1: |
|
1355 | if length == 1: | |
1356 | try: |
|
1356 | try: | |
1357 | value1 = float(valueList[0]) |
|
1357 | value1 = float(valueList[0]) | |
1358 | except: |
|
1358 | except: | |
1359 | self.console.clear() |
|
1359 | self.console.clear() | |
1360 | self.console.append("Please Write correct parameter Get Noise") |
|
1360 | self.console.append("Please Write correct parameter Get Noise") | |
1361 | return 0 |
|
1361 | return 0 | |
1362 | name1 = 'minHei' |
|
1362 | name1 = 'minHei' | |
1363 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1363 | opObj.addParameter(name=name1, value=value1, format=format) | |
1364 | elif length == 2: |
|
1364 | elif length == 2: | |
1365 | try: |
|
1365 | try: | |
1366 | value1 = float(valueList[0]) |
|
1366 | value1 = float(valueList[0]) | |
1367 | value2 = float(valueList[1]) |
|
1367 | value2 = float(valueList[1]) | |
1368 | except: |
|
1368 | except: | |
1369 | self.console.clear() |
|
1369 | self.console.clear() | |
1370 | self.console.append("Please Write corrects parameter Get Noise") |
|
1370 | self.console.append("Please Write corrects parameter Get Noise") | |
1371 | return 0 |
|
1371 | return 0 | |
1372 | name1 = 'minHei' |
|
1372 | name1 = 'minHei' | |
1373 | name2 = 'maxHei' |
|
1373 | name2 = 'maxHei' | |
1374 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1374 | opObj.addParameter(name=name1, value=value1, format=format) | |
1375 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1375 | opObj.addParameter(name=name2, value=value2, format=format) | |
1376 |
|
1376 | |||
1377 | elif length == 3: |
|
1377 | elif length == 3: | |
1378 | try: |
|
1378 | try: | |
1379 | value1 = float(valueList[0]) |
|
1379 | value1 = float(valueList[0]) | |
1380 | value2 = float(valueList[1]) |
|
1380 | value2 = float(valueList[1]) | |
1381 | value3 = float(valueList[2]) |
|
1381 | value3 = float(valueList[2]) | |
1382 | except: |
|
1382 | except: | |
1383 | self.console.clear() |
|
1383 | self.console.clear() | |
1384 | self.console.append("Please Write corrects parameter Get Noise") |
|
1384 | self.console.append("Please Write corrects parameter Get Noise") | |
1385 | return 0 |
|
1385 | return 0 | |
1386 | name1 = 'minHei' |
|
1386 | name1 = 'minHei' | |
1387 | name2 = 'maxHei' |
|
1387 | name2 = 'maxHei' | |
1388 | name3 = 'minVel' |
|
1388 | name3 = 'minVel' | |
1389 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1389 | opObj.addParameter(name=name1, value=value1, format=format) | |
1390 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1390 | opObj.addParameter(name=name2, value=value2, format=format) | |
1391 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1391 | opObj.addParameter(name=name3, value=value3, format=format) | |
1392 |
|
1392 | |||
1393 | elif length == 4: |
|
1393 | elif length == 4: | |
1394 | try: |
|
1394 | try: | |
1395 | value1 = float(valueList[0]) |
|
1395 | value1 = float(valueList[0]) | |
1396 | value2 = float(valueList[1]) |
|
1396 | value2 = float(valueList[1]) | |
1397 | value3 = float(valueList[2]) |
|
1397 | value3 = float(valueList[2]) | |
1398 | value4 = float(valueList[3]) |
|
1398 | value4 = float(valueList[3]) | |
1399 | except: |
|
1399 | except: | |
1400 | self.console.clear() |
|
1400 | self.console.clear() | |
1401 | self.console.append("Please Write corrects parameter Get Noise") |
|
1401 | self.console.append("Please Write corrects parameter Get Noise") | |
1402 | return 0 |
|
1402 | return 0 | |
1403 | name1 = 'minHei' |
|
1403 | name1 = 'minHei' | |
1404 | name2 = 'maxHei' |
|
1404 | name2 = 'maxHei' | |
1405 | name3 = 'minVel' |
|
1405 | name3 = 'minVel' | |
1406 | name4 = 'maxVel' |
|
1406 | name4 = 'maxVel' | |
1407 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1407 | opObj.addParameter(name=name1, value=value1, format=format) | |
1408 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1408 | opObj.addParameter(name=name2, value=value2, format=format) | |
1409 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1409 | opObj.addParameter(name=name3, value=value3, format=format) | |
1410 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1410 | opObj.addParameter(name=name4, value=value4, format=format) | |
1411 |
|
1411 | |||
1412 | elif length > 4: |
|
1412 | elif length > 4: | |
1413 | self.console.clear() |
|
1413 | self.console.clear() | |
1414 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1414 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1415 | return 0 |
|
1415 | return 0 | |
1416 |
|
1416 | |||
1417 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1417 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1418 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1418 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1419 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1419 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1420 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1420 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1421 |
|
1421 | |||
1422 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1422 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1423 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1423 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1424 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1424 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1425 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1425 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1426 |
|
1426 | |||
1427 | figpath = str(self.specGraphPath.text()) |
|
1427 | figpath = str(self.specGraphPath.text()) | |
1428 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1428 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1429 | try: |
|
1429 | try: | |
1430 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1430 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1431 | except: |
|
1431 | except: | |
1432 | wrperiod = None |
|
1432 | wrperiod = None | |
1433 |
|
1433 | |||
1434 | #-----Spectra Plot----- |
|
1434 | #-----Spectra Plot----- | |
1435 | if self.specGraphCebSpectraplot.isChecked(): |
|
1435 | if self.specGraphCebSpectraplot.isChecked(): | |
1436 |
|
1436 | |||
1437 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1437 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1438 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1438 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1439 |
|
1439 | |||
1440 | if not channelList == '': |
|
1440 | if not channelList == '': | |
1441 |
|
1441 | |||
1442 | if not isList(channelList): |
|
1442 | if not isList(channelList): | |
1443 | self.console.append("Invalid channelList") |
|
1443 | self.console.append("Invalid channelList") | |
1444 | return 0 |
|
1444 | return 0 | |
1445 |
|
1445 | |||
1446 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1446 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1447 |
|
1447 | |||
1448 | if not vel_range == '': |
|
1448 | if not vel_range == '': | |
1449 | xvalueList = vel_range.split(',') |
|
1449 | xvalueList = vel_range.split(',') | |
1450 | try: |
|
1450 | try: | |
1451 | value1 = float(xvalueList[0]) |
|
1451 | value1 = float(xvalueList[0]) | |
1452 | value2 = float(xvalueList[1]) |
|
1452 | value2 = float(xvalueList[1]) | |
1453 | except: |
|
1453 | except: | |
1454 | self.console.clear() |
|
1454 | self.console.clear() | |
1455 | self.console.append("Invalid velocity/frequency range") |
|
1455 | self.console.append("Invalid velocity/frequency range") | |
1456 | return 0 |
|
1456 | return 0 | |
1457 |
|
1457 | |||
1458 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1458 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1459 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1459 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1460 |
|
1460 | |||
1461 | if not hei_range == '': |
|
1461 | if not hei_range == '': | |
1462 | yvalueList = hei_range.split(",") |
|
1462 | yvalueList = hei_range.split(",") | |
1463 | try: |
|
1463 | try: | |
1464 | value1 = float(yvalueList[0]) |
|
1464 | value1 = float(yvalueList[0]) | |
1465 | value2 = float(yvalueList[1]) |
|
1465 | value2 = float(yvalueList[1]) | |
1466 | except: |
|
1466 | except: | |
1467 | self.console.clear() |
|
1467 | self.console.clear() | |
1468 | self.console.append("Invalid height range") |
|
1468 | self.console.append("Invalid height range") | |
1469 | return 0 |
|
1469 | return 0 | |
1470 |
|
1470 | |||
1471 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1471 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1472 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1472 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1473 |
|
1473 | |||
1474 | if not db_range == '': |
|
1474 | if not db_range == '': | |
1475 | zvalueList = db_range.split(",") |
|
1475 | zvalueList = db_range.split(",") | |
1476 | try: |
|
1476 | try: | |
1477 | value1 = float(zvalueList[0]) |
|
1477 | value1 = float(zvalueList[0]) | |
1478 | value2 = float(zvalueList[1]) |
|
1478 | value2 = float(zvalueList[1]) | |
1479 | except: |
|
1479 | except: | |
1480 | self.console.clear() |
|
1480 | self.console.clear() | |
1481 | self.console.append("Invalid db range") |
|
1481 | self.console.append("Invalid db range") | |
1482 | return 0 |
|
1482 | return 0 | |
1483 |
|
1483 | |||
1484 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1484 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1485 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1485 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1486 |
|
1486 | |||
1487 | if self.specGraphSaveSpectra.isChecked(): |
|
1487 | if self.specGraphSaveSpectra.isChecked(): | |
1488 | checkPath = True |
|
1488 | checkPath = True | |
1489 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1489 | opObj.addParameter(name='save', value=1 , format='bool') | |
1490 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1490 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1491 | if figfile: |
|
1491 | if figfile: | |
1492 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1492 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1493 | if wrperiod: |
|
1493 | if wrperiod: | |
1494 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1494 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1495 |
|
1495 | |||
1496 | if self.specGraphftpSpectra.isChecked(): |
|
1496 | if self.specGraphftpSpectra.isChecked(): | |
1497 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1497 | opObj.addParameter(name='ftp', value='1', format='int') | |
1498 | self.addFTPConf2Operation(puObj, opObj) |
|
1498 | self.addFTPConf2Operation(puObj, opObj) | |
1499 | addFTP = True |
|
1499 | addFTP = True | |
1500 |
|
1500 | |||
1501 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1501 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1502 |
|
1502 | |||
1503 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1503 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1504 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1504 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1505 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1505 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1506 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1506 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1507 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1507 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1508 |
|
1508 | |||
1509 | if not vel_range == '': |
|
1509 | if not vel_range == '': | |
1510 | xvalueList = vel_range.split(',') |
|
1510 | xvalueList = vel_range.split(',') | |
1511 | try: |
|
1511 | try: | |
1512 | value1 = float(xvalueList[0]) |
|
1512 | value1 = float(xvalueList[0]) | |
1513 | value2 = float(xvalueList[1]) |
|
1513 | value2 = float(xvalueList[1]) | |
1514 | except: |
|
1514 | except: | |
1515 | self.console.clear() |
|
1515 | self.console.clear() | |
1516 | self.console.append("Invalid velocity/frequency range") |
|
1516 | self.console.append("Invalid velocity/frequency range") | |
1517 | return 0 |
|
1517 | return 0 | |
1518 |
|
1518 | |||
1519 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1519 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1520 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1520 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1521 |
|
1521 | |||
1522 | if not hei_range == '': |
|
1522 | if not hei_range == '': | |
1523 | yvalueList = hei_range.split(",") |
|
1523 | yvalueList = hei_range.split(",") | |
1524 | try: |
|
1524 | try: | |
1525 | value1 = float(yvalueList[0]) |
|
1525 | value1 = float(yvalueList[0]) | |
1526 | value2 = float(yvalueList[1]) |
|
1526 | value2 = float(yvalueList[1]) | |
1527 | except: |
|
1527 | except: | |
1528 | self.console.clear() |
|
1528 | self.console.clear() | |
1529 | self.console.append("Invalid height range") |
|
1529 | self.console.append("Invalid height range") | |
1530 | return 0 |
|
1530 | return 0 | |
1531 |
|
1531 | |||
1532 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1532 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1533 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1533 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1534 |
|
1534 | |||
1535 | if not db_range == '': |
|
1535 | if not db_range == '': | |
1536 | zvalueList = db_range.split(",") |
|
1536 | zvalueList = db_range.split(",") | |
1537 | try: |
|
1537 | try: | |
1538 | value1 = float(zvalueList[0]) |
|
1538 | value1 = float(zvalueList[0]) | |
1539 | value2 = float(zvalueList[1]) |
|
1539 | value2 = float(zvalueList[1]) | |
1540 | except: |
|
1540 | except: | |
1541 | self.console.clear() |
|
1541 | self.console.clear() | |
1542 | self.console.append("Invalid db range") |
|
1542 | self.console.append("Invalid db range") | |
1543 | return 0 |
|
1543 | return 0 | |
1544 |
|
1544 | |||
1545 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1545 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1546 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1546 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1547 |
|
1547 | |||
1548 | if not magrange == '': |
|
1548 | if not magrange == '': | |
1549 | zvalueList = magrange.split(",") |
|
1549 | zvalueList = magrange.split(",") | |
1550 | try: |
|
1550 | try: | |
1551 | value1 = float(zvalueList[0]) |
|
1551 | value1 = float(zvalueList[0]) | |
1552 | value2 = float(zvalueList[1]) |
|
1552 | value2 = float(zvalueList[1]) | |
1553 | except: |
|
1553 | except: | |
1554 | self.console.clear() |
|
1554 | self.console.clear() | |
1555 | self.console.append("Invalid magnitude range") |
|
1555 | self.console.append("Invalid magnitude range") | |
1556 | return 0 |
|
1556 | return 0 | |
1557 |
|
1557 | |||
1558 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1558 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1559 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1559 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1560 |
|
1560 | |||
1561 | if not phaserange == '': |
|
1561 | if not phaserange == '': | |
1562 | zvalueList = phaserange.split(",") |
|
1562 | zvalueList = phaserange.split(",") | |
1563 | try: |
|
1563 | try: | |
1564 | value1 = float(zvalueList[0]) |
|
1564 | value1 = float(zvalueList[0]) | |
1565 | value2 = float(zvalueList[1]) |
|
1565 | value2 = float(zvalueList[1]) | |
1566 | except: |
|
1566 | except: | |
1567 | self.console.clear() |
|
1567 | self.console.clear() | |
1568 | self.console.append("Invalid phase range") |
|
1568 | self.console.append("Invalid phase range") | |
1569 | return 0 |
|
1569 | return 0 | |
1570 |
|
1570 | |||
1571 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1571 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1572 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1572 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1573 |
|
1573 | |||
1574 | if self.specGraphSaveCross.isChecked(): |
|
1574 | if self.specGraphSaveCross.isChecked(): | |
1575 | checkPath = True |
|
1575 | checkPath = True | |
1576 | opObj.addParameter(name='save', value='1', format='bool') |
|
1576 | opObj.addParameter(name='save', value='1', format='bool') | |
1577 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1577 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1578 | if figfile: |
|
1578 | if figfile: | |
1579 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1579 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1580 | if wrperiod: |
|
1580 | if wrperiod: | |
1581 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1581 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1582 |
|
1582 | |||
1583 | if self.specGraphftpCross.isChecked(): |
|
1583 | if self.specGraphftpCross.isChecked(): | |
1584 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1584 | opObj.addParameter(name='ftp', value='1', format='int') | |
1585 | self.addFTPConf2Operation(puObj, opObj) |
|
1585 | self.addFTPConf2Operation(puObj, opObj) | |
1586 | addFTP = True |
|
1586 | addFTP = True | |
1587 |
|
1587 | |||
1588 | if self.specGraphCebRTIplot.isChecked(): |
|
1588 | if self.specGraphCebRTIplot.isChecked(): | |
1589 |
|
1589 | |||
1590 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1590 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1591 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1591 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1592 |
|
1592 | |||
1593 | if not channelList == '': |
|
1593 | if not channelList == '': | |
1594 | if not isList(channelList): |
|
1594 | if not isList(channelList): | |
1595 | self.console.append("Invalid channelList") |
|
1595 | self.console.append("Invalid channelList") | |
1596 | return 0 |
|
1596 | return 0 | |
1597 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1597 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1598 |
|
1598 | |||
1599 | if not trange == '': |
|
1599 | if not trange == '': | |
1600 | xvalueList = trange.split(',') |
|
1600 | xvalueList = trange.split(',') | |
1601 | try: |
|
1601 | try: | |
1602 | value1 = float(xvalueList[0]) |
|
1602 | value1 = float(xvalueList[0]) | |
1603 | value2 = float(xvalueList[1]) |
|
1603 | value2 = float(xvalueList[1]) | |
1604 | except: |
|
1604 | except: | |
1605 | self.console.clear() |
|
1605 | self.console.clear() | |
1606 | self.console.append("Invalid time range") |
|
1606 | self.console.append("Invalid time range") | |
1607 | return 0 |
|
1607 | return 0 | |
1608 |
|
1608 | |||
1609 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1609 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1610 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1610 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1611 |
|
1611 | |||
1612 | # if not timerange == '': |
|
1612 | # if not timerange == '': | |
1613 | # try: |
|
1613 | # try: | |
1614 | # timerange = float(timerange) |
|
1614 | # timerange = float(timerange) | |
1615 | # except: |
|
1615 | # except: | |
1616 | # self.console.clear() |
|
1616 | # self.console.clear() | |
1617 | # self.console.append("Invalid time range") |
|
1617 | # self.console.append("Invalid time range") | |
1618 | # return 0 |
|
1618 | # return 0 | |
1619 | # |
|
1619 | # | |
1620 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1620 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1621 |
|
1621 | |||
1622 | if not hei_range == '': |
|
1622 | if not hei_range == '': | |
1623 | yvalueList = hei_range.split(",") |
|
1623 | yvalueList = hei_range.split(",") | |
1624 | try: |
|
1624 | try: | |
1625 | value1 = float(yvalueList[0]) |
|
1625 | value1 = float(yvalueList[0]) | |
1626 | value2 = float(yvalueList[1]) |
|
1626 | value2 = float(yvalueList[1]) | |
1627 | except: |
|
1627 | except: | |
1628 | self.console.clear() |
|
1628 | self.console.clear() | |
1629 | self.console.append("Invalid height range") |
|
1629 | self.console.append("Invalid height range") | |
1630 | return 0 |
|
1630 | return 0 | |
1631 |
|
1631 | |||
1632 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1632 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1633 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1633 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1634 |
|
1634 | |||
1635 | if not db_range == '': |
|
1635 | if not db_range == '': | |
1636 | zvalueList = db_range.split(",") |
|
1636 | zvalueList = db_range.split(",") | |
1637 | try: |
|
1637 | try: | |
1638 | value1 = float(zvalueList[0]) |
|
1638 | value1 = float(zvalueList[0]) | |
1639 | value2 = float(zvalueList[1]) |
|
1639 | value2 = float(zvalueList[1]) | |
1640 | except: |
|
1640 | except: | |
1641 | self.console.clear() |
|
1641 | self.console.clear() | |
1642 | self.console.append("Invalid db range") |
|
1642 | self.console.append("Invalid db range") | |
1643 | return 0 |
|
1643 | return 0 | |
1644 |
|
1644 | |||
1645 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1645 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1646 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1646 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1647 |
|
1647 | |||
1648 | if self.specGraphSaveRTIplot.isChecked(): |
|
1648 | if self.specGraphSaveRTIplot.isChecked(): | |
1649 | checkPath = True |
|
1649 | checkPath = True | |
1650 | opObj.addParameter(name='save', value='1', format='bool') |
|
1650 | opObj.addParameter(name='save', value='1', format='bool') | |
1651 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1651 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1652 | if figfile: |
|
1652 | if figfile: | |
1653 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1653 | opObj.addParameter(name='figfile', value=value, format='str') | |
1654 | if wrperiod: |
|
1654 | if wrperiod: | |
1655 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1655 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1656 |
|
1656 | |||
1657 | if self.specGraphftpRTIplot.isChecked(): |
|
1657 | if self.specGraphftpRTIplot.isChecked(): | |
1658 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1658 | opObj.addParameter(name='ftp', value='1', format='int') | |
1659 | self.addFTPConf2Operation(puObj, opObj) |
|
1659 | self.addFTPConf2Operation(puObj, opObj) | |
1660 | addFTP = True |
|
1660 | addFTP = True | |
1661 |
|
1661 | |||
1662 | if self.specGraphCebCoherencmap.isChecked(): |
|
1662 | if self.specGraphCebCoherencmap.isChecked(): | |
1663 |
|
1663 | |||
1664 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1664 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1665 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1665 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1666 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1666 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1667 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1667 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1668 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1668 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1669 |
|
1669 | |||
1670 | # if not timerange == '': |
|
1670 | # if not timerange == '': | |
1671 | # try: |
|
1671 | # try: | |
1672 | # timerange = int(timerange) |
|
1672 | # timerange = int(timerange) | |
1673 | # except: |
|
1673 | # except: | |
1674 | # self.console.clear() |
|
1674 | # self.console.clear() | |
1675 | # self.console.append("Invalid time range") |
|
1675 | # self.console.append("Invalid time range") | |
1676 | # return 0 |
|
1676 | # return 0 | |
1677 | # |
|
1677 | # | |
1678 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1678 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1679 |
|
1679 | |||
1680 | if not trange == '': |
|
1680 | if not trange == '': | |
1681 | xvalueList = trange.split(',') |
|
1681 | xvalueList = trange.split(',') | |
1682 | try: |
|
1682 | try: | |
1683 | value1 = float(xvalueList[0]) |
|
1683 | value1 = float(xvalueList[0]) | |
1684 | value2 = float(xvalueList[1]) |
|
1684 | value2 = float(xvalueList[1]) | |
1685 | except: |
|
1685 | except: | |
1686 | self.console.clear() |
|
1686 | self.console.clear() | |
1687 | self.console.append("Invalid time range") |
|
1687 | self.console.append("Invalid time range") | |
1688 | return 0 |
|
1688 | return 0 | |
1689 |
|
1689 | |||
1690 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1690 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1691 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1691 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1692 |
|
1692 | |||
1693 | if not hei_range == '': |
|
1693 | if not hei_range == '': | |
1694 | yvalueList = hei_range.split(",") |
|
1694 | yvalueList = hei_range.split(",") | |
1695 | try: |
|
1695 | try: | |
1696 | value1 = float(yvalueList[0]) |
|
1696 | value1 = float(yvalueList[0]) | |
1697 | value2 = float(yvalueList[1]) |
|
1697 | value2 = float(yvalueList[1]) | |
1698 | except: |
|
1698 | except: | |
1699 | self.console.clear() |
|
1699 | self.console.clear() | |
1700 | self.console.append("Invalid height range") |
|
1700 | self.console.append("Invalid height range") | |
1701 | return 0 |
|
1701 | return 0 | |
1702 |
|
1702 | |||
1703 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1703 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1704 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1704 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1705 |
|
1705 | |||
1706 | if not magrange == '': |
|
1706 | if not magrange == '': | |
1707 | zvalueList = magrange.split(",") |
|
1707 | zvalueList = magrange.split(",") | |
1708 | try: |
|
1708 | try: | |
1709 | value1 = float(zvalueList[0]) |
|
1709 | value1 = float(zvalueList[0]) | |
1710 | value2 = float(zvalueList[1]) |
|
1710 | value2 = float(zvalueList[1]) | |
1711 | except: |
|
1711 | except: | |
1712 | self.console.clear() |
|
1712 | self.console.clear() | |
1713 | self.console.append("Invalid magnitude range") |
|
1713 | self.console.append("Invalid magnitude range") | |
1714 | return 0 |
|
1714 | return 0 | |
1715 |
|
1715 | |||
1716 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1716 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1717 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1717 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1718 |
|
1718 | |||
1719 | if not phaserange == '': |
|
1719 | if not phaserange == '': | |
1720 | zvalueList = phaserange.split(",") |
|
1720 | zvalueList = phaserange.split(",") | |
1721 | try: |
|
1721 | try: | |
1722 | value1 = float(zvalueList[0]) |
|
1722 | value1 = float(zvalueList[0]) | |
1723 | value2 = float(zvalueList[1]) |
|
1723 | value2 = float(zvalueList[1]) | |
1724 | except: |
|
1724 | except: | |
1725 | self.console.clear() |
|
1725 | self.console.clear() | |
1726 | self.console.append("Invalid phase range") |
|
1726 | self.console.append("Invalid phase range") | |
1727 | return 0 |
|
1727 | return 0 | |
1728 |
|
1728 | |||
1729 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1729 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1730 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1730 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1731 |
|
1731 | |||
1732 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1732 | if self.specGraphSaveCoherencemap.isChecked(): | |
1733 | checkPath = True |
|
1733 | checkPath = True | |
1734 | opObj.addParameter(name='save', value='1', format='bool') |
|
1734 | opObj.addParameter(name='save', value='1', format='bool') | |
1735 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1735 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1736 | if figfile: |
|
1736 | if figfile: | |
1737 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1737 | opObj.addParameter(name='figfile', value=value, format='str') | |
1738 | if wrperiod: |
|
1738 | if wrperiod: | |
1739 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1739 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1740 |
|
1740 | |||
1741 | if self.specGraphftpCoherencemap.isChecked(): |
|
1741 | if self.specGraphftpCoherencemap.isChecked(): | |
1742 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1742 | opObj.addParameter(name='ftp', value='1', format='int') | |
1743 | self.addFTPConf2Operation(puObj, opObj) |
|
1743 | self.addFTPConf2Operation(puObj, opObj) | |
1744 | addFTP = True |
|
1744 | addFTP = True | |
1745 |
|
1745 | |||
1746 | if self.specGraphPowerprofile.isChecked(): |
|
1746 | if self.specGraphPowerprofile.isChecked(): | |
1747 |
|
1747 | |||
1748 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1748 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1749 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1749 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1750 |
|
1750 | |||
1751 | if not channelList == '': |
|
1751 | if not channelList == '': | |
1752 | if not isList(channelList): |
|
1752 | if not isList(channelList): | |
1753 | self.console.append("Invalid channelList") |
|
1753 | self.console.append("Invalid channelList") | |
1754 | return 0 |
|
1754 | return 0 | |
1755 |
|
1755 | |||
1756 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1756 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1757 |
|
1757 | |||
1758 | if not db_range == '': |
|
1758 | if not db_range == '': | |
1759 | xvalueList = db_range.split(',') |
|
1759 | xvalueList = db_range.split(',') | |
1760 | try: |
|
1760 | try: | |
1761 | value1 = float(xvalueList[0]) |
|
1761 | value1 = float(xvalueList[0]) | |
1762 | value2 = float(xvalueList[1]) |
|
1762 | value2 = float(xvalueList[1]) | |
1763 | except: |
|
1763 | except: | |
1764 | self.console.clear() |
|
1764 | self.console.clear() | |
1765 | self.console.append("Invalid db range") |
|
1765 | self.console.append("Invalid db range") | |
1766 | return 0 |
|
1766 | return 0 | |
1767 |
|
1767 | |||
1768 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1768 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1769 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1769 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1770 |
|
1770 | |||
1771 | if not hei_range == '': |
|
1771 | if not hei_range == '': | |
1772 | yvalueList = hei_range.split(",") |
|
1772 | yvalueList = hei_range.split(",") | |
1773 | try: |
|
1773 | try: | |
1774 | value1 = float(yvalueList[0]) |
|
1774 | value1 = float(yvalueList[0]) | |
1775 | value2 = float(yvalueList[1]) |
|
1775 | value2 = float(yvalueList[1]) | |
1776 | except: |
|
1776 | except: | |
1777 | self.console.clear() |
|
1777 | self.console.clear() | |
1778 | self.console.append("Invalid height range") |
|
1778 | self.console.append("Invalid height range") | |
1779 | return 0 |
|
1779 | return 0 | |
1780 |
|
1780 | |||
1781 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1781 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1782 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1782 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1783 |
|
1783 | |||
1784 | if self.specGraphSavePowerprofile.isChecked(): |
|
1784 | if self.specGraphSavePowerprofile.isChecked(): | |
1785 | checkPath = True |
|
1785 | checkPath = True | |
1786 | opObj.addParameter(name='save', value='1', format='bool') |
|
1786 | opObj.addParameter(name='save', value='1', format='bool') | |
1787 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1787 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1788 | if figfile: |
|
1788 | if figfile: | |
1789 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1789 | opObj.addParameter(name='figfile', value=value, format='str') | |
1790 | if wrperiod: |
|
1790 | if wrperiod: | |
1791 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1791 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1792 |
|
1792 | |||
1793 | if self.specGraphftpPowerprofile.isChecked(): |
|
1793 | if self.specGraphftpPowerprofile.isChecked(): | |
1794 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1794 | opObj.addParameter(name='ftp', value='1', format='int') | |
1795 | self.addFTPConf2Operation(puObj, opObj) |
|
1795 | self.addFTPConf2Operation(puObj, opObj) | |
1796 | addFTP = True |
|
1796 | addFTP = True | |
1797 | # rti noise |
|
1797 | # rti noise | |
1798 |
|
1798 | |||
1799 | if self.specGraphCebRTInoise.isChecked(): |
|
1799 | if self.specGraphCebRTInoise.isChecked(): | |
1800 |
|
1800 | |||
1801 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1801 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1802 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1802 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1803 |
|
1803 | |||
1804 | if not channelList == '': |
|
1804 | if not channelList == '': | |
1805 | if not isList(channelList): |
|
1805 | if not isList(channelList): | |
1806 | self.console.append("Invalid channelList") |
|
1806 | self.console.append("Invalid channelList") | |
1807 | return 0 |
|
1807 | return 0 | |
1808 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1808 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1809 |
|
1809 | |||
1810 | # if not timerange == '': |
|
1810 | # if not timerange == '': | |
1811 | # try: |
|
1811 | # try: | |
1812 | # timerange = float(timerange) |
|
1812 | # timerange = float(timerange) | |
1813 | # except: |
|
1813 | # except: | |
1814 | # self.console.clear() |
|
1814 | # self.console.clear() | |
1815 | # self.console.append("Invalid time range") |
|
1815 | # self.console.append("Invalid time range") | |
1816 | # return 0 |
|
1816 | # return 0 | |
1817 | # |
|
1817 | # | |
1818 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1818 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1819 |
|
1819 | |||
1820 | if not trange == '': |
|
1820 | if not trange == '': | |
1821 | xvalueList = trange.split(',') |
|
1821 | xvalueList = trange.split(',') | |
1822 | try: |
|
1822 | try: | |
1823 | value1 = float(xvalueList[0]) |
|
1823 | value1 = float(xvalueList[0]) | |
1824 | value2 = float(xvalueList[1]) |
|
1824 | value2 = float(xvalueList[1]) | |
1825 | except: |
|
1825 | except: | |
1826 | self.console.clear() |
|
1826 | self.console.clear() | |
1827 | self.console.append("Invalid time range") |
|
1827 | self.console.append("Invalid time range") | |
1828 | return 0 |
|
1828 | return 0 | |
1829 |
|
1829 | |||
1830 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1830 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1831 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1831 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1832 |
|
1832 | |||
1833 | if not db_range == '': |
|
1833 | if not db_range == '': | |
1834 | yvalueList = db_range.split(",") |
|
1834 | yvalueList = db_range.split(",") | |
1835 | try: |
|
1835 | try: | |
1836 | value1 = float(yvalueList[0]) |
|
1836 | value1 = float(yvalueList[0]) | |
1837 | value2 = float(yvalueList[1]) |
|
1837 | value2 = float(yvalueList[1]) | |
1838 | except: |
|
1838 | except: | |
1839 | self.console.clear() |
|
1839 | self.console.clear() | |
1840 | self.console.append("Invalid db range") |
|
1840 | self.console.append("Invalid db range") | |
1841 | return 0 |
|
1841 | return 0 | |
1842 |
|
1842 | |||
1843 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1843 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1844 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1844 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1845 |
|
1845 | |||
1846 | if self.specGraphSaveRTInoise.isChecked(): |
|
1846 | if self.specGraphSaveRTInoise.isChecked(): | |
1847 | checkPath = True |
|
1847 | checkPath = True | |
1848 | opObj.addParameter(name='save', value='1', format='bool') |
|
1848 | opObj.addParameter(name='save', value='1', format='bool') | |
1849 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1849 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1850 | if figfile: |
|
1850 | if figfile: | |
1851 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1851 | opObj.addParameter(name='figfile', value=value, format='str') | |
1852 | if wrperiod: |
|
1852 | if wrperiod: | |
1853 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1853 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1854 |
|
1854 | |||
1855 | # test_ftp |
|
1855 | # test_ftp | |
1856 | if self.specGraphftpRTInoise.isChecked(): |
|
1856 | if self.specGraphftpRTInoise.isChecked(): | |
1857 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1857 | opObj.addParameter(name='ftp', value='1', format='int') | |
1858 | self.addFTPConf2Operation(puObj, opObj) |
|
1858 | self.addFTPConf2Operation(puObj, opObj) | |
1859 | addFTP = True |
|
1859 | addFTP = True | |
1860 |
|
1860 | |||
1861 | if checkPath: |
|
1861 | if checkPath: | |
1862 | if not figpath: |
|
1862 | if not figpath: | |
1863 | self.console.clear() |
|
1863 | self.console.clear() | |
1864 | self.console.append("Graphic path should be defined") |
|
1864 | self.console.append("Graphic path should be defined") | |
1865 | return 0 |
|
1865 | return 0 | |
1866 |
|
1866 | |||
1867 | if addFTP and not figpath: |
|
1867 | if addFTP and not figpath: | |
1868 | self.console.clear() |
|
1868 | self.console.clear() | |
1869 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1869 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1870 | return 0 |
|
1870 | return 0 | |
1871 |
|
1871 | |||
1872 | # if something happend |
|
1872 | # if something happend | |
1873 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1873 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1874 | if parms_ok: |
|
1874 | if parms_ok: | |
1875 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1875 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1876 | opObj.addParameter(name='path', value=output_path) |
|
1876 | opObj.addParameter(name='path', value=output_path) | |
1877 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1877 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1878 |
|
1878 | |||
1879 | self.console.clear() |
|
1879 | self.console.clear() | |
1880 | try: |
|
1880 | try: | |
1881 | self.refreshPUProperties(puObj) |
|
1881 | self.refreshPUProperties(puObj) | |
1882 | except: |
|
1882 | except: | |
1883 | self.console.append("An error reading input parameters was found ... Check them!") |
|
1883 | self.console.append("An error reading input parameters was found ... Check them!") | |
1884 | return 0 |
|
1884 | return 0 | |
1885 |
|
1885 | |||
1886 | self.console.append("Save your project and press Play button to start signal processing") |
|
1886 | self.console.append("Save your project and press Play button to start signal processing") | |
1887 |
|
1887 | |||
1888 | self._enable_play_button() |
|
1888 | self._enable_play_button() | |
1889 | self._enable_save_button() |
|
1889 | self._enable_save_button() | |
1890 |
|
1890 | |||
1891 | return 1 |
|
1891 | return 1 | |
1892 |
|
1892 | |||
1893 | """ |
|
1893 | """ | |
1894 | Spectra Graph |
|
1894 | Spectra Graph | |
1895 | """ |
|
1895 | """ | |
1896 | @pyqtSignature("int") |
|
1896 | @pyqtSignature("int") | |
1897 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1897 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1898 |
|
1898 | |||
1899 | self.__checkSpecGraphFilters() |
|
1899 | self.__checkSpecGraphFilters() | |
1900 |
|
1900 | |||
1901 |
|
1901 | |||
1902 | @pyqtSignature("int") |
|
1902 | @pyqtSignature("int") | |
1903 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1903 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1904 |
|
1904 | |||
1905 | self.__checkSpecGraphFilters() |
|
1905 | self.__checkSpecGraphFilters() | |
1906 |
|
1906 | |||
1907 | @pyqtSignature("int") |
|
1907 | @pyqtSignature("int") | |
1908 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1908 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1909 |
|
1909 | |||
1910 | self.__checkSpecGraphFilters() |
|
1910 | self.__checkSpecGraphFilters() | |
1911 |
|
1911 | |||
1912 |
|
1912 | |||
1913 | @pyqtSignature("int") |
|
1913 | @pyqtSignature("int") | |
1914 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1914 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1915 |
|
1915 | |||
1916 | self.__checkSpecGraphFilters() |
|
1916 | self.__checkSpecGraphFilters() | |
1917 |
|
1917 | |||
1918 |
|
1918 | |||
1919 | @pyqtSignature("int") |
|
1919 | @pyqtSignature("int") | |
1920 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1920 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1921 |
|
1921 | |||
1922 | self.__checkSpecGraphFilters() |
|
1922 | self.__checkSpecGraphFilters() | |
1923 |
|
1923 | |||
1924 | @pyqtSignature("int") |
|
1924 | @pyqtSignature("int") | |
1925 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1925 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1926 |
|
1926 | |||
1927 | self.__checkSpecGraphFilters() |
|
1927 | self.__checkSpecGraphFilters() | |
1928 |
|
1928 | |||
1929 | @pyqtSignature("int") |
|
1929 | @pyqtSignature("int") | |
1930 | def on_specGraphPhase_stateChanged(self, p0): |
|
1930 | def on_specGraphPhase_stateChanged(self, p0): | |
1931 |
|
1931 | |||
1932 | self.__checkSpecGraphFilters() |
|
1932 | self.__checkSpecGraphFilters() | |
1933 |
|
1933 | |||
1934 | @pyqtSignature("int") |
|
1934 | @pyqtSignature("int") | |
1935 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1935 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1936 | """ |
|
1936 | """ | |
1937 | """ |
|
1937 | """ | |
1938 | self.__checkSpecGraphSaving() |
|
1938 | self.__checkSpecGraphSaving() | |
1939 |
|
1939 | |||
1940 | @pyqtSignature("int") |
|
1940 | @pyqtSignature("int") | |
1941 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1941 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1942 |
|
1942 | |||
1943 | self.__checkSpecGraphSaving() |
|
1943 | self.__checkSpecGraphSaving() | |
1944 |
|
1944 | |||
1945 | @pyqtSignature("int") |
|
1945 | @pyqtSignature("int") | |
1946 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1946 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1947 |
|
1947 | |||
1948 | self.__checkSpecGraphSaving() |
|
1948 | self.__checkSpecGraphSaving() | |
1949 |
|
1949 | |||
1950 | @pyqtSignature("int") |
|
1950 | @pyqtSignature("int") | |
1951 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1951 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1952 |
|
1952 | |||
1953 | self.__checkSpecGraphSaving() |
|
1953 | self.__checkSpecGraphSaving() | |
1954 |
|
1954 | |||
1955 | @pyqtSignature("int") |
|
1955 | @pyqtSignature("int") | |
1956 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1956 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1957 |
|
1957 | |||
1958 | self.__checkSpecGraphSaving() |
|
1958 | self.__checkSpecGraphSaving() | |
1959 |
|
1959 | |||
1960 | @pyqtSignature("int") |
|
1960 | @pyqtSignature("int") | |
1961 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1961 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1962 |
|
1962 | |||
1963 | self.__checkSpecGraphSaving() |
|
1963 | self.__checkSpecGraphSaving() | |
1964 |
|
1964 | |||
1965 | @pyqtSignature("int") |
|
1965 | @pyqtSignature("int") | |
1966 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1966 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1967 | """ |
|
1967 | """ | |
1968 | """ |
|
1968 | """ | |
1969 | self.__checkSpecGraphFTP() |
|
1969 | self.__checkSpecGraphFTP() | |
1970 |
|
1970 | |||
1971 |
|
1971 | |||
1972 | @pyqtSignature("int") |
|
1972 | @pyqtSignature("int") | |
1973 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1973 | def on_specGraphftpCross_stateChanged(self, p0): | |
1974 |
|
1974 | |||
1975 | self.__checkSpecGraphFTP() |
|
1975 | self.__checkSpecGraphFTP() | |
1976 |
|
1976 | |||
1977 | @pyqtSignature("int") |
|
1977 | @pyqtSignature("int") | |
1978 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1978 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1979 |
|
1979 | |||
1980 | self.__checkSpecGraphFTP() |
|
1980 | self.__checkSpecGraphFTP() | |
1981 |
|
1981 | |||
1982 | @pyqtSignature("int") |
|
1982 | @pyqtSignature("int") | |
1983 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1983 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1984 |
|
1984 | |||
1985 | self.__checkSpecGraphFTP() |
|
1985 | self.__checkSpecGraphFTP() | |
1986 |
|
1986 | |||
1987 | @pyqtSignature("int") |
|
1987 | @pyqtSignature("int") | |
1988 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1988 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1989 |
|
1989 | |||
1990 | self.__checkSpecGraphFTP() |
|
1990 | self.__checkSpecGraphFTP() | |
1991 |
|
1991 | |||
1992 | @pyqtSignature("int") |
|
1992 | @pyqtSignature("int") | |
1993 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1993 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1994 |
|
1994 | |||
1995 | self.__checkSpecGraphFTP() |
|
1995 | self.__checkSpecGraphFTP() | |
1996 |
|
1996 | |||
1997 | @pyqtSignature("") |
|
1997 | @pyqtSignature("") | |
1998 | def on_specGraphToolPath_clicked(self): |
|
1998 | def on_specGraphToolPath_clicked(self): | |
1999 | """ |
|
1999 | """ | |
2000 | """ |
|
2000 | """ | |
2001 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2001 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2002 | self.specGraphPath.setText(save_path) |
|
2002 | self.specGraphPath.setText(save_path) | |
2003 | if not os.path.exists(save_path): |
|
2003 | if not os.path.exists(save_path): | |
2004 | self.console.clear() |
|
2004 | self.console.clear() | |
2005 | self.console.append("Write a valid path") |
|
2005 | self.console.append("Write a valid path") | |
2006 | return |
|
2006 | return | |
2007 |
|
2007 | |||
2008 | @pyqtSignature("") |
|
2008 | @pyqtSignature("") | |
2009 | def on_specGraphClear_clicked(self): |
|
2009 | def on_specGraphClear_clicked(self): | |
2010 | return |
|
2010 | return | |
2011 |
|
2011 | |||
2012 | @pyqtSignature("") |
|
2012 | @pyqtSignature("") | |
2013 | def on_specHeisGraphToolPath_clicked(self): |
|
2013 | def on_specHeisGraphToolPath_clicked(self): | |
2014 | """ |
|
2014 | """ | |
2015 | """ |
|
2015 | """ | |
2016 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2016 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2017 | self.specHeisGraphPath.setText(save_path) |
|
2017 | self.specHeisGraphPath.setText(save_path) | |
2018 | if not os.path.exists(save_path): |
|
2018 | if not os.path.exists(save_path): | |
2019 | self.console.clear() |
|
2019 | self.console.clear() | |
2020 | self.console.append("Write a valid path") |
|
2020 | self.console.append("Write a valid path") | |
2021 | return |
|
2021 | return | |
2022 |
|
2022 | |||
2023 | @pyqtSignature("int") |
|
2023 | @pyqtSignature("int") | |
2024 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2024 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2025 | """ |
|
2025 | """ | |
2026 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2026 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2027 | """ |
|
2027 | """ | |
2028 | if p0 == 2: |
|
2028 | if p0 == 2: | |
2029 | self.specHeisOpIncoherent.setEnabled(True) |
|
2029 | self.specHeisOpIncoherent.setEnabled(True) | |
2030 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2030 | self.specHeisOpCobIncInt.setEnabled(True) | |
2031 | if p0 == 0: |
|
2031 | if p0 == 0: | |
2032 | self.specHeisOpIncoherent.setEnabled(False) |
|
2032 | self.specHeisOpIncoherent.setEnabled(False) | |
2033 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2033 | self.specHeisOpCobIncInt.setEnabled(False) | |
2034 |
|
2034 | |||
2035 | @pyqtSignature("") |
|
2035 | @pyqtSignature("") | |
2036 | def on_specHeisOpOk_clicked(self): |
|
2036 | def on_specHeisOpOk_clicked(self): | |
2037 | """ |
|
2037 | """ | |
2038 | AΓADE OPERACION SPECTRAHEIS |
|
2038 | AΓADE OPERACION SPECTRAHEIS | |
2039 | """ |
|
2039 | """ | |
2040 | addFTP = False |
|
2040 | addFTP = False | |
2041 | checkPath = False |
|
2041 | checkPath = False | |
2042 |
|
2042 | |||
2043 | self._disable_play_button() |
|
2043 | self._disable_play_button() | |
2044 | self._disable_save_button() |
|
2044 | self._disable_save_button() | |
2045 |
|
2045 | |||
2046 | self.console.clear() |
|
2046 | self.console.clear() | |
2047 | self.console.append("Checking input parameters ...") |
|
2047 | self.console.append("Checking input parameters ...") | |
2048 |
|
2048 | |||
2049 | puObj = self.getSelectedItemObj() |
|
2049 | puObj = self.getSelectedItemObj() | |
2050 | puObj.removeOperations() |
|
2050 | puObj.removeOperations() | |
2051 |
|
2051 | |||
2052 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2052 | if self.specHeisOpCebIncoherent.isChecked(): | |
2053 | value = str(self.specHeisOpIncoherent.text()) |
|
2053 | value = str(self.specHeisOpIncoherent.text()) | |
2054 | name_operation = 'IncohInt4SpectraHeis' |
|
2054 | name_operation = 'IncohInt4SpectraHeis' | |
2055 | optype = 'other' |
|
2055 | optype = 'other' | |
2056 |
|
2056 | |||
2057 | name_parameter = 'timeInterval' |
|
2057 | name_parameter = 'timeInterval' | |
2058 | format = 'float' |
|
2058 | format = 'float' | |
2059 |
|
2059 | |||
2060 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2060 | if self.specOpCobIncInt.currentIndex() == 0: | |
2061 | name_parameter = 'timeInterval' |
|
2061 | name_parameter = 'timeInterval' | |
2062 | format = 'float' |
|
2062 | format = 'float' | |
2063 |
|
2063 | |||
2064 | if not isFloat(value): |
|
2064 | if not isFloat(value): | |
2065 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2065 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2066 | return 0 |
|
2066 | return 0 | |
2067 |
|
2067 | |||
2068 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2068 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2069 |
|
2069 | |||
2070 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2070 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2071 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2071 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2072 | return 0 |
|
2072 | return 0 | |
2073 |
|
2073 | |||
2074 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2074 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2075 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2075 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2076 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2076 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2077 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2077 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2078 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2078 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2079 |
|
2079 | |||
2080 | # ---- Spectra Plot----- |
|
2080 | # ---- Spectra Plot----- | |
2081 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2081 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2082 |
|
2082 | |||
2083 | name_operation = 'SpectraHeisScope' |
|
2083 | name_operation = 'SpectraHeisScope' | |
2084 | optype = 'other' |
|
2084 | optype = 'other' | |
2085 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2085 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2086 |
|
2086 | |||
2087 | name_parameter = 'id' |
|
2087 | name_parameter = 'id' | |
2088 | format = 'int' |
|
2088 | format = 'int' | |
2089 | value = opObj.id |
|
2089 | value = opObj.id | |
2090 |
|
2090 | |||
2091 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2091 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2092 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2092 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2093 | return 0 |
|
2093 | return 0 | |
2094 |
|
2094 | |||
2095 | if not (channelList == ''): |
|
2095 | if not (channelList == ''): | |
2096 | name_parameter = 'channelList' |
|
2096 | name_parameter = 'channelList' | |
2097 | format = 'intlist' |
|
2097 | format = 'intlist' | |
2098 |
|
2098 | |||
2099 | if not isList(channelList): |
|
2099 | if not isList(channelList): | |
2100 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2100 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2101 | return 0 |
|
2101 | return 0 | |
2102 |
|
2102 | |||
2103 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2103 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2104 |
|
2104 | |||
2105 | if not freq_range == '': |
|
2105 | if not freq_range == '': | |
2106 | xvalueList = freq_range.split(',') |
|
2106 | xvalueList = freq_range.split(',') | |
2107 |
|
2107 | |||
2108 | if len(xvalueList) != 2: |
|
2108 | if len(xvalueList) != 2: | |
2109 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2109 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2110 | return 0 |
|
2110 | return 0 | |
2111 |
|
2111 | |||
2112 | value1 = xvalueList[0] |
|
2112 | value1 = xvalueList[0] | |
2113 | value2 = xvalueList[1] |
|
2113 | value2 = xvalueList[1] | |
2114 |
|
2114 | |||
2115 | if not isFloat(value1) or not isFloat(value2): |
|
2115 | if not isFloat(value1) or not isFloat(value2): | |
2116 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2116 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2117 | return 0 |
|
2117 | return 0 | |
2118 |
|
2118 | |||
2119 | name1 = 'xmin' |
|
2119 | name1 = 'xmin' | |
2120 | name2 = 'xmax' |
|
2120 | name2 = 'xmax' | |
2121 | format = 'float' |
|
2121 | format = 'float' | |
2122 |
|
2122 | |||
2123 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2123 | opObj.addParameter(name=name1, value=value1, format=format) | |
2124 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2124 | opObj.addParameter(name=name2, value=value2, format=format) | |
2125 |
|
2125 | |||
2126 | #------specHeisGgraphYmin-Ymax--- |
|
2126 | #------specHeisGgraphYmin-Ymax--- | |
2127 | if not power_range == '': |
|
2127 | if not power_range == '': | |
2128 | yvalueList = power_range.split(",") |
|
2128 | yvalueList = power_range.split(",") | |
2129 |
|
2129 | |||
2130 | if len(yvalueList) != 2: |
|
2130 | if len(yvalueList) != 2: | |
2131 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2131 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2132 | return 0 |
|
2132 | return 0 | |
2133 |
|
2133 | |||
2134 | value1 = yvalueList[0] |
|
2134 | value1 = yvalueList[0] | |
2135 | value2 = yvalueList[1] |
|
2135 | value2 = yvalueList[1] | |
2136 |
|
2136 | |||
2137 | if not isFloat(value1) or not isFloat(value2): |
|
2137 | if not isFloat(value1) or not isFloat(value2): | |
2138 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2138 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2139 | return 0 |
|
2139 | return 0 | |
2140 |
|
2140 | |||
2141 | name1 = 'ymin' |
|
2141 | name1 = 'ymin' | |
2142 | name2 = 'ymax' |
|
2142 | name2 = 'ymax' | |
2143 | format = 'float' |
|
2143 | format = 'float' | |
2144 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2144 | opObj.addParameter(name=name1, value=value1, format=format) | |
2145 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2145 | opObj.addParameter(name=name2, value=value2, format=format) | |
2146 |
|
2146 | |||
2147 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2147 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2148 | checkPath = True |
|
2148 | checkPath = True | |
2149 | name_parameter1 = 'save' |
|
2149 | name_parameter1 = 'save' | |
2150 | name_parameter2 = 'figpath' |
|
2150 | name_parameter2 = 'figpath' | |
2151 | name_parameter3 = 'figfile' |
|
2151 | name_parameter3 = 'figfile' | |
2152 | value1 = '1' |
|
2152 | value1 = '1' | |
2153 | value2 = str(self.specHeisGraphPath.text()) |
|
2153 | value2 = str(self.specHeisGraphPath.text()) | |
2154 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2154 | value3 = str(self.specHeisGraphPrefix.text()) | |
2155 | format1 = 'bool' |
|
2155 | format1 = 'bool' | |
2156 | format2 = 'str' |
|
2156 | format2 = 'str' | |
2157 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2157 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2158 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2158 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2159 | if not value3 == "": |
|
2159 | if not value3 == "": | |
2160 | try: |
|
2160 | try: | |
2161 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2161 | value3 = str(self.specHeisGraphPrefix.text()) | |
2162 | except: |
|
2162 | except: | |
2163 | self.console.clear() |
|
2163 | self.console.clear() | |
2164 | self.console.append("Please Write prefix") |
|
2164 | self.console.append("Please Write prefix") | |
2165 | return 0 |
|
2165 | return 0 | |
2166 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2166 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2167 |
|
2167 | |||
2168 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2168 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2169 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2169 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2170 |
|
2170 | |||
2171 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2171 | if self.specHeisGraphftpSpectra.isChecked(): | |
2172 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2172 | opObj.addParameter(name='ftp', value='1', format='int') | |
2173 | self.addFTPConf2Operation(puObj, opObj) |
|
2173 | self.addFTPConf2Operation(puObj, opObj) | |
2174 | addFTP = True |
|
2174 | addFTP = True | |
2175 |
|
2175 | |||
2176 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2176 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2177 | name_operation = 'RTIfromSpectraHeis' |
|
2177 | name_operation = 'RTIfromSpectraHeis' | |
2178 | optype = 'other' |
|
2178 | optype = 'other' | |
2179 |
|
2179 | |||
2180 | name_parameter = 'id' |
|
2180 | name_parameter = 'id' | |
2181 | format = 'int' |
|
2181 | format = 'int' | |
2182 |
|
2182 | |||
2183 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2183 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2184 | value = opObj.id |
|
2184 | value = opObj.id | |
2185 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2185 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2186 |
|
2186 | |||
2187 | if not channelList == '': |
|
2187 | if not channelList == '': | |
2188 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2188 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2189 |
|
2189 | |||
2190 | if not time_range == '': |
|
2190 | if not time_range == '': | |
2191 | xvalueList = time_range.split(',') |
|
2191 | xvalueList = time_range.split(',') | |
2192 | try: |
|
2192 | try: | |
2193 | value = float(xvalueList[0]) |
|
2193 | value = float(xvalueList[0]) | |
2194 | value = float(xvalueList[1]) |
|
2194 | value = float(xvalueList[1]) | |
2195 | except: |
|
2195 | except: | |
2196 | return 0 |
|
2196 | return 0 | |
2197 | format = 'float' |
|
2197 | format = 'float' | |
2198 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2198 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2199 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2199 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2200 |
|
2200 | |||
2201 | if not timerange == '': |
|
2201 | if not timerange == '': | |
2202 | format = 'int' |
|
2202 | format = 'int' | |
2203 | try: |
|
2203 | try: | |
2204 | timerange = int(timerange) |
|
2204 | timerange = int(timerange) | |
2205 | except: |
|
2205 | except: | |
2206 | return 0 |
|
2206 | return 0 | |
2207 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2207 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2208 |
|
2208 | |||
2209 |
|
2209 | |||
2210 | if not power_range == '': |
|
2210 | if not power_range == '': | |
2211 | yvalueList = power_range.split(",") |
|
2211 | yvalueList = power_range.split(",") | |
2212 | try: |
|
2212 | try: | |
2213 | value = float(yvalueList[0]) |
|
2213 | value = float(yvalueList[0]) | |
2214 | value = float(yvalueList[1]) |
|
2214 | value = float(yvalueList[1]) | |
2215 | except: |
|
2215 | except: | |
2216 | return 0 |
|
2216 | return 0 | |
2217 |
|
2217 | |||
2218 | format = 'float' |
|
2218 | format = 'float' | |
2219 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2219 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2220 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2220 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2221 |
|
2221 | |||
2222 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2222 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2223 | checkPath = True |
|
2223 | checkPath = True | |
2224 | opObj.addParameter(name='save', value='1', format='bool') |
|
2224 | opObj.addParameter(name='save', value='1', format='bool') | |
2225 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2225 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2226 | value = str(self.specHeisGraphPrefix.text()) |
|
2226 | value = str(self.specHeisGraphPrefix.text()) | |
2227 | if not value == "": |
|
2227 | if not value == "": | |
2228 | try: |
|
2228 | try: | |
2229 | value = str(self.specHeisGraphPrefix.text()) |
|
2229 | value = str(self.specHeisGraphPrefix.text()) | |
2230 | except: |
|
2230 | except: | |
2231 | self.console.clear() |
|
2231 | self.console.clear() | |
2232 | self.console.append("Please Write prefix") |
|
2232 | self.console.append("Please Write prefix") | |
2233 | return 0 |
|
2233 | return 0 | |
2234 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2234 | opObj.addParameter(name='figfile', value=value, format='str') | |
2235 |
|
2235 | |||
2236 | # test_ftp |
|
2236 | # test_ftp | |
2237 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2237 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2238 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2238 | opObj.addParameter(name='ftp', value='1', format='int') | |
2239 | self.addFTPConf2Operation(puObj, opObj) |
|
2239 | self.addFTPConf2Operation(puObj, opObj) | |
2240 | addFTP = True |
|
2240 | addFTP = True | |
2241 |
|
2241 | |||
2242 | localfolder = None |
|
2242 | localfolder = None | |
2243 | if checkPath: |
|
2243 | if checkPath: | |
2244 | localfolder = str(self.specHeisGraphPath.text()) |
|
2244 | localfolder = str(self.specHeisGraphPath.text()) | |
2245 | if localfolder == '': |
|
2245 | if localfolder == '': | |
2246 | self.console.clear() |
|
2246 | self.console.clear() | |
2247 | self.console.append("Graphic path should be defined") |
|
2247 | self.console.append("Graphic path should be defined") | |
2248 | return 0 |
|
2248 | return 0 | |
2249 |
|
2249 | |||
2250 | if addFTP and not localfolder: |
|
2250 | if addFTP and not localfolder: | |
2251 | self.console.clear() |
|
2251 | self.console.clear() | |
2252 | self.console.append("You should save plots before send them to FTP Server") |
|
2252 | self.console.append("You should save plots before send them to FTP Server") | |
2253 | return 0 |
|
2253 | return 0 | |
2254 |
|
2254 | |||
2255 | # if something happened |
|
2255 | # if something happened | |
2256 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2256 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2257 | if parms_ok: |
|
2257 | if parms_ok: | |
2258 | name_operation = 'FitsWriter' |
|
2258 | name_operation = 'FitsWriter' | |
2259 | optype = 'other' |
|
2259 | optype = 'other' | |
2260 | name_parameter1 = 'path' |
|
2260 | name_parameter1 = 'path' | |
2261 | name_parameter2 = 'dataBlocksPerFile' |
|
2261 | name_parameter2 = 'dataBlocksPerFile' | |
2262 | name_parameter3 = 'metadatafile' |
|
2262 | name_parameter3 = 'metadatafile' | |
2263 | value1 = output_path |
|
2263 | value1 = output_path | |
2264 | value2 = blocksperfile |
|
2264 | value2 = blocksperfile | |
2265 | value3 = metadata_file |
|
2265 | value3 = metadata_file | |
2266 | format2 = "int" |
|
2266 | format2 = "int" | |
2267 | format3 = "str" |
|
2267 | format3 = "str" | |
2268 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2268 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2269 |
|
2269 | |||
2270 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2270 | opObj.addParameter(name=name_parameter1, value=value1) | |
2271 |
|
2271 | |||
2272 | if blocksperfile: |
|
2272 | if blocksperfile: | |
2273 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2273 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2274 |
|
2274 | |||
2275 | if metadata_file: |
|
2275 | if metadata_file: | |
2276 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2276 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2277 |
|
2277 | |||
2278 | self.console.clear() |
|
2278 | self.console.clear() | |
2279 | try: |
|
2279 | try: | |
2280 | self.refreshPUProperties(puObj) |
|
2280 | self.refreshPUProperties(puObj) | |
2281 | except: |
|
2281 | except: | |
2282 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2282 | self.console.append("An error reading input parameters was found ... Check them!") | |
2283 | return 0 |
|
2283 | return 0 | |
2284 |
|
2284 | |||
2285 | self.console.append("Save your project and press Play button to start signal processing") |
|
2285 | self.console.append("Save your project and press Play button to start signal processing") | |
2286 |
|
2286 | |||
2287 | self._enable_save_button() |
|
2287 | self._enable_save_button() | |
2288 | self._enable_play_button() |
|
2288 | self._enable_play_button() | |
2289 |
|
2289 | |||
2290 | return 1 |
|
2290 | return 1 | |
2291 | @pyqtSignature("int") |
|
2291 | @pyqtSignature("int") | |
2292 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2292 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2293 |
|
2293 | |||
2294 | if p0 == 2: |
|
2294 | if p0 == 2: | |
2295 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2295 | self.specHeisGgraphChannelList.setEnabled(True) | |
2296 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2296 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2297 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2297 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2298 | if p0 == 0: |
|
2298 | if p0 == 0: | |
2299 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2299 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2300 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2300 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2301 |
|
2301 | |||
2302 | @pyqtSignature("int") |
|
2302 | @pyqtSignature("int") | |
2303 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2303 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2304 |
|
2304 | |||
2305 | if p0 == 2: |
|
2305 | if p0 == 2: | |
2306 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2306 | self.specHeisGgraphChannelList.setEnabled(True) | |
2307 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2307 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2308 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2308 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2309 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2309 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2310 |
|
2310 | |||
2311 | if p0 == 0: |
|
2311 | if p0 == 0: | |
2312 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2312 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2313 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2313 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2314 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2314 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2315 |
|
2315 | |||
2316 | @pyqtSignature("int") |
|
2316 | @pyqtSignature("int") | |
2317 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2317 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2318 | """ |
|
2318 | """ | |
2319 | """ |
|
2319 | """ | |
2320 | if p0 == 2: |
|
2320 | if p0 == 2: | |
2321 | self.specHeisGraphPath.setEnabled(True) |
|
2321 | self.specHeisGraphPath.setEnabled(True) | |
2322 | self.specHeisGraphPrefix.setEnabled(True) |
|
2322 | self.specHeisGraphPrefix.setEnabled(True) | |
2323 | self.specHeisGraphToolPath.setEnabled(True) |
|
2323 | self.specHeisGraphToolPath.setEnabled(True) | |
2324 | if p0 == 0: |
|
2324 | if p0 == 0: | |
2325 | self.specHeisGraphPath.setEnabled(False) |
|
2325 | self.specHeisGraphPath.setEnabled(False) | |
2326 | self.specHeisGraphPrefix.setEnabled(False) |
|
2326 | self.specHeisGraphPrefix.setEnabled(False) | |
2327 | self.specHeisGraphToolPath.setEnabled(False) |
|
2327 | self.specHeisGraphToolPath.setEnabled(False) | |
2328 |
|
2328 | |||
2329 | @pyqtSignature("int") |
|
2329 | @pyqtSignature("int") | |
2330 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2330 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2331 | if p0 == 2: |
|
2331 | if p0 == 2: | |
2332 | self.specHeisGraphPath.setEnabled(True) |
|
2332 | self.specHeisGraphPath.setEnabled(True) | |
2333 | self.specHeisGraphPrefix.setEnabled(True) |
|
2333 | self.specHeisGraphPrefix.setEnabled(True) | |
2334 | self.specHeisGraphToolPath.setEnabled(True) |
|
2334 | self.specHeisGraphToolPath.setEnabled(True) | |
2335 |
|
2335 | |||
2336 | @pyqtSignature("int") |
|
2336 | @pyqtSignature("int") | |
2337 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2337 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2338 | """ |
|
2338 | """ | |
2339 | """ |
|
2339 | """ | |
2340 | if p0 == 2: |
|
2340 | if p0 == 2: | |
2341 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2341 | self.specHeisGgraphftpratio.setEnabled(True) | |
2342 |
|
2342 | |||
2343 | if p0 == 0: |
|
2343 | if p0 == 0: | |
2344 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2344 | self.specHeisGgraphftpratio.setEnabled(False) | |
2345 |
|
2345 | |||
2346 | @pyqtSignature("int") |
|
2346 | @pyqtSignature("int") | |
2347 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2347 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2348 | if p0 == 2: |
|
2348 | if p0 == 2: | |
2349 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2349 | self.specHeisGgraphftpratio.setEnabled(True) | |
2350 |
|
2350 | |||
2351 | @pyqtSignature("") |
|
2351 | @pyqtSignature("") | |
2352 | def on_specHeisGraphClear_clicked(self): |
|
2352 | def on_specHeisGraphClear_clicked(self): | |
2353 | pass |
|
2353 | pass | |
2354 |
|
2354 | |||
2355 | def __checkSpecGraphSaving(self): |
|
2355 | def __checkSpecGraphSaving(self): | |
2356 |
|
2356 | |||
2357 | enable = False |
|
2357 | enable = False | |
2358 |
|
2358 | |||
2359 | if self.specGraphSaveSpectra.checkState(): |
|
2359 | if self.specGraphSaveSpectra.checkState(): | |
2360 | enable = True |
|
2360 | enable = True | |
2361 |
|
2361 | |||
2362 | if self.specGraphSaveCross.checkState(): |
|
2362 | if self.specGraphSaveCross.checkState(): | |
2363 | enable = True |
|
2363 | enable = True | |
2364 |
|
2364 | |||
2365 | if self.specGraphSaveRTIplot.checkState(): |
|
2365 | if self.specGraphSaveRTIplot.checkState(): | |
2366 | enable = True |
|
2366 | enable = True | |
2367 |
|
2367 | |||
2368 | if self.specGraphSaveCoherencemap.checkState(): |
|
2368 | if self.specGraphSaveCoherencemap.checkState(): | |
2369 | enable = True |
|
2369 | enable = True | |
2370 |
|
2370 | |||
2371 | if self.specGraphSavePowerprofile.checkState(): |
|
2371 | if self.specGraphSavePowerprofile.checkState(): | |
2372 | enable = True |
|
2372 | enable = True | |
2373 |
|
2373 | |||
2374 | if self.specGraphSaveRTInoise.checkState(): |
|
2374 | if self.specGraphSaveRTInoise.checkState(): | |
2375 | enable = True |
|
2375 | enable = True | |
2376 |
|
2376 | |||
2377 | self.specGraphPath.setEnabled(enable) |
|
2377 | self.specGraphPath.setEnabled(enable) | |
2378 | self.specGraphPrefix.setEnabled(enable) |
|
2378 | self.specGraphPrefix.setEnabled(enable) | |
2379 | self.specGraphToolPath.setEnabled(enable) |
|
2379 | self.specGraphToolPath.setEnabled(enable) | |
2380 |
|
2380 | |||
2381 | self.specGgraphftpratio.setEnabled(enable) |
|
2381 | self.specGgraphftpratio.setEnabled(enable) | |
2382 |
|
2382 | |||
2383 | def __checkSpecGraphFTP(self): |
|
2383 | def __checkSpecGraphFTP(self): | |
2384 |
|
2384 | |||
2385 | enable = False |
|
2385 | enable = False | |
2386 |
|
2386 | |||
2387 | if self.specGraphftpSpectra.checkState(): |
|
2387 | if self.specGraphftpSpectra.checkState(): | |
2388 | enable = True |
|
2388 | enable = True | |
2389 |
|
2389 | |||
2390 | if self.specGraphftpCross.checkState(): |
|
2390 | if self.specGraphftpCross.checkState(): | |
2391 | enable = True |
|
2391 | enable = True | |
2392 |
|
2392 | |||
2393 | if self.specGraphftpRTIplot.checkState(): |
|
2393 | if self.specGraphftpRTIplot.checkState(): | |
2394 | enable = True |
|
2394 | enable = True | |
2395 |
|
2395 | |||
2396 | if self.specGraphftpCoherencemap.checkState(): |
|
2396 | if self.specGraphftpCoherencemap.checkState(): | |
2397 | enable = True |
|
2397 | enable = True | |
2398 |
|
2398 | |||
2399 | if self.specGraphftpPowerprofile.checkState(): |
|
2399 | if self.specGraphftpPowerprofile.checkState(): | |
2400 | enable = True |
|
2400 | enable = True | |
2401 |
|
2401 | |||
2402 | if self.specGraphftpRTInoise.checkState(): |
|
2402 | if self.specGraphftpRTInoise.checkState(): | |
2403 | enable = True |
|
2403 | enable = True | |
2404 |
|
2404 | |||
2405 | # self.specGgraphftpratio.setEnabled(enable) |
|
2405 | # self.specGgraphftpratio.setEnabled(enable) | |
2406 |
|
2406 | |||
2407 | def __checkSpecGraphFilters(self): |
|
2407 | def __checkSpecGraphFilters(self): | |
2408 |
|
2408 | |||
2409 | freq = False |
|
2409 | freq = False | |
2410 | height = False |
|
2410 | height = False | |
2411 | db = False |
|
2411 | db = False | |
2412 | timerange = False |
|
2412 | timerange = False | |
2413 | magnitud = False |
|
2413 | magnitud = False | |
2414 | phase = False |
|
2414 | phase = False | |
2415 | channelList = False |
|
2415 | channelList = False | |
2416 |
|
2416 | |||
2417 | if self.specGraphCebSpectraplot.checkState(): |
|
2417 | if self.specGraphCebSpectraplot.checkState(): | |
2418 | freq = True |
|
2418 | freq = True | |
2419 | height = True |
|
2419 | height = True | |
2420 | db = True |
|
2420 | db = True | |
2421 | channelList = True |
|
2421 | channelList = True | |
2422 |
|
2422 | |||
2423 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2423 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2424 | freq = True |
|
2424 | freq = True | |
2425 | height = True |
|
2425 | height = True | |
2426 | db = True |
|
2426 | db = True | |
2427 | magnitud = True |
|
2427 | magnitud = True | |
2428 | phase = True |
|
2428 | phase = True | |
2429 |
|
2429 | |||
2430 | if self.specGraphCebRTIplot.checkState(): |
|
2430 | if self.specGraphCebRTIplot.checkState(): | |
2431 | height = True |
|
2431 | height = True | |
2432 | db = True |
|
2432 | db = True | |
2433 | timerange = True |
|
2433 | timerange = True | |
2434 | channelList = True |
|
2434 | channelList = True | |
2435 |
|
2435 | |||
2436 | if self.specGraphCebCoherencmap.checkState(): |
|
2436 | if self.specGraphCebCoherencmap.checkState(): | |
2437 | height = True |
|
2437 | height = True | |
2438 | timerange = True |
|
2438 | timerange = True | |
2439 | magnitud = True |
|
2439 | magnitud = True | |
2440 | phase = True |
|
2440 | phase = True | |
2441 |
|
2441 | |||
2442 | if self.specGraphPowerprofile.checkState(): |
|
2442 | if self.specGraphPowerprofile.checkState(): | |
2443 | height = True |
|
2443 | height = True | |
2444 | db = True |
|
2444 | db = True | |
2445 | channelList = True |
|
2445 | channelList = True | |
2446 |
|
2446 | |||
2447 | if self.specGraphCebRTInoise.checkState(): |
|
2447 | if self.specGraphCebRTInoise.checkState(): | |
2448 | db = True |
|
2448 | db = True | |
2449 | timerange = True |
|
2449 | timerange = True | |
2450 | channelList = True |
|
2450 | channelList = True | |
2451 |
|
2451 | |||
2452 |
|
2452 | |||
2453 | self.specGgraphFreq.setEnabled(freq) |
|
2453 | self.specGgraphFreq.setEnabled(freq) | |
2454 | self.specGgraphHeight.setEnabled(height) |
|
2454 | self.specGgraphHeight.setEnabled(height) | |
2455 | self.specGgraphDbsrange.setEnabled(db) |
|
2455 | self.specGgraphDbsrange.setEnabled(db) | |
2456 | self.specGgraphTminTmax.setEnabled(timerange) |
|
2456 | self.specGgraphTminTmax.setEnabled(timerange) | |
2457 |
|
2457 | |||
2458 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2458 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2459 | self.specGgraphPhase.setEnabled(phase) |
|
2459 | self.specGgraphPhase.setEnabled(phase) | |
2460 | self.specGgraphChannelList.setEnabled(channelList) |
|
2460 | self.specGgraphChannelList.setEnabled(channelList) | |
2461 |
|
2461 | |||
2462 | def __getParmsFromProjectWindow(self): |
|
2462 | def __getParmsFromProjectWindow(self): | |
2463 | """ |
|
2463 | """ | |
2464 | Check Inputs Project: |
|
2464 | Check Inputs Project: | |
2465 | - project_name |
|
2465 | - project_name | |
2466 | - datatype |
|
2466 | - datatype | |
2467 | - ext |
|
2467 | - ext | |
2468 | - data_path |
|
2468 | - data_path | |
2469 | - readmode |
|
2469 | - readmode | |
2470 | - delay |
|
2470 | - delay | |
2471 | - set |
|
2471 | - set | |
2472 | - walk |
|
2472 | - walk | |
2473 | """ |
|
2473 | """ | |
2474 | parms_ok = True |
|
2474 | parms_ok = True | |
2475 |
|
2475 | |||
2476 | project_name = str(self.proName.text()) |
|
2476 | project_name = str(self.proName.text()) | |
2477 |
|
2477 | |||
2478 | if project_name == '' or project_name == None: |
|
2478 | if project_name == '' or project_name == None: | |
2479 | outputstr = "Enter a project Name" |
|
2479 | outputstr = "Enter a project Name" | |
2480 | self.console.append(outputstr) |
|
2480 | self.console.append(outputstr) | |
2481 | parms_ok = False |
|
2481 | parms_ok = False | |
2482 | project_name = None |
|
2482 | project_name = None | |
2483 |
|
2483 | |||
2484 | description = str(self.proDescription.toPlainText()) |
|
2484 | description = str(self.proDescription.toPlainText()) | |
2485 |
|
2485 | |||
2486 | datatype = str(self.proComDataType.currentText()) |
|
2486 | datatype = str(self.proComDataType.currentText()) | |
2487 |
|
2487 | |||
2488 | ext = str(self.proDataType.text()) |
|
2488 | ext = str(self.proDataType.text()) | |
2489 |
|
2489 | |||
2490 | dpath = str(self.proDataPath.text()) |
|
2490 | dpath = str(self.proDataPath.text()) | |
2491 |
|
2491 | |||
2492 | if dpath == '': |
|
2492 | if dpath == '': | |
2493 | outputstr = 'Datapath is empty' |
|
2493 | outputstr = 'Datapath is empty' | |
2494 | self.console.append(outputstr) |
|
2494 | self.console.append(outputstr) | |
2495 | parms_ok = False |
|
2495 | parms_ok = False | |
2496 | dpath = None |
|
2496 | dpath = None | |
2497 |
|
2497 | |||
2498 | if dpath != None: |
|
2498 | if dpath != None: | |
2499 | if not os.path.isdir(dpath): |
|
2499 | if not os.path.isdir(dpath): | |
2500 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2500 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2501 | self.console.append(outputstr) |
|
2501 | self.console.append(outputstr) | |
2502 | parms_ok = False |
|
2502 | parms_ok = False | |
2503 | dpath = None |
|
2503 | dpath = None | |
2504 |
|
2504 | |||
2505 | online = int(self.proComReadMode.currentIndex()) |
|
2505 | online = int(self.proComReadMode.currentIndex()) | |
2506 |
|
2506 | |||
2507 | delay = None |
|
2507 | delay = None | |
2508 | if online==1: |
|
2508 | if online==1: | |
2509 | try: |
|
2509 | try: | |
2510 | delay = int(str(self.proDelay.text())) |
|
2510 | delay = int(str(self.proDelay.text())) | |
2511 | except: |
|
2511 | except: | |
2512 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2512 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2513 | self.console.append(outputstr) |
|
2513 | self.console.append(outputstr) | |
2514 | parms_ok = False |
|
2514 | parms_ok = False | |
2515 |
|
2515 | |||
2516 |
|
2516 | |||
2517 | set = None |
|
2517 | set = None | |
2518 | value = str(self.proSet.text()) |
|
2518 | value = str(self.proSet.text()) | |
2519 | try: |
|
2519 | try: | |
2520 | set = int(value) |
|
2520 | set = int(value) | |
2521 | except: |
|
2521 | except: | |
2522 | pass |
|
2522 | pass | |
2523 |
|
2523 | |||
2524 | ippKm = None |
|
2524 | ippKm = None | |
2525 |
|
2525 | |||
2526 | value = str(self.proIPPKm.text()) |
|
2526 | value = str(self.proIPPKm.text()) | |
2527 |
|
2527 | |||
2528 | try: |
|
2528 | try: | |
2529 | ippKm = float(value) |
|
2529 | ippKm = float(value) | |
2530 | except: |
|
2530 | except: | |
2531 | if datatype=="USRP": |
|
2531 | if datatype=="USRP": | |
2532 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2532 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2533 | self.console.append(outputstr) |
|
2533 | self.console.append(outputstr) | |
2534 | parms_ok = False |
|
2534 | parms_ok = False | |
2535 |
|
2535 | |||
2536 | walk = int(self.proComWalk.currentIndex()) |
|
2536 | walk = int(self.proComWalk.currentIndex()) | |
2537 | expLabel = str(self.proExpLabel.text()) |
|
2537 | expLabel = str(self.proExpLabel.text()) | |
2538 |
|
2538 | |||
2539 | startDate = str(self.proComStartDate.currentText()) |
|
2539 | startDate = str(self.proComStartDate.currentText()) | |
2540 | endDate = str(self.proComEndDate.currentText()) |
|
2540 | endDate = str(self.proComEndDate.currentText()) | |
2541 |
|
2541 | |||
2542 | # startDateList = startDate.split("/") |
|
2542 | # startDateList = startDate.split("/") | |
2543 | # endDateList = endDate.split("/") |
|
2543 | # endDateList = endDate.split("/") | |
2544 | # |
|
2544 | # | |
2545 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2545 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2546 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2546 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2547 |
|
2547 | |||
2548 | startTime = self.proStartTime.time() |
|
2548 | startTime = self.proStartTime.time() | |
2549 | endTime = self.proEndTime.time() |
|
2549 | endTime = self.proEndTime.time() | |
2550 |
|
2550 | |||
2551 | startTime = str(startTime.toString("H:m:s")) |
|
2551 | startTime = str(startTime.toString("H:m:s")) | |
2552 | endTime = str(endTime.toString("H:m:s")) |
|
2552 | endTime = str(endTime.toString("H:m:s")) | |
2553 |
|
2553 | |||
2554 | projectParms = ProjectParms() |
|
2554 | projectParms = ProjectParms() | |
2555 |
|
2555 | |||
2556 | projectParms.name = project_name |
|
2556 | projectParms.name = project_name | |
2557 | projectParms.description = description |
|
2557 | projectParms.description = description | |
2558 | projectParms.datatype = datatype |
|
2558 | projectParms.datatype = datatype | |
2559 | projectParms.ext = ext |
|
2559 | projectParms.ext = ext | |
2560 | projectParms.dpath = dpath |
|
2560 | projectParms.dpath = dpath | |
2561 | projectParms.online = online |
|
2561 | projectParms.online = online | |
2562 | projectParms.startDate = startDate |
|
2562 | projectParms.startDate = startDate | |
2563 | projectParms.endDate = endDate |
|
2563 | projectParms.endDate = endDate | |
2564 | projectParms.startTime = startTime |
|
2564 | projectParms.startTime = startTime | |
2565 | projectParms.endTime = endTime |
|
2565 | projectParms.endTime = endTime | |
2566 | projectParms.delay = delay |
|
2566 | projectParms.delay = delay | |
2567 | projectParms.walk = walk |
|
2567 | projectParms.walk = walk | |
2568 | projectParms.expLabel = expLabel |
|
2568 | projectParms.expLabel = expLabel | |
2569 | projectParms.set = set |
|
2569 | projectParms.set = set | |
2570 | projectParms.ippKm = ippKm |
|
2570 | projectParms.ippKm = ippKm | |
2571 | projectParms.parmsOk = parms_ok |
|
2571 | projectParms.parmsOk = parms_ok | |
2572 |
|
2572 | |||
2573 | return projectParms |
|
2573 | return projectParms | |
2574 |
|
2574 | |||
2575 |
|
2575 | |||
2576 | def __getParmsFromProjectObj(self, projectObjView): |
|
2576 | def __getParmsFromProjectObj(self, projectObjView): | |
2577 |
|
2577 | |||
2578 | parms_ok = True |
|
2578 | parms_ok = True | |
2579 |
|
2579 | |||
2580 | project_name, description = projectObjView.name, projectObjView.description |
|
2580 | project_name, description = projectObjView.name, projectObjView.description | |
2581 |
|
2581 | |||
2582 | readUnitObj = projectObjView.getReadUnitObj() |
|
2582 | readUnitObj = projectObjView.getReadUnitObj() | |
2583 | datatype = readUnitObj.datatype |
|
2583 | datatype = readUnitObj.datatype | |
2584 |
|
2584 | |||
2585 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2585 | operationObj = readUnitObj.getOperationObj(name='run') | |
2586 |
|
2586 | |||
2587 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2587 | dpath = operationObj.getParameterValue(parameterName='path') | |
2588 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2588 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2589 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2589 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2590 |
|
2590 | |||
2591 | startDate = startDate.strftime("%Y/%m/%d") |
|
2591 | startDate = startDate.strftime("%Y/%m/%d") | |
2592 | endDate = endDate.strftime("%Y/%m/%d") |
|
2592 | endDate = endDate.strftime("%Y/%m/%d") | |
2593 |
|
2593 | |||
2594 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2594 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2595 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2595 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2596 |
|
2596 | |||
2597 | startTime = startTime.strftime("%H:%M:%S") |
|
2597 | startTime = startTime.strftime("%H:%M:%S") | |
2598 | endTime = endTime.strftime("%H:%M:%S") |
|
2598 | endTime = endTime.strftime("%H:%M:%S") | |
2599 |
|
2599 | |||
2600 | online = 0 |
|
2600 | online = 0 | |
2601 | try: |
|
2601 | try: | |
2602 | online = operationObj.getParameterValue(parameterName='online') |
|
2602 | online = operationObj.getParameterValue(parameterName='online') | |
2603 | except: |
|
2603 | except: | |
2604 | pass |
|
2604 | pass | |
2605 |
|
2605 | |||
2606 | delay = '' |
|
2606 | delay = '' | |
2607 | try: |
|
2607 | try: | |
2608 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2608 | delay = operationObj.getParameterValue(parameterName='delay') | |
2609 | except: |
|
2609 | except: | |
2610 | pass |
|
2610 | pass | |
2611 |
|
2611 | |||
2612 | walk = 0 |
|
2612 | walk = 0 | |
2613 | try: |
|
2613 | try: | |
2614 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2614 | walk = operationObj.getParameterValue(parameterName='walk') | |
2615 | except: |
|
2615 | except: | |
2616 | pass |
|
2616 | pass | |
2617 |
|
2617 | |||
2618 | set = '' |
|
2618 | set = '' | |
2619 | try: |
|
2619 | try: | |
2620 | set = operationObj.getParameterValue(parameterName='set') |
|
2620 | set = operationObj.getParameterValue(parameterName='set') | |
2621 | except: |
|
2621 | except: | |
2622 | pass |
|
2622 | pass | |
2623 |
|
2623 | |||
2624 | expLabel = '' |
|
2624 | expLabel = '' | |
2625 | try: |
|
2625 | try: | |
2626 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2626 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2627 | except: |
|
2627 | except: | |
2628 | pass |
|
2628 | pass | |
2629 |
|
2629 | |||
2630 | ippKm = '' |
|
2630 | ippKm = '' | |
2631 | if datatype.lower() == 'usrp': |
|
2631 | if datatype.lower() == 'usrp': | |
2632 | try: |
|
2632 | try: | |
2633 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2633 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2634 | except: |
|
2634 | except: | |
2635 | pass |
|
2635 | pass | |
2636 |
|
2636 | |||
2637 | projectParms = ProjectParms() |
|
2637 | projectParms = ProjectParms() | |
2638 |
|
2638 | |||
2639 | projectParms.name = project_name |
|
2639 | projectParms.name = project_name | |
2640 | projectParms.description = description |
|
2640 | projectParms.description = description | |
2641 | projectParms.datatype = datatype |
|
2641 | projectParms.datatype = datatype | |
2642 | projectParms.ext = None |
|
2642 | projectParms.ext = None | |
2643 | projectParms.dpath = dpath |
|
2643 | projectParms.dpath = dpath | |
2644 | projectParms.online = online |
|
2644 | projectParms.online = online | |
2645 | projectParms.startDate = startDate |
|
2645 | projectParms.startDate = startDate | |
2646 | projectParms.endDate = endDate |
|
2646 | projectParms.endDate = endDate | |
2647 | projectParms.startTime = startTime |
|
2647 | projectParms.startTime = startTime | |
2648 | projectParms.endTime = endTime |
|
2648 | projectParms.endTime = endTime | |
2649 | projectParms.delay=delay |
|
2649 | projectParms.delay=delay | |
2650 | projectParms.walk=walk |
|
2650 | projectParms.walk=walk | |
2651 | projectParms.set=set |
|
2651 | projectParms.set=set | |
2652 | projectParms.ippKm=ippKm |
|
2652 | projectParms.ippKm=ippKm | |
2653 | projectParms.expLabel = expLabel |
|
2653 | projectParms.expLabel = expLabel | |
2654 | projectParms.parmsOk=parms_ok |
|
2654 | projectParms.parmsOk=parms_ok | |
2655 |
|
2655 | |||
2656 | return projectParms |
|
2656 | return projectParms | |
2657 |
|
2657 | |||
2658 | def refreshProjectWindow(self, projectObjView): |
|
2658 | def refreshProjectWindow(self, projectObjView): | |
2659 |
|
2659 | |||
2660 | self.proOk.setEnabled(False) |
|
2660 | self.proOk.setEnabled(False) | |
2661 |
|
2661 | |||
2662 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2662 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2663 |
|
2663 | |||
2664 | index = projectParms.getDatatypeIndex() |
|
2664 | index = projectParms.getDatatypeIndex() | |
2665 |
|
2665 | |||
2666 | self.proName.setText(projectParms.name) |
|
2666 | self.proName.setText(projectParms.name) | |
2667 | self.proDescription.clear() |
|
2667 | self.proDescription.clear() | |
2668 | self.proDescription.append(projectParms.description) |
|
2668 | self.proDescription.append(projectParms.description) | |
2669 |
|
2669 | |||
2670 | self.on_proComDataType_activated(index=index) |
|
2670 | self.on_proComDataType_activated(index=index) | |
2671 | self.proDataPath.setText(projectParms.dpath) |
|
2671 | self.proDataPath.setText(projectParms.dpath) | |
2672 | self.proComDataType.setCurrentIndex(index) |
|
2672 | self.proComDataType.setCurrentIndex(index) | |
2673 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2673 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2674 | self.proDelay.setText(str(projectParms.delay)) |
|
2674 | self.proDelay.setText(str(projectParms.delay)) | |
2675 | self.proSet.setText(str(projectParms.set)) |
|
2675 | self.proSet.setText(str(projectParms.set)) | |
2676 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2676 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2677 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2677 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2678 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2678 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2679 |
|
2679 | |||
2680 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2680 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2681 | ext = projectParms.getExt(), |
|
2681 | ext = projectParms.getExt(), | |
2682 | walk = projectParms.walk, |
|
2682 | walk = projectParms.walk, | |
2683 | expLabel = projectParms.expLabel) |
|
2683 | expLabel = projectParms.expLabel) | |
2684 |
|
2684 | |||
2685 | if not dateList: |
|
2685 | if not dateList: | |
2686 | return |
|
2686 | return | |
2687 |
|
2687 | |||
2688 | try: |
|
2688 | try: | |
2689 | startDateIndex = dateList.index(projectParms.startDate) |
|
2689 | startDateIndex = dateList.index(projectParms.startDate) | |
2690 | except: |
|
2690 | except: | |
2691 | startDateIndex = 0 |
|
2691 | startDateIndex = 0 | |
2692 |
|
2692 | |||
2693 | try: |
|
2693 | try: | |
2694 | endDateIndex = dateList.index(projectParms.endDate) |
|
2694 | endDateIndex = dateList.index(projectParms.endDate) | |
2695 | except: |
|
2695 | except: | |
2696 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2696 | endDateIndex = int(self.proComEndDate.count()-1) | |
2697 |
|
2697 | |||
2698 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2698 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2699 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2699 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2700 |
|
2700 | |||
2701 | startlist = projectParms.startTime.split(":") |
|
2701 | startlist = projectParms.startTime.split(":") | |
2702 | endlist = projectParms.endTime.split(":") |
|
2702 | endlist = projectParms.endTime.split(":") | |
2703 |
|
2703 | |||
2704 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2704 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2705 | self.proStartTime.setTime(self.time) |
|
2705 | self.proStartTime.setTime(self.time) | |
2706 |
|
2706 | |||
2707 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2707 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2708 | self.proEndTime.setTime(self.time) |
|
2708 | self.proEndTime.setTime(self.time) | |
2709 |
|
2709 | |||
2710 | self.proOk.setEnabled(True) |
|
2710 | self.proOk.setEnabled(True) | |
2711 |
|
2711 | |||
2712 | def __refreshVoltageWindow(self, puObj): |
|
2712 | def __refreshVoltageWindow(self, puObj): | |
2713 |
|
2713 | |||
2714 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2714 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2715 | if opObj == None: |
|
2715 | if opObj == None: | |
2716 | self.volOpRadarfrequency.clear() |
|
2716 | self.volOpRadarfrequency.clear() | |
2717 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2717 | self.volOpCebRadarfrequency.setCheckState(0) | |
2718 | else: |
|
2718 | else: | |
2719 | value = opObj.getParameterValue(parameterName='frequency') |
|
2719 | value = opObj.getParameterValue(parameterName='frequency') | |
2720 | value = str(float(value)/1e6) |
|
2720 | value = str(float(value)/1e6) | |
2721 | self.volOpRadarfrequency.setText(value) |
|
2721 | self.volOpRadarfrequency.setText(value) | |
2722 | self.volOpRadarfrequency.setEnabled(True) |
|
2722 | self.volOpRadarfrequency.setEnabled(True) | |
2723 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2723 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2724 |
|
2724 | |||
2725 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2725 | opObj = puObj.getOperationObj(name="selectChannels") | |
2726 |
|
2726 | |||
2727 | if opObj == None: |
|
2727 | if opObj == None: | |
2728 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2728 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2729 |
|
2729 | |||
2730 | if opObj == None: |
|
2730 | if opObj == None: | |
2731 | self.volOpChannel.clear() |
|
2731 | self.volOpChannel.clear() | |
2732 | self.volOpCebChannels.setCheckState(0) |
|
2732 | self.volOpCebChannels.setCheckState(0) | |
2733 | else: |
|
2733 | else: | |
2734 | channelEnabled = False |
|
2734 | channelEnabled = False | |
2735 | try: |
|
2735 | try: | |
2736 | value = opObj.getParameterValue(parameterName='channelList') |
|
2736 | value = opObj.getParameterValue(parameterName='channelList') | |
2737 | value = str(value)[1:-1] |
|
2737 | value = str(value)[1:-1] | |
2738 | channelEnabled = True |
|
2738 | channelEnabled = True | |
2739 | channelMode = 0 |
|
2739 | channelMode = 0 | |
2740 | except: |
|
2740 | except: | |
2741 | pass |
|
2741 | pass | |
2742 | try: |
|
2742 | try: | |
2743 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2743 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2744 | value = str(value)[1:-1] |
|
2744 | value = str(value)[1:-1] | |
2745 | channelEnabled = True |
|
2745 | channelEnabled = True | |
2746 | channelMode = 1 |
|
2746 | channelMode = 1 | |
2747 | except: |
|
2747 | except: | |
2748 | pass |
|
2748 | pass | |
2749 |
|
2749 | |||
2750 | if channelEnabled: |
|
2750 | if channelEnabled: | |
2751 | self.volOpChannel.setText(value) |
|
2751 | self.volOpChannel.setText(value) | |
2752 | self.volOpChannel.setEnabled(True) |
|
2752 | self.volOpChannel.setEnabled(True) | |
2753 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2753 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2754 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2754 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2755 |
|
2755 | |||
2756 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2756 | opObj = puObj.getOperationObj(name="selectHeights") | |
2757 | if opObj == None: |
|
2757 | if opObj == None: | |
2758 | self.volOpHeights.clear() |
|
2758 | self.volOpHeights.clear() | |
2759 | self.volOpCebHeights.setCheckState(0) |
|
2759 | self.volOpCebHeights.setCheckState(0) | |
2760 | else: |
|
2760 | else: | |
2761 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2761 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2762 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2762 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2763 | value = value1 + "," + value2 |
|
2763 | value = value1 + "," + value2 | |
2764 | self.volOpHeights.setText(value) |
|
2764 | self.volOpHeights.setText(value) | |
2765 | self.volOpHeights.setEnabled(True) |
|
2765 | self.volOpHeights.setEnabled(True) | |
2766 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2766 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2767 |
|
2767 | |||
2768 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2768 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2769 | if opObj == None: |
|
2769 | if opObj == None: | |
2770 | self.volOpFilter.clear() |
|
2770 | self.volOpFilter.clear() | |
2771 | self.volOpCebFilter.setCheckState(0) |
|
2771 | self.volOpCebFilter.setCheckState(0) | |
2772 | else: |
|
2772 | else: | |
2773 | value = opObj.getParameterValue(parameterName='window') |
|
2773 | value = opObj.getParameterValue(parameterName='window') | |
2774 | value = str(value) |
|
2774 | value = str(value) | |
2775 | self.volOpFilter.setText(value) |
|
2775 | self.volOpFilter.setText(value) | |
2776 | self.volOpFilter.setEnabled(True) |
|
2776 | self.volOpFilter.setEnabled(True) | |
2777 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2777 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2778 |
|
2778 | |||
2779 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2779 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2780 | if opObj == None: |
|
2780 | if opObj == None: | |
2781 | self.volOpProfile.clear() |
|
2781 | self.volOpProfile.clear() | |
2782 | self.volOpCebProfile.setCheckState(0) |
|
2782 | self.volOpCebProfile.setCheckState(0) | |
2783 | else: |
|
2783 | else: | |
2784 | for parmObj in opObj.getParameterObjList(): |
|
2784 | for parmObj in opObj.getParameterObjList(): | |
2785 |
|
2785 | |||
2786 | if parmObj.name == "profileList": |
|
2786 | if parmObj.name == "profileList": | |
2787 | value = parmObj.getValue() |
|
2787 | value = parmObj.getValue() | |
2788 | value = str(value)[1:-1] |
|
2788 | value = str(value)[1:-1] | |
2789 | self.volOpProfile.setText(value) |
|
2789 | self.volOpProfile.setText(value) | |
2790 | self.volOpProfile.setEnabled(True) |
|
2790 | self.volOpProfile.setEnabled(True) | |
2791 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2791 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2792 | self.volOpComProfile.setCurrentIndex(0) |
|
2792 | self.volOpComProfile.setCurrentIndex(0) | |
2793 |
|
2793 | |||
2794 | if parmObj.name == "profileRangeList": |
|
2794 | if parmObj.name == "profileRangeList": | |
2795 | value = parmObj.getValue() |
|
2795 | value = parmObj.getValue() | |
2796 | value = str(value)[1:-1] |
|
2796 | value = str(value)[1:-1] | |
2797 | self.volOpProfile.setText(value) |
|
2797 | self.volOpProfile.setText(value) | |
2798 | self.volOpProfile.setEnabled(True) |
|
2798 | self.volOpProfile.setEnabled(True) | |
2799 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2799 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2800 | self.volOpComProfile.setCurrentIndex(1) |
|
2800 | self.volOpComProfile.setCurrentIndex(1) | |
2801 |
|
2801 | |||
2802 | if parmObj.name == "rangeList": |
|
2802 | if parmObj.name == "rangeList": | |
2803 | value = parmObj.getValue() |
|
2803 | value = parmObj.getValue() | |
2804 | value = str(value)[1:-1] |
|
2804 | value = str(value)[1:-1] | |
2805 | self.volOpProfile.setText(value) |
|
2805 | self.volOpProfile.setText(value) | |
2806 | self.volOpProfile.setEnabled(True) |
|
2806 | self.volOpProfile.setEnabled(True) | |
2807 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2807 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2808 | self.volOpComProfile.setCurrentIndex(2) |
|
2808 | self.volOpComProfile.setCurrentIndex(2) | |
2809 |
|
2809 | |||
2810 | opObj = puObj.getOperationObj(name="Decoder") |
|
2810 | opObj = puObj.getOperationObj(name="Decoder") | |
2811 | self.volOpCode.setText("") |
|
2811 | self.volOpCode.setText("") | |
2812 | if opObj == None: |
|
2812 | if opObj == None: | |
2813 | self.volOpCebDecodification.setCheckState(0) |
|
2813 | self.volOpCebDecodification.setCheckState(0) | |
2814 | else: |
|
2814 | else: | |
2815 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2815 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2816 |
|
2816 | |||
2817 | parmObj = opObj.getParameterObj('code') |
|
2817 | parmObj = opObj.getParameterObj('code') | |
2818 |
|
2818 | |||
2819 | if parmObj == None: |
|
2819 | if parmObj == None: | |
2820 | self.volOpComCode.setCurrentIndex(0) |
|
2820 | self.volOpComCode.setCurrentIndex(0) | |
2821 | else: |
|
2821 | else: | |
2822 |
|
2822 | |||
2823 | parmObj1 = opObj.getParameterObj('nCode') |
|
2823 | parmObj1 = opObj.getParameterObj('nCode') | |
2824 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2824 | parmObj2 = opObj.getParameterObj('nBaud') | |
2825 |
|
2825 | |||
2826 | if parmObj1 == None or parmObj2 == None: |
|
2826 | if parmObj1 == None or parmObj2 == None: | |
2827 | self.volOpComCode.setCurrentIndex(0) |
|
2827 | self.volOpComCode.setCurrentIndex(0) | |
2828 | else: |
|
2828 | else: | |
2829 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2829 | code = ast.literal_eval(str(parmObj.getValue())) | |
2830 | nCode = parmObj1.getValue() |
|
2830 | nCode = parmObj1.getValue() | |
2831 | nBaud = parmObj2.getValue() |
|
2831 | nBaud = parmObj2.getValue() | |
2832 |
|
2832 | |||
2833 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2833 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2834 |
|
2834 | |||
2835 | #User defined by default |
|
2835 | #User defined by default | |
2836 | self.volOpComCode.setCurrentIndex(13) |
|
2836 | self.volOpComCode.setCurrentIndex(13) | |
2837 | self.volOpCode.setText(str(code)) |
|
2837 | self.volOpCode.setText(str(code)) | |
2838 |
|
2838 | |||
2839 | if nCode == 1: |
|
2839 | if nCode == 1: | |
2840 | if nBaud == 3: |
|
2840 | if nBaud == 3: | |
2841 | self.volOpComCode.setCurrentIndex(1) |
|
2841 | self.volOpComCode.setCurrentIndex(1) | |
2842 | if nBaud == 4: |
|
2842 | if nBaud == 4: | |
2843 | self.volOpComCode.setCurrentIndex(2) |
|
2843 | self.volOpComCode.setCurrentIndex(2) | |
2844 | if nBaud == 5: |
|
2844 | if nBaud == 5: | |
2845 | self.volOpComCode.setCurrentIndex(3) |
|
2845 | self.volOpComCode.setCurrentIndex(3) | |
2846 | if nBaud == 7: |
|
2846 | if nBaud == 7: | |
2847 | self.volOpComCode.setCurrentIndex(4) |
|
2847 | self.volOpComCode.setCurrentIndex(4) | |
2848 | if nBaud == 11: |
|
2848 | if nBaud == 11: | |
2849 | self.volOpComCode.setCurrentIndex(5) |
|
2849 | self.volOpComCode.setCurrentIndex(5) | |
2850 | if nBaud == 13: |
|
2850 | if nBaud == 13: | |
2851 | self.volOpComCode.setCurrentIndex(6) |
|
2851 | self.volOpComCode.setCurrentIndex(6) | |
2852 |
|
2852 | |||
2853 | if nCode == 2: |
|
2853 | if nCode == 2: | |
2854 | if nBaud == 3: |
|
2854 | if nBaud == 3: | |
2855 | self.volOpComCode.setCurrentIndex(7) |
|
2855 | self.volOpComCode.setCurrentIndex(7) | |
2856 | if nBaud == 4: |
|
2856 | if nBaud == 4: | |
2857 | self.volOpComCode.setCurrentIndex(8) |
|
2857 | self.volOpComCode.setCurrentIndex(8) | |
2858 | if nBaud == 5: |
|
2858 | if nBaud == 5: | |
2859 | self.volOpComCode.setCurrentIndex(9) |
|
2859 | self.volOpComCode.setCurrentIndex(9) | |
2860 | if nBaud == 7: |
|
2860 | if nBaud == 7: | |
2861 | self.volOpComCode.setCurrentIndex(10) |
|
2861 | self.volOpComCode.setCurrentIndex(10) | |
2862 | if nBaud == 11: |
|
2862 | if nBaud == 11: | |
2863 | self.volOpComCode.setCurrentIndex(11) |
|
2863 | self.volOpComCode.setCurrentIndex(11) | |
2864 | if nBaud == 13: |
|
2864 | if nBaud == 13: | |
2865 | self.volOpComCode.setCurrentIndex(12) |
|
2865 | self.volOpComCode.setCurrentIndex(12) | |
2866 |
|
2866 | |||
2867 |
|
2867 | |||
2868 | opObj = puObj.getOperationObj(name="deFlip") |
|
2868 | opObj = puObj.getOperationObj(name="deFlip") | |
2869 | if opObj == None: |
|
2869 | if opObj == None: | |
2870 | self.volOpFlip.clear() |
|
2870 | self.volOpFlip.clear() | |
2871 | self.volOpFlip.setEnabled(False) |
|
2871 | self.volOpFlip.setEnabled(False) | |
2872 | self.volOpCebFlip.setCheckState(0) |
|
2872 | self.volOpCebFlip.setCheckState(0) | |
2873 | else: |
|
2873 | else: | |
2874 | try: |
|
2874 | try: | |
2875 | value = opObj.getParameterValue(parameterName='channelList') |
|
2875 | value = opObj.getParameterValue(parameterName='channelList') | |
2876 | value = str(value)[1:-1] |
|
2876 | value = str(value)[1:-1] | |
2877 | except: |
|
2877 | except: | |
2878 | value = "" |
|
2878 | value = "" | |
2879 |
|
2879 | |||
2880 | self.volOpFlip.setText(value) |
|
2880 | self.volOpFlip.setText(value) | |
2881 | self.volOpFlip.setEnabled(True) |
|
2881 | self.volOpFlip.setEnabled(True) | |
2882 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2882 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2883 |
|
2883 | |||
2884 | opObj = puObj.getOperationObj(name="CohInt") |
|
2884 | opObj = puObj.getOperationObj(name="CohInt") | |
2885 | if opObj == None: |
|
2885 | if opObj == None: | |
2886 | self.volOpCohInt.clear() |
|
2886 | self.volOpCohInt.clear() | |
2887 | self.volOpCebCohInt.setCheckState(0) |
|
2887 | self.volOpCebCohInt.setCheckState(0) | |
2888 | else: |
|
2888 | else: | |
2889 | value = opObj.getParameterValue(parameterName='n') |
|
2889 | value = opObj.getParameterValue(parameterName='n') | |
2890 | self.volOpCohInt.setText(str(value)) |
|
2890 | self.volOpCohInt.setText(str(value)) | |
2891 | self.volOpCohInt.setEnabled(True) |
|
2891 | self.volOpCohInt.setEnabled(True) | |
2892 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2892 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2893 |
|
2893 | |||
2894 | opObj = puObj.getOperationObj(name='Scope') |
|
2894 | opObj = puObj.getOperationObj(name='Scope') | |
2895 | if opObj == None: |
|
2895 | if opObj == None: | |
2896 | self.volGraphCebshow.setCheckState(0) |
|
2896 | self.volGraphCebshow.setCheckState(0) | |
2897 | else: |
|
2897 | else: | |
2898 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2898 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2899 |
|
2899 | |||
2900 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2900 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2901 |
|
2901 | |||
2902 | if parmObj == None: |
|
2902 | if parmObj == None: | |
2903 | self.volGraphChannelList.clear() |
|
2903 | self.volGraphChannelList.clear() | |
2904 | else: |
|
2904 | else: | |
2905 | value = parmObj.getValue() |
|
2905 | value = parmObj.getValue() | |
2906 | value = str(value) |
|
2906 | value = str(value) | |
2907 | self.volGraphChannelList.setText(value) |
|
2907 | self.volGraphChannelList.setText(value) | |
2908 | self.volOpProfile.setEnabled(True) |
|
2908 | self.volOpProfile.setEnabled(True) | |
2909 |
|
2909 | |||
2910 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2910 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2911 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2911 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2912 |
|
2912 | |||
2913 | if parmObj1 == None or parmObj2 ==None: |
|
2913 | if parmObj1 == None or parmObj2 ==None: | |
2914 | self.volGraphfreqrange.clear() |
|
2914 | self.volGraphfreqrange.clear() | |
2915 | else: |
|
2915 | else: | |
2916 | value1 = parmObj1.getValue() |
|
2916 | value1 = parmObj1.getValue() | |
2917 | value1 = str(value1) |
|
2917 | value1 = str(value1) | |
2918 | value2 = parmObj2.getValue() |
|
2918 | value2 = parmObj2.getValue() | |
2919 | value2 = str(value2) |
|
2919 | value2 = str(value2) | |
2920 | value = value1 + "," + value2 |
|
2920 | value = value1 + "," + value2 | |
2921 | self.volGraphfreqrange.setText(value) |
|
2921 | self.volGraphfreqrange.setText(value) | |
2922 |
|
2922 | |||
2923 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2923 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2924 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2924 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2925 |
|
2925 | |||
2926 | if parmObj1 == None or parmObj2 ==None: |
|
2926 | if parmObj1 == None or parmObj2 ==None: | |
2927 | self.volGraphHeightrange.clear() |
|
2927 | self.volGraphHeightrange.clear() | |
2928 | else: |
|
2928 | else: | |
2929 | value1 = parmObj1.getValue() |
|
2929 | value1 = parmObj1.getValue() | |
2930 | value1 = str(value1) |
|
2930 | value1 = str(value1) | |
2931 | value2 = parmObj2.getValue() |
|
2931 | value2 = parmObj2.getValue() | |
2932 | value2 = str(value2) |
|
2932 | value2 = str(value2) | |
2933 | value = value1 + "," + value2 |
|
2933 | value = value1 + "," + value2 | |
2934 | value2 = str(value2) |
|
2934 | value2 = str(value2) | |
2935 | self.volGraphHeightrange.setText(value) |
|
2935 | self.volGraphHeightrange.setText(value) | |
2936 |
|
2936 | |||
2937 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2937 | parmObj = opObj.getParameterObj(parameterName='save') | |
2938 |
|
2938 | |||
2939 | if parmObj == None: |
|
2939 | if parmObj == None: | |
2940 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2940 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2941 | else: |
|
2941 | else: | |
2942 | value = parmObj.getValue() |
|
2942 | value = parmObj.getValue() | |
2943 | if value: |
|
2943 | if value: | |
2944 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2944 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2945 | else: |
|
2945 | else: | |
2946 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2946 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2947 |
|
2947 | |||
2948 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2948 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2949 | if parmObj == None: |
|
2949 | if parmObj == None: | |
2950 | self.volGraphPath.clear() |
|
2950 | self.volGraphPath.clear() | |
2951 | else: |
|
2951 | else: | |
2952 | value = parmObj.getValue() |
|
2952 | value = parmObj.getValue() | |
2953 | path = str(value) |
|
2953 | path = str(value) | |
2954 | self.volGraphPath.setText(path) |
|
2954 | self.volGraphPath.setText(path) | |
2955 |
|
2955 | |||
2956 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2956 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2957 | if parmObj == None: |
|
2957 | if parmObj == None: | |
2958 | self.volGraphPrefix.clear() |
|
2958 | self.volGraphPrefix.clear() | |
2959 | else: |
|
2959 | else: | |
2960 | value = parmObj.getValue() |
|
2960 | value = parmObj.getValue() | |
2961 | figfile = str(value) |
|
2961 | figfile = str(value) | |
2962 | self.volGraphPrefix.setText(figfile) |
|
2962 | self.volGraphPrefix.setText(figfile) | |
2963 |
|
2963 | |||
2964 | # outputVoltageWrite |
|
2964 | # outputVoltageWrite | |
2965 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2965 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2966 |
|
2966 | |||
2967 | if opObj == None: |
|
2967 | if opObj == None: | |
2968 | self.volOutputPath.clear() |
|
2968 | self.volOutputPath.clear() | |
2969 | self.volOutputblocksperfile.clear() |
|
2969 | self.volOutputblocksperfile.clear() | |
2970 | self.volOutputprofilesperblock.clear() |
|
2970 | self.volOutputprofilesperblock.clear() | |
2971 | else: |
|
2971 | else: | |
2972 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2972 | parmObj = opObj.getParameterObj(parameterName='path') | |
2973 | if parmObj == None: |
|
2973 | if parmObj == None: | |
2974 | self.volOutputPath.clear() |
|
2974 | self.volOutputPath.clear() | |
2975 | else: |
|
2975 | else: | |
2976 | value = parmObj.getValue() |
|
2976 | value = parmObj.getValue() | |
2977 | path = str(value) |
|
2977 | path = str(value) | |
2978 | self.volOutputPath.setText(path) |
|
2978 | self.volOutputPath.setText(path) | |
2979 |
|
2979 | |||
2980 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2980 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2981 | if parmObj == None: |
|
2981 | if parmObj == None: | |
2982 | self.volOutputblocksperfile.clear() |
|
2982 | self.volOutputblocksperfile.clear() | |
2983 | else: |
|
2983 | else: | |
2984 | value = parmObj.getValue() |
|
2984 | value = parmObj.getValue() | |
2985 | blocksperfile = str(value) |
|
2985 | blocksperfile = str(value) | |
2986 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2986 | self.volOutputblocksperfile.setText(blocksperfile) | |
2987 |
|
2987 | |||
2988 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2988 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2989 | if parmObj == None: |
|
2989 | if parmObj == None: | |
2990 | self.volOutputprofilesperblock.clear() |
|
2990 | self.volOutputprofilesperblock.clear() | |
2991 | else: |
|
2991 | else: | |
2992 | value = parmObj.getValue() |
|
2992 | value = parmObj.getValue() | |
2993 | profilesPerBlock = str(value) |
|
2993 | profilesPerBlock = str(value) | |
2994 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2994 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2995 |
|
2995 | |||
2996 | return |
|
2996 | return | |
2997 |
|
2997 | |||
2998 | def __refreshSpectraWindow(self, puObj): |
|
2998 | def __refreshSpectraWindow(self, puObj): | |
2999 |
|
2999 | |||
3000 | inputId = puObj.getInputId() |
|
3000 | inputId = puObj.getInputId() | |
3001 | inputPUObj = self.__puObjDict[inputId] |
|
3001 | inputPUObj = self.__puObjDict[inputId] | |
3002 |
|
3002 | |||
3003 | if inputPUObj.datatype == 'Voltage': |
|
3003 | if inputPUObj.datatype == 'Voltage': | |
3004 | self.specOpnFFTpoints.setEnabled(True) |
|
3004 | self.specOpnFFTpoints.setEnabled(True) | |
3005 | self.specOpProfiles.setEnabled(True) |
|
3005 | self.specOpProfiles.setEnabled(True) | |
3006 | self.specOpippFactor.setEnabled(True) |
|
3006 | self.specOpippFactor.setEnabled(True) | |
3007 | else: |
|
3007 | else: | |
3008 | self.specOpnFFTpoints.setEnabled(False) |
|
3008 | self.specOpnFFTpoints.setEnabled(False) | |
3009 | self.specOpProfiles.setEnabled(False) |
|
3009 | self.specOpProfiles.setEnabled(False) | |
3010 | self.specOpippFactor.setEnabled(False) |
|
3010 | self.specOpippFactor.setEnabled(False) | |
3011 |
|
3011 | |||
3012 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3012 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3013 | if opObj == None: |
|
3013 | if opObj == None: | |
3014 | self.specOpRadarfrequency.clear() |
|
3014 | self.specOpRadarfrequency.clear() | |
3015 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3015 | self.specOpCebRadarfrequency.setCheckState(0) | |
3016 | else: |
|
3016 | else: | |
3017 | value = opObj.getParameterValue(parameterName='frequency') |
|
3017 | value = opObj.getParameterValue(parameterName='frequency') | |
3018 | value = str(float(value)/1e6) |
|
3018 | value = str(float(value)/1e6) | |
3019 | self.specOpRadarfrequency.setText(value) |
|
3019 | self.specOpRadarfrequency.setText(value) | |
3020 | self.specOpRadarfrequency.setEnabled(True) |
|
3020 | self.specOpRadarfrequency.setEnabled(True) | |
3021 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3021 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3022 |
|
3022 | |||
3023 | opObj = puObj.getOperationObj(name="run") |
|
3023 | opObj = puObj.getOperationObj(name="run") | |
3024 | if opObj == None: |
|
3024 | if opObj == None: | |
3025 | self.specOpnFFTpoints.clear() |
|
3025 | self.specOpnFFTpoints.clear() | |
3026 | self.specOpProfiles.clear() |
|
3026 | self.specOpProfiles.clear() | |
3027 | self.specOpippFactor.clear() |
|
3027 | self.specOpippFactor.clear() | |
3028 | else: |
|
3028 | else: | |
3029 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3029 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3030 | if parmObj == None: |
|
3030 | if parmObj == None: | |
3031 | self.specOpnFFTpoints.clear() |
|
3031 | self.specOpnFFTpoints.clear() | |
3032 | else: |
|
3032 | else: | |
3033 | self.specOpnFFTpoints.setEnabled(True) |
|
3033 | self.specOpnFFTpoints.setEnabled(True) | |
3034 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3034 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3035 | self.specOpnFFTpoints.setText(str(value)) |
|
3035 | self.specOpnFFTpoints.setText(str(value)) | |
3036 |
|
3036 | |||
3037 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3037 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3038 | if parmObj == None: |
|
3038 | if parmObj == None: | |
3039 | self.specOpProfiles.clear() |
|
3039 | self.specOpProfiles.clear() | |
3040 | else: |
|
3040 | else: | |
3041 | self.specOpProfiles.setEnabled(True) |
|
3041 | self.specOpProfiles.setEnabled(True) | |
3042 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3042 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3043 | self.specOpProfiles.setText(str(value)) |
|
3043 | self.specOpProfiles.setText(str(value)) | |
3044 |
|
3044 | |||
3045 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3045 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3046 | if parmObj == None: |
|
3046 | if parmObj == None: | |
3047 | self.specOpippFactor.clear() |
|
3047 | self.specOpippFactor.clear() | |
3048 | else: |
|
3048 | else: | |
3049 | self.specOpippFactor.setEnabled(True) |
|
3049 | self.specOpippFactor.setEnabled(True) | |
3050 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3050 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3051 | self.specOpippFactor.setText(str(value)) |
|
3051 | self.specOpippFactor.setText(str(value)) | |
3052 |
|
3052 | |||
3053 | opObj = puObj.getOperationObj(name="run") |
|
3053 | opObj = puObj.getOperationObj(name="run") | |
3054 | if opObj == None: |
|
3054 | if opObj == None: | |
3055 | self.specOppairsList.clear() |
|
3055 | self.specOppairsList.clear() | |
3056 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3056 | self.specOpCebCrossSpectra.setCheckState(0) | |
3057 | else: |
|
3057 | else: | |
3058 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3058 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3059 | if parmObj == None: |
|
3059 | if parmObj == None: | |
3060 | self.specOppairsList.clear() |
|
3060 | self.specOppairsList.clear() | |
3061 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3061 | self.specOpCebCrossSpectra.setCheckState(0) | |
3062 | else: |
|
3062 | else: | |
3063 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3063 | value = opObj.getParameterValue(parameterName='pairsList') | |
3064 | value = str(value)[1:-1] |
|
3064 | value = str(value)[1:-1] | |
3065 | self.specOppairsList.setText(str(value)) |
|
3065 | self.specOppairsList.setText(str(value)) | |
3066 | self.specOppairsList.setEnabled(True) |
|
3066 | self.specOppairsList.setEnabled(True) | |
3067 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3067 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3068 |
|
3068 | |||
3069 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3069 | opObj = puObj.getOperationObj(name="selectChannels") | |
3070 |
|
3070 | |||
3071 | if opObj == None: |
|
3071 | if opObj == None: | |
3072 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3072 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3073 |
|
3073 | |||
3074 | if opObj == None: |
|
3074 | if opObj == None: | |
3075 | self.specOpChannel.clear() |
|
3075 | self.specOpChannel.clear() | |
3076 | self.specOpCebChannel.setCheckState(0) |
|
3076 | self.specOpCebChannel.setCheckState(0) | |
3077 | else: |
|
3077 | else: | |
3078 | channelEnabled = False |
|
3078 | channelEnabled = False | |
3079 | try: |
|
3079 | try: | |
3080 | value = opObj.getParameterValue(parameterName='channelList') |
|
3080 | value = opObj.getParameterValue(parameterName='channelList') | |
3081 | value = str(value)[1:-1] |
|
3081 | value = str(value)[1:-1] | |
3082 | channelEnabled = True |
|
3082 | channelEnabled = True | |
3083 | channelMode = 0 |
|
3083 | channelMode = 0 | |
3084 | except: |
|
3084 | except: | |
3085 | pass |
|
3085 | pass | |
3086 | try: |
|
3086 | try: | |
3087 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3087 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3088 | value = str(value)[1:-1] |
|
3088 | value = str(value)[1:-1] | |
3089 | channelEnabled = True |
|
3089 | channelEnabled = True | |
3090 | channelMode = 1 |
|
3090 | channelMode = 1 | |
3091 | except: |
|
3091 | except: | |
3092 | pass |
|
3092 | pass | |
3093 |
|
3093 | |||
3094 | if channelEnabled: |
|
3094 | if channelEnabled: | |
3095 | self.specOpChannel.setText(value) |
|
3095 | self.specOpChannel.setText(value) | |
3096 | self.specOpChannel.setEnabled(True) |
|
3096 | self.specOpChannel.setEnabled(True) | |
3097 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3097 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3098 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3098 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3099 |
|
3099 | |||
3100 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3100 | opObj = puObj.getOperationObj(name="selectHeights") | |
3101 | if opObj == None: |
|
3101 | if opObj == None: | |
3102 | self.specOpHeights.clear() |
|
3102 | self.specOpHeights.clear() | |
3103 | self.specOpCebHeights.setCheckState(0) |
|
3103 | self.specOpCebHeights.setCheckState(0) | |
3104 | else: |
|
3104 | else: | |
3105 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3105 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3106 | value1 = str(value1) |
|
3106 | value1 = str(value1) | |
3107 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3107 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3108 | value2 = str(value2) |
|
3108 | value2 = str(value2) | |
3109 | value = value1 + "," + value2 |
|
3109 | value = value1 + "," + value2 | |
3110 | self.specOpHeights.setText(value) |
|
3110 | self.specOpHeights.setText(value) | |
3111 | self.specOpHeights.setEnabled(True) |
|
3111 | self.specOpHeights.setEnabled(True) | |
3112 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3112 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3113 |
|
3113 | |||
3114 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3114 | opObj = puObj.getOperationObj(name="IncohInt") | |
3115 | if opObj == None: |
|
3115 | if opObj == None: | |
3116 | self.specOpIncoherent.clear() |
|
3116 | self.specOpIncoherent.clear() | |
3117 | self.specOpCebIncoherent.setCheckState(0) |
|
3117 | self.specOpCebIncoherent.setCheckState(0) | |
3118 | else: |
|
3118 | else: | |
3119 | for parmObj in opObj.getParameterObjList(): |
|
3119 | for parmObj in opObj.getParameterObjList(): | |
3120 | if parmObj.name == 'timeInterval': |
|
3120 | if parmObj.name == 'timeInterval': | |
3121 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3121 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3122 | self.specOpIncoherent.setText(str(value)) |
|
3122 | self.specOpIncoherent.setText(str(value)) | |
3123 | self.specOpIncoherent.setEnabled(True) |
|
3123 | self.specOpIncoherent.setEnabled(True) | |
3124 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3124 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3125 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3125 | self.specOpCobIncInt.setCurrentIndex(0) | |
3126 |
|
3126 | |||
3127 | if parmObj.name == 'n': |
|
3127 | if parmObj.name == 'n': | |
3128 | value = opObj.getParameterValue(parameterName='n') |
|
3128 | value = opObj.getParameterValue(parameterName='n') | |
3129 | self.specOpIncoherent.setText(str(value)) |
|
3129 | self.specOpIncoherent.setText(str(value)) | |
3130 | self.specOpIncoherent.setEnabled(True) |
|
3130 | self.specOpIncoherent.setEnabled(True) | |
3131 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3131 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3132 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3132 | self.specOpCobIncInt.setCurrentIndex(1) | |
3133 |
|
3133 | |||
3134 | opObj = puObj.getOperationObj(name="removeDC") |
|
3134 | opObj = puObj.getOperationObj(name="removeDC") | |
3135 | if opObj == None: |
|
3135 | if opObj == None: | |
3136 | self.specOpCebRemoveDC.setCheckState(0) |
|
3136 | self.specOpCebRemoveDC.setCheckState(0) | |
3137 | else: |
|
3137 | else: | |
3138 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3138 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3139 | value = opObj.getParameterValue(parameterName='mode') |
|
3139 | value = opObj.getParameterValue(parameterName='mode') | |
3140 | if value == 1: |
|
3140 | if value == 1: | |
3141 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3141 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3142 | elif value == 2: |
|
3142 | elif value == 2: | |
3143 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3143 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3144 |
|
3144 | |||
3145 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3145 | opObj = puObj.getOperationObj(name="removeInterference") | |
3146 | if opObj == None: |
|
3146 | if opObj == None: | |
3147 | self.specOpCebRemoveInt.setCheckState(0) |
|
3147 | self.specOpCebRemoveInt.setCheckState(0) | |
3148 | else: |
|
3148 | else: | |
3149 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3149 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3150 |
|
3150 | |||
3151 | opObj = puObj.getOperationObj(name='getNoise') |
|
3151 | opObj = puObj.getOperationObj(name='getNoise') | |
3152 | if opObj == None: |
|
3152 | if opObj == None: | |
3153 | self.specOpCebgetNoise.setCheckState(0) |
|
3153 | self.specOpCebgetNoise.setCheckState(0) | |
3154 | self.specOpgetNoise.clear() |
|
3154 | self.specOpgetNoise.clear() | |
3155 | else: |
|
3155 | else: | |
3156 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3156 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3157 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3157 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3158 | if parmObj == None: |
|
3158 | if parmObj == None: | |
3159 | self.specOpgetNoise.clear() |
|
3159 | self.specOpgetNoise.clear() | |
3160 | value1 = None |
|
3160 | value1 = None | |
3161 | else: |
|
3161 | else: | |
3162 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3162 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3163 | value1 = str(value1) |
|
3163 | value1 = str(value1) | |
3164 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3164 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3165 | if parmObj == None: |
|
3165 | if parmObj == None: | |
3166 | value2 = None |
|
3166 | value2 = None | |
3167 | value = value1 |
|
3167 | value = value1 | |
3168 | self.specOpgetNoise.setText(value) |
|
3168 | self.specOpgetNoise.setText(value) | |
3169 | self.specOpgetNoise.setEnabled(True) |
|
3169 | self.specOpgetNoise.setEnabled(True) | |
3170 | else: |
|
3170 | else: | |
3171 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3171 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3172 | value2 = str(value2) |
|
3172 | value2 = str(value2) | |
3173 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3173 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3174 | if parmObj == None: |
|
3174 | if parmObj == None: | |
3175 | value3 = None |
|
3175 | value3 = None | |
3176 | value = value1 + "," + value2 |
|
3176 | value = value1 + "," + value2 | |
3177 | self.specOpgetNoise.setText(value) |
|
3177 | self.specOpgetNoise.setText(value) | |
3178 | self.specOpgetNoise.setEnabled(True) |
|
3178 | self.specOpgetNoise.setEnabled(True) | |
3179 | else: |
|
3179 | else: | |
3180 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3180 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3181 | value3 = str(value3) |
|
3181 | value3 = str(value3) | |
3182 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3182 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3183 | if parmObj == None: |
|
3183 | if parmObj == None: | |
3184 | value4 = None |
|
3184 | value4 = None | |
3185 | value = value1 + "," + value2 + "," + value3 |
|
3185 | value = value1 + "," + value2 + "," + value3 | |
3186 | self.specOpgetNoise.setText(value) |
|
3186 | self.specOpgetNoise.setText(value) | |
3187 | self.specOpgetNoise.setEnabled(True) |
|
3187 | self.specOpgetNoise.setEnabled(True) | |
3188 | else: |
|
3188 | else: | |
3189 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3189 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3190 | value4 = str(value4) |
|
3190 | value4 = str(value4) | |
3191 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3191 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3192 | self.specOpgetNoise.setText(value) |
|
3192 | self.specOpgetNoise.setText(value) | |
3193 | self.specOpgetNoise.setEnabled(True) |
|
3193 | self.specOpgetNoise.setEnabled(True) | |
3194 |
|
3194 | |||
3195 | self.specGraphPath.clear() |
|
3195 | self.specGraphPath.clear() | |
3196 | self.specGraphPrefix.clear() |
|
3196 | self.specGraphPrefix.clear() | |
3197 | self.specGgraphFreq.clear() |
|
3197 | self.specGgraphFreq.clear() | |
3198 | self.specGgraphHeight.clear() |
|
3198 | self.specGgraphHeight.clear() | |
3199 | self.specGgraphDbsrange.clear() |
|
3199 | self.specGgraphDbsrange.clear() | |
3200 | self.specGgraphmagnitud.clear() |
|
3200 | self.specGgraphmagnitud.clear() | |
3201 | self.specGgraphPhase.clear() |
|
3201 | self.specGgraphPhase.clear() | |
3202 | self.specGgraphChannelList.clear() |
|
3202 | self.specGgraphChannelList.clear() | |
3203 | self.specGgraphTminTmax.clear() |
|
3203 | self.specGgraphTminTmax.clear() | |
3204 | self.specGgraphTimeRange.clear() |
|
3204 | self.specGgraphTimeRange.clear() | |
3205 | self.specGgraphftpratio.clear() |
|
3205 | self.specGgraphftpratio.clear() | |
3206 |
|
3206 | |||
3207 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3207 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3208 |
|
3208 | |||
3209 | if opObj == None: |
|
3209 | if opObj == None: | |
3210 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3210 | self.specGraphCebSpectraplot.setCheckState(0) | |
3211 | self.specGraphSaveSpectra.setCheckState(0) |
|
3211 | self.specGraphSaveSpectra.setCheckState(0) | |
3212 | self.specGraphftpSpectra.setCheckState(0) |
|
3212 | self.specGraphftpSpectra.setCheckState(0) | |
3213 | else: |
|
3213 | else: | |
3214 | operationSpectraPlot = "Enable" |
|
3214 | operationSpectraPlot = "Enable" | |
3215 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3215 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3216 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3216 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3217 | if parmObj == None: |
|
3217 | if parmObj == None: | |
3218 | self.specGgraphChannelList.clear() |
|
3218 | self.specGgraphChannelList.clear() | |
3219 | else: |
|
3219 | else: | |
3220 | value = opObj.getParameterValue(parameterName='channelList') |
|
3220 | value = opObj.getParameterValue(parameterName='channelList') | |
3221 | channelListSpectraPlot = str(value)[1:-1] |
|
3221 | channelListSpectraPlot = str(value)[1:-1] | |
3222 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3222 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3223 | self.specGgraphChannelList.setEnabled(True) |
|
3223 | self.specGgraphChannelList.setEnabled(True) | |
3224 |
|
3224 | |||
3225 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3225 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3226 | if parmObj == None: |
|
3226 | if parmObj == None: | |
3227 | self.specGgraphFreq.clear() |
|
3227 | self.specGgraphFreq.clear() | |
3228 | else: |
|
3228 | else: | |
3229 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3229 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3230 | value1 = str(value1) |
|
3230 | value1 = str(value1) | |
3231 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3231 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3232 | value2 = str(value2) |
|
3232 | value2 = str(value2) | |
3233 | value = value1 + "," + value2 |
|
3233 | value = value1 + "," + value2 | |
3234 | self.specGgraphFreq.setText(value) |
|
3234 | self.specGgraphFreq.setText(value) | |
3235 | self.specGgraphFreq.setEnabled(True) |
|
3235 | self.specGgraphFreq.setEnabled(True) | |
3236 |
|
3236 | |||
3237 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3237 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3238 | if parmObj == None: |
|
3238 | if parmObj == None: | |
3239 | self.specGgraphHeight.clear() |
|
3239 | self.specGgraphHeight.clear() | |
3240 | else: |
|
3240 | else: | |
3241 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3241 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3242 | value1 = str(value1) |
|
3242 | value1 = str(value1) | |
3243 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3243 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3244 | value2 = str(value2) |
|
3244 | value2 = str(value2) | |
3245 | value = value1 + "," + value2 |
|
3245 | value = value1 + "," + value2 | |
3246 | self.specGgraphHeight.setText(value) |
|
3246 | self.specGgraphHeight.setText(value) | |
3247 | self.specGgraphHeight.setEnabled(True) |
|
3247 | self.specGgraphHeight.setEnabled(True) | |
3248 |
|
3248 | |||
3249 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3249 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3250 | if parmObj == None: |
|
3250 | if parmObj == None: | |
3251 | self.specGgraphDbsrange.clear() |
|
3251 | self.specGgraphDbsrange.clear() | |
3252 | else: |
|
3252 | else: | |
3253 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3253 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3254 | value1 = str(value1) |
|
3254 | value1 = str(value1) | |
3255 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3255 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3256 | value2 = str(value2) |
|
3256 | value2 = str(value2) | |
3257 | value = value1 + "," + value2 |
|
3257 | value = value1 + "," + value2 | |
3258 | self.specGgraphDbsrange.setText(value) |
|
3258 | self.specGgraphDbsrange.setText(value) | |
3259 | self.specGgraphDbsrange.setEnabled(True) |
|
3259 | self.specGgraphDbsrange.setEnabled(True) | |
3260 |
|
3260 | |||
3261 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3261 | parmObj = opObj.getParameterObj(parameterName="save") | |
3262 | if parmObj == None: |
|
3262 | if parmObj == None: | |
3263 | self.specGraphSaveSpectra.setCheckState(0) |
|
3263 | self.specGraphSaveSpectra.setCheckState(0) | |
3264 | else: |
|
3264 | else: | |
3265 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3265 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3266 |
|
3266 | |||
3267 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3267 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3268 | if parmObj == None: |
|
3268 | if parmObj == None: | |
3269 | self.specGraphftpSpectra.setCheckState(0) |
|
3269 | self.specGraphftpSpectra.setCheckState(0) | |
3270 | else: |
|
3270 | else: | |
3271 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3271 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3272 |
|
3272 | |||
3273 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3273 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3274 | if parmObj: |
|
3274 | if parmObj: | |
3275 | value = parmObj.getValue() |
|
3275 | value = parmObj.getValue() | |
3276 | self.specGraphPath.setText(value) |
|
3276 | self.specGraphPath.setText(value) | |
3277 |
|
3277 | |||
3278 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3278 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3279 | if parmObj: |
|
3279 | if parmObj: | |
3280 | value = parmObj.getValue() |
|
3280 | value = parmObj.getValue() | |
3281 | self.specGgraphftpratio.setText(str(value)) |
|
3281 | self.specGgraphftpratio.setText(str(value)) | |
3282 |
|
3282 | |||
3283 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3283 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3284 |
|
3284 | |||
3285 | if opObj == None: |
|
3285 | if opObj == None: | |
3286 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3286 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3287 | self.specGraphSaveCross.setCheckState(0) |
|
3287 | self.specGraphSaveCross.setCheckState(0) | |
3288 | self.specGraphftpCross.setCheckState(0) |
|
3288 | self.specGraphftpCross.setCheckState(0) | |
3289 | else: |
|
3289 | else: | |
3290 | operationCrossSpectraPlot = "Enable" |
|
3290 | operationCrossSpectraPlot = "Enable" | |
3291 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3291 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3292 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3292 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3293 | if parmObj == None: |
|
3293 | if parmObj == None: | |
3294 | self.specGgraphFreq.clear() |
|
3294 | self.specGgraphFreq.clear() | |
3295 | else: |
|
3295 | else: | |
3296 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3296 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3297 | value1 = str(value1) |
|
3297 | value1 = str(value1) | |
3298 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3298 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3299 | value2 = str(value2) |
|
3299 | value2 = str(value2) | |
3300 | value = value1 + "," + value2 |
|
3300 | value = value1 + "," + value2 | |
3301 | self.specGgraphFreq.setText(value) |
|
3301 | self.specGgraphFreq.setText(value) | |
3302 | self.specGgraphFreq.setEnabled(True) |
|
3302 | self.specGgraphFreq.setEnabled(True) | |
3303 |
|
3303 | |||
3304 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3304 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3305 | if parmObj == None: |
|
3305 | if parmObj == None: | |
3306 | self.specGgraphHeight.clear() |
|
3306 | self.specGgraphHeight.clear() | |
3307 | else: |
|
3307 | else: | |
3308 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3308 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3309 | value1 = str(value1) |
|
3309 | value1 = str(value1) | |
3310 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3310 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3311 | value2 = str(value2) |
|
3311 | value2 = str(value2) | |
3312 | value = value1 + "," + value2 |
|
3312 | value = value1 + "," + value2 | |
3313 | self.specGgraphHeight.setText(value) |
|
3313 | self.specGgraphHeight.setText(value) | |
3314 | self.specGgraphHeight.setEnabled(True) |
|
3314 | self.specGgraphHeight.setEnabled(True) | |
3315 |
|
3315 | |||
3316 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3316 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3317 | if parmObj == None: |
|
3317 | if parmObj == None: | |
3318 | self.specGgraphDbsrange.clear() |
|
3318 | self.specGgraphDbsrange.clear() | |
3319 | else: |
|
3319 | else: | |
3320 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3320 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3321 | value1 = str(value1) |
|
3321 | value1 = str(value1) | |
3322 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3322 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3323 | value2 = str(value2) |
|
3323 | value2 = str(value2) | |
3324 | value = value1 + "," + value2 |
|
3324 | value = value1 + "," + value2 | |
3325 | self.specGgraphDbsrange.setText(value) |
|
3325 | self.specGgraphDbsrange.setText(value) | |
3326 | self.specGgraphDbsrange.setEnabled(True) |
|
3326 | self.specGgraphDbsrange.setEnabled(True) | |
3327 |
|
3327 | |||
3328 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3328 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3329 | if parmObj == None: |
|
3329 | if parmObj == None: | |
3330 | self.specGgraphmagnitud.clear() |
|
3330 | self.specGgraphmagnitud.clear() | |
3331 | else: |
|
3331 | else: | |
3332 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3332 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3333 | value1 = str(value1) |
|
3333 | value1 = str(value1) | |
3334 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3334 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3335 | value2 = str(value2) |
|
3335 | value2 = str(value2) | |
3336 | value = value1 + "," + value2 |
|
3336 | value = value1 + "," + value2 | |
3337 | self.specGgraphmagnitud.setText(value) |
|
3337 | self.specGgraphmagnitud.setText(value) | |
3338 | self.specGgraphmagnitud.setEnabled(True) |
|
3338 | self.specGgraphmagnitud.setEnabled(True) | |
3339 |
|
3339 | |||
3340 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3340 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3341 | if parmObj == None: |
|
3341 | if parmObj == None: | |
3342 | self.specGgraphPhase.clear() |
|
3342 | self.specGgraphPhase.clear() | |
3343 | else: |
|
3343 | else: | |
3344 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3344 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3345 | value1 = str(value1) |
|
3345 | value1 = str(value1) | |
3346 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3346 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3347 | value2 = str(value2) |
|
3347 | value2 = str(value2) | |
3348 | value = value1 + "," + value2 |
|
3348 | value = value1 + "," + value2 | |
3349 | self.specGgraphPhase.setText(value) |
|
3349 | self.specGgraphPhase.setText(value) | |
3350 | self.specGgraphPhase.setEnabled(True) |
|
3350 | self.specGgraphPhase.setEnabled(True) | |
3351 |
|
3351 | |||
3352 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3352 | parmObj = opObj.getParameterObj(parameterName="save") | |
3353 | if parmObj == None: |
|
3353 | if parmObj == None: | |
3354 | self.specGraphSaveCross.setCheckState(0) |
|
3354 | self.specGraphSaveCross.setCheckState(0) | |
3355 | else: |
|
3355 | else: | |
3356 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3356 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3357 |
|
3357 | |||
3358 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3358 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3359 | if parmObj == None: |
|
3359 | if parmObj == None: | |
3360 | self.specGraphftpCross.setCheckState(0) |
|
3360 | self.specGraphftpCross.setCheckState(0) | |
3361 | else: |
|
3361 | else: | |
3362 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3362 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3363 |
|
3363 | |||
3364 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3364 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3365 | if parmObj: |
|
3365 | if parmObj: | |
3366 | value = parmObj.getValue() |
|
3366 | value = parmObj.getValue() | |
3367 | self.specGraphPath.setText(value) |
|
3367 | self.specGraphPath.setText(value) | |
3368 |
|
3368 | |||
3369 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3369 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3370 | if parmObj: |
|
3370 | if parmObj: | |
3371 | value = parmObj.getValue() |
|
3371 | value = parmObj.getValue() | |
3372 | self.specGgraphftpratio.setText(str(value)) |
|
3372 | self.specGgraphftpratio.setText(str(value)) | |
3373 |
|
3373 | |||
3374 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3374 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3375 |
|
3375 | |||
3376 | if opObj == None: |
|
3376 | if opObj == None: | |
3377 | self.specGraphCebRTIplot.setCheckState(0) |
|
3377 | self.specGraphCebRTIplot.setCheckState(0) | |
3378 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3378 | self.specGraphSaveRTIplot.setCheckState(0) | |
3379 | self.specGraphftpRTIplot.setCheckState(0) |
|
3379 | self.specGraphftpRTIplot.setCheckState(0) | |
3380 | else: |
|
3380 | else: | |
3381 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3381 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3382 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3382 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3383 | if parmObj == None: |
|
3383 | if parmObj == None: | |
3384 | self.specGgraphChannelList.clear() |
|
3384 | self.specGgraphChannelList.clear() | |
3385 | else: |
|
3385 | else: | |
3386 | value = opObj.getParameterValue(parameterName='channelList') |
|
3386 | value = opObj.getParameterValue(parameterName='channelList') | |
3387 | channelListRTIPlot = str(value)[1:-1] |
|
3387 | channelListRTIPlot = str(value)[1:-1] | |
3388 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3388 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3389 | self.specGgraphChannelList.setEnabled(True) |
|
3389 | self.specGgraphChannelList.setEnabled(True) | |
3390 |
|
3390 | |||
3391 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3391 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3392 | if parmObj == None: |
|
3392 | if parmObj == None: | |
3393 | self.specGgraphTminTmax.clear() |
|
3393 | self.specGgraphTminTmax.clear() | |
3394 | else: |
|
3394 | else: | |
3395 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3395 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3396 | value1 = str(value1) |
|
3396 | value1 = str(value1) | |
3397 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3397 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3398 | value2 = str(value2) |
|
3398 | value2 = str(value2) | |
3399 | value = value1 + "," + value2 |
|
3399 | value = value1 + "," + value2 | |
3400 | self.specGgraphTminTmax.setText(value) |
|
3400 | self.specGgraphTminTmax.setText(value) | |
3401 | self.specGgraphTminTmax.setEnabled(True) |
|
3401 | self.specGgraphTminTmax.setEnabled(True) | |
3402 |
|
3402 | |||
3403 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3403 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3404 | if parmObj == None: |
|
3404 | if parmObj == None: | |
3405 | self.specGgraphTimeRange.clear() |
|
3405 | self.specGgraphTimeRange.clear() | |
3406 | else: |
|
3406 | else: | |
3407 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3407 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3408 | value1 = str(value1) |
|
3408 | value1 = str(value1) | |
3409 | self.specGgraphTimeRange.setText(value1) |
|
3409 | self.specGgraphTimeRange.setText(value1) | |
3410 | self.specGgraphTimeRange.setEnabled(True) |
|
3410 | self.specGgraphTimeRange.setEnabled(True) | |
3411 |
|
3411 | |||
3412 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3412 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3413 | if parmObj == None: |
|
3413 | if parmObj == None: | |
3414 | self.specGgraphHeight.clear() |
|
3414 | self.specGgraphHeight.clear() | |
3415 | else: |
|
3415 | else: | |
3416 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3416 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3417 | value1 = str(value1) |
|
3417 | value1 = str(value1) | |
3418 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3418 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3419 | value2 = str(value2) |
|
3419 | value2 = str(value2) | |
3420 | value = value1 + "," + value2 |
|
3420 | value = value1 + "," + value2 | |
3421 | self.specGgraphHeight.setText(value) |
|
3421 | self.specGgraphHeight.setText(value) | |
3422 | self.specGgraphHeight.setEnabled(True) |
|
3422 | self.specGgraphHeight.setEnabled(True) | |
3423 |
|
3423 | |||
3424 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3424 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3425 | if parmObj == None: |
|
3425 | if parmObj == None: | |
3426 | self.specGgraphDbsrange.clear() |
|
3426 | self.specGgraphDbsrange.clear() | |
3427 | else: |
|
3427 | else: | |
3428 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3428 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3429 | value1 = str(value1) |
|
3429 | value1 = str(value1) | |
3430 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3430 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3431 | value2 = str(value2) |
|
3431 | value2 = str(value2) | |
3432 | value = value1 + "," + value2 |
|
3432 | value = value1 + "," + value2 | |
3433 | self.specGgraphDbsrange.setText(value) |
|
3433 | self.specGgraphDbsrange.setText(value) | |
3434 | self.specGgraphDbsrange.setEnabled(True) |
|
3434 | self.specGgraphDbsrange.setEnabled(True) | |
3435 |
|
3435 | |||
3436 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3436 | parmObj = opObj.getParameterObj(parameterName="save") | |
3437 | if parmObj == None: |
|
3437 | if parmObj == None: | |
3438 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3438 | self.specGraphSaveRTIplot.setCheckState(0) | |
3439 | else: |
|
3439 | else: | |
3440 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3440 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3441 |
|
3441 | |||
3442 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3442 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3443 | if parmObj == None: |
|
3443 | if parmObj == None: | |
3444 | self.specGraphftpRTIplot.setCheckState(0) |
|
3444 | self.specGraphftpRTIplot.setCheckState(0) | |
3445 | else: |
|
3445 | else: | |
3446 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3446 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3447 |
|
3447 | |||
3448 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3448 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3449 | if parmObj: |
|
3449 | if parmObj: | |
3450 | value = parmObj.getValue() |
|
3450 | value = parmObj.getValue() | |
3451 | self.specGraphPath.setText(value) |
|
3451 | self.specGraphPath.setText(value) | |
3452 |
|
3452 | |||
3453 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3453 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3454 | if parmObj: |
|
3454 | if parmObj: | |
3455 | value = parmObj.getValue() |
|
3455 | value = parmObj.getValue() | |
3456 | self.specGgraphftpratio.setText(str(value)) |
|
3456 | self.specGgraphftpratio.setText(str(value)) | |
3457 |
|
3457 | |||
3458 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3458 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3459 |
|
3459 | |||
3460 | if opObj == None: |
|
3460 | if opObj == None: | |
3461 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3461 | self.specGraphCebCoherencmap.setCheckState(0) | |
3462 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3462 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3463 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3463 | self.specGraphftpCoherencemap.setCheckState(0) | |
3464 | else: |
|
3464 | else: | |
3465 | operationCoherenceMap = "Enable" |
|
3465 | operationCoherenceMap = "Enable" | |
3466 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3466 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3467 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3467 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3468 | if parmObj == None: |
|
3468 | if parmObj == None: | |
3469 | self.specGgraphTminTmax.clear() |
|
3469 | self.specGgraphTminTmax.clear() | |
3470 | else: |
|
3470 | else: | |
3471 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3471 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3472 | value1 = str(value1) |
|
3472 | value1 = str(value1) | |
3473 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3473 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3474 | value2 = str(value2) |
|
3474 | value2 = str(value2) | |
3475 | value = value1 + "," + value2 |
|
3475 | value = value1 + "," + value2 | |
3476 | self.specGgraphTminTmax.setText(value) |
|
3476 | self.specGgraphTminTmax.setText(value) | |
3477 | self.specGgraphTminTmax.setEnabled(True) |
|
3477 | self.specGgraphTminTmax.setEnabled(True) | |
3478 |
|
3478 | |||
3479 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3479 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3480 | if parmObj == None: |
|
3480 | if parmObj == None: | |
3481 | self.specGgraphTimeRange.clear() |
|
3481 | self.specGgraphTimeRange.clear() | |
3482 | else: |
|
3482 | else: | |
3483 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3483 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3484 | value1 = str(value1) |
|
3484 | value1 = str(value1) | |
3485 | self.specGgraphTimeRange.setText(value1) |
|
3485 | self.specGgraphTimeRange.setText(value1) | |
3486 | self.specGgraphTimeRange.setEnabled(True) |
|
3486 | self.specGgraphTimeRange.setEnabled(True) | |
3487 |
|
3487 | |||
3488 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3488 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3489 | if parmObj == None: |
|
3489 | if parmObj == None: | |
3490 | self.specGgraphHeight.clear() |
|
3490 | self.specGgraphHeight.clear() | |
3491 | else: |
|
3491 | else: | |
3492 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3492 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3493 | value1 = str(value1) |
|
3493 | value1 = str(value1) | |
3494 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3494 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3495 | value2 = str(value2) |
|
3495 | value2 = str(value2) | |
3496 | value = value1 + "," + value2 |
|
3496 | value = value1 + "," + value2 | |
3497 | self.specGgraphHeight.setText(value) |
|
3497 | self.specGgraphHeight.setText(value) | |
3498 | self.specGgraphHeight.setEnabled(True) |
|
3498 | self.specGgraphHeight.setEnabled(True) | |
3499 |
|
3499 | |||
3500 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3500 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3501 | if parmObj == None: |
|
3501 | if parmObj == None: | |
3502 | self.specGgraphmagnitud.clear() |
|
3502 | self.specGgraphmagnitud.clear() | |
3503 | else: |
|
3503 | else: | |
3504 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3504 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3505 | value1 = str(value1) |
|
3505 | value1 = str(value1) | |
3506 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3506 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3507 | value2 = str(value2) |
|
3507 | value2 = str(value2) | |
3508 | value = value1 + "," + value2 |
|
3508 | value = value1 + "," + value2 | |
3509 | self.specGgraphmagnitud.setText(value) |
|
3509 | self.specGgraphmagnitud.setText(value) | |
3510 | self.specGgraphmagnitud.setEnabled(True) |
|
3510 | self.specGgraphmagnitud.setEnabled(True) | |
3511 |
|
3511 | |||
3512 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3512 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3513 | if parmObj == None: |
|
3513 | if parmObj == None: | |
3514 | self.specGgraphmagnitud.clear() |
|
3514 | self.specGgraphmagnitud.clear() | |
3515 | else: |
|
3515 | else: | |
3516 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3516 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3517 | value1 = str(value1) |
|
3517 | value1 = str(value1) | |
3518 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3518 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3519 | value2 = str(value2) |
|
3519 | value2 = str(value2) | |
3520 | value = value1 + "," + value2 |
|
3520 | value = value1 + "," + value2 | |
3521 | self.specGgraphmagnitud.setText(value) |
|
3521 | self.specGgraphmagnitud.setText(value) | |
3522 | self.specGgraphmagnitud.setEnabled(True) |
|
3522 | self.specGgraphmagnitud.setEnabled(True) | |
3523 |
|
3523 | |||
3524 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3524 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3525 | if parmObj == None: |
|
3525 | if parmObj == None: | |
3526 | self.specGgraphPhase.clear() |
|
3526 | self.specGgraphPhase.clear() | |
3527 | else: |
|
3527 | else: | |
3528 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3528 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3529 | value1 = str(value1) |
|
3529 | value1 = str(value1) | |
3530 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3530 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3531 | value2 = str(value2) |
|
3531 | value2 = str(value2) | |
3532 | value = value1 + "," + value2 |
|
3532 | value = value1 + "," + value2 | |
3533 | self.specGgraphPhase.setText(value) |
|
3533 | self.specGgraphPhase.setText(value) | |
3534 | self.specGgraphPhase.setEnabled(True) |
|
3534 | self.specGgraphPhase.setEnabled(True) | |
3535 |
|
3535 | |||
3536 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3536 | parmObj = opObj.getParameterObj(parameterName="save") | |
3537 | if parmObj == None: |
|
3537 | if parmObj == None: | |
3538 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3538 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3539 | else: |
|
3539 | else: | |
3540 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3540 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3541 |
|
3541 | |||
3542 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3542 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3543 | if parmObj == None: |
|
3543 | if parmObj == None: | |
3544 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3544 | self.specGraphftpCoherencemap.setCheckState(0) | |
3545 | else: |
|
3545 | else: | |
3546 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3546 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3547 |
|
3547 | |||
3548 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3548 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3549 | if parmObj: |
|
3549 | if parmObj: | |
3550 | value = parmObj.getValue() |
|
3550 | value = parmObj.getValue() | |
3551 | self.specGraphPath.setText(value) |
|
3551 | self.specGraphPath.setText(value) | |
3552 |
|
3552 | |||
3553 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3553 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3554 | if parmObj: |
|
3554 | if parmObj: | |
3555 | value = parmObj.getValue() |
|
3555 | value = parmObj.getValue() | |
3556 | self.specGgraphftpratio.setText(str(value)) |
|
3556 | self.specGgraphftpratio.setText(str(value)) | |
3557 |
|
3557 | |||
3558 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3558 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3559 |
|
3559 | |||
3560 | if opObj == None: |
|
3560 | if opObj == None: | |
3561 | self.specGraphPowerprofile.setCheckState(0) |
|
3561 | self.specGraphPowerprofile.setCheckState(0) | |
3562 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3562 | self.specGraphSavePowerprofile.setCheckState(0) | |
3563 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3563 | self.specGraphftpPowerprofile.setCheckState(0) | |
3564 | operationPowerProfilePlot = "Disabled" |
|
3564 | operationPowerProfilePlot = "Disabled" | |
3565 | channelList = None |
|
3565 | channelList = None | |
3566 | freq_vel = None |
|
3566 | freq_vel = None | |
3567 | heightsrange = None |
|
3567 | heightsrange = None | |
3568 | else: |
|
3568 | else: | |
3569 | operationPowerProfilePlot = "Enable" |
|
3569 | operationPowerProfilePlot = "Enable" | |
3570 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3570 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3571 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3571 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3572 | if parmObj == None: |
|
3572 | if parmObj == None: | |
3573 | self.specGgraphDbsrange.clear() |
|
3573 | self.specGgraphDbsrange.clear() | |
3574 | else: |
|
3574 | else: | |
3575 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3575 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3576 | value1 = str(value1) |
|
3576 | value1 = str(value1) | |
3577 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3577 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3578 | value2 = str(value2) |
|
3578 | value2 = str(value2) | |
3579 | value = value1 + "," + value2 |
|
3579 | value = value1 + "," + value2 | |
3580 | self.specGgraphDbsrange.setText(value) |
|
3580 | self.specGgraphDbsrange.setText(value) | |
3581 | self.specGgraphDbsrange.setEnabled(True) |
|
3581 | self.specGgraphDbsrange.setEnabled(True) | |
3582 |
|
3582 | |||
3583 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3583 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3584 | if parmObj == None: |
|
3584 | if parmObj == None: | |
3585 | self.specGgraphHeight.clear() |
|
3585 | self.specGgraphHeight.clear() | |
3586 | else: |
|
3586 | else: | |
3587 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3587 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3588 | value1 = str(value1) |
|
3588 | value1 = str(value1) | |
3589 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3589 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3590 | value2 = str(value2) |
|
3590 | value2 = str(value2) | |
3591 | value = value1 + "," + value2 |
|
3591 | value = value1 + "," + value2 | |
3592 | self.specGgraphHeight.setText(value) |
|
3592 | self.specGgraphHeight.setText(value) | |
3593 | self.specGgraphHeight.setEnabled(True) |
|
3593 | self.specGgraphHeight.setEnabled(True) | |
3594 |
|
3594 | |||
3595 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3595 | parmObj = opObj.getParameterObj(parameterName="save") | |
3596 | if parmObj == None: |
|
3596 | if parmObj == None: | |
3597 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3597 | self.specGraphSavePowerprofile.setCheckState(0) | |
3598 | else: |
|
3598 | else: | |
3599 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3599 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3600 |
|
3600 | |||
3601 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3601 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3602 | if parmObj == None: |
|
3602 | if parmObj == None: | |
3603 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3603 | self.specGraphftpPowerprofile.setCheckState(0) | |
3604 | else: |
|
3604 | else: | |
3605 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3605 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3606 |
|
3606 | |||
3607 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3607 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3608 | if parmObj: |
|
3608 | if parmObj: | |
3609 | value = parmObj.getValue() |
|
3609 | value = parmObj.getValue() | |
3610 | self.specGraphPath.setText(value) |
|
3610 | self.specGraphPath.setText(value) | |
3611 |
|
3611 | |||
3612 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3612 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3613 | if parmObj: |
|
3613 | if parmObj: | |
3614 | value = parmObj.getValue() |
|
3614 | value = parmObj.getValue() | |
3615 | self.specGgraphftpratio.setText(str(value)) |
|
3615 | self.specGgraphftpratio.setText(str(value)) | |
3616 |
|
3616 | |||
3617 | opObj = puObj.getOperationObj(name='Noise') |
|
3617 | opObj = puObj.getOperationObj(name='Noise') | |
3618 |
|
3618 | |||
3619 | if opObj == None: |
|
3619 | if opObj == None: | |
3620 | self.specGraphCebRTInoise.setCheckState(0) |
|
3620 | self.specGraphCebRTInoise.setCheckState(0) | |
3621 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3621 | self.specGraphSaveRTInoise.setCheckState(0) | |
3622 | self.specGraphftpRTInoise.setCheckState(0) |
|
3622 | self.specGraphftpRTInoise.setCheckState(0) | |
3623 | else: |
|
3623 | else: | |
3624 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3624 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3625 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3625 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3626 | if parmObj == None: |
|
3626 | if parmObj == None: | |
3627 | self.specGgraphChannelList.clear() |
|
3627 | self.specGgraphChannelList.clear() | |
3628 | else: |
|
3628 | else: | |
3629 | value = opObj.getParameterValue(parameterName='channelList') |
|
3629 | value = opObj.getParameterValue(parameterName='channelList') | |
3630 | channelListRTINoise = str(value)[1:-1] |
|
3630 | channelListRTINoise = str(value)[1:-1] | |
3631 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3631 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3632 | self.specGgraphChannelList.setEnabled(True) |
|
3632 | self.specGgraphChannelList.setEnabled(True) | |
3633 |
|
3633 | |||
3634 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3634 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3635 | if parmObj == None: |
|
3635 | if parmObj == None: | |
3636 | self.specGgraphTminTmax.clear() |
|
3636 | self.specGgraphTminTmax.clear() | |
3637 | else: |
|
3637 | else: | |
3638 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3638 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3639 | value1 = str(value1) |
|
3639 | value1 = str(value1) | |
3640 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3640 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3641 | value2 = str(value2) |
|
3641 | value2 = str(value2) | |
3642 | value = value1 + "," + value2 |
|
3642 | value = value1 + "," + value2 | |
3643 | self.specGgraphTminTmax.setText(value) |
|
3643 | self.specGgraphTminTmax.setText(value) | |
3644 | self.specGgraphTminTmax.setEnabled(True) |
|
3644 | self.specGgraphTminTmax.setEnabled(True) | |
3645 |
|
3645 | |||
3646 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3646 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3647 | if parmObj == None: |
|
3647 | if parmObj == None: | |
3648 | self.specGgraphTimeRange.clear() |
|
3648 | self.specGgraphTimeRange.clear() | |
3649 | else: |
|
3649 | else: | |
3650 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3650 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3651 | value1 = str(value1) |
|
3651 | value1 = str(value1) | |
3652 | self.specGgraphTimeRange.setText(value1) |
|
3652 | self.specGgraphTimeRange.setText(value1) | |
3653 | self.specGgraphTimeRange.setEnabled(True) |
|
3653 | self.specGgraphTimeRange.setEnabled(True) | |
3654 |
|
3654 | |||
3655 |
|
3655 | |||
3656 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3656 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3657 | if parmObj == None: |
|
3657 | if parmObj == None: | |
3658 | self.specGgraphDbsrange.clear() |
|
3658 | self.specGgraphDbsrange.clear() | |
3659 | else: |
|
3659 | else: | |
3660 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3660 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3661 | value1 = str(value1) |
|
3661 | value1 = str(value1) | |
3662 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3662 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3663 | value2 = str(value2) |
|
3663 | value2 = str(value2) | |
3664 | value = value1 + "," + value2 |
|
3664 | value = value1 + "," + value2 | |
3665 | self.specGgraphDbsrange.setText(value) |
|
3665 | self.specGgraphDbsrange.setText(value) | |
3666 | self.specGgraphDbsrange.setEnabled(True) |
|
3666 | self.specGgraphDbsrange.setEnabled(True) | |
3667 |
|
3667 | |||
3668 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3668 | parmObj = opObj.getParameterObj(parameterName="save") | |
3669 | if parmObj == None: |
|
3669 | if parmObj == None: | |
3670 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3670 | self.specGraphSaveRTInoise.setCheckState(0) | |
3671 | else: |
|
3671 | else: | |
3672 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3672 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3673 |
|
3673 | |||
3674 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3674 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3675 | if parmObj == None: |
|
3675 | if parmObj == None: | |
3676 | self.specGraphftpRTInoise.setCheckState(0) |
|
3676 | self.specGraphftpRTInoise.setCheckState(0) | |
3677 | else: |
|
3677 | else: | |
3678 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3678 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3679 |
|
3679 | |||
3680 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3680 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3681 | if parmObj: |
|
3681 | if parmObj: | |
3682 | value = parmObj.getValue() |
|
3682 | value = parmObj.getValue() | |
3683 | self.specGraphPath.setText(value) |
|
3683 | self.specGraphPath.setText(value) | |
3684 |
|
3684 | |||
3685 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3685 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3686 | if parmObj: |
|
3686 | if parmObj: | |
3687 | value = parmObj.getValue() |
|
3687 | value = parmObj.getValue() | |
3688 | self.specGgraphftpratio.setText(str(value)) |
|
3688 | self.specGgraphftpratio.setText(str(value)) | |
3689 |
|
3689 | |||
3690 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3690 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3691 | if opObj == None: |
|
3691 | if opObj == None: | |
3692 | self.specOutputPath.clear() |
|
3692 | self.specOutputPath.clear() | |
3693 | self.specOutputblocksperfile.clear() |
|
3693 | self.specOutputblocksperfile.clear() | |
3694 | else: |
|
3694 | else: | |
3695 | value = opObj.getParameterObj(parameterName='path') |
|
3695 | value = opObj.getParameterObj(parameterName='path') | |
3696 | if value == None: |
|
3696 | if value == None: | |
3697 | self.specOutputPath.clear() |
|
3697 | self.specOutputPath.clear() | |
3698 | else: |
|
3698 | else: | |
3699 | value = opObj.getParameterValue(parameterName='path') |
|
3699 | value = opObj.getParameterValue(parameterName='path') | |
3700 | path = str(value) |
|
3700 | path = str(value) | |
3701 | self.specOutputPath.setText(path) |
|
3701 | self.specOutputPath.setText(path) | |
3702 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3702 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3703 | if value == None: |
|
3703 | if value == None: | |
3704 | self.specOutputblocksperfile.clear() |
|
3704 | self.specOutputblocksperfile.clear() | |
3705 | else: |
|
3705 | else: | |
3706 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3706 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3707 | blocksperfile = str(value) |
|
3707 | blocksperfile = str(value) | |
3708 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3708 | self.specOutputblocksperfile.setText(blocksperfile) | |
3709 |
|
3709 | |||
3710 | return |
|
3710 | return | |
3711 |
|
3711 | |||
3712 | def __refreshSpectraHeisWindow(self, puObj): |
|
3712 | def __refreshSpectraHeisWindow(self, puObj): | |
3713 |
|
3713 | |||
3714 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3714 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3715 | if opObj == None: |
|
3715 | if opObj == None: | |
3716 | self.specHeisOpIncoherent.clear() |
|
3716 | self.specHeisOpIncoherent.clear() | |
3717 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3717 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3718 | else: |
|
3718 | else: | |
3719 | for parmObj in opObj.getParameterObjList(): |
|
3719 | for parmObj in opObj.getParameterObjList(): | |
3720 | if parmObj.name == 'timeInterval': |
|
3720 | if parmObj.name == 'timeInterval': | |
3721 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3721 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3722 | self.specHeisOpIncoherent.setText(str(value)) |
|
3722 | self.specHeisOpIncoherent.setText(str(value)) | |
3723 | self.specHeisOpIncoherent.setEnabled(True) |
|
3723 | self.specHeisOpIncoherent.setEnabled(True) | |
3724 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3724 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3725 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3725 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3726 |
|
3726 | |||
3727 | # SpectraHeis Graph |
|
3727 | # SpectraHeis Graph | |
3728 |
|
3728 | |||
3729 | self.specHeisGgraphXminXmax.clear() |
|
3729 | self.specHeisGgraphXminXmax.clear() | |
3730 | self.specHeisGgraphYminYmax.clear() |
|
3730 | self.specHeisGgraphYminYmax.clear() | |
3731 |
|
3731 | |||
3732 | self.specHeisGgraphChannelList.clear() |
|
3732 | self.specHeisGgraphChannelList.clear() | |
3733 | self.specHeisGgraphTminTmax.clear() |
|
3733 | self.specHeisGgraphTminTmax.clear() | |
3734 | self.specHeisGgraphTimeRange.clear() |
|
3734 | self.specHeisGgraphTimeRange.clear() | |
3735 | self.specHeisGgraphftpratio.clear() |
|
3735 | self.specHeisGgraphftpratio.clear() | |
3736 |
|
3736 | |||
3737 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3737 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3738 | if opObj == None: |
|
3738 | if opObj == None: | |
3739 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3739 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3740 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3740 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3741 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3741 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3742 | else: |
|
3742 | else: | |
3743 | operationSpectraHeisScope = "Enable" |
|
3743 | operationSpectraHeisScope = "Enable" | |
3744 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3744 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3745 |
|
3745 | |||
3746 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3746 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3747 | if parmObj == None: |
|
3747 | if parmObj == None: | |
3748 | self.specHeisGgraphChannelList.clear() |
|
3748 | self.specHeisGgraphChannelList.clear() | |
3749 | else: |
|
3749 | else: | |
3750 | value = opObj.getParameterValue(parameterName='channelList') |
|
3750 | value = opObj.getParameterValue(parameterName='channelList') | |
3751 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3751 | channelListSpectraHeisScope = str(value)[1:-1] | |
3752 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3752 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3753 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3753 | self.specHeisGgraphChannelList.setEnabled(True) | |
3754 |
|
3754 | |||
3755 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3755 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3756 | if parmObj == None: |
|
3756 | if parmObj == None: | |
3757 | self.specHeisGgraphXminXmax.clear() |
|
3757 | self.specHeisGgraphXminXmax.clear() | |
3758 | else: |
|
3758 | else: | |
3759 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3759 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3760 | value1 = str(value1) |
|
3760 | value1 = str(value1) | |
3761 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3761 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3762 | value2 = str(value2) |
|
3762 | value2 = str(value2) | |
3763 | value = value1 + "," + value2 |
|
3763 | value = value1 + "," + value2 | |
3764 | self.specHeisGgraphXminXmax.setText(value) |
|
3764 | self.specHeisGgraphXminXmax.setText(value) | |
3765 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3765 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3766 |
|
3766 | |||
3767 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3767 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3768 | if parmObj == None: |
|
3768 | if parmObj == None: | |
3769 | self.specHeisGgraphYminYmax.clear() |
|
3769 | self.specHeisGgraphYminYmax.clear() | |
3770 | else: |
|
3770 | else: | |
3771 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3771 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3772 | value1 = str(value1) |
|
3772 | value1 = str(value1) | |
3773 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3773 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3774 | value2 = str(value2) |
|
3774 | value2 = str(value2) | |
3775 | value = value1 + "," + value2 |
|
3775 | value = value1 + "," + value2 | |
3776 | self.specHeisGgraphYminYmax.setText(value) |
|
3776 | self.specHeisGgraphYminYmax.setText(value) | |
3777 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3777 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3778 |
|
3778 | |||
3779 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3779 | parmObj = opObj.getParameterObj(parameterName="save") | |
3780 | if parmObj == None: |
|
3780 | if parmObj == None: | |
3781 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3781 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3782 | else: |
|
3782 | else: | |
3783 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3783 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3784 |
|
3784 | |||
3785 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3785 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3786 | if parmObj == None: |
|
3786 | if parmObj == None: | |
3787 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3787 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3788 | else: |
|
3788 | else: | |
3789 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3789 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3790 |
|
3790 | |||
3791 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3791 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3792 | if parmObj: |
|
3792 | if parmObj: | |
3793 | value = parmObj.getValue() |
|
3793 | value = parmObj.getValue() | |
3794 | self.specHeisGraphPath.setText(value) |
|
3794 | self.specHeisGraphPath.setText(value) | |
3795 |
|
3795 | |||
3796 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3796 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3797 | if parmObj: |
|
3797 | if parmObj: | |
3798 | value = parmObj.getValue() |
|
3798 | value = parmObj.getValue() | |
3799 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3799 | self.specHeisGgraphftpratio.setText(str(value)) | |
3800 |
|
3800 | |||
3801 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3801 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3802 |
|
3802 | |||
3803 | if opObj == None: |
|
3803 | if opObj == None: | |
3804 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3804 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3805 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3805 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3806 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3806 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3807 | else: |
|
3807 | else: | |
3808 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3808 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3809 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3809 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3810 | if parmObj == None: |
|
3810 | if parmObj == None: | |
3811 | self.specHeisGgraphChannelList.clear() |
|
3811 | self.specHeisGgraphChannelList.clear() | |
3812 | else: |
|
3812 | else: | |
3813 | value = opObj.getParameterValue(parameterName='channelList') |
|
3813 | value = opObj.getParameterValue(parameterName='channelList') | |
3814 | channelListRTIPlot = str(value)[1:-1] |
|
3814 | channelListRTIPlot = str(value)[1:-1] | |
3815 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3815 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3816 | self.specGgraphChannelList.setEnabled(True) |
|
3816 | self.specGgraphChannelList.setEnabled(True) | |
3817 |
|
3817 | |||
3818 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3818 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3819 | if parmObj == None: |
|
3819 | if parmObj == None: | |
3820 | self.specHeisGgraphTminTmax.clear() |
|
3820 | self.specHeisGgraphTminTmax.clear() | |
3821 | else: |
|
3821 | else: | |
3822 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3822 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3823 | value1 = str(value1) |
|
3823 | value1 = str(value1) | |
3824 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3824 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3825 | value2 = str(value2) |
|
3825 | value2 = str(value2) | |
3826 | value = value1 + "," + value2 |
|
3826 | value = value1 + "," + value2 | |
3827 | self.specHeisGgraphTminTmax.setText(value) |
|
3827 | self.specHeisGgraphTminTmax.setText(value) | |
3828 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3828 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3829 |
|
3829 | |||
3830 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3830 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3831 | if parmObj == None: |
|
3831 | if parmObj == None: | |
3832 | self.specGgraphTimeRange.clear() |
|
3832 | self.specGgraphTimeRange.clear() | |
3833 | else: |
|
3833 | else: | |
3834 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3834 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3835 | value1 = str(value1) |
|
3835 | value1 = str(value1) | |
3836 | self.specHeisGgraphTimeRange.setText(value1) |
|
3836 | self.specHeisGgraphTimeRange.setText(value1) | |
3837 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3837 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3838 |
|
3838 | |||
3839 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3839 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3840 | if parmObj == None: |
|
3840 | if parmObj == None: | |
3841 | self.specHeisGgraphYminYmax.clear() |
|
3841 | self.specHeisGgraphYminYmax.clear() | |
3842 | else: |
|
3842 | else: | |
3843 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3843 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3844 | value1 = str(value1) |
|
3844 | value1 = str(value1) | |
3845 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3845 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3846 | value2 = str(value2) |
|
3846 | value2 = str(value2) | |
3847 | value = value1 + "," + value2 |
|
3847 | value = value1 + "," + value2 | |
3848 | self.specHeisGgraphYminYmax.setText(value) |
|
3848 | self.specHeisGgraphYminYmax.setText(value) | |
3849 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3849 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3850 |
|
3850 | |||
3851 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3851 | parmObj = opObj.getParameterObj(parameterName="save") | |
3852 | if parmObj == None: |
|
3852 | if parmObj == None: | |
3853 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3853 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3854 | else: |
|
3854 | else: | |
3855 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3855 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3856 |
|
3856 | |||
3857 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3857 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3858 | if parmObj == None: |
|
3858 | if parmObj == None: | |
3859 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3859 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3860 | else: |
|
3860 | else: | |
3861 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3861 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3862 |
|
3862 | |||
3863 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3863 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3864 | if parmObj: |
|
3864 | if parmObj: | |
3865 | value = parmObj.getValue() |
|
3865 | value = parmObj.getValue() | |
3866 | self.specHeisGraphPath.setText(value) |
|
3866 | self.specHeisGraphPath.setText(value) | |
3867 |
|
3867 | |||
3868 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3868 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3869 | if parmObj: |
|
3869 | if parmObj: | |
3870 | value = parmObj.getValue() |
|
3870 | value = parmObj.getValue() | |
3871 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3871 | self.specHeisGgraphftpratio.setText(str(value)) | |
3872 |
|
3872 | |||
3873 | # outputSpectraHeisWrite |
|
3873 | # outputSpectraHeisWrite | |
3874 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3874 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3875 | if opObj == None: |
|
3875 | if opObj == None: | |
3876 | self.specHeisOutputPath.clear() |
|
3876 | self.specHeisOutputPath.clear() | |
3877 | self.specHeisOutputblocksperfile.clear() |
|
3877 | self.specHeisOutputblocksperfile.clear() | |
3878 | self.specHeisOutputMetada.clear() |
|
3878 | self.specHeisOutputMetada.clear() | |
3879 | else: |
|
3879 | else: | |
3880 | value = opObj.getParameterObj(parameterName='path') |
|
3880 | value = opObj.getParameterObj(parameterName='path') | |
3881 | if value == None: |
|
3881 | if value == None: | |
3882 | self.specHeisOutputPath.clear() |
|
3882 | self.specHeisOutputPath.clear() | |
3883 | else: |
|
3883 | else: | |
3884 | value = opObj.getParameterValue(parameterName='path') |
|
3884 | value = opObj.getParameterValue(parameterName='path') | |
3885 | path = str(value) |
|
3885 | path = str(value) | |
3886 | self.specHeisOutputPath.setText(path) |
|
3886 | self.specHeisOutputPath.setText(path) | |
3887 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3887 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3888 | if value == None: |
|
3888 | if value == None: | |
3889 | self.specHeisOutputblocksperfile.clear() |
|
3889 | self.specHeisOutputblocksperfile.clear() | |
3890 | else: |
|
3890 | else: | |
3891 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3891 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3892 | blocksperfile = str(value) |
|
3892 | blocksperfile = str(value) | |
3893 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3893 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3894 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3894 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3895 | if value == None: |
|
3895 | if value == None: | |
3896 | self.specHeisOutputMetada.clear() |
|
3896 | self.specHeisOutputMetada.clear() | |
3897 | else: |
|
3897 | else: | |
3898 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3898 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3899 | metadata_file = str(value) |
|
3899 | metadata_file = str(value) | |
3900 | self.specHeisOutputMetada.setText(metadata_file) |
|
3900 | self.specHeisOutputMetada.setText(metadata_file) | |
3901 |
|
3901 | |||
3902 | return |
|
3902 | return | |
3903 |
|
3903 | |||
3904 | def __refreshCorrelationWindow(self, puObj): |
|
3904 | def __refreshCorrelationWindow(self, puObj): | |
3905 | pass |
|
3905 | pass | |
3906 |
|
3906 | |||
3907 | def refreshPUWindow(self, puObj): |
|
3907 | def refreshPUWindow(self, puObj): | |
3908 |
|
3908 | |||
3909 | if puObj.datatype == 'Voltage': |
|
3909 | if puObj.datatype == 'Voltage': | |
3910 | self.__refreshVoltageWindow(puObj) |
|
3910 | self.__refreshVoltageWindow(puObj) | |
3911 |
|
3911 | |||
3912 | if puObj.datatype == 'Spectra': |
|
3912 | if puObj.datatype == 'Spectra': | |
3913 | self.__refreshSpectraWindow(puObj) |
|
3913 | self.__refreshSpectraWindow(puObj) | |
3914 |
|
3914 | |||
3915 | if puObj.datatype == 'SpectraHeis': |
|
3915 | if puObj.datatype == 'SpectraHeis': | |
3916 | self.__refreshSpectraHeisWindow(puObj) |
|
3916 | self.__refreshSpectraHeisWindow(puObj) | |
3917 |
|
3917 | |||
3918 | def refreshProjectProperties(self, projectObjView): |
|
3918 | def refreshProjectProperties(self, projectObjView): | |
3919 |
|
3919 | |||
3920 | propertyBuffObj = PropertyBuffer() |
|
3920 | propertyBuffObj = PropertyBuffer() | |
3921 | name = projectObjView.name |
|
3921 | name = projectObjView.name | |
3922 |
|
3922 | |||
3923 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3923 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3924 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3924 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3925 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3925 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3926 |
|
3926 | |||
3927 | readUnitObj = projectObjView.getReadUnitObj() |
|
3927 | readUnitObj = projectObjView.getReadUnitObj() | |
3928 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3928 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3929 |
|
3929 | |||
3930 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3930 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3931 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3931 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3932 |
|
3932 | |||
3933 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3933 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3934 |
|
3934 | |||
3935 | self.treeProjectProperties.setModel(propertiesModel) |
|
3935 | self.treeProjectProperties.setModel(propertiesModel) | |
3936 | self.treeProjectProperties.expandAll() |
|
3936 | self.treeProjectProperties.expandAll() | |
3937 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3937 | self.treeProjectProperties.resizeColumnToContents(0) | |
3938 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3938 | self.treeProjectProperties.resizeColumnToContents(1) | |
3939 |
|
3939 | |||
3940 | def refreshPUProperties(self, puObjView): |
|
3940 | def refreshPUProperties(self, puObjView): | |
3941 |
|
3941 | |||
3942 | ############ FTP CONFIG ################################ |
|
3942 | ############ FTP CONFIG ################################ | |
3943 | #Deleting FTP Conf. This processing unit have not got any |
|
3943 | #Deleting FTP Conf. This processing unit have not got any | |
3944 | #FTP configuration by default |
|
3944 | #FTP configuration by default | |
3945 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
3945 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
3946 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
3946 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
3947 | ######################################################## |
|
3947 | ######################################################## | |
3948 |
|
3948 | |||
3949 | propertyBuffObj = PropertyBuffer() |
|
3949 | propertyBuffObj = PropertyBuffer() | |
3950 |
|
3950 | |||
3951 | for thisOp in puObjView.getOperationObjList(): |
|
3951 | for thisOp in puObjView.getOperationObjList(): | |
3952 |
|
3952 | |||
3953 | operationName = thisOp.name |
|
3953 | operationName = thisOp.name | |
3954 |
|
3954 | |||
3955 | if operationName == 'run': |
|
3955 | if operationName == 'run': | |
3956 | operationName = 'Properties' |
|
3956 | operationName = 'Properties' | |
3957 |
|
3957 | |||
3958 | else: |
|
3958 | else: | |
3959 | if not thisOp.getParameterObjList(): |
|
3959 | if not thisOp.getParameterObjList(): | |
3960 | propertyBuffObj.append(operationName, '--', '--') |
|
3960 | propertyBuffObj.append(operationName, '--', '--') | |
3961 | continue |
|
3961 | continue | |
3962 |
|
3962 | |||
3963 | for thisParmObj in thisOp.getParameterObjList(): |
|
3963 | for thisParmObj in thisOp.getParameterObjList(): | |
3964 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3964 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3965 |
|
3965 | |||
3966 | ############ FTP CONFIG ################################ |
|
3966 | ############ FTP CONFIG ################################ | |
3967 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
3967 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
3968 | value = thisParmObj.getValue() |
|
3968 | value = thisParmObj.getValue() | |
3969 | self.temporalFTP.ftp_wei = value |
|
3969 | self.temporalFTP.ftp_wei = value | |
3970 |
|
3970 | |||
3971 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
3971 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
3972 | value = thisParmObj.getValue() |
|
3972 | value = thisParmObj.getValue() | |
3973 | self.temporalFTP.exp_code = value |
|
3973 | self.temporalFTP.exp_code = value | |
3974 |
|
3974 | |||
3975 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
3975 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
3976 | value = thisParmObj.getValue() |
|
3976 | value = thisParmObj.getValue() | |
3977 | self.temporalFTP.sub_exp_code = value |
|
3977 | self.temporalFTP.sub_exp_code = value | |
3978 |
|
3978 | |||
3979 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
3979 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
3980 | value = thisParmObj.getValue() |
|
3980 | value = thisParmObj.getValue() | |
3981 | self.temporalFTP.plot_pos = value |
|
3981 | self.temporalFTP.plot_pos = value | |
3982 |
|
3982 | |||
3983 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
3983 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
3984 | figpathObj = thisOp.getParameterObj('figpath') |
|
3984 | figpathObj = thisOp.getParameterObj('figpath') | |
3985 | if figpathObj: |
|
3985 | if figpathObj: | |
3986 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
3986 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
3987 |
|
3987 | |||
3988 | ######################################################## |
|
3988 | ######################################################## | |
3989 |
|
3989 | |||
3990 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3990 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3991 |
|
3991 | |||
3992 | self.treeProjectProperties.setModel(propertiesModel) |
|
3992 | self.treeProjectProperties.setModel(propertiesModel) | |
3993 | self.treeProjectProperties.expandAll() |
|
3993 | self.treeProjectProperties.expandAll() | |
3994 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3994 | self.treeProjectProperties.resizeColumnToContents(0) | |
3995 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3995 | self.treeProjectProperties.resizeColumnToContents(1) | |
3996 |
|
3996 | |||
3997 | def refreshGraphicsId(self): |
|
3997 | def refreshGraphicsId(self): | |
3998 |
|
3998 | |||
3999 | projectObj = self.getSelectedProjectObj() |
|
3999 | projectObj = self.getSelectedProjectObj() | |
4000 |
|
4000 | |||
4001 | if not projectObj: |
|
4001 | if not projectObj: | |
4002 | return |
|
4002 | return | |
4003 |
|
4003 | |||
4004 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
4004 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
4005 |
|
4005 | |||
4006 | for opObj in puObj.getOperationObjList(): |
|
4006 | for opObj in puObj.getOperationObjList(): | |
4007 |
|
4007 | |||
4008 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
4008 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
4009 | continue |
|
4009 | continue | |
4010 |
|
4010 | |||
4011 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4011 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4012 |
|
4012 | |||
4013 | def on_click(self, index): |
|
4013 | def on_click(self, index): | |
4014 |
|
4014 | |||
4015 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4015 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4016 |
|
4016 | |||
4017 | projectObjView = self.getSelectedProjectObj() |
|
4017 | projectObjView = self.getSelectedProjectObj() | |
4018 |
|
4018 | |||
4019 | if not projectObjView: |
|
4019 | if not projectObjView: | |
4020 | return |
|
4020 | return | |
4021 |
|
4021 | |||
4022 | self.create = False |
|
4022 | self.create = False | |
4023 | selectedObjView = self.getSelectedItemObj() |
|
4023 | selectedObjView = self.getSelectedItemObj() | |
4024 |
|
4024 | |||
4025 | #A project has been selected |
|
4025 | #A project has been selected | |
4026 | if projectObjView == selectedObjView: |
|
4026 | if projectObjView == selectedObjView: | |
4027 |
|
4027 | |||
4028 | self.refreshProjectWindow(projectObjView) |
|
4028 | self.refreshProjectWindow(projectObjView) | |
4029 | self.refreshProjectProperties(projectObjView) |
|
4029 | self.refreshProjectProperties(projectObjView) | |
4030 |
|
4030 | |||
4031 | self.tabProject.setEnabled(True) |
|
4031 | self.tabProject.setEnabled(True) | |
4032 | self.tabVoltage.setEnabled(False) |
|
4032 | self.tabVoltage.setEnabled(False) | |
4033 | self.tabSpectra.setEnabled(False) |
|
4033 | self.tabSpectra.setEnabled(False) | |
4034 | self.tabCorrelation.setEnabled(False) |
|
4034 | self.tabCorrelation.setEnabled(False) | |
4035 | self.tabSpectraHeis.setEnabled(False) |
|
4035 | self.tabSpectraHeis.setEnabled(False) | |
4036 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4036 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4037 |
|
4037 | |||
4038 | return |
|
4038 | return | |
4039 |
|
4039 | |||
4040 | #A processing unit has been selected |
|
4040 | #A processing unit has been selected | |
4041 | voltEnable = False |
|
4041 | voltEnable = False | |
4042 | specEnable = False |
|
4042 | specEnable = False | |
4043 | corrEnable = False |
|
4043 | corrEnable = False | |
4044 | specHeisEnable = False |
|
4044 | specHeisEnable = False | |
4045 | tabSelected = self.tabProject |
|
4045 | tabSelected = self.tabProject | |
4046 |
|
4046 | |||
4047 | puObj = selectedObjView |
|
4047 | puObj = selectedObjView | |
4048 |
|
4048 | |||
4049 | self.refreshPUWindow(puObj) |
|
4049 | self.refreshPUWindow(puObj) | |
4050 | self.refreshPUProperties(puObj) |
|
4050 | self.refreshPUProperties(puObj) | |
4051 | self.showtabPUCreated(puObj.datatype) |
|
4051 | self.showtabPUCreated(puObj.datatype) | |
4052 |
|
4052 | |||
4053 | def on_right_click(self, pos): |
|
4053 | def on_right_click(self, pos): | |
4054 |
|
4054 | |||
4055 | self.menu = QtGui.QMenu() |
|
4055 | self.menu = QtGui.QMenu() | |
4056 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4056 | quitAction0 = self.menu.addAction("Create a New Project") | |
4057 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4057 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4058 | quitAction2 = self.menu.addAction("Delete Item") |
|
4058 | quitAction2 = self.menu.addAction("Delete Item") | |
4059 | quitAction3 = self.menu.addAction("Quit") |
|
4059 | quitAction3 = self.menu.addAction("Quit") | |
4060 |
|
4060 | |||
4061 | if len(self.__itemTreeDict) == 0: |
|
4061 | if len(self.__itemTreeDict) == 0: | |
4062 | quitAction2.setEnabled(False) |
|
4062 | quitAction2.setEnabled(False) | |
4063 | else: |
|
4063 | else: | |
4064 | quitAction2.setEnabled(True) |
|
4064 | quitAction2.setEnabled(True) | |
4065 |
|
4065 | |||
4066 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4066 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4067 |
|
4067 | |||
4068 | if action == quitAction0: |
|
4068 | if action == quitAction0: | |
4069 | self. setInputsProject_View() |
|
4069 | self. setInputsProject_View() | |
4070 | self.create = True |
|
4070 | self.create = True | |
4071 |
|
4071 | |||
4072 | if action == quitAction1: |
|
4072 | if action == quitAction1: | |
4073 | if len(self.__projectObjDict) == 0: |
|
4073 | if len(self.__projectObjDict) == 0: | |
4074 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4074 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4075 | self.console.clear() |
|
4075 | self.console.clear() | |
4076 | self.console.append(outputstr) |
|
4076 | self.console.append(outputstr) | |
4077 | return 0 |
|
4077 | return 0 | |
4078 | else: |
|
4078 | else: | |
4079 | self.addPUWindow() |
|
4079 | self.addPUWindow() | |
4080 | self.console.clear() |
|
4080 | self.console.clear() | |
4081 | self.console.append("Please, Choose the type of Processing Unit") |
|
4081 | self.console.append("Please, Choose the type of Processing Unit") | |
4082 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4082 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4083 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4083 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4084 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4084 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4085 |
|
4085 | |||
4086 | if action == quitAction2: |
|
4086 | if action == quitAction2: | |
4087 | index = self.selectedItemTree |
|
4087 | index = self.selectedItemTree | |
4088 | try: |
|
4088 | try: | |
4089 | index.parent() |
|
4089 | index.parent() | |
4090 | except: |
|
4090 | except: | |
4091 | self.console.append('Please, first at all select a Project or Processing Unit') |
|
4091 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4092 | return 0 |
|
4092 | return 0 | |
4093 | # print index.parent(),index |
|
4093 | # print index.parent(),index | |
4094 | if index.parent() == None: |
|
4094 | if index.parent() == None: | |
4095 | self.projectExplorerModel.removeRow(index.row()) |
|
4095 | self.projectExplorerModel.removeRow(index.row()) | |
4096 | else: |
|
4096 | else: | |
4097 | index.parent().removeRow(index.row()) |
|
4097 | index.parent().removeRow(index.row()) | |
4098 | self.removeItemTreeFromProject() |
|
4098 | self.removeItemTreeFromProject() | |
4099 | self.console.clear() |
|
4099 | self.console.clear() | |
4100 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4100 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4101 | # print i.row() |
|
4101 | # print i.row() | |
4102 |
|
4102 | |||
4103 | if action == quitAction3: |
|
4103 | if action == quitAction3: | |
4104 | self.close() |
|
4104 | self.close() | |
4105 | return 0 |
|
4105 | return 0 | |
4106 |
|
4106 | |||
4107 | def createProjectView(self, id): |
|
4107 | def createProjectView(self, id): | |
4108 |
|
4108 | |||
4109 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4109 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4110 | id = str(id) |
|
4110 | id = str(id) | |
4111 | projectParms = self.__getParmsFromProjectWindow() |
|
4111 | projectParms = self.__getParmsFromProjectWindow() | |
4112 |
|
4112 | |||
4113 | if not projectParms.isValid(): |
|
4113 | if not projectParms.isValid(): | |
4114 | return None |
|
4114 | return None | |
4115 |
|
4115 | |||
4116 | projectObjView = Project() |
|
4116 | projectObjView = Project() | |
4117 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4117 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4118 |
|
4118 | |||
4119 | self.__projectObjDict[id] = projectObjView |
|
4119 | self.__projectObjDict[id] = projectObjView | |
4120 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4120 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4121 |
|
4121 | |||
4122 | return projectObjView |
|
4122 | return projectObjView | |
4123 |
|
4123 | |||
4124 | def updateProjectView(self): |
|
4124 | def updateProjectView(self): | |
4125 |
|
4125 | |||
4126 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4126 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4127 |
|
4127 | |||
4128 | projectParms = self.__getParmsFromProjectWindow() |
|
4128 | projectParms = self.__getParmsFromProjectWindow() | |
4129 |
|
4129 | |||
4130 | if not projectParms.isValid(): |
|
4130 | if not projectParms.isValid(): | |
4131 | return None |
|
4131 | return None | |
4132 |
|
4132 | |||
4133 | projectObjView = self.getSelectedProjectObj() |
|
4133 | projectObjView = self.getSelectedProjectObj() | |
4134 |
|
4134 | |||
4135 | if not projectObjView: |
|
4135 | if not projectObjView: | |
4136 | self.console.append("Please select a project before update it") |
|
4136 | self.console.append("Please select a project before update it") | |
4137 | return None |
|
4137 | return None | |
4138 |
|
4138 | |||
4139 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4139 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4140 |
|
4140 | |||
4141 | return projectObjView |
|
4141 | return projectObjView | |
4142 |
|
4142 | |||
4143 | def createReadUnitView(self, projectObjView, idReadUnit=None): |
|
4143 | def createReadUnitView(self, projectObjView, idReadUnit=None): | |
4144 |
|
4144 | |||
4145 | projectParms = self.__getParmsFromProjectWindow() |
|
4145 | projectParms = self.__getParmsFromProjectWindow() | |
4146 |
|
4146 | |||
4147 | if not projectParms.isValid(): |
|
4147 | if not projectParms.isValid(): | |
4148 | return None |
|
4148 | return None | |
4149 |
|
4149 | |||
4150 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4150 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4151 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4151 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4152 | datatype=projectParms.datatype, |
|
4152 | datatype=projectParms.datatype, | |
4153 | path=projectParms.dpath, |
|
4153 | path=projectParms.dpath, | |
4154 | startDate=projectParms.startDate, |
|
4154 | startDate=projectParms.startDate, | |
4155 | endDate=projectParms.endDate, |
|
4155 | endDate=projectParms.endDate, | |
4156 | startTime=projectParms.startTime, |
|
4156 | startTime=projectParms.startTime, | |
4157 | endTime=projectParms.endTime, |
|
4157 | endTime=projectParms.endTime, | |
4158 | online=projectParms.online, |
|
4158 | online=projectParms.online, | |
4159 | walk=projectParms.walk |
|
4159 | walk=projectParms.walk | |
4160 | ) |
|
4160 | ) | |
4161 |
|
4161 | |||
4162 | if projectParms.set: |
|
4162 | if projectParms.set: | |
4163 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4163 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4164 |
|
4164 | |||
4165 | if projectParms.delay: |
|
4165 | if projectParms.delay: | |
4166 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4166 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4167 |
|
4167 | |||
4168 | if projectParms.expLabel: |
|
4168 | if projectParms.expLabel: | |
4169 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4169 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4170 |
|
4170 | |||
4171 | readUnitConfObj.addOperation(name="printInfo") |
|
4171 | readUnitConfObj.addOperation(name="printInfo") | |
4172 |
|
4172 | |||
4173 | if projectParms.datatype == "USRP": |
|
4173 | if projectParms.datatype == "USRP": | |
4174 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4174 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4175 | datatype=projectParms.datatype, |
|
4175 | datatype=projectParms.datatype, | |
4176 | path=projectParms.dpath, |
|
4176 | path=projectParms.dpath, | |
4177 | startDate=projectParms.startDate, |
|
4177 | startDate=projectParms.startDate, | |
4178 | endDate=projectParms.endDate, |
|
4178 | endDate=projectParms.endDate, | |
4179 | startTime=projectParms.startTime, |
|
4179 | startTime=projectParms.startTime, | |
4180 | endTime=projectParms.endTime, |
|
4180 | endTime=projectParms.endTime, | |
4181 | online=projectParms.online, |
|
4181 | online=projectParms.online, | |
4182 | ippKm=projectParms.ippKm |
|
4182 | ippKm=projectParms.ippKm | |
4183 | ) |
|
4183 | ) | |
4184 |
|
4184 | |||
4185 | if projectParms.delay: |
|
4185 | if projectParms.delay: | |
4186 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4186 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4187 |
|
4187 | |||
4188 | return readUnitConfObj |
|
4188 | return readUnitConfObj | |
4189 |
|
4189 | |||
4190 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4190 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4191 |
|
4191 | |||
4192 | projectObjView.removeProcUnit(idReadUnit) |
|
4192 | projectObjView.removeProcUnit(idReadUnit) | |
4193 |
|
4193 | |||
4194 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) |
|
4194 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) | |
4195 |
|
4195 | |||
4196 | return readUnitConfObj |
|
4196 | return readUnitConfObj | |
4197 |
|
4197 | |||
4198 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4198 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4199 |
|
4199 | |||
4200 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4200 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4201 |
|
4201 | |||
4202 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4202 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4203 |
|
4203 | |||
4204 | return procUnitConfObj |
|
4204 | return procUnitConfObj | |
4205 |
|
4205 | |||
4206 | def updateProcUnitView(self, id): |
|
4206 | def updateProcUnitView(self, id): | |
4207 |
|
4207 | |||
4208 | pass |
|
4208 | pass | |
4209 |
|
4209 | |||
4210 | def addPUWindow(self): |
|
4210 | def addPUWindow(self): | |
4211 |
|
4211 | |||
4212 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4212 | self.configUPWindowObj = UnitProcessWindow(self) | |
4213 | fatherObj = self.getSelectedItemObj() |
|
4213 | fatherObj = self.getSelectedItemObj() | |
4214 | try: |
|
4214 | try: | |
4215 | fatherObj.getElementName() |
|
4215 | fatherObj.getElementName() | |
4216 | except: |
|
4216 | except: | |
4217 | self.console.append("First left click on Project or Processing Unit") |
|
4217 | self.console.append("First left click on Project or Processing Unit") | |
4218 | return 0 |
|
4218 | return 0 | |
4219 |
|
4219 | |||
4220 | if fatherObj.getElementName() == 'Project': |
|
4220 | if fatherObj.getElementName() == 'Project': | |
4221 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4221 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4222 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4222 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4223 |
|
4223 | |||
4224 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4224 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4225 | self.configUPWindowObj.loadTotalList() |
|
4225 | self.configUPWindowObj.loadTotalList() | |
4226 | self.configUPWindowObj.show() |
|
4226 | self.configUPWindowObj.show() | |
4227 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4227 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4228 |
|
4228 | |||
4229 | def createPUWindow(self): |
|
4229 | def createPUWindow(self): | |
4230 |
|
4230 | |||
4231 | if not self.configUPWindowObj.create: |
|
4231 | if not self.configUPWindowObj.create: | |
4232 | return |
|
4232 | return | |
4233 |
|
4233 | |||
4234 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4234 | fatherObj = self.configUPWindowObj.getFromWindow | |
4235 | datatype = self.configUPWindowObj.typeofUP |
|
4235 | datatype = self.configUPWindowObj.typeofUP | |
4236 |
|
4236 | |||
4237 | if fatherObj.getElementName() == 'Project': |
|
4237 | if fatherObj.getElementName() == 'Project': | |
4238 | inputId = fatherObj.getReadUnitId() |
|
4238 | inputId = fatherObj.getReadUnitId() | |
4239 | projectObjView = fatherObj |
|
4239 | projectObjView = fatherObj | |
4240 | else: |
|
4240 | else: | |
4241 | inputId = fatherObj.getId() |
|
4241 | inputId = fatherObj.getId() | |
4242 | projectObjView = self.getSelectedProjectObj() |
|
4242 | projectObjView = self.getSelectedProjectObj() | |
4243 |
|
4243 | |||
4244 | if not projectObjView: |
|
4244 | if not projectObjView: | |
4245 | return |
|
4245 | return | |
4246 |
|
4246 | |||
4247 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4247 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4248 |
|
4248 | |||
4249 | self.addPU2ProjectExplorer(puObj) |
|
4249 | self.addPU2ProjectExplorer(puObj) | |
4250 |
|
4250 | |||
4251 | self.showtabPUCreated(datatype) |
|
4251 | self.showtabPUCreated(datatype) | |
4252 |
|
4252 | |||
4253 | self.clearPUWindow(datatype) |
|
4253 | self.clearPUWindow(datatype) | |
4254 |
|
4254 | |||
4255 | self.showPUinitView() |
|
4255 | self.showPUinitView() | |
4256 |
|
4256 | |||
4257 | def addFTPConf2Operation(self, puObj, opObj): |
|
4257 | def addFTPConf2Operation(self, puObj, opObj): | |
4258 |
|
4258 | |||
4259 | if not self.temporalFTP.create: |
|
4259 | if not self.temporalFTP.create: | |
4260 | self.temporalFTP.setwithoutconfiguration() |
|
4260 | self.temporalFTP.setwithoutconfiguration() | |
4261 |
|
4261 | |||
4262 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4262 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4263 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4263 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4264 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4264 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4265 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4265 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4266 |
|
4266 | |||
4267 | if self.temporalFTP.ftp_wei: |
|
4267 | if self.temporalFTP.ftp_wei: | |
4268 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4268 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4269 | if self.temporalFTP.exp_code: |
|
4269 | if self.temporalFTP.exp_code: | |
4270 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4270 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4271 | if self.temporalFTP.sub_exp_code: |
|
4271 | if self.temporalFTP.sub_exp_code: | |
4272 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4272 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4273 | if self.temporalFTP.plot_pos: |
|
4273 | if self.temporalFTP.plot_pos: | |
4274 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4274 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4275 |
|
4275 | |||
4276 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4276 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4277 | # |
|
4277 | # | |
4278 | # puId = None |
|
4278 | # puId = None | |
4279 | # puObj = None |
|
4279 | # puObj = None | |
4280 | # |
|
4280 | # | |
4281 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4281 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4282 | # |
|
4282 | # | |
4283 | # if not thisPuObj.name == "SendToServer": |
|
4283 | # if not thisPuObj.name == "SendToServer": | |
4284 | # continue |
|
4284 | # continue | |
4285 | # |
|
4285 | # | |
4286 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4286 | # opObj = thisPuObj.getOperationObj(name='run') | |
4287 | # |
|
4287 | # | |
4288 | # parmObj = opObj.getParameterObj('localfolder') |
|
4288 | # parmObj = opObj.getParameterObj('localfolder') | |
4289 | # |
|
4289 | # | |
4290 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4290 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4291 | # if not parmObj: |
|
4291 | # if not parmObj: | |
4292 | # projectObj.removeProcUnit(thisPuId) |
|
4292 | # projectObj.removeProcUnit(thisPuId) | |
4293 | # continue |
|
4293 | # continue | |
4294 | # |
|
4294 | # | |
4295 | # thisLocalfolder = parmObj.getValue() |
|
4295 | # thisLocalfolder = parmObj.getValue() | |
4296 | # |
|
4296 | # | |
4297 | # if localfolder != thisLocalfolder: |
|
4297 | # if localfolder != thisLocalfolder: | |
4298 | # continue |
|
4298 | # continue | |
4299 | # |
|
4299 | # | |
4300 | # puId = thisPuId |
|
4300 | # puId = thisPuId | |
4301 | # puObj = thisPuObj |
|
4301 | # puObj = thisPuObj | |
4302 | # break |
|
4302 | # break | |
4303 | # |
|
4303 | # | |
4304 | # return puObj |
|
4304 | # return puObj | |
4305 |
|
4305 | |||
4306 | def createFTPProcUnitView(self): |
|
4306 | def createFTPProcUnitView(self): | |
4307 |
|
4307 | |||
4308 | if not self.temporalFTP.create: |
|
4308 | if not self.temporalFTP.create: | |
4309 | self.temporalFTP.setwithoutconfiguration() |
|
4309 | self.temporalFTP.setwithoutconfiguration() | |
4310 |
|
4310 | |||
4311 | projectObj = self.getSelectedProjectObj() |
|
4311 | projectObj = self.getSelectedProjectObj() | |
4312 |
|
4312 | |||
4313 | if not projectObj: |
|
4313 | if not projectObj: | |
4314 | return |
|
4314 | return | |
4315 |
|
4315 | |||
4316 | self.removeAllFTPProcUnitView(projectObj) |
|
4316 | self.removeAllFTPProcUnitView(projectObj) | |
4317 |
|
4317 | |||
4318 | if not self.__puLocalFolder2FTP: |
|
4318 | if not self.__puLocalFolder2FTP: | |
4319 | return |
|
4319 | return | |
4320 |
|
4320 | |||
4321 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4321 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4322 |
|
4322 | |||
4323 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4323 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4324 |
|
4324 | |||
4325 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4325 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4326 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4326 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4327 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4327 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4328 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4328 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4329 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4329 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4330 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4330 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4331 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4331 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4332 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4332 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4333 |
|
4333 | |||
4334 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4334 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4335 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4335 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4336 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4336 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4337 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4337 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4338 |
|
4338 | |||
4339 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4339 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4340 |
|
4340 | |||
4341 | def removeAllFTPProcUnitView(self, projectObj): |
|
4341 | def removeAllFTPProcUnitView(self, projectObj): | |
4342 |
|
4342 | |||
4343 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4343 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4344 |
|
4344 | |||
4345 | if not thisPuObj.name == "SendToServer": |
|
4345 | if not thisPuObj.name == "SendToServer": | |
4346 | continue |
|
4346 | continue | |
4347 |
|
4347 | |||
4348 | projectObj.removeProcUnit(thisPuId) |
|
4348 | projectObj.removeProcUnit(thisPuId) | |
4349 |
|
4349 | |||
4350 | if thisPuId not in self.__puObjDict.keys(): |
|
4350 | if thisPuId not in self.__puObjDict.keys(): | |
4351 | continue |
|
4351 | continue | |
4352 |
|
4352 | |||
4353 | self.__puObjDict.pop(thisPuId) |
|
4353 | self.__puObjDict.pop(thisPuId) | |
4354 |
|
4354 | |||
4355 | def showPUinitView(self): |
|
4355 | def showPUinitView(self): | |
4356 |
|
4356 | |||
4357 | self.propertiesModel = TreeModel() |
|
4357 | self.propertiesModel = TreeModel() | |
4358 | self.propertiesModel.initPUVoltageView() |
|
4358 | self.propertiesModel.initPUVoltageView() | |
4359 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4359 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4360 | self.treeProjectProperties.expandAll() |
|
4360 | self.treeProjectProperties.expandAll() | |
4361 | self.treeProjectProperties.allColumnsShowFocus() |
|
4361 | self.treeProjectProperties.allColumnsShowFocus() | |
4362 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4362 | self.treeProjectProperties.resizeColumnToContents(1) | |
4363 |
|
4363 | |||
4364 | def saveFTPFromOpObj(self, operationObj): |
|
4364 | def saveFTPFromOpObj(self, operationObj): | |
4365 |
|
4365 | |||
4366 | if operationObj.name != "SendByFTP": |
|
4366 | if operationObj.name != "SendByFTP": | |
4367 | return |
|
4367 | return | |
4368 |
|
4368 | |||
4369 | server = operationObj.getParameterValue("server") |
|
4369 | server = operationObj.getParameterValue("server") | |
4370 | username = operationObj.getParameterValue("username") |
|
4370 | username = operationObj.getParameterValue("username") | |
4371 | password = operationObj.getParameterValue("password") |
|
4371 | password = operationObj.getParameterValue("password") | |
4372 | localfolder = operationObj.getParameterValue("localfolder") |
|
4372 | localfolder = operationObj.getParameterValue("localfolder") | |
4373 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4373 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4374 | ext = operationObj.getParameterValue("ext") |
|
4374 | ext = operationObj.getParameterValue("ext") | |
4375 | period = operationObj.getParameterValue("period") |
|
4375 | period = operationObj.getParameterValue("period") | |
4376 |
|
4376 | |||
4377 | self.temporalFTP.save(server=server, |
|
4377 | self.temporalFTP.save(server=server, | |
4378 | remotefolder=remotefolder, |
|
4378 | remotefolder=remotefolder, | |
4379 | username=username, |
|
4379 | username=username, | |
4380 | password=password, |
|
4380 | password=password, | |
4381 | localfolder=localfolder, |
|
4381 | localfolder=localfolder, | |
4382 | extension=ext) |
|
4382 | extension=ext) | |
4383 |
|
4383 | |||
4384 | return |
|
4384 | return | |
4385 |
|
4385 | |||
4386 | def saveFTPFromProcUnitObj(self, puObj): |
|
4386 | def saveFTPFromProcUnitObj(self, puObj): | |
4387 |
|
4387 | |||
4388 | opObj = puObj.getOperationObj(name="run") |
|
4388 | opObj = puObj.getOperationObj(name="run") | |
4389 |
|
4389 | |||
4390 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4390 | parmObj = opObj.getParameterObj(parameterName="server") | |
4391 | if parmObj == None: |
|
4391 | if parmObj == None: | |
4392 | server = 'jro-app.igp.gob.pe' |
|
4392 | server = 'jro-app.igp.gob.pe' | |
4393 | else: |
|
4393 | else: | |
4394 | server = parmObj.getValue() |
|
4394 | server = parmObj.getValue() | |
4395 |
|
4395 | |||
4396 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4396 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4397 | if parmObj == None: |
|
4397 | if parmObj == None: | |
4398 | remotefolder = '/home/wmaster/graficos' |
|
4398 | remotefolder = '/home/wmaster/graficos' | |
4399 | else: |
|
4399 | else: | |
4400 | remotefolder = parmObj.getValue() |
|
4400 | remotefolder = parmObj.getValue() | |
4401 |
|
4401 | |||
4402 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4402 | parmObj = opObj.getParameterObj(parameterName="username") | |
4403 | if parmObj == None: |
|
4403 | if parmObj == None: | |
4404 | username = 'wmaster' |
|
4404 | username = 'wmaster' | |
4405 | else: |
|
4405 | else: | |
4406 | username = parmObj.getValue() |
|
4406 | username = parmObj.getValue() | |
4407 |
|
4407 | |||
4408 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4408 | parmObj = opObj.getParameterObj(parameterName="password") | |
4409 | if parmObj == None: |
|
4409 | if parmObj == None: | |
4410 | password = 'mst2010vhf' |
|
4410 | password = 'mst2010vhf' | |
4411 | else: |
|
4411 | else: | |
4412 | password = parmObj.getValue() |
|
4412 | password = parmObj.getValue() | |
4413 |
|
4413 | |||
4414 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4414 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4415 | if parmObj == None: |
|
4415 | if parmObj == None: | |
4416 | ftp_wei = 0 |
|
4416 | ftp_wei = 0 | |
4417 | else: |
|
4417 | else: | |
4418 | ftp_wei = parmObj.getValue() |
|
4418 | ftp_wei = parmObj.getValue() | |
4419 |
|
4419 | |||
4420 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4420 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4421 | if parmObj == None: |
|
4421 | if parmObj == None: | |
4422 | exp_code = 0 |
|
4422 | exp_code = 0 | |
4423 | else: |
|
4423 | else: | |
4424 | exp_code = parmObj.getValue() |
|
4424 | exp_code = parmObj.getValue() | |
4425 |
|
4425 | |||
4426 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4426 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4427 | if parmObj == None: |
|
4427 | if parmObj == None: | |
4428 | sub_exp_code = 0 |
|
4428 | sub_exp_code = 0 | |
4429 | else: |
|
4429 | else: | |
4430 | sub_exp_code = parmObj.getValue() |
|
4430 | sub_exp_code = parmObj.getValue() | |
4431 |
|
4431 | |||
4432 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4432 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4433 | if parmObj == None: |
|
4433 | if parmObj == None: | |
4434 | plot_pos = 0 |
|
4434 | plot_pos = 0 | |
4435 | else: |
|
4435 | else: | |
4436 | plot_pos = parmObj.getValue() |
|
4436 | plot_pos = parmObj.getValue() | |
4437 |
|
4437 | |||
4438 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4438 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4439 | if parmObj == None: |
|
4439 | if parmObj == None: | |
4440 | localfolder = None |
|
4440 | localfolder = None | |
4441 | else: |
|
4441 | else: | |
4442 | localfolder = parmObj.getValue() |
|
4442 | localfolder = parmObj.getValue() | |
4443 |
|
4443 | |||
4444 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4444 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4445 | if parmObj == None: |
|
4445 | if parmObj == None: | |
4446 | extension = '.png' |
|
4446 | extension = '.png' | |
4447 | else: |
|
4447 | else: | |
4448 | extension = parmObj.getValue() |
|
4448 | extension = parmObj.getValue() | |
4449 |
|
4449 | |||
4450 | self.temporalFTP.save(server=server, |
|
4450 | self.temporalFTP.save(server=server, | |
4451 | remotefolder=remotefolder, |
|
4451 | remotefolder=remotefolder, | |
4452 | username=username, |
|
4452 | username=username, | |
4453 | password=password, |
|
4453 | password=password, | |
4454 | ftp_wei=ftp_wei, |
|
4454 | ftp_wei=ftp_wei, | |
4455 | exp_code=exp_code, |
|
4455 | exp_code=exp_code, | |
4456 | sub_exp_code=sub_exp_code, |
|
4456 | sub_exp_code=sub_exp_code, | |
4457 | plot_pos=plot_pos, |
|
4457 | plot_pos=plot_pos, | |
4458 | localfolder=localfolder, |
|
4458 | localfolder=localfolder, | |
4459 | extension=extension) |
|
4459 | extension=extension) | |
4460 |
|
4460 | |||
4461 | def addProject2ProjectExplorer(self, id, name): |
|
4461 | def addProject2ProjectExplorer(self, id, name): | |
4462 |
|
4462 | |||
4463 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4463 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4464 |
|
4464 | |||
4465 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4465 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4466 | parentItem.appendRow(itemTree) |
|
4466 | parentItem.appendRow(itemTree) | |
4467 |
|
4467 | |||
4468 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4468 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4469 |
|
4469 | |||
4470 | self.selectedItemTree = itemTree |
|
4470 | self.selectedItemTree = itemTree | |
4471 |
|
4471 | |||
4472 | self.__itemTreeDict[id] = itemTree |
|
4472 | self.__itemTreeDict[id] = itemTree | |
4473 |
|
4473 | |||
4474 | def addPU2ProjectExplorer(self, puObj): |
|
4474 | def addPU2ProjectExplorer(self, puObj): | |
4475 |
|
4475 | |||
4476 | id, name = puObj.id, puObj.datatype |
|
4476 | id, name = puObj.id, puObj.datatype | |
4477 |
|
4477 | |||
4478 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4478 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4479 |
|
4479 | |||
4480 | parentItem = self.selectedItemTree |
|
4480 | parentItem = self.selectedItemTree | |
4481 | parentItem.appendRow(itemTree) |
|
4481 | parentItem.appendRow(itemTree) | |
4482 | self.projectExplorerTree.expandAll() |
|
4482 | self.projectExplorerTree.expandAll() | |
4483 |
|
4483 | |||
4484 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4484 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4485 |
|
4485 | |||
4486 | self.selectedItemTree = itemTree |
|
4486 | self.selectedItemTree = itemTree | |
4487 |
|
4487 | |||
4488 | self.__itemTreeDict[id] = itemTree |
|
4488 | self.__itemTreeDict[id] = itemTree | |
4489 |
|
4489 | |||
4490 | def addPU2PELoadXML(self, puObj): |
|
4490 | def addPU2PELoadXML(self, puObj): | |
4491 |
|
4491 | |||
4492 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4492 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4493 |
|
4493 | |||
4494 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4494 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4495 |
|
4495 | |||
4496 | if self.__itemTreeDict.has_key(inputId): |
|
4496 | if self.__itemTreeDict.has_key(inputId): | |
4497 | parentItem = self.__itemTreeDict[inputId] |
|
4497 | parentItem = self.__itemTreeDict[inputId] | |
4498 | else: |
|
4498 | else: | |
4499 | #If parent is a Reader object |
|
4499 | #If parent is a Reader object | |
4500 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4500 | parentItem = self.__itemTreeDict[id[:-1]] | |
4501 |
|
4501 | |||
4502 | parentItem.appendRow(itemTree) |
|
4502 | parentItem.appendRow(itemTree) | |
4503 | self.projectExplorerTree.expandAll() |
|
4503 | self.projectExplorerTree.expandAll() | |
4504 | parentItem = itemTree |
|
4504 | parentItem = itemTree | |
4505 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4505 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4506 |
|
4506 | |||
4507 | self.__itemTreeDict[id] = itemTree |
|
4507 | self.__itemTreeDict[id] = itemTree | |
4508 | self.selectedItemTree = itemTree |
|
4508 | self.selectedItemTree = itemTree | |
4509 |
|
4509 | |||
4510 | def getSelectedProjectObj(self): |
|
4510 | def getSelectedProjectObj(self): | |
4511 | """ |
|
4511 | """ | |
4512 | Return the current project object selected. If a processing unit is |
|
4512 | Return the current project object selected. If a processing unit is | |
4513 | actually selected this function returns associated project. |
|
4513 | actually selected this function returns associated project. | |
4514 |
|
4514 | |||
4515 | None if any project or processing unit is selected |
|
4515 | None if any project or processing unit is selected | |
4516 | """ |
|
4516 | """ | |
4517 | for key in self.__itemTreeDict.keys(): |
|
4517 | for key in self.__itemTreeDict.keys(): | |
4518 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4518 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4519 | continue |
|
4519 | continue | |
4520 |
|
4520 | |||
4521 | if self.__projectObjDict.has_key(key): |
|
4521 | if self.__projectObjDict.has_key(key): | |
4522 | projectObj = self.__projectObjDict[key] |
|
4522 | projectObj = self.__projectObjDict[key] | |
4523 | return projectObj |
|
4523 | return projectObj | |
4524 |
|
4524 | |||
4525 | puObj = self.__puObjDict[key] |
|
4525 | puObj = self.__puObjDict[key] | |
4526 |
|
4526 | |||
4527 | if puObj.parentId == None: |
|
4527 | if puObj.parentId == None: | |
4528 | projectId = puObj.getId()[0] |
|
4528 | projectId = puObj.getId()[0] | |
4529 | else: |
|
4529 | else: | |
4530 | projectId = puObj.parentId |
|
4530 | projectId = puObj.parentId | |
4531 |
|
4531 | |||
4532 | projectObj = self.__projectObjDict[projectId] |
|
4532 | projectObj = self.__projectObjDict[projectId] | |
4533 | return projectObj |
|
4533 | return projectObj | |
4534 |
|
4534 | |||
4535 | return None |
|
4535 | return None | |
4536 |
|
4536 | |||
4537 | def getSelectedItemObj(self): |
|
4537 | def getSelectedItemObj(self): | |
4538 | """ |
|
4538 | """ | |
4539 | Return the current project or processing unit object selected |
|
4539 | Return the current project or processing unit object selected | |
4540 |
|
4540 | |||
4541 | None if any project or processing unit is selected |
|
4541 | None if any project or processing unit is selected | |
4542 | """ |
|
4542 | """ | |
4543 | for key in self.__itemTreeDict.keys(): |
|
4543 | for key in self.__itemTreeDict.keys(): | |
4544 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4544 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4545 | continue |
|
4545 | continue | |
4546 |
|
4546 | |||
4547 | if self.__projectObjDict.has_key(key) == True: |
|
4547 | if self.__projectObjDict.has_key(key) == True: | |
4548 | fatherObj = self.__projectObjDict[key] |
|
4548 | fatherObj = self.__projectObjDict[key] | |
4549 | else: |
|
4549 | else: | |
4550 | fatherObj = self.__puObjDict[key] |
|
4550 | fatherObj = self.__puObjDict[key] | |
4551 |
|
4551 | |||
4552 | return fatherObj |
|
4552 | return fatherObj | |
4553 |
|
4553 | |||
4554 | return None |
|
4554 | return None | |
4555 |
|
4555 | |||
4556 | def _WarningWindow(self, text, information): |
|
4556 | def _WarningWindow(self, text, information): | |
4557 |
|
4557 | |||
4558 | msgBox = QtGui.QMessageBox() |
|
4558 | msgBox = QtGui.QMessageBox() | |
4559 | msgBox.setText(text) |
|
4559 | msgBox.setText(text) | |
4560 | msgBox.setInformativeText(information) |
|
4560 | msgBox.setInformativeText(information) | |
4561 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4561 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4562 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4562 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4563 | ret = msgBox.exec_() |
|
4563 | ret = msgBox.exec_() | |
4564 |
|
4564 | |||
4565 | answer = False |
|
4565 | answer = False | |
4566 |
|
4566 | |||
4567 | if ret == QtGui.QMessageBox.Ok: |
|
4567 | if ret == QtGui.QMessageBox.Ok: | |
4568 | answer = True |
|
4568 | answer = True | |
4569 |
|
4569 | |||
4570 | return answer |
|
4570 | return answer | |
4571 |
|
4571 | |||
4572 | def __getNewProjectId(self): |
|
4572 | def __getNewProjectId(self): | |
4573 |
|
4573 | |||
4574 | loadProject = False |
|
4574 | loadProject = False | |
4575 |
|
4575 | |||
4576 | for thisId in range(1,10): |
|
4576 | for thisId in range(1,10): | |
4577 | newId = str(thisId) |
|
4577 | newId = str(thisId) | |
4578 | if newId in self.__projectObjDict.keys(): |
|
4578 | if newId in self.__projectObjDict.keys(): | |
4579 | continue |
|
4579 | continue | |
4580 |
|
4580 | |||
4581 | loadProject = True |
|
4581 | loadProject = True | |
4582 | projectId = newId |
|
4582 | projectId = newId | |
4583 | break |
|
4583 | break | |
4584 |
|
4584 | |||
4585 | if not loadProject: |
|
4585 | if not loadProject: | |
4586 | self.console.clear() |
|
4586 | self.console.clear() | |
4587 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4587 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4588 | return None |
|
4588 | return None | |
4589 |
|
4589 | |||
4590 | return projectId |
|
4590 | return projectId | |
4591 |
|
4591 | |||
4592 | def openProject(self): |
|
4592 | def openProject(self): | |
4593 |
|
4593 | |||
4594 | self._disable_save_button() |
|
4594 | self._disable_save_button() | |
4595 | self._disable_play_button() |
|
4595 | self._disable_play_button() | |
4596 |
|
4596 | |||
4597 | self.frame_2.setEnabled(True) |
|
4597 | self.frame_2.setEnabled(True) | |
4598 |
|
4598 | |||
4599 | # print self.dir |
|
4599 | # print self.dir | |
4600 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4600 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4601 |
|
4601 | |||
4602 | projectObjLoad = Project() |
|
4602 | projectObjLoad = Project() | |
4603 |
|
4603 | |||
4604 | try: |
|
4604 | try: | |
4605 | projectObjLoad.readXml(filename) |
|
4605 | projectObjLoad.readXml(filename) | |
4606 | except: |
|
4606 | except: | |
4607 | self.console.clear() |
|
4607 | self.console.clear() | |
4608 | self.console.append("The selected xml file could not be loaded ...") |
|
4608 | self.console.append("The selected xml file could not be loaded ...") | |
4609 | return 0 |
|
4609 | return 0 | |
4610 |
|
4610 | |||
4611 | self.create = False |
|
4611 | self.create = False | |
4612 | self.refreshProjectWindow(projectObjLoad) |
|
4612 | self.refreshProjectWindow(projectObjLoad) | |
4613 | self.refreshProjectProperties(projectObjLoad) |
|
4613 | self.refreshProjectProperties(projectObjLoad) | |
4614 |
|
4614 | |||
4615 | projectId = projectObjLoad.id |
|
4615 | projectId = projectObjLoad.id | |
4616 |
|
4616 | |||
4617 | if projectId in self.__projectObjDict.keys(): |
|
4617 | if projectId in self.__projectObjDict.keys(): | |
4618 |
|
4618 | |||
4619 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4619 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4620 | # "Do you want to load the file anyway?") |
|
4620 | # "Do you want to load the file anyway?") | |
4621 | # if not answer: |
|
4621 | # if not answer: | |
4622 | # return |
|
4622 | # return | |
4623 |
|
4623 | |||
4624 | projectId = self.__getNewProjectId() |
|
4624 | projectId = self.__getNewProjectId() | |
4625 |
|
4625 | |||
4626 | if not projectId: |
|
4626 | if not projectId: | |
4627 | return |
|
4627 | return | |
4628 |
|
4628 | |||
4629 | projectObjLoad.updateId(projectId) |
|
4629 | projectObjLoad.updateId(projectId) | |
4630 |
|
4630 | |||
4631 | self.__projectObjDict[projectId] = projectObjLoad |
|
4631 | self.__projectObjDict[projectId] = projectObjLoad | |
4632 |
|
4632 | |||
4633 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4633 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4634 |
|
4634 | |||
4635 | self.tabWidgetProject.setEnabled(True) |
|
4635 | self.tabWidgetProject.setEnabled(True) | |
4636 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4636 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4637 | # Disable tabProject after finish the creation |
|
4637 | # Disable tabProject after finish the creation | |
4638 | self.tabProject.setEnabled(True) |
|
4638 | self.tabProject.setEnabled(True) | |
4639 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4639 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4640 |
|
4640 | |||
4641 | for puId, puObj in puObjorderList.items(): |
|
4641 | for puId, puObj in puObjorderList.items(): | |
4642 |
|
4642 | |||
4643 | self.__puObjDict[puId] = puObj |
|
4643 | self.__puObjDict[puId] = puObj | |
4644 |
|
4644 | |||
4645 | if puObj.name == "SendToServer": |
|
4645 | if puObj.name == "SendToServer": | |
4646 | self.saveFTPFromProcUnitObj(puObj) |
|
4646 | self.saveFTPFromProcUnitObj(puObj) | |
4647 |
|
4647 | |||
4648 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4648 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4649 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4649 | operationObj = puObj.getOperationObj("SendByFTP") | |
4650 |
|
4650 | |||
4651 | if operationObj: |
|
4651 | if operationObj: | |
4652 | self.saveFTPFromOpObj(operationObj) |
|
4652 | self.saveFTPFromOpObj(operationObj) | |
4653 | ############################################################ |
|
4653 | ############################################################ | |
4654 |
|
4654 | |||
4655 | if puObj.inputId == '0': |
|
4655 | if puObj.inputId == '0': | |
4656 | continue |
|
4656 | continue | |
4657 |
|
4657 | |||
4658 | self.addPU2PELoadXML(puObj) |
|
4658 | self.addPU2PELoadXML(puObj) | |
4659 |
|
4659 | |||
4660 | self.refreshPUWindow(puObj) |
|
4660 | self.refreshPUWindow(puObj) | |
4661 | self.refreshPUProperties(puObj) |
|
4661 | self.refreshPUProperties(puObj) | |
4662 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4662 | self.showtabPUCreated(datatype=puObj.datatype) | |
4663 |
|
4663 | |||
4664 | self.console.clear() |
|
4664 | self.console.clear() | |
4665 | self.console.append("The selected xml file has been loaded successfully") |
|
4665 | self.console.append("The selected xml file has been loaded successfully") | |
4666 |
|
4666 | |||
4667 | self._disable_save_button() |
|
4667 | self._disable_save_button() | |
4668 | self._enable_play_button() |
|
4668 | self._enable_play_button() | |
4669 |
|
4669 | |||
4670 | def create_updating_timer(self): |
|
4670 | def create_updating_timer(self): | |
4671 |
|
4671 | |||
4672 | self.comm_data_timer = QtCore.QTimer(self) |
|
4672 | self.comm_data_timer = QtCore.QTimer(self) | |
4673 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4673 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4674 | self.comm_data_timer.start(1000) |
|
4674 | self.comm_data_timer.start(1000) | |
4675 |
|
4675 | |||
4676 | def on_comm_updating_timer(self): |
|
4676 | def on_comm_updating_timer(self): | |
4677 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4677 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4678 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4678 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4679 | if not self.threadStarted: |
|
4679 | if not self.threadStarted: | |
4680 | return |
|
4680 | return | |
4681 |
|
4681 | |||
4682 | if self.controllerThread.isFinished(): |
|
4682 | if self.controllerThread.isFinished(): | |
4683 | self.stopProject() |
|
4683 | self.stopProject() | |
4684 | return |
|
4684 | return | |
4685 |
|
4685 | |||
4686 | def use_plotmanager(self, controllerThread): |
|
4686 | def use_plotmanager(self, controllerThread): | |
4687 |
|
4687 | |||
4688 | plotter_queue = Queue(10) |
|
4688 | plotter_queue = Queue(10) | |
4689 | controllerThread.setPlotterQueue(plotter_queue) |
|
4689 | controllerThread.setPlotterQueue(plotter_queue) | |
4690 | controllerThread.useExternalPlotManager() |
|
4690 | controllerThread.useExternalPlotManager() | |
4691 |
|
4691 | |||
4692 | self.plotManager = PlotManager(plotter_queue) |
|
4692 | self.plotManager = PlotManager(plotter_queue) | |
4693 |
|
4693 | |||
4694 | self.plot_timer = QtCore.QTimer() |
|
4694 | self.plot_timer = QtCore.QTimer() | |
4695 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) |
|
4695 | self.plot_timer.timeout.connect(self.on_plotmanager_timer) | |
4696 | self.plot_timer.start(10) |
|
4696 | self.plot_timer.start(10) | |
4697 |
|
4697 | |||
4698 | def on_plotmanager_timer(self): |
|
4698 | def on_plotmanager_timer(self): | |
4699 |
|
4699 | |||
4700 | if not self.plotManager: |
|
4700 | if not self.plotManager: | |
4701 | return |
|
4701 | return | |
4702 |
|
4702 | |||
4703 | self.plotManager.run() |
|
4703 | self.plotManager.run() | |
4704 |
|
4704 | |||
4705 | def playProject(self, ext=".xml", save=1): |
|
4705 | def playProject(self, ext=".xml", save=1): | |
4706 |
|
4706 | |||
4707 | self._disable_play_button() |
|
4707 | self._disable_play_button() | |
4708 | self._disable_save_button() |
|
4708 | self._disable_save_button() | |
4709 |
|
4709 | |||
4710 | if self.controllerThread: |
|
4710 | if self.controllerThread: | |
4711 | if self.controllerThread.isRunning(): |
|
4711 | if self.controllerThread.isRunning(): | |
4712 | self.console.append("There is already another process running") |
|
4712 | self.console.append("There is already another process running") | |
4713 | self._enable_stop_button() |
|
4713 | self._enable_stop_button() | |
4714 | return |
|
4714 | return | |
4715 |
|
4715 | |||
4716 | projectObj = self.getSelectedProjectObj() |
|
4716 | projectObj = self.getSelectedProjectObj() | |
4717 |
|
4717 | |||
4718 | if not projectObj: |
|
4718 | if not projectObj: | |
4719 | self.console.append("Please, select a project to start it") |
|
4719 | self.console.append("Please, select a project to start it") | |
4720 | return |
|
4720 | return | |
4721 |
|
4721 | |||
4722 | if save: |
|
4722 | if save: | |
4723 | filename = self.saveProject() |
|
4723 | filename = self.saveProject() | |
4724 | if filename == None: |
|
4724 | if filename == None: | |
4725 | self.console.append("Process not initialized.") |
|
4725 | self.console.append("Process not initialized.") | |
4726 | return |
|
4726 | return | |
4727 | else: |
|
4727 | else: | |
4728 | filename = TEMPORAL_FILE |
|
4728 | filename = TEMPORAL_FILE | |
4729 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4729 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4730 |
|
4730 | |||
4731 | self.console.clear() |
|
4731 | self.console.clear() | |
4732 | self.console.append("Please wait...") |
|
4732 | self.console.append("Please wait...") | |
4733 |
|
4733 | |||
4734 | self.controllerThread = ControllerThread() |
|
4734 | self.controllerThread = ControllerThread() | |
4735 | self.controllerThread.readXml(filename) |
|
4735 | self.controllerThread.readXml(filename) | |
4736 |
|
4736 | |||
4737 | self.use_plotmanager(self.controllerThread) |
|
4737 | self.use_plotmanager(self.controllerThread) | |
4738 |
|
4738 | |||
4739 | self.controllerThread.start() |
|
4739 | self.controllerThread.start() | |
4740 |
|
4740 | |||
4741 | sleep(0.5) |
|
4741 | sleep(0.5) | |
4742 |
|
4742 | |||
4743 | self.threadStarted = True |
|
4743 | self.threadStarted = True | |
4744 |
|
4744 | |||
4745 | self._disable_play_button() |
|
4745 | self._disable_play_button() | |
4746 | self._disable_save_button() |
|
4746 | self._disable_save_button() | |
4747 | self._enable_stop_button() |
|
4747 | self._enable_stop_button() | |
4748 |
|
4748 | |||
4749 | def stopProject(self): |
|
4749 | def stopProject(self): | |
4750 |
|
4750 | |||
4751 | self.threadStarted = False |
|
4751 | self.threadStarted = False | |
4752 | self.controllerThread.stop() |
|
4752 | self.controllerThread.stop() | |
4753 |
|
4753 | |||
4754 | while not self.plotManager.isEmpty(): |
|
4754 | while not self.plotManager.isEmpty(): | |
4755 | self.plotManager.run() |
|
4755 | self.plotManager.run() | |
4756 |
|
4756 | |||
4757 | self.plotManager.close() |
|
4757 | self.plotManager.close() | |
4758 | self.plotManager = None |
|
4758 | self.plotManager = None | |
4759 |
|
4759 | |||
4760 | while self.controllerThread.isRunning(): |
|
4760 | while self.controllerThread.isRunning(): | |
4761 | sleep(0.5) |
|
4761 | sleep(0.5) | |
4762 |
|
4762 | |||
4763 | self._disable_stop_button() |
|
4763 | self._disable_stop_button() | |
4764 | self._enable_play_button() |
|
4764 | self._enable_play_button() | |
4765 |
|
4765 | |||
4766 | def pauseProject(self): |
|
4766 | def pauseProject(self): | |
4767 |
|
4767 | |||
4768 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4768 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4769 | paused = self.controllerThread.pause() |
|
4769 | paused = self.controllerThread.pause() | |
4770 |
|
4770 | |||
4771 | self.changePauseIcon(paused) |
|
4771 | self.changePauseIcon(paused) | |
4772 |
|
4772 | |||
4773 | def saveProject(self, filename=None): |
|
4773 | def saveProject(self, filename=None): | |
4774 |
|
4774 | |||
4775 | self._disable_save_button() |
|
4775 | self._disable_save_button() | |
4776 | self._disable_play_button() |
|
4776 | self._disable_play_button() | |
4777 |
|
4777 | |||
4778 | projectObj = self.getSelectedProjectObj() |
|
4778 | projectObj = self.getSelectedProjectObj() | |
4779 |
|
4779 | |||
4780 | if not projectObj: |
|
4780 | if not projectObj: | |
4781 |
|
4781 | |||
4782 | if self.create: |
|
4782 | if self.create: | |
4783 | self.console.append("Please press Ok before save it") |
|
4783 | self.console.append("Please press Ok before save it") | |
4784 | else: |
|
4784 | else: | |
4785 | self.console.append("Please select a project before save it") |
|
4785 | self.console.append("Please select a project before save it") | |
4786 | return |
|
4786 | return | |
4787 |
|
4787 | |||
4788 | self.refreshGraphicsId() |
|
4788 | self.refreshGraphicsId() | |
4789 |
|
4789 | |||
4790 | sts = True |
|
4790 | sts = True | |
4791 | selectedItemObj = self.getSelectedItemObj() |
|
4791 | selectedItemObj = self.getSelectedItemObj() | |
4792 |
|
4792 | |||
4793 | #A Processing Unit has been selected |
|
4793 | #A Processing Unit has been selected | |
4794 | if projectObj == selectedItemObj: |
|
4794 | if projectObj == selectedItemObj: | |
4795 | if not self.on_proOk_clicked(): |
|
4795 | if not self.on_proOk_clicked(): | |
4796 | return None |
|
4796 | return None | |
4797 |
|
4797 | |||
4798 | #A Processing Unit has been selected |
|
4798 | #A Processing Unit has been selected | |
4799 | if projectObj != selectedItemObj: |
|
4799 | if projectObj != selectedItemObj: | |
4800 | puObj = selectedItemObj |
|
4800 | puObj = selectedItemObj | |
4801 |
|
4801 | |||
4802 | if puObj.name == 'VoltageProc': |
|
4802 | if puObj.name == 'VoltageProc': | |
4803 | sts = self.on_volOpOk_clicked() |
|
4803 | sts = self.on_volOpOk_clicked() | |
4804 | if puObj.name == 'SpectraProc': |
|
4804 | if puObj.name == 'SpectraProc': | |
4805 | sts = self.on_specOpOk_clicked() |
|
4805 | sts = self.on_specOpOk_clicked() | |
4806 | if puObj.name == 'SpectraHeisProc': |
|
4806 | if puObj.name == 'SpectraHeisProc': | |
4807 | sts = self.on_specHeisOpOk_clicked() |
|
4807 | sts = self.on_specHeisOpOk_clicked() | |
4808 |
|
4808 | |||
4809 | if not sts: |
|
4809 | if not sts: | |
4810 | return None |
|
4810 | return None | |
4811 |
|
4811 | |||
4812 | self.createFTPProcUnitView() |
|
4812 | self.createFTPProcUnitView() | |
4813 |
|
4813 | |||
4814 | if not filename: |
|
4814 | if not filename: | |
4815 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4815 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4816 |
|
4816 | |||
4817 | projectObj.writeXml(filename) |
|
4817 | projectObj.writeXml(filename) | |
4818 | self.console.clear() |
|
4818 | self.console.clear() | |
4819 | self.console.append("Project saved") |
|
4819 | self.console.append("Project saved") | |
4820 | self.console.append("Press Play button to start data processing ...") |
|
4820 | self.console.append("Press Play button to start data processing ...") | |
4821 |
|
4821 | |||
4822 | self._disable_save_button() |
|
4822 | self._disable_save_button() | |
4823 | self._enable_play_button() |
|
4823 | self._enable_play_button() | |
4824 |
|
4824 | |||
4825 | return filename |
|
4825 | return filename | |
4826 |
|
4826 | |||
4827 | def removeItemTreeFromProject(self): |
|
4827 | def removeItemTreeFromProject(self): | |
4828 | """ |
|
4828 | """ | |
4829 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4829 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4830 | """ |
|
4830 | """ | |
4831 | for key in self.__itemTreeDict.keys(): |
|
4831 | for key in self.__itemTreeDict.keys(): | |
4832 |
|
4832 | |||
4833 | #Check again because an item can delete multiple items (childs) |
|
4833 | #Check again because an item can delete multiple items (childs) | |
4834 | if key not in self.__itemTreeDict.keys(): |
|
4834 | if key not in self.__itemTreeDict.keys(): | |
4835 | continue |
|
4835 | continue | |
4836 |
|
4836 | |||
4837 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4837 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4838 | continue |
|
4838 | continue | |
4839 |
|
4839 | |||
4840 | if self.__projectObjDict.has_key(key) == True: |
|
4840 | if self.__projectObjDict.has_key(key) == True: | |
4841 |
|
4841 | |||
4842 | del self.__projectObjDict[key] |
|
4842 | del self.__projectObjDict[key] | |
4843 | del self.__itemTreeDict[key] |
|
4843 | del self.__itemTreeDict[key] | |
4844 |
|
4844 | |||
4845 | else: |
|
4845 | else: | |
4846 | puObj = self.__puObjDict[key] |
|
4846 | puObj = self.__puObjDict[key] | |
4847 | idProjectParent = puObj.parentId |
|
4847 | idProjectParent = puObj.parentId | |
4848 | projectObj = self.__projectObjDict[idProjectParent] |
|
4848 | projectObj = self.__projectObjDict[idProjectParent] | |
4849 |
|
4849 | |||
4850 | del self.__puObjDict[key] |
|
4850 | del self.__puObjDict[key] | |
4851 | del self.__itemTreeDict[key] |
|
4851 | del self.__itemTreeDict[key] | |
4852 | del projectObj.procUnitConfObjDict[key] |
|
4852 | del projectObj.procUnitConfObjDict[key] | |
4853 |
|
4853 | |||
4854 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4854 | for key in projectObj.procUnitConfObjDict.keys(): | |
4855 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4855 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4856 | continue |
|
4856 | continue | |
4857 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4857 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4858 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4858 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4859 | del projectObj.procUnitConfObjDict[key] |
|
4859 | del projectObj.procUnitConfObjDict[key] | |
4860 | # print projectObj.procUnitConfObjDict |
|
4860 | # print projectObj.procUnitConfObjDict | |
4861 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4861 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4862 |
|
4862 | |||
4863 | def setInputsProject_View(self): |
|
4863 | def setInputsProject_View(self): | |
4864 |
|
4864 | |||
4865 | self.tabWidgetProject.setEnabled(True) |
|
4865 | self.tabWidgetProject.setEnabled(True) | |
4866 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4866 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4867 | self.tabProject.setEnabled(True) |
|
4867 | self.tabProject.setEnabled(True) | |
4868 | self.frame_2.setEnabled(False) |
|
4868 | self.frame_2.setEnabled(False) | |
4869 | self.proName.clear() |
|
4869 | self.proName.clear() | |
4870 | self.proName.setFocus() |
|
4870 | self.proName.setFocus() | |
4871 | self.proName.setSelection(0, 0) |
|
4871 | self.proName.setSelection(0, 0) | |
4872 | self.proName.setCursorPosition(0) |
|
4872 | self.proName.setCursorPosition(0) | |
4873 | self.proDataType.setText('.r') |
|
4873 | self.proDataType.setText('.r') | |
4874 | self.proDataPath.clear() |
|
4874 | self.proDataPath.clear() | |
4875 | self.proComDataType.clear() |
|
4875 | self.proComDataType.clear() | |
4876 | self.proComDataType.addItem("Voltage") |
|
4876 | self.proComDataType.addItem("Voltage") | |
4877 | self.proComDataType.addItem("Spectra") |
|
4877 | self.proComDataType.addItem("Spectra") | |
4878 | self.proComDataType.addItem("Fits") |
|
4878 | self.proComDataType.addItem("Fits") | |
4879 | self.proComDataType.addItem("USRP") |
|
4879 | self.proComDataType.addItem("USRP") | |
4880 |
|
4880 | |||
4881 | self.proComStartDate.clear() |
|
4881 | self.proComStartDate.clear() | |
4882 | self.proComEndDate.clear() |
|
4882 | self.proComEndDate.clear() | |
4883 |
|
4883 | |||
4884 | startTime = "00:00:00" |
|
4884 | startTime = "00:00:00" | |
4885 | endTime = "23:59:59" |
|
4885 | endTime = "23:59:59" | |
4886 | starlist = startTime.split(":") |
|
4886 | starlist = startTime.split(":") | |
4887 | endlist = endTime.split(":") |
|
4887 | endlist = endTime.split(":") | |
4888 | self.proDelay.setText("60") |
|
4888 | self.proDelay.setText("60") | |
4889 | self.proSet.setText("") |
|
4889 | self.proSet.setText("") | |
4890 |
|
4890 | |||
4891 | self.labelSet.show() |
|
4891 | self.labelSet.show() | |
4892 | self.proSet.show() |
|
4892 | self.proSet.show() | |
4893 |
|
4893 | |||
4894 | self.labelIPPKm.hide() |
|
4894 | self.labelIPPKm.hide() | |
4895 | self.proIPPKm.hide() |
|
4895 | self.proIPPKm.hide() | |
4896 |
|
4896 | |||
4897 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4897 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4898 | self.proStartTime.setTime(self.time) |
|
4898 | self.proStartTime.setTime(self.time) | |
4899 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4899 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4900 | self.proEndTime.setTime(self.time) |
|
4900 | self.proEndTime.setTime(self.time) | |
4901 | self.proDescription.clear() |
|
4901 | self.proDescription.clear() | |
4902 | self.proOk.setEnabled(False) |
|
4902 | self.proOk.setEnabled(False) | |
4903 | # self.console.append("Please, Write a name Project") |
|
4903 | # self.console.append("Please, Write a name Project") | |
4904 | # self.console.append("Introduce Project Parameters")DC |
|
4904 | # self.console.append("Introduce Project Parameters")DC | |
4905 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4905 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4906 |
|
4906 | |||
4907 | def clearPUWindow(self, datatype): |
|
4907 | def clearPUWindow(self, datatype): | |
4908 |
|
4908 | |||
4909 | projectObjView = self.getSelectedProjectObj() |
|
4909 | projectObjView = self.getSelectedProjectObj() | |
4910 |
|
4910 | |||
4911 | if not projectObjView: |
|
4911 | if not projectObjView: | |
4912 | return |
|
4912 | return | |
4913 |
|
4913 | |||
4914 | puObj = self.getSelectedItemObj() |
|
4914 | puObj = self.getSelectedItemObj() | |
4915 | inputId = puObj.getInputId() |
|
4915 | inputId = puObj.getInputId() | |
4916 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4916 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4917 |
|
4917 | |||
4918 | if datatype == 'Voltage': |
|
4918 | if datatype == 'Voltage': | |
4919 | self.volOpComChannels.setEnabled(False) |
|
4919 | self.volOpComChannels.setEnabled(False) | |
4920 | self.volOpComHeights.setEnabled(False) |
|
4920 | self.volOpComHeights.setEnabled(False) | |
4921 | self.volOpFilter.setEnabled(False) |
|
4921 | self.volOpFilter.setEnabled(False) | |
4922 | self.volOpComProfile.setEnabled(False) |
|
4922 | self.volOpComProfile.setEnabled(False) | |
4923 | self.volOpComCode.setEnabled(False) |
|
4923 | self.volOpComCode.setEnabled(False) | |
4924 | self.volOpCohInt.setEnabled(False) |
|
4924 | self.volOpCohInt.setEnabled(False) | |
4925 | self.volOpChannel.setEnabled(False) |
|
4925 | self.volOpChannel.setEnabled(False) | |
4926 | self.volOpHeights.setEnabled(False) |
|
4926 | self.volOpHeights.setEnabled(False) | |
4927 | self.volOpProfile.setEnabled(False) |
|
4927 | self.volOpProfile.setEnabled(False) | |
4928 | self.volOpRadarfrequency.setEnabled(False) |
|
4928 | self.volOpRadarfrequency.setEnabled(False) | |
4929 | self.volOpCebChannels.setCheckState(0) |
|
4929 | self.volOpCebChannels.setCheckState(0) | |
4930 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4930 | self.volOpCebRadarfrequency.setCheckState(0) | |
4931 | self.volOpCebHeights.setCheckState(0) |
|
4931 | self.volOpCebHeights.setCheckState(0) | |
4932 | self.volOpCebFilter.setCheckState(0) |
|
4932 | self.volOpCebFilter.setCheckState(0) | |
4933 | self.volOpCebProfile.setCheckState(0) |
|
4933 | self.volOpCebProfile.setCheckState(0) | |
4934 | self.volOpCebDecodification.setCheckState(0) |
|
4934 | self.volOpCebDecodification.setCheckState(0) | |
4935 | self.volOpCebCohInt.setCheckState(0) |
|
4935 | self.volOpCebCohInt.setCheckState(0) | |
4936 |
|
4936 | |||
4937 | self.volOpChannel.clear() |
|
4937 | self.volOpChannel.clear() | |
4938 | self.volOpHeights.clear() |
|
4938 | self.volOpHeights.clear() | |
4939 | self.volOpProfile.clear() |
|
4939 | self.volOpProfile.clear() | |
4940 | self.volOpFilter.clear() |
|
4940 | self.volOpFilter.clear() | |
4941 | self.volOpCohInt.clear() |
|
4941 | self.volOpCohInt.clear() | |
4942 | self.volOpRadarfrequency.clear() |
|
4942 | self.volOpRadarfrequency.clear() | |
4943 |
|
4943 | |||
4944 | if datatype == 'Spectra': |
|
4944 | if datatype == 'Spectra': | |
4945 |
|
4945 | |||
4946 | if inputPUObj.datatype == 'Spectra': |
|
4946 | if inputPUObj.datatype == 'Spectra': | |
4947 | self.specOpnFFTpoints.setEnabled(False) |
|
4947 | self.specOpnFFTpoints.setEnabled(False) | |
4948 | self.specOpProfiles.setEnabled(False) |
|
4948 | self.specOpProfiles.setEnabled(False) | |
4949 | self.specOpippFactor.setEnabled(False) |
|
4949 | self.specOpippFactor.setEnabled(False) | |
4950 | else: |
|
4950 | else: | |
4951 | self.specOpnFFTpoints.setEnabled(True) |
|
4951 | self.specOpnFFTpoints.setEnabled(True) | |
4952 | self.specOpProfiles.setEnabled(True) |
|
4952 | self.specOpProfiles.setEnabled(True) | |
4953 | self.specOpippFactor.setEnabled(True) |
|
4953 | self.specOpippFactor.setEnabled(True) | |
4954 |
|
4954 | |||
4955 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4955 | self.specOpCebCrossSpectra.setCheckState(0) | |
4956 | self.specOpCebChannel.setCheckState(0) |
|
4956 | self.specOpCebChannel.setCheckState(0) | |
4957 | self.specOpCebHeights.setCheckState(0) |
|
4957 | self.specOpCebHeights.setCheckState(0) | |
4958 | self.specOpCebIncoherent.setCheckState(0) |
|
4958 | self.specOpCebIncoherent.setCheckState(0) | |
4959 | self.specOpCebRemoveDC.setCheckState(0) |
|
4959 | self.specOpCebRemoveDC.setCheckState(0) | |
4960 | self.specOpCebRemoveInt.setCheckState(0) |
|
4960 | self.specOpCebRemoveInt.setCheckState(0) | |
4961 | self.specOpCebgetNoise.setCheckState(0) |
|
4961 | self.specOpCebgetNoise.setCheckState(0) | |
4962 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4962 | self.specOpCebRadarfrequency.setCheckState(0) | |
4963 |
|
4963 | |||
4964 | self.specOpRadarfrequency.setEnabled(False) |
|
4964 | self.specOpRadarfrequency.setEnabled(False) | |
4965 | self.specOppairsList.setEnabled(False) |
|
4965 | self.specOppairsList.setEnabled(False) | |
4966 | self.specOpChannel.setEnabled(False) |
|
4966 | self.specOpChannel.setEnabled(False) | |
4967 | self.specOpHeights.setEnabled(False) |
|
4967 | self.specOpHeights.setEnabled(False) | |
4968 | self.specOpIncoherent.setEnabled(False) |
|
4968 | self.specOpIncoherent.setEnabled(False) | |
4969 | self.specOpgetNoise.setEnabled(False) |
|
4969 | self.specOpgetNoise.setEnabled(False) | |
4970 |
|
4970 | |||
4971 | self.specOpRadarfrequency.clear() |
|
4971 | self.specOpRadarfrequency.clear() | |
4972 | self.specOpnFFTpoints.clear() |
|
4972 | self.specOpnFFTpoints.clear() | |
4973 | self.specOpProfiles.clear() |
|
4973 | self.specOpProfiles.clear() | |
4974 | self.specOpippFactor.clear |
|
4974 | self.specOpippFactor.clear | |
4975 | self.specOppairsList.clear() |
|
4975 | self.specOppairsList.clear() | |
4976 | self.specOpChannel.clear() |
|
4976 | self.specOpChannel.clear() | |
4977 | self.specOpHeights.clear() |
|
4977 | self.specOpHeights.clear() | |
4978 | self.specOpIncoherent.clear() |
|
4978 | self.specOpIncoherent.clear() | |
4979 | self.specOpgetNoise.clear() |
|
4979 | self.specOpgetNoise.clear() | |
4980 |
|
4980 | |||
4981 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4981 | self.specGraphCebSpectraplot.setCheckState(0) | |
4982 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4982 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4983 | self.specGraphCebRTIplot.setCheckState(0) |
|
4983 | self.specGraphCebRTIplot.setCheckState(0) | |
4984 | self.specGraphCebRTInoise.setCheckState(0) |
|
4984 | self.specGraphCebRTInoise.setCheckState(0) | |
4985 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4985 | self.specGraphCebCoherencmap.setCheckState(0) | |
4986 | self.specGraphPowerprofile.setCheckState(0) |
|
4986 | self.specGraphPowerprofile.setCheckState(0) | |
4987 |
|
4987 | |||
4988 | self.specGraphSaveSpectra.setCheckState(0) |
|
4988 | self.specGraphSaveSpectra.setCheckState(0) | |
4989 | self.specGraphSaveCross.setCheckState(0) |
|
4989 | self.specGraphSaveCross.setCheckState(0) | |
4990 | self.specGraphSaveRTIplot.setCheckState(0) |
|
4990 | self.specGraphSaveRTIplot.setCheckState(0) | |
4991 | self.specGraphSaveRTInoise.setCheckState(0) |
|
4991 | self.specGraphSaveRTInoise.setCheckState(0) | |
4992 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
4992 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4993 | self.specGraphSavePowerprofile.setCheckState(0) |
|
4993 | self.specGraphSavePowerprofile.setCheckState(0) | |
4994 |
|
4994 | |||
4995 | self.specGraphftpRTIplot.setCheckState(0) |
|
4995 | self.specGraphftpRTIplot.setCheckState(0) | |
4996 | self.specGraphftpRTInoise.setCheckState(0) |
|
4996 | self.specGraphftpRTInoise.setCheckState(0) | |
4997 | self.specGraphftpCoherencemap.setCheckState(0) |
|
4997 | self.specGraphftpCoherencemap.setCheckState(0) | |
4998 |
|
4998 | |||
4999 | self.specGraphPath.clear() |
|
4999 | self.specGraphPath.clear() | |
5000 | self.specGraphPrefix.clear() |
|
5000 | self.specGraphPrefix.clear() | |
5001 |
|
5001 | |||
5002 | self.specGgraphftpratio.clear() |
|
5002 | self.specGgraphftpratio.clear() | |
5003 |
|
5003 | |||
5004 | self.specGgraphChannelList.clear() |
|
5004 | self.specGgraphChannelList.clear() | |
5005 | self.specGgraphFreq.clear() |
|
5005 | self.specGgraphFreq.clear() | |
5006 | self.specGgraphHeight.clear() |
|
5006 | self.specGgraphHeight.clear() | |
5007 | self.specGgraphDbsrange.clear() |
|
5007 | self.specGgraphDbsrange.clear() | |
5008 | self.specGgraphmagnitud.clear() |
|
5008 | self.specGgraphmagnitud.clear() | |
5009 | self.specGgraphTminTmax.clear() |
|
5009 | self.specGgraphTminTmax.clear() | |
5010 | self.specGgraphTimeRange.clear() |
|
5010 | self.specGgraphTimeRange.clear() | |
5011 |
|
5011 | |||
5012 | if datatype == 'SpectraHeis': |
|
5012 | if datatype == 'SpectraHeis': | |
5013 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5013 | self.specHeisOpCebIncoherent.setCheckState(0) | |
5014 | self.specHeisOpIncoherent.setEnabled(False) |
|
5014 | self.specHeisOpIncoherent.setEnabled(False) | |
5015 | self.specHeisOpIncoherent.clear() |
|
5015 | self.specHeisOpIncoherent.clear() | |
5016 |
|
5016 | |||
5017 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5017 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5018 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5018 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5019 |
|
5019 | |||
5020 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5020 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5021 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5021 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5022 |
|
5022 | |||
5023 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5023 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5024 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5024 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5025 |
|
5025 | |||
5026 | self.specHeisGraphPath.clear() |
|
5026 | self.specHeisGraphPath.clear() | |
5027 | self.specHeisGraphPrefix.clear() |
|
5027 | self.specHeisGraphPrefix.clear() | |
5028 | self.specHeisGgraphChannelList.clear() |
|
5028 | self.specHeisGgraphChannelList.clear() | |
5029 | self.specHeisGgraphXminXmax.clear() |
|
5029 | self.specHeisGgraphXminXmax.clear() | |
5030 | self.specHeisGgraphYminYmax.clear() |
|
5030 | self.specHeisGgraphYminYmax.clear() | |
5031 | self.specHeisGgraphTminTmax.clear() |
|
5031 | self.specHeisGgraphTminTmax.clear() | |
5032 | self.specHeisGgraphTimeRange.clear() |
|
5032 | self.specHeisGgraphTimeRange.clear() | |
5033 | self.specHeisGgraphftpratio.clear() |
|
5033 | self.specHeisGgraphftpratio.clear() | |
5034 |
|
5034 | |||
5035 | def showtabPUCreated(self, datatype): |
|
5035 | def showtabPUCreated(self, datatype): | |
5036 |
|
5036 | |||
5037 | if datatype == "Voltage": |
|
5037 | if datatype == "Voltage": | |
5038 | self.tabVoltage.setEnabled(True) |
|
5038 | self.tabVoltage.setEnabled(True) | |
5039 | self.tabProject.setEnabled(False) |
|
5039 | self.tabProject.setEnabled(False) | |
5040 | self.tabSpectra.setEnabled(False) |
|
5040 | self.tabSpectra.setEnabled(False) | |
5041 | self.tabCorrelation.setEnabled(False) |
|
5041 | self.tabCorrelation.setEnabled(False) | |
5042 | self.tabSpectraHeis.setEnabled(False) |
|
5042 | self.tabSpectraHeis.setEnabled(False) | |
5043 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5043 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5044 |
|
5044 | |||
5045 | if datatype == "Spectra": |
|
5045 | if datatype == "Spectra": | |
5046 | self.tabVoltage.setEnabled(False) |
|
5046 | self.tabVoltage.setEnabled(False) | |
5047 | self.tabProject.setEnabled(False) |
|
5047 | self.tabProject.setEnabled(False) | |
5048 | self.tabSpectra.setEnabled(True) |
|
5048 | self.tabSpectra.setEnabled(True) | |
5049 | self.tabCorrelation.setEnabled(False) |
|
5049 | self.tabCorrelation.setEnabled(False) | |
5050 | self.tabSpectraHeis.setEnabled(False) |
|
5050 | self.tabSpectraHeis.setEnabled(False) | |
5051 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5051 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5052 |
|
5052 | |||
5053 | if datatype == "SpectraHeis": |
|
5053 | if datatype == "SpectraHeis": | |
5054 | self.tabVoltage.setEnabled(False) |
|
5054 | self.tabVoltage.setEnabled(False) | |
5055 | self.tabProject.setEnabled(False) |
|
5055 | self.tabProject.setEnabled(False) | |
5056 | self.tabSpectra.setEnabled(False) |
|
5056 | self.tabSpectra.setEnabled(False) | |
5057 | self.tabCorrelation.setEnabled(False) |
|
5057 | self.tabCorrelation.setEnabled(False) | |
5058 | self.tabSpectraHeis.setEnabled(True) |
|
5058 | self.tabSpectraHeis.setEnabled(True) | |
5059 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5059 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5060 |
|
5060 | |||
5061 | def checkInputsProject(self): |
|
5061 | def checkInputsProject(self): | |
5062 | """ |
|
5062 | """ | |
5063 | Check Inputs Project: |
|
5063 | Check Inputs Project: | |
5064 | - project_name |
|
5064 | - project_name | |
5065 | - datatype |
|
5065 | - datatype | |
5066 | - ext |
|
5066 | - ext | |
5067 | - data_path |
|
5067 | - data_path | |
5068 | - readmode |
|
5068 | - readmode | |
5069 | - delay |
|
5069 | - delay | |
5070 | - set |
|
5070 | - set | |
5071 | - walk |
|
5071 | - walk | |
5072 | """ |
|
5072 | """ | |
5073 | parms_ok = True |
|
5073 | parms_ok = True | |
5074 | project_name = str(self.proName.text()) |
|
5074 | project_name = str(self.proName.text()) | |
5075 | if project_name == '' or project_name == None: |
|
5075 | if project_name == '' or project_name == None: | |
5076 | outputstr = "Enter the Project Name" |
|
5076 | outputstr = "Enter the Project Name" | |
5077 | self.console.append(outputstr) |
|
5077 | self.console.append(outputstr) | |
5078 | parms_ok = False |
|
5078 | parms_ok = False | |
5079 | project_name = None |
|
5079 | project_name = None | |
5080 |
|
5080 | |||
5081 | datatype = str(self.proComDataType.currentText()) |
|
5081 | datatype = str(self.proComDataType.currentText()) | |
5082 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5082 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5083 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5083 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5084 | self.console.append(outputstr) |
|
5084 | self.console.append(outputstr) | |
5085 | parms_ok = False |
|
5085 | parms_ok = False | |
5086 | datatype = None |
|
5086 | datatype = None | |
5087 |
|
5087 | |||
5088 | ext = str(self.proDataType.text()) |
|
5088 | ext = str(self.proDataType.text()) | |
5089 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5089 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5090 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5090 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5091 | self.console.append(outputstr) |
|
5091 | self.console.append(outputstr) | |
5092 | parms_ok = False |
|
5092 | parms_ok = False | |
5093 | ext = None |
|
5093 | ext = None | |
5094 |
|
5094 | |||
5095 | data_path = str(self.proDataPath.text()) |
|
5095 | data_path = str(self.proDataPath.text()) | |
5096 |
|
5096 | |||
5097 | if data_path == '': |
|
5097 | if data_path == '': | |
5098 | outputstr = 'Datapath is empty' |
|
5098 | outputstr = 'Datapath is empty' | |
5099 | self.console.append(outputstr) |
|
5099 | self.console.append(outputstr) | |
5100 | parms_ok = False |
|
5100 | parms_ok = False | |
5101 | data_path = None |
|
5101 | data_path = None | |
5102 |
|
5102 | |||
5103 | if data_path != None: |
|
5103 | if data_path != None: | |
5104 | if not os.path.isdir(data_path): |
|
5104 | if not os.path.isdir(data_path): | |
5105 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5105 | outputstr = 'Datapath:%s does not exists' % data_path | |
5106 | self.console.append(outputstr) |
|
5106 | self.console.append(outputstr) | |
5107 | parms_ok = False |
|
5107 | parms_ok = False | |
5108 | data_path = None |
|
5108 | data_path = None | |
5109 |
|
5109 | |||
5110 | read_mode = str(self.proComReadMode.currentText()) |
|
5110 | read_mode = str(self.proComReadMode.currentText()) | |
5111 | if not(read_mode in ['Online', 'Offline']): |
|
5111 | if not(read_mode in ['Online', 'Offline']): | |
5112 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5112 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5113 | self.console.append(outputstr) |
|
5113 | self.console.append(outputstr) | |
5114 | parms_ok = False |
|
5114 | parms_ok = False | |
5115 | read_mode = None |
|
5115 | read_mode = None | |
5116 |
|
5116 | |||
5117 | delay = None |
|
5117 | delay = None | |
5118 | if read_mode == "Online": |
|
5118 | if read_mode == "Online": | |
5119 | parms_ok = False |
|
5119 | parms_ok = False | |
5120 | try: |
|
5120 | try: | |
5121 | delay = int(str(self.proDelay.text())) |
|
5121 | delay = int(str(self.proDelay.text())) | |
5122 | parms_ok = True |
|
5122 | parms_ok = True | |
5123 | except: |
|
5123 | except: | |
5124 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5124 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5125 | self.console.append(outputstr) |
|
5125 | self.console.append(outputstr) | |
5126 |
|
5126 | |||
5127 | try: |
|
5127 | try: | |
5128 | set = int(str(self.proSet.text())) |
|
5128 | set = int(str(self.proSet.text())) | |
5129 | except: |
|
5129 | except: | |
5130 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5130 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5131 | # self.console.append(outputstr) |
|
5131 | # self.console.append(outputstr) | |
5132 | # parms_ok = False |
|
5132 | # parms_ok = False | |
5133 | set = None |
|
5133 | set = None | |
5134 |
|
5134 | |||
5135 | walk = int(self.proComWalk.currentIndex()) |
|
5135 | walk = int(self.proComWalk.currentIndex()) | |
5136 | expLabel = str(self.proExpLabel.text()) |
|
5136 | expLabel = str(self.proExpLabel.text()) | |
5137 |
|
5137 | |||
5138 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5138 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5139 |
|
5139 | |||
5140 | def checkInputsPUSave(self, datatype): |
|
5140 | def checkInputsPUSave(self, datatype): | |
5141 | """ |
|
5141 | """ | |
5142 | Check Inputs Spectra Save: |
|
5142 | Check Inputs Spectra Save: | |
5143 | - path |
|
5143 | - path | |
5144 | - blocks Per File |
|
5144 | - blocks Per File | |
5145 | - sufix |
|
5145 | - sufix | |
5146 | - dataformat |
|
5146 | - dataformat | |
5147 | """ |
|
5147 | """ | |
5148 | parms_ok = True |
|
5148 | parms_ok = True | |
5149 |
|
5149 | |||
5150 | if datatype == "Voltage": |
|
5150 | if datatype == "Voltage": | |
5151 | output_path = str(self.volOutputPath.text()) |
|
5151 | output_path = str(self.volOutputPath.text()) | |
5152 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5152 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5153 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5153 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5154 |
|
5154 | |||
5155 | if datatype == "Spectra": |
|
5155 | if datatype == "Spectra": | |
5156 | output_path = str(self.specOutputPath.text()) |
|
5156 | output_path = str(self.specOutputPath.text()) | |
5157 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5157 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5158 | profilesperblock = 0 |
|
5158 | profilesperblock = 0 | |
5159 |
|
5159 | |||
5160 | if datatype == "SpectraHeis": |
|
5160 | if datatype == "SpectraHeis": | |
5161 | output_path = str(self.specHeisOutputPath.text()) |
|
5161 | output_path = str(self.specHeisOutputPath.text()) | |
5162 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5162 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5163 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5163 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5164 |
|
5164 | |||
5165 | if output_path == '': |
|
5165 | if output_path == '': | |
5166 | outputstr = 'Outputpath is empty' |
|
5166 | outputstr = 'Outputpath is empty' | |
5167 | self.console.append(outputstr) |
|
5167 | self.console.append(outputstr) | |
5168 | parms_ok = False |
|
5168 | parms_ok = False | |
5169 |
|
5169 | |||
5170 | if not os.path.isdir(output_path): |
|
5170 | if not os.path.isdir(output_path): | |
5171 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5171 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5172 | self.console.append(outputstr) |
|
5172 | self.console.append(outputstr) | |
5173 | parms_ok = False |
|
5173 | parms_ok = False | |
5174 |
|
5174 | |||
5175 | try: |
|
5175 | try: | |
5176 | profilesperblock = int(profilesperblock) |
|
5176 | profilesperblock = int(profilesperblock) | |
5177 | except: |
|
5177 | except: | |
5178 | if datatype == "Voltage": |
|
5178 | if datatype == "Voltage": | |
5179 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5179 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5180 | self.console.append(outputstr) |
|
5180 | self.console.append(outputstr) | |
5181 | parms_ok = False |
|
5181 | parms_ok = False | |
5182 | profilesperblock = None |
|
5182 | profilesperblock = None | |
5183 |
|
5183 | |||
5184 | try: |
|
5184 | try: | |
5185 | blocksperfile = int(blocksperfile) |
|
5185 | blocksperfile = int(blocksperfile) | |
5186 | except: |
|
5186 | except: | |
5187 | if datatype == "Voltage": |
|
5187 | if datatype == "Voltage": | |
5188 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5188 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5189 | elif datatype == "Spectra": |
|
5189 | elif datatype == "Spectra": | |
5190 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5190 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5191 | elif datatype == "SpectraHeis": |
|
5191 | elif datatype == "SpectraHeis": | |
5192 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5192 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5193 |
|
5193 | |||
5194 | self.console.append(outputstr) |
|
5194 | self.console.append(outputstr) | |
5195 | parms_ok = False |
|
5195 | parms_ok = False | |
5196 | blocksperfile = None |
|
5196 | blocksperfile = None | |
5197 |
|
5197 | |||
5198 | if datatype == "SpectraHeis": |
|
5198 | if datatype == "SpectraHeis": | |
5199 | if metadata_file != '': |
|
5199 | if metadata_file != '': | |
5200 | if not os.path.isfile(metadata_file): |
|
5200 | if not os.path.isfile(metadata_file): | |
5201 | outputstr = 'Metadata file %s does not exist' % metadata_file |
|
5201 | outputstr = 'Metadata file %s does not exist' % metadata_file | |
5202 | self.console.append(outputstr) |
|
5202 | self.console.append(outputstr) | |
5203 | parms_ok = False |
|
5203 | parms_ok = False | |
5204 |
|
5204 | |||
5205 | if datatype == "Voltage": |
|
5205 | if datatype == "Voltage": | |
5206 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5206 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5207 |
|
5207 | |||
5208 |
|
5208 | |||
5209 | if datatype == "Spectra": |
|
5209 | if datatype == "Spectra": | |
5210 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5210 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5211 |
|
5211 | |||
5212 |
|
5212 | |||
5213 | if datatype == "SpectraHeis": |
|
5213 | if datatype == "SpectraHeis": | |
5214 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5214 | return parms_ok, output_path, blocksperfile, metadata_file | |
5215 |
|
5215 | |||
5216 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5216 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5217 |
|
5217 | |||
5218 | dateList = [] |
|
5218 | dateList = [] | |
5219 | fileList = [] |
|
5219 | fileList = [] | |
5220 |
|
5220 | |||
5221 | if ext == ".r": |
|
5221 | if ext == ".r": | |
5222 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5222 | from schainpy.model.io.jroIO_base import JRODataReader | |
5223 |
|
5223 | |||
5224 | readerObj = JRODataReader() |
|
5224 | readerObj = JRODataReader() | |
5225 | dateList = readerObj.findDatafiles(path=data_path, |
|
5225 | dateList = readerObj.findDatafiles(path=data_path, | |
5226 | expLabel=expLabel, |
|
5226 | expLabel=expLabel, | |
5227 | ext=ext, |
|
5227 | ext=ext, | |
5228 | walk=walk) |
|
5228 | walk=walk) | |
5229 |
|
5229 | |||
5230 | if ext == ".pdata": |
|
5230 | if ext == ".pdata": | |
5231 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5231 | from schainpy.model.io.jroIO_base import JRODataReader | |
5232 |
|
5232 | |||
5233 | readerObj = JRODataReader() |
|
5233 | readerObj = JRODataReader() | |
5234 | dateList = readerObj.findDatafiles(path=data_path, |
|
5234 | dateList = readerObj.findDatafiles(path=data_path, | |
5235 | expLabel=expLabel, |
|
5235 | expLabel=expLabel, | |
5236 | ext=ext, |
|
5236 | ext=ext, | |
5237 | walk=walk) |
|
5237 | walk=walk) | |
5238 |
|
5238 | |||
5239 | if ext == ".fits": |
|
5239 | if ext == ".fits": | |
5240 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5240 | from schainpy.model.io.jroIO_base import JRODataReader | |
5241 |
|
5241 | |||
5242 | readerObj = JRODataReader() |
|
5242 | readerObj = JRODataReader() | |
5243 | dateList = readerObj.findDatafiles(path=data_path, |
|
5243 | dateList = readerObj.findDatafiles(path=data_path, | |
5244 | expLabel=expLabel, |
|
5244 | expLabel=expLabel, | |
5245 | ext=ext, |
|
5245 | ext=ext, | |
5246 | walk=walk) |
|
5246 | walk=walk) | |
5247 |
|
5247 | |||
5248 | if ext == ".hdf5": |
|
5248 | if ext == ".hdf5": | |
5249 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5249 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5250 |
|
5250 | |||
5251 | readerObj = USRPReader() |
|
5251 | readerObj = USRPReader() | |
5252 | dateList = readerObj.findDatafiles(path=data_path) |
|
5252 | dateList = readerObj.findDatafiles(path=data_path) | |
5253 |
|
5253 | |||
5254 | return dateList |
|
5254 | return dateList | |
5255 |
|
5255 | |||
5256 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5256 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5257 | """ |
|
5257 | """ | |
5258 | Method to loads day |
|
5258 | Method to loads day | |
5259 | """ |
|
5259 | """ | |
5260 | # self._disable_save_button() |
|
5260 | # self._disable_save_button() | |
5261 | # self._disable_play_button() |
|
5261 | # self._disable_play_button() | |
5262 | # self.proOk.setEnabled(False) |
|
5262 | # self.proOk.setEnabled(False) | |
5263 |
|
5263 | |||
5264 | self.proComStartDate.clear() |
|
5264 | self.proComStartDate.clear() | |
5265 | self.proComEndDate.clear() |
|
5265 | self.proComEndDate.clear() | |
5266 |
|
5266 | |||
5267 | self.dateList = [] |
|
5267 | self.dateList = [] | |
5268 |
|
5268 | |||
5269 | if not data_path: |
|
5269 | if not data_path: | |
5270 | return [] |
|
5270 | return [] | |
5271 |
|
5271 | |||
5272 | if not os.path.isdir(data_path): |
|
5272 | if not os.path.isdir(data_path): | |
5273 | return [] |
|
5273 | return [] | |
5274 |
|
5274 | |||
5275 | self.dataPath = data_path |
|
5275 | self.dataPath = data_path | |
5276 |
|
5276 | |||
5277 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5277 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5278 |
|
5278 | |||
5279 | if not dateList: |
|
5279 | if not dateList: | |
5280 | # self.console.clear() |
|
5280 | # self.console.clear() | |
5281 | if walk: |
|
5281 | if walk: | |
5282 | if expLabel: |
|
5282 | if expLabel: | |
5283 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5283 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5284 | else: |
|
5284 | else: | |
5285 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5285 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5286 | else: |
|
5286 | else: | |
5287 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5287 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5288 |
|
5288 | |||
5289 | self.console.append(outputstr) |
|
5289 | self.console.append(outputstr) | |
5290 | return [] |
|
5290 | return [] | |
5291 |
|
5291 | |||
5292 | dateStrList = [] |
|
5292 | dateStrList = [] | |
5293 | for thisDate in dateList: |
|
5293 | for thisDate in dateList: | |
5294 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5294 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5295 |
|
5295 | |||
5296 | self.proComStartDate.addItem(dateStr) |
|
5296 | self.proComStartDate.addItem(dateStr) | |
5297 | self.proComEndDate.addItem(dateStr) |
|
5297 | self.proComEndDate.addItem(dateStr) | |
5298 | dateStrList.append(dateStr) |
|
5298 | dateStrList.append(dateStr) | |
5299 |
|
5299 | |||
5300 | self.proComStartDate.setCurrentIndex(0) |
|
5300 | self.proComStartDate.setCurrentIndex(0) | |
5301 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5301 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5302 |
|
5302 | |||
5303 | self.dateList = dateStrList |
|
5303 | self.dateList = dateStrList | |
5304 |
|
5304 | |||
5305 | self.console.clear() |
|
5305 | self.console.clear() | |
5306 | self.console.append("Successful load") |
|
5306 | self.console.append("Successful load") | |
5307 |
|
5307 | |||
5308 | # self.proOk.setEnabled(True) |
|
5308 | # self.proOk.setEnabled(True) | |
5309 | # self._enable_play_button() |
|
5309 | # self._enable_play_button() | |
5310 | # self._enable_save_button() |
|
5310 | # self._enable_save_button() | |
5311 |
|
5311 | |||
5312 | return self.dateList |
|
5312 | return self.dateList | |
5313 |
|
5313 | |||
5314 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5314 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5315 |
|
5315 | |||
5316 | if pathWorkSpace == None: |
|
5316 | if pathWorkSpace == None: | |
5317 | home = os.path.expanduser("~") |
|
5317 | home = os.path.expanduser("~") | |
5318 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5318 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5319 |
|
5319 | |||
5320 | self.pathWorkSpace = pathWorkSpace |
|
5320 | self.pathWorkSpace = pathWorkSpace | |
5321 |
|
5321 | |||
5322 | """ |
|
5322 | """ | |
5323 | Comandos Usados en Console |
|
5323 | Comandos Usados en Console | |
5324 | """ |
|
5324 | """ | |
5325 | def __del__(self): |
|
5325 | def __del__(self): | |
5326 | sys.stdout = sys.__stdout__ |
|
5326 | sys.stdout = sys.__stdout__ | |
5327 | sys.stderr = sys.__stderr__ |
|
5327 | sys.stderr = sys.__stderr__ | |
5328 |
|
5328 | |||
5329 | def normalOutputWritten(self, text): |
|
5329 | def normalOutputWritten(self, text): | |
5330 | color_black = QtGui.QColor(0,0,0) |
|
5330 | color_black = QtGui.QColor(0,0,0) | |
5331 | self.console.setTextColor(color_black) |
|
5331 | self.console.setTextColor(color_black) | |
5332 | self.console.append(text) |
|
5332 | self.console.append(text) | |
5333 |
|
5333 | |||
5334 | def errorOutputWritten(self, text): |
|
5334 | def errorOutputWritten(self, text): | |
5335 | color_red = QtGui.QColor(255,0,0) |
|
5335 | color_red = QtGui.QColor(255,0,0) | |
5336 | color_black = QtGui.QColor(0,0,0) |
|
5336 | color_black = QtGui.QColor(0,0,0) | |
5337 |
|
5337 | |||
5338 | self.console.setTextColor(color_red) |
|
5338 | self.console.setTextColor(color_red) | |
5339 | self.console.append(text) |
|
5339 | self.console.append(text) | |
5340 | self.console.setTextColor(color_black) |
|
5340 | self.console.setTextColor(color_black) | |
5341 |
|
5341 | |||
5342 | def _enable_save_button(self): |
|
5342 | def _enable_save_button(self): | |
5343 |
|
5343 | |||
5344 | self.actionSaveToolbar.setEnabled(True) |
|
5344 | self.actionSaveToolbar.setEnabled(True) | |
5345 | self.actionSave.setEnabled(True) |
|
5345 | self.actionSave.setEnabled(True) | |
5346 |
|
5346 | |||
5347 | def _disable_save_button(self): |
|
5347 | def _disable_save_button(self): | |
5348 |
|
5348 | |||
5349 | self.actionSaveToolbar.setEnabled(False) |
|
5349 | self.actionSaveToolbar.setEnabled(False) | |
5350 | self.actionSave.setEnabled(False) |
|
5350 | self.actionSave.setEnabled(False) | |
5351 |
|
5351 | |||
5352 | def _enable_play_button(self): |
|
5352 | def _enable_play_button(self): | |
5353 |
|
5353 | |||
5354 | self.actionStart.setEnabled(True) |
|
5354 | self.actionStart.setEnabled(True) | |
5355 | self.actionStarToolbar.setEnabled(True) |
|
5355 | self.actionStarToolbar.setEnabled(True) | |
5356 |
|
5356 | |||
5357 | self.changeStartIcon(started=False) |
|
5357 | self.changeStartIcon(started=False) | |
5358 |
|
5358 | |||
5359 | def _disable_play_button(self): |
|
5359 | def _disable_play_button(self): | |
5360 |
|
5360 | |||
5361 | self.actionStart.setEnabled(False) |
|
5361 | self.actionStart.setEnabled(False) | |
5362 | self.actionStarToolbar.setEnabled(False) |
|
5362 | self.actionStarToolbar.setEnabled(False) | |
5363 |
|
5363 | |||
5364 | self.changeStartIcon(started=True) |
|
5364 | self.changeStartIcon(started=True) | |
5365 |
|
5365 | |||
5366 | def _enable_stop_button(self): |
|
5366 | def _enable_stop_button(self): | |
5367 |
|
5367 | |||
5368 | self.actionPause.setEnabled(True) |
|
5368 | self.actionPause.setEnabled(True) | |
5369 | self.actionStop.setEnabled(True) |
|
5369 | self.actionStop.setEnabled(True) | |
5370 |
|
5370 | |||
5371 | self.actionPauseToolbar.setEnabled(True) |
|
5371 | self.actionPauseToolbar.setEnabled(True) | |
5372 | self.actionStopToolbar.setEnabled(True) |
|
5372 | self.actionStopToolbar.setEnabled(True) | |
5373 |
|
5373 | |||
5374 | self.changePauseIcon(paused=False) |
|
5374 | self.changePauseIcon(paused=False) | |
5375 | self.changeStopIcon(started=True) |
|
5375 | self.changeStopIcon(started=True) | |
5376 |
|
5376 | |||
5377 | def _disable_stop_button(self): |
|
5377 | def _disable_stop_button(self): | |
5378 |
|
5378 | |||
5379 | self.actionPause.setEnabled(False) |
|
5379 | self.actionPause.setEnabled(False) | |
5380 | self.actionStop.setEnabled(False) |
|
5380 | self.actionStop.setEnabled(False) | |
5381 |
|
5381 | |||
5382 | self.actionPauseToolbar.setEnabled(False) |
|
5382 | self.actionPauseToolbar.setEnabled(False) | |
5383 | self.actionStopToolbar.setEnabled(False) |
|
5383 | self.actionStopToolbar.setEnabled(False) | |
5384 |
|
5384 | |||
5385 | self.changePauseIcon(paused=False) |
|
5385 | self.changePauseIcon(paused=False) | |
5386 | self.changeStopIcon(started=False) |
|
5386 | self.changeStopIcon(started=False) | |
5387 |
|
5387 | |||
5388 | def setGUIStatus(self): |
|
5388 | def setGUIStatus(self): | |
5389 |
|
5389 | |||
5390 | self.setWindowTitle("ROJ-Signal Chain") |
|
5390 | self.setWindowTitle("ROJ-Signal Chain") | |
5391 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5391 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5392 |
|
5392 | |||
5393 | self.tabWidgetProject.setEnabled(False) |
|
5393 | self.tabWidgetProject.setEnabled(False) | |
5394 | self.tabVoltage.setEnabled(False) |
|
5394 | self.tabVoltage.setEnabled(False) | |
5395 | self.tabSpectra.setEnabled(False) |
|
5395 | self.tabSpectra.setEnabled(False) | |
5396 | self.tabCorrelation.setEnabled(False) |
|
5396 | self.tabCorrelation.setEnabled(False) | |
5397 | self.frame_2.setEnabled(False) |
|
5397 | self.frame_2.setEnabled(False) | |
5398 |
|
5398 | |||
5399 | self.actionCreate.setShortcut('Ctrl+N') |
|
5399 | self.actionCreate.setShortcut('Ctrl+N') | |
5400 | self.actionOpen.setShortcut('Ctrl+O') |
|
5400 | self.actionOpen.setShortcut('Ctrl+O') | |
5401 | self.actionSave.setShortcut('Ctrl+S') |
|
5401 | self.actionSave.setShortcut('Ctrl+S') | |
5402 | self.actionClose.setShortcut('Ctrl+X') |
|
5402 | self.actionClose.setShortcut('Ctrl+X') | |
5403 |
|
5403 | |||
5404 | self.actionStart.setShortcut('Ctrl+1') |
|
5404 | self.actionStart.setShortcut('Ctrl+1') | |
5405 | self.actionPause.setShortcut('Ctrl+2') |
|
5405 | self.actionPause.setShortcut('Ctrl+2') | |
5406 | self.actionStop.setShortcut('Ctrl+3') |
|
5406 | self.actionStop.setShortcut('Ctrl+3') | |
5407 |
|
5407 | |||
5408 | self.actionFTP.setShortcut('Ctrl+F') |
|
5408 | self.actionFTP.setShortcut('Ctrl+F') | |
5409 |
|
5409 | |||
5410 | self.actionStart.setEnabled(False) |
|
5410 | self.actionStart.setEnabled(False) | |
5411 | self.actionPause.setEnabled(False) |
|
5411 | self.actionPause.setEnabled(False) | |
5412 | self.actionStop.setEnabled(False) |
|
5412 | self.actionStop.setEnabled(False) | |
5413 |
|
5413 | |||
5414 | self.actionStarToolbar.setEnabled(False) |
|
5414 | self.actionStarToolbar.setEnabled(False) | |
5415 | self.actionPauseToolbar.setEnabled(False) |
|
5415 | self.actionPauseToolbar.setEnabled(False) | |
5416 | self.actionStopToolbar.setEnabled(False) |
|
5416 | self.actionStopToolbar.setEnabled(False) | |
5417 |
|
5417 | |||
5418 | self.proName.clear() |
|
5418 | self.proName.clear() | |
5419 | self.proDataPath.setText('') |
|
5419 | self.proDataPath.setText('') | |
5420 | self.console.setReadOnly(True) |
|
5420 | self.console.setReadOnly(True) | |
5421 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5421 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5422 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5422 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5423 | self.proDataType.setEnabled(False) |
|
5423 | self.proDataType.setEnabled(False) | |
5424 | self.time = QtCore.QTime() |
|
5424 | self.time = QtCore.QTime() | |
5425 | self.hour = 0 |
|
5425 | self.hour = 0 | |
5426 | self.min = 0 |
|
5426 | self.min = 0 | |
5427 | self.sec = 0 |
|
5427 | self.sec = 0 | |
5428 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5428 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5429 | startTime = "00:00:00" |
|
5429 | startTime = "00:00:00" | |
5430 | endTime = "23:59:59" |
|
5430 | endTime = "23:59:59" | |
5431 | starlist = startTime.split(":") |
|
5431 | starlist = startTime.split(":") | |
5432 | endlist = endTime.split(":") |
|
5432 | endlist = endTime.split(":") | |
5433 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5433 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5434 | self.proStartTime.setTime(self.time) |
|
5434 | self.proStartTime.setTime(self.time) | |
5435 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5435 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5436 | self.proEndTime.setTime(self.time) |
|
5436 | self.proEndTime.setTime(self.time) | |
5437 | self.proOk.setEnabled(False) |
|
5437 | self.proOk.setEnabled(False) | |
5438 | # set model Project Explorer |
|
5438 | # set model Project Explorer | |
5439 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5439 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5440 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5440 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5441 | layout = QtGui.QVBoxLayout() |
|
5441 | layout = QtGui.QVBoxLayout() | |
5442 | layout.addWidget(self.projectExplorerTree) |
|
5442 | layout.addWidget(self.projectExplorerTree) | |
5443 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5443 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5444 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5444 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5445 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5445 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5446 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5446 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5447 | self.projectExplorerTree.expandAll() |
|
5447 | self.projectExplorerTree.expandAll() | |
5448 | # set model Project Properties |
|
5448 | # set model Project Properties | |
5449 |
|
5449 | |||
5450 | self.propertiesModel = TreeModel() |
|
5450 | self.propertiesModel = TreeModel() | |
5451 | self.propertiesModel.initProjectView() |
|
5451 | self.propertiesModel.initProjectView() | |
5452 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5452 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5453 | self.treeProjectProperties.expandAll() |
|
5453 | self.treeProjectProperties.expandAll() | |
5454 | self.treeProjectProperties.allColumnsShowFocus() |
|
5454 | self.treeProjectProperties.allColumnsShowFocus() | |
5455 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5455 | self.treeProjectProperties.resizeColumnToContents(1) | |
5456 |
|
5456 | |||
5457 | # set Project |
|
5457 | # set Project | |
5458 | self.proExpLabel.setEnabled(True) |
|
5458 | self.proExpLabel.setEnabled(True) | |
5459 | self.proDelay.setEnabled(False) |
|
5459 | self.proDelay.setEnabled(False) | |
5460 | self.proSet.setEnabled(True) |
|
5460 | self.proSet.setEnabled(True) | |
5461 | self.proDataType.setReadOnly(True) |
|
5461 | self.proDataType.setReadOnly(True) | |
5462 |
|
5462 | |||
5463 | # set Operation Voltage |
|
5463 | # set Operation Voltage | |
5464 | self.volOpComChannels.setEnabled(False) |
|
5464 | self.volOpComChannels.setEnabled(False) | |
5465 | self.volOpComHeights.setEnabled(False) |
|
5465 | self.volOpComHeights.setEnabled(False) | |
5466 | self.volOpFilter.setEnabled(False) |
|
5466 | self.volOpFilter.setEnabled(False) | |
5467 | self.volOpComProfile.setEnabled(False) |
|
5467 | self.volOpComProfile.setEnabled(False) | |
5468 | self.volOpComCode.setEnabled(False) |
|
5468 | self.volOpComCode.setEnabled(False) | |
5469 | self.volOpFlip.setEnabled(False) |
|
5469 | self.volOpFlip.setEnabled(False) | |
5470 | self.volOpCohInt.setEnabled(False) |
|
5470 | self.volOpCohInt.setEnabled(False) | |
5471 | self.volOpRadarfrequency.setEnabled(False) |
|
5471 | self.volOpRadarfrequency.setEnabled(False) | |
5472 |
|
5472 | |||
5473 | self.volOpChannel.setEnabled(False) |
|
5473 | self.volOpChannel.setEnabled(False) | |
5474 | self.volOpHeights.setEnabled(False) |
|
5474 | self.volOpHeights.setEnabled(False) | |
5475 | self.volOpProfile.setEnabled(False) |
|
5475 | self.volOpProfile.setEnabled(False) | |
5476 | self.volOpComMode.setEnabled(False) |
|
5476 | self.volOpComMode.setEnabled(False) | |
5477 |
|
5477 | |||
5478 | self.volGraphPath.setEnabled(False) |
|
5478 | self.volGraphPath.setEnabled(False) | |
5479 | self.volGraphPrefix.setEnabled(False) |
|
5479 | self.volGraphPrefix.setEnabled(False) | |
5480 | self.volGraphToolPath.setEnabled(False) |
|
5480 | self.volGraphToolPath.setEnabled(False) | |
5481 |
|
5481 | |||
5482 | # set Graph Voltage |
|
5482 | # set Graph Voltage | |
5483 | self.volGraphChannelList.setEnabled(False) |
|
5483 | self.volGraphChannelList.setEnabled(False) | |
5484 | self.volGraphfreqrange.setEnabled(False) |
|
5484 | self.volGraphfreqrange.setEnabled(False) | |
5485 | self.volGraphHeightrange.setEnabled(False) |
|
5485 | self.volGraphHeightrange.setEnabled(False) | |
5486 |
|
5486 | |||
5487 | # set Operation Spectra |
|
5487 | # set Operation Spectra | |
5488 | self.specOpnFFTpoints.setEnabled(False) |
|
5488 | self.specOpnFFTpoints.setEnabled(False) | |
5489 | self.specOpProfiles.setEnabled(False) |
|
5489 | self.specOpProfiles.setEnabled(False) | |
5490 | self.specOpippFactor.setEnabled(False) |
|
5490 | self.specOpippFactor.setEnabled(False) | |
5491 | self.specOppairsList.setEnabled(False) |
|
5491 | self.specOppairsList.setEnabled(False) | |
5492 | self.specOpComChannel.setEnabled(False) |
|
5492 | self.specOpComChannel.setEnabled(False) | |
5493 | self.specOpComHeights.setEnabled(False) |
|
5493 | self.specOpComHeights.setEnabled(False) | |
5494 | self.specOpIncoherent.setEnabled(False) |
|
5494 | self.specOpIncoherent.setEnabled(False) | |
5495 | self.specOpgetNoise.setEnabled(False) |
|
5495 | self.specOpgetNoise.setEnabled(False) | |
5496 | self.specOpRadarfrequency.setEnabled(False) |
|
5496 | self.specOpRadarfrequency.setEnabled(False) | |
5497 |
|
5497 | |||
5498 |
|
5498 | |||
5499 | self.specOpChannel.setEnabled(False) |
|
5499 | self.specOpChannel.setEnabled(False) | |
5500 | self.specOpHeights.setEnabled(False) |
|
5500 | self.specOpHeights.setEnabled(False) | |
5501 | # set Graph Spectra |
|
5501 | # set Graph Spectra | |
5502 | self.specGgraphChannelList.setEnabled(False) |
|
5502 | self.specGgraphChannelList.setEnabled(False) | |
5503 | self.specGgraphFreq.setEnabled(False) |
|
5503 | self.specGgraphFreq.setEnabled(False) | |
5504 | self.specGgraphHeight.setEnabled(False) |
|
5504 | self.specGgraphHeight.setEnabled(False) | |
5505 | self.specGgraphDbsrange.setEnabled(False) |
|
5505 | self.specGgraphDbsrange.setEnabled(False) | |
5506 | self.specGgraphmagnitud.setEnabled(False) |
|
5506 | self.specGgraphmagnitud.setEnabled(False) | |
5507 | self.specGgraphTminTmax.setEnabled(False) |
|
5507 | self.specGgraphTminTmax.setEnabled(False) | |
5508 | self.specGgraphTimeRange.setEnabled(False) |
|
5508 | self.specGgraphTimeRange.setEnabled(False) | |
5509 | self.specGraphPath.setEnabled(False) |
|
5509 | self.specGraphPath.setEnabled(False) | |
5510 | self.specGraphToolPath.setEnabled(False) |
|
5510 | self.specGraphToolPath.setEnabled(False) | |
5511 | self.specGraphPrefix.setEnabled(False) |
|
5511 | self.specGraphPrefix.setEnabled(False) | |
5512 |
|
5512 | |||
5513 | self.specGgraphftpratio.setEnabled(False) |
|
5513 | self.specGgraphftpratio.setEnabled(False) | |
5514 | # set Operation SpectraHeis |
|
5514 | # set Operation SpectraHeis | |
5515 | self.specHeisOpIncoherent.setEnabled(False) |
|
5515 | self.specHeisOpIncoherent.setEnabled(False) | |
5516 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5516 | self.specHeisOpCobIncInt.setEnabled(False) | |
5517 | # set Graph SpectraHeis |
|
5517 | # set Graph SpectraHeis | |
5518 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5518 | self.specHeisGgraphChannelList.setEnabled(False) | |
5519 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5519 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5520 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5520 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5521 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5521 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5522 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5522 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5523 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5523 | self.specHeisGgraphftpratio.setEnabled(False) | |
5524 | self.specHeisGraphPath.setEnabled(False) |
|
5524 | self.specHeisGraphPath.setEnabled(False) | |
5525 | self.specHeisGraphPrefix.setEnabled(False) |
|
5525 | self.specHeisGraphPrefix.setEnabled(False) | |
5526 | self.specHeisGraphToolPath.setEnabled(False) |
|
5526 | self.specHeisGraphToolPath.setEnabled(False) | |
5527 |
|
5527 | |||
5528 |
|
5528 | |||
5529 | # tool tip gui |
|
5529 | # tool tip gui | |
5530 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5530 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5531 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5531 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5532 | # tool tip gui project |
|
5532 | # tool tip gui project | |
5533 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') |
|
5533 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') | |
5534 | self.proComWalk.setCurrentIndex(0) |
|
5534 | self.proComWalk.setCurrentIndex(0) | |
5535 | # tool tip gui volOp |
|
5535 | # tool tip gui volOp | |
5536 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5536 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5537 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5537 | self.volOpHeights.setToolTip('Example: 90,180') | |
5538 | self.volOpFilter.setToolTip('Example: 2') |
|
5538 | self.volOpFilter.setToolTip('Example: 2') | |
5539 | self.volOpProfile.setToolTip('Example:0,127') |
|
5539 | self.volOpProfile.setToolTip('Example:0,127') | |
5540 | self.volOpCohInt.setToolTip('Example: 128') |
|
5540 | self.volOpCohInt.setToolTip('Example: 128') | |
5541 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5541 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5542 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5542 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5543 | # tool tip gui volGraph |
|
5543 | # tool tip gui volGraph | |
5544 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5544 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5545 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5545 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5546 | # tool tip gui specOp |
|
5546 | # tool tip gui specOp | |
5547 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5547 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5548 | self.specOpProfiles.setToolTip('Example: 128') |
|
5548 | self.specOpProfiles.setToolTip('Example: 128') | |
5549 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5549 | self.specOpippFactor.setToolTip('Example:1.0') | |
5550 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5550 | self.specOpIncoherent.setToolTip('Example: 10') | |
5551 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5551 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5552 |
|
5552 | |||
5553 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5553 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5554 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5554 | self.specOpHeights.setToolTip('Example: 90,180') | |
5555 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5555 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5556 | # tool tip gui specGraph |
|
5556 | # tool tip gui specGraph | |
5557 |
|
5557 | |||
5558 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5558 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5559 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5559 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5560 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5560 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5561 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5561 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5562 |
|
5562 | |||
5563 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5563 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5564 |
|
5564 | |||
5565 |
|
5565 | |||
5566 | self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5566 | self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5567 |
|
5567 | |||
5568 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5568 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5569 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5569 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5570 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5570 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5571 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5571 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5572 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5572 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5573 |
|
5573 | |||
5574 | self.labelSet.show() |
|
5574 | self.labelSet.show() | |
5575 | self.proSet.show() |
|
5575 | self.proSet.show() | |
5576 |
|
5576 | |||
5577 | self.labelIPPKm.hide() |
|
5577 | self.labelIPPKm.hide() | |
5578 | self.proIPPKm.hide() |
|
5578 | self.proIPPKm.hide() | |
5579 |
|
5579 | |||
5580 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5580 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5581 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5581 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5582 |
|
5582 | |||
5583 |
|
5583 | |||
5584 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5584 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5585 | """ |
|
5585 | """ | |
5586 | Class documentation goes here. |
|
5586 | Class documentation goes here. | |
5587 | """ |
|
5587 | """ | |
5588 | closed = pyqtSignal() |
|
5588 | closed = pyqtSignal() | |
5589 | create = False |
|
5589 | create = False | |
5590 |
|
5590 | |||
5591 | def __init__(self, parent=None): |
|
5591 | def __init__(self, parent=None): | |
5592 | """ |
|
5592 | """ | |
5593 | Constructor |
|
5593 | Constructor | |
5594 | """ |
|
5594 | """ | |
5595 | QMainWindow.__init__(self, parent) |
|
5595 | QMainWindow.__init__(self, parent) | |
5596 | self.setupUi(self) |
|
5596 | self.setupUi(self) | |
5597 | self.getFromWindow = None |
|
5597 | self.getFromWindow = None | |
5598 | self.getfromWindowList = [] |
|
5598 | self.getfromWindowList = [] | |
5599 | self.dataTypeProject = None |
|
5599 | self.dataTypeProject = None | |
5600 |
|
5600 | |||
5601 | self.listUP = None |
|
5601 | self.listUP = None | |
5602 |
|
5602 | |||
5603 | @pyqtSignature("") |
|
5603 | @pyqtSignature("") | |
5604 | def on_unitPokbut_clicked(self): |
|
5604 | def on_unitPokbut_clicked(self): | |
5605 | """ |
|
5605 | """ | |
5606 | Slot documentation goes here. |
|
5606 | Slot documentation goes here. | |
5607 | """ |
|
5607 | """ | |
5608 | self.create = True |
|
5608 | self.create = True | |
5609 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5609 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5610 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5610 | # self.nameofUP= str(self.nameUptxt.text()) | |
5611 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5611 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5612 | self.close() |
|
5612 | self.close() | |
5613 |
|
5613 | |||
5614 |
|
5614 | |||
5615 | @pyqtSignature("") |
|
5615 | @pyqtSignature("") | |
5616 | def on_unitPcancelbut_clicked(self): |
|
5616 | def on_unitPcancelbut_clicked(self): | |
5617 | """ |
|
5617 | """ | |
5618 | Slot documentation goes here. |
|
5618 | Slot documentation goes here. | |
5619 | """ |
|
5619 | """ | |
5620 | self.create = False |
|
5620 | self.create = False | |
5621 | self.close() |
|
5621 | self.close() | |
5622 |
|
5622 | |||
5623 | def loadTotalList(self): |
|
5623 | def loadTotalList(self): | |
5624 | self.comboInputBox.clear() |
|
5624 | self.comboInputBox.clear() | |
5625 | for i in self.getfromWindowList: |
|
5625 | for i in self.getfromWindowList: | |
5626 |
|
5626 | |||
5627 | name = i.getElementName() |
|
5627 | name = i.getElementName() | |
5628 | if name == 'Project': |
|
5628 | if name == 'Project': | |
5629 | id = i.id |
|
5629 | id = i.id | |
5630 | name = i.name |
|
5630 | name = i.name | |
5631 | if self.dataTypeProject == 'Voltage': |
|
5631 | if self.dataTypeProject == 'Voltage': | |
5632 | self.comboTypeBox.clear() |
|
5632 | self.comboTypeBox.clear() | |
5633 | self.comboTypeBox.addItem("Voltage") |
|
5633 | self.comboTypeBox.addItem("Voltage") | |
5634 |
|
5634 | |||
5635 | if self.dataTypeProject == 'Spectra': |
|
5635 | if self.dataTypeProject == 'Spectra': | |
5636 | self.comboTypeBox.clear() |
|
5636 | self.comboTypeBox.clear() | |
5637 | self.comboTypeBox.addItem("Spectra") |
|
5637 | self.comboTypeBox.addItem("Spectra") | |
5638 | self.comboTypeBox.addItem("Correlation") |
|
5638 | self.comboTypeBox.addItem("Correlation") | |
5639 | if self.dataTypeProject == 'Fits': |
|
5639 | if self.dataTypeProject == 'Fits': | |
5640 | self.comboTypeBox.clear() |
|
5640 | self.comboTypeBox.clear() | |
5641 | self.comboTypeBox.addItem("SpectraHeis") |
|
5641 | self.comboTypeBox.addItem("SpectraHeis") | |
5642 |
|
5642 | |||
5643 |
|
5643 | |||
5644 | if name == 'ProcUnit': |
|
5644 | if name == 'ProcUnit': | |
5645 | id = int(i.id) - 1 |
|
5645 | id = int(i.id) - 1 | |
5646 | name = i.datatype |
|
5646 | name = i.datatype | |
5647 | if name == 'Voltage': |
|
5647 | if name == 'Voltage': | |
5648 | self.comboTypeBox.clear() |
|
5648 | self.comboTypeBox.clear() | |
5649 | self.comboTypeBox.addItem("Spectra") |
|
5649 | self.comboTypeBox.addItem("Spectra") | |
5650 | self.comboTypeBox.addItem("SpectraHeis") |
|
5650 | self.comboTypeBox.addItem("SpectraHeis") | |
5651 | self.comboTypeBox.addItem("Correlation") |
|
5651 | self.comboTypeBox.addItem("Correlation") | |
5652 | if name == 'Spectra': |
|
5652 | if name == 'Spectra': | |
5653 | self.comboTypeBox.clear() |
|
5653 | self.comboTypeBox.clear() | |
5654 | self.comboTypeBox.addItem("Spectra") |
|
5654 | self.comboTypeBox.addItem("Spectra") | |
5655 | self.comboTypeBox.addItem("SpectraHeis") |
|
5655 | self.comboTypeBox.addItem("SpectraHeis") | |
5656 | self.comboTypeBox.addItem("Correlation") |
|
5656 | self.comboTypeBox.addItem("Correlation") | |
5657 | if name == 'SpectraHeis': |
|
5657 | if name == 'SpectraHeis': | |
5658 | self.comboTypeBox.clear() |
|
5658 | self.comboTypeBox.clear() | |
5659 | self.comboTypeBox.addItem("SpectraHeis") |
|
5659 | self.comboTypeBox.addItem("SpectraHeis") | |
5660 |
|
5660 | |||
5661 | self.comboInputBox.addItem(str(name)) |
|
5661 | self.comboInputBox.addItem(str(name)) | |
5662 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5662 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5663 |
|
5663 | |||
5664 | def closeEvent(self, event): |
|
5664 | def closeEvent(self, event): | |
5665 | self.closed.emit() |
|
5665 | self.closed.emit() | |
5666 | event.accept() |
|
5666 | event.accept() | |
5667 |
|
5667 | |||
5668 | class Ftp(QMainWindow, Ui_Ftp): |
|
5668 | class Ftp(QMainWindow, Ui_Ftp): | |
5669 | """ |
|
5669 | """ | |
5670 | Class documentation goes here. |
|
5670 | Class documentation goes here. | |
5671 | """ |
|
5671 | """ | |
5672 | create = False |
|
5672 | create = False | |
5673 | closed = pyqtSignal() |
|
5673 | closed = pyqtSignal() | |
5674 | server = None |
|
5674 | server = None | |
5675 | remotefolder = None |
|
5675 | remotefolder = None | |
5676 | username = None |
|
5676 | username = None | |
5677 | password = None |
|
5677 | password = None | |
5678 | ftp_wei = None |
|
5678 | ftp_wei = None | |
5679 | exp_code = None |
|
5679 | exp_code = None | |
5680 | sub_exp_code = None |
|
5680 | sub_exp_code = None | |
5681 | plot_pos = None |
|
5681 | plot_pos = None | |
5682 |
|
5682 | |||
5683 | def __init__(self, parent=None): |
|
5683 | def __init__(self, parent=None): | |
5684 | """ |
|
5684 | """ | |
5685 | Constructor |
|
5685 | Constructor | |
5686 | """ |
|
5686 | """ | |
5687 | QMainWindow.__init__(self, parent) |
|
5687 | QMainWindow.__init__(self, parent) | |
5688 | self.setupUi(self) |
|
5688 | self.setupUi(self) | |
5689 | self.setGUIStatus() |
|
5689 | self.setGUIStatus() | |
5690 |
|
5690 | |||
5691 | def setGUIStatus(self): |
|
5691 | def setGUIStatus(self): | |
5692 | self.setWindowTitle("ROJ-Signal Chain") |
|
5692 | self.setWindowTitle("ROJ-Signal Chain") | |
5693 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5693 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5694 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5694 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5695 | self.usernameFTP.setToolTip('Example: myusername') |
|
5695 | self.usernameFTP.setToolTip('Example: myusername') | |
5696 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5696 | self.passwordFTP.setToolTip('Example: mypass ') | |
5697 | self.weightFTP.setToolTip('Example: 0') |
|
5697 | self.weightFTP.setToolTip('Example: 0') | |
5698 | self.expcodeFTP.setToolTip('Example: 0') |
|
5698 | self.expcodeFTP.setToolTip('Example: 0') | |
5699 | self.subexpFTP.setToolTip('Example: 0') |
|
5699 | self.subexpFTP.setToolTip('Example: 0') | |
5700 | self.plotposFTP.setToolTip('Example: 0') |
|
5700 | self.plotposFTP.setToolTip('Example: 0') | |
5701 |
|
5701 | |||
5702 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5702 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5703 | self.serverFTP.setText(str(server)) |
|
5703 | self.serverFTP.setText(str(server)) | |
5704 | self.folderFTP.setText(str(remotefolder)) |
|
5704 | self.folderFTP.setText(str(remotefolder)) | |
5705 | self.usernameFTP.setText(str(username)) |
|
5705 | self.usernameFTP.setText(str(username)) | |
5706 | self.passwordFTP.setText(str(password)) |
|
5706 | self.passwordFTP.setText(str(password)) | |
5707 | self.weightFTP.setText(str(ftp_wei)) |
|
5707 | self.weightFTP.setText(str(ftp_wei)) | |
5708 | self.expcodeFTP.setText(str(exp_code)) |
|
5708 | self.expcodeFTP.setText(str(exp_code)) | |
5709 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5709 | self.subexpFTP.setText(str(sub_exp_code)) | |
5710 | self.plotposFTP.setText(str(plot_pos)) |
|
5710 | self.plotposFTP.setText(str(plot_pos)) | |
5711 |
|
5711 | |||
5712 | def getParmsFromFtpWindow(self): |
|
5712 | def getParmsFromFtpWindow(self): | |
5713 | """ |
|
5713 | """ | |
5714 | Return Inputs Project: |
|
5714 | Return Inputs Project: | |
5715 | - server |
|
5715 | - server | |
5716 | - remotefolder |
|
5716 | - remotefolder | |
5717 | - username |
|
5717 | - username | |
5718 | - password |
|
5718 | - password | |
5719 | - ftp_wei |
|
5719 | - ftp_wei | |
5720 | - exp_code |
|
5720 | - exp_code | |
5721 | - sub_exp_code |
|
5721 | - sub_exp_code | |
5722 | - plot_pos |
|
5722 | - plot_pos | |
5723 | """ |
|
5723 | """ | |
5724 | name_server_ftp = str(self.serverFTP.text()) |
|
5724 | name_server_ftp = str(self.serverFTP.text()) | |
5725 | if not name_server_ftp: |
|
5725 | if not name_server_ftp: | |
5726 | self.console.clear() |
|
5726 | self.console.clear() | |
5727 | self.console.append("Please Write a FTP Server") |
|
5727 | self.console.append("Please Write a FTP Server") | |
5728 | return 0 |
|
5728 | return 0 | |
5729 |
|
5729 | |||
5730 | folder_server_ftp = str(self.folderFTP.text()) |
|
5730 | folder_server_ftp = str(self.folderFTP.text()) | |
5731 | if not folder_server_ftp: |
|
5731 | if not folder_server_ftp: | |
5732 | self.console.clear() |
|
5732 | self.console.clear() | |
5733 | self.console.append("Please Write a Folder") |
|
5733 | self.console.append("Please Write a Folder") | |
5734 | return 0 |
|
5734 | return 0 | |
5735 |
|
5735 | |||
5736 | username_ftp = str(self.usernameFTP.text()) |
|
5736 | username_ftp = str(self.usernameFTP.text()) | |
5737 | if not username_ftp: |
|
5737 | if not username_ftp: | |
5738 | self.console.clear() |
|
5738 | self.console.clear() | |
5739 | self.console.append("Please Write a User Name") |
|
5739 | self.console.append("Please Write a User Name") | |
5740 | return 0 |
|
5740 | return 0 | |
5741 |
|
5741 | |||
5742 | password_ftp = str(self.passwordFTP.text()) |
|
5742 | password_ftp = str(self.passwordFTP.text()) | |
5743 | if not password_ftp: |
|
5743 | if not password_ftp: | |
5744 | self.console.clear() |
|
5744 | self.console.clear() | |
5745 | self.console.append("Please Write a passwordFTP") |
|
5745 | self.console.append("Please Write a passwordFTP") | |
5746 | return 0 |
|
5746 | return 0 | |
5747 |
|
5747 | |||
5748 | ftp_wei = str(self.weightFTP.text()) |
|
5748 | ftp_wei = str(self.weightFTP.text()) | |
5749 | if not ftp_wei == "": |
|
5749 | if not ftp_wei == "": | |
5750 | try: |
|
5750 | try: | |
5751 | ftp_wei = int(self.weightFTP.text()) |
|
5751 | ftp_wei = int(self.weightFTP.text()) | |
5752 | except: |
|
5752 | except: | |
5753 | self.console.clear() |
|
5753 | self.console.clear() | |
5754 | self.console.append("Please Write a ftp_wei number") |
|
5754 | self.console.append("Please Write a ftp_wei number") | |
5755 | return 0 |
|
5755 | return 0 | |
5756 |
|
5756 | |||
5757 | exp_code = str(self.expcodeFTP.text()) |
|
5757 | exp_code = str(self.expcodeFTP.text()) | |
5758 | if not exp_code == "": |
|
5758 | if not exp_code == "": | |
5759 | try: |
|
5759 | try: | |
5760 | exp_code = int(self.expcodeFTP.text()) |
|
5760 | exp_code = int(self.expcodeFTP.text()) | |
5761 | except: |
|
5761 | except: | |
5762 | self.console.clear() |
|
5762 | self.console.clear() | |
5763 | self.console.append("Please Write a exp_code number") |
|
5763 | self.console.append("Please Write a exp_code number") | |
5764 | return 0 |
|
5764 | return 0 | |
5765 |
|
5765 | |||
5766 |
|
5766 | |||
5767 | sub_exp_code = str(self.subexpFTP.text()) |
|
5767 | sub_exp_code = str(self.subexpFTP.text()) | |
5768 | if not sub_exp_code == "": |
|
5768 | if not sub_exp_code == "": | |
5769 | try: |
|
5769 | try: | |
5770 | sub_exp_code = int(self.subexpFTP.text()) |
|
5770 | sub_exp_code = int(self.subexpFTP.text()) | |
5771 | except: |
|
5771 | except: | |
5772 | self.console.clear() |
|
5772 | self.console.clear() | |
5773 | self.console.append("Please Write a sub_exp_code number") |
|
5773 | self.console.append("Please Write a sub_exp_code number") | |
5774 | return 0 |
|
5774 | return 0 | |
5775 |
|
5775 | |||
5776 | plot_pos = str(self.plotposFTP.text()) |
|
5776 | plot_pos = str(self.plotposFTP.text()) | |
5777 | if not plot_pos == "": |
|
5777 | if not plot_pos == "": | |
5778 | try: |
|
5778 | try: | |
5779 | plot_pos = int(self.plotposFTP.text()) |
|
5779 | plot_pos = int(self.plotposFTP.text()) | |
5780 | except: |
|
5780 | except: | |
5781 | self.console.clear() |
|
5781 | self.console.clear() | |
5782 | self.console.append("Please Write a plot_pos number") |
|
5782 | self.console.append("Please Write a plot_pos number") | |
5783 | return 0 |
|
5783 | return 0 | |
5784 |
|
5784 | |||
5785 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5785 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5786 |
|
5786 | |||
5787 | @pyqtSignature("") |
|
5787 | @pyqtSignature("") | |
5788 | def on_ftpOkButton_clicked(self): |
|
5788 | def on_ftpOkButton_clicked(self): | |
5789 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5789 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5790 | self.create = True |
|
5790 | self.create = True | |
5791 | self.close() |
|
5791 | self.close() | |
5792 |
|
5792 | |||
5793 | @pyqtSignature("") |
|
5793 | @pyqtSignature("") | |
5794 | def on_ftpCancelButton_clicked(self): |
|
5794 | def on_ftpCancelButton_clicked(self): | |
5795 | self.create = False |
|
5795 | self.create = False | |
5796 | self.close() |
|
5796 | self.close() | |
5797 |
|
5797 | |||
5798 | def closeEvent(self, event): |
|
5798 | def closeEvent(self, event): | |
5799 | self.closed.emit() |
|
5799 | self.closed.emit() | |
5800 | event.accept() |
|
5800 | event.accept() | |
5801 |
|
5801 | |||
5802 | class ftpBuffer(): |
|
5802 | class ftpBuffer(): | |
5803 |
|
5803 | |||
5804 | server = None |
|
5804 | server = None | |
5805 | remotefolder = None |
|
5805 | remotefolder = None | |
5806 | username = None |
|
5806 | username = None | |
5807 | password = None |
|
5807 | password = None | |
5808 | ftp_wei = None |
|
5808 | ftp_wei = None | |
5809 | exp_code = None |
|
5809 | exp_code = None | |
5810 | sub_exp_code = None |
|
5810 | sub_exp_code = None | |
5811 | plot_pos = None |
|
5811 | plot_pos = None | |
5812 | create = False |
|
5812 | create = False | |
5813 | withoutconfig = False |
|
5813 | withoutconfig = False | |
5814 | createforView = False |
|
5814 | createforView = False | |
5815 | localfolder = None |
|
5815 | localfolder = None | |
5816 | extension = None |
|
5816 | extension = None | |
5817 | period = None |
|
5817 | period = None | |
5818 | protocol = None |
|
5818 | protocol = None | |
5819 |
|
5819 | |||
5820 | def __init__(self): |
|
5820 | def __init__(self): | |
5821 |
|
5821 | |||
5822 | self.create = False |
|
5822 | self.create = False | |
5823 | self.server = None |
|
5823 | self.server = None | |
5824 | self.remotefolder = None |
|
5824 | self.remotefolder = None | |
5825 | self.username = None |
|
5825 | self.username = None | |
5826 | self.password = None |
|
5826 | self.password = None | |
5827 | self.ftp_wei = None |
|
5827 | self.ftp_wei = None | |
5828 | self.exp_code = None |
|
5828 | self.exp_code = None | |
5829 | self.sub_exp_code = None |
|
5829 | self.sub_exp_code = None | |
5830 | self.plot_pos = None |
|
5830 | self.plot_pos = None | |
5831 | # self.create = False |
|
5831 | # self.create = False | |
5832 | self.localfolder = None |
|
5832 | self.localfolder = None | |
5833 | self.extension = None |
|
5833 | self.extension = None | |
5834 | self.period = None |
|
5834 | self.period = None | |
5835 | self.protocol = None |
|
5835 | self.protocol = None | |
5836 |
|
5836 | |||
5837 | def setwithoutconfiguration(self): |
|
5837 | def setwithoutconfiguration(self): | |
5838 |
|
5838 | |||
5839 | self.create = False |
|
5839 | self.create = False | |
5840 | self.server = "jro-app.igp.gob.pe" |
|
5840 | self.server = "jro-app.igp.gob.pe" | |
5841 | self.remotefolder = "/home/wmaster/graficos" |
|
5841 | self.remotefolder = "/home/wmaster/graficos" | |
5842 | self.username = "wmaster" |
|
5842 | self.username = "wmaster" | |
5843 | self.password = "mst2010vhf" |
|
5843 | self.password = "mst2010vhf" | |
5844 | self.withoutconfig = True |
|
5844 | self.withoutconfig = True | |
5845 | self.localfolder = './' |
|
5845 | self.localfolder = './' | |
5846 | self.extension = '.png' |
|
5846 | self.extension = '.png' | |
5847 | self.period = 60 |
|
5847 | self.period = 60 | |
5848 | self.protocol = 'ftp' |
|
5848 | self.protocol = 'ftp' | |
5849 | self.createforView = True |
|
5849 | self.createforView = True | |
5850 |
|
5850 | |||
5851 | if not self.ftp_wei: |
|
5851 | if not self.ftp_wei: | |
5852 | self.ftp_wei = 0 |
|
5852 | self.ftp_wei = 0 | |
5853 |
|
5853 | |||
5854 | if not self.exp_code: |
|
5854 | if not self.exp_code: | |
5855 | self.exp_code = 0 |
|
5855 | self.exp_code = 0 | |
5856 |
|
5856 | |||
5857 | if not self.sub_exp_code: |
|
5857 | if not self.sub_exp_code: | |
5858 | self.sub_exp_code = 0 |
|
5858 | self.sub_exp_code = 0 | |
5859 |
|
5859 | |||
5860 | if not self.plot_pos: |
|
5860 | if not self.plot_pos: | |
5861 | self.plot_pos = 0 |
|
5861 | self.plot_pos = 0 | |
5862 |
|
5862 | |||
5863 | 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'): |
|
5863 | 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'): | |
5864 |
|
5864 | |||
5865 | self.server = server |
|
5865 | self.server = server | |
5866 | self.remotefolder = remotefolder |
|
5866 | self.remotefolder = remotefolder | |
5867 | self.username = username |
|
5867 | self.username = username | |
5868 | self.password = password |
|
5868 | self.password = password | |
5869 | self.ftp_wei = ftp_wei |
|
5869 | self.ftp_wei = ftp_wei | |
5870 | self.exp_code = exp_code |
|
5870 | self.exp_code = exp_code | |
5871 | self.sub_exp_code = sub_exp_code |
|
5871 | self.sub_exp_code = sub_exp_code | |
5872 | self.plot_pos = plot_pos |
|
5872 | self.plot_pos = plot_pos | |
5873 | self.create = True |
|
5873 | self.create = True | |
5874 | self.withoutconfig = False |
|
5874 | self.withoutconfig = False | |
5875 | self.createforView = True |
|
5875 | self.createforView = True | |
5876 | self.localfolder = localfolder |
|
5876 | self.localfolder = localfolder | |
5877 | self.extension = extension |
|
5877 | self.extension = extension | |
5878 | self.period = period |
|
5878 | self.period = period | |
5879 | self.protocol = protocol |
|
5879 | self.protocol = protocol | |
5880 |
|
5880 | |||
5881 | def recover(self): |
|
5881 | def recover(self): | |
5882 |
|
5882 | |||
5883 | 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 |
|
5883 | 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 | |
5884 |
|
5884 | |||
5885 | class ShowMeConsole(QtCore.QObject): |
|
5885 | class ShowMeConsole(QtCore.QObject): | |
5886 |
|
5886 | |||
5887 | textWritten = QtCore.pyqtSignal(str) |
|
5887 | textWritten = QtCore.pyqtSignal(str) | |
5888 |
|
5888 | |||
5889 | def write(self, text): |
|
5889 | def write(self, text): | |
5890 |
|
5890 | |||
5891 | if len(text) == 0: |
|
5891 | if len(text) == 0: | |
5892 | self.textWritten.emit("\n") |
|
5892 | self.textWritten.emit("\n") | |
5893 | return |
|
5893 | return | |
5894 |
|
5894 | |||
5895 | if text[-1] == "\n": |
|
5895 | if text[-1] == "\n": | |
5896 | text = text[:-1] |
|
5896 | text = text[:-1] | |
5897 |
|
5897 | |||
5898 | self.textWritten.emit(str(text)) |
|
5898 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now