@@ -1,139 +1,141 | |||||
1 | import threading |
|
1 | import threading | |
2 |
|
2 | |||
3 | from schainpy.controller import Project |
|
3 | from schainpy.controller import Project | |
4 |
|
4 | |||
5 | class ControllerThread(threading.Thread, Project): |
|
5 | class ControllerThread(threading.Thread, Project): | |
6 |
|
6 | |||
7 | def __init__(self, filename=None, plotter_queue=None): |
|
7 | def __init__(self, filename=None, plotter_queue=None): | |
8 |
|
8 | |||
9 | threading.Thread.__init__(self) |
|
9 | threading.Thread.__init__(self) | |
10 | Project.__init__(self, filename, plotter_queue) |
|
10 | Project.__init__(self, filename, plotter_queue) | |
11 |
|
11 | |||
12 | self.setDaemon(True) |
|
12 | self.setDaemon(True) | |
13 |
|
13 | |||
14 | self.lock = threading.Lock() |
|
14 | self.lock = threading.Lock() | |
15 | self.control = {'stop':False, 'pause':False} |
|
15 | self.control = {'stop':False, 'pause':False} | |
16 |
|
16 | |||
17 | def __del__(self): |
|
17 | def __del__(self): | |
18 |
|
18 | |||
19 | self.control['stop'] = True |
|
19 | self.control['stop'] = True | |
20 |
|
20 | |||
21 | def stop(self): |
|
21 | def stop(self): | |
22 |
|
22 | |||
23 | self.lock.acquire() |
|
23 | self.lock.acquire() | |
24 |
|
24 | |||
25 | self.control['stop'] = True |
|
25 | self.control['stop'] = True | |
26 |
|
26 | |||
27 | self.lock.release() |
|
27 | self.lock.release() | |
28 |
|
28 | |||
29 | def pause(self): |
|
29 | def pause(self): | |
30 |
|
30 | |||
31 | self.lock.acquire() |
|
31 | self.lock.acquire() | |
32 |
|
32 | |||
33 | self.control['pause'] = not(self.control['pause']) |
|
33 | self.control['pause'] = not(self.control['pause']) | |
34 | paused = self.control['pause'] |
|
34 | paused = self.control['pause'] | |
35 |
|
35 | |||
36 | self.lock.release() |
|
36 | self.lock.release() | |
37 |
|
37 | |||
38 | return paused |
|
38 | return paused | |
39 |
|
39 | |||
40 | def isPaused(self): |
|
40 | def isPaused(self): | |
41 |
|
41 | |||
42 | self.lock.acquire() |
|
42 | self.lock.acquire() | |
43 | paused = self.control['pause'] |
|
43 | paused = self.control['pause'] | |
44 | self.lock.release() |
|
44 | self.lock.release() | |
45 |
|
45 | |||
46 | return paused |
|
46 | return paused | |
47 |
|
47 | |||
48 | def isStopped(self): |
|
48 | def isStopped(self): | |
49 |
|
49 | |||
50 | self.lock.acquire() |
|
50 | self.lock.acquire() | |
51 | stopped = self.control['stop'] |
|
51 | stopped = self.control['stop'] | |
52 | self.lock.release() |
|
52 | self.lock.release() | |
53 |
|
53 | |||
54 | return stopped |
|
54 | return stopped | |
55 |
|
55 | |||
56 | def run(self): |
|
56 | def run(self): | |
57 | self.control['stop'] = False |
|
57 | self.control['stop'] = False | |
58 | self.control['pause'] = False |
|
58 | self.control['pause'] = False | |
59 |
|
59 | |||
60 |
self.re |
|
60 | if not self.writeXml(self.filename): | |
|
61 | return | |||
|
62 | ||||
61 | self.createObjects() |
|
63 | self.createObjects() | |
62 | self.connectObjects() |
|
64 | self.connectObjects() | |
63 | Project.run(self) |
|
65 | Project.run(self) | |
64 |
|
66 | |||
65 | def isRunning(self): |
|
67 | def isRunning(self): | |
66 |
|
68 | |||
67 | return self.is_alive() |
|
69 | return self.is_alive() | |
68 |
|
70 | |||
69 | def isFinished(self): |
|
71 | def isFinished(self): | |
70 |
|
72 | |||
71 | return not self.is_alive() |
|
73 | return not self.is_alive() | |
72 |
|
74 | |||
73 | # from PyQt4 import QtCore |
|
75 | # from PyQt4 import QtCore | |
74 | # from PyQt4.QtCore import SIGNAL |
|
76 | # from PyQt4.QtCore import SIGNAL | |
75 | # |
|
77 | # | |
76 | # class ControllerQThread(QtCore.QThread, Project): |
|
78 | # class ControllerQThread(QtCore.QThread, Project): | |
77 | # |
|
79 | # | |
78 | # def __init__(self, filename): |
|
80 | # def __init__(self, filename): | |
79 | # |
|
81 | # | |
80 | # QtCore.QThread.__init__(self) |
|
82 | # QtCore.QThread.__init__(self) | |
81 | # Project.__init__(self) |
|
83 | # Project.__init__(self) | |
82 | # |
|
84 | # | |
83 | # self.filename = filename |
|
85 | # self.filename = filename | |
84 | # |
|
86 | # | |
85 | # self.lock = threading.Lock() |
|
87 | # self.lock = threading.Lock() | |
86 | # self.control = {'stop':False, 'pause':False} |
|
88 | # self.control = {'stop':False, 'pause':False} | |
87 | # |
|
89 | # | |
88 | # def __del__(self): |
|
90 | # def __del__(self): | |
89 | # |
|
91 | # | |
90 | # self.control['stop'] = True |
|
92 | # self.control['stop'] = True | |
91 | # self.wait() |
|
93 | # self.wait() | |
92 | # |
|
94 | # | |
93 | # def stop(self): |
|
95 | # def stop(self): | |
94 | # |
|
96 | # | |
95 | # self.lock.acquire() |
|
97 | # self.lock.acquire() | |
96 | # |
|
98 | # | |
97 | # self.control['stop'] = True |
|
99 | # self.control['stop'] = True | |
98 | # |
|
100 | # | |
99 | # self.lock.release() |
|
101 | # self.lock.release() | |
100 | # |
|
102 | # | |
101 | # def pause(self): |
|
103 | # def pause(self): | |
102 | # |
|
104 | # | |
103 | # self.lock.acquire() |
|
105 | # self.lock.acquire() | |
104 | # |
|
106 | # | |
105 | # self.control['pause'] = not(self.control['pause']) |
|
107 | # self.control['pause'] = not(self.control['pause']) | |
106 | # paused = self.control['pause'] |
|
108 | # paused = self.control['pause'] | |
107 | # |
|
109 | # | |
108 | # self.lock.release() |
|
110 | # self.lock.release() | |
109 | # |
|
111 | # | |
110 | # return paused |
|
112 | # return paused | |
111 | # |
|
113 | # | |
112 | # def isPaused(self): |
|
114 | # def isPaused(self): | |
113 | # |
|
115 | # | |
114 | # self.lock.acquire() |
|
116 | # self.lock.acquire() | |
115 | # paused = self.control['pause'] |
|
117 | # paused = self.control['pause'] | |
116 | # self.lock.release() |
|
118 | # self.lock.release() | |
117 | # |
|
119 | # | |
118 | # return paused |
|
120 | # return paused | |
119 | # |
|
121 | # | |
120 | # def isStopped(self): |
|
122 | # def isStopped(self): | |
121 | # |
|
123 | # | |
122 | # self.lock.acquire() |
|
124 | # self.lock.acquire() | |
123 | # stopped = self.control['stop'] |
|
125 | # stopped = self.control['stop'] | |
124 | # self.lock.release() |
|
126 | # self.lock.release() | |
125 | # |
|
127 | # | |
126 | # return stopped |
|
128 | # return stopped | |
127 | # |
|
129 | # | |
128 | # def run(self): |
|
130 | # def run(self): | |
129 | # |
|
131 | # | |
130 | # self.control['stop'] = False |
|
132 | # self.control['stop'] = False | |
131 | # self.control['pause'] = False |
|
133 | # self.control['pause'] = False | |
132 | # |
|
134 | # | |
133 | # self.readXml(self.filename) |
|
135 | # self.readXml(self.filename) | |
134 | # self.createObjects() |
|
136 | # self.createObjects() | |
135 | # self.connectObjects() |
|
137 | # self.connectObjects() | |
136 | # self.emit( SIGNAL( "jobStarted( PyQt_PyObject )" ), 1) |
|
138 | # self.emit( SIGNAL( "jobStarted( PyQt_PyObject )" ), 1) | |
137 | # Project.run(self) |
|
139 | # Project.run(self) | |
138 | # self.emit( SIGNAL( "jobFinished( PyQt_PyObject )" ), 1) |
|
140 | # self.emit( SIGNAL( "jobFinished( PyQt_PyObject )" ), 1) | |
139 | # No newline at end of file |
|
141 | # |
@@ -1,5865 +1,5867 | |||||
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 | ||||
|
7 | #+++++++++++++GUI V2++++++++++++++# | |||
|
8 | @author Miguel Urco | |||
6 | """ |
|
9 | """ | |
7 |
import os, sys |
|
10 | import os, sys | |
8 | import datetime |
|
11 | import datetime | |
9 | import numpy |
|
12 | import numpy | |
10 |
import |
|
13 | import ast | |
|
14 | ||||
|
15 | from Queue import Queue | |||
11 |
|
16 | |||
12 | from collections import OrderedDict |
|
17 | from collections import OrderedDict | |
13 | from os.path import expanduser |
|
18 | from os.path import expanduser | |
14 | from time import sleep |
|
19 | from time import sleep | |
15 | # from gevent import sleep |
|
|||
16 |
|
||||
17 | import ast |
|
|||
18 |
|
20 | |||
19 | from PyQt4.QtGui import QMainWindow |
|
21 | from PyQt4.QtGui import QMainWindow | |
20 | from PyQt4.QtCore import pyqtSignature |
|
22 | from PyQt4.QtCore import pyqtSignature | |
21 | from PyQt4.QtCore import pyqtSignal |
|
23 | from PyQt4.QtCore import pyqtSignal | |
22 | from PyQt4 import QtCore |
|
24 | from PyQt4 import QtCore | |
23 | from PyQt4 import QtGui |
|
25 | from PyQt4 import QtGui | |
24 | # from PyQt4.QtCore import QThread |
|
26 | # from PyQt4.QtCore import QThread | |
25 | # from PyQt4.QtCore import QObject, SIGNAL |
|
27 | # from PyQt4.QtCore import QObject, SIGNAL | |
26 |
|
28 | |||
27 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
29 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess | |
28 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
30 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp | |
29 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
31 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow | |
30 | from schainpy.controller_api import ControllerThread |
|
32 | from schainpy.controller_api import ControllerThread | |
31 | from schainpy.controller import Project |
|
33 | from schainpy.controller import Project | |
32 |
|
34 | |||
33 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
35 | from propertiesViewModel import TreeModel, PropertyBuffer | |
34 | from parametersModel import ProjectParms |
|
36 | from parametersModel import ProjectParms | |
35 |
|
37 | |||
36 | from schainpy.gui.figures import tools |
|
38 | from schainpy.gui.figures import tools | |
37 |
|
39 | |||
38 | FIGURES_PATH = tools.get_path() |
|
40 | FIGURES_PATH = tools.get_path() | |
39 | TEMPORAL_FILE = ".temp.xml" |
|
41 | TEMPORAL_FILE = ".temp.xml" | |
40 |
|
42 | |||
41 | def isRadarFile(file): |
|
43 | def isRadarFile(file): | |
42 | try: |
|
44 | try: | |
43 | year = int(file[1:5]) |
|
45 | year = int(file[1:5]) | |
44 | doy = int(file[5:8]) |
|
46 | doy = int(file[5:8]) | |
45 | set = int(file[8:11]) |
|
47 | set = int(file[8:11]) | |
46 | except: |
|
48 | except: | |
47 | return 0 |
|
49 | return 0 | |
48 |
|
50 | |||
49 | return 1 |
|
51 | return 1 | |
50 |
|
52 | |||
51 | def isRadarPath(path): |
|
53 | def isRadarPath(path): | |
52 | try: |
|
54 | try: | |
53 | year = int(path[1:5]) |
|
55 | year = int(path[1:5]) | |
54 | doy = int(path[5:8]) |
|
56 | doy = int(path[5:8]) | |
55 | except: |
|
57 | except: | |
56 | return 0 |
|
58 | return 0 | |
57 |
|
59 | |||
58 | return 1 |
|
60 | return 1 | |
59 |
|
61 | |||
60 | def isInt(value): |
|
62 | def isInt(value): | |
61 |
|
63 | |||
62 | try: |
|
64 | try: | |
63 | int(value) |
|
65 | int(value) | |
64 | except: |
|
66 | except: | |
65 | return 0 |
|
67 | return 0 | |
66 |
|
68 | |||
67 | return 1 |
|
69 | return 1 | |
68 |
|
70 | |||
69 | def isFloat(value): |
|
71 | def isFloat(value): | |
70 |
|
72 | |||
71 | try: |
|
73 | try: | |
72 | float(value) |
|
74 | float(value) | |
73 | except: |
|
75 | except: | |
74 | return 0 |
|
76 | return 0 | |
75 |
|
77 | |||
76 | return 1 |
|
78 | return 1 | |
77 |
|
79 | |||
78 | def isList(value): |
|
80 | def isList(value): | |
79 |
|
81 | |||
80 | x = ast.literal_eval(value) |
|
82 | x = ast.literal_eval(value) | |
81 |
|
83 | |||
82 | if type(x) in (tuple, list): |
|
84 | if type(x) in (tuple, list): | |
83 | return 1 |
|
85 | return 1 | |
84 |
|
86 | |||
85 | return 0 |
|
87 | return 0 | |
86 |
|
88 | |||
87 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
89 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
88 | """ |
|
90 | """ | |
89 | """ |
|
91 | """ | |
90 | def __init__(self, parent=None): |
|
92 | def __init__(self, parent=None): | |
91 | """ |
|
93 | """ | |
92 |
|
94 | |||
93 | """ |
|
95 | """ | |
94 | QMainWindow.__init__(self, parent) |
|
96 | QMainWindow.__init__(self, parent) | |
95 | self.setupUi(self) |
|
97 | self.setupUi(self) | |
96 | self.__puObjDict = {} |
|
98 | self.__puObjDict = {} | |
97 | self.__itemTreeDict = {} |
|
99 | self.__itemTreeDict = {} | |
98 | self.readUnitConfObjList = [] |
|
100 | self.readUnitConfObjList = [] | |
99 | self.operObjList = [] |
|
101 | self.operObjList = [] | |
100 | self.projecObjView = None |
|
102 | self.projecObjView = None | |
101 | self.idProject = 0 |
|
103 | self.idProject = 0 | |
102 | # self.idImag = 0 |
|
104 | # self.idImag = 0 | |
103 |
|
105 | |||
104 | self.idImagscope = 0 |
|
106 | self.idImagscope = 0 | |
105 | self.idImagspectra = 0 |
|
107 | self.idImagspectra = 0 | |
106 | self.idImagcross = 0 |
|
108 | self.idImagcross = 0 | |
107 | self.idImagrti = 0 |
|
109 | self.idImagrti = 0 | |
108 | self.idImagcoherence = 0 |
|
110 | self.idImagcoherence = 0 | |
109 | self.idImagpower = 0 |
|
111 | self.idImagpower = 0 | |
110 | self.idImagrtinoise = 0 |
|
112 | self.idImagrtinoise = 0 | |
111 | self.idImagspectraHeis = 0 |
|
113 | self.idImagspectraHeis = 0 | |
112 | self.idImagrtiHeis = 0 |
|
114 | self.idImagrtiHeis = 0 | |
113 |
|
115 | |||
114 | self.dataPath = None |
|
116 | self.dataPath = None | |
115 | self.online = 0 |
|
117 | self.online = 0 | |
116 | self.walk = 0 |
|
118 | self.walk = 0 | |
117 | self.create = False |
|
119 | self.create = False | |
118 | self.selectedItemTree = None |
|
120 | self.selectedItemTree = None | |
119 | self.controllerThread = None |
|
121 | self.controllerThread = None | |
120 | # self.commCtrlPThread = None |
|
122 | # self.commCtrlPThread = None | |
121 | # self.create_figure() |
|
123 | # self.create_figure() | |
122 | self.temporalFTP = ftpBuffer() |
|
124 | self.temporalFTP = ftpBuffer() | |
123 | self.projectProperCaracteristica = [] |
|
125 | self.projectProperCaracteristica = [] | |
124 | self.projectProperPrincipal = [] |
|
126 | self.projectProperPrincipal = [] | |
125 | self.projectProperDescripcion = [] |
|
127 | self.projectProperDescripcion = [] | |
126 | self.volProperCaracteristica = [] |
|
128 | self.volProperCaracteristica = [] | |
127 | self.volProperPrincipal = [] |
|
129 | self.volProperPrincipal = [] | |
128 | self.volProperDescripcion = [] |
|
130 | self.volProperDescripcion = [] | |
129 | self.specProperCaracteristica = [] |
|
131 | self.specProperCaracteristica = [] | |
130 | self.specProperPrincipal = [] |
|
132 | self.specProperPrincipal = [] | |
131 | self.specProperDescripcion = [] |
|
133 | self.specProperDescripcion = [] | |
132 |
|
134 | |||
133 | self.specHeisProperCaracteristica = [] |
|
135 | self.specHeisProperCaracteristica = [] | |
134 | self.specHeisProperPrincipal = [] |
|
136 | self.specHeisProperPrincipal = [] | |
135 | self.specHeisProperDescripcion = [] |
|
137 | self.specHeisProperDescripcion = [] | |
136 |
|
138 | |||
137 | # self.pathWorkSpace = './' |
|
139 | # self.pathWorkSpace = './' | |
138 |
|
140 | |||
139 | self.__projectObjDict = {} |
|
141 | self.__projectObjDict = {} | |
140 | self.__operationObjDict = {} |
|
142 | self.__operationObjDict = {} | |
141 |
|
143 | |||
142 | self.__puLocalFolder2FTP = {} |
|
144 | self.__puLocalFolder2FTP = {} | |
143 | self.threadStarted = False |
|
145 | self.threadStarted = False | |
144 |
|
146 | |||
145 | # self.create_comm() |
|
147 | # self.create_comm() | |
146 | self.create_updating_timer() |
|
148 | self.create_updating_timer() | |
147 | self.setGUIStatus() |
|
149 | self.setGUIStatus() | |
148 |
|
150 | |||
149 | @pyqtSignature("") |
|
151 | @pyqtSignature("") | |
150 | def on_actionOpen_triggered(self): |
|
152 | def on_actionOpen_triggered(self): | |
151 | """ |
|
153 | """ | |
152 | Slot documentation goes here. |
|
154 | Slot documentation goes here. | |
153 | """ |
|
155 | """ | |
154 | self.openProject() |
|
156 | self.openProject() | |
155 |
|
157 | |||
156 | @pyqtSignature("") |
|
158 | @pyqtSignature("") | |
157 | def on_actionCreate_triggered(self): |
|
159 | def on_actionCreate_triggered(self): | |
158 | """ |
|
160 | """ | |
159 | Slot documentation goes here. |
|
161 | Slot documentation goes here. | |
160 | """ |
|
162 | """ | |
161 | self.setInputsProject_View() |
|
163 | self.setInputsProject_View() | |
162 | self.create = True |
|
164 | self.create = True | |
163 |
|
165 | |||
164 | @pyqtSignature("") |
|
166 | @pyqtSignature("") | |
165 | def on_actionSave_triggered(self): |
|
167 | def on_actionSave_triggered(self): | |
166 | """ |
|
168 | """ | |
167 | Slot documentation goes here. |
|
169 | Slot documentation goes here. | |
168 | """ |
|
170 | """ | |
169 | self.saveProject() |
|
171 | self.saveProject() | |
170 |
|
172 | |||
171 | @pyqtSignature("") |
|
173 | @pyqtSignature("") | |
172 | def on_actionClose_triggered(self): |
|
174 | def on_actionClose_triggered(self): | |
173 | """ |
|
175 | """ | |
174 | Slot documentation goes here. |
|
176 | Slot documentation goes here. | |
175 | """ |
|
177 | """ | |
176 | self.close() |
|
178 | self.close() | |
177 |
|
179 | |||
178 | @pyqtSignature("") |
|
180 | @pyqtSignature("") | |
179 | def on_actionStart_triggered(self): |
|
181 | def on_actionStart_triggered(self): | |
180 | """ |
|
182 | """ | |
181 | """ |
|
183 | """ | |
182 | self.playProject() |
|
184 | self.playProject() | |
183 |
|
185 | |||
184 | @pyqtSignature("") |
|
186 | @pyqtSignature("") | |
185 | def on_actionPause_triggered(self): |
|
187 | def on_actionPause_triggered(self): | |
186 | """ |
|
188 | """ | |
187 | """ |
|
189 | """ | |
188 | self.pauseProject() |
|
190 | self.pauseProject() | |
189 |
|
191 | |||
190 | @pyqtSignature("") |
|
192 | @pyqtSignature("") | |
191 | def on_actionStop_triggered(self): |
|
193 | def on_actionStop_triggered(self): | |
192 | """ |
|
194 | """ | |
193 | """ |
|
195 | """ | |
194 | self.stopProject() |
|
196 | self.stopProject() | |
195 |
|
197 | |||
196 | @pyqtSignature("") |
|
198 | @pyqtSignature("") | |
197 | def on_actionAbout_triggered(self): |
|
199 | def on_actionAbout_triggered(self): | |
198 | """ |
|
200 | """ | |
199 | """ |
|
201 | """ | |
200 | self.aboutEvent() |
|
202 | self.aboutEvent() | |
201 |
|
203 | |||
202 | @pyqtSignature("") |
|
204 | @pyqtSignature("") | |
203 | def on_actionFTP_triggered(self): |
|
205 | def on_actionFTP_triggered(self): | |
204 | """ |
|
206 | """ | |
205 | """ |
|
207 | """ | |
206 | self.configFTPWindowObj = Ftp(self) |
|
208 | self.configFTPWindowObj = Ftp(self) | |
207 |
|
209 | |||
208 | if not self.temporalFTP.create: |
|
210 | if not self.temporalFTP.create: | |
209 | self.temporalFTP.setwithoutconfiguration() |
|
211 | self.temporalFTP.setwithoutconfiguration() | |
210 |
|
212 | |||
211 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, |
|
213 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |
212 | self.temporalFTP.remotefolder, |
|
214 | self.temporalFTP.remotefolder, | |
213 | self.temporalFTP.username, |
|
215 | self.temporalFTP.username, | |
214 | self.temporalFTP.password, |
|
216 | self.temporalFTP.password, | |
215 | self.temporalFTP.ftp_wei, |
|
217 | self.temporalFTP.ftp_wei, | |
216 | self.temporalFTP.exp_code, |
|
218 | self.temporalFTP.exp_code, | |
217 | self.temporalFTP.sub_exp_code, |
|
219 | self.temporalFTP.sub_exp_code, | |
218 | self.temporalFTP.plot_pos) |
|
220 | self.temporalFTP.plot_pos) | |
219 |
|
221 | |||
220 | self.configFTPWindowObj.show() |
|
222 | self.configFTPWindowObj.show() | |
221 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
223 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
222 |
|
224 | |||
223 | def createFTPConfig(self): |
|
225 | def createFTPConfig(self): | |
224 |
|
226 | |||
225 | if not self.configFTPWindowObj.create: |
|
227 | if not self.configFTPWindowObj.create: | |
226 | self.console.clear() |
|
228 | self.console.clear() | |
227 | self.console.append("There is no FTP configuration") |
|
229 | self.console.append("There is no FTP configuration") | |
228 | return |
|
230 | return | |
229 |
|
231 | |||
230 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
232 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
231 |
|
233 | |||
232 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
234 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
233 | self.temporalFTP.save(server=server, |
|
235 | self.temporalFTP.save(server=server, | |
234 | remotefolder=remotefolder, |
|
236 | remotefolder=remotefolder, | |
235 | username=username, |
|
237 | username=username, | |
236 | password=password, |
|
238 | password=password, | |
237 | ftp_wei=ftp_wei, |
|
239 | ftp_wei=ftp_wei, | |
238 | exp_code=exp_code, |
|
240 | exp_code=exp_code, | |
239 | sub_exp_code=sub_exp_code, |
|
241 | sub_exp_code=sub_exp_code, | |
240 | plot_pos=plot_pos) |
|
242 | plot_pos=plot_pos) | |
241 |
|
243 | |||
242 | @pyqtSignature("") |
|
244 | @pyqtSignature("") | |
243 | def on_actionOpenToolbar_triggered(self): |
|
245 | def on_actionOpenToolbar_triggered(self): | |
244 | """ |
|
246 | """ | |
245 | Slot documentation goes here. |
|
247 | Slot documentation goes here. | |
246 | """ |
|
248 | """ | |
247 | self.openProject() |
|
249 | self.openProject() | |
248 |
|
250 | |||
249 | @pyqtSignature("") |
|
251 | @pyqtSignature("") | |
250 | def on_actionCreateToolbar_triggered(self): |
|
252 | def on_actionCreateToolbar_triggered(self): | |
251 | """ |
|
253 | """ | |
252 | Slot documentation goes here. |
|
254 | Slot documentation goes here. | |
253 | """ |
|
255 | """ | |
254 | self.setInputsProject_View() |
|
256 | self.setInputsProject_View() | |
255 | self.create = True |
|
257 | self.create = True | |
256 |
|
258 | |||
257 | @pyqtSignature("") |
|
259 | @pyqtSignature("") | |
258 | def on_actionAddPU_triggered(self): |
|
260 | def on_actionAddPU_triggered(self): | |
259 |
|
261 | |||
260 | if len(self.__projectObjDict) == 0: |
|
262 | if len(self.__projectObjDict) == 0: | |
261 | outputstr = "First create a Project before add any Processing Unit" |
|
263 | outputstr = "First create a Project before add any Processing Unit" | |
262 | self.console.clear() |
|
264 | self.console.clear() | |
263 | self.console.append(outputstr) |
|
265 | self.console.append(outputstr) | |
264 | return |
|
266 | return | |
265 | else: |
|
267 | else: | |
266 | self.addPUWindow() |
|
268 | self.addPUWindow() | |
267 | self.console.clear() |
|
269 | self.console.clear() | |
268 | self.console.append("Please, Choose the type of Processing Unit") |
|
270 | self.console.append("Please, Choose the type of Processing Unit") | |
269 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
271 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
270 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
272 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
271 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
273 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
272 |
|
274 | |||
273 |
|
275 | |||
274 | @pyqtSignature("") |
|
276 | @pyqtSignature("") | |
275 | def on_actionSaveToolbar_triggered(self): |
|
277 | def on_actionSaveToolbar_triggered(self): | |
276 | """ |
|
278 | """ | |
277 | Slot documentation goes here. |
|
279 | Slot documentation goes here. | |
278 | """ |
|
280 | """ | |
279 | self.saveProject() |
|
281 | self.saveProject() | |
280 |
|
282 | |||
281 | @pyqtSignature("") |
|
283 | @pyqtSignature("") | |
282 | def on_actionStarToolbar_triggered(self): |
|
284 | def on_actionStarToolbar_triggered(self): | |
283 | """ |
|
285 | """ | |
284 | Slot documentation goes here. |
|
286 | Slot documentation goes here. | |
285 | """ |
|
287 | """ | |
286 | self.playProject() |
|
288 | self.playProject() | |
287 |
|
289 | |||
288 | @pyqtSignature("") |
|
290 | @pyqtSignature("") | |
289 | def on_actionPauseToolbar_triggered(self): |
|
291 | def on_actionPauseToolbar_triggered(self): | |
290 |
|
292 | |||
291 | self.pauseProject() |
|
293 | self.pauseProject() | |
292 |
|
294 | |||
293 | @pyqtSignature("") |
|
295 | @pyqtSignature("") | |
294 | def on_actionStopToolbar_triggered(self): |
|
296 | def on_actionStopToolbar_triggered(self): | |
295 | """ |
|
297 | """ | |
296 | Slot documentation goes here. |
|
298 | Slot documentation goes here. | |
297 | """ |
|
299 | """ | |
298 | self.stopProject() |
|
300 | self.stopProject() | |
299 |
|
301 | |||
300 | @pyqtSignature("int") |
|
302 | @pyqtSignature("int") | |
301 | def on_proComReadMode_activated(self, index): |
|
303 | def on_proComReadMode_activated(self, index): | |
302 | """ |
|
304 | """ | |
303 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
305 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
304 | """ |
|
306 | """ | |
305 | if index == 0: |
|
307 | if index == 0: | |
306 | self.online = 0 |
|
308 | self.online = 0 | |
307 | self.proDelay.setText("0") |
|
309 | self.proDelay.setText("0") | |
308 | self.proSet.setText("") |
|
310 | self.proSet.setText("") | |
309 | self.proSet.setEnabled(False) |
|
311 | self.proSet.setEnabled(False) | |
310 | self.proDelay.setEnabled(False) |
|
312 | self.proDelay.setEnabled(False) | |
311 | elif index == 1: |
|
313 | elif index == 1: | |
312 | self.online = 1 |
|
314 | self.online = 1 | |
313 | self.proSet.setText("") |
|
315 | self.proSet.setText("") | |
314 | self.proDelay.setText("5") |
|
316 | self.proDelay.setText("5") | |
315 | self.proSet.setEnabled(True) |
|
317 | self.proSet.setEnabled(True) | |
316 | self.proDelay.setEnabled(True) |
|
318 | self.proDelay.setEnabled(True) | |
317 |
|
319 | |||
318 | @pyqtSignature("int") |
|
320 | @pyqtSignature("int") | |
319 | def on_proComDataType_activated(self, index): |
|
321 | def on_proComDataType_activated(self, index): | |
320 | """ |
|
322 | """ | |
321 | Voltage or Spectra |
|
323 | Voltage or Spectra | |
322 | """ |
|
324 | """ | |
323 | self.labelSet.show() |
|
325 | self.labelSet.show() | |
324 | self.proSet.show() |
|
326 | self.proSet.show() | |
325 |
|
327 | |||
326 | self.labExpLabel.show() |
|
328 | self.labExpLabel.show() | |
327 | self.proExpLabel.show() |
|
329 | self.proExpLabel.show() | |
328 |
|
330 | |||
329 | self.labelIPPKm.hide() |
|
331 | self.labelIPPKm.hide() | |
330 | self.proIPPKm.hide() |
|
332 | self.proIPPKm.hide() | |
331 |
|
333 | |||
332 | if index == 0: |
|
334 | if index == 0: | |
333 | extension = '.r' |
|
335 | extension = '.r' | |
334 | elif index == 1: |
|
336 | elif index == 1: | |
335 | extension = '.pdata' |
|
337 | extension = '.pdata' | |
336 | elif index == 2: |
|
338 | elif index == 2: | |
337 | extension = '.fits' |
|
339 | extension = '.fits' | |
338 | elif index == 3: |
|
340 | elif index == 3: | |
339 | extension = '.hdf5' |
|
341 | extension = '.hdf5' | |
340 |
|
342 | |||
341 | self.labelIPPKm.show() |
|
343 | self.labelIPPKm.show() | |
342 | self.proIPPKm.show() |
|
344 | self.proIPPKm.show() | |
343 |
|
345 | |||
344 | self.labelSet.hide() |
|
346 | self.labelSet.hide() | |
345 | self.proSet.hide() |
|
347 | self.proSet.hide() | |
346 |
|
348 | |||
347 | self.labExpLabel.hide() |
|
349 | self.labExpLabel.hide() | |
348 | self.proExpLabel.hide() |
|
350 | self.proExpLabel.hide() | |
349 |
|
351 | |||
350 | self.proDataType.setText(extension) |
|
352 | self.proDataType.setText(extension) | |
351 |
|
353 | |||
352 | @pyqtSignature("int") |
|
354 | @pyqtSignature("int") | |
353 | def on_proComWalk_activated(self, index): |
|
355 | def on_proComWalk_activated(self, index): | |
354 | """ |
|
356 | """ | |
355 |
|
357 | |||
356 | """ |
|
358 | """ | |
357 | if index == 0: |
|
359 | if index == 0: | |
358 | self.walk = 0 |
|
360 | self.walk = 0 | |
359 | elif index == 1: |
|
361 | elif index == 1: | |
360 | self.walk = 1 |
|
362 | self.walk = 1 | |
361 |
|
363 | |||
362 | @pyqtSignature("") |
|
364 | @pyqtSignature("") | |
363 | def on_proToolPath_clicked(self): |
|
365 | def on_proToolPath_clicked(self): | |
364 | """ |
|
366 | """ | |
365 | Choose your path |
|
367 | Choose your path | |
366 | """ |
|
368 | """ | |
367 |
|
369 | |||
368 | current_dpath = './' |
|
370 | current_dpath = './' | |
369 | if self.dataPath: |
|
371 | if self.dataPath: | |
370 | current_dpath = self.dataPath |
|
372 | current_dpath = self.dataPath | |
371 |
|
373 | |||
372 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
374 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
373 |
|
375 | |||
374 | #If it was canceled |
|
376 | #If it was canceled | |
375 | if not datapath: |
|
377 | if not datapath: | |
376 | return |
|
378 | return | |
377 |
|
379 | |||
378 | #If any change was done |
|
380 | #If any change was done | |
379 | if datapath == self.dataPath: |
|
381 | if datapath == self.dataPath: | |
380 | return |
|
382 | return | |
381 |
|
383 | |||
382 | self.proDataPath.setText(datapath) |
|
384 | self.proDataPath.setText(datapath) | |
383 |
|
385 | |||
384 | self._disable_play_button() |
|
386 | self._disable_play_button() | |
385 | self._disable_save_button() |
|
387 | self._disable_save_button() | |
386 | self.proOk.setEnabled(False) |
|
388 | self.proOk.setEnabled(False) | |
387 |
|
389 | |||
388 | self.proComStartDate.clear() |
|
390 | self.proComStartDate.clear() | |
389 | self.proComEndDate.clear() |
|
391 | self.proComEndDate.clear() | |
390 |
|
392 | |||
391 | if not os.path.exists(datapath): |
|
393 | if not os.path.exists(datapath): | |
392 |
|
394 | |||
393 | self.console.clear() |
|
395 | self.console.clear() | |
394 | self.console.append("Write a valid path") |
|
396 | self.console.append("Write a valid path") | |
395 | return |
|
397 | return | |
396 |
|
398 | |||
397 | self.dataPath = datapath |
|
399 | self.dataPath = datapath | |
398 |
|
400 | |||
399 | self.console.clear() |
|
401 | self.console.clear() | |
400 | self.console.append("Select the read mode and press 'load button'") |
|
402 | self.console.append("Select the read mode and press 'load button'") | |
401 |
|
403 | |||
402 |
|
404 | |||
403 | @pyqtSignature("") |
|
405 | @pyqtSignature("") | |
404 | def on_proLoadButton_clicked(self): |
|
406 | def on_proLoadButton_clicked(self): | |
405 |
|
407 | |||
406 | self.console.clear() |
|
408 | self.console.clear() | |
407 |
|
409 | |||
408 | parameter_list = self.checkInputsProject() |
|
410 | parameter_list = self.checkInputsProject() | |
409 |
|
411 | |||
410 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list |
|
412 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list | |
411 |
|
413 | |||
412 | if read_mode == "Offline": |
|
414 | if read_mode == "Offline": | |
413 | self.proComStartDate.clear() |
|
415 | self.proComStartDate.clear() | |
414 | self.proComEndDate.clear() |
|
416 | self.proComEndDate.clear() | |
415 | self.proComStartDate.setEnabled(True) |
|
417 | self.proComStartDate.setEnabled(True) | |
416 | self.proComEndDate.setEnabled(True) |
|
418 | self.proComEndDate.setEnabled(True) | |
417 | self.proStartTime.setEnabled(True) |
|
419 | self.proStartTime.setEnabled(True) | |
418 | self.proEndTime.setEnabled(True) |
|
420 | self.proEndTime.setEnabled(True) | |
419 | self.frame_2.setEnabled(True) |
|
421 | self.frame_2.setEnabled(True) | |
420 |
|
422 | |||
421 | if read_mode == "Online": |
|
423 | if read_mode == "Online": | |
422 | self.proComStartDate.addItem("1960/01/30") |
|
424 | self.proComStartDate.addItem("1960/01/30") | |
423 | self.proComEndDate.addItem("2018/12/31") |
|
425 | self.proComEndDate.addItem("2018/12/31") | |
424 | self.proComStartDate.setEnabled(False) |
|
426 | self.proComStartDate.setEnabled(False) | |
425 | self.proComEndDate.setEnabled(False) |
|
427 | self.proComEndDate.setEnabled(False) | |
426 | self.proStartTime.setEnabled(False) |
|
428 | self.proStartTime.setEnabled(False) | |
427 | self.proEndTime.setEnabled(False) |
|
429 | self.proEndTime.setEnabled(False) | |
428 | self.frame_2.setEnabled(True) |
|
430 | self.frame_2.setEnabled(True) | |
429 |
|
431 | |||
430 | if self.loadDays(data_path, ext, walk, expLabel) == []: |
|
432 | if self.loadDays(data_path, ext, walk, expLabel) == []: | |
431 | self._disable_save_button() |
|
433 | self._disable_save_button() | |
432 | self._disable_play_button() |
|
434 | self._disable_play_button() | |
433 | self.proOk.setEnabled(False) |
|
435 | self.proOk.setEnabled(False) | |
434 | else: |
|
436 | else: | |
435 | self._enable_save_button() |
|
437 | self._enable_save_button() | |
436 | self._enable_play_button() |
|
438 | self._enable_play_button() | |
437 | self.proOk.setEnabled(True) |
|
439 | self.proOk.setEnabled(True) | |
438 |
|
440 | |||
439 | @pyqtSignature("int") |
|
441 | @pyqtSignature("int") | |
440 | def on_proComStartDate_activated(self, index): |
|
442 | def on_proComStartDate_activated(self, index): | |
441 | """ |
|
443 | """ | |
442 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
444 | SELECCION DEL RANGO DE FECHAS -START DATE | |
443 | """ |
|
445 | """ | |
444 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
446 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
445 |
|
447 | |||
446 | self.proComEndDate.clear() |
|
448 | self.proComEndDate.clear() | |
447 | for i in self.dateList[index:]: |
|
449 | for i in self.dateList[index:]: | |
448 | self.proComEndDate.addItem(i) |
|
450 | self.proComEndDate.addItem(i) | |
449 |
|
451 | |||
450 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
452 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
451 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
453 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
452 | else: |
|
454 | else: | |
453 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
455 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
454 |
|
456 | |||
455 | @pyqtSignature("int") |
|
457 | @pyqtSignature("int") | |
456 | def on_proComEndDate_activated(self, index): |
|
458 | def on_proComEndDate_activated(self, index): | |
457 | """ |
|
459 | """ | |
458 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
460 | SELECCION DEL RANGO DE FECHAS-END DATE | |
459 | """ |
|
461 | """ | |
460 | pass |
|
462 | pass | |
461 |
|
463 | |||
462 | @pyqtSignature("") |
|
464 | @pyqtSignature("") | |
463 | def on_proOk_clicked(self): |
|
465 | def on_proOk_clicked(self): | |
464 | """ |
|
466 | """ | |
465 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
467 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
466 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
468 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
467 | """ |
|
469 | """ | |
468 |
|
470 | |||
469 | self._disable_play_button() |
|
471 | self._disable_play_button() | |
470 | self._disable_save_button() |
|
472 | self._disable_save_button() | |
471 |
|
473 | |||
472 | self.console.clear() |
|
474 | self.console.clear() | |
473 |
|
475 | |||
474 | if self.create: |
|
476 | if self.create: | |
475 |
|
477 | |||
476 | projectId = self.__getNewProjectId() |
|
478 | projectId = self.__getNewProjectId() | |
477 |
|
479 | |||
478 | if not projectId: |
|
480 | if not projectId: | |
479 | return 0 |
|
481 | return 0 | |
480 |
|
482 | |||
481 | projectObjView = self.createProjectView(projectId) |
|
483 | projectObjView = self.createProjectView(projectId) | |
482 |
|
484 | |||
483 | if not projectObjView: |
|
485 | if not projectObjView: | |
484 | return 0 |
|
486 | return 0 | |
485 |
|
487 | |||
486 | self.create = False |
|
488 | self.create = False | |
487 |
|
489 | |||
488 | readUnitObj = self.createReadUnitView(projectObjView) |
|
490 | readUnitObj = self.createReadUnitView(projectObjView) | |
489 |
|
491 | |||
490 | if not readUnitObj: |
|
492 | if not readUnitObj: | |
491 | return 0 |
|
493 | return 0 | |
492 |
|
494 | |||
493 | else: |
|
495 | else: | |
494 | projectObjView = self.updateProjectView() |
|
496 | projectObjView = self.updateProjectView() | |
495 |
|
497 | |||
496 | if not projectObjView: |
|
498 | if not projectObjView: | |
497 | return 0 |
|
499 | return 0 | |
498 |
|
500 | |||
499 | projectId = projectObjView.getId() |
|
501 | projectId = projectObjView.getId() | |
500 | idReadUnit = projectObjView.getReadUnitId() |
|
502 | idReadUnit = projectObjView.getReadUnitId() | |
501 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
503 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
502 |
|
504 | |||
503 | if not readUnitObj: |
|
505 | if not readUnitObj: | |
504 | return 0 |
|
506 | return 0 | |
505 |
|
507 | |||
506 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
508 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
507 | # Project Properties |
|
509 | # Project Properties | |
508 | self.refreshProjectProperties(projectObjView) |
|
510 | self.refreshProjectProperties(projectObjView) | |
509 | # Disable tabProject after finish the creation |
|
511 | # Disable tabProject after finish the creation | |
510 |
|
512 | |||
511 | self._enable_play_button() |
|
513 | self._enable_play_button() | |
512 | self._enable_save_button() |
|
514 | self._enable_save_button() | |
513 |
|
515 | |||
514 | self.console.clear() |
|
516 | self.console.clear() | |
515 | self.console.append("The project parameters were validated") |
|
517 | self.console.append("The project parameters were validated") | |
516 |
|
518 | |||
517 | return 1 |
|
519 | return 1 | |
518 |
|
520 | |||
519 | @pyqtSignature("") |
|
521 | @pyqtSignature("") | |
520 | def on_proClear_clicked(self): |
|
522 | def on_proClear_clicked(self): | |
521 |
|
523 | |||
522 | self.console.clear() |
|
524 | self.console.clear() | |
523 |
|
525 | |||
524 | @pyqtSignature("int") |
|
526 | @pyqtSignature("int") | |
525 | def on_volOpCebChannels_stateChanged(self, p0): |
|
527 | def on_volOpCebChannels_stateChanged(self, p0): | |
526 | """ |
|
528 | """ | |
527 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
529 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
528 | """ |
|
530 | """ | |
529 | if p0 == 2: |
|
531 | if p0 == 2: | |
530 | self.volOpComChannels.setEnabled(True) |
|
532 | self.volOpComChannels.setEnabled(True) | |
531 | self.volOpChannel.setEnabled(True) |
|
533 | self.volOpChannel.setEnabled(True) | |
532 |
|
534 | |||
533 | if p0 == 0: |
|
535 | if p0 == 0: | |
534 | self.volOpComChannels.setEnabled(False) |
|
536 | self.volOpComChannels.setEnabled(False) | |
535 | self.volOpChannel.setEnabled(False) |
|
537 | self.volOpChannel.setEnabled(False) | |
536 | self.volOpChannel.clear() |
|
538 | self.volOpChannel.clear() | |
537 |
|
539 | |||
538 | @pyqtSignature("int") |
|
540 | @pyqtSignature("int") | |
539 | def on_volOpCebHeights_stateChanged(self, p0): |
|
541 | def on_volOpCebHeights_stateChanged(self, p0): | |
540 | """ |
|
542 | """ | |
541 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
543 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
542 | """ |
|
544 | """ | |
543 | if p0 == 2: |
|
545 | if p0 == 2: | |
544 | self.volOpHeights.setEnabled(True) |
|
546 | self.volOpHeights.setEnabled(True) | |
545 | self.volOpComHeights.setEnabled(True) |
|
547 | self.volOpComHeights.setEnabled(True) | |
546 |
|
548 | |||
547 | if p0 == 0: |
|
549 | if p0 == 0: | |
548 | self.volOpHeights.setEnabled(False) |
|
550 | self.volOpHeights.setEnabled(False) | |
549 | self.volOpHeights.clear() |
|
551 | self.volOpHeights.clear() | |
550 | self.volOpComHeights.setEnabled(False) |
|
552 | self.volOpComHeights.setEnabled(False) | |
551 |
|
553 | |||
552 | @pyqtSignature("int") |
|
554 | @pyqtSignature("int") | |
553 | def on_volOpCebFilter_stateChanged(self, p0): |
|
555 | def on_volOpCebFilter_stateChanged(self, p0): | |
554 | """ |
|
556 | """ | |
555 | Name='Decoder', optype='other' |
|
557 | Name='Decoder', optype='other' | |
556 | """ |
|
558 | """ | |
557 | if p0 == 2: |
|
559 | if p0 == 2: | |
558 | self.volOpFilter.setEnabled(True) |
|
560 | self.volOpFilter.setEnabled(True) | |
559 |
|
561 | |||
560 | if p0 == 0: |
|
562 | if p0 == 0: | |
561 | self.volOpFilter.setEnabled(False) |
|
563 | self.volOpFilter.setEnabled(False) | |
562 | self.volOpFilter.clear() |
|
564 | self.volOpFilter.clear() | |
563 |
|
565 | |||
564 | @pyqtSignature("int") |
|
566 | @pyqtSignature("int") | |
565 | def on_volOpCebProfile_stateChanged(self, p0): |
|
567 | def on_volOpCebProfile_stateChanged(self, p0): | |
566 | """ |
|
568 | """ | |
567 | Check Box habilita ingreso del rango de Perfiles |
|
569 | Check Box habilita ingreso del rango de Perfiles | |
568 | """ |
|
570 | """ | |
569 | if p0 == 2: |
|
571 | if p0 == 2: | |
570 | self.volOpComProfile.setEnabled(True) |
|
572 | self.volOpComProfile.setEnabled(True) | |
571 | self.volOpProfile.setEnabled(True) |
|
573 | self.volOpProfile.setEnabled(True) | |
572 |
|
574 | |||
573 | if p0 == 0: |
|
575 | if p0 == 0: | |
574 | self.volOpComProfile.setEnabled(False) |
|
576 | self.volOpComProfile.setEnabled(False) | |
575 | self.volOpProfile.setEnabled(False) |
|
577 | self.volOpProfile.setEnabled(False) | |
576 | self.volOpProfile.clear() |
|
578 | self.volOpProfile.clear() | |
577 |
|
579 | |||
578 | @pyqtSignature("int") |
|
580 | @pyqtSignature("int") | |
579 | def on_volOpComProfile_activated(self, index): |
|
581 | def on_volOpComProfile_activated(self, index): | |
580 | """ |
|
582 | """ | |
581 | Check Box habilita ingreso del rango de Perfiles |
|
583 | Check Box habilita ingreso del rango de Perfiles | |
582 | """ |
|
584 | """ | |
583 | #Profile List |
|
585 | #Profile List | |
584 | if index == 0: |
|
586 | if index == 0: | |
585 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
587 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
586 |
|
588 | |||
587 | #Profile Range |
|
589 | #Profile Range | |
588 | if index == 1: |
|
590 | if index == 1: | |
589 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
591 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
590 |
|
592 | |||
591 | #Profile Range List |
|
593 | #Profile Range List | |
592 | if index == 2: |
|
594 | if index == 2: | |
593 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
595 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
594 |
|
596 | |||
595 | @pyqtSignature("int") |
|
597 | @pyqtSignature("int") | |
596 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
598 | def on_volOpCebDecodification_stateChanged(self, p0): | |
597 | """ |
|
599 | """ | |
598 | Check Box habilita |
|
600 | Check Box habilita | |
599 | """ |
|
601 | """ | |
600 | if p0 == 2: |
|
602 | if p0 == 2: | |
601 | self.volOpComCode.setEnabled(True) |
|
603 | self.volOpComCode.setEnabled(True) | |
602 | self.volOpComMode.setEnabled(True) |
|
604 | self.volOpComMode.setEnabled(True) | |
603 | if p0 == 0: |
|
605 | if p0 == 0: | |
604 | self.volOpComCode.setEnabled(False) |
|
606 | self.volOpComCode.setEnabled(False) | |
605 | self.volOpComMode.setEnabled(False) |
|
607 | self.volOpComMode.setEnabled(False) | |
606 |
|
608 | |||
607 | @pyqtSignature("int") |
|
609 | @pyqtSignature("int") | |
608 | def on_volOpComCode_activated(self, index): |
|
610 | def on_volOpComCode_activated(self, index): | |
609 | """ |
|
611 | """ | |
610 | Check Box habilita ingreso |
|
612 | Check Box habilita ingreso | |
611 | """ |
|
613 | """ | |
612 | if index == 13: |
|
614 | if index == 13: | |
613 | self.volOpCode.setEnabled(True) |
|
615 | self.volOpCode.setEnabled(True) | |
614 | else: |
|
616 | else: | |
615 | self.volOpCode.setEnabled(False) |
|
617 | self.volOpCode.setEnabled(False) | |
616 |
|
618 | |||
617 | if index == 0: |
|
619 | if index == 0: | |
618 | code = '' |
|
620 | code = '' | |
619 | self.volOpCode.setText(str(code)) |
|
621 | self.volOpCode.setText(str(code)) | |
620 | return |
|
622 | return | |
621 |
|
623 | |||
622 | if index == 1: |
|
624 | if index == 1: | |
623 | code = '(1,1,-1)' |
|
625 | code = '(1,1,-1)' | |
624 | nCode = '1' |
|
626 | nCode = '1' | |
625 | nBaud = '3' |
|
627 | nBaud = '3' | |
626 | if index == 2: |
|
628 | if index == 2: | |
627 | code = '(1,1,-1,1)' |
|
629 | code = '(1,1,-1,1)' | |
628 | nCode = '1' |
|
630 | nCode = '1' | |
629 | nBaud = '4' |
|
631 | nBaud = '4' | |
630 | if index == 3: |
|
632 | if index == 3: | |
631 | code = '(1,1,1,-1,1)' |
|
633 | code = '(1,1,1,-1,1)' | |
632 | nCode = '1' |
|
634 | nCode = '1' | |
633 | nBaud = '5' |
|
635 | nBaud = '5' | |
634 | if index == 4: |
|
636 | if index == 4: | |
635 | code = '(1,1,1,-1,-1,1,-1)' |
|
637 | code = '(1,1,1,-1,-1,1,-1)' | |
636 | nCode = '1' |
|
638 | nCode = '1' | |
637 | nBaud = '7' |
|
639 | nBaud = '7' | |
638 | if index == 5: |
|
640 | if index == 5: | |
639 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
641 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
640 | nCode = '1' |
|
642 | nCode = '1' | |
641 | nBaud = '11' |
|
643 | nBaud = '11' | |
642 | if index == 6: |
|
644 | if index == 6: | |
643 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
645 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
644 | nCode = '1' |
|
646 | nCode = '1' | |
645 | nBaud = '13' |
|
647 | nBaud = '13' | |
646 | if index == 7: |
|
648 | if index == 7: | |
647 | code = '(1,1,-1,-1,-1,1)' |
|
649 | code = '(1,1,-1,-1,-1,1)' | |
648 | nCode = '2' |
|
650 | nCode = '2' | |
649 | nBaud = '3' |
|
651 | nBaud = '3' | |
650 | if index == 8: |
|
652 | if index == 8: | |
651 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
653 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
652 | nCode = '2' |
|
654 | nCode = '2' | |
653 | nBaud = '4' |
|
655 | nBaud = '4' | |
654 | if index == 9: |
|
656 | if index == 9: | |
655 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
657 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
656 | nCode = '2' |
|
658 | nCode = '2' | |
657 | nBaud = '5' |
|
659 | nBaud = '5' | |
658 | if index == 10: |
|
660 | if index == 10: | |
659 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
661 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
660 | nCode = '2' |
|
662 | nCode = '2' | |
661 | nBaud = '7' |
|
663 | nBaud = '7' | |
662 | if index == 11: |
|
664 | if index == 11: | |
663 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' |
|
665 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
664 | nCode = '2' |
|
666 | nCode = '2' | |
665 | nBaud = '11' |
|
667 | nBaud = '11' | |
666 | if index == 12: |
|
668 | if index == 12: | |
667 | 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)' |
|
669 | 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)' | |
668 | nCode = '2' |
|
670 | nCode = '2' | |
669 | nBaud = '13' |
|
671 | nBaud = '13' | |
670 |
|
672 | |||
671 | code = ast.literal_eval(code) |
|
673 | code = ast.literal_eval(code) | |
672 | nCode = int(nCode) |
|
674 | nCode = int(nCode) | |
673 | nBaud = int(nBaud) |
|
675 | nBaud = int(nBaud) | |
674 |
|
676 | |||
675 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
677 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
676 |
|
678 | |||
677 | self.volOpCode.setText(str(code)) |
|
679 | self.volOpCode.setText(str(code)) | |
678 |
|
680 | |||
679 | @pyqtSignature("int") |
|
681 | @pyqtSignature("int") | |
680 | def on_volOpCebFlip_stateChanged(self, p0): |
|
682 | def on_volOpCebFlip_stateChanged(self, p0): | |
681 | """ |
|
683 | """ | |
682 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
684 | Check Box habilita ingresode del numero de Integraciones a realizar | |
683 | """ |
|
685 | """ | |
684 | if p0 == 2: |
|
686 | if p0 == 2: | |
685 | self.volOpFlip.setEnabled(True) |
|
687 | self.volOpFlip.setEnabled(True) | |
686 | if p0 == 0: |
|
688 | if p0 == 0: | |
687 | self.volOpFlip.setEnabled(False) |
|
689 | self.volOpFlip.setEnabled(False) | |
688 | self.volOpFlip.clear() |
|
690 | self.volOpFlip.clear() | |
689 |
|
691 | |||
690 | @pyqtSignature("int") |
|
692 | @pyqtSignature("int") | |
691 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
693 | def on_volOpCebCohInt_stateChanged(self, p0): | |
692 | """ |
|
694 | """ | |
693 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
695 | Check Box habilita ingresode del numero de Integraciones a realizar | |
694 | """ |
|
696 | """ | |
695 | if p0 == 2: |
|
697 | if p0 == 2: | |
696 | self.volOpCohInt.setEnabled(True) |
|
698 | self.volOpCohInt.setEnabled(True) | |
697 | if p0 == 0: |
|
699 | if p0 == 0: | |
698 | self.volOpCohInt.setEnabled(False) |
|
700 | self.volOpCohInt.setEnabled(False) | |
699 | self.volOpCohInt.clear() |
|
701 | self.volOpCohInt.clear() | |
700 |
|
702 | |||
701 | @pyqtSignature("int") |
|
703 | @pyqtSignature("int") | |
702 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
704 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
703 | """ |
|
705 | """ | |
704 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
706 | Check Box habilita ingresode del numero de Integraciones a realizar | |
705 | """ |
|
707 | """ | |
706 | if p0 == 2: |
|
708 | if p0 == 2: | |
707 | self.volOpRadarfrequency.setEnabled(True) |
|
709 | self.volOpRadarfrequency.setEnabled(True) | |
708 | if p0 == 0: |
|
710 | if p0 == 0: | |
709 | self.volOpRadarfrequency.clear() |
|
711 | self.volOpRadarfrequency.clear() | |
710 | self.volOpRadarfrequency.setEnabled(False) |
|
712 | self.volOpRadarfrequency.setEnabled(False) | |
711 |
|
713 | |||
712 | @pyqtSignature("") |
|
714 | @pyqtSignature("") | |
713 | def on_volOutputToolPath_clicked(self): |
|
715 | def on_volOutputToolPath_clicked(self): | |
714 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
716 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
715 | self.volOutputPath.setText(dirOutPath) |
|
717 | self.volOutputPath.setText(dirOutPath) | |
716 |
|
718 | |||
717 | @pyqtSignature("") |
|
719 | @pyqtSignature("") | |
718 | def on_specOutputToolPath_clicked(self): |
|
720 | def on_specOutputToolPath_clicked(self): | |
719 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
721 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
720 | self.specOutputPath.setText(dirOutPath) |
|
722 | self.specOutputPath.setText(dirOutPath) | |
721 |
|
723 | |||
722 | @pyqtSignature("") |
|
724 | @pyqtSignature("") | |
723 | def on_specHeisOutputToolPath_clicked(self): |
|
725 | def on_specHeisOutputToolPath_clicked(self): | |
724 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
726 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
725 | self.specHeisOutputPath.setText(dirOutPath) |
|
727 | self.specHeisOutputPath.setText(dirOutPath) | |
726 |
|
728 | |||
727 | @pyqtSignature("") |
|
729 | @pyqtSignature("") | |
728 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
730 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
729 |
|
731 | |||
730 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
732 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
731 | self.specHeisOutputMetada.setText(filename) |
|
733 | self.specHeisOutputMetada.setText(filename) | |
732 |
|
734 | |||
733 | @pyqtSignature("") |
|
735 | @pyqtSignature("") | |
734 | def on_volOpOk_clicked(self): |
|
736 | def on_volOpOk_clicked(self): | |
735 | """ |
|
737 | """ | |
736 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
738 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
737 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
739 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
738 | """ |
|
740 | """ | |
739 |
|
741 | |||
740 | checkPath = False |
|
742 | checkPath = False | |
741 |
|
743 | |||
742 | self._disable_play_button() |
|
744 | self._disable_play_button() | |
743 | self._disable_save_button() |
|
745 | self._disable_save_button() | |
744 |
|
746 | |||
745 | self.console.clear() |
|
747 | self.console.clear() | |
746 | self.console.append("Checking input parameters ...") |
|
748 | self.console.append("Checking input parameters ...") | |
747 |
|
749 | |||
748 | puObj = self.getSelectedItemObj() |
|
750 | puObj = self.getSelectedItemObj() | |
749 | puObj.removeOperations() |
|
751 | puObj.removeOperations() | |
750 |
|
752 | |||
751 | if self.volOpCebRadarfrequency.isChecked(): |
|
753 | if self.volOpCebRadarfrequency.isChecked(): | |
752 | value = str(self.volOpRadarfrequency.text()) |
|
754 | value = str(self.volOpRadarfrequency.text()) | |
753 | format = 'float' |
|
755 | format = 'float' | |
754 | name_operation = 'setRadarFrequency' |
|
756 | name_operation = 'setRadarFrequency' | |
755 | name_parameter = 'frequency' |
|
757 | name_parameter = 'frequency' | |
756 | if not value == "": |
|
758 | if not value == "": | |
757 | try: |
|
759 | try: | |
758 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 |
|
760 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
759 | except: |
|
761 | except: | |
760 | self.console.clear() |
|
762 | self.console.clear() | |
761 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
763 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
762 | return 0 |
|
764 | return 0 | |
763 |
|
765 | |||
764 | opObj = puObj.addOperation(name=name_operation) |
|
766 | opObj = puObj.addOperation(name=name_operation) | |
765 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): |
|
767 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): | |
766 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
768 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
767 | return 0 |
|
769 | return 0 | |
768 |
|
770 | |||
769 | if self.volOpCebChannels.isChecked(): |
|
771 | if self.volOpCebChannels.isChecked(): | |
770 | value = str(self.volOpChannel.text()) |
|
772 | value = str(self.volOpChannel.text()) | |
771 |
|
773 | |||
772 | if value == "": |
|
774 | if value == "": | |
773 | print "Please fill channel list" |
|
775 | print "Please fill channel list" | |
774 | return 0 |
|
776 | return 0 | |
775 |
|
777 | |||
776 | format = 'intlist' |
|
778 | format = 'intlist' | |
777 | if self.volOpComChannels.currentIndex() == 0: |
|
779 | if self.volOpComChannels.currentIndex() == 0: | |
778 | name_operation = "selectChannels" |
|
780 | name_operation = "selectChannels" | |
779 | name_parameter = 'channelList' |
|
781 | name_parameter = 'channelList' | |
780 | else: |
|
782 | else: | |
781 | name_operation = "selectChannelsByIndex" |
|
783 | name_operation = "selectChannelsByIndex" | |
782 | name_parameter = 'channelIndexList' |
|
784 | name_parameter = 'channelIndexList' | |
783 |
|
785 | |||
784 | opObj = puObj.addOperation(name=name_operation) |
|
786 | opObj = puObj.addOperation(name=name_operation) | |
785 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
787 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
786 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
788 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
787 | return 0 |
|
789 | return 0 | |
788 |
|
790 | |||
789 | if self.volOpCebHeights.isChecked(): |
|
791 | if self.volOpCebHeights.isChecked(): | |
790 | value = str(self.volOpHeights.text()) |
|
792 | value = str(self.volOpHeights.text()) | |
791 |
|
793 | |||
792 | if value == "": |
|
794 | if value == "": | |
793 | print "Please fill height range" |
|
795 | print "Please fill height range" | |
794 | return 0 |
|
796 | return 0 | |
795 |
|
797 | |||
796 | valueList = value.split(',') |
|
798 | valueList = value.split(',') | |
797 |
|
799 | |||
798 | if self.volOpComHeights.currentIndex() == 0: |
|
800 | if self.volOpComHeights.currentIndex() == 0: | |
799 | format = 'float' |
|
801 | format = 'float' | |
800 | name_operation = 'selectHeights' |
|
802 | name_operation = 'selectHeights' | |
801 | name_parameter1 = 'minHei' |
|
803 | name_parameter1 = 'minHei' | |
802 | name_parameter2 = 'maxHei' |
|
804 | name_parameter2 = 'maxHei' | |
803 | else: |
|
805 | else: | |
804 | format = 'int' |
|
806 | format = 'int' | |
805 | name_operation = 'selectHeightsByIndex' |
|
807 | name_operation = 'selectHeightsByIndex' | |
806 | name_parameter1 = 'minIndex' |
|
808 | name_parameter1 = 'minIndex' | |
807 | name_parameter2 = 'maxIndex' |
|
809 | name_parameter2 = 'maxIndex' | |
808 |
|
810 | |||
809 | opObj = puObj.addOperation(name=name_operation) |
|
811 | opObj = puObj.addOperation(name=name_operation) | |
810 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
812 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
811 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
813 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
812 |
|
814 | |||
813 | if self.volOpCebFilter.isChecked(): |
|
815 | if self.volOpCebFilter.isChecked(): | |
814 | value = str(self.volOpFilter.text()) |
|
816 | value = str(self.volOpFilter.text()) | |
815 | if value == "": |
|
817 | if value == "": | |
816 | print "Please fill filter value" |
|
818 | print "Please fill filter value" | |
817 | return 0 |
|
819 | return 0 | |
818 |
|
820 | |||
819 | format = 'int' |
|
821 | format = 'int' | |
820 | name_operation = 'filterByHeights' |
|
822 | name_operation = 'filterByHeights' | |
821 | name_parameter = 'window' |
|
823 | name_parameter = 'window' | |
822 | opObj = puObj.addOperation(name=name_operation) |
|
824 | opObj = puObj.addOperation(name=name_operation) | |
823 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
825 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
824 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
826 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
825 | return 0 |
|
827 | return 0 | |
826 |
|
828 | |||
827 | if self.volOpCebProfile.isChecked(): |
|
829 | if self.volOpCebProfile.isChecked(): | |
828 | value = str(self.volOpProfile.text()) |
|
830 | value = str(self.volOpProfile.text()) | |
829 |
|
831 | |||
830 | if value == "": |
|
832 | if value == "": | |
831 | print "Please fill profile value" |
|
833 | print "Please fill profile value" | |
832 | return 0 |
|
834 | return 0 | |
833 |
|
835 | |||
834 | format = 'intlist' |
|
836 | format = 'intlist' | |
835 | optype = 'other' |
|
837 | optype = 'other' | |
836 | name_operation = 'ProfileSelector' |
|
838 | name_operation = 'ProfileSelector' | |
837 | if self.volOpComProfile.currentIndex() == 0: |
|
839 | if self.volOpComProfile.currentIndex() == 0: | |
838 | name_parameter = 'profileList' |
|
840 | name_parameter = 'profileList' | |
839 | if self.volOpComProfile.currentIndex() == 1: |
|
841 | if self.volOpComProfile.currentIndex() == 1: | |
840 | name_parameter = 'profileRangeList' |
|
842 | name_parameter = 'profileRangeList' | |
841 | if self.volOpComProfile.currentIndex() == 2: |
|
843 | if self.volOpComProfile.currentIndex() == 2: | |
842 | name_parameter = 'rangeList' |
|
844 | name_parameter = 'rangeList' | |
843 |
|
845 | |||
844 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
846 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
845 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
847 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
846 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
848 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
847 | return 0 |
|
849 | return 0 | |
848 |
|
850 | |||
849 | if self.volOpCebDecodification.isChecked(): |
|
851 | if self.volOpCebDecodification.isChecked(): | |
850 | name_operation = 'Decoder' |
|
852 | name_operation = 'Decoder' | |
851 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
853 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
852 |
|
854 | |||
853 | #User defined |
|
855 | #User defined | |
854 | nBaud = None |
|
856 | nBaud = None | |
855 | nCode = None |
|
857 | nCode = None | |
856 |
|
858 | |||
857 | code = str(self.volOpCode.text()) |
|
859 | code = str(self.volOpCode.text()) | |
858 | try: |
|
860 | try: | |
859 | code_tmp = ast.literal_eval(code) |
|
861 | code_tmp = ast.literal_eval(code) | |
860 | except: |
|
862 | except: | |
861 | code_tmp = [] |
|
863 | code_tmp = [] | |
862 |
|
864 | |||
863 | if len(code_tmp) > 0: |
|
865 | if len(code_tmp) > 0: | |
864 |
|
866 | |||
865 | if type(code_tmp) not in (tuple, list): |
|
867 | if type(code_tmp) not in (tuple, list): | |
866 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
868 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
867 | return 0 |
|
869 | return 0 | |
868 |
|
870 | |||
869 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] |
|
871 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] | |
870 | nBaud = len(code_tmp[0]) |
|
872 | nBaud = len(code_tmp[0]) | |
871 | nCode = len(code_tmp) |
|
873 | nCode = len(code_tmp) | |
872 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] |
|
874 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] | |
873 | nBaud = len(code_tmp[0]) |
|
875 | nBaud = len(code_tmp[0]) | |
874 | nCode = 1 |
|
876 | nCode = 1 | |
875 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) |
|
877 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) | |
876 | nBaud = len(code_tmp) |
|
878 | nBaud = len(code_tmp) | |
877 | nCode = 1 |
|
879 | nCode = 1 | |
878 | else: |
|
880 | else: | |
879 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
881 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
880 | return 0 |
|
882 | return 0 | |
881 |
|
883 | |||
882 | if not nBaud or not nCode: |
|
884 | if not nBaud or not nCode: | |
883 | self.console.append("Please write a right value for Code") |
|
885 | self.console.append("Please write a right value for Code") | |
884 | return 0 |
|
886 | return 0 | |
885 |
|
887 | |||
886 | code = code.replace("(", "") |
|
888 | code = code.replace("(", "") | |
887 | code = code.replace(")", "") |
|
889 | code = code.replace(")", "") | |
888 | code = code.replace("[", "") |
|
890 | code = code.replace("[", "") | |
889 | code = code.replace("]", "") |
|
891 | code = code.replace("]", "") | |
890 |
|
892 | |||
891 | if not opObj.addParameter(name='code', value=code, format='intlist'): |
|
893 | if not opObj.addParameter(name='code', value=code, format='intlist'): | |
892 | self.console.append("Please write a right value for Code") |
|
894 | self.console.append("Please write a right value for Code") | |
893 | return 0 |
|
895 | return 0 | |
894 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): |
|
896 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): | |
895 | self.console.append("Please write a right value for Code") |
|
897 | self.console.append("Please write a right value for Code") | |
896 | return 0 |
|
898 | return 0 | |
897 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): |
|
899 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): | |
898 | self.console.append("Please write a right value for Code") |
|
900 | self.console.append("Please write a right value for Code") | |
899 | return 0 |
|
901 | return 0 | |
900 |
|
902 | |||
901 | name_parameter = 'mode' |
|
903 | name_parameter = 'mode' | |
902 | format = 'int' |
|
904 | format = 'int' | |
903 |
|
905 | |||
904 | value = str(self.volOpComMode.currentIndex()) |
|
906 | value = str(self.volOpComMode.currentIndex()) | |
905 |
|
907 | |||
906 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
908 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
907 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
909 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
908 | return 0 |
|
910 | return 0 | |
909 |
|
911 | |||
910 |
|
912 | |||
911 | if self.volOpCebFlip.isChecked(): |
|
913 | if self.volOpCebFlip.isChecked(): | |
912 | name_operation = 'deFlip' |
|
914 | name_operation = 'deFlip' | |
913 | optype = 'self' |
|
915 | optype = 'self' | |
914 |
|
916 | |||
915 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
917 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
916 |
|
918 | |||
917 | name_parameter = 'channelList' |
|
919 | name_parameter = 'channelList' | |
918 | format = 'intlist' |
|
920 | format = 'intlist' | |
919 | value = str(self.volOpFlip.text()) |
|
921 | value = str(self.volOpFlip.text()) | |
920 |
|
922 | |||
921 | if value != "": |
|
923 | if value != "": | |
922 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
924 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
923 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
925 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
924 | return 0 |
|
926 | return 0 | |
925 |
|
927 | |||
926 | if self.volOpCebCohInt.isChecked(): |
|
928 | if self.volOpCebCohInt.isChecked(): | |
927 | name_operation = 'CohInt' |
|
929 | name_operation = 'CohInt' | |
928 | optype = 'other' |
|
930 | optype = 'other' | |
929 | value = str(self.volOpCohInt.text()) |
|
931 | value = str(self.volOpCohInt.text()) | |
930 |
|
932 | |||
931 | if value == "": |
|
933 | if value == "": | |
932 | print "Please fill number of coherent integrations" |
|
934 | print "Please fill number of coherent integrations" | |
933 | return 0 |
|
935 | return 0 | |
934 |
|
936 | |||
935 | name_parameter = 'n' |
|
937 | name_parameter = 'n' | |
936 | format = 'int' |
|
938 | format = 'int' | |
937 |
|
939 | |||
938 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
940 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
939 |
|
941 | |||
940 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
942 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
941 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
943 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
942 | return 0 |
|
944 | return 0 | |
943 |
|
945 | |||
944 | if self.volGraphCebshow.isChecked(): |
|
946 | if self.volGraphCebshow.isChecked(): | |
945 | name_operation = 'Scope' |
|
947 | name_operation = 'Scope' | |
946 | optype = 'other' |
|
948 | optype = 'other' | |
947 | name_parameter = 'type' |
|
949 | name_parameter = 'type' | |
948 | value = 'Scope' |
|
950 | value = 'Scope' | |
949 | if self.idImagscope == 0: |
|
951 | if self.idImagscope == 0: | |
950 | self.idImagscope = 100 |
|
952 | self.idImagscope = 100 | |
951 | else: |
|
953 | else: | |
952 | self.idImagscope = self.idImagscope + 1 |
|
954 | self.idImagscope = self.idImagscope + 1 | |
953 |
|
955 | |||
954 | name_parameter1 = 'id' |
|
956 | name_parameter1 = 'id' | |
955 | value1 = int(self.idImagscope) |
|
957 | value1 = int(self.idImagscope) | |
956 | format1 = 'int' |
|
958 | format1 = 'int' | |
957 | format = 'str' |
|
959 | format = 'str' | |
958 |
|
960 | |||
959 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
961 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
960 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
962 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
961 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
963 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
962 |
|
964 | |||
963 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
965 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
964 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
966 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
965 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
967 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
966 |
|
968 | |||
967 | if channelList: |
|
969 | if channelList: | |
968 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
970 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
969 |
|
971 | |||
970 | if xvalue: |
|
972 | if xvalue: | |
971 | xvalueList = xvalue.split(',') |
|
973 | xvalueList = xvalue.split(',') | |
972 | try: |
|
974 | try: | |
973 | value0 = float(xvalueList[0]) |
|
975 | value0 = float(xvalueList[0]) | |
974 | value1 = float(xvalueList[1]) |
|
976 | value1 = float(xvalueList[1]) | |
975 | except: |
|
977 | except: | |
976 | return 0 |
|
978 | return 0 | |
977 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
979 | opObj.addParameter(name='xmin', value=value0, format='float') | |
978 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
980 | opObj.addParameter(name='xmax', value=value1, format='float') | |
979 |
|
981 | |||
980 |
|
982 | |||
981 | if not yvalue == "": |
|
983 | if not yvalue == "": | |
982 | yvalueList = yvalue.split(",") |
|
984 | yvalueList = yvalue.split(",") | |
983 | try: |
|
985 | try: | |
984 | value0 = int(yvalueList[0]) |
|
986 | value0 = int(yvalueList[0]) | |
985 | value1 = int(yvalueList[1]) |
|
987 | value1 = int(yvalueList[1]) | |
986 | except: |
|
988 | except: | |
987 | return 0 |
|
989 | return 0 | |
988 |
|
990 | |||
989 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
991 | opObj.addParameter(name='ymin', value=value0, format='int') | |
990 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
992 | opObj.addParameter(name='ymax', value=value1, format='int') | |
991 |
|
993 | |||
992 | if self.volGraphCebSave.isChecked(): |
|
994 | if self.volGraphCebSave.isChecked(): | |
993 | checkPath = True |
|
995 | checkPath = True | |
994 | opObj.addParameter(name='save', value='1', format='int') |
|
996 | opObj.addParameter(name='save', value='1', format='int') | |
995 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') |
|
997 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') | |
996 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
998 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
997 | if value: |
|
999 | if value: | |
998 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1000 | opObj.addParameter(name='figfile', value=value, format='str') | |
999 |
|
1001 | |||
1000 | localfolder = None |
|
1002 | localfolder = None | |
1001 | if checkPath: |
|
1003 | if checkPath: | |
1002 | localfolder = str(self.volGraphPath.text()) |
|
1004 | localfolder = str(self.volGraphPath.text()) | |
1003 | if localfolder == '': |
|
1005 | if localfolder == '': | |
1004 | self.console.clear() |
|
1006 | self.console.clear() | |
1005 | self.console.append("Graphic path should be defined") |
|
1007 | self.console.append("Graphic path should be defined") | |
1006 | return 0 |
|
1008 | return 0 | |
1007 |
|
1009 | |||
1008 | # if something happend |
|
1010 | # if something happend | |
1009 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1011 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1010 | if parms_ok: |
|
1012 | if parms_ok: | |
1011 | name_operation = 'VoltageWriter' |
|
1013 | name_operation = 'VoltageWriter' | |
1012 | optype = 'other' |
|
1014 | optype = 'other' | |
1013 | name_parameter1 = 'path' |
|
1015 | name_parameter1 = 'path' | |
1014 | name_parameter2 = 'blocksPerFile' |
|
1016 | name_parameter2 = 'blocksPerFile' | |
1015 | name_parameter3 = 'profilesPerBlock' |
|
1017 | name_parameter3 = 'profilesPerBlock' | |
1016 | value1 = output_path |
|
1018 | value1 = output_path | |
1017 | value2 = blocksperfile |
|
1019 | value2 = blocksperfile | |
1018 | value3 = profilesperblock |
|
1020 | value3 = profilesperblock | |
1019 | format = "int" |
|
1021 | format = "int" | |
1020 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1022 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1021 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1023 | opObj.addParameter(name=name_parameter1, value=value1) | |
1022 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1024 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1023 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1025 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1024 |
|
1026 | |||
1025 | self.console.clear() |
|
1027 | self.console.clear() | |
1026 | try: |
|
1028 | try: | |
1027 | self.refreshPUProperties(puObj) |
|
1029 | self.refreshPUProperties(puObj) | |
1028 | except: |
|
1030 | except: | |
1029 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1031 | self.console.append("An error reading input parameters was found ...Check them!") | |
1030 | return 0 |
|
1032 | return 0 | |
1031 |
|
1033 | |||
1032 | self.console.append("Save your project and press Play button to start signal processing") |
|
1034 | self.console.append("Save your project and press Play button to start signal processing") | |
1033 |
|
1035 | |||
1034 | self._enable_play_button() |
|
1036 | self._enable_play_button() | |
1035 | self._enable_save_button() |
|
1037 | self._enable_save_button() | |
1036 |
|
1038 | |||
1037 | return 1 |
|
1039 | return 1 | |
1038 |
|
1040 | |||
1039 | """ |
|
1041 | """ | |
1040 | Voltage Graph |
|
1042 | Voltage Graph | |
1041 | """ |
|
1043 | """ | |
1042 | @pyqtSignature("int") |
|
1044 | @pyqtSignature("int") | |
1043 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1045 | def on_volGraphCebSave_stateChanged(self, p0): | |
1044 | """ |
|
1046 | """ | |
1045 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1047 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1046 | """ |
|
1048 | """ | |
1047 | if p0 == 2: |
|
1049 | if p0 == 2: | |
1048 | self.volGraphPath.setEnabled(True) |
|
1050 | self.volGraphPath.setEnabled(True) | |
1049 | self.volGraphPrefix.setEnabled(True) |
|
1051 | self.volGraphPrefix.setEnabled(True) | |
1050 | self.volGraphToolPath.setEnabled(True) |
|
1052 | self.volGraphToolPath.setEnabled(True) | |
1051 |
|
1053 | |||
1052 | if p0 == 0: |
|
1054 | if p0 == 0: | |
1053 | self.volGraphPath.setEnabled(False) |
|
1055 | self.volGraphPath.setEnabled(False) | |
1054 | self.volGraphPrefix.setEnabled(False) |
|
1056 | self.volGraphPrefix.setEnabled(False) | |
1055 | self.volGraphToolPath.setEnabled(False) |
|
1057 | self.volGraphToolPath.setEnabled(False) | |
1056 |
|
1058 | |||
1057 | @pyqtSignature("") |
|
1059 | @pyqtSignature("") | |
1058 | def on_volGraphToolPath_clicked(self): |
|
1060 | def on_volGraphToolPath_clicked(self): | |
1059 | """ |
|
1061 | """ | |
1060 | Donde se guardan los DATOS |
|
1062 | Donde se guardan los DATOS | |
1061 | """ |
|
1063 | """ | |
1062 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1064 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1063 | self.volGraphPath.setText(save_path) |
|
1065 | self.volGraphPath.setText(save_path) | |
1064 |
|
1066 | |||
1065 | if not os.path.exists(save_path): |
|
1067 | if not os.path.exists(save_path): | |
1066 | self.console.clear() |
|
1068 | self.console.clear() | |
1067 | self.console.append("Set a valid path") |
|
1069 | self.console.append("Set a valid path") | |
1068 | self.volGraphOk.setEnabled(False) |
|
1070 | self.volGraphOk.setEnabled(False) | |
1069 | return |
|
1071 | return | |
1070 |
|
1072 | |||
1071 | @pyqtSignature("int") |
|
1073 | @pyqtSignature("int") | |
1072 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1074 | def on_volGraphCebshow_stateChanged(self, p0): | |
1073 | """ |
|
1075 | """ | |
1074 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1076 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1075 | """ |
|
1077 | """ | |
1076 | if p0 == 0: |
|
1078 | if p0 == 0: | |
1077 |
|
1079 | |||
1078 | self.volGraphChannelList.setEnabled(False) |
|
1080 | self.volGraphChannelList.setEnabled(False) | |
1079 | self.volGraphfreqrange.setEnabled(False) |
|
1081 | self.volGraphfreqrange.setEnabled(False) | |
1080 | self.volGraphHeightrange.setEnabled(False) |
|
1082 | self.volGraphHeightrange.setEnabled(False) | |
1081 | if p0 == 2: |
|
1083 | if p0 == 2: | |
1082 |
|
1084 | |||
1083 | self.volGraphChannelList.setEnabled(True) |
|
1085 | self.volGraphChannelList.setEnabled(True) | |
1084 | self.volGraphfreqrange.setEnabled(True) |
|
1086 | self.volGraphfreqrange.setEnabled(True) | |
1085 | self.volGraphHeightrange.setEnabled(True) |
|
1087 | self.volGraphHeightrange.setEnabled(True) | |
1086 |
|
1088 | |||
1087 | """ |
|
1089 | """ | |
1088 | Spectra operation |
|
1090 | Spectra operation | |
1089 | """ |
|
1091 | """ | |
1090 | @pyqtSignature("int") |
|
1092 | @pyqtSignature("int") | |
1091 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1093 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1092 | """ |
|
1094 | """ | |
1093 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1095 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1094 | """ |
|
1096 | """ | |
1095 | if p0 == 2: |
|
1097 | if p0 == 2: | |
1096 | self.specOpRadarfrequency.setEnabled(True) |
|
1098 | self.specOpRadarfrequency.setEnabled(True) | |
1097 | if p0 == 0: |
|
1099 | if p0 == 0: | |
1098 | self.specOpRadarfrequency.clear() |
|
1100 | self.specOpRadarfrequency.clear() | |
1099 | self.specOpRadarfrequency.setEnabled(False) |
|
1101 | self.specOpRadarfrequency.setEnabled(False) | |
1100 |
|
1102 | |||
1101 |
|
1103 | |||
1102 | @pyqtSignature("int") |
|
1104 | @pyqtSignature("int") | |
1103 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1105 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1104 | """ |
|
1106 | """ | |
1105 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1107 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1106 | """ |
|
1108 | """ | |
1107 | if p0 == 2: |
|
1109 | if p0 == 2: | |
1108 | # self.specOpnFFTpoints.setEnabled(True) |
|
1110 | # self.specOpnFFTpoints.setEnabled(True) | |
1109 | self.specOppairsList.setEnabled(True) |
|
1111 | self.specOppairsList.setEnabled(True) | |
1110 | if p0 == 0: |
|
1112 | if p0 == 0: | |
1111 | # self.specOpnFFTpoints.setEnabled(False) |
|
1113 | # self.specOpnFFTpoints.setEnabled(False) | |
1112 | self.specOppairsList.setEnabled(False) |
|
1114 | self.specOppairsList.setEnabled(False) | |
1113 |
|
1115 | |||
1114 | @pyqtSignature("int") |
|
1116 | @pyqtSignature("int") | |
1115 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1117 | def on_specOpCebChannel_stateChanged(self, p0): | |
1116 | """ |
|
1118 | """ | |
1117 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1119 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1118 | """ |
|
1120 | """ | |
1119 | if p0 == 2: |
|
1121 | if p0 == 2: | |
1120 | self.specOpChannel.setEnabled(True) |
|
1122 | self.specOpChannel.setEnabled(True) | |
1121 | self.specOpComChannel.setEnabled(True) |
|
1123 | self.specOpComChannel.setEnabled(True) | |
1122 | if p0 == 0: |
|
1124 | if p0 == 0: | |
1123 | self.specOpChannel.setEnabled(False) |
|
1125 | self.specOpChannel.setEnabled(False) | |
1124 | self.specOpComChannel.setEnabled(False) |
|
1126 | self.specOpComChannel.setEnabled(False) | |
1125 |
|
1127 | |||
1126 | @pyqtSignature("int") |
|
1128 | @pyqtSignature("int") | |
1127 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1129 | def on_specOpCebHeights_stateChanged(self, p0): | |
1128 | """ |
|
1130 | """ | |
1129 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1131 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1130 | """ |
|
1132 | """ | |
1131 | if p0 == 2: |
|
1133 | if p0 == 2: | |
1132 | self.specOpComHeights.setEnabled(True) |
|
1134 | self.specOpComHeights.setEnabled(True) | |
1133 | self.specOpHeights.setEnabled(True) |
|
1135 | self.specOpHeights.setEnabled(True) | |
1134 | if p0 == 0: |
|
1136 | if p0 == 0: | |
1135 | self.specOpComHeights.setEnabled(False) |
|
1137 | self.specOpComHeights.setEnabled(False) | |
1136 | self.specOpHeights.setEnabled(False) |
|
1138 | self.specOpHeights.setEnabled(False) | |
1137 |
|
1139 | |||
1138 |
|
1140 | |||
1139 | @pyqtSignature("int") |
|
1141 | @pyqtSignature("int") | |
1140 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1142 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1141 | """ |
|
1143 | """ | |
1142 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1144 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1143 | """ |
|
1145 | """ | |
1144 | if p0 == 2: |
|
1146 | if p0 == 2: | |
1145 | self.specOpIncoherent.setEnabled(True) |
|
1147 | self.specOpIncoherent.setEnabled(True) | |
1146 | if p0 == 0: |
|
1148 | if p0 == 0: | |
1147 | self.specOpIncoherent.setEnabled(False) |
|
1149 | self.specOpIncoherent.setEnabled(False) | |
1148 |
|
1150 | |||
1149 | @pyqtSignature("int") |
|
1151 | @pyqtSignature("int") | |
1150 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1152 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1151 | """ |
|
1153 | """ | |
1152 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1154 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1153 | """ |
|
1155 | """ | |
1154 | if p0 == 2: |
|
1156 | if p0 == 2: | |
1155 | self.specOpComRemoveDC.setEnabled(True) |
|
1157 | self.specOpComRemoveDC.setEnabled(True) | |
1156 | if p0 == 0: |
|
1158 | if p0 == 0: | |
1157 | self.specOpComRemoveDC.setEnabled(False) |
|
1159 | self.specOpComRemoveDC.setEnabled(False) | |
1158 |
|
1160 | |||
1159 | @pyqtSignature("int") |
|
1161 | @pyqtSignature("int") | |
1160 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1162 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1161 | """ |
|
1163 | """ | |
1162 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1164 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1163 | """ |
|
1165 | """ | |
1164 | if p0 == 2: |
|
1166 | if p0 == 2: | |
1165 | self.specOpgetNoise.setEnabled(True) |
|
1167 | self.specOpgetNoise.setEnabled(True) | |
1166 |
|
1168 | |||
1167 | if p0 == 0: |
|
1169 | if p0 == 0: | |
1168 | self.specOpgetNoise.setEnabled(False) |
|
1170 | self.specOpgetNoise.setEnabled(False) | |
1169 |
|
1171 | |||
1170 | @pyqtSignature("") |
|
1172 | @pyqtSignature("") | |
1171 | def on_specOpOk_clicked(self): |
|
1173 | def on_specOpOk_clicked(self): | |
1172 | """ |
|
1174 | """ | |
1173 | AΓADE OPERACION SPECTRA |
|
1175 | AΓADE OPERACION SPECTRA | |
1174 | """ |
|
1176 | """ | |
1175 |
|
1177 | |||
1176 | addFTP = False |
|
1178 | addFTP = False | |
1177 | checkPath = False |
|
1179 | checkPath = False | |
1178 |
|
1180 | |||
1179 | self._disable_play_button() |
|
1181 | self._disable_play_button() | |
1180 | self._disable_save_button() |
|
1182 | self._disable_save_button() | |
1181 |
|
1183 | |||
1182 | self.console.clear() |
|
1184 | self.console.clear() | |
1183 | self.console.append("Checking input parameters ...") |
|
1185 | self.console.append("Checking input parameters ...") | |
1184 |
|
1186 | |||
1185 | projectObj = self.getSelectedProjectObj() |
|
1187 | projectObj = self.getSelectedProjectObj() | |
1186 |
|
1188 | |||
1187 | if not projectObj: |
|
1189 | if not projectObj: | |
1188 | self.console.append("Please select a project before update it") |
|
1190 | self.console.append("Please select a project before update it") | |
1189 | return |
|
1191 | return | |
1190 |
|
1192 | |||
1191 | puObj = self.getSelectedItemObj() |
|
1193 | puObj = self.getSelectedItemObj() | |
1192 |
|
1194 | |||
1193 | puObj.removeOperations() |
|
1195 | puObj.removeOperations() | |
1194 |
|
1196 | |||
1195 | if self.specOpCebRadarfrequency.isChecked(): |
|
1197 | if self.specOpCebRadarfrequency.isChecked(): | |
1196 | value = str(self.specOpRadarfrequency.text()) |
|
1198 | value = str(self.specOpRadarfrequency.text()) | |
1197 | format = 'float' |
|
1199 | format = 'float' | |
1198 | name_operation = 'setRadarFrequency' |
|
1200 | name_operation = 'setRadarFrequency' | |
1199 | name_parameter = 'frequency' |
|
1201 | name_parameter = 'frequency' | |
1200 |
|
1202 | |||
1201 | if not isFloat(value): |
|
1203 | if not isFloat(value): | |
1202 | self.console.clear() |
|
1204 | self.console.clear() | |
1203 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1205 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1204 | return 0 |
|
1206 | return 0 | |
1205 |
|
1207 | |||
1206 | radarfreq = float(value)*1e6 |
|
1208 | radarfreq = float(value)*1e6 | |
1207 | opObj = puObj.addOperation(name=name_operation) |
|
1209 | opObj = puObj.addOperation(name=name_operation) | |
1208 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1210 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1209 |
|
1211 | |||
1210 | inputId = puObj.getInputId() |
|
1212 | inputId = puObj.getInputId() | |
1211 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1213 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1212 |
|
1214 | |||
1213 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1215 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1214 |
|
1216 | |||
1215 | value = str(self.specOpnFFTpoints.text()) |
|
1217 | value = str(self.specOpnFFTpoints.text()) | |
1216 |
|
1218 | |||
1217 | if not isInt(value): |
|
1219 | if not isInt(value): | |
1218 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) |
|
1220 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) | |
1219 | return 0 |
|
1221 | return 0 | |
1220 |
|
1222 | |||
1221 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1223 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1222 |
|
1224 | |||
1223 | value = str(self.specOpProfiles.text()) |
|
1225 | value = str(self.specOpProfiles.text()) | |
1224 | if not isInt(value): |
|
1226 | if not isInt(value): | |
1225 | self.console.append("Please write a value on Profiles field") |
|
1227 | self.console.append("Please write a value on Profiles field") | |
1226 | else: |
|
1228 | else: | |
1227 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1229 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1228 |
|
1230 | |||
1229 | value = str(self.specOpippFactor.text()) |
|
1231 | value = str(self.specOpippFactor.text()) | |
1230 | if not isInt(value): |
|
1232 | if not isInt(value): | |
1231 | self.console.append("Please write a value on IppFactor field") |
|
1233 | self.console.append("Please write a value on IppFactor field") | |
1232 | else: |
|
1234 | else: | |
1233 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1235 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1234 |
|
1236 | |||
1235 | if self.specOpCebCrossSpectra.isChecked(): |
|
1237 | if self.specOpCebCrossSpectra.isChecked(): | |
1236 | name_parameter = 'pairsList' |
|
1238 | name_parameter = 'pairsList' | |
1237 | format = 'pairslist' |
|
1239 | format = 'pairslist' | |
1238 | value = str(self.specOppairsList.text()) |
|
1240 | value = str(self.specOppairsList.text()) | |
1239 |
|
1241 | |||
1240 | if value == "": |
|
1242 | if value == "": | |
1241 | print "Please fill the pairs list field" |
|
1243 | print "Please fill the pairs list field" | |
1242 | return 0 |
|
1244 | return 0 | |
1243 |
|
1245 | |||
1244 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
1246 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
1245 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1247 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1246 | return 0 |
|
1248 | return 0 | |
1247 |
|
1249 | |||
1248 | if self.specOpCebHeights.isChecked(): |
|
1250 | if self.specOpCebHeights.isChecked(): | |
1249 | value = str(self.specOpHeights.text()) |
|
1251 | value = str(self.specOpHeights.text()) | |
1250 |
|
1252 | |||
1251 | if value == "": |
|
1253 | if value == "": | |
1252 | self.console.append("Empty value for '%s'" %(value, "Height range")) |
|
1254 | self.console.append("Empty value for '%s'" %(value, "Height range")) | |
1253 | return 0 |
|
1255 | return 0 | |
1254 |
|
1256 | |||
1255 | valueList = value.split(',') |
|
1257 | valueList = value.split(',') | |
1256 | format = 'float' |
|
1258 | format = 'float' | |
1257 | value0 = valueList[0] |
|
1259 | value0 = valueList[0] | |
1258 | value1 = valueList[1] |
|
1260 | value1 = valueList[1] | |
1259 |
|
1261 | |||
1260 | if not isFloat(value0) or not isFloat(value1): |
|
1262 | if not isFloat(value0) or not isFloat(value1): | |
1261 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) |
|
1263 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) | |
1262 | return 0 |
|
1264 | return 0 | |
1263 |
|
1265 | |||
1264 | if self.specOpComHeights.currentIndex() == 0: |
|
1266 | if self.specOpComHeights.currentIndex() == 0: | |
1265 | name_operation = 'selectHeights' |
|
1267 | name_operation = 'selectHeights' | |
1266 | name_parameter1 = 'minHei' |
|
1268 | name_parameter1 = 'minHei' | |
1267 | name_parameter2 = 'maxHei' |
|
1269 | name_parameter2 = 'maxHei' | |
1268 | else: |
|
1270 | else: | |
1269 | name_operation = 'selectHeightsByIndex' |
|
1271 | name_operation = 'selectHeightsByIndex' | |
1270 | name_parameter1 = 'minIndex' |
|
1272 | name_parameter1 = 'minIndex' | |
1271 | name_parameter2 = 'maxIndex' |
|
1273 | name_parameter2 = 'maxIndex' | |
1272 |
|
1274 | |||
1273 | opObj = puObj.addOperation(name=name_operation) |
|
1275 | opObj = puObj.addOperation(name=name_operation) | |
1274 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1276 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1275 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1277 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1276 |
|
1278 | |||
1277 | if self.specOpCebChannel.isChecked(): |
|
1279 | if self.specOpCebChannel.isChecked(): | |
1278 |
|
1280 | |||
1279 | if self.specOpComChannel.currentIndex() == 0: |
|
1281 | if self.specOpComChannel.currentIndex() == 0: | |
1280 | name_operation = "selectChannels" |
|
1282 | name_operation = "selectChannels" | |
1281 | name_parameter = 'channelList' |
|
1283 | name_parameter = 'channelList' | |
1282 | else: |
|
1284 | else: | |
1283 | name_operation = "selectChannelsByIndex" |
|
1285 | name_operation = "selectChannelsByIndex" | |
1284 | name_parameter = 'channelIndexList' |
|
1286 | name_parameter = 'channelIndexList' | |
1285 |
|
1287 | |||
1286 | format = 'intlist' |
|
1288 | format = 'intlist' | |
1287 | value = str(self.specOpChannel.text()) |
|
1289 | value = str(self.specOpChannel.text()) | |
1288 |
|
1290 | |||
1289 | if value == "": |
|
1291 | if value == "": | |
1290 | print "Please fill channel list" |
|
1292 | print "Please fill channel list" | |
1291 | return 0 |
|
1293 | return 0 | |
1292 |
|
1294 | |||
1293 | if not isList(value): |
|
1295 | if not isList(value): | |
1294 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1296 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1295 | return 0 |
|
1297 | return 0 | |
1296 |
|
1298 | |||
1297 | opObj = puObj.addOperation(name=name_operation) |
|
1299 | opObj = puObj.addOperation(name=name_operation) | |
1298 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1300 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1299 |
|
1301 | |||
1300 | if self.specOpCebIncoherent.isChecked(): |
|
1302 | if self.specOpCebIncoherent.isChecked(): | |
1301 |
|
1303 | |||
1302 | name_operation = 'IncohInt' |
|
1304 | name_operation = 'IncohInt' | |
1303 | optype = 'other' |
|
1305 | optype = 'other' | |
1304 |
|
1306 | |||
1305 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1307 | if self.specOpCobIncInt.currentIndex() == 0: | |
1306 | name_parameter = 'timeInterval' |
|
1308 | name_parameter = 'timeInterval' | |
1307 | format = 'float' |
|
1309 | format = 'float' | |
1308 | else: |
|
1310 | else: | |
1309 | name_parameter = 'n' |
|
1311 | name_parameter = 'n' | |
1310 | format = 'int' |
|
1312 | format = 'int' | |
1311 |
|
1313 | |||
1312 | value = str(self.specOpIncoherent.text()) |
|
1314 | value = str(self.specOpIncoherent.text()) | |
1313 |
|
1315 | |||
1314 | if value == "": |
|
1316 | if value == "": | |
1315 | print "Please fill Incoherent integration value" |
|
1317 | print "Please fill Incoherent integration value" | |
1316 | return 0 |
|
1318 | return 0 | |
1317 |
|
1319 | |||
1318 | if not isFloat(value): |
|
1320 | if not isFloat(value): | |
1319 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1321 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1320 | return 0 |
|
1322 | return 0 | |
1321 |
|
1323 | |||
1322 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1324 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1323 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1325 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1324 |
|
1326 | |||
1325 | if self.specOpCebRemoveDC.isChecked(): |
|
1327 | if self.specOpCebRemoveDC.isChecked(): | |
1326 | name_operation = 'removeDC' |
|
1328 | name_operation = 'removeDC' | |
1327 | name_parameter = 'mode' |
|
1329 | name_parameter = 'mode' | |
1328 | format = 'int' |
|
1330 | format = 'int' | |
1329 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1331 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1330 | value = 1 |
|
1332 | value = 1 | |
1331 | else: |
|
1333 | else: | |
1332 | value = 2 |
|
1334 | value = 2 | |
1333 | opObj = puObj.addOperation(name=name_operation) |
|
1335 | opObj = puObj.addOperation(name=name_operation) | |
1334 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1336 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1335 |
|
1337 | |||
1336 | if self.specOpCebRemoveInt.isChecked(): |
|
1338 | if self.specOpCebRemoveInt.isChecked(): | |
1337 | name_operation = 'removeInterference' |
|
1339 | name_operation = 'removeInterference' | |
1338 | opObj = puObj.addOperation(name=name_operation) |
|
1340 | opObj = puObj.addOperation(name=name_operation) | |
1339 |
|
1341 | |||
1340 |
|
1342 | |||
1341 | if self.specOpCebgetNoise.isChecked(): |
|
1343 | if self.specOpCebgetNoise.isChecked(): | |
1342 | value = str(self.specOpgetNoise.text()) |
|
1344 | value = str(self.specOpgetNoise.text()) | |
1343 | valueList = value.split(',') |
|
1345 | valueList = value.split(',') | |
1344 | format = 'float' |
|
1346 | format = 'float' | |
1345 | name_operation = "getNoise" |
|
1347 | name_operation = "getNoise" | |
1346 | opObj = puObj.addOperation(name=name_operation) |
|
1348 | opObj = puObj.addOperation(name=name_operation) | |
1347 |
|
1349 | |||
1348 | if not value == '': |
|
1350 | if not value == '': | |
1349 | valueList = value.split(',') |
|
1351 | valueList = value.split(',') | |
1350 | length = len(valueList) |
|
1352 | length = len(valueList) | |
1351 | if length == 1: |
|
1353 | if length == 1: | |
1352 | try: |
|
1354 | try: | |
1353 | value1 = float(valueList[0]) |
|
1355 | value1 = float(valueList[0]) | |
1354 | except: |
|
1356 | except: | |
1355 | self.console.clear() |
|
1357 | self.console.clear() | |
1356 | self.console.append("Please Write correct parameter Get Noise") |
|
1358 | self.console.append("Please Write correct parameter Get Noise") | |
1357 | return 0 |
|
1359 | return 0 | |
1358 | name1 = 'minHei' |
|
1360 | name1 = 'minHei' | |
1359 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1361 | opObj.addParameter(name=name1, value=value1, format=format) | |
1360 | elif length == 2: |
|
1362 | elif length == 2: | |
1361 | try: |
|
1363 | try: | |
1362 | value1 = float(valueList[0]) |
|
1364 | value1 = float(valueList[0]) | |
1363 | value2 = float(valueList[1]) |
|
1365 | value2 = float(valueList[1]) | |
1364 | except: |
|
1366 | except: | |
1365 | self.console.clear() |
|
1367 | self.console.clear() | |
1366 | self.console.append("Please Write corrects parameter Get Noise") |
|
1368 | self.console.append("Please Write corrects parameter Get Noise") | |
1367 | return 0 |
|
1369 | return 0 | |
1368 | name1 = 'minHei' |
|
1370 | name1 = 'minHei' | |
1369 | name2 = 'maxHei' |
|
1371 | name2 = 'maxHei' | |
1370 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1372 | opObj.addParameter(name=name1, value=value1, format=format) | |
1371 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1373 | opObj.addParameter(name=name2, value=value2, format=format) | |
1372 |
|
1374 | |||
1373 | elif length == 3: |
|
1375 | elif length == 3: | |
1374 | try: |
|
1376 | try: | |
1375 | value1 = float(valueList[0]) |
|
1377 | value1 = float(valueList[0]) | |
1376 | value2 = float(valueList[1]) |
|
1378 | value2 = float(valueList[1]) | |
1377 | value3 = float(valueList[2]) |
|
1379 | value3 = float(valueList[2]) | |
1378 | except: |
|
1380 | except: | |
1379 | self.console.clear() |
|
1381 | self.console.clear() | |
1380 | self.console.append("Please Write corrects parameter Get Noise") |
|
1382 | self.console.append("Please Write corrects parameter Get Noise") | |
1381 | return 0 |
|
1383 | return 0 | |
1382 | name1 = 'minHei' |
|
1384 | name1 = 'minHei' | |
1383 | name2 = 'maxHei' |
|
1385 | name2 = 'maxHei' | |
1384 | name3 = 'minVel' |
|
1386 | name3 = 'minVel' | |
1385 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1387 | opObj.addParameter(name=name1, value=value1, format=format) | |
1386 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1388 | opObj.addParameter(name=name2, value=value2, format=format) | |
1387 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1389 | opObj.addParameter(name=name3, value=value3, format=format) | |
1388 |
|
1390 | |||
1389 | elif length == 4: |
|
1391 | elif length == 4: | |
1390 | try: |
|
1392 | try: | |
1391 | value1 = float(valueList[0]) |
|
1393 | value1 = float(valueList[0]) | |
1392 | value2 = float(valueList[1]) |
|
1394 | value2 = float(valueList[1]) | |
1393 | value3 = float(valueList[2]) |
|
1395 | value3 = float(valueList[2]) | |
1394 | value4 = float(valueList[3]) |
|
1396 | value4 = float(valueList[3]) | |
1395 | except: |
|
1397 | except: | |
1396 | self.console.clear() |
|
1398 | self.console.clear() | |
1397 | self.console.append("Please Write corrects parameter Get Noise") |
|
1399 | self.console.append("Please Write corrects parameter Get Noise") | |
1398 | return 0 |
|
1400 | return 0 | |
1399 | name1 = 'minHei' |
|
1401 | name1 = 'minHei' | |
1400 | name2 = 'maxHei' |
|
1402 | name2 = 'maxHei' | |
1401 | name3 = 'minVel' |
|
1403 | name3 = 'minVel' | |
1402 | name4 = 'maxVel' |
|
1404 | name4 = 'maxVel' | |
1403 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1405 | opObj.addParameter(name=name1, value=value1, format=format) | |
1404 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1406 | opObj.addParameter(name=name2, value=value2, format=format) | |
1405 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1407 | opObj.addParameter(name=name3, value=value3, format=format) | |
1406 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1408 | opObj.addParameter(name=name4, value=value4, format=format) | |
1407 |
|
1409 | |||
1408 | elif length > 4: |
|
1410 | elif length > 4: | |
1409 | self.console.clear() |
|
1411 | self.console.clear() | |
1410 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1412 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1411 | return 0 |
|
1413 | return 0 | |
1412 |
|
1414 | |||
1413 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1415 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1414 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1416 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1415 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1417 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1416 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1418 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1417 |
|
1419 | |||
1418 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1420 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1419 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1421 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1420 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1422 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1421 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1423 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1422 |
|
1424 | |||
1423 | figpath = str(self.specGraphPath.text()) |
|
1425 | figpath = str(self.specGraphPath.text()) | |
1424 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1426 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1425 | try: |
|
1427 | try: | |
1426 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1428 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1427 | except: |
|
1429 | except: | |
1428 | wrperiod = None |
|
1430 | wrperiod = None | |
1429 |
|
1431 | |||
1430 | #-----Spectra Plot----- |
|
1432 | #-----Spectra Plot----- | |
1431 | if self.specGraphCebSpectraplot.isChecked(): |
|
1433 | if self.specGraphCebSpectraplot.isChecked(): | |
1432 |
|
1434 | |||
1433 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1435 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1434 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1436 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1435 |
|
1437 | |||
1436 | if not channelList == '': |
|
1438 | if not channelList == '': | |
1437 |
|
1439 | |||
1438 | if not isList(channelList): |
|
1440 | if not isList(channelList): | |
1439 | self.console.append("Invalid channelList") |
|
1441 | self.console.append("Invalid channelList") | |
1440 | return 0 |
|
1442 | return 0 | |
1441 |
|
1443 | |||
1442 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1444 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1443 |
|
1445 | |||
1444 | if not vel_range == '': |
|
1446 | if not vel_range == '': | |
1445 | xvalueList = vel_range.split(',') |
|
1447 | xvalueList = vel_range.split(',') | |
1446 | try: |
|
1448 | try: | |
1447 | value1 = float(xvalueList[0]) |
|
1449 | value1 = float(xvalueList[0]) | |
1448 | value2 = float(xvalueList[1]) |
|
1450 | value2 = float(xvalueList[1]) | |
1449 | except: |
|
1451 | except: | |
1450 | self.console.clear() |
|
1452 | self.console.clear() | |
1451 | self.console.append("Invalid velocity/frequency range") |
|
1453 | self.console.append("Invalid velocity/frequency range") | |
1452 | return 0 |
|
1454 | return 0 | |
1453 |
|
1455 | |||
1454 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1456 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1455 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1457 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1456 |
|
1458 | |||
1457 | if not hei_range == '': |
|
1459 | if not hei_range == '': | |
1458 | yvalueList = hei_range.split(",") |
|
1460 | yvalueList = hei_range.split(",") | |
1459 | try: |
|
1461 | try: | |
1460 | value1 = float(yvalueList[0]) |
|
1462 | value1 = float(yvalueList[0]) | |
1461 | value2 = float(yvalueList[1]) |
|
1463 | value2 = float(yvalueList[1]) | |
1462 | except: |
|
1464 | except: | |
1463 | self.console.clear() |
|
1465 | self.console.clear() | |
1464 | self.console.append("Invalid height range") |
|
1466 | self.console.append("Invalid height range") | |
1465 | return 0 |
|
1467 | return 0 | |
1466 |
|
1468 | |||
1467 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1469 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1468 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1470 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1469 |
|
1471 | |||
1470 | if not db_range == '': |
|
1472 | if not db_range == '': | |
1471 | zvalueList = db_range.split(",") |
|
1473 | zvalueList = db_range.split(",") | |
1472 | try: |
|
1474 | try: | |
1473 | value1 = float(zvalueList[0]) |
|
1475 | value1 = float(zvalueList[0]) | |
1474 | value2 = float(zvalueList[1]) |
|
1476 | value2 = float(zvalueList[1]) | |
1475 | except: |
|
1477 | except: | |
1476 | self.console.clear() |
|
1478 | self.console.clear() | |
1477 | self.console.append("Invalid db range") |
|
1479 | self.console.append("Invalid db range") | |
1478 | return 0 |
|
1480 | return 0 | |
1479 |
|
1481 | |||
1480 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1482 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1481 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1483 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1482 |
|
1484 | |||
1483 | if self.specGraphSaveSpectra.isChecked(): |
|
1485 | if self.specGraphSaveSpectra.isChecked(): | |
1484 | checkPath = True |
|
1486 | checkPath = True | |
1485 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1487 | opObj.addParameter(name='save', value=1 , format='bool') | |
1486 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1488 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1487 | if figfile: |
|
1489 | if figfile: | |
1488 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1490 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1489 | if wrperiod: |
|
1491 | if wrperiod: | |
1490 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1492 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1491 |
|
1493 | |||
1492 | if self.specGraphftpSpectra.isChecked(): |
|
1494 | if self.specGraphftpSpectra.isChecked(): | |
1493 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1495 | opObj.addParameter(name='ftp', value='1', format='int') | |
1494 | self.addFTPConf2Operation(puObj, opObj) |
|
1496 | self.addFTPConf2Operation(puObj, opObj) | |
1495 | addFTP = True |
|
1497 | addFTP = True | |
1496 |
|
1498 | |||
1497 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1499 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1498 |
|
1500 | |||
1499 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1501 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1500 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1502 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1501 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1503 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1502 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1504 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1503 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1505 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1504 |
|
1506 | |||
1505 | if not vel_range == '': |
|
1507 | if not vel_range == '': | |
1506 | xvalueList = vel_range.split(',') |
|
1508 | xvalueList = vel_range.split(',') | |
1507 | try: |
|
1509 | try: | |
1508 | value1 = float(xvalueList[0]) |
|
1510 | value1 = float(xvalueList[0]) | |
1509 | value2 = float(xvalueList[1]) |
|
1511 | value2 = float(xvalueList[1]) | |
1510 | except: |
|
1512 | except: | |
1511 | self.console.clear() |
|
1513 | self.console.clear() | |
1512 | self.console.append("Invalid velocity/frequency range") |
|
1514 | self.console.append("Invalid velocity/frequency range") | |
1513 | return 0 |
|
1515 | return 0 | |
1514 |
|
1516 | |||
1515 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1517 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1516 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1518 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1517 |
|
1519 | |||
1518 | if not hei_range == '': |
|
1520 | if not hei_range == '': | |
1519 | yvalueList = hei_range.split(",") |
|
1521 | yvalueList = hei_range.split(",") | |
1520 | try: |
|
1522 | try: | |
1521 | value1 = float(yvalueList[0]) |
|
1523 | value1 = float(yvalueList[0]) | |
1522 | value2 = float(yvalueList[1]) |
|
1524 | value2 = float(yvalueList[1]) | |
1523 | except: |
|
1525 | except: | |
1524 | self.console.clear() |
|
1526 | self.console.clear() | |
1525 | self.console.append("Invalid height range") |
|
1527 | self.console.append("Invalid height range") | |
1526 | return 0 |
|
1528 | return 0 | |
1527 |
|
1529 | |||
1528 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1530 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1529 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1531 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1530 |
|
1532 | |||
1531 | if not db_range == '': |
|
1533 | if not db_range == '': | |
1532 | zvalueList = db_range.split(",") |
|
1534 | zvalueList = db_range.split(",") | |
1533 | try: |
|
1535 | try: | |
1534 | value1 = float(zvalueList[0]) |
|
1536 | value1 = float(zvalueList[0]) | |
1535 | value2 = float(zvalueList[1]) |
|
1537 | value2 = float(zvalueList[1]) | |
1536 | except: |
|
1538 | except: | |
1537 | self.console.clear() |
|
1539 | self.console.clear() | |
1538 | self.console.append("Invalid db range") |
|
1540 | self.console.append("Invalid db range") | |
1539 | return 0 |
|
1541 | return 0 | |
1540 |
|
1542 | |||
1541 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1543 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1542 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1544 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1543 |
|
1545 | |||
1544 | if not magrange == '': |
|
1546 | if not magrange == '': | |
1545 | zvalueList = magrange.split(",") |
|
1547 | zvalueList = magrange.split(",") | |
1546 | try: |
|
1548 | try: | |
1547 | value1 = float(zvalueList[0]) |
|
1549 | value1 = float(zvalueList[0]) | |
1548 | value2 = float(zvalueList[1]) |
|
1550 | value2 = float(zvalueList[1]) | |
1549 | except: |
|
1551 | except: | |
1550 | self.console.clear() |
|
1552 | self.console.clear() | |
1551 | self.console.append("Invalid magnitude range") |
|
1553 | self.console.append("Invalid magnitude range") | |
1552 | return 0 |
|
1554 | return 0 | |
1553 |
|
1555 | |||
1554 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1556 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1555 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1557 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1556 |
|
1558 | |||
1557 | if not phaserange == '': |
|
1559 | if not phaserange == '': | |
1558 | zvalueList = phaserange.split(",") |
|
1560 | zvalueList = phaserange.split(",") | |
1559 | try: |
|
1561 | try: | |
1560 | value1 = float(zvalueList[0]) |
|
1562 | value1 = float(zvalueList[0]) | |
1561 | value2 = float(zvalueList[1]) |
|
1563 | value2 = float(zvalueList[1]) | |
1562 | except: |
|
1564 | except: | |
1563 | self.console.clear() |
|
1565 | self.console.clear() | |
1564 | self.console.append("Invalid phase range") |
|
1566 | self.console.append("Invalid phase range") | |
1565 | return 0 |
|
1567 | return 0 | |
1566 |
|
1568 | |||
1567 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1569 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1568 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1570 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1569 |
|
1571 | |||
1570 | if self.specGraphSaveCross.isChecked(): |
|
1572 | if self.specGraphSaveCross.isChecked(): | |
1571 | checkPath = True |
|
1573 | checkPath = True | |
1572 | opObj.addParameter(name='save', value='1', format='bool') |
|
1574 | opObj.addParameter(name='save', value='1', format='bool') | |
1573 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1575 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1574 | if figfile: |
|
1576 | if figfile: | |
1575 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1577 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1576 | if wrperiod: |
|
1578 | if wrperiod: | |
1577 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1579 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1578 |
|
1580 | |||
1579 | if self.specGraphftpCross.isChecked(): |
|
1581 | if self.specGraphftpCross.isChecked(): | |
1580 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1582 | opObj.addParameter(name='ftp', value='1', format='int') | |
1581 | self.addFTPConf2Operation(puObj, opObj) |
|
1583 | self.addFTPConf2Operation(puObj, opObj) | |
1582 | addFTP = True |
|
1584 | addFTP = True | |
1583 |
|
1585 | |||
1584 | if self.specGraphCebRTIplot.isChecked(): |
|
1586 | if self.specGraphCebRTIplot.isChecked(): | |
1585 |
|
1587 | |||
1586 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1588 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1587 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1589 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1588 |
|
1590 | |||
1589 | if not channelList == '': |
|
1591 | if not channelList == '': | |
1590 | if not isList(channelList): |
|
1592 | if not isList(channelList): | |
1591 | self.console.append("Invalid channelList") |
|
1593 | self.console.append("Invalid channelList") | |
1592 | return 0 |
|
1594 | return 0 | |
1593 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1595 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1594 |
|
1596 | |||
1595 | if not trange == '': |
|
1597 | if not trange == '': | |
1596 | xvalueList = trange.split(',') |
|
1598 | xvalueList = trange.split(',') | |
1597 | try: |
|
1599 | try: | |
1598 | value1 = float(xvalueList[0]) |
|
1600 | value1 = float(xvalueList[0]) | |
1599 | value2 = float(xvalueList[1]) |
|
1601 | value2 = float(xvalueList[1]) | |
1600 | except: |
|
1602 | except: | |
1601 | self.console.clear() |
|
1603 | self.console.clear() | |
1602 | self.console.append("Invalid time range") |
|
1604 | self.console.append("Invalid time range") | |
1603 | return 0 |
|
1605 | return 0 | |
1604 |
|
1606 | |||
1605 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1607 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1606 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1608 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1607 |
|
1609 | |||
1608 | # if not timerange == '': |
|
1610 | # if not timerange == '': | |
1609 | # try: |
|
1611 | # try: | |
1610 | # timerange = float(timerange) |
|
1612 | # timerange = float(timerange) | |
1611 | # except: |
|
1613 | # except: | |
1612 | # self.console.clear() |
|
1614 | # self.console.clear() | |
1613 | # self.console.append("Invalid time range") |
|
1615 | # self.console.append("Invalid time range") | |
1614 | # return 0 |
|
1616 | # return 0 | |
1615 | # |
|
1617 | # | |
1616 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1618 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1617 |
|
1619 | |||
1618 | if not hei_range == '': |
|
1620 | if not hei_range == '': | |
1619 | yvalueList = hei_range.split(",") |
|
1621 | yvalueList = hei_range.split(",") | |
1620 | try: |
|
1622 | try: | |
1621 | value1 = float(yvalueList[0]) |
|
1623 | value1 = float(yvalueList[0]) | |
1622 | value2 = float(yvalueList[1]) |
|
1624 | value2 = float(yvalueList[1]) | |
1623 | except: |
|
1625 | except: | |
1624 | self.console.clear() |
|
1626 | self.console.clear() | |
1625 | self.console.append("Invalid height range") |
|
1627 | self.console.append("Invalid height range") | |
1626 | return 0 |
|
1628 | return 0 | |
1627 |
|
1629 | |||
1628 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1630 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1629 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1631 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1630 |
|
1632 | |||
1631 | if not db_range == '': |
|
1633 | if not db_range == '': | |
1632 | zvalueList = db_range.split(",") |
|
1634 | zvalueList = db_range.split(",") | |
1633 | try: |
|
1635 | try: | |
1634 | value1 = float(zvalueList[0]) |
|
1636 | value1 = float(zvalueList[0]) | |
1635 | value2 = float(zvalueList[1]) |
|
1637 | value2 = float(zvalueList[1]) | |
1636 | except: |
|
1638 | except: | |
1637 | self.console.clear() |
|
1639 | self.console.clear() | |
1638 | self.console.append("Invalid db range") |
|
1640 | self.console.append("Invalid db range") | |
1639 | return 0 |
|
1641 | return 0 | |
1640 |
|
1642 | |||
1641 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1643 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1642 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1644 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1643 |
|
1645 | |||
1644 | if self.specGraphSaveRTIplot.isChecked(): |
|
1646 | if self.specGraphSaveRTIplot.isChecked(): | |
1645 | checkPath = True |
|
1647 | checkPath = True | |
1646 | opObj.addParameter(name='save', value='1', format='bool') |
|
1648 | opObj.addParameter(name='save', value='1', format='bool') | |
1647 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1649 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1648 | if figfile: |
|
1650 | if figfile: | |
1649 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1651 | opObj.addParameter(name='figfile', value=value, format='str') | |
1650 | if wrperiod: |
|
1652 | if wrperiod: | |
1651 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1653 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1652 |
|
1654 | |||
1653 | if self.specGraphftpRTIplot.isChecked(): |
|
1655 | if self.specGraphftpRTIplot.isChecked(): | |
1654 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1656 | opObj.addParameter(name='ftp', value='1', format='int') | |
1655 | self.addFTPConf2Operation(puObj, opObj) |
|
1657 | self.addFTPConf2Operation(puObj, opObj) | |
1656 | addFTP = True |
|
1658 | addFTP = True | |
1657 |
|
1659 | |||
1658 | if self.specGraphCebCoherencmap.isChecked(): |
|
1660 | if self.specGraphCebCoherencmap.isChecked(): | |
1659 |
|
1661 | |||
1660 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1662 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1661 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1663 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1662 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1664 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1663 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1665 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1664 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1666 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1665 |
|
1667 | |||
1666 | # if not timerange == '': |
|
1668 | # if not timerange == '': | |
1667 | # try: |
|
1669 | # try: | |
1668 | # timerange = int(timerange) |
|
1670 | # timerange = int(timerange) | |
1669 | # except: |
|
1671 | # except: | |
1670 | # self.console.clear() |
|
1672 | # self.console.clear() | |
1671 | # self.console.append("Invalid time range") |
|
1673 | # self.console.append("Invalid time range") | |
1672 | # return 0 |
|
1674 | # return 0 | |
1673 | # |
|
1675 | # | |
1674 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1676 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1675 |
|
1677 | |||
1676 | if not trange == '': |
|
1678 | if not trange == '': | |
1677 | xvalueList = trange.split(',') |
|
1679 | xvalueList = trange.split(',') | |
1678 | try: |
|
1680 | try: | |
1679 | value1 = float(xvalueList[0]) |
|
1681 | value1 = float(xvalueList[0]) | |
1680 | value2 = float(xvalueList[1]) |
|
1682 | value2 = float(xvalueList[1]) | |
1681 | except: |
|
1683 | except: | |
1682 | self.console.clear() |
|
1684 | self.console.clear() | |
1683 | self.console.append("Invalid time range") |
|
1685 | self.console.append("Invalid time range") | |
1684 | return 0 |
|
1686 | return 0 | |
1685 |
|
1687 | |||
1686 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1688 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1687 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1689 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1688 |
|
1690 | |||
1689 | if not hei_range == '': |
|
1691 | if not hei_range == '': | |
1690 | yvalueList = hei_range.split(",") |
|
1692 | yvalueList = hei_range.split(",") | |
1691 | try: |
|
1693 | try: | |
1692 | value1 = float(yvalueList[0]) |
|
1694 | value1 = float(yvalueList[0]) | |
1693 | value2 = float(yvalueList[1]) |
|
1695 | value2 = float(yvalueList[1]) | |
1694 | except: |
|
1696 | except: | |
1695 | self.console.clear() |
|
1697 | self.console.clear() | |
1696 | self.console.append("Invalid height range") |
|
1698 | self.console.append("Invalid height range") | |
1697 | return 0 |
|
1699 | return 0 | |
1698 |
|
1700 | |||
1699 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1701 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1700 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1702 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1701 |
|
1703 | |||
1702 | if not magrange == '': |
|
1704 | if not magrange == '': | |
1703 | zvalueList = magrange.split(",") |
|
1705 | zvalueList = magrange.split(",") | |
1704 | try: |
|
1706 | try: | |
1705 | value1 = float(zvalueList[0]) |
|
1707 | value1 = float(zvalueList[0]) | |
1706 | value2 = float(zvalueList[1]) |
|
1708 | value2 = float(zvalueList[1]) | |
1707 | except: |
|
1709 | except: | |
1708 | self.console.clear() |
|
1710 | self.console.clear() | |
1709 | self.console.append("Invalid magnitude range") |
|
1711 | self.console.append("Invalid magnitude range") | |
1710 | return 0 |
|
1712 | return 0 | |
1711 |
|
1713 | |||
1712 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1714 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1713 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1715 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1714 |
|
1716 | |||
1715 | if not phaserange == '': |
|
1717 | if not phaserange == '': | |
1716 | zvalueList = phaserange.split(",") |
|
1718 | zvalueList = phaserange.split(",") | |
1717 | try: |
|
1719 | try: | |
1718 | value1 = float(zvalueList[0]) |
|
1720 | value1 = float(zvalueList[0]) | |
1719 | value2 = float(zvalueList[1]) |
|
1721 | value2 = float(zvalueList[1]) | |
1720 | except: |
|
1722 | except: | |
1721 | self.console.clear() |
|
1723 | self.console.clear() | |
1722 | self.console.append("Invalid phase range") |
|
1724 | self.console.append("Invalid phase range") | |
1723 | return 0 |
|
1725 | return 0 | |
1724 |
|
1726 | |||
1725 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1727 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1726 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1728 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1727 |
|
1729 | |||
1728 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1730 | if self.specGraphSaveCoherencemap.isChecked(): | |
1729 | checkPath = True |
|
1731 | checkPath = True | |
1730 | opObj.addParameter(name='save', value='1', format='bool') |
|
1732 | opObj.addParameter(name='save', value='1', format='bool') | |
1731 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1733 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1732 | if figfile: |
|
1734 | if figfile: | |
1733 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1735 | opObj.addParameter(name='figfile', value=value, format='str') | |
1734 | if wrperiod: |
|
1736 | if wrperiod: | |
1735 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1737 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1736 |
|
1738 | |||
1737 | if self.specGraphftpCoherencemap.isChecked(): |
|
1739 | if self.specGraphftpCoherencemap.isChecked(): | |
1738 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1740 | opObj.addParameter(name='ftp', value='1', format='int') | |
1739 | self.addFTPConf2Operation(puObj, opObj) |
|
1741 | self.addFTPConf2Operation(puObj, opObj) | |
1740 | addFTP = True |
|
1742 | addFTP = True | |
1741 |
|
1743 | |||
1742 | if self.specGraphPowerprofile.isChecked(): |
|
1744 | if self.specGraphPowerprofile.isChecked(): | |
1743 |
|
1745 | |||
1744 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1746 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1745 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1747 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1746 |
|
1748 | |||
1747 | if not channelList == '': |
|
1749 | if not channelList == '': | |
1748 | if not isList(channelList): |
|
1750 | if not isList(channelList): | |
1749 | self.console.append("Invalid channelList") |
|
1751 | self.console.append("Invalid channelList") | |
1750 | return 0 |
|
1752 | return 0 | |
1751 |
|
1753 | |||
1752 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1754 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1753 |
|
1755 | |||
1754 | if not db_range == '': |
|
1756 | if not db_range == '': | |
1755 | xvalueList = db_range.split(',') |
|
1757 | xvalueList = db_range.split(',') | |
1756 | try: |
|
1758 | try: | |
1757 | value1 = float(xvalueList[0]) |
|
1759 | value1 = float(xvalueList[0]) | |
1758 | value2 = float(xvalueList[1]) |
|
1760 | value2 = float(xvalueList[1]) | |
1759 | except: |
|
1761 | except: | |
1760 | self.console.clear() |
|
1762 | self.console.clear() | |
1761 | self.console.append("Invalid db range") |
|
1763 | self.console.append("Invalid db range") | |
1762 | return 0 |
|
1764 | return 0 | |
1763 |
|
1765 | |||
1764 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1766 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1765 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1767 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1766 |
|
1768 | |||
1767 | if not hei_range == '': |
|
1769 | if not hei_range == '': | |
1768 | yvalueList = hei_range.split(",") |
|
1770 | yvalueList = hei_range.split(",") | |
1769 | try: |
|
1771 | try: | |
1770 | value1 = float(yvalueList[0]) |
|
1772 | value1 = float(yvalueList[0]) | |
1771 | value2 = float(yvalueList[1]) |
|
1773 | value2 = float(yvalueList[1]) | |
1772 | except: |
|
1774 | except: | |
1773 | self.console.clear() |
|
1775 | self.console.clear() | |
1774 | self.console.append("Invalid height range") |
|
1776 | self.console.append("Invalid height range") | |
1775 | return 0 |
|
1777 | return 0 | |
1776 |
|
1778 | |||
1777 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1779 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1778 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1780 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1779 |
|
1781 | |||
1780 | if self.specGraphSavePowerprofile.isChecked(): |
|
1782 | if self.specGraphSavePowerprofile.isChecked(): | |
1781 | checkPath = True |
|
1783 | checkPath = True | |
1782 | opObj.addParameter(name='save', value='1', format='bool') |
|
1784 | opObj.addParameter(name='save', value='1', format='bool') | |
1783 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1785 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1784 | if figfile: |
|
1786 | if figfile: | |
1785 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1787 | opObj.addParameter(name='figfile', value=value, format='str') | |
1786 | if wrperiod: |
|
1788 | if wrperiod: | |
1787 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1789 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1788 |
|
1790 | |||
1789 | if self.specGraphftpPowerprofile.isChecked(): |
|
1791 | if self.specGraphftpPowerprofile.isChecked(): | |
1790 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1792 | opObj.addParameter(name='ftp', value='1', format='int') | |
1791 | self.addFTPConf2Operation(puObj, opObj) |
|
1793 | self.addFTPConf2Operation(puObj, opObj) | |
1792 | addFTP = True |
|
1794 | addFTP = True | |
1793 | # rti noise |
|
1795 | # rti noise | |
1794 |
|
1796 | |||
1795 | if self.specGraphCebRTInoise.isChecked(): |
|
1797 | if self.specGraphCebRTInoise.isChecked(): | |
1796 |
|
1798 | |||
1797 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1799 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1798 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1800 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1799 |
|
1801 | |||
1800 | if not channelList == '': |
|
1802 | if not channelList == '': | |
1801 | if not isList(channelList): |
|
1803 | if not isList(channelList): | |
1802 | self.console.append("Invalid channelList") |
|
1804 | self.console.append("Invalid channelList") | |
1803 | return 0 |
|
1805 | return 0 | |
1804 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1806 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1805 |
|
1807 | |||
1806 | # if not timerange == '': |
|
1808 | # if not timerange == '': | |
1807 | # try: |
|
1809 | # try: | |
1808 | # timerange = float(timerange) |
|
1810 | # timerange = float(timerange) | |
1809 | # except: |
|
1811 | # except: | |
1810 | # self.console.clear() |
|
1812 | # self.console.clear() | |
1811 | # self.console.append("Invalid time range") |
|
1813 | # self.console.append("Invalid time range") | |
1812 | # return 0 |
|
1814 | # return 0 | |
1813 | # |
|
1815 | # | |
1814 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1816 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1815 |
|
1817 | |||
1816 | if not trange == '': |
|
1818 | if not trange == '': | |
1817 | xvalueList = trange.split(',') |
|
1819 | xvalueList = trange.split(',') | |
1818 | try: |
|
1820 | try: | |
1819 | value1 = float(xvalueList[0]) |
|
1821 | value1 = float(xvalueList[0]) | |
1820 | value2 = float(xvalueList[1]) |
|
1822 | value2 = float(xvalueList[1]) | |
1821 | except: |
|
1823 | except: | |
1822 | self.console.clear() |
|
1824 | self.console.clear() | |
1823 | self.console.append("Invalid time range") |
|
1825 | self.console.append("Invalid time range") | |
1824 | return 0 |
|
1826 | return 0 | |
1825 |
|
1827 | |||
1826 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1828 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1827 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1829 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1828 |
|
1830 | |||
1829 | if not db_range == '': |
|
1831 | if not db_range == '': | |
1830 | yvalueList = db_range.split(",") |
|
1832 | yvalueList = db_range.split(",") | |
1831 | try: |
|
1833 | try: | |
1832 | value1 = float(yvalueList[0]) |
|
1834 | value1 = float(yvalueList[0]) | |
1833 | value2 = float(yvalueList[1]) |
|
1835 | value2 = float(yvalueList[1]) | |
1834 | except: |
|
1836 | except: | |
1835 | self.console.clear() |
|
1837 | self.console.clear() | |
1836 | self.console.append("Invalid db range") |
|
1838 | self.console.append("Invalid db range") | |
1837 | return 0 |
|
1839 | return 0 | |
1838 |
|
1840 | |||
1839 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1841 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1840 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1842 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1841 |
|
1843 | |||
1842 | if self.specGraphSaveRTInoise.isChecked(): |
|
1844 | if self.specGraphSaveRTInoise.isChecked(): | |
1843 | checkPath = True |
|
1845 | checkPath = True | |
1844 | opObj.addParameter(name='save', value='1', format='bool') |
|
1846 | opObj.addParameter(name='save', value='1', format='bool') | |
1845 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1847 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1846 | if figfile: |
|
1848 | if figfile: | |
1847 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1849 | opObj.addParameter(name='figfile', value=value, format='str') | |
1848 | if wrperiod: |
|
1850 | if wrperiod: | |
1849 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1851 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1850 |
|
1852 | |||
1851 | # test_ftp |
|
1853 | # test_ftp | |
1852 | if self.specGraphftpRTInoise.isChecked(): |
|
1854 | if self.specGraphftpRTInoise.isChecked(): | |
1853 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1855 | opObj.addParameter(name='ftp', value='1', format='int') | |
1854 | self.addFTPConf2Operation(puObj, opObj) |
|
1856 | self.addFTPConf2Operation(puObj, opObj) | |
1855 | addFTP = True |
|
1857 | addFTP = True | |
1856 |
|
1858 | |||
1857 | if checkPath: |
|
1859 | if checkPath: | |
1858 | if not figpath: |
|
1860 | if not figpath: | |
1859 | self.console.clear() |
|
1861 | self.console.clear() | |
1860 | self.console.append("Graphic path should be defined") |
|
1862 | self.console.append("Graphic path should be defined") | |
1861 | return 0 |
|
1863 | return 0 | |
1862 |
|
1864 | |||
1863 | if addFTP and not figpath: |
|
1865 | if addFTP and not figpath: | |
1864 | self.console.clear() |
|
1866 | self.console.clear() | |
1865 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1867 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1866 | return 0 |
|
1868 | return 0 | |
1867 |
|
1869 | |||
1868 | # if something happend |
|
1870 | # if something happend | |
1869 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1871 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1870 | if parms_ok: |
|
1872 | if parms_ok: | |
1871 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1873 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1872 | opObj.addParameter(name='path', value=output_path) |
|
1874 | opObj.addParameter(name='path', value=output_path) | |
1873 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1875 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1874 |
|
1876 | |||
1875 | self.console.clear() |
|
1877 | self.console.clear() | |
1876 | try: |
|
1878 | try: | |
1877 | self.refreshPUProperties(puObj) |
|
1879 | self.refreshPUProperties(puObj) | |
1878 | except: |
|
1880 | except: | |
1879 | self.console.append("An error reading input parameters was found ... Check them!") |
|
1881 | self.console.append("An error reading input parameters was found ... Check them!") | |
1880 | return 0 |
|
1882 | return 0 | |
1881 |
|
1883 | |||
1882 | self.console.append("Save your project and press Play button to start signal processing") |
|
1884 | self.console.append("Save your project and press Play button to start signal processing") | |
1883 |
|
1885 | |||
1884 | self._enable_play_button() |
|
1886 | self._enable_play_button() | |
1885 | self._enable_save_button() |
|
1887 | self._enable_save_button() | |
1886 |
|
1888 | |||
1887 | return 1 |
|
1889 | return 1 | |
1888 |
|
1890 | |||
1889 | """ |
|
1891 | """ | |
1890 | Spectra Graph |
|
1892 | Spectra Graph | |
1891 | """ |
|
1893 | """ | |
1892 | @pyqtSignature("int") |
|
1894 | @pyqtSignature("int") | |
1893 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1895 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1894 |
|
1896 | |||
1895 | self.__checkSpecGraphFilters() |
|
1897 | self.__checkSpecGraphFilters() | |
1896 |
|
1898 | |||
1897 |
|
1899 | |||
1898 | @pyqtSignature("int") |
|
1900 | @pyqtSignature("int") | |
1899 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1901 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1900 |
|
1902 | |||
1901 | self.__checkSpecGraphFilters() |
|
1903 | self.__checkSpecGraphFilters() | |
1902 |
|
1904 | |||
1903 | @pyqtSignature("int") |
|
1905 | @pyqtSignature("int") | |
1904 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1906 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1905 |
|
1907 | |||
1906 | self.__checkSpecGraphFilters() |
|
1908 | self.__checkSpecGraphFilters() | |
1907 |
|
1909 | |||
1908 |
|
1910 | |||
1909 | @pyqtSignature("int") |
|
1911 | @pyqtSignature("int") | |
1910 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1912 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1911 |
|
1913 | |||
1912 | self.__checkSpecGraphFilters() |
|
1914 | self.__checkSpecGraphFilters() | |
1913 |
|
1915 | |||
1914 |
|
1916 | |||
1915 | @pyqtSignature("int") |
|
1917 | @pyqtSignature("int") | |
1916 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1918 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1917 |
|
1919 | |||
1918 | self.__checkSpecGraphFilters() |
|
1920 | self.__checkSpecGraphFilters() | |
1919 |
|
1921 | |||
1920 | @pyqtSignature("int") |
|
1922 | @pyqtSignature("int") | |
1921 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1923 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1922 |
|
1924 | |||
1923 | self.__checkSpecGraphFilters() |
|
1925 | self.__checkSpecGraphFilters() | |
1924 |
|
1926 | |||
1925 | @pyqtSignature("int") |
|
1927 | @pyqtSignature("int") | |
1926 | def on_specGraphPhase_stateChanged(self, p0): |
|
1928 | def on_specGraphPhase_stateChanged(self, p0): | |
1927 |
|
1929 | |||
1928 | self.__checkSpecGraphFilters() |
|
1930 | self.__checkSpecGraphFilters() | |
1929 |
|
1931 | |||
1930 | @pyqtSignature("int") |
|
1932 | @pyqtSignature("int") | |
1931 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1933 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1932 | """ |
|
1934 | """ | |
1933 | """ |
|
1935 | """ | |
1934 | self.__checkSpecGraphSaving() |
|
1936 | self.__checkSpecGraphSaving() | |
1935 |
|
1937 | |||
1936 | @pyqtSignature("int") |
|
1938 | @pyqtSignature("int") | |
1937 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1939 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1938 |
|
1940 | |||
1939 | self.__checkSpecGraphSaving() |
|
1941 | self.__checkSpecGraphSaving() | |
1940 |
|
1942 | |||
1941 | @pyqtSignature("int") |
|
1943 | @pyqtSignature("int") | |
1942 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1944 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1943 |
|
1945 | |||
1944 | self.__checkSpecGraphSaving() |
|
1946 | self.__checkSpecGraphSaving() | |
1945 |
|
1947 | |||
1946 | @pyqtSignature("int") |
|
1948 | @pyqtSignature("int") | |
1947 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1949 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1948 |
|
1950 | |||
1949 | self.__checkSpecGraphSaving() |
|
1951 | self.__checkSpecGraphSaving() | |
1950 |
|
1952 | |||
1951 | @pyqtSignature("int") |
|
1953 | @pyqtSignature("int") | |
1952 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1954 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1953 |
|
1955 | |||
1954 | self.__checkSpecGraphSaving() |
|
1956 | self.__checkSpecGraphSaving() | |
1955 |
|
1957 | |||
1956 | @pyqtSignature("int") |
|
1958 | @pyqtSignature("int") | |
1957 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1959 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1958 |
|
1960 | |||
1959 | self.__checkSpecGraphSaving() |
|
1961 | self.__checkSpecGraphSaving() | |
1960 |
|
1962 | |||
1961 | @pyqtSignature("int") |
|
1963 | @pyqtSignature("int") | |
1962 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1964 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1963 | """ |
|
1965 | """ | |
1964 | """ |
|
1966 | """ | |
1965 | self.__checkSpecGraphFTP() |
|
1967 | self.__checkSpecGraphFTP() | |
1966 |
|
1968 | |||
1967 |
|
1969 | |||
1968 | @pyqtSignature("int") |
|
1970 | @pyqtSignature("int") | |
1969 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1971 | def on_specGraphftpCross_stateChanged(self, p0): | |
1970 |
|
1972 | |||
1971 | self.__checkSpecGraphFTP() |
|
1973 | self.__checkSpecGraphFTP() | |
1972 |
|
1974 | |||
1973 | @pyqtSignature("int") |
|
1975 | @pyqtSignature("int") | |
1974 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1976 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1975 |
|
1977 | |||
1976 | self.__checkSpecGraphFTP() |
|
1978 | self.__checkSpecGraphFTP() | |
1977 |
|
1979 | |||
1978 | @pyqtSignature("int") |
|
1980 | @pyqtSignature("int") | |
1979 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1981 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1980 |
|
1982 | |||
1981 | self.__checkSpecGraphFTP() |
|
1983 | self.__checkSpecGraphFTP() | |
1982 |
|
1984 | |||
1983 | @pyqtSignature("int") |
|
1985 | @pyqtSignature("int") | |
1984 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1986 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1985 |
|
1987 | |||
1986 | self.__checkSpecGraphFTP() |
|
1988 | self.__checkSpecGraphFTP() | |
1987 |
|
1989 | |||
1988 | @pyqtSignature("int") |
|
1990 | @pyqtSignature("int") | |
1989 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1991 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1990 |
|
1992 | |||
1991 | self.__checkSpecGraphFTP() |
|
1993 | self.__checkSpecGraphFTP() | |
1992 |
|
1994 | |||
1993 | @pyqtSignature("") |
|
1995 | @pyqtSignature("") | |
1994 | def on_specGraphToolPath_clicked(self): |
|
1996 | def on_specGraphToolPath_clicked(self): | |
1995 | """ |
|
1997 | """ | |
1996 | """ |
|
1998 | """ | |
1997 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1999 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1998 | self.specGraphPath.setText(save_path) |
|
2000 | self.specGraphPath.setText(save_path) | |
1999 | if not os.path.exists(save_path): |
|
2001 | if not os.path.exists(save_path): | |
2000 | self.console.clear() |
|
2002 | self.console.clear() | |
2001 | self.console.append("Write a valid path") |
|
2003 | self.console.append("Write a valid path") | |
2002 | return |
|
2004 | return | |
2003 |
|
2005 | |||
2004 | @pyqtSignature("") |
|
2006 | @pyqtSignature("") | |
2005 | def on_specGraphClear_clicked(self): |
|
2007 | def on_specGraphClear_clicked(self): | |
2006 | return |
|
2008 | return | |
2007 |
|
2009 | |||
2008 | @pyqtSignature("") |
|
2010 | @pyqtSignature("") | |
2009 | def on_specHeisGraphToolPath_clicked(self): |
|
2011 | def on_specHeisGraphToolPath_clicked(self): | |
2010 | """ |
|
2012 | """ | |
2011 | """ |
|
2013 | """ | |
2012 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2014 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2013 | self.specHeisGraphPath.setText(save_path) |
|
2015 | self.specHeisGraphPath.setText(save_path) | |
2014 | if not os.path.exists(save_path): |
|
2016 | if not os.path.exists(save_path): | |
2015 | self.console.clear() |
|
2017 | self.console.clear() | |
2016 | self.console.append("Write a valid path") |
|
2018 | self.console.append("Write a valid path") | |
2017 | return |
|
2019 | return | |
2018 |
|
2020 | |||
2019 | @pyqtSignature("int") |
|
2021 | @pyqtSignature("int") | |
2020 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2022 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2021 | """ |
|
2023 | """ | |
2022 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2024 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2023 | """ |
|
2025 | """ | |
2024 | if p0 == 2: |
|
2026 | if p0 == 2: | |
2025 | self.specHeisOpIncoherent.setEnabled(True) |
|
2027 | self.specHeisOpIncoherent.setEnabled(True) | |
2026 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2028 | self.specHeisOpCobIncInt.setEnabled(True) | |
2027 | if p0 == 0: |
|
2029 | if p0 == 0: | |
2028 | self.specHeisOpIncoherent.setEnabled(False) |
|
2030 | self.specHeisOpIncoherent.setEnabled(False) | |
2029 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2031 | self.specHeisOpCobIncInt.setEnabled(False) | |
2030 |
|
2032 | |||
2031 | @pyqtSignature("") |
|
2033 | @pyqtSignature("") | |
2032 | def on_specHeisOpOk_clicked(self): |
|
2034 | def on_specHeisOpOk_clicked(self): | |
2033 | """ |
|
2035 | """ | |
2034 | AΓADE OPERACION SPECTRAHEIS |
|
2036 | AΓADE OPERACION SPECTRAHEIS | |
2035 | """ |
|
2037 | """ | |
2036 | addFTP = False |
|
2038 | addFTP = False | |
2037 | checkPath = False |
|
2039 | checkPath = False | |
2038 |
|
2040 | |||
2039 | self._disable_play_button() |
|
2041 | self._disable_play_button() | |
2040 | self._disable_save_button() |
|
2042 | self._disable_save_button() | |
2041 |
|
2043 | |||
2042 | self.console.clear() |
|
2044 | self.console.clear() | |
2043 | self.console.append("Checking input parameters ...") |
|
2045 | self.console.append("Checking input parameters ...") | |
2044 |
|
2046 | |||
2045 | puObj = self.getSelectedItemObj() |
|
2047 | puObj = self.getSelectedItemObj() | |
2046 | puObj.removeOperations() |
|
2048 | puObj.removeOperations() | |
2047 |
|
2049 | |||
2048 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2050 | if self.specHeisOpCebIncoherent.isChecked(): | |
2049 | value = str(self.specHeisOpIncoherent.text()) |
|
2051 | value = str(self.specHeisOpIncoherent.text()) | |
2050 | name_operation = 'IncohInt4SpectraHeis' |
|
2052 | name_operation = 'IncohInt4SpectraHeis' | |
2051 | optype = 'other' |
|
2053 | optype = 'other' | |
2052 |
|
2054 | |||
2053 | name_parameter = 'timeInterval' |
|
2055 | name_parameter = 'timeInterval' | |
2054 | format = 'float' |
|
2056 | format = 'float' | |
2055 |
|
2057 | |||
2056 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2058 | if self.specOpCobIncInt.currentIndex() == 0: | |
2057 | name_parameter = 'timeInterval' |
|
2059 | name_parameter = 'timeInterval' | |
2058 | format = 'float' |
|
2060 | format = 'float' | |
2059 |
|
2061 | |||
2060 | if not isFloat(value): |
|
2062 | if not isFloat(value): | |
2061 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2063 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2062 | return 0 |
|
2064 | return 0 | |
2063 |
|
2065 | |||
2064 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2066 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2065 |
|
2067 | |||
2066 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2068 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2067 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2069 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2068 | return 0 |
|
2070 | return 0 | |
2069 |
|
2071 | |||
2070 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2072 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2071 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2073 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2072 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2074 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2073 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2075 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2074 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2076 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2075 |
|
2077 | |||
2076 | # ---- Spectra Plot----- |
|
2078 | # ---- Spectra Plot----- | |
2077 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2079 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2078 |
|
2080 | |||
2079 | name_operation = 'SpectraHeisScope' |
|
2081 | name_operation = 'SpectraHeisScope' | |
2080 | optype = 'other' |
|
2082 | optype = 'other' | |
2081 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2083 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2082 |
|
2084 | |||
2083 | name_parameter = 'id' |
|
2085 | name_parameter = 'id' | |
2084 | format = 'int' |
|
2086 | format = 'int' | |
2085 | value = opObj.id |
|
2087 | value = opObj.id | |
2086 |
|
2088 | |||
2087 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2089 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2088 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2090 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2089 | return 0 |
|
2091 | return 0 | |
2090 |
|
2092 | |||
2091 | if not (channelList == ''): |
|
2093 | if not (channelList == ''): | |
2092 | name_parameter = 'channelList' |
|
2094 | name_parameter = 'channelList' | |
2093 | format = 'intlist' |
|
2095 | format = 'intlist' | |
2094 |
|
2096 | |||
2095 | if not isList(channelList): |
|
2097 | if not isList(channelList): | |
2096 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2098 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2097 | return 0 |
|
2099 | return 0 | |
2098 |
|
2100 | |||
2099 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2101 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2100 |
|
2102 | |||
2101 | if not freq_range == '': |
|
2103 | if not freq_range == '': | |
2102 | xvalueList = freq_range.split(',') |
|
2104 | xvalueList = freq_range.split(',') | |
2103 |
|
2105 | |||
2104 | if len(xvalueList) != 2: |
|
2106 | if len(xvalueList) != 2: | |
2105 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2107 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2106 | return 0 |
|
2108 | return 0 | |
2107 |
|
2109 | |||
2108 | value1 = xvalueList[0] |
|
2110 | value1 = xvalueList[0] | |
2109 | value2 = xvalueList[1] |
|
2111 | value2 = xvalueList[1] | |
2110 |
|
2112 | |||
2111 | if not isFloat(value1) or not isFloat(value2): |
|
2113 | if not isFloat(value1) or not isFloat(value2): | |
2112 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2114 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2113 | return 0 |
|
2115 | return 0 | |
2114 |
|
2116 | |||
2115 | name1 = 'xmin' |
|
2117 | name1 = 'xmin' | |
2116 | name2 = 'xmax' |
|
2118 | name2 = 'xmax' | |
2117 | format = 'float' |
|
2119 | format = 'float' | |
2118 |
|
2120 | |||
2119 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2121 | opObj.addParameter(name=name1, value=value1, format=format) | |
2120 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2122 | opObj.addParameter(name=name2, value=value2, format=format) | |
2121 |
|
2123 | |||
2122 | #------specHeisGgraphYmin-Ymax--- |
|
2124 | #------specHeisGgraphYmin-Ymax--- | |
2123 | if not power_range == '': |
|
2125 | if not power_range == '': | |
2124 | yvalueList = power_range.split(",") |
|
2126 | yvalueList = power_range.split(",") | |
2125 |
|
2127 | |||
2126 | if len(yvalueList) != 2: |
|
2128 | if len(yvalueList) != 2: | |
2127 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2129 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2128 | return 0 |
|
2130 | return 0 | |
2129 |
|
2131 | |||
2130 | value1 = yvalueList[0] |
|
2132 | value1 = yvalueList[0] | |
2131 | value2 = yvalueList[1] |
|
2133 | value2 = yvalueList[1] | |
2132 |
|
2134 | |||
2133 | if not isFloat(value1) or not isFloat(value2): |
|
2135 | if not isFloat(value1) or not isFloat(value2): | |
2134 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2136 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2135 | return 0 |
|
2137 | return 0 | |
2136 |
|
2138 | |||
2137 | name1 = 'ymin' |
|
2139 | name1 = 'ymin' | |
2138 | name2 = 'ymax' |
|
2140 | name2 = 'ymax' | |
2139 | format = 'float' |
|
2141 | format = 'float' | |
2140 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2142 | opObj.addParameter(name=name1, value=value1, format=format) | |
2141 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2143 | opObj.addParameter(name=name2, value=value2, format=format) | |
2142 |
|
2144 | |||
2143 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2145 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2144 | checkPath = True |
|
2146 | checkPath = True | |
2145 | name_parameter1 = 'save' |
|
2147 | name_parameter1 = 'save' | |
2146 | name_parameter2 = 'figpath' |
|
2148 | name_parameter2 = 'figpath' | |
2147 | name_parameter3 = 'figfile' |
|
2149 | name_parameter3 = 'figfile' | |
2148 | value1 = '1' |
|
2150 | value1 = '1' | |
2149 | value2 = str(self.specHeisGraphPath.text()) |
|
2151 | value2 = str(self.specHeisGraphPath.text()) | |
2150 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2152 | value3 = str(self.specHeisGraphPrefix.text()) | |
2151 | format1 = 'bool' |
|
2153 | format1 = 'bool' | |
2152 | format2 = 'str' |
|
2154 | format2 = 'str' | |
2153 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2155 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2154 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2156 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2155 | if not value3 == "": |
|
2157 | if not value3 == "": | |
2156 | try: |
|
2158 | try: | |
2157 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2159 | value3 = str(self.specHeisGraphPrefix.text()) | |
2158 | except: |
|
2160 | except: | |
2159 | self.console.clear() |
|
2161 | self.console.clear() | |
2160 | self.console.append("Please Write prefix") |
|
2162 | self.console.append("Please Write prefix") | |
2161 | return 0 |
|
2163 | return 0 | |
2162 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2164 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2163 |
|
2165 | |||
2164 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2166 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2165 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2167 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2166 |
|
2168 | |||
2167 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2169 | if self.specHeisGraphftpSpectra.isChecked(): | |
2168 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2170 | opObj.addParameter(name='ftp', value='1', format='int') | |
2169 | self.addFTPConf2Operation(puObj, opObj) |
|
2171 | self.addFTPConf2Operation(puObj, opObj) | |
2170 | addFTP = True |
|
2172 | addFTP = True | |
2171 |
|
2173 | |||
2172 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2174 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2173 | name_operation = 'RTIfromSpectraHeis' |
|
2175 | name_operation = 'RTIfromSpectraHeis' | |
2174 | optype = 'other' |
|
2176 | optype = 'other' | |
2175 |
|
2177 | |||
2176 | name_parameter = 'id' |
|
2178 | name_parameter = 'id' | |
2177 | format = 'int' |
|
2179 | format = 'int' | |
2178 |
|
2180 | |||
2179 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2181 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2180 | value = opObj.id |
|
2182 | value = opObj.id | |
2181 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2183 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2182 |
|
2184 | |||
2183 | if not channelList == '': |
|
2185 | if not channelList == '': | |
2184 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2186 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2185 |
|
2187 | |||
2186 | if not time_range == '': |
|
2188 | if not time_range == '': | |
2187 | xvalueList = time_range.split(',') |
|
2189 | xvalueList = time_range.split(',') | |
2188 | try: |
|
2190 | try: | |
2189 | value = float(xvalueList[0]) |
|
2191 | value = float(xvalueList[0]) | |
2190 | value = float(xvalueList[1]) |
|
2192 | value = float(xvalueList[1]) | |
2191 | except: |
|
2193 | except: | |
2192 | return 0 |
|
2194 | return 0 | |
2193 | format = 'float' |
|
2195 | format = 'float' | |
2194 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2196 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2195 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2197 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2196 |
|
2198 | |||
2197 | if not timerange == '': |
|
2199 | if not timerange == '': | |
2198 | format = 'int' |
|
2200 | format = 'int' | |
2199 | try: |
|
2201 | try: | |
2200 | timerange = int(timerange) |
|
2202 | timerange = int(timerange) | |
2201 | except: |
|
2203 | except: | |
2202 | return 0 |
|
2204 | return 0 | |
2203 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2205 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2204 |
|
2206 | |||
2205 |
|
2207 | |||
2206 | if not power_range == '': |
|
2208 | if not power_range == '': | |
2207 | yvalueList = power_range.split(",") |
|
2209 | yvalueList = power_range.split(",") | |
2208 | try: |
|
2210 | try: | |
2209 | value = float(yvalueList[0]) |
|
2211 | value = float(yvalueList[0]) | |
2210 | value = float(yvalueList[1]) |
|
2212 | value = float(yvalueList[1]) | |
2211 | except: |
|
2213 | except: | |
2212 | return 0 |
|
2214 | return 0 | |
2213 |
|
2215 | |||
2214 | format = 'float' |
|
2216 | format = 'float' | |
2215 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2217 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2216 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2218 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2217 |
|
2219 | |||
2218 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2220 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2219 | checkPath = True |
|
2221 | checkPath = True | |
2220 | opObj.addParameter(name='save', value='1', format='bool') |
|
2222 | opObj.addParameter(name='save', value='1', format='bool') | |
2221 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2223 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2222 | value = str(self.specHeisGraphPrefix.text()) |
|
2224 | value = str(self.specHeisGraphPrefix.text()) | |
2223 | if not value == "": |
|
2225 | if not value == "": | |
2224 | try: |
|
2226 | try: | |
2225 | value = str(self.specHeisGraphPrefix.text()) |
|
2227 | value = str(self.specHeisGraphPrefix.text()) | |
2226 | except: |
|
2228 | except: | |
2227 | self.console.clear() |
|
2229 | self.console.clear() | |
2228 | self.console.append("Please Write prefix") |
|
2230 | self.console.append("Please Write prefix") | |
2229 | return 0 |
|
2231 | return 0 | |
2230 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2232 | opObj.addParameter(name='figfile', value=value, format='str') | |
2231 |
|
2233 | |||
2232 | # test_ftp |
|
2234 | # test_ftp | |
2233 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2235 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2234 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2236 | opObj.addParameter(name='ftp', value='1', format='int') | |
2235 | self.addFTPConf2Operation(puObj, opObj) |
|
2237 | self.addFTPConf2Operation(puObj, opObj) | |
2236 | addFTP = True |
|
2238 | addFTP = True | |
2237 |
|
2239 | |||
2238 | localfolder = None |
|
2240 | localfolder = None | |
2239 | if checkPath: |
|
2241 | if checkPath: | |
2240 | localfolder = str(self.specHeisGraphPath.text()) |
|
2242 | localfolder = str(self.specHeisGraphPath.text()) | |
2241 | if localfolder == '': |
|
2243 | if localfolder == '': | |
2242 | self.console.clear() |
|
2244 | self.console.clear() | |
2243 | self.console.append("Graphic path should be defined") |
|
2245 | self.console.append("Graphic path should be defined") | |
2244 | return 0 |
|
2246 | return 0 | |
2245 |
|
2247 | |||
2246 | if addFTP and not localfolder: |
|
2248 | if addFTP and not localfolder: | |
2247 | self.console.clear() |
|
2249 | self.console.clear() | |
2248 | self.console.append("You should save plots before send them to FTP Server") |
|
2250 | self.console.append("You should save plots before send them to FTP Server") | |
2249 | return 0 |
|
2251 | return 0 | |
2250 |
|
2252 | |||
2251 | # if something happened |
|
2253 | # if something happened | |
2252 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2254 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2253 | if parms_ok: |
|
2255 | if parms_ok: | |
2254 | name_operation = 'FitsWriter' |
|
2256 | name_operation = 'FitsWriter' | |
2255 | optype = 'other' |
|
2257 | optype = 'other' | |
2256 | name_parameter1 = 'path' |
|
2258 | name_parameter1 = 'path' | |
2257 | name_parameter2 = 'dataBlocksPerFile' |
|
2259 | name_parameter2 = 'dataBlocksPerFile' | |
2258 | name_parameter3 = 'metadatafile' |
|
2260 | name_parameter3 = 'metadatafile' | |
2259 | value1 = output_path |
|
2261 | value1 = output_path | |
2260 | value2 = blocksperfile |
|
2262 | value2 = blocksperfile | |
2261 | value3 = metadata_file |
|
2263 | value3 = metadata_file | |
2262 | format2 = "int" |
|
2264 | format2 = "int" | |
2263 | format3 = "str" |
|
2265 | format3 = "str" | |
2264 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2266 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2265 |
|
2267 | |||
2266 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2268 | opObj.addParameter(name=name_parameter1, value=value1) | |
2267 |
|
2269 | |||
2268 | if blocksperfile: |
|
2270 | if blocksperfile: | |
2269 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2271 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2270 |
|
2272 | |||
2271 | if metadata_file: |
|
2273 | if metadata_file: | |
2272 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2274 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2273 |
|
2275 | |||
2274 | self.console.clear() |
|
2276 | self.console.clear() | |
2275 | try: |
|
2277 | try: | |
2276 | self.refreshPUProperties(puObj) |
|
2278 | self.refreshPUProperties(puObj) | |
2277 | except: |
|
2279 | except: | |
2278 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2280 | self.console.append("An error reading input parameters was found ... Check them!") | |
2279 | return 0 |
|
2281 | return 0 | |
2280 |
|
2282 | |||
2281 | self.console.append("Save your project and press Play button to start signal processing") |
|
2283 | self.console.append("Save your project and press Play button to start signal processing") | |
2282 |
|
2284 | |||
2283 | self._enable_save_button() |
|
2285 | self._enable_save_button() | |
2284 | self._enable_play_button() |
|
2286 | self._enable_play_button() | |
2285 |
|
2287 | |||
2286 | return 1 |
|
2288 | return 1 | |
2287 | @pyqtSignature("int") |
|
2289 | @pyqtSignature("int") | |
2288 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2290 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2289 |
|
2291 | |||
2290 | if p0 == 2: |
|
2292 | if p0 == 2: | |
2291 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2293 | self.specHeisGgraphChannelList.setEnabled(True) | |
2292 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2294 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2293 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2295 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2294 | if p0 == 0: |
|
2296 | if p0 == 0: | |
2295 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2297 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2296 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2298 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2297 |
|
2299 | |||
2298 | @pyqtSignature("int") |
|
2300 | @pyqtSignature("int") | |
2299 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2301 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2300 |
|
2302 | |||
2301 | if p0 == 2: |
|
2303 | if p0 == 2: | |
2302 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2304 | self.specHeisGgraphChannelList.setEnabled(True) | |
2303 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2305 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2304 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2306 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2305 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2307 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2306 |
|
2308 | |||
2307 | if p0 == 0: |
|
2309 | if p0 == 0: | |
2308 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2310 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2309 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2311 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2310 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2312 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2311 |
|
2313 | |||
2312 | @pyqtSignature("int") |
|
2314 | @pyqtSignature("int") | |
2313 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2315 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2314 | """ |
|
2316 | """ | |
2315 | """ |
|
2317 | """ | |
2316 | if p0 == 2: |
|
2318 | if p0 == 2: | |
2317 | self.specHeisGraphPath.setEnabled(True) |
|
2319 | self.specHeisGraphPath.setEnabled(True) | |
2318 | self.specHeisGraphPrefix.setEnabled(True) |
|
2320 | self.specHeisGraphPrefix.setEnabled(True) | |
2319 | self.specHeisGraphToolPath.setEnabled(True) |
|
2321 | self.specHeisGraphToolPath.setEnabled(True) | |
2320 | if p0 == 0: |
|
2322 | if p0 == 0: | |
2321 | self.specHeisGraphPath.setEnabled(False) |
|
2323 | self.specHeisGraphPath.setEnabled(False) | |
2322 | self.specHeisGraphPrefix.setEnabled(False) |
|
2324 | self.specHeisGraphPrefix.setEnabled(False) | |
2323 | self.specHeisGraphToolPath.setEnabled(False) |
|
2325 | self.specHeisGraphToolPath.setEnabled(False) | |
2324 |
|
2326 | |||
2325 | @pyqtSignature("int") |
|
2327 | @pyqtSignature("int") | |
2326 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2328 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2327 | if p0 == 2: |
|
2329 | if p0 == 2: | |
2328 | self.specHeisGraphPath.setEnabled(True) |
|
2330 | self.specHeisGraphPath.setEnabled(True) | |
2329 | self.specHeisGraphPrefix.setEnabled(True) |
|
2331 | self.specHeisGraphPrefix.setEnabled(True) | |
2330 | self.specHeisGraphToolPath.setEnabled(True) |
|
2332 | self.specHeisGraphToolPath.setEnabled(True) | |
2331 |
|
2333 | |||
2332 | @pyqtSignature("int") |
|
2334 | @pyqtSignature("int") | |
2333 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2335 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2334 | """ |
|
2336 | """ | |
2335 | """ |
|
2337 | """ | |
2336 | if p0 == 2: |
|
2338 | if p0 == 2: | |
2337 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2339 | self.specHeisGgraphftpratio.setEnabled(True) | |
2338 |
|
2340 | |||
2339 | if p0 == 0: |
|
2341 | if p0 == 0: | |
2340 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2342 | self.specHeisGgraphftpratio.setEnabled(False) | |
2341 |
|
2343 | |||
2342 | @pyqtSignature("int") |
|
2344 | @pyqtSignature("int") | |
2343 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2345 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2344 | if p0 == 2: |
|
2346 | if p0 == 2: | |
2345 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2347 | self.specHeisGgraphftpratio.setEnabled(True) | |
2346 |
|
2348 | |||
2347 | @pyqtSignature("") |
|
2349 | @pyqtSignature("") | |
2348 | def on_specHeisGraphClear_clicked(self): |
|
2350 | def on_specHeisGraphClear_clicked(self): | |
2349 | pass |
|
2351 | pass | |
2350 |
|
2352 | |||
2351 | def __checkSpecGraphSaving(self): |
|
2353 | def __checkSpecGraphSaving(self): | |
2352 |
|
2354 | |||
2353 | enable = False |
|
2355 | enable = False | |
2354 |
|
2356 | |||
2355 | if self.specGraphSaveSpectra.checkState(): |
|
2357 | if self.specGraphSaveSpectra.checkState(): | |
2356 | enable = True |
|
2358 | enable = True | |
2357 |
|
2359 | |||
2358 | if self.specGraphSaveCross.checkState(): |
|
2360 | if self.specGraphSaveCross.checkState(): | |
2359 | enable = True |
|
2361 | enable = True | |
2360 |
|
2362 | |||
2361 | if self.specGraphSaveRTIplot.checkState(): |
|
2363 | if self.specGraphSaveRTIplot.checkState(): | |
2362 | enable = True |
|
2364 | enable = True | |
2363 |
|
2365 | |||
2364 | if self.specGraphSaveCoherencemap.checkState(): |
|
2366 | if self.specGraphSaveCoherencemap.checkState(): | |
2365 | enable = True |
|
2367 | enable = True | |
2366 |
|
2368 | |||
2367 | if self.specGraphSavePowerprofile.checkState(): |
|
2369 | if self.specGraphSavePowerprofile.checkState(): | |
2368 | enable = True |
|
2370 | enable = True | |
2369 |
|
2371 | |||
2370 | if self.specGraphSaveRTInoise.checkState(): |
|
2372 | if self.specGraphSaveRTInoise.checkState(): | |
2371 | enable = True |
|
2373 | enable = True | |
2372 |
|
2374 | |||
2373 | self.specGraphPath.setEnabled(enable) |
|
2375 | self.specGraphPath.setEnabled(enable) | |
2374 | self.specGraphPrefix.setEnabled(enable) |
|
2376 | self.specGraphPrefix.setEnabled(enable) | |
2375 | self.specGraphToolPath.setEnabled(enable) |
|
2377 | self.specGraphToolPath.setEnabled(enable) | |
2376 |
|
2378 | |||
2377 | self.specGgraphftpratio.setEnabled(enable) |
|
2379 | self.specGgraphftpratio.setEnabled(enable) | |
2378 |
|
2380 | |||
2379 | def __checkSpecGraphFTP(self): |
|
2381 | def __checkSpecGraphFTP(self): | |
2380 |
|
2382 | |||
2381 | enable = False |
|
2383 | enable = False | |
2382 |
|
2384 | |||
2383 | if self.specGraphftpSpectra.checkState(): |
|
2385 | if self.specGraphftpSpectra.checkState(): | |
2384 | enable = True |
|
2386 | enable = True | |
2385 |
|
2387 | |||
2386 | if self.specGraphftpCross.checkState(): |
|
2388 | if self.specGraphftpCross.checkState(): | |
2387 | enable = True |
|
2389 | enable = True | |
2388 |
|
2390 | |||
2389 | if self.specGraphftpRTIplot.checkState(): |
|
2391 | if self.specGraphftpRTIplot.checkState(): | |
2390 | enable = True |
|
2392 | enable = True | |
2391 |
|
2393 | |||
2392 | if self.specGraphftpCoherencemap.checkState(): |
|
2394 | if self.specGraphftpCoherencemap.checkState(): | |
2393 | enable = True |
|
2395 | enable = True | |
2394 |
|
2396 | |||
2395 | if self.specGraphftpPowerprofile.checkState(): |
|
2397 | if self.specGraphftpPowerprofile.checkState(): | |
2396 | enable = True |
|
2398 | enable = True | |
2397 |
|
2399 | |||
2398 | if self.specGraphftpRTInoise.checkState(): |
|
2400 | if self.specGraphftpRTInoise.checkState(): | |
2399 | enable = True |
|
2401 | enable = True | |
2400 |
|
2402 | |||
2401 | # self.specGgraphftpratio.setEnabled(enable) |
|
2403 | # self.specGgraphftpratio.setEnabled(enable) | |
2402 |
|
2404 | |||
2403 | def __checkSpecGraphFilters(self): |
|
2405 | def __checkSpecGraphFilters(self): | |
2404 |
|
2406 | |||
2405 | freq = False |
|
2407 | freq = False | |
2406 | height = False |
|
2408 | height = False | |
2407 | db = False |
|
2409 | db = False | |
2408 | time = False |
|
2410 | timerange = False | |
2409 | magnitud = False |
|
2411 | magnitud = False | |
2410 | phase = False |
|
2412 | phase = False | |
2411 | channelList = False |
|
2413 | channelList = False | |
2412 |
|
2414 | |||
2413 | if self.specGraphCebSpectraplot.checkState(): |
|
2415 | if self.specGraphCebSpectraplot.checkState(): | |
2414 | freq = True |
|
2416 | freq = True | |
2415 | height = True |
|
2417 | height = True | |
2416 | db = True |
|
2418 | db = True | |
2417 | channelList = True |
|
2419 | channelList = True | |
2418 |
|
2420 | |||
2419 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2421 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2420 | freq = True |
|
2422 | freq = True | |
2421 | height = True |
|
2423 | height = True | |
2422 | db = True |
|
2424 | db = True | |
2423 | magnitud = True |
|
2425 | magnitud = True | |
2424 | phase = True |
|
2426 | phase = True | |
2425 |
|
2427 | |||
2426 | if self.specGraphCebRTIplot.checkState(): |
|
2428 | if self.specGraphCebRTIplot.checkState(): | |
2427 | height = True |
|
2429 | height = True | |
2428 | db = True |
|
2430 | db = True | |
2429 | time = True |
|
2431 | timerange = True | |
2430 | channelList = True |
|
2432 | channelList = True | |
2431 |
|
2433 | |||
2432 | if self.specGraphCebCoherencmap.checkState(): |
|
2434 | if self.specGraphCebCoherencmap.checkState(): | |
2433 | height = True |
|
2435 | height = True | |
2434 | time = True |
|
2436 | timerange = True | |
2435 | magnitud = True |
|
2437 | magnitud = True | |
2436 | phase = True |
|
2438 | phase = True | |
2437 |
|
2439 | |||
2438 | if self.specGraphPowerprofile.checkState(): |
|
2440 | if self.specGraphPowerprofile.checkState(): | |
2439 | height = True |
|
2441 | height = True | |
2440 | db = True |
|
2442 | db = True | |
2441 | channelList = True |
|
2443 | channelList = True | |
2442 |
|
2444 | |||
2443 | if self.specGraphCebRTInoise.checkState(): |
|
2445 | if self.specGraphCebRTInoise.checkState(): | |
2444 | db = True |
|
2446 | db = True | |
2445 | time = True |
|
2447 | timerange = True | |
2446 | channelList = True |
|
2448 | channelList = True | |
2447 |
|
2449 | |||
2448 |
|
2450 | |||
2449 | self.specGgraphFreq.setEnabled(freq) |
|
2451 | self.specGgraphFreq.setEnabled(freq) | |
2450 | self.specGgraphHeight.setEnabled(height) |
|
2452 | self.specGgraphHeight.setEnabled(height) | |
2451 | self.specGgraphDbsrange.setEnabled(db) |
|
2453 | self.specGgraphDbsrange.setEnabled(db) | |
2452 | self.specGgraphTminTmax.setEnabled(time) |
|
2454 | self.specGgraphTminTmax.setEnabled(timerange) | |
2453 |
|
2455 | |||
2454 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2456 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2455 | self.specGgraphPhase.setEnabled(phase) |
|
2457 | self.specGgraphPhase.setEnabled(phase) | |
2456 | self.specGgraphChannelList.setEnabled(channelList) |
|
2458 | self.specGgraphChannelList.setEnabled(channelList) | |
2457 |
|
2459 | |||
2458 | def __getParmsFromProjectWindow(self): |
|
2460 | def __getParmsFromProjectWindow(self): | |
2459 | """ |
|
2461 | """ | |
2460 | Check Inputs Project: |
|
2462 | Check Inputs Project: | |
2461 | - project_name |
|
2463 | - project_name | |
2462 | - datatype |
|
2464 | - datatype | |
2463 | - ext |
|
2465 | - ext | |
2464 | - data_path |
|
2466 | - data_path | |
2465 | - readmode |
|
2467 | - readmode | |
2466 | - delay |
|
2468 | - delay | |
2467 | - set |
|
2469 | - set | |
2468 | - walk |
|
2470 | - walk | |
2469 | """ |
|
2471 | """ | |
2470 | parms_ok = True |
|
2472 | parms_ok = True | |
2471 |
|
2473 | |||
2472 | project_name = str(self.proName.text()) |
|
2474 | project_name = str(self.proName.text()) | |
2473 |
|
2475 | |||
2474 | if project_name == '' or project_name == None: |
|
2476 | if project_name == '' or project_name == None: | |
2475 | outputstr = "Enter a project Name" |
|
2477 | outputstr = "Enter a project Name" | |
2476 | self.console.append(outputstr) |
|
2478 | self.console.append(outputstr) | |
2477 | parms_ok = False |
|
2479 | parms_ok = False | |
2478 | project_name = None |
|
2480 | project_name = None | |
2479 |
|
2481 | |||
2480 | description = str(self.proDescription.toPlainText()) |
|
2482 | description = str(self.proDescription.toPlainText()) | |
2481 |
|
2483 | |||
2482 | datatype = str(self.proComDataType.currentText()) |
|
2484 | datatype = str(self.proComDataType.currentText()) | |
2483 |
|
2485 | |||
2484 | ext = str(self.proDataType.text()) |
|
2486 | ext = str(self.proDataType.text()) | |
2485 |
|
2487 | |||
2486 | dpath = str(self.proDataPath.text()) |
|
2488 | dpath = str(self.proDataPath.text()) | |
2487 |
|
2489 | |||
2488 | if dpath == '': |
|
2490 | if dpath == '': | |
2489 | outputstr = 'Datapath is empty' |
|
2491 | outputstr = 'Datapath is empty' | |
2490 | self.console.append(outputstr) |
|
2492 | self.console.append(outputstr) | |
2491 | parms_ok = False |
|
2493 | parms_ok = False | |
2492 | dpath = None |
|
2494 | dpath = None | |
2493 |
|
2495 | |||
2494 | if dpath != None: |
|
2496 | if dpath != None: | |
2495 | if not os.path.isdir(dpath): |
|
2497 | if not os.path.isdir(dpath): | |
2496 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2498 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2497 | self.console.append(outputstr) |
|
2499 | self.console.append(outputstr) | |
2498 | parms_ok = False |
|
2500 | parms_ok = False | |
2499 | dpath = None |
|
2501 | dpath = None | |
2500 |
|
2502 | |||
2501 | online = int(self.proComReadMode.currentIndex()) |
|
2503 | online = int(self.proComReadMode.currentIndex()) | |
2502 |
|
2504 | |||
2503 | delay = None |
|
2505 | delay = None | |
2504 | if online==1: |
|
2506 | if online==1: | |
2505 | try: |
|
2507 | try: | |
2506 | delay = int(str(self.proDelay.text())) |
|
2508 | delay = int(str(self.proDelay.text())) | |
2507 | except: |
|
2509 | except: | |
2508 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2510 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2509 | self.console.append(outputstr) |
|
2511 | self.console.append(outputstr) | |
2510 | parms_ok = False |
|
2512 | parms_ok = False | |
2511 |
|
2513 | |||
2512 |
|
2514 | |||
2513 | set = None |
|
2515 | set = None | |
2514 | value = str(self.proSet.text()) |
|
2516 | value = str(self.proSet.text()) | |
2515 | try: |
|
2517 | try: | |
2516 | set = int(value) |
|
2518 | set = int(value) | |
2517 | except: |
|
2519 | except: | |
2518 | pass |
|
2520 | pass | |
2519 |
|
2521 | |||
2520 | ippKm = None |
|
2522 | ippKm = None | |
2521 |
|
2523 | |||
2522 | value = str(self.proIPPKm.text()) |
|
2524 | value = str(self.proIPPKm.text()) | |
2523 |
|
2525 | |||
2524 | try: |
|
2526 | try: | |
2525 | ippKm = float(value) |
|
2527 | ippKm = float(value) | |
2526 | except: |
|
2528 | except: | |
2527 | if datatype=="USRP": |
|
2529 | if datatype=="USRP": | |
2528 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2530 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2529 | self.console.append(outputstr) |
|
2531 | self.console.append(outputstr) | |
2530 | parms_ok = False |
|
2532 | parms_ok = False | |
2531 |
|
2533 | |||
2532 | walk = int(self.proComWalk.currentIndex()) |
|
2534 | walk = int(self.proComWalk.currentIndex()) | |
2533 | expLabel = str(self.proExpLabel.text()) |
|
2535 | expLabel = str(self.proExpLabel.text()) | |
2534 |
|
2536 | |||
2535 | startDate = str(self.proComStartDate.currentText()) |
|
2537 | startDate = str(self.proComStartDate.currentText()) | |
2536 | endDate = str(self.proComEndDate.currentText()) |
|
2538 | endDate = str(self.proComEndDate.currentText()) | |
2537 |
|
2539 | |||
2538 | # startDateList = startDate.split("/") |
|
2540 | # startDateList = startDate.split("/") | |
2539 | # endDateList = endDate.split("/") |
|
2541 | # endDateList = endDate.split("/") | |
2540 | # |
|
2542 | # | |
2541 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2543 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2542 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2544 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2543 |
|
2545 | |||
2544 | startTime = self.proStartTime.time() |
|
2546 | startTime = self.proStartTime.time() | |
2545 | endTime = self.proEndTime.time() |
|
2547 | endTime = self.proEndTime.time() | |
2546 |
|
2548 | |||
2547 | startTime = str(startTime.toString("H:m:s")) |
|
2549 | startTime = str(startTime.toString("H:m:s")) | |
2548 | endTime = str(endTime.toString("H:m:s")) |
|
2550 | endTime = str(endTime.toString("H:m:s")) | |
2549 |
|
2551 | |||
2550 | projectParms = ProjectParms() |
|
2552 | projectParms = ProjectParms() | |
2551 |
|
2553 | |||
2552 | projectParms.name = project_name |
|
2554 | projectParms.name = project_name | |
2553 | projectParms.description = description |
|
2555 | projectParms.description = description | |
2554 | projectParms.datatype = datatype |
|
2556 | projectParms.datatype = datatype | |
2555 | projectParms.ext = ext |
|
2557 | projectParms.ext = ext | |
2556 | projectParms.dpath = dpath |
|
2558 | projectParms.dpath = dpath | |
2557 | projectParms.online = online |
|
2559 | projectParms.online = online | |
2558 | projectParms.startDate = startDate |
|
2560 | projectParms.startDate = startDate | |
2559 | projectParms.endDate = endDate |
|
2561 | projectParms.endDate = endDate | |
2560 | projectParms.startTime = startTime |
|
2562 | projectParms.startTime = startTime | |
2561 | projectParms.endTime = endTime |
|
2563 | projectParms.endTime = endTime | |
2562 | projectParms.delay = delay |
|
2564 | projectParms.delay = delay | |
2563 | projectParms.walk = walk |
|
2565 | projectParms.walk = walk | |
2564 | projectParms.expLabel = expLabel |
|
2566 | projectParms.expLabel = expLabel | |
2565 | projectParms.set = set |
|
2567 | projectParms.set = set | |
2566 | projectParms.ippKm = ippKm |
|
2568 | projectParms.ippKm = ippKm | |
2567 | projectParms.parmsOk = parms_ok |
|
2569 | projectParms.parmsOk = parms_ok | |
2568 |
|
2570 | |||
2569 | return projectParms |
|
2571 | return projectParms | |
2570 |
|
2572 | |||
2571 |
|
2573 | |||
2572 | def __getParmsFromProjectObj(self, projectObjView): |
|
2574 | def __getParmsFromProjectObj(self, projectObjView): | |
2573 |
|
2575 | |||
2574 | parms_ok = True |
|
2576 | parms_ok = True | |
2575 |
|
2577 | |||
2576 | project_name, description = projectObjView.name, projectObjView.description |
|
2578 | project_name, description = projectObjView.name, projectObjView.description | |
2577 |
|
2579 | |||
2578 | readUnitObj = projectObjView.getReadUnitObj() |
|
2580 | readUnitObj = projectObjView.getReadUnitObj() | |
2579 | datatype = readUnitObj.datatype |
|
2581 | datatype = readUnitObj.datatype | |
2580 |
|
2582 | |||
2581 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2583 | operationObj = readUnitObj.getOperationObj(name='run') | |
2582 |
|
2584 | |||
2583 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2585 | dpath = operationObj.getParameterValue(parameterName='path') | |
2584 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2586 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2585 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2587 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2586 |
|
2588 | |||
2587 | startDate = startDate.strftime("%Y/%m/%d") |
|
2589 | startDate = startDate.strftime("%Y/%m/%d") | |
2588 | endDate = endDate.strftime("%Y/%m/%d") |
|
2590 | endDate = endDate.strftime("%Y/%m/%d") | |
2589 |
|
2591 | |||
2590 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2592 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2591 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2593 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2592 |
|
2594 | |||
2593 | startTime = startTime.strftime("%H:%M:%S") |
|
2595 | startTime = startTime.strftime("%H:%M:%S") | |
2594 | endTime = endTime.strftime("%H:%M:%S") |
|
2596 | endTime = endTime.strftime("%H:%M:%S") | |
2595 |
|
2597 | |||
2596 | online = 0 |
|
2598 | online = 0 | |
2597 | try: |
|
2599 | try: | |
2598 | online = operationObj.getParameterValue(parameterName='online') |
|
2600 | online = operationObj.getParameterValue(parameterName='online') | |
2599 | except: |
|
2601 | except: | |
2600 | pass |
|
2602 | pass | |
2601 |
|
2603 | |||
2602 | delay = '' |
|
2604 | delay = '' | |
2603 | try: |
|
2605 | try: | |
2604 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2606 | delay = operationObj.getParameterValue(parameterName='delay') | |
2605 | except: |
|
2607 | except: | |
2606 | pass |
|
2608 | pass | |
2607 |
|
2609 | |||
2608 | walk = 0 |
|
2610 | walk = 0 | |
2609 | try: |
|
2611 | try: | |
2610 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2612 | walk = operationObj.getParameterValue(parameterName='walk') | |
2611 | except: |
|
2613 | except: | |
2612 | pass |
|
2614 | pass | |
2613 |
|
2615 | |||
2614 | set = '' |
|
2616 | set = '' | |
2615 | try: |
|
2617 | try: | |
2616 | set = operationObj.getParameterValue(parameterName='set') |
|
2618 | set = operationObj.getParameterValue(parameterName='set') | |
2617 | except: |
|
2619 | except: | |
2618 | pass |
|
2620 | pass | |
2619 |
|
2621 | |||
2620 | expLabel = '' |
|
2622 | expLabel = '' | |
2621 | try: |
|
2623 | try: | |
2622 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2624 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2623 | except: |
|
2625 | except: | |
2624 | pass |
|
2626 | pass | |
2625 |
|
2627 | |||
2626 | ippKm = '' |
|
2628 | ippKm = '' | |
2627 | if datatype.lower() == 'usrp': |
|
2629 | if datatype.lower() == 'usrp': | |
2628 | try: |
|
2630 | try: | |
2629 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2631 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2630 | except: |
|
2632 | except: | |
2631 | pass |
|
2633 | pass | |
2632 |
|
2634 | |||
2633 | projectParms = ProjectParms() |
|
2635 | projectParms = ProjectParms() | |
2634 |
|
2636 | |||
2635 | projectParms.name = project_name |
|
2637 | projectParms.name = project_name | |
2636 | projectParms.description = description |
|
2638 | projectParms.description = description | |
2637 | projectParms.datatype = datatype |
|
2639 | projectParms.datatype = datatype | |
2638 | projectParms.ext = None |
|
2640 | projectParms.ext = None | |
2639 | projectParms.dpath = dpath |
|
2641 | projectParms.dpath = dpath | |
2640 | projectParms.online = online |
|
2642 | projectParms.online = online | |
2641 | projectParms.startDate = startDate |
|
2643 | projectParms.startDate = startDate | |
2642 | projectParms.endDate = endDate |
|
2644 | projectParms.endDate = endDate | |
2643 | projectParms.startTime = startTime |
|
2645 | projectParms.startTime = startTime | |
2644 | projectParms.endTime = endTime |
|
2646 | projectParms.endTime = endTime | |
2645 | projectParms.delay=delay |
|
2647 | projectParms.delay=delay | |
2646 | projectParms.walk=walk |
|
2648 | projectParms.walk=walk | |
2647 | projectParms.set=set |
|
2649 | projectParms.set=set | |
2648 | projectParms.ippKm=ippKm |
|
2650 | projectParms.ippKm=ippKm | |
2649 | projectParms.expLabel = expLabel |
|
2651 | projectParms.expLabel = expLabel | |
2650 | projectParms.parmsOk=parms_ok |
|
2652 | projectParms.parmsOk=parms_ok | |
2651 |
|
2653 | |||
2652 | return projectParms |
|
2654 | return projectParms | |
2653 |
|
2655 | |||
2654 | def refreshProjectWindow(self, projectObjView): |
|
2656 | def refreshProjectWindow(self, projectObjView): | |
2655 |
|
2657 | |||
2656 | self.proOk.setEnabled(False) |
|
2658 | self.proOk.setEnabled(False) | |
2657 |
|
2659 | |||
2658 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2660 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2659 |
|
2661 | |||
2660 | index = projectParms.getDatatypeIndex() |
|
2662 | index = projectParms.getDatatypeIndex() | |
2661 |
|
2663 | |||
2662 | self.proName.setText(projectParms.name) |
|
2664 | self.proName.setText(projectParms.name) | |
2663 | self.proDescription.clear() |
|
2665 | self.proDescription.clear() | |
2664 | self.proDescription.append(projectParms.description) |
|
2666 | self.proDescription.append(projectParms.description) | |
2665 |
|
2667 | |||
2666 | self.on_proComDataType_activated(index=index) |
|
2668 | self.on_proComDataType_activated(index=index) | |
2667 | self.proDataPath.setText(projectParms.dpath) |
|
2669 | self.proDataPath.setText(projectParms.dpath) | |
2668 | self.proComDataType.setCurrentIndex(index) |
|
2670 | self.proComDataType.setCurrentIndex(index) | |
2669 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2671 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2670 | self.proDelay.setText(str(projectParms.delay)) |
|
2672 | self.proDelay.setText(str(projectParms.delay)) | |
2671 | self.proSet.setText(str(projectParms.set)) |
|
2673 | self.proSet.setText(str(projectParms.set)) | |
2672 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2674 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2673 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2675 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2674 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2676 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2675 |
|
2677 | |||
2676 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2678 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2677 | ext = projectParms.getExt(), |
|
2679 | ext = projectParms.getExt(), | |
2678 | walk = projectParms.walk, |
|
2680 | walk = projectParms.walk, | |
2679 | expLabel = projectParms.expLabel) |
|
2681 | expLabel = projectParms.expLabel) | |
2680 |
|
2682 | |||
2681 | if not dateList: |
|
2683 | if not dateList: | |
2682 | return |
|
2684 | return | |
2683 |
|
2685 | |||
2684 | try: |
|
2686 | try: | |
2685 | startDateIndex = dateList.index(projectParms.startDate) |
|
2687 | startDateIndex = dateList.index(projectParms.startDate) | |
2686 | except: |
|
2688 | except: | |
2687 | startDateIndex = 0 |
|
2689 | startDateIndex = 0 | |
2688 |
|
2690 | |||
2689 | try: |
|
2691 | try: | |
2690 | endDateIndex = dateList.index(projectParms.endDate) |
|
2692 | endDateIndex = dateList.index(projectParms.endDate) | |
2691 | except: |
|
2693 | except: | |
2692 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2694 | endDateIndex = int(self.proComEndDate.count()-1) | |
2693 |
|
2695 | |||
2694 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2696 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2695 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2697 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2696 |
|
2698 | |||
2697 | startlist = projectParms.startTime.split(":") |
|
2699 | startlist = projectParms.startTime.split(":") | |
2698 | endlist = projectParms.endTime.split(":") |
|
2700 | endlist = projectParms.endTime.split(":") | |
2699 |
|
2701 | |||
2700 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2702 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2701 | self.proStartTime.setTime(self.time) |
|
2703 | self.proStartTime.setTime(self.time) | |
2702 |
|
2704 | |||
2703 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2705 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2704 | self.proEndTime.setTime(self.time) |
|
2706 | self.proEndTime.setTime(self.time) | |
2705 |
|
2707 | |||
2706 | self.proOk.setEnabled(True) |
|
2708 | self.proOk.setEnabled(True) | |
2707 |
|
2709 | |||
2708 | def __refreshVoltageWindow(self, puObj): |
|
2710 | def __refreshVoltageWindow(self, puObj): | |
2709 |
|
2711 | |||
2710 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2712 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2711 | if opObj == None: |
|
2713 | if opObj == None: | |
2712 | self.volOpRadarfrequency.clear() |
|
2714 | self.volOpRadarfrequency.clear() | |
2713 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2715 | self.volOpCebRadarfrequency.setCheckState(0) | |
2714 | else: |
|
2716 | else: | |
2715 | value = opObj.getParameterValue(parameterName='frequency') |
|
2717 | value = opObj.getParameterValue(parameterName='frequency') | |
2716 | value = str(float(value)/1e6) |
|
2718 | value = str(float(value)/1e6) | |
2717 | self.volOpRadarfrequency.setText(value) |
|
2719 | self.volOpRadarfrequency.setText(value) | |
2718 | self.volOpRadarfrequency.setEnabled(True) |
|
2720 | self.volOpRadarfrequency.setEnabled(True) | |
2719 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2721 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2720 |
|
2722 | |||
2721 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2723 | opObj = puObj.getOperationObj(name="selectChannels") | |
2722 |
|
2724 | |||
2723 | if opObj == None: |
|
2725 | if opObj == None: | |
2724 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2726 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2725 |
|
2727 | |||
2726 | if opObj == None: |
|
2728 | if opObj == None: | |
2727 | self.volOpChannel.clear() |
|
2729 | self.volOpChannel.clear() | |
2728 | self.volOpCebChannels.setCheckState(0) |
|
2730 | self.volOpCebChannels.setCheckState(0) | |
2729 | else: |
|
2731 | else: | |
2730 | channelEnabled = False |
|
2732 | channelEnabled = False | |
2731 | try: |
|
2733 | try: | |
2732 | value = opObj.getParameterValue(parameterName='channelList') |
|
2734 | value = opObj.getParameterValue(parameterName='channelList') | |
2733 | value = str(value)[1:-1] |
|
2735 | value = str(value)[1:-1] | |
2734 | channelEnabled = True |
|
2736 | channelEnabled = True | |
2735 | channelMode = 0 |
|
2737 | channelMode = 0 | |
2736 | except: |
|
2738 | except: | |
2737 | pass |
|
2739 | pass | |
2738 | try: |
|
2740 | try: | |
2739 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2741 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2740 | value = str(value)[1:-1] |
|
2742 | value = str(value)[1:-1] | |
2741 | channelEnabled = True |
|
2743 | channelEnabled = True | |
2742 | channelMode = 1 |
|
2744 | channelMode = 1 | |
2743 | except: |
|
2745 | except: | |
2744 | pass |
|
2746 | pass | |
2745 |
|
2747 | |||
2746 | if channelEnabled: |
|
2748 | if channelEnabled: | |
2747 | self.volOpChannel.setText(value) |
|
2749 | self.volOpChannel.setText(value) | |
2748 | self.volOpChannel.setEnabled(True) |
|
2750 | self.volOpChannel.setEnabled(True) | |
2749 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2751 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2750 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2752 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2751 |
|
2753 | |||
2752 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2754 | opObj = puObj.getOperationObj(name="selectHeights") | |
2753 | if opObj == None: |
|
2755 | if opObj == None: | |
2754 | self.volOpHeights.clear() |
|
2756 | self.volOpHeights.clear() | |
2755 | self.volOpCebHeights.setCheckState(0) |
|
2757 | self.volOpCebHeights.setCheckState(0) | |
2756 | else: |
|
2758 | else: | |
2757 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2759 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2758 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2760 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2759 | value = value1 + "," + value2 |
|
2761 | value = value1 + "," + value2 | |
2760 | self.volOpHeights.setText(value) |
|
2762 | self.volOpHeights.setText(value) | |
2761 | self.volOpHeights.setEnabled(True) |
|
2763 | self.volOpHeights.setEnabled(True) | |
2762 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2764 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2763 |
|
2765 | |||
2764 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2766 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2765 | if opObj == None: |
|
2767 | if opObj == None: | |
2766 | self.volOpFilter.clear() |
|
2768 | self.volOpFilter.clear() | |
2767 | self.volOpCebFilter.setCheckState(0) |
|
2769 | self.volOpCebFilter.setCheckState(0) | |
2768 | else: |
|
2770 | else: | |
2769 | value = opObj.getParameterValue(parameterName='window') |
|
2771 | value = opObj.getParameterValue(parameterName='window') | |
2770 | value = str(value) |
|
2772 | value = str(value) | |
2771 | self.volOpFilter.setText(value) |
|
2773 | self.volOpFilter.setText(value) | |
2772 | self.volOpFilter.setEnabled(True) |
|
2774 | self.volOpFilter.setEnabled(True) | |
2773 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2775 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2774 |
|
2776 | |||
2775 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2777 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2776 | if opObj == None: |
|
2778 | if opObj == None: | |
2777 | self.volOpProfile.clear() |
|
2779 | self.volOpProfile.clear() | |
2778 | self.volOpCebProfile.setCheckState(0) |
|
2780 | self.volOpCebProfile.setCheckState(0) | |
2779 | else: |
|
2781 | else: | |
2780 | for parmObj in opObj.getParameterObjList(): |
|
2782 | for parmObj in opObj.getParameterObjList(): | |
2781 |
|
2783 | |||
2782 | if parmObj.name == "profileList": |
|
2784 | if parmObj.name == "profileList": | |
2783 | value = parmObj.getValue() |
|
2785 | value = parmObj.getValue() | |
2784 | value = str(value)[1:-1] |
|
2786 | value = str(value)[1:-1] | |
2785 | self.volOpProfile.setText(value) |
|
2787 | self.volOpProfile.setText(value) | |
2786 | self.volOpProfile.setEnabled(True) |
|
2788 | self.volOpProfile.setEnabled(True) | |
2787 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2789 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2788 | self.volOpComProfile.setCurrentIndex(0) |
|
2790 | self.volOpComProfile.setCurrentIndex(0) | |
2789 |
|
2791 | |||
2790 | if parmObj.name == "profileRangeList": |
|
2792 | if parmObj.name == "profileRangeList": | |
2791 | value = parmObj.getValue() |
|
2793 | value = parmObj.getValue() | |
2792 | value = str(value)[1:-1] |
|
2794 | value = str(value)[1:-1] | |
2793 | self.volOpProfile.setText(value) |
|
2795 | self.volOpProfile.setText(value) | |
2794 | self.volOpProfile.setEnabled(True) |
|
2796 | self.volOpProfile.setEnabled(True) | |
2795 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2797 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2796 | self.volOpComProfile.setCurrentIndex(1) |
|
2798 | self.volOpComProfile.setCurrentIndex(1) | |
2797 |
|
2799 | |||
2798 | if parmObj.name == "rangeList": |
|
2800 | if parmObj.name == "rangeList": | |
2799 | value = parmObj.getValue() |
|
2801 | value = parmObj.getValue() | |
2800 | value = str(value)[1:-1] |
|
2802 | value = str(value)[1:-1] | |
2801 | self.volOpProfile.setText(value) |
|
2803 | self.volOpProfile.setText(value) | |
2802 | self.volOpProfile.setEnabled(True) |
|
2804 | self.volOpProfile.setEnabled(True) | |
2803 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2805 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2804 | self.volOpComProfile.setCurrentIndex(2) |
|
2806 | self.volOpComProfile.setCurrentIndex(2) | |
2805 |
|
2807 | |||
2806 | opObj = puObj.getOperationObj(name="Decoder") |
|
2808 | opObj = puObj.getOperationObj(name="Decoder") | |
2807 | self.volOpCode.setText("") |
|
2809 | self.volOpCode.setText("") | |
2808 | if opObj == None: |
|
2810 | if opObj == None: | |
2809 | self.volOpCebDecodification.setCheckState(0) |
|
2811 | self.volOpCebDecodification.setCheckState(0) | |
2810 | else: |
|
2812 | else: | |
2811 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2813 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2812 |
|
2814 | |||
2813 | parmObj = opObj.getParameterObj('code') |
|
2815 | parmObj = opObj.getParameterObj('code') | |
2814 |
|
2816 | |||
2815 | if parmObj == None: |
|
2817 | if parmObj == None: | |
2816 | self.volOpComCode.setCurrentIndex(0) |
|
2818 | self.volOpComCode.setCurrentIndex(0) | |
2817 | else: |
|
2819 | else: | |
2818 |
|
2820 | |||
2819 | parmObj1 = opObj.getParameterObj('nCode') |
|
2821 | parmObj1 = opObj.getParameterObj('nCode') | |
2820 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2822 | parmObj2 = opObj.getParameterObj('nBaud') | |
2821 |
|
2823 | |||
2822 | if parmObj1 == None or parmObj2 == None: |
|
2824 | if parmObj1 == None or parmObj2 == None: | |
2823 | self.volOpComCode.setCurrentIndex(0) |
|
2825 | self.volOpComCode.setCurrentIndex(0) | |
2824 | else: |
|
2826 | else: | |
2825 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2827 | code = ast.literal_eval(str(parmObj.getValue())) | |
2826 | nCode = parmObj1.getValue() |
|
2828 | nCode = parmObj1.getValue() | |
2827 | nBaud = parmObj2.getValue() |
|
2829 | nBaud = parmObj2.getValue() | |
2828 |
|
2830 | |||
2829 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2831 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2830 |
|
2832 | |||
2831 | #User defined by default |
|
2833 | #User defined by default | |
2832 | self.volOpComCode.setCurrentIndex(13) |
|
2834 | self.volOpComCode.setCurrentIndex(13) | |
2833 | self.volOpCode.setText(str(code)) |
|
2835 | self.volOpCode.setText(str(code)) | |
2834 |
|
2836 | |||
2835 | if nCode == 1: |
|
2837 | if nCode == 1: | |
2836 | if nBaud == 3: |
|
2838 | if nBaud == 3: | |
2837 | self.volOpComCode.setCurrentIndex(1) |
|
2839 | self.volOpComCode.setCurrentIndex(1) | |
2838 | if nBaud == 4: |
|
2840 | if nBaud == 4: | |
2839 | self.volOpComCode.setCurrentIndex(2) |
|
2841 | self.volOpComCode.setCurrentIndex(2) | |
2840 | if nBaud == 5: |
|
2842 | if nBaud == 5: | |
2841 | self.volOpComCode.setCurrentIndex(3) |
|
2843 | self.volOpComCode.setCurrentIndex(3) | |
2842 | if nBaud == 7: |
|
2844 | if nBaud == 7: | |
2843 | self.volOpComCode.setCurrentIndex(4) |
|
2845 | self.volOpComCode.setCurrentIndex(4) | |
2844 | if nBaud == 11: |
|
2846 | if nBaud == 11: | |
2845 | self.volOpComCode.setCurrentIndex(5) |
|
2847 | self.volOpComCode.setCurrentIndex(5) | |
2846 | if nBaud == 13: |
|
2848 | if nBaud == 13: | |
2847 | self.volOpComCode.setCurrentIndex(6) |
|
2849 | self.volOpComCode.setCurrentIndex(6) | |
2848 |
|
2850 | |||
2849 | if nCode == 2: |
|
2851 | if nCode == 2: | |
2850 | if nBaud == 3: |
|
2852 | if nBaud == 3: | |
2851 | self.volOpComCode.setCurrentIndex(7) |
|
2853 | self.volOpComCode.setCurrentIndex(7) | |
2852 | if nBaud == 4: |
|
2854 | if nBaud == 4: | |
2853 | self.volOpComCode.setCurrentIndex(8) |
|
2855 | self.volOpComCode.setCurrentIndex(8) | |
2854 | if nBaud == 5: |
|
2856 | if nBaud == 5: | |
2855 | self.volOpComCode.setCurrentIndex(9) |
|
2857 | self.volOpComCode.setCurrentIndex(9) | |
2856 | if nBaud == 7: |
|
2858 | if nBaud == 7: | |
2857 | self.volOpComCode.setCurrentIndex(10) |
|
2859 | self.volOpComCode.setCurrentIndex(10) | |
2858 | if nBaud == 11: |
|
2860 | if nBaud == 11: | |
2859 | self.volOpComCode.setCurrentIndex(11) |
|
2861 | self.volOpComCode.setCurrentIndex(11) | |
2860 | if nBaud == 13: |
|
2862 | if nBaud == 13: | |
2861 | self.volOpComCode.setCurrentIndex(12) |
|
2863 | self.volOpComCode.setCurrentIndex(12) | |
2862 |
|
2864 | |||
2863 |
|
2865 | |||
2864 | opObj = puObj.getOperationObj(name="deFlip") |
|
2866 | opObj = puObj.getOperationObj(name="deFlip") | |
2865 | if opObj == None: |
|
2867 | if opObj == None: | |
2866 | self.volOpFlip.clear() |
|
2868 | self.volOpFlip.clear() | |
2867 | self.volOpFlip.setEnabled(False) |
|
2869 | self.volOpFlip.setEnabled(False) | |
2868 | self.volOpCebFlip.setCheckState(0) |
|
2870 | self.volOpCebFlip.setCheckState(0) | |
2869 | else: |
|
2871 | else: | |
2870 | try: |
|
2872 | try: | |
2871 | value = opObj.getParameterValue(parameterName='channelList') |
|
2873 | value = opObj.getParameterValue(parameterName='channelList') | |
2872 | value = str(value)[1:-1] |
|
2874 | value = str(value)[1:-1] | |
2873 | except: |
|
2875 | except: | |
2874 | value = "" |
|
2876 | value = "" | |
2875 |
|
2877 | |||
2876 | self.volOpFlip.setText(value) |
|
2878 | self.volOpFlip.setText(value) | |
2877 | self.volOpFlip.setEnabled(True) |
|
2879 | self.volOpFlip.setEnabled(True) | |
2878 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2880 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2879 |
|
2881 | |||
2880 | opObj = puObj.getOperationObj(name="CohInt") |
|
2882 | opObj = puObj.getOperationObj(name="CohInt") | |
2881 | if opObj == None: |
|
2883 | if opObj == None: | |
2882 | self.volOpCohInt.clear() |
|
2884 | self.volOpCohInt.clear() | |
2883 | self.volOpCebCohInt.setCheckState(0) |
|
2885 | self.volOpCebCohInt.setCheckState(0) | |
2884 | else: |
|
2886 | else: | |
2885 | value = opObj.getParameterValue(parameterName='n') |
|
2887 | value = opObj.getParameterValue(parameterName='n') | |
2886 | self.volOpCohInt.setText(str(value)) |
|
2888 | self.volOpCohInt.setText(str(value)) | |
2887 | self.volOpCohInt.setEnabled(True) |
|
2889 | self.volOpCohInt.setEnabled(True) | |
2888 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2890 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2889 |
|
2891 | |||
2890 | opObj = puObj.getOperationObj(name='Scope') |
|
2892 | opObj = puObj.getOperationObj(name='Scope') | |
2891 | if opObj == None: |
|
2893 | if opObj == None: | |
2892 | self.volGraphCebshow.setCheckState(0) |
|
2894 | self.volGraphCebshow.setCheckState(0) | |
2893 | else: |
|
2895 | else: | |
2894 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2896 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2895 |
|
2897 | |||
2896 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2898 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2897 |
|
2899 | |||
2898 | if parmObj == None: |
|
2900 | if parmObj == None: | |
2899 | self.volGraphChannelList.clear() |
|
2901 | self.volGraphChannelList.clear() | |
2900 | else: |
|
2902 | else: | |
2901 | value = parmObj.getValue() |
|
2903 | value = parmObj.getValue() | |
2902 | value = str(value) |
|
2904 | value = str(value) | |
2903 | self.volGraphChannelList.setText(value) |
|
2905 | self.volGraphChannelList.setText(value) | |
2904 | self.volOpProfile.setEnabled(True) |
|
2906 | self.volOpProfile.setEnabled(True) | |
2905 |
|
2907 | |||
2906 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2908 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2907 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2909 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2908 |
|
2910 | |||
2909 | if parmObj1 == None or parmObj2 ==None: |
|
2911 | if parmObj1 == None or parmObj2 ==None: | |
2910 | self.volGraphfreqrange.clear() |
|
2912 | self.volGraphfreqrange.clear() | |
2911 | else: |
|
2913 | else: | |
2912 | value1 = parmObj1.getValue() |
|
2914 | value1 = parmObj1.getValue() | |
2913 | value1 = str(value1) |
|
2915 | value1 = str(value1) | |
2914 | value2 = parmObj2.getValue() |
|
2916 | value2 = parmObj2.getValue() | |
2915 | value2 = str(value2) |
|
2917 | value2 = str(value2) | |
2916 | value = value1 + "," + value2 |
|
2918 | value = value1 + "," + value2 | |
2917 | self.volGraphfreqrange.setText(value) |
|
2919 | self.volGraphfreqrange.setText(value) | |
2918 |
|
2920 | |||
2919 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2921 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2920 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2922 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2921 |
|
2923 | |||
2922 | if parmObj1 == None or parmObj2 ==None: |
|
2924 | if parmObj1 == None or parmObj2 ==None: | |
2923 | self.volGraphHeightrange.clear() |
|
2925 | self.volGraphHeightrange.clear() | |
2924 | else: |
|
2926 | else: | |
2925 | value1 = parmObj1.getValue() |
|
2927 | value1 = parmObj1.getValue() | |
2926 | value1 = str(value1) |
|
2928 | value1 = str(value1) | |
2927 | value2 = parmObj2.getValue() |
|
2929 | value2 = parmObj2.getValue() | |
2928 | value2 = str(value2) |
|
2930 | value2 = str(value2) | |
2929 | value = value1 + "," + value2 |
|
2931 | value = value1 + "," + value2 | |
2930 | value2 = str(value2) |
|
2932 | value2 = str(value2) | |
2931 | self.volGraphHeightrange.setText(value) |
|
2933 | self.volGraphHeightrange.setText(value) | |
2932 |
|
2934 | |||
2933 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2935 | parmObj = opObj.getParameterObj(parameterName='save') | |
2934 |
|
2936 | |||
2935 | if parmObj == None: |
|
2937 | if parmObj == None: | |
2936 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2938 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2937 | else: |
|
2939 | else: | |
2938 | value = parmObj.getValue() |
|
2940 | value = parmObj.getValue() | |
2939 | if value: |
|
2941 | if value: | |
2940 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2942 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2941 | else: |
|
2943 | else: | |
2942 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2944 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2943 |
|
2945 | |||
2944 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2946 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2945 | if parmObj == None: |
|
2947 | if parmObj == None: | |
2946 | self.volGraphPath.clear() |
|
2948 | self.volGraphPath.clear() | |
2947 | else: |
|
2949 | else: | |
2948 | value = parmObj.getValue() |
|
2950 | value = parmObj.getValue() | |
2949 | path = str(value) |
|
2951 | path = str(value) | |
2950 | self.volGraphPath.setText(path) |
|
2952 | self.volGraphPath.setText(path) | |
2951 |
|
2953 | |||
2952 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2954 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2953 | if parmObj == None: |
|
2955 | if parmObj == None: | |
2954 | self.volGraphPrefix.clear() |
|
2956 | self.volGraphPrefix.clear() | |
2955 | else: |
|
2957 | else: | |
2956 | value = parmObj.getValue() |
|
2958 | value = parmObj.getValue() | |
2957 | figfile = str(value) |
|
2959 | figfile = str(value) | |
2958 | self.volGraphPrefix.setText(figfile) |
|
2960 | self.volGraphPrefix.setText(figfile) | |
2959 |
|
2961 | |||
2960 | # outputVoltageWrite |
|
2962 | # outputVoltageWrite | |
2961 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2963 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2962 |
|
2964 | |||
2963 | if opObj == None: |
|
2965 | if opObj == None: | |
2964 | self.volOutputPath.clear() |
|
2966 | self.volOutputPath.clear() | |
2965 | self.volOutputblocksperfile.clear() |
|
2967 | self.volOutputblocksperfile.clear() | |
2966 | self.volOutputprofilesperblock.clear() |
|
2968 | self.volOutputprofilesperblock.clear() | |
2967 | else: |
|
2969 | else: | |
2968 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2970 | parmObj = opObj.getParameterObj(parameterName='path') | |
2969 | if parmObj == None: |
|
2971 | if parmObj == None: | |
2970 | self.volOutputPath.clear() |
|
2972 | self.volOutputPath.clear() | |
2971 | else: |
|
2973 | else: | |
2972 | value = parmObj.getValue() |
|
2974 | value = parmObj.getValue() | |
2973 | path = str(value) |
|
2975 | path = str(value) | |
2974 | self.volOutputPath.setText(path) |
|
2976 | self.volOutputPath.setText(path) | |
2975 |
|
2977 | |||
2976 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2978 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2977 | if parmObj == None: |
|
2979 | if parmObj == None: | |
2978 | self.volOutputblocksperfile.clear() |
|
2980 | self.volOutputblocksperfile.clear() | |
2979 | else: |
|
2981 | else: | |
2980 | value = parmObj.getValue() |
|
2982 | value = parmObj.getValue() | |
2981 | blocksperfile = str(value) |
|
2983 | blocksperfile = str(value) | |
2982 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2984 | self.volOutputblocksperfile.setText(blocksperfile) | |
2983 |
|
2985 | |||
2984 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2986 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2985 | if parmObj == None: |
|
2987 | if parmObj == None: | |
2986 | self.volOutputprofilesperblock.clear() |
|
2988 | self.volOutputprofilesperblock.clear() | |
2987 | else: |
|
2989 | else: | |
2988 | value = parmObj.getValue() |
|
2990 | value = parmObj.getValue() | |
2989 | profilesPerBlock = str(value) |
|
2991 | profilesPerBlock = str(value) | |
2990 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2992 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2991 |
|
2993 | |||
2992 | return |
|
2994 | return | |
2993 |
|
2995 | |||
2994 | def __refreshSpectraWindow(self, puObj): |
|
2996 | def __refreshSpectraWindow(self, puObj): | |
2995 |
|
2997 | |||
2996 | inputId = puObj.getInputId() |
|
2998 | inputId = puObj.getInputId() | |
2997 | inputPUObj = self.__puObjDict[inputId] |
|
2999 | inputPUObj = self.__puObjDict[inputId] | |
2998 |
|
3000 | |||
2999 | if inputPUObj.datatype == 'Voltage': |
|
3001 | if inputPUObj.datatype == 'Voltage': | |
3000 | self.specOpnFFTpoints.setEnabled(True) |
|
3002 | self.specOpnFFTpoints.setEnabled(True) | |
3001 | self.specOpProfiles.setEnabled(True) |
|
3003 | self.specOpProfiles.setEnabled(True) | |
3002 | self.specOpippFactor.setEnabled(True) |
|
3004 | self.specOpippFactor.setEnabled(True) | |
3003 | else: |
|
3005 | else: | |
3004 | self.specOpnFFTpoints.setEnabled(False) |
|
3006 | self.specOpnFFTpoints.setEnabled(False) | |
3005 | self.specOpProfiles.setEnabled(False) |
|
3007 | self.specOpProfiles.setEnabled(False) | |
3006 | self.specOpippFactor.setEnabled(False) |
|
3008 | self.specOpippFactor.setEnabled(False) | |
3007 |
|
3009 | |||
3008 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3010 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3009 | if opObj == None: |
|
3011 | if opObj == None: | |
3010 | self.specOpRadarfrequency.clear() |
|
3012 | self.specOpRadarfrequency.clear() | |
3011 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3013 | self.specOpCebRadarfrequency.setCheckState(0) | |
3012 | else: |
|
3014 | else: | |
3013 | value = opObj.getParameterValue(parameterName='frequency') |
|
3015 | value = opObj.getParameterValue(parameterName='frequency') | |
3014 | value = str(float(value)/1e6) |
|
3016 | value = str(float(value)/1e6) | |
3015 | self.specOpRadarfrequency.setText(value) |
|
3017 | self.specOpRadarfrequency.setText(value) | |
3016 | self.specOpRadarfrequency.setEnabled(True) |
|
3018 | self.specOpRadarfrequency.setEnabled(True) | |
3017 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3019 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3018 |
|
3020 | |||
3019 | opObj = puObj.getOperationObj(name="run") |
|
3021 | opObj = puObj.getOperationObj(name="run") | |
3020 | if opObj == None: |
|
3022 | if opObj == None: | |
3021 | self.specOpnFFTpoints.clear() |
|
3023 | self.specOpnFFTpoints.clear() | |
3022 | self.specOpProfiles.clear() |
|
3024 | self.specOpProfiles.clear() | |
3023 | self.specOpippFactor.clear() |
|
3025 | self.specOpippFactor.clear() | |
3024 | else: |
|
3026 | else: | |
3025 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3027 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3026 | if parmObj == None: |
|
3028 | if parmObj == None: | |
3027 | self.specOpnFFTpoints.clear() |
|
3029 | self.specOpnFFTpoints.clear() | |
3028 | else: |
|
3030 | else: | |
3029 | self.specOpnFFTpoints.setEnabled(True) |
|
3031 | self.specOpnFFTpoints.setEnabled(True) | |
3030 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3032 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3031 | self.specOpnFFTpoints.setText(str(value)) |
|
3033 | self.specOpnFFTpoints.setText(str(value)) | |
3032 |
|
3034 | |||
3033 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3035 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3034 | if parmObj == None: |
|
3036 | if parmObj == None: | |
3035 | self.specOpProfiles.clear() |
|
3037 | self.specOpProfiles.clear() | |
3036 | else: |
|
3038 | else: | |
3037 | self.specOpProfiles.setEnabled(True) |
|
3039 | self.specOpProfiles.setEnabled(True) | |
3038 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3040 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3039 | self.specOpProfiles.setText(str(value)) |
|
3041 | self.specOpProfiles.setText(str(value)) | |
3040 |
|
3042 | |||
3041 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3043 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3042 | if parmObj == None: |
|
3044 | if parmObj == None: | |
3043 | self.specOpippFactor.clear() |
|
3045 | self.specOpippFactor.clear() | |
3044 | else: |
|
3046 | else: | |
3045 | self.specOpippFactor.setEnabled(True) |
|
3047 | self.specOpippFactor.setEnabled(True) | |
3046 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3048 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3047 | self.specOpippFactor.setText(str(value)) |
|
3049 | self.specOpippFactor.setText(str(value)) | |
3048 |
|
3050 | |||
3049 | opObj = puObj.getOperationObj(name="run") |
|
3051 | opObj = puObj.getOperationObj(name="run") | |
3050 | if opObj == None: |
|
3052 | if opObj == None: | |
3051 | self.specOppairsList.clear() |
|
3053 | self.specOppairsList.clear() | |
3052 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3054 | self.specOpCebCrossSpectra.setCheckState(0) | |
3053 | else: |
|
3055 | else: | |
3054 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3056 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3055 | if parmObj == None: |
|
3057 | if parmObj == None: | |
3056 | self.specOppairsList.clear() |
|
3058 | self.specOppairsList.clear() | |
3057 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3059 | self.specOpCebCrossSpectra.setCheckState(0) | |
3058 | else: |
|
3060 | else: | |
3059 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3061 | value = opObj.getParameterValue(parameterName='pairsList') | |
3060 | value = str(value)[1:-1] |
|
3062 | value = str(value)[1:-1] | |
3061 | self.specOppairsList.setText(str(value)) |
|
3063 | self.specOppairsList.setText(str(value)) | |
3062 | self.specOppairsList.setEnabled(True) |
|
3064 | self.specOppairsList.setEnabled(True) | |
3063 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3065 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3064 |
|
3066 | |||
3065 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3067 | opObj = puObj.getOperationObj(name="selectChannels") | |
3066 |
|
3068 | |||
3067 | if opObj == None: |
|
3069 | if opObj == None: | |
3068 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3070 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3069 |
|
3071 | |||
3070 | if opObj == None: |
|
3072 | if opObj == None: | |
3071 | self.specOpChannel.clear() |
|
3073 | self.specOpChannel.clear() | |
3072 | self.specOpCebChannel.setCheckState(0) |
|
3074 | self.specOpCebChannel.setCheckState(0) | |
3073 | else: |
|
3075 | else: | |
3074 | channelEnabled = False |
|
3076 | channelEnabled = False | |
3075 | try: |
|
3077 | try: | |
3076 | value = opObj.getParameterValue(parameterName='channelList') |
|
3078 | value = opObj.getParameterValue(parameterName='channelList') | |
3077 | value = str(value)[1:-1] |
|
3079 | value = str(value)[1:-1] | |
3078 | channelEnabled = True |
|
3080 | channelEnabled = True | |
3079 | channelMode = 0 |
|
3081 | channelMode = 0 | |
3080 | except: |
|
3082 | except: | |
3081 | pass |
|
3083 | pass | |
3082 | try: |
|
3084 | try: | |
3083 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3085 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3084 | value = str(value)[1:-1] |
|
3086 | value = str(value)[1:-1] | |
3085 | channelEnabled = True |
|
3087 | channelEnabled = True | |
3086 | channelMode = 1 |
|
3088 | channelMode = 1 | |
3087 | except: |
|
3089 | except: | |
3088 | pass |
|
3090 | pass | |
3089 |
|
3091 | |||
3090 | if channelEnabled: |
|
3092 | if channelEnabled: | |
3091 | self.specOpChannel.setText(value) |
|
3093 | self.specOpChannel.setText(value) | |
3092 | self.specOpChannel.setEnabled(True) |
|
3094 | self.specOpChannel.setEnabled(True) | |
3093 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3095 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3094 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3096 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3095 |
|
3097 | |||
3096 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3098 | opObj = puObj.getOperationObj(name="selectHeights") | |
3097 | if opObj == None: |
|
3099 | if opObj == None: | |
3098 | self.specOpHeights.clear() |
|
3100 | self.specOpHeights.clear() | |
3099 | self.specOpCebHeights.setCheckState(0) |
|
3101 | self.specOpCebHeights.setCheckState(0) | |
3100 | else: |
|
3102 | else: | |
3101 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3103 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3102 | value1 = str(value1) |
|
3104 | value1 = str(value1) | |
3103 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3105 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3104 | value2 = str(value2) |
|
3106 | value2 = str(value2) | |
3105 | value = value1 + "," + value2 |
|
3107 | value = value1 + "," + value2 | |
3106 | self.specOpHeights.setText(value) |
|
3108 | self.specOpHeights.setText(value) | |
3107 | self.specOpHeights.setEnabled(True) |
|
3109 | self.specOpHeights.setEnabled(True) | |
3108 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3110 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3109 |
|
3111 | |||
3110 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3112 | opObj = puObj.getOperationObj(name="IncohInt") | |
3111 | if opObj == None: |
|
3113 | if opObj == None: | |
3112 | self.specOpIncoherent.clear() |
|
3114 | self.specOpIncoherent.clear() | |
3113 | self.specOpCebIncoherent.setCheckState(0) |
|
3115 | self.specOpCebIncoherent.setCheckState(0) | |
3114 | else: |
|
3116 | else: | |
3115 | for parmObj in opObj.getParameterObjList(): |
|
3117 | for parmObj in opObj.getParameterObjList(): | |
3116 | if parmObj.name == 'timeInterval': |
|
3118 | if parmObj.name == 'timeInterval': | |
3117 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3119 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3118 | self.specOpIncoherent.setText(str(value)) |
|
3120 | self.specOpIncoherent.setText(str(value)) | |
3119 | self.specOpIncoherent.setEnabled(True) |
|
3121 | self.specOpIncoherent.setEnabled(True) | |
3120 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3122 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3121 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3123 | self.specOpCobIncInt.setCurrentIndex(0) | |
3122 |
|
3124 | |||
3123 | if parmObj.name == 'n': |
|
3125 | if parmObj.name == 'n': | |
3124 | value = opObj.getParameterValue(parameterName='n') |
|
3126 | value = opObj.getParameterValue(parameterName='n') | |
3125 | self.specOpIncoherent.setText(str(value)) |
|
3127 | self.specOpIncoherent.setText(str(value)) | |
3126 | self.specOpIncoherent.setEnabled(True) |
|
3128 | self.specOpIncoherent.setEnabled(True) | |
3127 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3129 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3128 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3130 | self.specOpCobIncInt.setCurrentIndex(1) | |
3129 |
|
3131 | |||
3130 | opObj = puObj.getOperationObj(name="removeDC") |
|
3132 | opObj = puObj.getOperationObj(name="removeDC") | |
3131 | if opObj == None: |
|
3133 | if opObj == None: | |
3132 | self.specOpCebRemoveDC.setCheckState(0) |
|
3134 | self.specOpCebRemoveDC.setCheckState(0) | |
3133 | else: |
|
3135 | else: | |
3134 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3136 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3135 | value = opObj.getParameterValue(parameterName='mode') |
|
3137 | value = opObj.getParameterValue(parameterName='mode') | |
3136 | if value == 1: |
|
3138 | if value == 1: | |
3137 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3139 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3138 | elif value == 2: |
|
3140 | elif value == 2: | |
3139 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3141 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3140 |
|
3142 | |||
3141 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3143 | opObj = puObj.getOperationObj(name="removeInterference") | |
3142 | if opObj == None: |
|
3144 | if opObj == None: | |
3143 | self.specOpCebRemoveInt.setCheckState(0) |
|
3145 | self.specOpCebRemoveInt.setCheckState(0) | |
3144 | else: |
|
3146 | else: | |
3145 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3147 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3146 |
|
3148 | |||
3147 | opObj = puObj.getOperationObj(name='getNoise') |
|
3149 | opObj = puObj.getOperationObj(name='getNoise') | |
3148 | if opObj == None: |
|
3150 | if opObj == None: | |
3149 | self.specOpCebgetNoise.setCheckState(0) |
|
3151 | self.specOpCebgetNoise.setCheckState(0) | |
3150 | self.specOpgetNoise.clear() |
|
3152 | self.specOpgetNoise.clear() | |
3151 | else: |
|
3153 | else: | |
3152 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3154 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3153 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3155 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3154 | if parmObj == None: |
|
3156 | if parmObj == None: | |
3155 | self.specOpgetNoise.clear() |
|
3157 | self.specOpgetNoise.clear() | |
3156 | value1 = None |
|
3158 | value1 = None | |
3157 | else: |
|
3159 | else: | |
3158 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3160 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3159 | value1 = str(value1) |
|
3161 | value1 = str(value1) | |
3160 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3162 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3161 | if parmObj == None: |
|
3163 | if parmObj == None: | |
3162 | value2 = None |
|
3164 | value2 = None | |
3163 | value = value1 |
|
3165 | value = value1 | |
3164 | self.specOpgetNoise.setText(value) |
|
3166 | self.specOpgetNoise.setText(value) | |
3165 | self.specOpgetNoise.setEnabled(True) |
|
3167 | self.specOpgetNoise.setEnabled(True) | |
3166 | else: |
|
3168 | else: | |
3167 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3169 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3168 | value2 = str(value2) |
|
3170 | value2 = str(value2) | |
3169 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3171 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3170 | if parmObj == None: |
|
3172 | if parmObj == None: | |
3171 | value3 = None |
|
3173 | value3 = None | |
3172 | value = value1 + "," + value2 |
|
3174 | value = value1 + "," + value2 | |
3173 | self.specOpgetNoise.setText(value) |
|
3175 | self.specOpgetNoise.setText(value) | |
3174 | self.specOpgetNoise.setEnabled(True) |
|
3176 | self.specOpgetNoise.setEnabled(True) | |
3175 | else: |
|
3177 | else: | |
3176 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3178 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3177 | value3 = str(value3) |
|
3179 | value3 = str(value3) | |
3178 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3180 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3179 | if parmObj == None: |
|
3181 | if parmObj == None: | |
3180 | value4 = None |
|
3182 | value4 = None | |
3181 | value = value1 + "," + value2 + "," + value3 |
|
3183 | value = value1 + "," + value2 + "," + value3 | |
3182 | self.specOpgetNoise.setText(value) |
|
3184 | self.specOpgetNoise.setText(value) | |
3183 | self.specOpgetNoise.setEnabled(True) |
|
3185 | self.specOpgetNoise.setEnabled(True) | |
3184 | else: |
|
3186 | else: | |
3185 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3187 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3186 | value4 = str(value4) |
|
3188 | value4 = str(value4) | |
3187 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3189 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3188 | self.specOpgetNoise.setText(value) |
|
3190 | self.specOpgetNoise.setText(value) | |
3189 | self.specOpgetNoise.setEnabled(True) |
|
3191 | self.specOpgetNoise.setEnabled(True) | |
3190 |
|
3192 | |||
3191 | self.specGraphPath.clear() |
|
3193 | self.specGraphPath.clear() | |
3192 | self.specGraphPrefix.clear() |
|
3194 | self.specGraphPrefix.clear() | |
3193 | self.specGgraphFreq.clear() |
|
3195 | self.specGgraphFreq.clear() | |
3194 | self.specGgraphHeight.clear() |
|
3196 | self.specGgraphHeight.clear() | |
3195 | self.specGgraphDbsrange.clear() |
|
3197 | self.specGgraphDbsrange.clear() | |
3196 | self.specGgraphmagnitud.clear() |
|
3198 | self.specGgraphmagnitud.clear() | |
3197 | self.specGgraphPhase.clear() |
|
3199 | self.specGgraphPhase.clear() | |
3198 | self.specGgraphChannelList.clear() |
|
3200 | self.specGgraphChannelList.clear() | |
3199 | self.specGgraphTminTmax.clear() |
|
3201 | self.specGgraphTminTmax.clear() | |
3200 | self.specGgraphTimeRange.clear() |
|
3202 | self.specGgraphTimeRange.clear() | |
3201 | self.specGgraphftpratio.clear() |
|
3203 | self.specGgraphftpratio.clear() | |
3202 |
|
3204 | |||
3203 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3205 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3204 |
|
3206 | |||
3205 | if opObj == None: |
|
3207 | if opObj == None: | |
3206 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3208 | self.specGraphCebSpectraplot.setCheckState(0) | |
3207 | self.specGraphSaveSpectra.setCheckState(0) |
|
3209 | self.specGraphSaveSpectra.setCheckState(0) | |
3208 | self.specGraphftpSpectra.setCheckState(0) |
|
3210 | self.specGraphftpSpectra.setCheckState(0) | |
3209 | else: |
|
3211 | else: | |
3210 | operationSpectraPlot = "Enable" |
|
3212 | operationSpectraPlot = "Enable" | |
3211 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3213 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3212 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3214 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3213 | if parmObj == None: |
|
3215 | if parmObj == None: | |
3214 | self.specGgraphChannelList.clear() |
|
3216 | self.specGgraphChannelList.clear() | |
3215 | else: |
|
3217 | else: | |
3216 | value = opObj.getParameterValue(parameterName='channelList') |
|
3218 | value = opObj.getParameterValue(parameterName='channelList') | |
3217 | channelListSpectraPlot = str(value)[1:-1] |
|
3219 | channelListSpectraPlot = str(value)[1:-1] | |
3218 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3220 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3219 | self.specGgraphChannelList.setEnabled(True) |
|
3221 | self.specGgraphChannelList.setEnabled(True) | |
3220 |
|
3222 | |||
3221 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3223 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3222 | if parmObj == None: |
|
3224 | if parmObj == None: | |
3223 | self.specGgraphFreq.clear() |
|
3225 | self.specGgraphFreq.clear() | |
3224 | else: |
|
3226 | else: | |
3225 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3227 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3226 | value1 = str(value1) |
|
3228 | value1 = str(value1) | |
3227 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3229 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3228 | value2 = str(value2) |
|
3230 | value2 = str(value2) | |
3229 | value = value1 + "," + value2 |
|
3231 | value = value1 + "," + value2 | |
3230 | self.specGgraphFreq.setText(value) |
|
3232 | self.specGgraphFreq.setText(value) | |
3231 | self.specGgraphFreq.setEnabled(True) |
|
3233 | self.specGgraphFreq.setEnabled(True) | |
3232 |
|
3234 | |||
3233 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3235 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3234 | if parmObj == None: |
|
3236 | if parmObj == None: | |
3235 | self.specGgraphHeight.clear() |
|
3237 | self.specGgraphHeight.clear() | |
3236 | else: |
|
3238 | else: | |
3237 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3239 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3238 | value1 = str(value1) |
|
3240 | value1 = str(value1) | |
3239 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3241 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3240 | value2 = str(value2) |
|
3242 | value2 = str(value2) | |
3241 | value = value1 + "," + value2 |
|
3243 | value = value1 + "," + value2 | |
3242 | self.specGgraphHeight.setText(value) |
|
3244 | self.specGgraphHeight.setText(value) | |
3243 | self.specGgraphHeight.setEnabled(True) |
|
3245 | self.specGgraphHeight.setEnabled(True) | |
3244 |
|
3246 | |||
3245 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3247 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3246 | if parmObj == None: |
|
3248 | if parmObj == None: | |
3247 | self.specGgraphDbsrange.clear() |
|
3249 | self.specGgraphDbsrange.clear() | |
3248 | else: |
|
3250 | else: | |
3249 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3251 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3250 | value1 = str(value1) |
|
3252 | value1 = str(value1) | |
3251 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3253 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3252 | value2 = str(value2) |
|
3254 | value2 = str(value2) | |
3253 | value = value1 + "," + value2 |
|
3255 | value = value1 + "," + value2 | |
3254 | self.specGgraphDbsrange.setText(value) |
|
3256 | self.specGgraphDbsrange.setText(value) | |
3255 | self.specGgraphDbsrange.setEnabled(True) |
|
3257 | self.specGgraphDbsrange.setEnabled(True) | |
3256 |
|
3258 | |||
3257 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3259 | parmObj = opObj.getParameterObj(parameterName="save") | |
3258 | if parmObj == None: |
|
3260 | if parmObj == None: | |
3259 | self.specGraphSaveSpectra.setCheckState(0) |
|
3261 | self.specGraphSaveSpectra.setCheckState(0) | |
3260 | else: |
|
3262 | else: | |
3261 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3263 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3262 |
|
3264 | |||
3263 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3265 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3264 | if parmObj == None: |
|
3266 | if parmObj == None: | |
3265 | self.specGraphftpSpectra.setCheckState(0) |
|
3267 | self.specGraphftpSpectra.setCheckState(0) | |
3266 | else: |
|
3268 | else: | |
3267 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3269 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3268 |
|
3270 | |||
3269 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3271 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3270 | if parmObj: |
|
3272 | if parmObj: | |
3271 | value = parmObj.getValue() |
|
3273 | value = parmObj.getValue() | |
3272 | self.specGraphPath.setText(value) |
|
3274 | self.specGraphPath.setText(value) | |
3273 |
|
3275 | |||
3274 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3276 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3275 | if parmObj: |
|
3277 | if parmObj: | |
3276 | value = parmObj.getValue() |
|
3278 | value = parmObj.getValue() | |
3277 | self.specGgraphftpratio.setText(str(value)) |
|
3279 | self.specGgraphftpratio.setText(str(value)) | |
3278 |
|
3280 | |||
3279 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3281 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3280 |
|
3282 | |||
3281 | if opObj == None: |
|
3283 | if opObj == None: | |
3282 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3284 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3283 | self.specGraphSaveCross.setCheckState(0) |
|
3285 | self.specGraphSaveCross.setCheckState(0) | |
3284 | self.specGraphftpCross.setCheckState(0) |
|
3286 | self.specGraphftpCross.setCheckState(0) | |
3285 | else: |
|
3287 | else: | |
3286 | operationCrossSpectraPlot = "Enable" |
|
3288 | operationCrossSpectraPlot = "Enable" | |
3287 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3289 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3288 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3290 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3289 | if parmObj == None: |
|
3291 | if parmObj == None: | |
3290 | self.specGgraphFreq.clear() |
|
3292 | self.specGgraphFreq.clear() | |
3291 | else: |
|
3293 | else: | |
3292 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3294 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3293 | value1 = str(value1) |
|
3295 | value1 = str(value1) | |
3294 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3296 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3295 | value2 = str(value2) |
|
3297 | value2 = str(value2) | |
3296 | value = value1 + "," + value2 |
|
3298 | value = value1 + "," + value2 | |
3297 | self.specGgraphFreq.setText(value) |
|
3299 | self.specGgraphFreq.setText(value) | |
3298 | self.specGgraphFreq.setEnabled(True) |
|
3300 | self.specGgraphFreq.setEnabled(True) | |
3299 |
|
3301 | |||
3300 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3302 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3301 | if parmObj == None: |
|
3303 | if parmObj == None: | |
3302 | self.specGgraphHeight.clear() |
|
3304 | self.specGgraphHeight.clear() | |
3303 | else: |
|
3305 | else: | |
3304 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3306 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3305 | value1 = str(value1) |
|
3307 | value1 = str(value1) | |
3306 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3308 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3307 | value2 = str(value2) |
|
3309 | value2 = str(value2) | |
3308 | value = value1 + "," + value2 |
|
3310 | value = value1 + "," + value2 | |
3309 | self.specGgraphHeight.setText(value) |
|
3311 | self.specGgraphHeight.setText(value) | |
3310 | self.specGgraphHeight.setEnabled(True) |
|
3312 | self.specGgraphHeight.setEnabled(True) | |
3311 |
|
3313 | |||
3312 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3314 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3313 | if parmObj == None: |
|
3315 | if parmObj == None: | |
3314 | self.specGgraphDbsrange.clear() |
|
3316 | self.specGgraphDbsrange.clear() | |
3315 | else: |
|
3317 | else: | |
3316 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3318 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3317 | value1 = str(value1) |
|
3319 | value1 = str(value1) | |
3318 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3320 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3319 | value2 = str(value2) |
|
3321 | value2 = str(value2) | |
3320 | value = value1 + "," + value2 |
|
3322 | value = value1 + "," + value2 | |
3321 | self.specGgraphDbsrange.setText(value) |
|
3323 | self.specGgraphDbsrange.setText(value) | |
3322 | self.specGgraphDbsrange.setEnabled(True) |
|
3324 | self.specGgraphDbsrange.setEnabled(True) | |
3323 |
|
3325 | |||
3324 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3326 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3325 | if parmObj == None: |
|
3327 | if parmObj == None: | |
3326 | self.specGgraphmagnitud.clear() |
|
3328 | self.specGgraphmagnitud.clear() | |
3327 | else: |
|
3329 | else: | |
3328 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3330 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3329 | value1 = str(value1) |
|
3331 | value1 = str(value1) | |
3330 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3332 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3331 | value2 = str(value2) |
|
3333 | value2 = str(value2) | |
3332 | value = value1 + "," + value2 |
|
3334 | value = value1 + "," + value2 | |
3333 | self.specGgraphmagnitud.setText(value) |
|
3335 | self.specGgraphmagnitud.setText(value) | |
3334 | self.specGgraphmagnitud.setEnabled(True) |
|
3336 | self.specGgraphmagnitud.setEnabled(True) | |
3335 |
|
3337 | |||
3336 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3338 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3337 | if parmObj == None: |
|
3339 | if parmObj == None: | |
3338 | self.specGgraphPhase.clear() |
|
3340 | self.specGgraphPhase.clear() | |
3339 | else: |
|
3341 | else: | |
3340 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3342 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3341 | value1 = str(value1) |
|
3343 | value1 = str(value1) | |
3342 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3344 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3343 | value2 = str(value2) |
|
3345 | value2 = str(value2) | |
3344 | value = value1 + "," + value2 |
|
3346 | value = value1 + "," + value2 | |
3345 | self.specGgraphPhase.setText(value) |
|
3347 | self.specGgraphPhase.setText(value) | |
3346 | self.specGgraphPhase.setEnabled(True) |
|
3348 | self.specGgraphPhase.setEnabled(True) | |
3347 |
|
3349 | |||
3348 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3350 | parmObj = opObj.getParameterObj(parameterName="save") | |
3349 | if parmObj == None: |
|
3351 | if parmObj == None: | |
3350 | self.specGraphSaveCross.setCheckState(0) |
|
3352 | self.specGraphSaveCross.setCheckState(0) | |
3351 | else: |
|
3353 | else: | |
3352 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3354 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3353 |
|
3355 | |||
3354 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3356 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3355 | if parmObj == None: |
|
3357 | if parmObj == None: | |
3356 | self.specGraphftpCross.setCheckState(0) |
|
3358 | self.specGraphftpCross.setCheckState(0) | |
3357 | else: |
|
3359 | else: | |
3358 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3360 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3359 |
|
3361 | |||
3360 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3362 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3361 | if parmObj: |
|
3363 | if parmObj: | |
3362 | value = parmObj.getValue() |
|
3364 | value = parmObj.getValue() | |
3363 | self.specGraphPath.setText(value) |
|
3365 | self.specGraphPath.setText(value) | |
3364 |
|
3366 | |||
3365 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3367 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3366 | if parmObj: |
|
3368 | if parmObj: | |
3367 | value = parmObj.getValue() |
|
3369 | value = parmObj.getValue() | |
3368 | self.specGgraphftpratio.setText(str(value)) |
|
3370 | self.specGgraphftpratio.setText(str(value)) | |
3369 |
|
3371 | |||
3370 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3372 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3371 |
|
3373 | |||
3372 | if opObj == None: |
|
3374 | if opObj == None: | |
3373 | self.specGraphCebRTIplot.setCheckState(0) |
|
3375 | self.specGraphCebRTIplot.setCheckState(0) | |
3374 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3376 | self.specGraphSaveRTIplot.setCheckState(0) | |
3375 | self.specGraphftpRTIplot.setCheckState(0) |
|
3377 | self.specGraphftpRTIplot.setCheckState(0) | |
3376 | else: |
|
3378 | else: | |
3377 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3379 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3378 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3380 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3379 | if parmObj == None: |
|
3381 | if parmObj == None: | |
3380 | self.specGgraphChannelList.clear() |
|
3382 | self.specGgraphChannelList.clear() | |
3381 | else: |
|
3383 | else: | |
3382 | value = opObj.getParameterValue(parameterName='channelList') |
|
3384 | value = opObj.getParameterValue(parameterName='channelList') | |
3383 | channelListRTIPlot = str(value)[1:-1] |
|
3385 | channelListRTIPlot = str(value)[1:-1] | |
3384 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3386 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3385 | self.specGgraphChannelList.setEnabled(True) |
|
3387 | self.specGgraphChannelList.setEnabled(True) | |
3386 |
|
3388 | |||
3387 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3389 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3388 | if parmObj == None: |
|
3390 | if parmObj == None: | |
3389 | self.specGgraphTminTmax.clear() |
|
3391 | self.specGgraphTminTmax.clear() | |
3390 | else: |
|
3392 | else: | |
3391 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3393 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3392 | value1 = str(value1) |
|
3394 | value1 = str(value1) | |
3393 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3395 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3394 | value2 = str(value2) |
|
3396 | value2 = str(value2) | |
3395 | value = value1 + "," + value2 |
|
3397 | value = value1 + "," + value2 | |
3396 | self.specGgraphTminTmax.setText(value) |
|
3398 | self.specGgraphTminTmax.setText(value) | |
3397 | self.specGgraphTminTmax.setEnabled(True) |
|
3399 | self.specGgraphTminTmax.setEnabled(True) | |
3398 |
|
3400 | |||
3399 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3401 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3400 | if parmObj == None: |
|
3402 | if parmObj == None: | |
3401 | self.specGgraphTimeRange.clear() |
|
3403 | self.specGgraphTimeRange.clear() | |
3402 | else: |
|
3404 | else: | |
3403 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3405 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3404 | value1 = str(value1) |
|
3406 | value1 = str(value1) | |
3405 | self.specGgraphTimeRange.setText(value1) |
|
3407 | self.specGgraphTimeRange.setText(value1) | |
3406 | self.specGgraphTimeRange.setEnabled(True) |
|
3408 | self.specGgraphTimeRange.setEnabled(True) | |
3407 |
|
3409 | |||
3408 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3410 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3409 | if parmObj == None: |
|
3411 | if parmObj == None: | |
3410 | self.specGgraphHeight.clear() |
|
3412 | self.specGgraphHeight.clear() | |
3411 | else: |
|
3413 | else: | |
3412 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3414 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3413 | value1 = str(value1) |
|
3415 | value1 = str(value1) | |
3414 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3416 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3415 | value2 = str(value2) |
|
3417 | value2 = str(value2) | |
3416 | value = value1 + "," + value2 |
|
3418 | value = value1 + "," + value2 | |
3417 | self.specGgraphHeight.setText(value) |
|
3419 | self.specGgraphHeight.setText(value) | |
3418 | self.specGgraphHeight.setEnabled(True) |
|
3420 | self.specGgraphHeight.setEnabled(True) | |
3419 |
|
3421 | |||
3420 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3422 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3421 | if parmObj == None: |
|
3423 | if parmObj == None: | |
3422 | self.specGgraphDbsrange.clear() |
|
3424 | self.specGgraphDbsrange.clear() | |
3423 | else: |
|
3425 | else: | |
3424 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3426 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3425 | value1 = str(value1) |
|
3427 | value1 = str(value1) | |
3426 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3428 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3427 | value2 = str(value2) |
|
3429 | value2 = str(value2) | |
3428 | value = value1 + "," + value2 |
|
3430 | value = value1 + "," + value2 | |
3429 | self.specGgraphDbsrange.setText(value) |
|
3431 | self.specGgraphDbsrange.setText(value) | |
3430 | self.specGgraphDbsrange.setEnabled(True) |
|
3432 | self.specGgraphDbsrange.setEnabled(True) | |
3431 |
|
3433 | |||
3432 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3434 | parmObj = opObj.getParameterObj(parameterName="save") | |
3433 | if parmObj == None: |
|
3435 | if parmObj == None: | |
3434 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3436 | self.specGraphSaveRTIplot.setCheckState(0) | |
3435 | else: |
|
3437 | else: | |
3436 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3438 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3437 |
|
3439 | |||
3438 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3440 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3439 | if parmObj == None: |
|
3441 | if parmObj == None: | |
3440 | self.specGraphftpRTIplot.setCheckState(0) |
|
3442 | self.specGraphftpRTIplot.setCheckState(0) | |
3441 | else: |
|
3443 | else: | |
3442 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3444 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3443 |
|
3445 | |||
3444 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3446 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3445 | if parmObj: |
|
3447 | if parmObj: | |
3446 | value = parmObj.getValue() |
|
3448 | value = parmObj.getValue() | |
3447 | self.specGraphPath.setText(value) |
|
3449 | self.specGraphPath.setText(value) | |
3448 |
|
3450 | |||
3449 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3451 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3450 | if parmObj: |
|
3452 | if parmObj: | |
3451 | value = parmObj.getValue() |
|
3453 | value = parmObj.getValue() | |
3452 | self.specGgraphftpratio.setText(str(value)) |
|
3454 | self.specGgraphftpratio.setText(str(value)) | |
3453 |
|
3455 | |||
3454 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3456 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3455 |
|
3457 | |||
3456 | if opObj == None: |
|
3458 | if opObj == None: | |
3457 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3459 | self.specGraphCebCoherencmap.setCheckState(0) | |
3458 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3460 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3459 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3461 | self.specGraphftpCoherencemap.setCheckState(0) | |
3460 | else: |
|
3462 | else: | |
3461 | operationCoherenceMap = "Enable" |
|
3463 | operationCoherenceMap = "Enable" | |
3462 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3464 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3463 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3465 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3464 | if parmObj == None: |
|
3466 | if parmObj == None: | |
3465 | self.specGgraphTminTmax.clear() |
|
3467 | self.specGgraphTminTmax.clear() | |
3466 | else: |
|
3468 | else: | |
3467 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3469 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3468 | value1 = str(value1) |
|
3470 | value1 = str(value1) | |
3469 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3471 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3470 | value2 = str(value2) |
|
3472 | value2 = str(value2) | |
3471 | value = value1 + "," + value2 |
|
3473 | value = value1 + "," + value2 | |
3472 | self.specGgraphTminTmax.setText(value) |
|
3474 | self.specGgraphTminTmax.setText(value) | |
3473 | self.specGgraphTminTmax.setEnabled(True) |
|
3475 | self.specGgraphTminTmax.setEnabled(True) | |
3474 |
|
3476 | |||
3475 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3477 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3476 | if parmObj == None: |
|
3478 | if parmObj == None: | |
3477 | self.specGgraphTimeRange.clear() |
|
3479 | self.specGgraphTimeRange.clear() | |
3478 | else: |
|
3480 | else: | |
3479 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3481 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3480 | value1 = str(value1) |
|
3482 | value1 = str(value1) | |
3481 | self.specGgraphTimeRange.setText(value1) |
|
3483 | self.specGgraphTimeRange.setText(value1) | |
3482 | self.specGgraphTimeRange.setEnabled(True) |
|
3484 | self.specGgraphTimeRange.setEnabled(True) | |
3483 |
|
3485 | |||
3484 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3486 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3485 | if parmObj == None: |
|
3487 | if parmObj == None: | |
3486 | self.specGgraphHeight.clear() |
|
3488 | self.specGgraphHeight.clear() | |
3487 | else: |
|
3489 | else: | |
3488 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3490 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3489 | value1 = str(value1) |
|
3491 | value1 = str(value1) | |
3490 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3492 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3491 | value2 = str(value2) |
|
3493 | value2 = str(value2) | |
3492 | value = value1 + "," + value2 |
|
3494 | value = value1 + "," + value2 | |
3493 | self.specGgraphHeight.setText(value) |
|
3495 | self.specGgraphHeight.setText(value) | |
3494 | self.specGgraphHeight.setEnabled(True) |
|
3496 | self.specGgraphHeight.setEnabled(True) | |
3495 |
|
3497 | |||
3496 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3498 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3497 | if parmObj == None: |
|
3499 | if parmObj == None: | |
3498 | self.specGgraphmagnitud.clear() |
|
3500 | self.specGgraphmagnitud.clear() | |
3499 | else: |
|
3501 | else: | |
3500 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3502 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3501 | value1 = str(value1) |
|
3503 | value1 = str(value1) | |
3502 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3504 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3503 | value2 = str(value2) |
|
3505 | value2 = str(value2) | |
3504 | value = value1 + "," + value2 |
|
3506 | value = value1 + "," + value2 | |
3505 | self.specGgraphmagnitud.setText(value) |
|
3507 | self.specGgraphmagnitud.setText(value) | |
3506 | self.specGgraphmagnitud.setEnabled(True) |
|
3508 | self.specGgraphmagnitud.setEnabled(True) | |
3507 |
|
3509 | |||
3508 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3510 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3509 | if parmObj == None: |
|
3511 | if parmObj == None: | |
3510 | self.specGgraphmagnitud.clear() |
|
3512 | self.specGgraphmagnitud.clear() | |
3511 | else: |
|
3513 | else: | |
3512 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3514 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3513 | value1 = str(value1) |
|
3515 | value1 = str(value1) | |
3514 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3516 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3515 | value2 = str(value2) |
|
3517 | value2 = str(value2) | |
3516 | value = value1 + "," + value2 |
|
3518 | value = value1 + "," + value2 | |
3517 | self.specGgraphmagnitud.setText(value) |
|
3519 | self.specGgraphmagnitud.setText(value) | |
3518 | self.specGgraphmagnitud.setEnabled(True) |
|
3520 | self.specGgraphmagnitud.setEnabled(True) | |
3519 |
|
3521 | |||
3520 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3522 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3521 | if parmObj == None: |
|
3523 | if parmObj == None: | |
3522 | self.specGgraphPhase.clear() |
|
3524 | self.specGgraphPhase.clear() | |
3523 | else: |
|
3525 | else: | |
3524 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3526 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3525 | value1 = str(value1) |
|
3527 | value1 = str(value1) | |
3526 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3528 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3527 | value2 = str(value2) |
|
3529 | value2 = str(value2) | |
3528 | value = value1 + "," + value2 |
|
3530 | value = value1 + "," + value2 | |
3529 | self.specGgraphPhase.setText(value) |
|
3531 | self.specGgraphPhase.setText(value) | |
3530 | self.specGgraphPhase.setEnabled(True) |
|
3532 | self.specGgraphPhase.setEnabled(True) | |
3531 |
|
3533 | |||
3532 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3534 | parmObj = opObj.getParameterObj(parameterName="save") | |
3533 | if parmObj == None: |
|
3535 | if parmObj == None: | |
3534 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3536 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3535 | else: |
|
3537 | else: | |
3536 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3538 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3537 |
|
3539 | |||
3538 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3540 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3539 | if parmObj == None: |
|
3541 | if parmObj == None: | |
3540 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3542 | self.specGraphftpCoherencemap.setCheckState(0) | |
3541 | else: |
|
3543 | else: | |
3542 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3544 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3543 |
|
3545 | |||
3544 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3546 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3545 | if parmObj: |
|
3547 | if parmObj: | |
3546 | value = parmObj.getValue() |
|
3548 | value = parmObj.getValue() | |
3547 | self.specGraphPath.setText(value) |
|
3549 | self.specGraphPath.setText(value) | |
3548 |
|
3550 | |||
3549 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3551 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3550 | if parmObj: |
|
3552 | if parmObj: | |
3551 | value = parmObj.getValue() |
|
3553 | value = parmObj.getValue() | |
3552 | self.specGgraphftpratio.setText(str(value)) |
|
3554 | self.specGgraphftpratio.setText(str(value)) | |
3553 |
|
3555 | |||
3554 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3556 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3555 |
|
3557 | |||
3556 | if opObj == None: |
|
3558 | if opObj == None: | |
3557 | self.specGraphPowerprofile.setCheckState(0) |
|
3559 | self.specGraphPowerprofile.setCheckState(0) | |
3558 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3560 | self.specGraphSavePowerprofile.setCheckState(0) | |
3559 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3561 | self.specGraphftpPowerprofile.setCheckState(0) | |
3560 | operationPowerProfilePlot = "Disabled" |
|
3562 | operationPowerProfilePlot = "Disabled" | |
3561 | channelList = None |
|
3563 | channelList = None | |
3562 | freq_vel = None |
|
3564 | freq_vel = None | |
3563 | heightsrange = None |
|
3565 | heightsrange = None | |
3564 | else: |
|
3566 | else: | |
3565 | operationPowerProfilePlot = "Enable" |
|
3567 | operationPowerProfilePlot = "Enable" | |
3566 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3568 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3567 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3569 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3568 | if parmObj == None: |
|
3570 | if parmObj == None: | |
3569 | self.specGgraphDbsrange.clear() |
|
3571 | self.specGgraphDbsrange.clear() | |
3570 | else: |
|
3572 | else: | |
3571 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3573 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3572 | value1 = str(value1) |
|
3574 | value1 = str(value1) | |
3573 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3575 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3574 | value2 = str(value2) |
|
3576 | value2 = str(value2) | |
3575 | value = value1 + "," + value2 |
|
3577 | value = value1 + "," + value2 | |
3576 | self.specGgraphDbsrange.setText(value) |
|
3578 | self.specGgraphDbsrange.setText(value) | |
3577 | self.specGgraphDbsrange.setEnabled(True) |
|
3579 | self.specGgraphDbsrange.setEnabled(True) | |
3578 |
|
3580 | |||
3579 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3581 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3580 | if parmObj == None: |
|
3582 | if parmObj == None: | |
3581 | self.specGgraphHeight.clear() |
|
3583 | self.specGgraphHeight.clear() | |
3582 | else: |
|
3584 | else: | |
3583 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3585 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3584 | value1 = str(value1) |
|
3586 | value1 = str(value1) | |
3585 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3587 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3586 | value2 = str(value2) |
|
3588 | value2 = str(value2) | |
3587 | value = value1 + "," + value2 |
|
3589 | value = value1 + "," + value2 | |
3588 | self.specGgraphHeight.setText(value) |
|
3590 | self.specGgraphHeight.setText(value) | |
3589 | self.specGgraphHeight.setEnabled(True) |
|
3591 | self.specGgraphHeight.setEnabled(True) | |
3590 |
|
3592 | |||
3591 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3593 | parmObj = opObj.getParameterObj(parameterName="save") | |
3592 | if parmObj == None: |
|
3594 | if parmObj == None: | |
3593 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3595 | self.specGraphSavePowerprofile.setCheckState(0) | |
3594 | else: |
|
3596 | else: | |
3595 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3597 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3596 |
|
3598 | |||
3597 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3599 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3598 | if parmObj == None: |
|
3600 | if parmObj == None: | |
3599 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3601 | self.specGraphftpPowerprofile.setCheckState(0) | |
3600 | else: |
|
3602 | else: | |
3601 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3603 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3602 |
|
3604 | |||
3603 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3605 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3604 | if parmObj: |
|
3606 | if parmObj: | |
3605 | value = parmObj.getValue() |
|
3607 | value = parmObj.getValue() | |
3606 | self.specGraphPath.setText(value) |
|
3608 | self.specGraphPath.setText(value) | |
3607 |
|
3609 | |||
3608 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3610 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3609 | if parmObj: |
|
3611 | if parmObj: | |
3610 | value = parmObj.getValue() |
|
3612 | value = parmObj.getValue() | |
3611 | self.specGgraphftpratio.setText(str(value)) |
|
3613 | self.specGgraphftpratio.setText(str(value)) | |
3612 |
|
3614 | |||
3613 | opObj = puObj.getOperationObj(name='Noise') |
|
3615 | opObj = puObj.getOperationObj(name='Noise') | |
3614 |
|
3616 | |||
3615 | if opObj == None: |
|
3617 | if opObj == None: | |
3616 | self.specGraphCebRTInoise.setCheckState(0) |
|
3618 | self.specGraphCebRTInoise.setCheckState(0) | |
3617 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3619 | self.specGraphSaveRTInoise.setCheckState(0) | |
3618 | self.specGraphftpRTInoise.setCheckState(0) |
|
3620 | self.specGraphftpRTInoise.setCheckState(0) | |
3619 | else: |
|
3621 | else: | |
3620 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3622 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3621 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3623 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3622 | if parmObj == None: |
|
3624 | if parmObj == None: | |
3623 | self.specGgraphChannelList.clear() |
|
3625 | self.specGgraphChannelList.clear() | |
3624 | else: |
|
3626 | else: | |
3625 | value = opObj.getParameterValue(parameterName='channelList') |
|
3627 | value = opObj.getParameterValue(parameterName='channelList') | |
3626 | channelListRTINoise = str(value)[1:-1] |
|
3628 | channelListRTINoise = str(value)[1:-1] | |
3627 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3629 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3628 | self.specGgraphChannelList.setEnabled(True) |
|
3630 | self.specGgraphChannelList.setEnabled(True) | |
3629 |
|
3631 | |||
3630 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3632 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3631 | if parmObj == None: |
|
3633 | if parmObj == None: | |
3632 | self.specGgraphTminTmax.clear() |
|
3634 | self.specGgraphTminTmax.clear() | |
3633 | else: |
|
3635 | else: | |
3634 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3636 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3635 | value1 = str(value1) |
|
3637 | value1 = str(value1) | |
3636 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3638 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3637 | value2 = str(value2) |
|
3639 | value2 = str(value2) | |
3638 | value = value1 + "," + value2 |
|
3640 | value = value1 + "," + value2 | |
3639 | self.specGgraphTminTmax.setText(value) |
|
3641 | self.specGgraphTminTmax.setText(value) | |
3640 | self.specGgraphTminTmax.setEnabled(True) |
|
3642 | self.specGgraphTminTmax.setEnabled(True) | |
3641 |
|
3643 | |||
3642 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3644 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3643 | if parmObj == None: |
|
3645 | if parmObj == None: | |
3644 | self.specGgraphTimeRange.clear() |
|
3646 | self.specGgraphTimeRange.clear() | |
3645 | else: |
|
3647 | else: | |
3646 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3648 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3647 | value1 = str(value1) |
|
3649 | value1 = str(value1) | |
3648 | self.specGgraphTimeRange.setText(value1) |
|
3650 | self.specGgraphTimeRange.setText(value1) | |
3649 | self.specGgraphTimeRange.setEnabled(True) |
|
3651 | self.specGgraphTimeRange.setEnabled(True) | |
3650 |
|
3652 | |||
3651 |
|
3653 | |||
3652 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3654 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3653 | if parmObj == None: |
|
3655 | if parmObj == None: | |
3654 | self.specGgraphDbsrange.clear() |
|
3656 | self.specGgraphDbsrange.clear() | |
3655 | else: |
|
3657 | else: | |
3656 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3658 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3657 | value1 = str(value1) |
|
3659 | value1 = str(value1) | |
3658 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3660 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3659 | value2 = str(value2) |
|
3661 | value2 = str(value2) | |
3660 | value = value1 + "," + value2 |
|
3662 | value = value1 + "," + value2 | |
3661 | self.specGgraphDbsrange.setText(value) |
|
3663 | self.specGgraphDbsrange.setText(value) | |
3662 | self.specGgraphDbsrange.setEnabled(True) |
|
3664 | self.specGgraphDbsrange.setEnabled(True) | |
3663 |
|
3665 | |||
3664 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3666 | parmObj = opObj.getParameterObj(parameterName="save") | |
3665 | if parmObj == None: |
|
3667 | if parmObj == None: | |
3666 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3668 | self.specGraphSaveRTInoise.setCheckState(0) | |
3667 | else: |
|
3669 | else: | |
3668 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3670 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3669 |
|
3671 | |||
3670 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3672 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3671 | if parmObj == None: |
|
3673 | if parmObj == None: | |
3672 | self.specGraphftpRTInoise.setCheckState(0) |
|
3674 | self.specGraphftpRTInoise.setCheckState(0) | |
3673 | else: |
|
3675 | else: | |
3674 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3676 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3675 |
|
3677 | |||
3676 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3678 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3677 | if parmObj: |
|
3679 | if parmObj: | |
3678 | value = parmObj.getValue() |
|
3680 | value = parmObj.getValue() | |
3679 | self.specGraphPath.setText(value) |
|
3681 | self.specGraphPath.setText(value) | |
3680 |
|
3682 | |||
3681 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3683 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3682 | if parmObj: |
|
3684 | if parmObj: | |
3683 | value = parmObj.getValue() |
|
3685 | value = parmObj.getValue() | |
3684 | self.specGgraphftpratio.setText(str(value)) |
|
3686 | self.specGgraphftpratio.setText(str(value)) | |
3685 |
|
3687 | |||
3686 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3688 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3687 | if opObj == None: |
|
3689 | if opObj == None: | |
3688 | self.specOutputPath.clear() |
|
3690 | self.specOutputPath.clear() | |
3689 | self.specOutputblocksperfile.clear() |
|
3691 | self.specOutputblocksperfile.clear() | |
3690 | else: |
|
3692 | else: | |
3691 | value = opObj.getParameterObj(parameterName='path') |
|
3693 | value = opObj.getParameterObj(parameterName='path') | |
3692 | if value == None: |
|
3694 | if value == None: | |
3693 | self.specOutputPath.clear() |
|
3695 | self.specOutputPath.clear() | |
3694 | else: |
|
3696 | else: | |
3695 | value = opObj.getParameterValue(parameterName='path') |
|
3697 | value = opObj.getParameterValue(parameterName='path') | |
3696 | path = str(value) |
|
3698 | path = str(value) | |
3697 | self.specOutputPath.setText(path) |
|
3699 | self.specOutputPath.setText(path) | |
3698 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3700 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3699 | if value == None: |
|
3701 | if value == None: | |
3700 | self.specOutputblocksperfile.clear() |
|
3702 | self.specOutputblocksperfile.clear() | |
3701 | else: |
|
3703 | else: | |
3702 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3704 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3703 | blocksperfile = str(value) |
|
3705 | blocksperfile = str(value) | |
3704 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3706 | self.specOutputblocksperfile.setText(blocksperfile) | |
3705 |
|
3707 | |||
3706 | return |
|
3708 | return | |
3707 |
|
3709 | |||
3708 | def __refreshSpectraHeisWindow(self, puObj): |
|
3710 | def __refreshSpectraHeisWindow(self, puObj): | |
3709 |
|
3711 | |||
3710 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3712 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3711 | if opObj == None: |
|
3713 | if opObj == None: | |
3712 | self.specHeisOpIncoherent.clear() |
|
3714 | self.specHeisOpIncoherent.clear() | |
3713 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3715 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3714 | else: |
|
3716 | else: | |
3715 | for parmObj in opObj.getParameterObjList(): |
|
3717 | for parmObj in opObj.getParameterObjList(): | |
3716 | if parmObj.name == 'timeInterval': |
|
3718 | if parmObj.name == 'timeInterval': | |
3717 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3719 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3718 | self.specHeisOpIncoherent.setText(str(value)) |
|
3720 | self.specHeisOpIncoherent.setText(str(value)) | |
3719 | self.specHeisOpIncoherent.setEnabled(True) |
|
3721 | self.specHeisOpIncoherent.setEnabled(True) | |
3720 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3722 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3721 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3723 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3722 |
|
3724 | |||
3723 | # SpectraHeis Graph |
|
3725 | # SpectraHeis Graph | |
3724 |
|
3726 | |||
3725 | self.specHeisGgraphXminXmax.clear() |
|
3727 | self.specHeisGgraphXminXmax.clear() | |
3726 | self.specHeisGgraphYminYmax.clear() |
|
3728 | self.specHeisGgraphYminYmax.clear() | |
3727 |
|
3729 | |||
3728 | self.specHeisGgraphChannelList.clear() |
|
3730 | self.specHeisGgraphChannelList.clear() | |
3729 | self.specHeisGgraphTminTmax.clear() |
|
3731 | self.specHeisGgraphTminTmax.clear() | |
3730 | self.specHeisGgraphTimeRange.clear() |
|
3732 | self.specHeisGgraphTimeRange.clear() | |
3731 | self.specHeisGgraphftpratio.clear() |
|
3733 | self.specHeisGgraphftpratio.clear() | |
3732 |
|
3734 | |||
3733 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3735 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3734 | if opObj == None: |
|
3736 | if opObj == None: | |
3735 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3737 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3736 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3738 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3737 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3739 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3738 | else: |
|
3740 | else: | |
3739 | operationSpectraHeisScope = "Enable" |
|
3741 | operationSpectraHeisScope = "Enable" | |
3740 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3742 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3741 |
|
3743 | |||
3742 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3744 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3743 | if parmObj == None: |
|
3745 | if parmObj == None: | |
3744 | self.specHeisGgraphChannelList.clear() |
|
3746 | self.specHeisGgraphChannelList.clear() | |
3745 | else: |
|
3747 | else: | |
3746 | value = opObj.getParameterValue(parameterName='channelList') |
|
3748 | value = opObj.getParameterValue(parameterName='channelList') | |
3747 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3749 | channelListSpectraHeisScope = str(value)[1:-1] | |
3748 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3750 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3749 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3751 | self.specHeisGgraphChannelList.setEnabled(True) | |
3750 |
|
3752 | |||
3751 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3753 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3752 | if parmObj == None: |
|
3754 | if parmObj == None: | |
3753 | self.specHeisGgraphXminXmax.clear() |
|
3755 | self.specHeisGgraphXminXmax.clear() | |
3754 | else: |
|
3756 | else: | |
3755 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3757 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3756 | value1 = str(value1) |
|
3758 | value1 = str(value1) | |
3757 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3759 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3758 | value2 = str(value2) |
|
3760 | value2 = str(value2) | |
3759 | value = value1 + "," + value2 |
|
3761 | value = value1 + "," + value2 | |
3760 | self.specHeisGgraphXminXmax.setText(value) |
|
3762 | self.specHeisGgraphXminXmax.setText(value) | |
3761 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3763 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3762 |
|
3764 | |||
3763 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3765 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3764 | if parmObj == None: |
|
3766 | if parmObj == None: | |
3765 | self.specHeisGgraphYminYmax.clear() |
|
3767 | self.specHeisGgraphYminYmax.clear() | |
3766 | else: |
|
3768 | else: | |
3767 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3769 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3768 | value1 = str(value1) |
|
3770 | value1 = str(value1) | |
3769 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3771 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3770 | value2 = str(value2) |
|
3772 | value2 = str(value2) | |
3771 | value = value1 + "," + value2 |
|
3773 | value = value1 + "," + value2 | |
3772 | self.specHeisGgraphYminYmax.setText(value) |
|
3774 | self.specHeisGgraphYminYmax.setText(value) | |
3773 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3775 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3774 |
|
3776 | |||
3775 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3777 | parmObj = opObj.getParameterObj(parameterName="save") | |
3776 | if parmObj == None: |
|
3778 | if parmObj == None: | |
3777 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3779 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3778 | else: |
|
3780 | else: | |
3779 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3781 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3780 |
|
3782 | |||
3781 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3783 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3782 | if parmObj == None: |
|
3784 | if parmObj == None: | |
3783 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3785 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3784 | else: |
|
3786 | else: | |
3785 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3787 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3786 |
|
3788 | |||
3787 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3789 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3788 | if parmObj: |
|
3790 | if parmObj: | |
3789 | value = parmObj.getValue() |
|
3791 | value = parmObj.getValue() | |
3790 | self.specHeisGraphPath.setText(value) |
|
3792 | self.specHeisGraphPath.setText(value) | |
3791 |
|
3793 | |||
3792 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3794 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3793 | if parmObj: |
|
3795 | if parmObj: | |
3794 | value = parmObj.getValue() |
|
3796 | value = parmObj.getValue() | |
3795 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3797 | self.specHeisGgraphftpratio.setText(str(value)) | |
3796 |
|
3798 | |||
3797 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3799 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3798 |
|
3800 | |||
3799 | if opObj == None: |
|
3801 | if opObj == None: | |
3800 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3802 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3801 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3803 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3802 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3804 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3803 | else: |
|
3805 | else: | |
3804 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3806 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3805 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3807 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3806 | if parmObj == None: |
|
3808 | if parmObj == None: | |
3807 | self.specHeisGgraphChannelList.clear() |
|
3809 | self.specHeisGgraphChannelList.clear() | |
3808 | else: |
|
3810 | else: | |
3809 | value = opObj.getParameterValue(parameterName='channelList') |
|
3811 | value = opObj.getParameterValue(parameterName='channelList') | |
3810 | channelListRTIPlot = str(value)[1:-1] |
|
3812 | channelListRTIPlot = str(value)[1:-1] | |
3811 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3813 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3812 | self.specGgraphChannelList.setEnabled(True) |
|
3814 | self.specGgraphChannelList.setEnabled(True) | |
3813 |
|
3815 | |||
3814 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3816 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3815 | if parmObj == None: |
|
3817 | if parmObj == None: | |
3816 | self.specHeisGgraphTminTmax.clear() |
|
3818 | self.specHeisGgraphTminTmax.clear() | |
3817 | else: |
|
3819 | else: | |
3818 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3820 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3819 | value1 = str(value1) |
|
3821 | value1 = str(value1) | |
3820 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3822 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3821 | value2 = str(value2) |
|
3823 | value2 = str(value2) | |
3822 | value = value1 + "," + value2 |
|
3824 | value = value1 + "," + value2 | |
3823 | self.specHeisGgraphTminTmax.setText(value) |
|
3825 | self.specHeisGgraphTminTmax.setText(value) | |
3824 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3826 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3825 |
|
3827 | |||
3826 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3828 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3827 | if parmObj == None: |
|
3829 | if parmObj == None: | |
3828 | self.specGgraphTimeRange.clear() |
|
3830 | self.specGgraphTimeRange.clear() | |
3829 | else: |
|
3831 | else: | |
3830 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3832 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3831 | value1 = str(value1) |
|
3833 | value1 = str(value1) | |
3832 | self.specHeisGgraphTimeRange.setText(value1) |
|
3834 | self.specHeisGgraphTimeRange.setText(value1) | |
3833 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3835 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3834 |
|
3836 | |||
3835 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3837 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3836 | if parmObj == None: |
|
3838 | if parmObj == None: | |
3837 | self.specHeisGgraphYminYmax.clear() |
|
3839 | self.specHeisGgraphYminYmax.clear() | |
3838 | else: |
|
3840 | else: | |
3839 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3841 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3840 | value1 = str(value1) |
|
3842 | value1 = str(value1) | |
3841 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3843 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3842 | value2 = str(value2) |
|
3844 | value2 = str(value2) | |
3843 | value = value1 + "," + value2 |
|
3845 | value = value1 + "," + value2 | |
3844 | self.specHeisGgraphYminYmax.setText(value) |
|
3846 | self.specHeisGgraphYminYmax.setText(value) | |
3845 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3847 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3846 |
|
3848 | |||
3847 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3849 | parmObj = opObj.getParameterObj(parameterName="save") | |
3848 | if parmObj == None: |
|
3850 | if parmObj == None: | |
3849 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3851 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3850 | else: |
|
3852 | else: | |
3851 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3853 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3852 |
|
3854 | |||
3853 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3855 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3854 | if parmObj == None: |
|
3856 | if parmObj == None: | |
3855 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3857 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3856 | else: |
|
3858 | else: | |
3857 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3859 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3858 |
|
3860 | |||
3859 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3861 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3860 | if parmObj: |
|
3862 | if parmObj: | |
3861 | value = parmObj.getValue() |
|
3863 | value = parmObj.getValue() | |
3862 | self.specHeisGraphPath.setText(value) |
|
3864 | self.specHeisGraphPath.setText(value) | |
3863 |
|
3865 | |||
3864 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3866 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3865 | if parmObj: |
|
3867 | if parmObj: | |
3866 | value = parmObj.getValue() |
|
3868 | value = parmObj.getValue() | |
3867 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3869 | self.specHeisGgraphftpratio.setText(str(value)) | |
3868 |
|
3870 | |||
3869 | # outputSpectraHeisWrite |
|
3871 | # outputSpectraHeisWrite | |
3870 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3872 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3871 | if opObj == None: |
|
3873 | if opObj == None: | |
3872 | self.specHeisOutputPath.clear() |
|
3874 | self.specHeisOutputPath.clear() | |
3873 | self.specHeisOutputblocksperfile.clear() |
|
3875 | self.specHeisOutputblocksperfile.clear() | |
3874 | self.specHeisOutputMetada.clear() |
|
3876 | self.specHeisOutputMetada.clear() | |
3875 | else: |
|
3877 | else: | |
3876 | value = opObj.getParameterObj(parameterName='path') |
|
3878 | value = opObj.getParameterObj(parameterName='path') | |
3877 | if value == None: |
|
3879 | if value == None: | |
3878 | self.specHeisOutputPath.clear() |
|
3880 | self.specHeisOutputPath.clear() | |
3879 | else: |
|
3881 | else: | |
3880 | value = opObj.getParameterValue(parameterName='path') |
|
3882 | value = opObj.getParameterValue(parameterName='path') | |
3881 | path = str(value) |
|
3883 | path = str(value) | |
3882 | self.specHeisOutputPath.setText(path) |
|
3884 | self.specHeisOutputPath.setText(path) | |
3883 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3885 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3884 | if value == None: |
|
3886 | if value == None: | |
3885 | self.specHeisOutputblocksperfile.clear() |
|
3887 | self.specHeisOutputblocksperfile.clear() | |
3886 | else: |
|
3888 | else: | |
3887 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3889 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3888 | blocksperfile = str(value) |
|
3890 | blocksperfile = str(value) | |
3889 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3891 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3890 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3892 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3891 | if value == None: |
|
3893 | if value == None: | |
3892 | self.specHeisOutputMetada.clear() |
|
3894 | self.specHeisOutputMetada.clear() | |
3893 | else: |
|
3895 | else: | |
3894 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3896 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3895 | metadata_file = str(value) |
|
3897 | metadata_file = str(value) | |
3896 | self.specHeisOutputMetada.setText(metadata_file) |
|
3898 | self.specHeisOutputMetada.setText(metadata_file) | |
3897 |
|
3899 | |||
3898 | return |
|
3900 | return | |
3899 |
|
3901 | |||
3900 | def __refreshCorrelationWindow(self, puObj): |
|
3902 | def __refreshCorrelationWindow(self, puObj): | |
3901 | pass |
|
3903 | pass | |
3902 |
|
3904 | |||
3903 | def refreshPUWindow(self, puObj): |
|
3905 | def refreshPUWindow(self, puObj): | |
3904 |
|
3906 | |||
3905 | if puObj.datatype == 'Voltage': |
|
3907 | if puObj.datatype == 'Voltage': | |
3906 | self.__refreshVoltageWindow(puObj) |
|
3908 | self.__refreshVoltageWindow(puObj) | |
3907 |
|
3909 | |||
3908 | if puObj.datatype == 'Spectra': |
|
3910 | if puObj.datatype == 'Spectra': | |
3909 | self.__refreshSpectraWindow(puObj) |
|
3911 | self.__refreshSpectraWindow(puObj) | |
3910 |
|
3912 | |||
3911 | if puObj.datatype == 'SpectraHeis': |
|
3913 | if puObj.datatype == 'SpectraHeis': | |
3912 | self.__refreshSpectraHeisWindow(puObj) |
|
3914 | self.__refreshSpectraHeisWindow(puObj) | |
3913 |
|
3915 | |||
3914 | def refreshProjectProperties(self, projectObjView): |
|
3916 | def refreshProjectProperties(self, projectObjView): | |
3915 |
|
3917 | |||
3916 | propertyBuffObj = PropertyBuffer() |
|
3918 | propertyBuffObj = PropertyBuffer() | |
3917 | name = projectObjView.name |
|
3919 | name = projectObjView.name | |
3918 |
|
3920 | |||
3919 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3921 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3920 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3922 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3921 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3923 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3922 |
|
3924 | |||
3923 | readUnitObj = projectObjView.getReadUnitObj() |
|
3925 | readUnitObj = projectObjView.getReadUnitObj() | |
3924 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3926 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3925 |
|
3927 | |||
3926 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3928 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3927 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3929 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3928 |
|
3930 | |||
3929 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3931 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3930 |
|
3932 | |||
3931 | self.treeProjectProperties.setModel(propertiesModel) |
|
3933 | self.treeProjectProperties.setModel(propertiesModel) | |
3932 | self.treeProjectProperties.expandAll() |
|
3934 | self.treeProjectProperties.expandAll() | |
3933 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3935 | self.treeProjectProperties.resizeColumnToContents(0) | |
3934 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3936 | self.treeProjectProperties.resizeColumnToContents(1) | |
3935 |
|
3937 | |||
3936 | def refreshPUProperties(self, puObjView): |
|
3938 | def refreshPUProperties(self, puObjView): | |
3937 |
|
3939 | |||
3938 | ############ FTP CONFIG ################################ |
|
3940 | ############ FTP CONFIG ################################ | |
3939 | #Deleting FTP Conf. This processing unit have not got any |
|
3941 | #Deleting FTP Conf. This processing unit have not got any | |
3940 | #FTP configuration by default |
|
3942 | #FTP configuration by default | |
3941 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
3943 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
3942 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
3944 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
3943 | ######################################################## |
|
3945 | ######################################################## | |
3944 |
|
3946 | |||
3945 | propertyBuffObj = PropertyBuffer() |
|
3947 | propertyBuffObj = PropertyBuffer() | |
3946 |
|
3948 | |||
3947 | for thisOp in puObjView.getOperationObjList(): |
|
3949 | for thisOp in puObjView.getOperationObjList(): | |
3948 |
|
3950 | |||
3949 | operationName = thisOp.name |
|
3951 | operationName = thisOp.name | |
3950 |
|
3952 | |||
3951 | if operationName == 'run': |
|
3953 | if operationName == 'run': | |
3952 | operationName = 'Properties' |
|
3954 | operationName = 'Properties' | |
3953 |
|
3955 | |||
3954 | else: |
|
3956 | else: | |
3955 | if not thisOp.getParameterObjList(): |
|
3957 | if not thisOp.getParameterObjList(): | |
3956 | propertyBuffObj.append(operationName, '--', '--') |
|
3958 | propertyBuffObj.append(operationName, '--', '--') | |
3957 | continue |
|
3959 | continue | |
3958 |
|
3960 | |||
3959 | for thisParmObj in thisOp.getParameterObjList(): |
|
3961 | for thisParmObj in thisOp.getParameterObjList(): | |
3960 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3962 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3961 |
|
3963 | |||
3962 | ############ FTP CONFIG ################################ |
|
3964 | ############ FTP CONFIG ################################ | |
3963 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
3965 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
3964 | value = thisParmObj.getValue() |
|
3966 | value = thisParmObj.getValue() | |
3965 | self.temporalFTP.ftp_wei = value |
|
3967 | self.temporalFTP.ftp_wei = value | |
3966 |
|
3968 | |||
3967 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
3969 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
3968 | value = thisParmObj.getValue() |
|
3970 | value = thisParmObj.getValue() | |
3969 | self.temporalFTP.exp_code = value |
|
3971 | self.temporalFTP.exp_code = value | |
3970 |
|
3972 | |||
3971 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
3973 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
3972 | value = thisParmObj.getValue() |
|
3974 | value = thisParmObj.getValue() | |
3973 | self.temporalFTP.sub_exp_code = value |
|
3975 | self.temporalFTP.sub_exp_code = value | |
3974 |
|
3976 | |||
3975 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
3977 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
3976 | value = thisParmObj.getValue() |
|
3978 | value = thisParmObj.getValue() | |
3977 | self.temporalFTP.plot_pos = value |
|
3979 | self.temporalFTP.plot_pos = value | |
3978 |
|
3980 | |||
3979 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
3981 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
3980 | figpathObj = thisOp.getParameterObj('figpath') |
|
3982 | figpathObj = thisOp.getParameterObj('figpath') | |
3981 | if figpathObj: |
|
3983 | if figpathObj: | |
3982 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
3984 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
3983 |
|
3985 | |||
3984 | ######################################################## |
|
3986 | ######################################################## | |
3985 |
|
3987 | |||
3986 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3988 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3987 |
|
3989 | |||
3988 | self.treeProjectProperties.setModel(propertiesModel) |
|
3990 | self.treeProjectProperties.setModel(propertiesModel) | |
3989 | self.treeProjectProperties.expandAll() |
|
3991 | self.treeProjectProperties.expandAll() | |
3990 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3992 | self.treeProjectProperties.resizeColumnToContents(0) | |
3991 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3993 | self.treeProjectProperties.resizeColumnToContents(1) | |
3992 |
|
3994 | |||
3993 | def refreshGraphicsId(self): |
|
3995 | def refreshGraphicsId(self): | |
3994 |
|
3996 | |||
3995 | projectObj = self.getSelectedProjectObj() |
|
3997 | projectObj = self.getSelectedProjectObj() | |
3996 |
|
3998 | |||
3997 | if not projectObj: |
|
3999 | if not projectObj: | |
3998 | return |
|
4000 | return | |
3999 |
|
4001 | |||
4000 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
4002 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
4001 |
|
4003 | |||
4002 | for opObj in puObj.getOperationObjList(): |
|
4004 | for opObj in puObj.getOperationObjList(): | |
4003 |
|
4005 | |||
4004 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
4006 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
4005 | continue |
|
4007 | continue | |
4006 |
|
4008 | |||
4007 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4009 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4008 |
|
4010 | |||
4009 | def on_click(self, index): |
|
4011 | def on_click(self, index): | |
4010 |
|
4012 | |||
4011 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4013 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4012 |
|
4014 | |||
4013 | projectObjView = self.getSelectedProjectObj() |
|
4015 | projectObjView = self.getSelectedProjectObj() | |
4014 |
|
4016 | |||
4015 | if not projectObjView: |
|
4017 | if not projectObjView: | |
4016 | return |
|
4018 | return | |
4017 |
|
4019 | |||
4018 | self.create = False |
|
4020 | self.create = False | |
4019 | selectedObjView = self.getSelectedItemObj() |
|
4021 | selectedObjView = self.getSelectedItemObj() | |
4020 |
|
4022 | |||
4021 | #A project has been selected |
|
4023 | #A project has been selected | |
4022 | if projectObjView == selectedObjView: |
|
4024 | if projectObjView == selectedObjView: | |
4023 |
|
4025 | |||
4024 | self.refreshProjectWindow(projectObjView) |
|
4026 | self.refreshProjectWindow(projectObjView) | |
4025 | self.refreshProjectProperties(projectObjView) |
|
4027 | self.refreshProjectProperties(projectObjView) | |
4026 |
|
4028 | |||
4027 | self.tabProject.setEnabled(True) |
|
4029 | self.tabProject.setEnabled(True) | |
4028 | self.tabVoltage.setEnabled(False) |
|
4030 | self.tabVoltage.setEnabled(False) | |
4029 | self.tabSpectra.setEnabled(False) |
|
4031 | self.tabSpectra.setEnabled(False) | |
4030 | self.tabCorrelation.setEnabled(False) |
|
4032 | self.tabCorrelation.setEnabled(False) | |
4031 | self.tabSpectraHeis.setEnabled(False) |
|
4033 | self.tabSpectraHeis.setEnabled(False) | |
4032 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4034 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4033 |
|
4035 | |||
4034 | return |
|
4036 | return | |
4035 |
|
4037 | |||
4036 | #A processing unit has been selected |
|
4038 | #A processing unit has been selected | |
4037 | voltEnable = False |
|
4039 | voltEnable = False | |
4038 | specEnable = False |
|
4040 | specEnable = False | |
4039 | corrEnable = False |
|
4041 | corrEnable = False | |
4040 | specHeisEnable = False |
|
4042 | specHeisEnable = False | |
4041 | tabSelected = self.tabProject |
|
4043 | tabSelected = self.tabProject | |
4042 |
|
4044 | |||
4043 | puObj = selectedObjView |
|
4045 | puObj = selectedObjView | |
4044 |
|
4046 | |||
4045 | self.refreshPUWindow(puObj) |
|
4047 | self.refreshPUWindow(puObj) | |
4046 | self.refreshPUProperties(puObj) |
|
4048 | self.refreshPUProperties(puObj) | |
4047 | self.showtabPUCreated(puObj.datatype) |
|
4049 | self.showtabPUCreated(puObj.datatype) | |
4048 |
|
4050 | |||
4049 | def on_right_click(self, pos): |
|
4051 | def on_right_click(self, pos): | |
4050 |
|
4052 | |||
4051 | self.menu = QtGui.QMenu() |
|
4053 | self.menu = QtGui.QMenu() | |
4052 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4054 | quitAction0 = self.menu.addAction("Create a New Project") | |
4053 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4055 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4054 | quitAction2 = self.menu.addAction("Delete Item") |
|
4056 | quitAction2 = self.menu.addAction("Delete Item") | |
4055 | quitAction3 = self.menu.addAction("Quit") |
|
4057 | quitAction3 = self.menu.addAction("Quit") | |
4056 |
|
4058 | |||
4057 | if len(self.__itemTreeDict) == 0: |
|
4059 | if len(self.__itemTreeDict) == 0: | |
4058 | quitAction2.setEnabled(False) |
|
4060 | quitAction2.setEnabled(False) | |
4059 | else: |
|
4061 | else: | |
4060 | quitAction2.setEnabled(True) |
|
4062 | quitAction2.setEnabled(True) | |
4061 |
|
4063 | |||
4062 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4064 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4063 |
|
4065 | |||
4064 | if action == quitAction0: |
|
4066 | if action == quitAction0: | |
4065 | self. setInputsProject_View() |
|
4067 | self. setInputsProject_View() | |
4066 | self.create = True |
|
4068 | self.create = True | |
4067 |
|
4069 | |||
4068 | if action == quitAction1: |
|
4070 | if action == quitAction1: | |
4069 | if len(self.__projectObjDict) == 0: |
|
4071 | if len(self.__projectObjDict) == 0: | |
4070 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4072 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4071 | self.console.clear() |
|
4073 | self.console.clear() | |
4072 | self.console.append(outputstr) |
|
4074 | self.console.append(outputstr) | |
4073 | return 0 |
|
4075 | return 0 | |
4074 | else: |
|
4076 | else: | |
4075 | self.addPUWindow() |
|
4077 | self.addPUWindow() | |
4076 | self.console.clear() |
|
4078 | self.console.clear() | |
4077 | self.console.append("Please, Choose the type of Processing Unit") |
|
4079 | self.console.append("Please, Choose the type of Processing Unit") | |
4078 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4080 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4079 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4081 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4080 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4082 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4081 |
|
4083 | |||
4082 | if action == quitAction2: |
|
4084 | if action == quitAction2: | |
4083 | index = self.selectedItemTree |
|
4085 | index = self.selectedItemTree | |
4084 | try: |
|
4086 | try: | |
4085 | index.parent() |
|
4087 | index.parent() | |
4086 | except: |
|
4088 | except: | |
4087 | self.console.append('Please, first at all select a Project or Processing Unit') |
|
4089 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4088 | return 0 |
|
4090 | return 0 | |
4089 | # print index.parent(),index |
|
4091 | # print index.parent(),index | |
4090 | if index.parent() == None: |
|
4092 | if index.parent() == None: | |
4091 | self.projectExplorerModel.removeRow(index.row()) |
|
4093 | self.projectExplorerModel.removeRow(index.row()) | |
4092 | else: |
|
4094 | else: | |
4093 | index.parent().removeRow(index.row()) |
|
4095 | index.parent().removeRow(index.row()) | |
4094 | self.removeItemTreeFromProject() |
|
4096 | self.removeItemTreeFromProject() | |
4095 | self.console.clear() |
|
4097 | self.console.clear() | |
4096 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4098 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4097 | # print i.row() |
|
4099 | # print i.row() | |
4098 |
|
4100 | |||
4099 | if action == quitAction3: |
|
4101 | if action == quitAction3: | |
4100 | self.close() |
|
4102 | self.close() | |
4101 | return 0 |
|
4103 | return 0 | |
4102 |
|
4104 | |||
4103 | def createProjectView(self, id): |
|
4105 | def createProjectView(self, id): | |
4104 |
|
4106 | |||
4105 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4107 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4106 | id = str(id) |
|
4108 | id = str(id) | |
4107 | projectParms = self.__getParmsFromProjectWindow() |
|
4109 | projectParms = self.__getParmsFromProjectWindow() | |
4108 |
|
4110 | |||
4109 | if not projectParms.isValid(): |
|
4111 | if not projectParms.isValid(): | |
4110 | return None |
|
4112 | return None | |
4111 |
|
4113 | |||
4112 | projectObjView = Project() |
|
4114 | projectObjView = Project() | |
4113 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4115 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4114 |
|
4116 | |||
4115 | self.__projectObjDict[id] = projectObjView |
|
4117 | self.__projectObjDict[id] = projectObjView | |
4116 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4118 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4117 |
|
4119 | |||
4118 | return projectObjView |
|
4120 | return projectObjView | |
4119 |
|
4121 | |||
4120 | def updateProjectView(self): |
|
4122 | def updateProjectView(self): | |
4121 |
|
4123 | |||
4122 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4124 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4123 |
|
4125 | |||
4124 | projectParms = self.__getParmsFromProjectWindow() |
|
4126 | projectParms = self.__getParmsFromProjectWindow() | |
4125 |
|
4127 | |||
4126 | if not projectParms.isValid(): |
|
4128 | if not projectParms.isValid(): | |
4127 | return None |
|
4129 | return None | |
4128 |
|
4130 | |||
4129 | projectObjView = self.getSelectedProjectObj() |
|
4131 | projectObjView = self.getSelectedProjectObj() | |
4130 |
|
4132 | |||
4131 | if not projectObjView: |
|
4133 | if not projectObjView: | |
4132 | self.console.append("Please select a project before update it") |
|
4134 | self.console.append("Please select a project before update it") | |
4133 | return None |
|
4135 | return None | |
4134 |
|
4136 | |||
4135 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4137 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4136 |
|
4138 | |||
4137 | return projectObjView |
|
4139 | return projectObjView | |
4138 |
|
4140 | |||
4139 | def createReadUnitView(self, projectObjView, idReadUnit=None): |
|
4141 | def createReadUnitView(self, projectObjView, idReadUnit=None): | |
4140 |
|
4142 | |||
4141 | projectParms = self.__getParmsFromProjectWindow() |
|
4143 | projectParms = self.__getParmsFromProjectWindow() | |
4142 |
|
4144 | |||
4143 | if not projectParms.isValid(): |
|
4145 | if not projectParms.isValid(): | |
4144 | return None |
|
4146 | return None | |
4145 |
|
4147 | |||
4146 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4148 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4147 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4149 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4148 | datatype=projectParms.datatype, |
|
4150 | datatype=projectParms.datatype, | |
4149 | path=projectParms.dpath, |
|
4151 | path=projectParms.dpath, | |
4150 | startDate=projectParms.startDate, |
|
4152 | startDate=projectParms.startDate, | |
4151 | endDate=projectParms.endDate, |
|
4153 | endDate=projectParms.endDate, | |
4152 | startTime=projectParms.startTime, |
|
4154 | startTime=projectParms.startTime, | |
4153 | endTime=projectParms.endTime, |
|
4155 | endTime=projectParms.endTime, | |
4154 | online=projectParms.online, |
|
4156 | online=projectParms.online, | |
4155 | walk=projectParms.walk |
|
4157 | walk=projectParms.walk | |
4156 | ) |
|
4158 | ) | |
4157 |
|
4159 | |||
4158 | if projectParms.set: |
|
4160 | if projectParms.set: | |
4159 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4161 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4160 |
|
4162 | |||
4161 | if projectParms.delay: |
|
4163 | if projectParms.delay: | |
4162 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4164 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4163 |
|
4165 | |||
4164 | if projectParms.expLabel: |
|
4166 | if projectParms.expLabel: | |
4165 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4167 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4166 |
|
4168 | |||
4167 | readUnitConfObj.addOperation(name="printInfo") |
|
4169 | readUnitConfObj.addOperation(name="printInfo") | |
4168 |
|
4170 | |||
4169 | if projectParms.datatype == "USRP": |
|
4171 | if projectParms.datatype == "USRP": | |
4170 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, |
|
4172 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
4171 | datatype=projectParms.datatype, |
|
4173 | datatype=projectParms.datatype, | |
4172 | path=projectParms.dpath, |
|
4174 | path=projectParms.dpath, | |
4173 | startDate=projectParms.startDate, |
|
4175 | startDate=projectParms.startDate, | |
4174 | endDate=projectParms.endDate, |
|
4176 | endDate=projectParms.endDate, | |
4175 | startTime=projectParms.startTime, |
|
4177 | startTime=projectParms.startTime, | |
4176 | endTime=projectParms.endTime, |
|
4178 | endTime=projectParms.endTime, | |
4177 | online=projectParms.online, |
|
4179 | online=projectParms.online, | |
4178 | ippKm=projectParms.ippKm |
|
4180 | ippKm=projectParms.ippKm | |
4179 | ) |
|
4181 | ) | |
4180 |
|
4182 | |||
4181 | if projectParms.delay: |
|
4183 | if projectParms.delay: | |
4182 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4184 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4183 |
|
4185 | |||
4184 | return readUnitConfObj |
|
4186 | return readUnitConfObj | |
4185 |
|
4187 | |||
4186 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4188 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4187 |
|
4189 | |||
4188 | projectObjView.removeProcUnit(idReadUnit) |
|
4190 | projectObjView.removeProcUnit(idReadUnit) | |
4189 |
|
4191 | |||
4190 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) |
|
4192 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) | |
4191 |
|
4193 | |||
4192 | return readUnitConfObj |
|
4194 | return readUnitConfObj | |
4193 |
|
4195 | |||
4194 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4196 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4195 |
|
4197 | |||
4196 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4198 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4197 |
|
4199 | |||
4198 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4200 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4199 |
|
4201 | |||
4200 | return procUnitConfObj |
|
4202 | return procUnitConfObj | |
4201 |
|
4203 | |||
4202 | def updateProcUnitView(self, id): |
|
4204 | def updateProcUnitView(self, id): | |
4203 |
|
4205 | |||
4204 | pass |
|
4206 | pass | |
4205 |
|
4207 | |||
4206 | def addPUWindow(self): |
|
4208 | def addPUWindow(self): | |
4207 |
|
4209 | |||
4208 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4210 | self.configUPWindowObj = UnitProcessWindow(self) | |
4209 | fatherObj = self.getSelectedItemObj() |
|
4211 | fatherObj = self.getSelectedItemObj() | |
4210 | try: |
|
4212 | try: | |
4211 | fatherObj.getElementName() |
|
4213 | fatherObj.getElementName() | |
4212 | except: |
|
4214 | except: | |
4213 | self.console.append("First left click on Project or Processing Unit") |
|
4215 | self.console.append("First left click on Project or Processing Unit") | |
4214 | return 0 |
|
4216 | return 0 | |
4215 |
|
4217 | |||
4216 | if fatherObj.getElementName() == 'Project': |
|
4218 | if fatherObj.getElementName() == 'Project': | |
4217 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4219 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4218 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4220 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4219 |
|
4221 | |||
4220 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4222 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4221 | self.configUPWindowObj.loadTotalList() |
|
4223 | self.configUPWindowObj.loadTotalList() | |
4222 | self.configUPWindowObj.show() |
|
4224 | self.configUPWindowObj.show() | |
4223 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4225 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4224 |
|
4226 | |||
4225 | def createPUWindow(self): |
|
4227 | def createPUWindow(self): | |
4226 |
|
4228 | |||
4227 | if not self.configUPWindowObj.create: |
|
4229 | if not self.configUPWindowObj.create: | |
4228 | return |
|
4230 | return | |
4229 |
|
4231 | |||
4230 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4232 | fatherObj = self.configUPWindowObj.getFromWindow | |
4231 | datatype = self.configUPWindowObj.typeofUP |
|
4233 | datatype = self.configUPWindowObj.typeofUP | |
4232 |
|
4234 | |||
4233 | if fatherObj.getElementName() == 'Project': |
|
4235 | if fatherObj.getElementName() == 'Project': | |
4234 | inputId = fatherObj.getReadUnitId() |
|
4236 | inputId = fatherObj.getReadUnitId() | |
4235 | projectObjView = fatherObj |
|
4237 | projectObjView = fatherObj | |
4236 | else: |
|
4238 | else: | |
4237 | inputId = fatherObj.getId() |
|
4239 | inputId = fatherObj.getId() | |
4238 | projectObjView = self.getSelectedProjectObj() |
|
4240 | projectObjView = self.getSelectedProjectObj() | |
4239 |
|
4241 | |||
4240 | if not projectObjView: |
|
4242 | if not projectObjView: | |
4241 | return |
|
4243 | return | |
4242 |
|
4244 | |||
4243 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4245 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4244 |
|
4246 | |||
4245 | self.addPU2ProjectExplorer(puObj) |
|
4247 | self.addPU2ProjectExplorer(puObj) | |
4246 |
|
4248 | |||
4247 | self.showtabPUCreated(datatype) |
|
4249 | self.showtabPUCreated(datatype) | |
4248 |
|
4250 | |||
4249 | self.clearPUWindow(datatype) |
|
4251 | self.clearPUWindow(datatype) | |
4250 |
|
4252 | |||
4251 | self.showPUinitView() |
|
4253 | self.showPUinitView() | |
4252 |
|
4254 | |||
4253 | def addFTPConf2Operation(self, puObj, opObj): |
|
4255 | def addFTPConf2Operation(self, puObj, opObj): | |
4254 |
|
4256 | |||
4255 | if not self.temporalFTP.create: |
|
4257 | if not self.temporalFTP.create: | |
4256 | self.temporalFTP.setwithoutconfiguration() |
|
4258 | self.temporalFTP.setwithoutconfiguration() | |
4257 |
|
4259 | |||
4258 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4260 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4259 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4261 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4260 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4262 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4261 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4263 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4262 |
|
4264 | |||
4263 | if self.temporalFTP.ftp_wei: |
|
4265 | if self.temporalFTP.ftp_wei: | |
4264 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4266 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4265 | if self.temporalFTP.exp_code: |
|
4267 | if self.temporalFTP.exp_code: | |
4266 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4268 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4267 | if self.temporalFTP.sub_exp_code: |
|
4269 | if self.temporalFTP.sub_exp_code: | |
4268 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4270 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4269 | if self.temporalFTP.plot_pos: |
|
4271 | if self.temporalFTP.plot_pos: | |
4270 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4272 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4271 |
|
4273 | |||
4272 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4274 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4273 | # |
|
4275 | # | |
4274 | # puId = None |
|
4276 | # puId = None | |
4275 | # puObj = None |
|
4277 | # puObj = None | |
4276 | # |
|
4278 | # | |
4277 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4279 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4278 | # |
|
4280 | # | |
4279 | # if not thisPuObj.name == "SendToServer": |
|
4281 | # if not thisPuObj.name == "SendToServer": | |
4280 | # continue |
|
4282 | # continue | |
4281 | # |
|
4283 | # | |
4282 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4284 | # opObj = thisPuObj.getOperationObj(name='run') | |
4283 | # |
|
4285 | # | |
4284 | # parmObj = opObj.getParameterObj('localfolder') |
|
4286 | # parmObj = opObj.getParameterObj('localfolder') | |
4285 | # |
|
4287 | # | |
4286 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4288 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4287 | # if not parmObj: |
|
4289 | # if not parmObj: | |
4288 | # projectObj.removeProcUnit(thisPuId) |
|
4290 | # projectObj.removeProcUnit(thisPuId) | |
4289 | # continue |
|
4291 | # continue | |
4290 | # |
|
4292 | # | |
4291 | # thisLocalfolder = parmObj.getValue() |
|
4293 | # thisLocalfolder = parmObj.getValue() | |
4292 | # |
|
4294 | # | |
4293 | # if localfolder != thisLocalfolder: |
|
4295 | # if localfolder != thisLocalfolder: | |
4294 | # continue |
|
4296 | # continue | |
4295 | # |
|
4297 | # | |
4296 | # puId = thisPuId |
|
4298 | # puId = thisPuId | |
4297 | # puObj = thisPuObj |
|
4299 | # puObj = thisPuObj | |
4298 | # break |
|
4300 | # break | |
4299 | # |
|
4301 | # | |
4300 | # return puObj |
|
4302 | # return puObj | |
4301 |
|
4303 | |||
4302 | def createFTPProcUnitView(self): |
|
4304 | def createFTPProcUnitView(self): | |
4303 |
|
4305 | |||
4304 | if not self.temporalFTP.create: |
|
4306 | if not self.temporalFTP.create: | |
4305 | self.temporalFTP.setwithoutconfiguration() |
|
4307 | self.temporalFTP.setwithoutconfiguration() | |
4306 |
|
4308 | |||
4307 | projectObj = self.getSelectedProjectObj() |
|
4309 | projectObj = self.getSelectedProjectObj() | |
4308 |
|
4310 | |||
4309 | if not projectObj: |
|
4311 | if not projectObj: | |
4310 | return |
|
4312 | return | |
4311 |
|
4313 | |||
4312 | self.removeAllFTPProcUnitView(projectObj) |
|
4314 | self.removeAllFTPProcUnitView(projectObj) | |
4313 |
|
4315 | |||
4314 | if not self.__puLocalFolder2FTP: |
|
4316 | if not self.__puLocalFolder2FTP: | |
4315 | return |
|
4317 | return | |
4316 |
|
4318 | |||
4317 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4319 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4318 |
|
4320 | |||
4319 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4321 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4320 |
|
4322 | |||
4321 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4323 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4322 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4324 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4323 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4325 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4324 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4326 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4325 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4327 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4326 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4328 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4327 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4329 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4328 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4330 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4329 |
|
4331 | |||
4330 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4332 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4331 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4333 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4332 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4334 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4333 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4335 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4334 |
|
4336 | |||
4335 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4337 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4336 |
|
4338 | |||
4337 | def removeAllFTPProcUnitView(self, projectObj): |
|
4339 | def removeAllFTPProcUnitView(self, projectObj): | |
4338 |
|
4340 | |||
4339 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4341 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4340 |
|
4342 | |||
4341 | if not thisPuObj.name == "SendToServer": |
|
4343 | if not thisPuObj.name == "SendToServer": | |
4342 | continue |
|
4344 | continue | |
4343 |
|
4345 | |||
4344 | projectObj.removeProcUnit(thisPuId) |
|
4346 | projectObj.removeProcUnit(thisPuId) | |
4345 |
|
4347 | |||
4346 | if thisPuId not in self.__puObjDict.keys(): |
|
4348 | if thisPuId not in self.__puObjDict.keys(): | |
4347 | continue |
|
4349 | continue | |
4348 |
|
4350 | |||
4349 | self.__puObjDict.pop(thisPuId) |
|
4351 | self.__puObjDict.pop(thisPuId) | |
4350 |
|
4352 | |||
4351 | def showPUinitView(self): |
|
4353 | def showPUinitView(self): | |
4352 |
|
4354 | |||
4353 | self.propertiesModel = TreeModel() |
|
4355 | self.propertiesModel = TreeModel() | |
4354 | self.propertiesModel.initPUVoltageView() |
|
4356 | self.propertiesModel.initPUVoltageView() | |
4355 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4357 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4356 | self.treeProjectProperties.expandAll() |
|
4358 | self.treeProjectProperties.expandAll() | |
4357 | self.treeProjectProperties.allColumnsShowFocus() |
|
4359 | self.treeProjectProperties.allColumnsShowFocus() | |
4358 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4360 | self.treeProjectProperties.resizeColumnToContents(1) | |
4359 |
|
4361 | |||
4360 | def saveFTPFromOpObj(self, operationObj): |
|
4362 | def saveFTPFromOpObj(self, operationObj): | |
4361 |
|
4363 | |||
4362 | if operationObj.name != "SendByFTP": |
|
4364 | if operationObj.name != "SendByFTP": | |
4363 | return |
|
4365 | return | |
4364 |
|
4366 | |||
4365 | server = operationObj.getParameterValue("server") |
|
4367 | server = operationObj.getParameterValue("server") | |
4366 | username = operationObj.getParameterValue("username") |
|
4368 | username = operationObj.getParameterValue("username") | |
4367 | password = operationObj.getParameterValue("password") |
|
4369 | password = operationObj.getParameterValue("password") | |
4368 | localfolder = operationObj.getParameterValue("localfolder") |
|
4370 | localfolder = operationObj.getParameterValue("localfolder") | |
4369 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4371 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4370 | ext = operationObj.getParameterValue("ext") |
|
4372 | ext = operationObj.getParameterValue("ext") | |
4371 | period = operationObj.getParameterValue("period") |
|
4373 | period = operationObj.getParameterValue("period") | |
4372 |
|
4374 | |||
4373 | self.temporalFTP.save(server=server, |
|
4375 | self.temporalFTP.save(server=server, | |
4374 | remotefolder=remotefolder, |
|
4376 | remotefolder=remotefolder, | |
4375 | username=username, |
|
4377 | username=username, | |
4376 | password=password, |
|
4378 | password=password, | |
4377 | localfolder=localfolder, |
|
4379 | localfolder=localfolder, | |
4378 | extension=ext) |
|
4380 | extension=ext) | |
4379 |
|
4381 | |||
4380 | return |
|
4382 | return | |
4381 |
|
4383 | |||
4382 | def saveFTPFromProcUnitObj(self, puObj): |
|
4384 | def saveFTPFromProcUnitObj(self, puObj): | |
4383 |
|
4385 | |||
4384 | opObj = puObj.getOperationObj(name="run") |
|
4386 | opObj = puObj.getOperationObj(name="run") | |
4385 |
|
4387 | |||
4386 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4388 | parmObj = opObj.getParameterObj(parameterName="server") | |
4387 | if parmObj == None: |
|
4389 | if parmObj == None: | |
4388 | server = 'jro-app.igp.gob.pe' |
|
4390 | server = 'jro-app.igp.gob.pe' | |
4389 | else: |
|
4391 | else: | |
4390 | server = parmObj.getValue() |
|
4392 | server = parmObj.getValue() | |
4391 |
|
4393 | |||
4392 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4394 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4393 | if parmObj == None: |
|
4395 | if parmObj == None: | |
4394 | remotefolder = '/home/wmaster/graficos' |
|
4396 | remotefolder = '/home/wmaster/graficos' | |
4395 | else: |
|
4397 | else: | |
4396 | remotefolder = parmObj.getValue() |
|
4398 | remotefolder = parmObj.getValue() | |
4397 |
|
4399 | |||
4398 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4400 | parmObj = opObj.getParameterObj(parameterName="username") | |
4399 | if parmObj == None: |
|
4401 | if parmObj == None: | |
4400 | username = 'wmaster' |
|
4402 | username = 'wmaster' | |
4401 | else: |
|
4403 | else: | |
4402 | username = parmObj.getValue() |
|
4404 | username = parmObj.getValue() | |
4403 |
|
4405 | |||
4404 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4406 | parmObj = opObj.getParameterObj(parameterName="password") | |
4405 | if parmObj == None: |
|
4407 | if parmObj == None: | |
4406 | password = 'mst2010vhf' |
|
4408 | password = 'mst2010vhf' | |
4407 | else: |
|
4409 | else: | |
4408 | password = parmObj.getValue() |
|
4410 | password = parmObj.getValue() | |
4409 |
|
4411 | |||
4410 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4412 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4411 | if parmObj == None: |
|
4413 | if parmObj == None: | |
4412 | ftp_wei = 0 |
|
4414 | ftp_wei = 0 | |
4413 | else: |
|
4415 | else: | |
4414 | ftp_wei = parmObj.getValue() |
|
4416 | ftp_wei = parmObj.getValue() | |
4415 |
|
4417 | |||
4416 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4418 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4417 | if parmObj == None: |
|
4419 | if parmObj == None: | |
4418 | exp_code = 0 |
|
4420 | exp_code = 0 | |
4419 | else: |
|
4421 | else: | |
4420 | exp_code = parmObj.getValue() |
|
4422 | exp_code = parmObj.getValue() | |
4421 |
|
4423 | |||
4422 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4424 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4423 | if parmObj == None: |
|
4425 | if parmObj == None: | |
4424 | sub_exp_code = 0 |
|
4426 | sub_exp_code = 0 | |
4425 | else: |
|
4427 | else: | |
4426 | sub_exp_code = parmObj.getValue() |
|
4428 | sub_exp_code = parmObj.getValue() | |
4427 |
|
4429 | |||
4428 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4430 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4429 | if parmObj == None: |
|
4431 | if parmObj == None: | |
4430 | plot_pos = 0 |
|
4432 | plot_pos = 0 | |
4431 | else: |
|
4433 | else: | |
4432 | plot_pos = parmObj.getValue() |
|
4434 | plot_pos = parmObj.getValue() | |
4433 |
|
4435 | |||
4434 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4436 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4435 | if parmObj == None: |
|
4437 | if parmObj == None: | |
4436 | localfolder = None |
|
4438 | localfolder = None | |
4437 | else: |
|
4439 | else: | |
4438 | localfolder = parmObj.getValue() |
|
4440 | localfolder = parmObj.getValue() | |
4439 |
|
4441 | |||
4440 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4442 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4441 | if parmObj == None: |
|
4443 | if parmObj == None: | |
4442 | extension = '.png' |
|
4444 | extension = '.png' | |
4443 | else: |
|
4445 | else: | |
4444 | extension = parmObj.getValue() |
|
4446 | extension = parmObj.getValue() | |
4445 |
|
4447 | |||
4446 | self.temporalFTP.save(server=server, |
|
4448 | self.temporalFTP.save(server=server, | |
4447 | remotefolder=remotefolder, |
|
4449 | remotefolder=remotefolder, | |
4448 | username=username, |
|
4450 | username=username, | |
4449 | password=password, |
|
4451 | password=password, | |
4450 | ftp_wei=ftp_wei, |
|
4452 | ftp_wei=ftp_wei, | |
4451 | exp_code=exp_code, |
|
4453 | exp_code=exp_code, | |
4452 | sub_exp_code=sub_exp_code, |
|
4454 | sub_exp_code=sub_exp_code, | |
4453 | plot_pos=plot_pos, |
|
4455 | plot_pos=plot_pos, | |
4454 | localfolder=localfolder, |
|
4456 | localfolder=localfolder, | |
4455 | extension=extension) |
|
4457 | extension=extension) | |
4456 |
|
4458 | |||
4457 | def addProject2ProjectExplorer(self, id, name): |
|
4459 | def addProject2ProjectExplorer(self, id, name): | |
4458 |
|
4460 | |||
4459 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4461 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4460 |
|
4462 | |||
4461 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4463 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4462 | parentItem.appendRow(itemTree) |
|
4464 | parentItem.appendRow(itemTree) | |
4463 |
|
4465 | |||
4464 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4466 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4465 |
|
4467 | |||
4466 | self.selectedItemTree = itemTree |
|
4468 | self.selectedItemTree = itemTree | |
4467 |
|
4469 | |||
4468 | self.__itemTreeDict[id] = itemTree |
|
4470 | self.__itemTreeDict[id] = itemTree | |
4469 |
|
4471 | |||
4470 | def addPU2ProjectExplorer(self, puObj): |
|
4472 | def addPU2ProjectExplorer(self, puObj): | |
4471 |
|
4473 | |||
4472 | id, name = puObj.id, puObj.datatype |
|
4474 | id, name = puObj.id, puObj.datatype | |
4473 |
|
4475 | |||
4474 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4476 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4475 |
|
4477 | |||
4476 | parentItem = self.selectedItemTree |
|
4478 | parentItem = self.selectedItemTree | |
4477 | parentItem.appendRow(itemTree) |
|
4479 | parentItem.appendRow(itemTree) | |
4478 | self.projectExplorerTree.expandAll() |
|
4480 | self.projectExplorerTree.expandAll() | |
4479 |
|
4481 | |||
4480 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4482 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4481 |
|
4483 | |||
4482 | self.selectedItemTree = itemTree |
|
4484 | self.selectedItemTree = itemTree | |
4483 |
|
4485 | |||
4484 | self.__itemTreeDict[id] = itemTree |
|
4486 | self.__itemTreeDict[id] = itemTree | |
4485 |
|
4487 | |||
4486 | def addPU2PELoadXML(self, puObj): |
|
4488 | def addPU2PELoadXML(self, puObj): | |
4487 |
|
4489 | |||
4488 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4490 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4489 |
|
4491 | |||
4490 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4492 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4491 |
|
4493 | |||
4492 | if self.__itemTreeDict.has_key(inputId): |
|
4494 | if self.__itemTreeDict.has_key(inputId): | |
4493 | parentItem = self.__itemTreeDict[inputId] |
|
4495 | parentItem = self.__itemTreeDict[inputId] | |
4494 | else: |
|
4496 | else: | |
4495 | #If parent is a Reader object |
|
4497 | #If parent is a Reader object | |
4496 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4498 | parentItem = self.__itemTreeDict[id[:-1]] | |
4497 |
|
4499 | |||
4498 | parentItem.appendRow(itemTree) |
|
4500 | parentItem.appendRow(itemTree) | |
4499 | self.projectExplorerTree.expandAll() |
|
4501 | self.projectExplorerTree.expandAll() | |
4500 | parentItem = itemTree |
|
4502 | parentItem = itemTree | |
4501 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4503 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4502 |
|
4504 | |||
4503 | self.__itemTreeDict[id] = itemTree |
|
4505 | self.__itemTreeDict[id] = itemTree | |
4504 | self.selectedItemTree = itemTree |
|
4506 | self.selectedItemTree = itemTree | |
4505 |
|
4507 | |||
4506 | def getSelectedProjectObj(self): |
|
4508 | def getSelectedProjectObj(self): | |
4507 | """ |
|
4509 | """ | |
4508 | Return the current project object selected. If a processing unit is |
|
4510 | Return the current project object selected. If a processing unit is | |
4509 | actually selected this function returns associated project. |
|
4511 | actually selected this function returns associated project. | |
4510 |
|
4512 | |||
4511 | None if any project or processing unit is selected |
|
4513 | None if any project or processing unit is selected | |
4512 | """ |
|
4514 | """ | |
4513 | for key in self.__itemTreeDict.keys(): |
|
4515 | for key in self.__itemTreeDict.keys(): | |
4514 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4516 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4515 | continue |
|
4517 | continue | |
4516 |
|
4518 | |||
4517 | if self.__projectObjDict.has_key(key): |
|
4519 | if self.__projectObjDict.has_key(key): | |
4518 | projectObj = self.__projectObjDict[key] |
|
4520 | projectObj = self.__projectObjDict[key] | |
4519 | return projectObj |
|
4521 | return projectObj | |
4520 |
|
4522 | |||
4521 | puObj = self.__puObjDict[key] |
|
4523 | puObj = self.__puObjDict[key] | |
4522 |
|
4524 | |||
4523 | if puObj.parentId == None: |
|
4525 | if puObj.parentId == None: | |
4524 | projectId = puObj.getId()[0] |
|
4526 | projectId = puObj.getId()[0] | |
4525 | else: |
|
4527 | else: | |
4526 | projectId = puObj.parentId |
|
4528 | projectId = puObj.parentId | |
4527 |
|
4529 | |||
4528 | projectObj = self.__projectObjDict[projectId] |
|
4530 | projectObj = self.__projectObjDict[projectId] | |
4529 | return projectObj |
|
4531 | return projectObj | |
4530 |
|
4532 | |||
4531 | return None |
|
4533 | return None | |
4532 |
|
4534 | |||
4533 | def getSelectedItemObj(self): |
|
4535 | def getSelectedItemObj(self): | |
4534 | """ |
|
4536 | """ | |
4535 | Return the current project or processing unit object selected |
|
4537 | Return the current project or processing unit object selected | |
4536 |
|
4538 | |||
4537 | None if any project or processing unit is selected |
|
4539 | None if any project or processing unit is selected | |
4538 | """ |
|
4540 | """ | |
4539 | for key in self.__itemTreeDict.keys(): |
|
4541 | for key in self.__itemTreeDict.keys(): | |
4540 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4542 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4541 | continue |
|
4543 | continue | |
4542 |
|
4544 | |||
4543 | if self.__projectObjDict.has_key(key) == True: |
|
4545 | if self.__projectObjDict.has_key(key) == True: | |
4544 | fatherObj = self.__projectObjDict[key] |
|
4546 | fatherObj = self.__projectObjDict[key] | |
4545 | else: |
|
4547 | else: | |
4546 | fatherObj = self.__puObjDict[key] |
|
4548 | fatherObj = self.__puObjDict[key] | |
4547 |
|
4549 | |||
4548 | return fatherObj |
|
4550 | return fatherObj | |
4549 |
|
4551 | |||
4550 | return None |
|
4552 | return None | |
4551 |
|
4553 | |||
4552 | def _WarningWindow(self, text, information): |
|
4554 | def _WarningWindow(self, text, information): | |
4553 |
|
4555 | |||
4554 | msgBox = QtGui.QMessageBox() |
|
4556 | msgBox = QtGui.QMessageBox() | |
4555 | msgBox.setText(text) |
|
4557 | msgBox.setText(text) | |
4556 | msgBox.setInformativeText(information) |
|
4558 | msgBox.setInformativeText(information) | |
4557 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4559 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4558 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4560 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4559 | ret = msgBox.exec_() |
|
4561 | ret = msgBox.exec_() | |
4560 |
|
4562 | |||
4561 | answer = False |
|
4563 | answer = False | |
4562 |
|
4564 | |||
4563 | if ret == QtGui.QMessageBox.Ok: |
|
4565 | if ret == QtGui.QMessageBox.Ok: | |
4564 | answer = True |
|
4566 | answer = True | |
4565 |
|
4567 | |||
4566 | return answer |
|
4568 | return answer | |
4567 |
|
4569 | |||
4568 | def __getNewProjectId(self): |
|
4570 | def __getNewProjectId(self): | |
4569 |
|
4571 | |||
4570 | loadProject = False |
|
4572 | loadProject = False | |
4571 |
|
4573 | |||
4572 | for thisId in range(1,10): |
|
4574 | for thisId in range(1,10): | |
4573 | newId = str(thisId) |
|
4575 | newId = str(thisId) | |
4574 | if newId in self.__projectObjDict.keys(): |
|
4576 | if newId in self.__projectObjDict.keys(): | |
4575 | continue |
|
4577 | continue | |
4576 |
|
4578 | |||
4577 | loadProject = True |
|
4579 | loadProject = True | |
4578 | projectId = newId |
|
4580 | projectId = newId | |
4579 | break |
|
4581 | break | |
4580 |
|
4582 | |||
4581 | if not loadProject: |
|
4583 | if not loadProject: | |
4582 | self.console.clear() |
|
4584 | self.console.clear() | |
4583 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4585 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4584 | return None |
|
4586 | return None | |
4585 |
|
4587 | |||
4586 | return projectId |
|
4588 | return projectId | |
4587 |
|
4589 | |||
4588 | def openProject(self): |
|
4590 | def openProject(self): | |
4589 |
|
4591 | |||
4590 | self._disable_save_button() |
|
4592 | self._disable_save_button() | |
4591 | self._disable_play_button() |
|
4593 | self._disable_play_button() | |
4592 |
|
4594 | |||
4593 | self.frame_2.setEnabled(True) |
|
4595 | self.frame_2.setEnabled(True) | |
4594 |
|
4596 | |||
4595 | # print self.dir |
|
4597 | # print self.dir | |
4596 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4598 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4597 |
|
4599 | |||
4598 | projectObjLoad = Project() |
|
4600 | projectObjLoad = Project() | |
4599 |
|
4601 | |||
4600 | try: |
|
4602 | try: | |
4601 | projectObjLoad.readXml(filename) |
|
4603 | projectObjLoad.readXml(filename) | |
4602 | except: |
|
4604 | except: | |
4603 | self.console.clear() |
|
4605 | self.console.clear() | |
4604 | self.console.append("The selected xml file could not be loaded ...") |
|
4606 | self.console.append("The selected xml file could not be loaded ...") | |
4605 | return 0 |
|
4607 | return 0 | |
4606 |
|
4608 | |||
4607 | self.create = False |
|
4609 | self.create = False | |
4608 | self.refreshProjectWindow(projectObjLoad) |
|
4610 | self.refreshProjectWindow(projectObjLoad) | |
4609 | self.refreshProjectProperties(projectObjLoad) |
|
4611 | self.refreshProjectProperties(projectObjLoad) | |
4610 |
|
4612 | |||
4611 | projectId = projectObjLoad.id |
|
4613 | projectId = projectObjLoad.id | |
4612 |
|
4614 | |||
4613 | if projectId in self.__projectObjDict.keys(): |
|
4615 | if projectId in self.__projectObjDict.keys(): | |
4614 |
|
4616 | |||
4615 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4617 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4616 | # "Do you want to load the file anyway?") |
|
4618 | # "Do you want to load the file anyway?") | |
4617 | # if not answer: |
|
4619 | # if not answer: | |
4618 | # return |
|
4620 | # return | |
4619 |
|
4621 | |||
4620 | projectId = self.__getNewProjectId() |
|
4622 | projectId = self.__getNewProjectId() | |
4621 |
|
4623 | |||
4622 | if not projectId: |
|
4624 | if not projectId: | |
4623 | return |
|
4625 | return | |
4624 |
|
4626 | |||
4625 | projectObjLoad.updateId(projectId) |
|
4627 | projectObjLoad.updateId(projectId) | |
4626 |
|
4628 | |||
4627 | self.__projectObjDict[projectId] = projectObjLoad |
|
4629 | self.__projectObjDict[projectId] = projectObjLoad | |
4628 |
|
4630 | |||
4629 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4631 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4630 |
|
4632 | |||
4631 | self.tabWidgetProject.setEnabled(True) |
|
4633 | self.tabWidgetProject.setEnabled(True) | |
4632 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4634 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4633 | # Disable tabProject after finish the creation |
|
4635 | # Disable tabProject after finish the creation | |
4634 | self.tabProject.setEnabled(True) |
|
4636 | self.tabProject.setEnabled(True) | |
4635 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4637 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4636 |
|
4638 | |||
4637 | for puId, puObj in puObjorderList.items(): |
|
4639 | for puId, puObj in puObjorderList.items(): | |
4638 |
|
4640 | |||
4639 | self.__puObjDict[puId] = puObj |
|
4641 | self.__puObjDict[puId] = puObj | |
4640 |
|
4642 | |||
4641 | if puObj.name == "SendToServer": |
|
4643 | if puObj.name == "SendToServer": | |
4642 | self.saveFTPFromProcUnitObj(puObj) |
|
4644 | self.saveFTPFromProcUnitObj(puObj) | |
4643 |
|
4645 | |||
4644 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4646 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4645 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4647 | operationObj = puObj.getOperationObj("SendByFTP") | |
4646 |
|
4648 | |||
4647 | if operationObj: |
|
4649 | if operationObj: | |
4648 | self.saveFTPFromOpObj(operationObj) |
|
4650 | self.saveFTPFromOpObj(operationObj) | |
4649 | ############################################################ |
|
4651 | ############################################################ | |
4650 |
|
4652 | |||
4651 | if puObj.inputId == '0': |
|
4653 | if puObj.inputId == '0': | |
4652 | continue |
|
4654 | continue | |
4653 |
|
4655 | |||
4654 | self.addPU2PELoadXML(puObj) |
|
4656 | self.addPU2PELoadXML(puObj) | |
4655 |
|
4657 | |||
4656 | self.refreshPUWindow(puObj) |
|
4658 | self.refreshPUWindow(puObj) | |
4657 | self.refreshPUProperties(puObj) |
|
4659 | self.refreshPUProperties(puObj) | |
4658 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4660 | self.showtabPUCreated(datatype=puObj.datatype) | |
4659 |
|
4661 | |||
4660 | self.console.clear() |
|
4662 | self.console.clear() | |
4661 | self.console.append("The selected xml file has been loaded successfully") |
|
4663 | self.console.append("The selected xml file has been loaded successfully") | |
4662 |
|
4664 | |||
4663 | self._disable_save_button() |
|
4665 | self._disable_save_button() | |
4664 | self._enable_play_button() |
|
4666 | self._enable_play_button() | |
4665 |
|
4667 | |||
4666 | def create_updating_timer(self): |
|
4668 | def create_updating_timer(self): | |
4667 | self.comm_data_timer = QtCore.QTimer(self) |
|
4669 | self.comm_data_timer = QtCore.QTimer(self) | |
4668 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4670 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4669 | self.comm_data_timer.start(1000) |
|
4671 | self.comm_data_timer.start(1000) | |
4670 |
|
4672 | |||
4671 | def on_comm_updating_timer(self): |
|
4673 | def on_comm_updating_timer(self): | |
4672 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4674 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4673 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4675 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4674 | if not self.threadStarted: |
|
4676 | if not self.threadStarted: | |
4675 | return |
|
4677 | return | |
4676 |
|
4678 | |||
4677 | if self.controllerThread.isFinished(): |
|
4679 | if self.controllerThread.isFinished(): | |
4678 | self.stopProject() |
|
4680 | self.stopProject() | |
4679 |
|
4681 | |||
4680 | def playProject(self, ext=".xml", save=1): |
|
4682 | def playProject(self, ext=".xml", save=1): | |
4681 |
|
4683 | |||
4682 | self._disable_play_button() |
|
4684 | self._disable_play_button() | |
4683 | self._disable_save_button() |
|
4685 | self._disable_save_button() | |
4684 |
|
4686 | |||
4685 | if self.controllerThread: |
|
4687 | if self.controllerThread: | |
4686 | if self.controllerThread.isRunning(): |
|
4688 | if self.controllerThread.isRunning(): | |
4687 | self.console.append("There is already another process running") |
|
4689 | self.console.append("There is already another process running") | |
4688 | self._enable_stop_button() |
|
4690 | self._enable_stop_button() | |
4689 | return |
|
4691 | return | |
4690 |
|
4692 | |||
4691 | projectObj = self.getSelectedProjectObj() |
|
4693 | projectObj = self.getSelectedProjectObj() | |
4692 |
|
4694 | |||
4693 | if not projectObj: |
|
4695 | if not projectObj: | |
4694 | self.console.append("Please, select a project to start it") |
|
4696 | self.console.append("Please, select a project to start it") | |
4695 | return |
|
4697 | return | |
4696 |
|
4698 | |||
4697 | if save: |
|
4699 | if save: | |
4698 | filename = self.saveProject() |
|
4700 | filename = self.saveProject() | |
4699 | if filename == None: |
|
4701 | if filename == None: | |
4700 | self.console.append("Process not initialized.") |
|
4702 | self.console.append("Process not initialized.") | |
4701 | return |
|
4703 | return | |
4702 | else: |
|
4704 | else: | |
4703 | filename = TEMPORAL_FILE |
|
4705 | filename = TEMPORAL_FILE | |
4704 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4706 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4705 |
|
4707 | |||
4706 |
self.console. |
|
4708 | self.console.clear() | |
|
4709 | self.console.append("Please wait...") | |||
4707 |
|
4710 | |||
4708 | self.controllerThread = ControllerThread(filename) |
|
4711 | self.controllerThread = ControllerThread(filename) | |
4709 |
|
||||
4710 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) |
|
|||
4711 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) |
|
|||
4712 | self.console.clear() |
|
|||
4713 | self.controllerThread.start() |
|
4712 | self.controllerThread.start() | |
|
4713 | ||||
4714 | sleep(0.5) |
|
4714 | sleep(0.5) | |
|
4715 | ||||
4715 | self.threadStarted = True |
|
4716 | self.threadStarted = True | |
4716 |
|
4717 | |||
4717 | self._disable_play_button() |
|
4718 | self._disable_play_button() | |
4718 | self._disable_save_button() |
|
4719 | self._disable_save_button() | |
4719 | self._enable_stop_button() |
|
4720 | self._enable_stop_button() | |
|
4721 | self.console.clear() | |||
4720 |
|
4722 | |||
4721 | def stopProject(self): |
|
4723 | def stopProject(self): | |
4722 |
|
4724 | |||
4723 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) |
|
4725 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
4724 | self.controllerThread.stop() |
|
4726 | self.controllerThread.stop() | |
4725 | self.threadStarted = False |
|
4727 | self.threadStarted = False | |
4726 |
|
4728 | |||
4727 | while self.controllerThread.isRunning(): |
|
4729 | while self.controllerThread.isRunning(): | |
4728 | sleep(0.5) |
|
4730 | sleep(0.5) | |
4729 |
|
4731 | |||
4730 | self._disable_stop_button() |
|
4732 | self._disable_stop_button() | |
4731 | self._enable_play_button() |
|
4733 | self._enable_play_button() | |
4732 |
|
4734 | |||
4733 | def pauseProject(self): |
|
4735 | def pauseProject(self): | |
4734 |
|
4736 | |||
4735 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4737 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4736 | paused = self.controllerThread.pause() |
|
4738 | paused = self.controllerThread.pause() | |
4737 |
|
4739 | |||
4738 | self.changePauseIcon(paused) |
|
4740 | self.changePauseIcon(paused) | |
4739 |
|
4741 | |||
4740 | def saveProject(self, filename=None): |
|
4742 | def saveProject(self, filename=None): | |
4741 |
|
4743 | |||
4742 | self._disable_save_button() |
|
4744 | self._disable_save_button() | |
4743 | self._disable_play_button() |
|
4745 | self._disable_play_button() | |
4744 |
|
4746 | |||
4745 | projectObj = self.getSelectedProjectObj() |
|
4747 | projectObj = self.getSelectedProjectObj() | |
4746 |
|
4748 | |||
4747 | if not projectObj: |
|
4749 | if not projectObj: | |
4748 |
|
4750 | |||
4749 | if self.create: |
|
4751 | if self.create: | |
4750 | self.console.append("Please press Ok before save it") |
|
4752 | self.console.append("Please press Ok before save it") | |
4751 | else: |
|
4753 | else: | |
4752 | self.console.append("Please select a project before save it") |
|
4754 | self.console.append("Please select a project before save it") | |
4753 | return |
|
4755 | return | |
4754 |
|
4756 | |||
4755 | self.refreshGraphicsId() |
|
4757 | self.refreshGraphicsId() | |
4756 |
|
4758 | |||
4757 | sts = True |
|
4759 | sts = True | |
4758 | selectedItemObj = self.getSelectedItemObj() |
|
4760 | selectedItemObj = self.getSelectedItemObj() | |
4759 |
|
4761 | |||
4760 | #A Processing Unit has been selected |
|
4762 | #A Processing Unit has been selected | |
4761 | if projectObj == selectedItemObj: |
|
4763 | if projectObj == selectedItemObj: | |
4762 | if not self.on_proOk_clicked(): |
|
4764 | if not self.on_proOk_clicked(): | |
4763 | return None |
|
4765 | return None | |
4764 |
|
4766 | |||
4765 | #A Processing Unit has been selected |
|
4767 | #A Processing Unit has been selected | |
4766 | if projectObj != selectedItemObj: |
|
4768 | if projectObj != selectedItemObj: | |
4767 | puObj = selectedItemObj |
|
4769 | puObj = selectedItemObj | |
4768 |
|
4770 | |||
4769 | if puObj.name == 'VoltageProc': |
|
4771 | if puObj.name == 'VoltageProc': | |
4770 | sts = self.on_volOpOk_clicked() |
|
4772 | sts = self.on_volOpOk_clicked() | |
4771 | if puObj.name == 'SpectraProc': |
|
4773 | if puObj.name == 'SpectraProc': | |
4772 | sts = self.on_specOpOk_clicked() |
|
4774 | sts = self.on_specOpOk_clicked() | |
4773 | if puObj.name == 'SpectraHeisProc': |
|
4775 | if puObj.name == 'SpectraHeisProc': | |
4774 | sts = self.on_specHeisOpOk_clicked() |
|
4776 | sts = self.on_specHeisOpOk_clicked() | |
4775 |
|
4777 | |||
4776 | if not sts: |
|
4778 | if not sts: | |
4777 | return None |
|
4779 | return None | |
4778 |
|
4780 | |||
4779 | self.createFTPProcUnitView() |
|
4781 | self.createFTPProcUnitView() | |
4780 |
|
4782 | |||
4781 | if not filename: |
|
4783 | if not filename: | |
4782 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4784 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4783 |
|
4785 | |||
4784 | projectObj.writeXml(filename) |
|
4786 | projectObj.writeXml(filename) | |
4785 | self.console.clear() |
|
4787 | self.console.clear() | |
4786 | self.console.append("Project saved") |
|
4788 | self.console.append("Project saved") | |
4787 | self.console.append("Press Play button to start data processing ...") |
|
4789 | self.console.append("Press Play button to start data processing ...") | |
4788 |
|
4790 | |||
4789 | self._disable_save_button() |
|
4791 | self._disable_save_button() | |
4790 | self._enable_play_button() |
|
4792 | self._enable_play_button() | |
4791 |
|
4793 | |||
4792 | return filename |
|
4794 | return filename | |
4793 |
|
4795 | |||
4794 | def removeItemTreeFromProject(self): |
|
4796 | def removeItemTreeFromProject(self): | |
4795 | """ |
|
4797 | """ | |
4796 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4798 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4797 | """ |
|
4799 | """ | |
4798 | for key in self.__itemTreeDict.keys(): |
|
4800 | for key in self.__itemTreeDict.keys(): | |
4799 |
|
4801 | |||
4800 | #Check again because an item can delete multiple items (childs) |
|
4802 | #Check again because an item can delete multiple items (childs) | |
4801 | if key not in self.__itemTreeDict.keys(): |
|
4803 | if key not in self.__itemTreeDict.keys(): | |
4802 | continue |
|
4804 | continue | |
4803 |
|
4805 | |||
4804 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4806 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4805 | continue |
|
4807 | continue | |
4806 |
|
4808 | |||
4807 | if self.__projectObjDict.has_key(key) == True: |
|
4809 | if self.__projectObjDict.has_key(key) == True: | |
4808 |
|
4810 | |||
4809 | del self.__projectObjDict[key] |
|
4811 | del self.__projectObjDict[key] | |
4810 | del self.__itemTreeDict[key] |
|
4812 | del self.__itemTreeDict[key] | |
4811 |
|
4813 | |||
4812 | else: |
|
4814 | else: | |
4813 | puObj = self.__puObjDict[key] |
|
4815 | puObj = self.__puObjDict[key] | |
4814 | idProjectParent = puObj.parentId |
|
4816 | idProjectParent = puObj.parentId | |
4815 | projectObj = self.__projectObjDict[idProjectParent] |
|
4817 | projectObj = self.__projectObjDict[idProjectParent] | |
4816 |
|
4818 | |||
4817 | del self.__puObjDict[key] |
|
4819 | del self.__puObjDict[key] | |
4818 | del self.__itemTreeDict[key] |
|
4820 | del self.__itemTreeDict[key] | |
4819 | del projectObj.procUnitConfObjDict[key] |
|
4821 | del projectObj.procUnitConfObjDict[key] | |
4820 |
|
4822 | |||
4821 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4823 | for key in projectObj.procUnitConfObjDict.keys(): | |
4822 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4824 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4823 | continue |
|
4825 | continue | |
4824 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4826 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4825 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4827 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4826 | del projectObj.procUnitConfObjDict[key] |
|
4828 | del projectObj.procUnitConfObjDict[key] | |
4827 | # print projectObj.procUnitConfObjDict |
|
4829 | # print projectObj.procUnitConfObjDict | |
4828 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4830 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4829 |
|
4831 | |||
4830 | def setInputsProject_View(self): |
|
4832 | def setInputsProject_View(self): | |
4831 |
|
4833 | |||
4832 | self.tabWidgetProject.setEnabled(True) |
|
4834 | self.tabWidgetProject.setEnabled(True) | |
4833 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4835 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4834 | self.tabProject.setEnabled(True) |
|
4836 | self.tabProject.setEnabled(True) | |
4835 | self.frame_2.setEnabled(False) |
|
4837 | self.frame_2.setEnabled(False) | |
4836 | self.proName.clear() |
|
4838 | self.proName.clear() | |
4837 | self.proName.setFocus() |
|
4839 | self.proName.setFocus() | |
4838 | self.proName.setSelection(0, 0) |
|
4840 | self.proName.setSelection(0, 0) | |
4839 | self.proName.setCursorPosition(0) |
|
4841 | self.proName.setCursorPosition(0) | |
4840 | self.proDataType.setText('.r') |
|
4842 | self.proDataType.setText('.r') | |
4841 | self.proDataPath.clear() |
|
4843 | self.proDataPath.clear() | |
4842 | self.proComDataType.clear() |
|
4844 | self.proComDataType.clear() | |
4843 | self.proComDataType.addItem("Voltage") |
|
4845 | self.proComDataType.addItem("Voltage") | |
4844 | self.proComDataType.addItem("Spectra") |
|
4846 | self.proComDataType.addItem("Spectra") | |
4845 | self.proComDataType.addItem("Fits") |
|
4847 | self.proComDataType.addItem("Fits") | |
4846 | self.proComDataType.addItem("USRP") |
|
4848 | self.proComDataType.addItem("USRP") | |
4847 |
|
4849 | |||
4848 | self.proComStartDate.clear() |
|
4850 | self.proComStartDate.clear() | |
4849 | self.proComEndDate.clear() |
|
4851 | self.proComEndDate.clear() | |
4850 |
|
4852 | |||
4851 | startTime = "00:00:00" |
|
4853 | startTime = "00:00:00" | |
4852 | endTime = "23:59:59" |
|
4854 | endTime = "23:59:59" | |
4853 | starlist = startTime.split(":") |
|
4855 | starlist = startTime.split(":") | |
4854 | endlist = endTime.split(":") |
|
4856 | endlist = endTime.split(":") | |
4855 | self.proDelay.setText("60") |
|
4857 | self.proDelay.setText("60") | |
4856 | self.proSet.setText("") |
|
4858 | self.proSet.setText("") | |
4857 |
|
4859 | |||
4858 | self.labelSet.show() |
|
4860 | self.labelSet.show() | |
4859 | self.proSet.show() |
|
4861 | self.proSet.show() | |
4860 |
|
4862 | |||
4861 | self.labelIPPKm.hide() |
|
4863 | self.labelIPPKm.hide() | |
4862 | self.proIPPKm.hide() |
|
4864 | self.proIPPKm.hide() | |
4863 |
|
4865 | |||
4864 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4866 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4865 | self.proStartTime.setTime(self.time) |
|
4867 | self.proStartTime.setTime(self.time) | |
4866 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4868 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4867 | self.proEndTime.setTime(self.time) |
|
4869 | self.proEndTime.setTime(self.time) | |
4868 | self.proDescription.clear() |
|
4870 | self.proDescription.clear() | |
4869 | self.proOk.setEnabled(False) |
|
4871 | self.proOk.setEnabled(False) | |
4870 | # self.console.append("Please, Write a name Project") |
|
4872 | # self.console.append("Please, Write a name Project") | |
4871 | # self.console.append("Introduce Project Parameters")DC |
|
4873 | # self.console.append("Introduce Project Parameters")DC | |
4872 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4874 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4873 |
|
4875 | |||
4874 | def clearPUWindow(self, datatype): |
|
4876 | def clearPUWindow(self, datatype): | |
4875 |
|
4877 | |||
4876 | projectObjView = self.getSelectedProjectObj() |
|
4878 | projectObjView = self.getSelectedProjectObj() | |
4877 |
|
4879 | |||
4878 | if not projectObjView: |
|
4880 | if not projectObjView: | |
4879 | return |
|
4881 | return | |
4880 |
|
4882 | |||
4881 | puObj = self.getSelectedItemObj() |
|
4883 | puObj = self.getSelectedItemObj() | |
4882 | inputId = puObj.getInputId() |
|
4884 | inputId = puObj.getInputId() | |
4883 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4885 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4884 |
|
4886 | |||
4885 | if datatype == 'Voltage': |
|
4887 | if datatype == 'Voltage': | |
4886 | self.volOpComChannels.setEnabled(False) |
|
4888 | self.volOpComChannels.setEnabled(False) | |
4887 | self.volOpComHeights.setEnabled(False) |
|
4889 | self.volOpComHeights.setEnabled(False) | |
4888 | self.volOpFilter.setEnabled(False) |
|
4890 | self.volOpFilter.setEnabled(False) | |
4889 | self.volOpComProfile.setEnabled(False) |
|
4891 | self.volOpComProfile.setEnabled(False) | |
4890 | self.volOpComCode.setEnabled(False) |
|
4892 | self.volOpComCode.setEnabled(False) | |
4891 | self.volOpCohInt.setEnabled(False) |
|
4893 | self.volOpCohInt.setEnabled(False) | |
4892 | self.volOpChannel.setEnabled(False) |
|
4894 | self.volOpChannel.setEnabled(False) | |
4893 | self.volOpHeights.setEnabled(False) |
|
4895 | self.volOpHeights.setEnabled(False) | |
4894 | self.volOpProfile.setEnabled(False) |
|
4896 | self.volOpProfile.setEnabled(False) | |
4895 | self.volOpRadarfrequency.setEnabled(False) |
|
4897 | self.volOpRadarfrequency.setEnabled(False) | |
4896 | self.volOpCebChannels.setCheckState(0) |
|
4898 | self.volOpCebChannels.setCheckState(0) | |
4897 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4899 | self.volOpCebRadarfrequency.setCheckState(0) | |
4898 | self.volOpCebHeights.setCheckState(0) |
|
4900 | self.volOpCebHeights.setCheckState(0) | |
4899 | self.volOpCebFilter.setCheckState(0) |
|
4901 | self.volOpCebFilter.setCheckState(0) | |
4900 | self.volOpCebProfile.setCheckState(0) |
|
4902 | self.volOpCebProfile.setCheckState(0) | |
4901 | self.volOpCebDecodification.setCheckState(0) |
|
4903 | self.volOpCebDecodification.setCheckState(0) | |
4902 | self.volOpCebCohInt.setCheckState(0) |
|
4904 | self.volOpCebCohInt.setCheckState(0) | |
4903 |
|
4905 | |||
4904 | self.volOpChannel.clear() |
|
4906 | self.volOpChannel.clear() | |
4905 | self.volOpHeights.clear() |
|
4907 | self.volOpHeights.clear() | |
4906 | self.volOpProfile.clear() |
|
4908 | self.volOpProfile.clear() | |
4907 | self.volOpFilter.clear() |
|
4909 | self.volOpFilter.clear() | |
4908 | self.volOpCohInt.clear() |
|
4910 | self.volOpCohInt.clear() | |
4909 | self.volOpRadarfrequency.clear() |
|
4911 | self.volOpRadarfrequency.clear() | |
4910 |
|
4912 | |||
4911 | if datatype == 'Spectra': |
|
4913 | if datatype == 'Spectra': | |
4912 |
|
4914 | |||
4913 | if inputPUObj.datatype == 'Spectra': |
|
4915 | if inputPUObj.datatype == 'Spectra': | |
4914 | self.specOpnFFTpoints.setEnabled(False) |
|
4916 | self.specOpnFFTpoints.setEnabled(False) | |
4915 | self.specOpProfiles.setEnabled(False) |
|
4917 | self.specOpProfiles.setEnabled(False) | |
4916 | self.specOpippFactor.setEnabled(False) |
|
4918 | self.specOpippFactor.setEnabled(False) | |
4917 | else: |
|
4919 | else: | |
4918 | self.specOpnFFTpoints.setEnabled(True) |
|
4920 | self.specOpnFFTpoints.setEnabled(True) | |
4919 | self.specOpProfiles.setEnabled(True) |
|
4921 | self.specOpProfiles.setEnabled(True) | |
4920 | self.specOpippFactor.setEnabled(True) |
|
4922 | self.specOpippFactor.setEnabled(True) | |
4921 |
|
4923 | |||
4922 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4924 | self.specOpCebCrossSpectra.setCheckState(0) | |
4923 | self.specOpCebChannel.setCheckState(0) |
|
4925 | self.specOpCebChannel.setCheckState(0) | |
4924 | self.specOpCebHeights.setCheckState(0) |
|
4926 | self.specOpCebHeights.setCheckState(0) | |
4925 | self.specOpCebIncoherent.setCheckState(0) |
|
4927 | self.specOpCebIncoherent.setCheckState(0) | |
4926 | self.specOpCebRemoveDC.setCheckState(0) |
|
4928 | self.specOpCebRemoveDC.setCheckState(0) | |
4927 | self.specOpCebRemoveInt.setCheckState(0) |
|
4929 | self.specOpCebRemoveInt.setCheckState(0) | |
4928 | self.specOpCebgetNoise.setCheckState(0) |
|
4930 | self.specOpCebgetNoise.setCheckState(0) | |
4929 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4931 | self.specOpCebRadarfrequency.setCheckState(0) | |
4930 |
|
4932 | |||
4931 | self.specOpRadarfrequency.setEnabled(False) |
|
4933 | self.specOpRadarfrequency.setEnabled(False) | |
4932 | self.specOppairsList.setEnabled(False) |
|
4934 | self.specOppairsList.setEnabled(False) | |
4933 | self.specOpChannel.setEnabled(False) |
|
4935 | self.specOpChannel.setEnabled(False) | |
4934 | self.specOpHeights.setEnabled(False) |
|
4936 | self.specOpHeights.setEnabled(False) | |
4935 | self.specOpIncoherent.setEnabled(False) |
|
4937 | self.specOpIncoherent.setEnabled(False) | |
4936 | self.specOpgetNoise.setEnabled(False) |
|
4938 | self.specOpgetNoise.setEnabled(False) | |
4937 |
|
4939 | |||
4938 | self.specOpRadarfrequency.clear() |
|
4940 | self.specOpRadarfrequency.clear() | |
4939 | self.specOpnFFTpoints.clear() |
|
4941 | self.specOpnFFTpoints.clear() | |
4940 | self.specOpProfiles.clear() |
|
4942 | self.specOpProfiles.clear() | |
4941 | self.specOpippFactor.clear |
|
4943 | self.specOpippFactor.clear | |
4942 | self.specOppairsList.clear() |
|
4944 | self.specOppairsList.clear() | |
4943 | self.specOpChannel.clear() |
|
4945 | self.specOpChannel.clear() | |
4944 | self.specOpHeights.clear() |
|
4946 | self.specOpHeights.clear() | |
4945 | self.specOpIncoherent.clear() |
|
4947 | self.specOpIncoherent.clear() | |
4946 | self.specOpgetNoise.clear() |
|
4948 | self.specOpgetNoise.clear() | |
4947 |
|
4949 | |||
4948 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4950 | self.specGraphCebSpectraplot.setCheckState(0) | |
4949 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4951 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4950 | self.specGraphCebRTIplot.setCheckState(0) |
|
4952 | self.specGraphCebRTIplot.setCheckState(0) | |
4951 | self.specGraphCebRTInoise.setCheckState(0) |
|
4953 | self.specGraphCebRTInoise.setCheckState(0) | |
4952 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4954 | self.specGraphCebCoherencmap.setCheckState(0) | |
4953 | self.specGraphPowerprofile.setCheckState(0) |
|
4955 | self.specGraphPowerprofile.setCheckState(0) | |
4954 |
|
4956 | |||
4955 | self.specGraphSaveSpectra.setCheckState(0) |
|
4957 | self.specGraphSaveSpectra.setCheckState(0) | |
4956 | self.specGraphSaveCross.setCheckState(0) |
|
4958 | self.specGraphSaveCross.setCheckState(0) | |
4957 | self.specGraphSaveRTIplot.setCheckState(0) |
|
4959 | self.specGraphSaveRTIplot.setCheckState(0) | |
4958 | self.specGraphSaveRTInoise.setCheckState(0) |
|
4960 | self.specGraphSaveRTInoise.setCheckState(0) | |
4959 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
4961 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4960 | self.specGraphSavePowerprofile.setCheckState(0) |
|
4962 | self.specGraphSavePowerprofile.setCheckState(0) | |
4961 |
|
4963 | |||
4962 | self.specGraphftpRTIplot.setCheckState(0) |
|
4964 | self.specGraphftpRTIplot.setCheckState(0) | |
4963 | self.specGraphftpRTInoise.setCheckState(0) |
|
4965 | self.specGraphftpRTInoise.setCheckState(0) | |
4964 | self.specGraphftpCoherencemap.setCheckState(0) |
|
4966 | self.specGraphftpCoherencemap.setCheckState(0) | |
4965 |
|
4967 | |||
4966 | self.specGraphPath.clear() |
|
4968 | self.specGraphPath.clear() | |
4967 | self.specGraphPrefix.clear() |
|
4969 | self.specGraphPrefix.clear() | |
4968 |
|
4970 | |||
4969 | self.specGgraphftpratio.clear() |
|
4971 | self.specGgraphftpratio.clear() | |
4970 |
|
4972 | |||
4971 | self.specGgraphChannelList.clear() |
|
4973 | self.specGgraphChannelList.clear() | |
4972 | self.specGgraphFreq.clear() |
|
4974 | self.specGgraphFreq.clear() | |
4973 | self.specGgraphHeight.clear() |
|
4975 | self.specGgraphHeight.clear() | |
4974 | self.specGgraphDbsrange.clear() |
|
4976 | self.specGgraphDbsrange.clear() | |
4975 | self.specGgraphmagnitud.clear() |
|
4977 | self.specGgraphmagnitud.clear() | |
4976 | self.specGgraphTminTmax.clear() |
|
4978 | self.specGgraphTminTmax.clear() | |
4977 | self.specGgraphTimeRange.clear() |
|
4979 | self.specGgraphTimeRange.clear() | |
4978 |
|
4980 | |||
4979 | if datatype == 'SpectraHeis': |
|
4981 | if datatype == 'SpectraHeis': | |
4980 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
4982 | self.specHeisOpCebIncoherent.setCheckState(0) | |
4981 | self.specHeisOpIncoherent.setEnabled(False) |
|
4983 | self.specHeisOpIncoherent.setEnabled(False) | |
4982 | self.specHeisOpIncoherent.clear() |
|
4984 | self.specHeisOpIncoherent.clear() | |
4983 |
|
4985 | |||
4984 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
4986 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
4985 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
4987 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
4986 |
|
4988 | |||
4987 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
4989 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
4988 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
4990 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
4989 |
|
4991 | |||
4990 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
4992 | self.specHeisGraphftpSpectra.setCheckState(0) | |
4991 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
4993 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
4992 |
|
4994 | |||
4993 | self.specHeisGraphPath.clear() |
|
4995 | self.specHeisGraphPath.clear() | |
4994 | self.specHeisGraphPrefix.clear() |
|
4996 | self.specHeisGraphPrefix.clear() | |
4995 | self.specHeisGgraphChannelList.clear() |
|
4997 | self.specHeisGgraphChannelList.clear() | |
4996 | self.specHeisGgraphXminXmax.clear() |
|
4998 | self.specHeisGgraphXminXmax.clear() | |
4997 | self.specHeisGgraphYminYmax.clear() |
|
4999 | self.specHeisGgraphYminYmax.clear() | |
4998 | self.specHeisGgraphTminTmax.clear() |
|
5000 | self.specHeisGgraphTminTmax.clear() | |
4999 | self.specHeisGgraphTimeRange.clear() |
|
5001 | self.specHeisGgraphTimeRange.clear() | |
5000 | self.specHeisGgraphftpratio.clear() |
|
5002 | self.specHeisGgraphftpratio.clear() | |
5001 |
|
5003 | |||
5002 | def showtabPUCreated(self, datatype): |
|
5004 | def showtabPUCreated(self, datatype): | |
5003 |
|
5005 | |||
5004 | if datatype == "Voltage": |
|
5006 | if datatype == "Voltage": | |
5005 | self.tabVoltage.setEnabled(True) |
|
5007 | self.tabVoltage.setEnabled(True) | |
5006 | self.tabProject.setEnabled(False) |
|
5008 | self.tabProject.setEnabled(False) | |
5007 | self.tabSpectra.setEnabled(False) |
|
5009 | self.tabSpectra.setEnabled(False) | |
5008 | self.tabCorrelation.setEnabled(False) |
|
5010 | self.tabCorrelation.setEnabled(False) | |
5009 | self.tabSpectraHeis.setEnabled(False) |
|
5011 | self.tabSpectraHeis.setEnabled(False) | |
5010 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5012 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5011 |
|
5013 | |||
5012 | if datatype == "Spectra": |
|
5014 | if datatype == "Spectra": | |
5013 | self.tabVoltage.setEnabled(False) |
|
5015 | self.tabVoltage.setEnabled(False) | |
5014 | self.tabProject.setEnabled(False) |
|
5016 | self.tabProject.setEnabled(False) | |
5015 | self.tabSpectra.setEnabled(True) |
|
5017 | self.tabSpectra.setEnabled(True) | |
5016 | self.tabCorrelation.setEnabled(False) |
|
5018 | self.tabCorrelation.setEnabled(False) | |
5017 | self.tabSpectraHeis.setEnabled(False) |
|
5019 | self.tabSpectraHeis.setEnabled(False) | |
5018 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5020 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5019 |
|
5021 | |||
5020 | if datatype == "SpectraHeis": |
|
5022 | if datatype == "SpectraHeis": | |
5021 | self.tabVoltage.setEnabled(False) |
|
5023 | self.tabVoltage.setEnabled(False) | |
5022 | self.tabProject.setEnabled(False) |
|
5024 | self.tabProject.setEnabled(False) | |
5023 | self.tabSpectra.setEnabled(False) |
|
5025 | self.tabSpectra.setEnabled(False) | |
5024 | self.tabCorrelation.setEnabled(False) |
|
5026 | self.tabCorrelation.setEnabled(False) | |
5025 | self.tabSpectraHeis.setEnabled(True) |
|
5027 | self.tabSpectraHeis.setEnabled(True) | |
5026 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5028 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5027 |
|
5029 | |||
5028 | def checkInputsProject(self): |
|
5030 | def checkInputsProject(self): | |
5029 | """ |
|
5031 | """ | |
5030 | Check Inputs Project: |
|
5032 | Check Inputs Project: | |
5031 | - project_name |
|
5033 | - project_name | |
5032 | - datatype |
|
5034 | - datatype | |
5033 | - ext |
|
5035 | - ext | |
5034 | - data_path |
|
5036 | - data_path | |
5035 | - readmode |
|
5037 | - readmode | |
5036 | - delay |
|
5038 | - delay | |
5037 | - set |
|
5039 | - set | |
5038 | - walk |
|
5040 | - walk | |
5039 | """ |
|
5041 | """ | |
5040 | parms_ok = True |
|
5042 | parms_ok = True | |
5041 | project_name = str(self.proName.text()) |
|
5043 | project_name = str(self.proName.text()) | |
5042 | if project_name == '' or project_name == None: |
|
5044 | if project_name == '' or project_name == None: | |
5043 | outputstr = "Enter the Project Name" |
|
5045 | outputstr = "Enter the Project Name" | |
5044 | self.console.append(outputstr) |
|
5046 | self.console.append(outputstr) | |
5045 | parms_ok = False |
|
5047 | parms_ok = False | |
5046 | project_name = None |
|
5048 | project_name = None | |
5047 |
|
5049 | |||
5048 | datatype = str(self.proComDataType.currentText()) |
|
5050 | datatype = str(self.proComDataType.currentText()) | |
5049 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5051 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5050 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5052 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5051 | self.console.append(outputstr) |
|
5053 | self.console.append(outputstr) | |
5052 | parms_ok = False |
|
5054 | parms_ok = False | |
5053 | datatype = None |
|
5055 | datatype = None | |
5054 |
|
5056 | |||
5055 | ext = str(self.proDataType.text()) |
|
5057 | ext = str(self.proDataType.text()) | |
5056 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5058 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5057 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5059 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5058 | self.console.append(outputstr) |
|
5060 | self.console.append(outputstr) | |
5059 | parms_ok = False |
|
5061 | parms_ok = False | |
5060 | ext = None |
|
5062 | ext = None | |
5061 |
|
5063 | |||
5062 | data_path = str(self.proDataPath.text()) |
|
5064 | data_path = str(self.proDataPath.text()) | |
5063 |
|
5065 | |||
5064 | if data_path == '': |
|
5066 | if data_path == '': | |
5065 | outputstr = 'Datapath is empty' |
|
5067 | outputstr = 'Datapath is empty' | |
5066 | self.console.append(outputstr) |
|
5068 | self.console.append(outputstr) | |
5067 | parms_ok = False |
|
5069 | parms_ok = False | |
5068 | data_path = None |
|
5070 | data_path = None | |
5069 |
|
5071 | |||
5070 | if data_path != None: |
|
5072 | if data_path != None: | |
5071 | if not os.path.isdir(data_path): |
|
5073 | if not os.path.isdir(data_path): | |
5072 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5074 | outputstr = 'Datapath:%s does not exists' % data_path | |
5073 | self.console.append(outputstr) |
|
5075 | self.console.append(outputstr) | |
5074 | parms_ok = False |
|
5076 | parms_ok = False | |
5075 | data_path = None |
|
5077 | data_path = None | |
5076 |
|
5078 | |||
5077 | read_mode = str(self.proComReadMode.currentText()) |
|
5079 | read_mode = str(self.proComReadMode.currentText()) | |
5078 | if not(read_mode in ['Online', 'Offline']): |
|
5080 | if not(read_mode in ['Online', 'Offline']): | |
5079 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5081 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5080 | self.console.append(outputstr) |
|
5082 | self.console.append(outputstr) | |
5081 | parms_ok = False |
|
5083 | parms_ok = False | |
5082 | read_mode = None |
|
5084 | read_mode = None | |
5083 |
|
5085 | |||
5084 | delay = None |
|
5086 | delay = None | |
5085 | if read_mode == "Online": |
|
5087 | if read_mode == "Online": | |
5086 | parms_ok = False |
|
5088 | parms_ok = False | |
5087 | try: |
|
5089 | try: | |
5088 | delay = int(str(self.proDelay.text())) |
|
5090 | delay = int(str(self.proDelay.text())) | |
5089 | parms_ok = True |
|
5091 | parms_ok = True | |
5090 | except: |
|
5092 | except: | |
5091 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5093 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5092 | self.console.append(outputstr) |
|
5094 | self.console.append(outputstr) | |
5093 |
|
5095 | |||
5094 | try: |
|
5096 | try: | |
5095 | set = int(str(self.proSet.text())) |
|
5097 | set = int(str(self.proSet.text())) | |
5096 | except: |
|
5098 | except: | |
5097 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5099 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5098 | # self.console.append(outputstr) |
|
5100 | # self.console.append(outputstr) | |
5099 | # parms_ok = False |
|
5101 | # parms_ok = False | |
5100 | set = None |
|
5102 | set = None | |
5101 |
|
5103 | |||
5102 | walk = int(self.proComWalk.currentIndex()) |
|
5104 | walk = int(self.proComWalk.currentIndex()) | |
5103 | expLabel = str(self.proExpLabel.text()) |
|
5105 | expLabel = str(self.proExpLabel.text()) | |
5104 |
|
5106 | |||
5105 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5107 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5106 |
|
5108 | |||
5107 | def checkInputsPUSave(self, datatype): |
|
5109 | def checkInputsPUSave(self, datatype): | |
5108 | """ |
|
5110 | """ | |
5109 | Check Inputs Spectra Save: |
|
5111 | Check Inputs Spectra Save: | |
5110 | - path |
|
5112 | - path | |
5111 | - blocks Per File |
|
5113 | - blocks Per File | |
5112 | - sufix |
|
5114 | - sufix | |
5113 | - dataformat |
|
5115 | - dataformat | |
5114 | """ |
|
5116 | """ | |
5115 | parms_ok = True |
|
5117 | parms_ok = True | |
5116 |
|
5118 | |||
5117 | if datatype == "Voltage": |
|
5119 | if datatype == "Voltage": | |
5118 | output_path = str(self.volOutputPath.text()) |
|
5120 | output_path = str(self.volOutputPath.text()) | |
5119 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5121 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5120 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5122 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5121 |
|
5123 | |||
5122 | if datatype == "Spectra": |
|
5124 | if datatype == "Spectra": | |
5123 | output_path = str(self.specOutputPath.text()) |
|
5125 | output_path = str(self.specOutputPath.text()) | |
5124 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5126 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5125 | profilesperblock = 0 |
|
5127 | profilesperblock = 0 | |
5126 |
|
5128 | |||
5127 | if datatype == "SpectraHeis": |
|
5129 | if datatype == "SpectraHeis": | |
5128 | output_path = str(self.specHeisOutputPath.text()) |
|
5130 | output_path = str(self.specHeisOutputPath.text()) | |
5129 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5131 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5130 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5132 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5131 |
|
5133 | |||
5132 | if output_path == '': |
|
5134 | if output_path == '': | |
5133 | outputstr = 'Outputpath is empty' |
|
5135 | outputstr = 'Outputpath is empty' | |
5134 | self.console.append(outputstr) |
|
5136 | self.console.append(outputstr) | |
5135 | parms_ok = False |
|
5137 | parms_ok = False | |
5136 |
|
5138 | |||
5137 | if not os.path.isdir(output_path): |
|
5139 | if not os.path.isdir(output_path): | |
5138 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5140 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5139 | self.console.append(outputstr) |
|
5141 | self.console.append(outputstr) | |
5140 | parms_ok = False |
|
5142 | parms_ok = False | |
5141 |
|
5143 | |||
5142 | try: |
|
5144 | try: | |
5143 | profilesperblock = int(profilesperblock) |
|
5145 | profilesperblock = int(profilesperblock) | |
5144 | except: |
|
5146 | except: | |
5145 | if datatype == "Voltage": |
|
5147 | if datatype == "Voltage": | |
5146 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5148 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5147 | self.console.append(outputstr) |
|
5149 | self.console.append(outputstr) | |
5148 | parms_ok = False |
|
5150 | parms_ok = False | |
5149 | profilesperblock = None |
|
5151 | profilesperblock = None | |
5150 |
|
5152 | |||
5151 | try: |
|
5153 | try: | |
5152 | blocksperfile = int(blocksperfile) |
|
5154 | blocksperfile = int(blocksperfile) | |
5153 | except: |
|
5155 | except: | |
5154 | if datatype == "Voltage": |
|
5156 | if datatype == "Voltage": | |
5155 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5157 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5156 | elif datatype == "Spectra": |
|
5158 | elif datatype == "Spectra": | |
5157 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5159 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5158 | elif datatype == "SpectraHeis": |
|
5160 | elif datatype == "SpectraHeis": | |
5159 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5161 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5160 |
|
5162 | |||
5161 | self.console.append(outputstr) |
|
5163 | self.console.append(outputstr) | |
5162 | parms_ok = False |
|
5164 | parms_ok = False | |
5163 | blocksperfile = None |
|
5165 | blocksperfile = None | |
5164 |
|
5166 | |||
5165 | if datatype == "SpectraHeis": |
|
5167 | if datatype == "SpectraHeis": | |
5166 | if metadata_file != '': |
|
5168 | if metadata_file != '': | |
5167 | if not os.path.isfile(metadata_file): |
|
5169 | if not os.path.isfile(metadata_file): | |
5168 | outputstr = 'Metadata file %s does not exist' % metadata_file |
|
5170 | outputstr = 'Metadata file %s does not exist' % metadata_file | |
5169 | self.console.append(outputstr) |
|
5171 | self.console.append(outputstr) | |
5170 | parms_ok = False |
|
5172 | parms_ok = False | |
5171 |
|
5173 | |||
5172 | if datatype == "Voltage": |
|
5174 | if datatype == "Voltage": | |
5173 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5175 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5174 |
|
5176 | |||
5175 |
|
5177 | |||
5176 | if datatype == "Spectra": |
|
5178 | if datatype == "Spectra": | |
5177 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5179 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5178 |
|
5180 | |||
5179 |
|
5181 | |||
5180 | if datatype == "SpectraHeis": |
|
5182 | if datatype == "SpectraHeis": | |
5181 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5183 | return parms_ok, output_path, blocksperfile, metadata_file | |
5182 |
|
5184 | |||
5183 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5185 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5184 |
|
5186 | |||
5185 | dateList = [] |
|
5187 | dateList = [] | |
5186 | fileList = [] |
|
5188 | fileList = [] | |
5187 |
|
5189 | |||
5188 | if ext == ".r": |
|
5190 | if ext == ".r": | |
5189 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5191 | from schainpy.model.io.jroIO_base import JRODataReader | |
5190 |
|
5192 | |||
5191 | readerObj = JRODataReader() |
|
5193 | readerObj = JRODataReader() | |
5192 | dateList = readerObj.findDatafiles(path=data_path, |
|
5194 | dateList = readerObj.findDatafiles(path=data_path, | |
5193 | expLabel=expLabel, |
|
5195 | expLabel=expLabel, | |
5194 | ext=ext, |
|
5196 | ext=ext, | |
5195 | walk=walk) |
|
5197 | walk=walk) | |
5196 |
|
5198 | |||
5197 | if ext == ".pdata": |
|
5199 | if ext == ".pdata": | |
5198 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5200 | from schainpy.model.io.jroIO_base import JRODataReader | |
5199 |
|
5201 | |||
5200 | readerObj = JRODataReader() |
|
5202 | readerObj = JRODataReader() | |
5201 | dateList = readerObj.findDatafiles(path=data_path, |
|
5203 | dateList = readerObj.findDatafiles(path=data_path, | |
5202 | expLabel=expLabel, |
|
5204 | expLabel=expLabel, | |
5203 | ext=ext, |
|
5205 | ext=ext, | |
5204 | walk=walk) |
|
5206 | walk=walk) | |
5205 |
|
5207 | |||
5206 | if ext == ".fits": |
|
5208 | if ext == ".fits": | |
5207 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5209 | from schainpy.model.io.jroIO_base import JRODataReader | |
5208 |
|
5210 | |||
5209 | readerObj = JRODataReader() |
|
5211 | readerObj = JRODataReader() | |
5210 | dateList = readerObj.findDatafiles(path=data_path, |
|
5212 | dateList = readerObj.findDatafiles(path=data_path, | |
5211 | expLabel=expLabel, |
|
5213 | expLabel=expLabel, | |
5212 | ext=ext, |
|
5214 | ext=ext, | |
5213 | walk=walk) |
|
5215 | walk=walk) | |
5214 |
|
5216 | |||
5215 | if ext == ".hdf5": |
|
5217 | if ext == ".hdf5": | |
5216 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5218 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5217 |
|
5219 | |||
5218 | readerObj = USRPReader() |
|
5220 | readerObj = USRPReader() | |
5219 | dateList = readerObj.findDatafiles(path=data_path) |
|
5221 | dateList = readerObj.findDatafiles(path=data_path) | |
5220 |
|
5222 | |||
5221 | return dateList |
|
5223 | return dateList | |
5222 |
|
5224 | |||
5223 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5225 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5224 | """ |
|
5226 | """ | |
5225 | Method to loads day |
|
5227 | Method to loads day | |
5226 | """ |
|
5228 | """ | |
5227 | # self._disable_save_button() |
|
5229 | # self._disable_save_button() | |
5228 | # self._disable_play_button() |
|
5230 | # self._disable_play_button() | |
5229 | # self.proOk.setEnabled(False) |
|
5231 | # self.proOk.setEnabled(False) | |
5230 |
|
5232 | |||
5231 | self.proComStartDate.clear() |
|
5233 | self.proComStartDate.clear() | |
5232 | self.proComEndDate.clear() |
|
5234 | self.proComEndDate.clear() | |
5233 |
|
5235 | |||
5234 | self.dateList = [] |
|
5236 | self.dateList = [] | |
5235 |
|
5237 | |||
5236 | if not data_path: |
|
5238 | if not data_path: | |
5237 | return [] |
|
5239 | return [] | |
5238 |
|
5240 | |||
5239 | if not os.path.isdir(data_path): |
|
5241 | if not os.path.isdir(data_path): | |
5240 | return [] |
|
5242 | return [] | |
5241 |
|
5243 | |||
5242 | self.dataPath = data_path |
|
5244 | self.dataPath = data_path | |
5243 |
|
5245 | |||
5244 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5246 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5245 |
|
5247 | |||
5246 | if not dateList: |
|
5248 | if not dateList: | |
5247 | # self.console.clear() |
|
5249 | # self.console.clear() | |
5248 | if walk: |
|
5250 | if walk: | |
5249 | if expLabel: |
|
5251 | if expLabel: | |
5250 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5252 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5251 | else: |
|
5253 | else: | |
5252 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5254 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5253 | else: |
|
5255 | else: | |
5254 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5256 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5255 |
|
5257 | |||
5256 | self.console.append(outputstr) |
|
5258 | self.console.append(outputstr) | |
5257 | return [] |
|
5259 | return [] | |
5258 |
|
5260 | |||
5259 | dateStrList = [] |
|
5261 | dateStrList = [] | |
5260 | for thisDate in dateList: |
|
5262 | for thisDate in dateList: | |
5261 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5263 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5262 |
|
5264 | |||
5263 | self.proComStartDate.addItem(dateStr) |
|
5265 | self.proComStartDate.addItem(dateStr) | |
5264 | self.proComEndDate.addItem(dateStr) |
|
5266 | self.proComEndDate.addItem(dateStr) | |
5265 | dateStrList.append(dateStr) |
|
5267 | dateStrList.append(dateStr) | |
5266 |
|
5268 | |||
5267 | self.proComStartDate.setCurrentIndex(0) |
|
5269 | self.proComStartDate.setCurrentIndex(0) | |
5268 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5270 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5269 |
|
5271 | |||
5270 | self.dateList = dateStrList |
|
5272 | self.dateList = dateStrList | |
5271 |
|
5273 | |||
5272 | self.console.clear() |
|
5274 | self.console.clear() | |
5273 | self.console.append("Successful load") |
|
5275 | self.console.append("Successful load") | |
5274 |
|
5276 | |||
5275 | # self.proOk.setEnabled(True) |
|
5277 | # self.proOk.setEnabled(True) | |
5276 | # self._enable_play_button() |
|
5278 | # self._enable_play_button() | |
5277 | # self._enable_save_button() |
|
5279 | # self._enable_save_button() | |
5278 |
|
5280 | |||
5279 | return self.dateList |
|
5281 | return self.dateList | |
5280 |
|
5282 | |||
5281 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5283 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5282 |
|
5284 | |||
5283 | if pathWorkSpace == None: |
|
5285 | if pathWorkSpace == None: | |
5284 | home = os.path.expanduser("~") |
|
5286 | home = os.path.expanduser("~") | |
5285 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5287 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5286 |
|
5288 | |||
5287 | self.pathWorkSpace = pathWorkSpace |
|
5289 | self.pathWorkSpace = pathWorkSpace | |
5288 |
|
5290 | |||
5289 | """ |
|
5291 | """ | |
5290 | Comandos Usados en Console |
|
5292 | Comandos Usados en Console | |
5291 | """ |
|
5293 | """ | |
5292 | def __del__(self): |
|
5294 | def __del__(self): | |
5293 | sys.stdout = sys.__stdout__ |
|
5295 | sys.stdout = sys.__stdout__ | |
5294 | sys.stderr = sys.__stderr__ |
|
5296 | sys.stderr = sys.__stderr__ | |
5295 |
|
5297 | |||
5296 | def normalOutputWritten(self, text): |
|
5298 | def normalOutputWritten(self, text): | |
5297 | color_black = QtGui.QColor(0,0,0) |
|
5299 | color_black = QtGui.QColor(0,0,0) | |
5298 | self.console.setTextColor(color_black) |
|
5300 | self.console.setTextColor(color_black) | |
5299 | self.console.append(text) |
|
5301 | self.console.append(text) | |
5300 |
|
5302 | |||
5301 | def errorOutputWritten(self, text): |
|
5303 | def errorOutputWritten(self, text): | |
5302 | color_red = QtGui.QColor(255,0,0) |
|
5304 | color_red = QtGui.QColor(255,0,0) | |
5303 | color_black = QtGui.QColor(0,0,0) |
|
5305 | color_black = QtGui.QColor(0,0,0) | |
5304 |
|
5306 | |||
5305 | self.console.setTextColor(color_red) |
|
5307 | self.console.setTextColor(color_red) | |
5306 | self.console.append(text) |
|
5308 | self.console.append(text) | |
5307 | self.console.setTextColor(color_black) |
|
5309 | self.console.setTextColor(color_black) | |
5308 |
|
5310 | |||
5309 | def _enable_save_button(self): |
|
5311 | def _enable_save_button(self): | |
5310 |
|
5312 | |||
5311 | self.actionSaveToolbar.setEnabled(True) |
|
5313 | self.actionSaveToolbar.setEnabled(True) | |
5312 | self.actionSave.setEnabled(True) |
|
5314 | self.actionSave.setEnabled(True) | |
5313 |
|
5315 | |||
5314 | def _disable_save_button(self): |
|
5316 | def _disable_save_button(self): | |
5315 |
|
5317 | |||
5316 | self.actionSaveToolbar.setEnabled(False) |
|
5318 | self.actionSaveToolbar.setEnabled(False) | |
5317 | self.actionSave.setEnabled(False) |
|
5319 | self.actionSave.setEnabled(False) | |
5318 |
|
5320 | |||
5319 | def _enable_play_button(self): |
|
5321 | def _enable_play_button(self): | |
5320 |
|
5322 | |||
5321 | self.actionStart.setEnabled(True) |
|
5323 | self.actionStart.setEnabled(True) | |
5322 | self.actionStarToolbar.setEnabled(True) |
|
5324 | self.actionStarToolbar.setEnabled(True) | |
5323 |
|
5325 | |||
5324 | self.changeStartIcon(started=False) |
|
5326 | self.changeStartIcon(started=False) | |
5325 |
|
5327 | |||
5326 | def _disable_play_button(self): |
|
5328 | def _disable_play_button(self): | |
5327 |
|
5329 | |||
5328 | self.actionStart.setEnabled(False) |
|
5330 | self.actionStart.setEnabled(False) | |
5329 | self.actionStarToolbar.setEnabled(False) |
|
5331 | self.actionStarToolbar.setEnabled(False) | |
5330 |
|
5332 | |||
5331 | self.changeStartIcon(started=True) |
|
5333 | self.changeStartIcon(started=True) | |
5332 |
|
5334 | |||
5333 | def _enable_stop_button(self): |
|
5335 | def _enable_stop_button(self): | |
5334 |
|
5336 | |||
5335 | self.actionPause.setEnabled(True) |
|
5337 | self.actionPause.setEnabled(True) | |
5336 | self.actionStop.setEnabled(True) |
|
5338 | self.actionStop.setEnabled(True) | |
5337 |
|
5339 | |||
5338 | self.actionPauseToolbar.setEnabled(True) |
|
5340 | self.actionPauseToolbar.setEnabled(True) | |
5339 | self.actionStopToolbar.setEnabled(True) |
|
5341 | self.actionStopToolbar.setEnabled(True) | |
5340 |
|
5342 | |||
5341 | self.changePauseIcon(paused=False) |
|
5343 | self.changePauseIcon(paused=False) | |
5342 | self.changeStopIcon(started=True) |
|
5344 | self.changeStopIcon(started=True) | |
5343 |
|
5345 | |||
5344 | def _disable_stop_button(self): |
|
5346 | def _disable_stop_button(self): | |
5345 |
|
5347 | |||
5346 | self.actionPause.setEnabled(False) |
|
5348 | self.actionPause.setEnabled(False) | |
5347 | self.actionStop.setEnabled(False) |
|
5349 | self.actionStop.setEnabled(False) | |
5348 |
|
5350 | |||
5349 | self.actionPauseToolbar.setEnabled(False) |
|
5351 | self.actionPauseToolbar.setEnabled(False) | |
5350 | self.actionStopToolbar.setEnabled(False) |
|
5352 | self.actionStopToolbar.setEnabled(False) | |
5351 |
|
5353 | |||
5352 | self.changePauseIcon(paused=False) |
|
5354 | self.changePauseIcon(paused=False) | |
5353 | self.changeStopIcon(started=False) |
|
5355 | self.changeStopIcon(started=False) | |
5354 |
|
5356 | |||
5355 | def setGUIStatus(self): |
|
5357 | def setGUIStatus(self): | |
5356 |
|
5358 | |||
5357 | self.setWindowTitle("ROJ-Signal Chain") |
|
5359 | self.setWindowTitle("ROJ-Signal Chain") | |
5358 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5360 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5359 |
|
5361 | |||
5360 | self.tabWidgetProject.setEnabled(False) |
|
5362 | self.tabWidgetProject.setEnabled(False) | |
5361 | self.tabVoltage.setEnabled(False) |
|
5363 | self.tabVoltage.setEnabled(False) | |
5362 | self.tabSpectra.setEnabled(False) |
|
5364 | self.tabSpectra.setEnabled(False) | |
5363 | self.tabCorrelation.setEnabled(False) |
|
5365 | self.tabCorrelation.setEnabled(False) | |
5364 | self.frame_2.setEnabled(False) |
|
5366 | self.frame_2.setEnabled(False) | |
5365 |
|
5367 | |||
5366 | self.actionCreate.setShortcut('Ctrl+N') |
|
5368 | self.actionCreate.setShortcut('Ctrl+N') | |
5367 | self.actionOpen.setShortcut('Ctrl+O') |
|
5369 | self.actionOpen.setShortcut('Ctrl+O') | |
5368 | self.actionSave.setShortcut('Ctrl+S') |
|
5370 | self.actionSave.setShortcut('Ctrl+S') | |
5369 | self.actionClose.setShortcut('Ctrl+X') |
|
5371 | self.actionClose.setShortcut('Ctrl+X') | |
5370 |
|
5372 | |||
5371 | self.actionStart.setShortcut('Ctrl+1') |
|
5373 | self.actionStart.setShortcut('Ctrl+1') | |
5372 | self.actionPause.setShortcut('Ctrl+2') |
|
5374 | self.actionPause.setShortcut('Ctrl+2') | |
5373 | self.actionStop.setShortcut('Ctrl+3') |
|
5375 | self.actionStop.setShortcut('Ctrl+3') | |
5374 |
|
5376 | |||
5375 | self.actionFTP.setShortcut('Ctrl+F') |
|
5377 | self.actionFTP.setShortcut('Ctrl+F') | |
5376 |
|
5378 | |||
5377 | self.actionStart.setEnabled(False) |
|
5379 | self.actionStart.setEnabled(False) | |
5378 | self.actionPause.setEnabled(False) |
|
5380 | self.actionPause.setEnabled(False) | |
5379 | self.actionStop.setEnabled(False) |
|
5381 | self.actionStop.setEnabled(False) | |
5380 |
|
5382 | |||
5381 | self.actionStarToolbar.setEnabled(False) |
|
5383 | self.actionStarToolbar.setEnabled(False) | |
5382 | self.actionPauseToolbar.setEnabled(False) |
|
5384 | self.actionPauseToolbar.setEnabled(False) | |
5383 | self.actionStopToolbar.setEnabled(False) |
|
5385 | self.actionStopToolbar.setEnabled(False) | |
5384 |
|
5386 | |||
5385 | self.proName.clear() |
|
5387 | self.proName.clear() | |
5386 | self.proDataPath.setText('') |
|
5388 | self.proDataPath.setText('') | |
5387 | self.console.setReadOnly(True) |
|
5389 | self.console.setReadOnly(True) | |
5388 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5390 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5389 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5391 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5390 | self.proDataType.setEnabled(False) |
|
5392 | self.proDataType.setEnabled(False) | |
5391 | self.time = QtCore.QTime() |
|
5393 | self.time = QtCore.QTime() | |
5392 | self.hour = 0 |
|
5394 | self.hour = 0 | |
5393 | self.min = 0 |
|
5395 | self.min = 0 | |
5394 | self.sec = 0 |
|
5396 | self.sec = 0 | |
5395 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5397 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5396 | startTime = "00:00:00" |
|
5398 | startTime = "00:00:00" | |
5397 | endTime = "23:59:59" |
|
5399 | endTime = "23:59:59" | |
5398 | starlist = startTime.split(":") |
|
5400 | starlist = startTime.split(":") | |
5399 | endlist = endTime.split(":") |
|
5401 | endlist = endTime.split(":") | |
5400 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5402 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5401 | self.proStartTime.setTime(self.time) |
|
5403 | self.proStartTime.setTime(self.time) | |
5402 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5404 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5403 | self.proEndTime.setTime(self.time) |
|
5405 | self.proEndTime.setTime(self.time) | |
5404 | self.proOk.setEnabled(False) |
|
5406 | self.proOk.setEnabled(False) | |
5405 | # set model Project Explorer |
|
5407 | # set model Project Explorer | |
5406 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5408 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5407 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5409 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5408 | layout = QtGui.QVBoxLayout() |
|
5410 | layout = QtGui.QVBoxLayout() | |
5409 | layout.addWidget(self.projectExplorerTree) |
|
5411 | layout.addWidget(self.projectExplorerTree) | |
5410 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5412 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5411 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5413 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5412 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5414 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5413 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5415 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5414 | self.projectExplorerTree.expandAll() |
|
5416 | self.projectExplorerTree.expandAll() | |
5415 | # set model Project Properties |
|
5417 | # set model Project Properties | |
5416 |
|
5418 | |||
5417 | self.propertiesModel = TreeModel() |
|
5419 | self.propertiesModel = TreeModel() | |
5418 | self.propertiesModel.initProjectView() |
|
5420 | self.propertiesModel.initProjectView() | |
5419 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5421 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5420 | self.treeProjectProperties.expandAll() |
|
5422 | self.treeProjectProperties.expandAll() | |
5421 | self.treeProjectProperties.allColumnsShowFocus() |
|
5423 | self.treeProjectProperties.allColumnsShowFocus() | |
5422 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5424 | self.treeProjectProperties.resizeColumnToContents(1) | |
5423 |
|
5425 | |||
5424 | # set Project |
|
5426 | # set Project | |
5425 | self.proExpLabel.setEnabled(True) |
|
5427 | self.proExpLabel.setEnabled(True) | |
5426 | self.proDelay.setEnabled(False) |
|
5428 | self.proDelay.setEnabled(False) | |
5427 | self.proSet.setEnabled(True) |
|
5429 | self.proSet.setEnabled(True) | |
5428 | self.proDataType.setReadOnly(True) |
|
5430 | self.proDataType.setReadOnly(True) | |
5429 |
|
5431 | |||
5430 | # set Operation Voltage |
|
5432 | # set Operation Voltage | |
5431 | self.volOpComChannels.setEnabled(False) |
|
5433 | self.volOpComChannels.setEnabled(False) | |
5432 | self.volOpComHeights.setEnabled(False) |
|
5434 | self.volOpComHeights.setEnabled(False) | |
5433 | self.volOpFilter.setEnabled(False) |
|
5435 | self.volOpFilter.setEnabled(False) | |
5434 | self.volOpComProfile.setEnabled(False) |
|
5436 | self.volOpComProfile.setEnabled(False) | |
5435 | self.volOpComCode.setEnabled(False) |
|
5437 | self.volOpComCode.setEnabled(False) | |
5436 | self.volOpFlip.setEnabled(False) |
|
5438 | self.volOpFlip.setEnabled(False) | |
5437 | self.volOpCohInt.setEnabled(False) |
|
5439 | self.volOpCohInt.setEnabled(False) | |
5438 | self.volOpRadarfrequency.setEnabled(False) |
|
5440 | self.volOpRadarfrequency.setEnabled(False) | |
5439 |
|
5441 | |||
5440 | self.volOpChannel.setEnabled(False) |
|
5442 | self.volOpChannel.setEnabled(False) | |
5441 | self.volOpHeights.setEnabled(False) |
|
5443 | self.volOpHeights.setEnabled(False) | |
5442 | self.volOpProfile.setEnabled(False) |
|
5444 | self.volOpProfile.setEnabled(False) | |
5443 | self.volOpComMode.setEnabled(False) |
|
5445 | self.volOpComMode.setEnabled(False) | |
5444 |
|
5446 | |||
5445 | self.volGraphPath.setEnabled(False) |
|
5447 | self.volGraphPath.setEnabled(False) | |
5446 | self.volGraphPrefix.setEnabled(False) |
|
5448 | self.volGraphPrefix.setEnabled(False) | |
5447 | self.volGraphToolPath.setEnabled(False) |
|
5449 | self.volGraphToolPath.setEnabled(False) | |
5448 |
|
5450 | |||
5449 | # set Graph Voltage |
|
5451 | # set Graph Voltage | |
5450 | self.volGraphChannelList.setEnabled(False) |
|
5452 | self.volGraphChannelList.setEnabled(False) | |
5451 | self.volGraphfreqrange.setEnabled(False) |
|
5453 | self.volGraphfreqrange.setEnabled(False) | |
5452 | self.volGraphHeightrange.setEnabled(False) |
|
5454 | self.volGraphHeightrange.setEnabled(False) | |
5453 |
|
5455 | |||
5454 | # set Operation Spectra |
|
5456 | # set Operation Spectra | |
5455 | self.specOpnFFTpoints.setEnabled(False) |
|
5457 | self.specOpnFFTpoints.setEnabled(False) | |
5456 | self.specOpProfiles.setEnabled(False) |
|
5458 | self.specOpProfiles.setEnabled(False) | |
5457 | self.specOpippFactor.setEnabled(False) |
|
5459 | self.specOpippFactor.setEnabled(False) | |
5458 | self.specOppairsList.setEnabled(False) |
|
5460 | self.specOppairsList.setEnabled(False) | |
5459 | self.specOpComChannel.setEnabled(False) |
|
5461 | self.specOpComChannel.setEnabled(False) | |
5460 | self.specOpComHeights.setEnabled(False) |
|
5462 | self.specOpComHeights.setEnabled(False) | |
5461 | self.specOpIncoherent.setEnabled(False) |
|
5463 | self.specOpIncoherent.setEnabled(False) | |
5462 | self.specOpgetNoise.setEnabled(False) |
|
5464 | self.specOpgetNoise.setEnabled(False) | |
5463 | self.specOpRadarfrequency.setEnabled(False) |
|
5465 | self.specOpRadarfrequency.setEnabled(False) | |
5464 |
|
5466 | |||
5465 |
|
5467 | |||
5466 | self.specOpChannel.setEnabled(False) |
|
5468 | self.specOpChannel.setEnabled(False) | |
5467 | self.specOpHeights.setEnabled(False) |
|
5469 | self.specOpHeights.setEnabled(False) | |
5468 | # set Graph Spectra |
|
5470 | # set Graph Spectra | |
5469 | self.specGgraphChannelList.setEnabled(False) |
|
5471 | self.specGgraphChannelList.setEnabled(False) | |
5470 | self.specGgraphFreq.setEnabled(False) |
|
5472 | self.specGgraphFreq.setEnabled(False) | |
5471 | self.specGgraphHeight.setEnabled(False) |
|
5473 | self.specGgraphHeight.setEnabled(False) | |
5472 | self.specGgraphDbsrange.setEnabled(False) |
|
5474 | self.specGgraphDbsrange.setEnabled(False) | |
5473 | self.specGgraphmagnitud.setEnabled(False) |
|
5475 | self.specGgraphmagnitud.setEnabled(False) | |
5474 | self.specGgraphTminTmax.setEnabled(False) |
|
5476 | self.specGgraphTminTmax.setEnabled(False) | |
5475 | self.specGgraphTimeRange.setEnabled(False) |
|
5477 | self.specGgraphTimeRange.setEnabled(False) | |
5476 | self.specGraphPath.setEnabled(False) |
|
5478 | self.specGraphPath.setEnabled(False) | |
5477 | self.specGraphToolPath.setEnabled(False) |
|
5479 | self.specGraphToolPath.setEnabled(False) | |
5478 | self.specGraphPrefix.setEnabled(False) |
|
5480 | self.specGraphPrefix.setEnabled(False) | |
5479 |
|
5481 | |||
5480 | self.specGgraphftpratio.setEnabled(False) |
|
5482 | self.specGgraphftpratio.setEnabled(False) | |
5481 | # set Operation SpectraHeis |
|
5483 | # set Operation SpectraHeis | |
5482 | self.specHeisOpIncoherent.setEnabled(False) |
|
5484 | self.specHeisOpIncoherent.setEnabled(False) | |
5483 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5485 | self.specHeisOpCobIncInt.setEnabled(False) | |
5484 | # set Graph SpectraHeis |
|
5486 | # set Graph SpectraHeis | |
5485 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5487 | self.specHeisGgraphChannelList.setEnabled(False) | |
5486 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5488 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5487 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5489 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5488 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5490 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5489 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5491 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5490 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5492 | self.specHeisGgraphftpratio.setEnabled(False) | |
5491 | self.specHeisGraphPath.setEnabled(False) |
|
5493 | self.specHeisGraphPath.setEnabled(False) | |
5492 | self.specHeisGraphPrefix.setEnabled(False) |
|
5494 | self.specHeisGraphPrefix.setEnabled(False) | |
5493 | self.specHeisGraphToolPath.setEnabled(False) |
|
5495 | self.specHeisGraphToolPath.setEnabled(False) | |
5494 |
|
5496 | |||
5495 |
|
5497 | |||
5496 | # tool tip gui |
|
5498 | # tool tip gui | |
5497 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5499 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5498 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5500 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5499 | # tool tip gui project |
|
5501 | # tool tip gui project | |
5500 | 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>') |
|
5502 | 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>') | |
5501 | self.proComWalk.setCurrentIndex(0) |
|
5503 | self.proComWalk.setCurrentIndex(0) | |
5502 | # tool tip gui volOp |
|
5504 | # tool tip gui volOp | |
5503 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5505 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5504 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5506 | self.volOpHeights.setToolTip('Example: 90,180') | |
5505 | self.volOpFilter.setToolTip('Example: 2') |
|
5507 | self.volOpFilter.setToolTip('Example: 2') | |
5506 | self.volOpProfile.setToolTip('Example:0,127') |
|
5508 | self.volOpProfile.setToolTip('Example:0,127') | |
5507 | self.volOpCohInt.setToolTip('Example: 128') |
|
5509 | self.volOpCohInt.setToolTip('Example: 128') | |
5508 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5510 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5509 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5511 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5510 | # tool tip gui volGraph |
|
5512 | # tool tip gui volGraph | |
5511 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5513 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5512 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5514 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5513 | # tool tip gui specOp |
|
5515 | # tool tip gui specOp | |
5514 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5516 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5515 | self.specOpProfiles.setToolTip('Example: 128') |
|
5517 | self.specOpProfiles.setToolTip('Example: 128') | |
5516 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5518 | self.specOpippFactor.setToolTip('Example:1.0') | |
5517 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5519 | self.specOpIncoherent.setToolTip('Example: 10') | |
5518 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5520 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5519 |
|
5521 | |||
5520 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5522 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5521 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5523 | self.specOpHeights.setToolTip('Example: 90,180') | |
5522 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5524 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5523 | # tool tip gui specGraph |
|
5525 | # tool tip gui specGraph | |
5524 |
|
5526 | |||
5525 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5527 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5526 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5528 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5527 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5529 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5528 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5530 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5529 |
|
5531 | |||
5530 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5532 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5531 |
|
5533 | |||
5532 |
|
5534 | |||
5533 | self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5535 | self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5534 |
|
5536 | |||
5535 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5537 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5536 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5538 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5537 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5539 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5538 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5540 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5539 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5541 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5540 |
|
5542 | |||
5541 | self.labelSet.show() |
|
5543 | self.labelSet.show() | |
5542 | self.proSet.show() |
|
5544 | self.proSet.show() | |
5543 |
|
5545 | |||
5544 | self.labelIPPKm.hide() |
|
5546 | self.labelIPPKm.hide() | |
5545 | self.proIPPKm.hide() |
|
5547 | self.proIPPKm.hide() | |
5546 |
|
5548 | |||
5547 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5549 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5548 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5550 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5549 |
|
5551 | |||
5550 |
|
5552 | |||
5551 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5553 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5552 | """ |
|
5554 | """ | |
5553 | Class documentation goes here. |
|
5555 | Class documentation goes here. | |
5554 | """ |
|
5556 | """ | |
5555 | closed = pyqtSignal() |
|
5557 | closed = pyqtSignal() | |
5556 | create = False |
|
5558 | create = False | |
5557 |
|
5559 | |||
5558 | def __init__(self, parent=None): |
|
5560 | def __init__(self, parent=None): | |
5559 | """ |
|
5561 | """ | |
5560 | Constructor |
|
5562 | Constructor | |
5561 | """ |
|
5563 | """ | |
5562 | QMainWindow.__init__(self, parent) |
|
5564 | QMainWindow.__init__(self, parent) | |
5563 | self.setupUi(self) |
|
5565 | self.setupUi(self) | |
5564 | self.getFromWindow = None |
|
5566 | self.getFromWindow = None | |
5565 | self.getfromWindowList = [] |
|
5567 | self.getfromWindowList = [] | |
5566 | self.dataTypeProject = None |
|
5568 | self.dataTypeProject = None | |
5567 |
|
5569 | |||
5568 | self.listUP = None |
|
5570 | self.listUP = None | |
5569 |
|
5571 | |||
5570 | @pyqtSignature("") |
|
5572 | @pyqtSignature("") | |
5571 | def on_unitPokbut_clicked(self): |
|
5573 | def on_unitPokbut_clicked(self): | |
5572 | """ |
|
5574 | """ | |
5573 | Slot documentation goes here. |
|
5575 | Slot documentation goes here. | |
5574 | """ |
|
5576 | """ | |
5575 | self.create = True |
|
5577 | self.create = True | |
5576 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5578 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5577 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5579 | # self.nameofUP= str(self.nameUptxt.text()) | |
5578 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5580 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5579 | self.close() |
|
5581 | self.close() | |
5580 |
|
5582 | |||
5581 |
|
5583 | |||
5582 | @pyqtSignature("") |
|
5584 | @pyqtSignature("") | |
5583 | def on_unitPcancelbut_clicked(self): |
|
5585 | def on_unitPcancelbut_clicked(self): | |
5584 | """ |
|
5586 | """ | |
5585 | Slot documentation goes here. |
|
5587 | Slot documentation goes here. | |
5586 | """ |
|
5588 | """ | |
5587 | self.create = False |
|
5589 | self.create = False | |
5588 | self.close() |
|
5590 | self.close() | |
5589 |
|
5591 | |||
5590 | def loadTotalList(self): |
|
5592 | def loadTotalList(self): | |
5591 | self.comboInputBox.clear() |
|
5593 | self.comboInputBox.clear() | |
5592 | for i in self.getfromWindowList: |
|
5594 | for i in self.getfromWindowList: | |
5593 |
|
5595 | |||
5594 | name = i.getElementName() |
|
5596 | name = i.getElementName() | |
5595 | if name == 'Project': |
|
5597 | if name == 'Project': | |
5596 | id = i.id |
|
5598 | id = i.id | |
5597 | name = i.name |
|
5599 | name = i.name | |
5598 | if self.dataTypeProject == 'Voltage': |
|
5600 | if self.dataTypeProject == 'Voltage': | |
5599 | self.comboTypeBox.clear() |
|
5601 | self.comboTypeBox.clear() | |
5600 | self.comboTypeBox.addItem("Voltage") |
|
5602 | self.comboTypeBox.addItem("Voltage") | |
5601 |
|
5603 | |||
5602 | if self.dataTypeProject == 'Spectra': |
|
5604 | if self.dataTypeProject == 'Spectra': | |
5603 | self.comboTypeBox.clear() |
|
5605 | self.comboTypeBox.clear() | |
5604 | self.comboTypeBox.addItem("Spectra") |
|
5606 | self.comboTypeBox.addItem("Spectra") | |
5605 | self.comboTypeBox.addItem("Correlation") |
|
5607 | self.comboTypeBox.addItem("Correlation") | |
5606 | if self.dataTypeProject == 'Fits': |
|
5608 | if self.dataTypeProject == 'Fits': | |
5607 | self.comboTypeBox.clear() |
|
5609 | self.comboTypeBox.clear() | |
5608 | self.comboTypeBox.addItem("SpectraHeis") |
|
5610 | self.comboTypeBox.addItem("SpectraHeis") | |
5609 |
|
5611 | |||
5610 |
|
5612 | |||
5611 | if name == 'ProcUnit': |
|
5613 | if name == 'ProcUnit': | |
5612 | id = int(i.id) - 1 |
|
5614 | id = int(i.id) - 1 | |
5613 | name = i.datatype |
|
5615 | name = i.datatype | |
5614 | if name == 'Voltage': |
|
5616 | if name == 'Voltage': | |
5615 | self.comboTypeBox.clear() |
|
5617 | self.comboTypeBox.clear() | |
5616 | self.comboTypeBox.addItem("Spectra") |
|
5618 | self.comboTypeBox.addItem("Spectra") | |
5617 | self.comboTypeBox.addItem("SpectraHeis") |
|
5619 | self.comboTypeBox.addItem("SpectraHeis") | |
5618 | self.comboTypeBox.addItem("Correlation") |
|
5620 | self.comboTypeBox.addItem("Correlation") | |
5619 | if name == 'Spectra': |
|
5621 | if name == 'Spectra': | |
5620 | self.comboTypeBox.clear() |
|
5622 | self.comboTypeBox.clear() | |
5621 | self.comboTypeBox.addItem("Spectra") |
|
5623 | self.comboTypeBox.addItem("Spectra") | |
5622 | self.comboTypeBox.addItem("SpectraHeis") |
|
5624 | self.comboTypeBox.addItem("SpectraHeis") | |
5623 | self.comboTypeBox.addItem("Correlation") |
|
5625 | self.comboTypeBox.addItem("Correlation") | |
5624 | if name == 'SpectraHeis': |
|
5626 | if name == 'SpectraHeis': | |
5625 | self.comboTypeBox.clear() |
|
5627 | self.comboTypeBox.clear() | |
5626 | self.comboTypeBox.addItem("SpectraHeis") |
|
5628 | self.comboTypeBox.addItem("SpectraHeis") | |
5627 |
|
5629 | |||
5628 | self.comboInputBox.addItem(str(name)) |
|
5630 | self.comboInputBox.addItem(str(name)) | |
5629 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5631 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5630 |
|
5632 | |||
5631 | def closeEvent(self, event): |
|
5633 | def closeEvent(self, event): | |
5632 | self.closed.emit() |
|
5634 | self.closed.emit() | |
5633 | event.accept() |
|
5635 | event.accept() | |
5634 |
|
5636 | |||
5635 | class Ftp(QMainWindow, Ui_Ftp): |
|
5637 | class Ftp(QMainWindow, Ui_Ftp): | |
5636 | """ |
|
5638 | """ | |
5637 | Class documentation goes here. |
|
5639 | Class documentation goes here. | |
5638 | """ |
|
5640 | """ | |
5639 | create = False |
|
5641 | create = False | |
5640 | closed = pyqtSignal() |
|
5642 | closed = pyqtSignal() | |
5641 | server = None |
|
5643 | server = None | |
5642 | remotefolder = None |
|
5644 | remotefolder = None | |
5643 | username = None |
|
5645 | username = None | |
5644 | password = None |
|
5646 | password = None | |
5645 | ftp_wei = None |
|
5647 | ftp_wei = None | |
5646 | exp_code = None |
|
5648 | exp_code = None | |
5647 | sub_exp_code = None |
|
5649 | sub_exp_code = None | |
5648 | plot_pos = None |
|
5650 | plot_pos = None | |
5649 |
|
5651 | |||
5650 | def __init__(self, parent=None): |
|
5652 | def __init__(self, parent=None): | |
5651 | """ |
|
5653 | """ | |
5652 | Constructor |
|
5654 | Constructor | |
5653 | """ |
|
5655 | """ | |
5654 | QMainWindow.__init__(self, parent) |
|
5656 | QMainWindow.__init__(self, parent) | |
5655 | self.setupUi(self) |
|
5657 | self.setupUi(self) | |
5656 | self.setGUIStatus() |
|
5658 | self.setGUIStatus() | |
5657 |
|
5659 | |||
5658 | def setGUIStatus(self): |
|
5660 | def setGUIStatus(self): | |
5659 | self.setWindowTitle("ROJ-Signal Chain") |
|
5661 | self.setWindowTitle("ROJ-Signal Chain") | |
5660 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5662 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5661 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5663 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5662 | self.usernameFTP.setToolTip('Example: myusername') |
|
5664 | self.usernameFTP.setToolTip('Example: myusername') | |
5663 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5665 | self.passwordFTP.setToolTip('Example: mypass ') | |
5664 | self.weightFTP.setToolTip('Example: 0') |
|
5666 | self.weightFTP.setToolTip('Example: 0') | |
5665 | self.expcodeFTP.setToolTip('Example: 0') |
|
5667 | self.expcodeFTP.setToolTip('Example: 0') | |
5666 | self.subexpFTP.setToolTip('Example: 0') |
|
5668 | self.subexpFTP.setToolTip('Example: 0') | |
5667 | self.plotposFTP.setToolTip('Example: 0') |
|
5669 | self.plotposFTP.setToolTip('Example: 0') | |
5668 |
|
5670 | |||
5669 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5671 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5670 | self.serverFTP.setText(str(server)) |
|
5672 | self.serverFTP.setText(str(server)) | |
5671 | self.folderFTP.setText(str(remotefolder)) |
|
5673 | self.folderFTP.setText(str(remotefolder)) | |
5672 | self.usernameFTP.setText(str(username)) |
|
5674 | self.usernameFTP.setText(str(username)) | |
5673 | self.passwordFTP.setText(str(password)) |
|
5675 | self.passwordFTP.setText(str(password)) | |
5674 | self.weightFTP.setText(str(ftp_wei)) |
|
5676 | self.weightFTP.setText(str(ftp_wei)) | |
5675 | self.expcodeFTP.setText(str(exp_code)) |
|
5677 | self.expcodeFTP.setText(str(exp_code)) | |
5676 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5678 | self.subexpFTP.setText(str(sub_exp_code)) | |
5677 | self.plotposFTP.setText(str(plot_pos)) |
|
5679 | self.plotposFTP.setText(str(plot_pos)) | |
5678 |
|
5680 | |||
5679 | def getParmsFromFtpWindow(self): |
|
5681 | def getParmsFromFtpWindow(self): | |
5680 | """ |
|
5682 | """ | |
5681 | Return Inputs Project: |
|
5683 | Return Inputs Project: | |
5682 | - server |
|
5684 | - server | |
5683 | - remotefolder |
|
5685 | - remotefolder | |
5684 | - username |
|
5686 | - username | |
5685 | - password |
|
5687 | - password | |
5686 | - ftp_wei |
|
5688 | - ftp_wei | |
5687 | - exp_code |
|
5689 | - exp_code | |
5688 | - sub_exp_code |
|
5690 | - sub_exp_code | |
5689 | - plot_pos |
|
5691 | - plot_pos | |
5690 | """ |
|
5692 | """ | |
5691 | name_server_ftp = str(self.serverFTP.text()) |
|
5693 | name_server_ftp = str(self.serverFTP.text()) | |
5692 | if not name_server_ftp: |
|
5694 | if not name_server_ftp: | |
5693 | self.console.clear() |
|
5695 | self.console.clear() | |
5694 | self.console.append("Please Write a FTP Server") |
|
5696 | self.console.append("Please Write a FTP Server") | |
5695 | return 0 |
|
5697 | return 0 | |
5696 |
|
5698 | |||
5697 | folder_server_ftp = str(self.folderFTP.text()) |
|
5699 | folder_server_ftp = str(self.folderFTP.text()) | |
5698 | if not folder_server_ftp: |
|
5700 | if not folder_server_ftp: | |
5699 | self.console.clear() |
|
5701 | self.console.clear() | |
5700 | self.console.append("Please Write a Folder") |
|
5702 | self.console.append("Please Write a Folder") | |
5701 | return 0 |
|
5703 | return 0 | |
5702 |
|
5704 | |||
5703 | username_ftp = str(self.usernameFTP.text()) |
|
5705 | username_ftp = str(self.usernameFTP.text()) | |
5704 | if not username_ftp: |
|
5706 | if not username_ftp: | |
5705 | self.console.clear() |
|
5707 | self.console.clear() | |
5706 | self.console.append("Please Write a User Name") |
|
5708 | self.console.append("Please Write a User Name") | |
5707 | return 0 |
|
5709 | return 0 | |
5708 |
|
5710 | |||
5709 | password_ftp = str(self.passwordFTP.text()) |
|
5711 | password_ftp = str(self.passwordFTP.text()) | |
5710 | if not password_ftp: |
|
5712 | if not password_ftp: | |
5711 | self.console.clear() |
|
5713 | self.console.clear() | |
5712 | self.console.append("Please Write a passwordFTP") |
|
5714 | self.console.append("Please Write a passwordFTP") | |
5713 | return 0 |
|
5715 | return 0 | |
5714 |
|
5716 | |||
5715 | ftp_wei = str(self.weightFTP.text()) |
|
5717 | ftp_wei = str(self.weightFTP.text()) | |
5716 | if not ftp_wei == "": |
|
5718 | if not ftp_wei == "": | |
5717 | try: |
|
5719 | try: | |
5718 | ftp_wei = int(self.weightFTP.text()) |
|
5720 | ftp_wei = int(self.weightFTP.text()) | |
5719 | except: |
|
5721 | except: | |
5720 | self.console.clear() |
|
5722 | self.console.clear() | |
5721 | self.console.append("Please Write a ftp_wei number") |
|
5723 | self.console.append("Please Write a ftp_wei number") | |
5722 | return 0 |
|
5724 | return 0 | |
5723 |
|
5725 | |||
5724 | exp_code = str(self.expcodeFTP.text()) |
|
5726 | exp_code = str(self.expcodeFTP.text()) | |
5725 | if not exp_code == "": |
|
5727 | if not exp_code == "": | |
5726 | try: |
|
5728 | try: | |
5727 | exp_code = int(self.expcodeFTP.text()) |
|
5729 | exp_code = int(self.expcodeFTP.text()) | |
5728 | except: |
|
5730 | except: | |
5729 | self.console.clear() |
|
5731 | self.console.clear() | |
5730 | self.console.append("Please Write a exp_code number") |
|
5732 | self.console.append("Please Write a exp_code number") | |
5731 | return 0 |
|
5733 | return 0 | |
5732 |
|
5734 | |||
5733 |
|
5735 | |||
5734 | sub_exp_code = str(self.subexpFTP.text()) |
|
5736 | sub_exp_code = str(self.subexpFTP.text()) | |
5735 | if not sub_exp_code == "": |
|
5737 | if not sub_exp_code == "": | |
5736 | try: |
|
5738 | try: | |
5737 | sub_exp_code = int(self.subexpFTP.text()) |
|
5739 | sub_exp_code = int(self.subexpFTP.text()) | |
5738 | except: |
|
5740 | except: | |
5739 | self.console.clear() |
|
5741 | self.console.clear() | |
5740 | self.console.append("Please Write a sub_exp_code number") |
|
5742 | self.console.append("Please Write a sub_exp_code number") | |
5741 | return 0 |
|
5743 | return 0 | |
5742 |
|
5744 | |||
5743 | plot_pos = str(self.plotposFTP.text()) |
|
5745 | plot_pos = str(self.plotposFTP.text()) | |
5744 | if not plot_pos == "": |
|
5746 | if not plot_pos == "": | |
5745 | try: |
|
5747 | try: | |
5746 | plot_pos = int(self.plotposFTP.text()) |
|
5748 | plot_pos = int(self.plotposFTP.text()) | |
5747 | except: |
|
5749 | except: | |
5748 | self.console.clear() |
|
5750 | self.console.clear() | |
5749 | self.console.append("Please Write a plot_pos number") |
|
5751 | self.console.append("Please Write a plot_pos number") | |
5750 | return 0 |
|
5752 | return 0 | |
5751 |
|
5753 | |||
5752 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5754 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5753 |
|
5755 | |||
5754 | @pyqtSignature("") |
|
5756 | @pyqtSignature("") | |
5755 | def on_ftpOkButton_clicked(self): |
|
5757 | def on_ftpOkButton_clicked(self): | |
5756 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5758 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5757 | self.create = True |
|
5759 | self.create = True | |
5758 | self.close() |
|
5760 | self.close() | |
5759 |
|
5761 | |||
5760 | @pyqtSignature("") |
|
5762 | @pyqtSignature("") | |
5761 | def on_ftpCancelButton_clicked(self): |
|
5763 | def on_ftpCancelButton_clicked(self): | |
5762 | self.create = False |
|
5764 | self.create = False | |
5763 | self.close() |
|
5765 | self.close() | |
5764 |
|
5766 | |||
5765 | def closeEvent(self, event): |
|
5767 | def closeEvent(self, event): | |
5766 | self.closed.emit() |
|
5768 | self.closed.emit() | |
5767 | event.accept() |
|
5769 | event.accept() | |
5768 |
|
5770 | |||
5769 | class ftpBuffer(): |
|
5771 | class ftpBuffer(): | |
5770 |
|
5772 | |||
5771 | server = None |
|
5773 | server = None | |
5772 | remotefolder = None |
|
5774 | remotefolder = None | |
5773 | username = None |
|
5775 | username = None | |
5774 | password = None |
|
5776 | password = None | |
5775 | ftp_wei = None |
|
5777 | ftp_wei = None | |
5776 | exp_code = None |
|
5778 | exp_code = None | |
5777 | sub_exp_code = None |
|
5779 | sub_exp_code = None | |
5778 | plot_pos = None |
|
5780 | plot_pos = None | |
5779 | create = False |
|
5781 | create = False | |
5780 | withoutconfig = False |
|
5782 | withoutconfig = False | |
5781 | createforView = False |
|
5783 | createforView = False | |
5782 | localfolder = None |
|
5784 | localfolder = None | |
5783 | extension = None |
|
5785 | extension = None | |
5784 | period = None |
|
5786 | period = None | |
5785 | protocol = None |
|
5787 | protocol = None | |
5786 |
|
5788 | |||
5787 | def __init__(self): |
|
5789 | def __init__(self): | |
5788 |
|
5790 | |||
5789 | self.create = False |
|
5791 | self.create = False | |
5790 | self.server = None |
|
5792 | self.server = None | |
5791 | self.remotefolder = None |
|
5793 | self.remotefolder = None | |
5792 | self.username = None |
|
5794 | self.username = None | |
5793 | self.password = None |
|
5795 | self.password = None | |
5794 | self.ftp_wei = None |
|
5796 | self.ftp_wei = None | |
5795 | self.exp_code = None |
|
5797 | self.exp_code = None | |
5796 | self.sub_exp_code = None |
|
5798 | self.sub_exp_code = None | |
5797 | self.plot_pos = None |
|
5799 | self.plot_pos = None | |
5798 | # self.create = False |
|
5800 | # self.create = False | |
5799 | self.localfolder = None |
|
5801 | self.localfolder = None | |
5800 | self.extension = None |
|
5802 | self.extension = None | |
5801 | self.period = None |
|
5803 | self.period = None | |
5802 | self.protocol = None |
|
5804 | self.protocol = None | |
5803 |
|
5805 | |||
5804 | def setwithoutconfiguration(self): |
|
5806 | def setwithoutconfiguration(self): | |
5805 |
|
5807 | |||
5806 | self.create = False |
|
5808 | self.create = False | |
5807 | self.server = "jro-app.igp.gob.pe" |
|
5809 | self.server = "jro-app.igp.gob.pe" | |
5808 | self.remotefolder = "/home/wmaster/graficos" |
|
5810 | self.remotefolder = "/home/wmaster/graficos" | |
5809 | self.username = "wmaster" |
|
5811 | self.username = "wmaster" | |
5810 | self.password = "mst2010vhf" |
|
5812 | self.password = "mst2010vhf" | |
5811 | self.withoutconfig = True |
|
5813 | self.withoutconfig = True | |
5812 | self.localfolder = './' |
|
5814 | self.localfolder = './' | |
5813 | self.extension = '.png' |
|
5815 | self.extension = '.png' | |
5814 | self.period = 60 |
|
5816 | self.period = 60 | |
5815 | self.protocol = 'ftp' |
|
5817 | self.protocol = 'ftp' | |
5816 | self.createforView = True |
|
5818 | self.createforView = True | |
5817 |
|
5819 | |||
5818 | if not self.ftp_wei: |
|
5820 | if not self.ftp_wei: | |
5819 | self.ftp_wei = 0 |
|
5821 | self.ftp_wei = 0 | |
5820 |
|
5822 | |||
5821 | if not self.exp_code: |
|
5823 | if not self.exp_code: | |
5822 | self.exp_code = 0 |
|
5824 | self.exp_code = 0 | |
5823 |
|
5825 | |||
5824 | if not self.sub_exp_code: |
|
5826 | if not self.sub_exp_code: | |
5825 | self.sub_exp_code = 0 |
|
5827 | self.sub_exp_code = 0 | |
5826 |
|
5828 | |||
5827 | if not self.plot_pos: |
|
5829 | if not self.plot_pos: | |
5828 | self.plot_pos = 0 |
|
5830 | self.plot_pos = 0 | |
5829 |
|
5831 | |||
5830 | 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'): |
|
5832 | 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'): | |
5831 |
|
5833 | |||
5832 | self.server = server |
|
5834 | self.server = server | |
5833 | self.remotefolder = remotefolder |
|
5835 | self.remotefolder = remotefolder | |
5834 | self.username = username |
|
5836 | self.username = username | |
5835 | self.password = password |
|
5837 | self.password = password | |
5836 | self.ftp_wei = ftp_wei |
|
5838 | self.ftp_wei = ftp_wei | |
5837 | self.exp_code = exp_code |
|
5839 | self.exp_code = exp_code | |
5838 | self.sub_exp_code = sub_exp_code |
|
5840 | self.sub_exp_code = sub_exp_code | |
5839 | self.plot_pos = plot_pos |
|
5841 | self.plot_pos = plot_pos | |
5840 | self.create = True |
|
5842 | self.create = True | |
5841 | self.withoutconfig = False |
|
5843 | self.withoutconfig = False | |
5842 | self.createforView = True |
|
5844 | self.createforView = True | |
5843 | self.localfolder = localfolder |
|
5845 | self.localfolder = localfolder | |
5844 | self.extension = extension |
|
5846 | self.extension = extension | |
5845 | self.period = period |
|
5847 | self.period = period | |
5846 | self.protocol = protocol |
|
5848 | self.protocol = protocol | |
5847 |
|
5849 | |||
5848 | def recover(self): |
|
5850 | def recover(self): | |
5849 |
|
5851 | |||
5850 | 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 |
|
5852 | 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 | |
5851 |
|
5853 | |||
5852 | class ShowMeConsole(QtCore.QObject): |
|
5854 | class ShowMeConsole(QtCore.QObject): | |
5853 |
|
5855 | |||
5854 | textWritten = QtCore.pyqtSignal(str) |
|
5856 | textWritten = QtCore.pyqtSignal(str) | |
5855 |
|
5857 | |||
5856 | def write(self, text): |
|
5858 | def write(self, text): | |
5857 |
|
5859 | |||
5858 | if len(text) == 0: |
|
5860 | if len(text) == 0: | |
5859 | self.textWritten.emit("\n") |
|
5861 | self.textWritten.emit("\n") | |
5860 | return |
|
5862 | return | |
5861 |
|
5863 | |||
5862 | if text[-1] == "\n": |
|
5864 | if text[-1] == "\n": | |
5863 | text = text[:-1] |
|
5865 | text = text[:-1] | |
5864 |
|
5866 | |||
5865 | self.textWritten.emit(str(text)) |
|
5867 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now