@@ -1,1206 +1,1234 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on September , 2012 |
|
2 | Created on September , 2012 | |
3 | @author: |
|
3 | @author: | |
4 | ''' |
|
4 | ''' | |
5 |
|
5 | |||
6 | import sys |
|
6 | import sys | |
7 | import ast |
|
7 | import ast | |
|
8 | import datetime | |||
8 | import traceback |
|
9 | import traceback | |
9 | import schainpy |
|
10 | import schainpy | |
10 | import schainpy.admin |
|
11 | import schainpy.admin | |
11 |
|
12 | |||
12 | from xml.etree.ElementTree import ElementTree, Element, SubElement, tostring |
|
13 | from xml.etree.ElementTree import ElementTree, Element, SubElement, tostring | |
13 | from xml.dom import minidom |
|
14 | from xml.dom import minidom | |
14 |
|
15 | |||
15 | from schainpy.model import * |
|
16 | from schainpy.model import * | |
16 | from time import sleep |
|
17 | from time import sleep | |
17 |
|
18 | |||
18 | def prettify(elem): |
|
19 | def prettify(elem): | |
19 | """Return a pretty-printed XML string for the Element. |
|
20 | """Return a pretty-printed XML string for the Element. | |
20 | """ |
|
21 | """ | |
21 | rough_string = tostring(elem, 'utf-8') |
|
22 | rough_string = tostring(elem, 'utf-8') | |
22 | reparsed = minidom.parseString(rough_string) |
|
23 | reparsed = minidom.parseString(rough_string) | |
23 | return reparsed.toprettyxml(indent=" ") |
|
24 | return reparsed.toprettyxml(indent=" ") | |
24 |
|
25 | |||
25 | class ParameterConf(): |
|
26 | class ParameterConf(): | |
26 |
|
27 | |||
27 | id = None |
|
28 | id = None | |
28 | name = None |
|
29 | name = None | |
29 | value = None |
|
30 | value = None | |
30 | format = None |
|
31 | format = None | |
31 |
|
32 | |||
32 | __formated_value = None |
|
33 | __formated_value = None | |
33 |
|
34 | |||
34 | ELEMENTNAME = 'Parameter' |
|
35 | ELEMENTNAME = 'Parameter' | |
35 |
|
36 | |||
36 | def __init__(self): |
|
37 | def __init__(self): | |
37 |
|
38 | |||
38 | self.format = 'str' |
|
39 | self.format = 'str' | |
39 |
|
40 | |||
40 | def getElementName(self): |
|
41 | def getElementName(self): | |
41 |
|
42 | |||
42 | return self.ELEMENTNAME |
|
43 | return self.ELEMENTNAME | |
43 |
|
44 | |||
44 | def getValue(self): |
|
45 | def getValue(self): | |
45 |
|
46 | |||
46 | value = self.value |
|
47 | value = self.value | |
47 | format = self.format |
|
48 | format = self.format | |
48 |
|
49 | |||
49 | if self.__formated_value != None: |
|
50 | if self.__formated_value != None: | |
50 |
|
51 | |||
51 | return self.__formated_value |
|
52 | return self.__formated_value | |
52 |
|
53 | |||
53 | if format == 'str': |
|
54 | if format == 'str': | |
54 | self.__formated_value = str(value) |
|
55 | self.__formated_value = str(value) | |
55 | return self.__formated_value |
|
56 | return self.__formated_value | |
56 |
|
57 | |||
57 | if value == '': |
|
58 | if value == '': | |
58 | raise ValueError, "%s: This parameter value is empty" %self.name |
|
59 | raise ValueError, "%s: This parameter value is empty" %self.name | |
59 |
|
60 | |||
60 | if format == 'list': |
|
61 | if format == 'list': | |
61 | strList = value.split(',') |
|
62 | strList = value.split(',') | |
62 |
|
63 | |||
63 | self.__formated_value = strList |
|
64 | self.__formated_value = strList | |
64 |
|
65 | |||
65 | return self.__formated_value |
|
66 | return self.__formated_value | |
66 |
|
67 | |||
67 | if format == 'intlist': |
|
68 | if format == 'intlist': | |
68 | """ |
|
69 | """ | |
69 | Example: |
|
70 | Example: | |
70 | value = (0,1,2) |
|
71 | value = (0,1,2) | |
71 | """ |
|
72 | """ | |
72 | value = value.replace('(', '') |
|
73 | value = value.replace('(', '') | |
73 | value = value.replace(')', '') |
|
74 | value = value.replace(')', '') | |
74 |
|
75 | |||
75 | value = value.replace('[', '') |
|
76 | value = value.replace('[', '') | |
76 | value = value.replace(']', '') |
|
77 | value = value.replace(']', '') | |
77 |
|
78 | |||
78 | strList = value.split(',') |
|
79 | strList = value.split(',') | |
79 | intList = [int(float(x)) for x in strList] |
|
80 | intList = [int(float(x)) for x in strList] | |
80 |
|
81 | |||
81 | self.__formated_value = intList |
|
82 | self.__formated_value = intList | |
82 |
|
83 | |||
83 | return self.__formated_value |
|
84 | return self.__formated_value | |
84 |
|
85 | |||
85 | if format == 'floatlist': |
|
86 | if format == 'floatlist': | |
86 | """ |
|
87 | """ | |
87 | Example: |
|
88 | Example: | |
88 | value = (0.5, 1.4, 2.7) |
|
89 | value = (0.5, 1.4, 2.7) | |
89 | """ |
|
90 | """ | |
90 |
|
91 | |||
91 | value = value.replace('(', '') |
|
92 | value = value.replace('(', '') | |
92 | value = value.replace(')', '') |
|
93 | value = value.replace(')', '') | |
93 |
|
94 | |||
94 | value = value.replace('[', '') |
|
95 | value = value.replace('[', '') | |
95 | value = value.replace(']', '') |
|
96 | value = value.replace(']', '') | |
96 |
|
97 | |||
97 | strList = value.split(',') |
|
98 | strList = value.split(',') | |
98 | floatList = [float(x) for x in strList] |
|
99 | floatList = [float(x) for x in strList] | |
99 |
|
100 | |||
100 | self.__formated_value = floatList |
|
101 | self.__formated_value = floatList | |
101 |
|
102 | |||
102 | return self.__formated_value |
|
103 | return self.__formated_value | |
103 |
|
104 | |||
104 | if format == 'date': |
|
105 | if format == 'date': | |
105 | strList = value.split('/') |
|
106 | strList = value.split('/') | |
106 | intList = [int(x) for x in strList] |
|
107 | intList = [int(x) for x in strList] | |
107 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
108 | date = datetime.date(intList[0], intList[1], intList[2]) | |
108 |
|
109 | |||
109 | self.__formated_value = date |
|
110 | self.__formated_value = date | |
110 |
|
111 | |||
111 | return self.__formated_value |
|
112 | return self.__formated_value | |
112 |
|
113 | |||
113 | if format == 'time': |
|
114 | if format == 'time': | |
114 | strList = value.split(':') |
|
115 | strList = value.split(':') | |
115 | intList = [int(x) for x in strList] |
|
116 | intList = [int(x) for x in strList] | |
116 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
117 | time = datetime.time(intList[0], intList[1], intList[2]) | |
117 |
|
118 | |||
118 | self.__formated_value = time |
|
119 | self.__formated_value = time | |
119 |
|
120 | |||
120 | return self.__formated_value |
|
121 | return self.__formated_value | |
121 |
|
122 | |||
122 | if format == 'pairslist': |
|
123 | if format == 'pairslist': | |
123 | """ |
|
124 | """ | |
124 | Example: |
|
125 | Example: | |
125 | value = (0,1),(1,2) |
|
126 | value = (0,1),(1,2) | |
126 | """ |
|
127 | """ | |
127 |
|
128 | |||
128 | value = value.replace('(', '') |
|
129 | value = value.replace('(', '') | |
129 | value = value.replace(')', '') |
|
130 | value = value.replace(')', '') | |
130 |
|
131 | |||
131 | value = value.replace('[', '') |
|
132 | value = value.replace('[', '') | |
132 | value = value.replace(']', '') |
|
133 | value = value.replace(']', '') | |
133 |
|
134 | |||
134 | strList = value.split(',') |
|
135 | strList = value.split(',') | |
135 | intList = [int(item) for item in strList] |
|
136 | intList = [int(item) for item in strList] | |
136 | pairList = [] |
|
137 | pairList = [] | |
137 | for i in range(len(intList)/2): |
|
138 | for i in range(len(intList)/2): | |
138 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
139 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
139 |
|
140 | |||
140 | self.__formated_value = pairList |
|
141 | self.__formated_value = pairList | |
141 |
|
142 | |||
142 | return self.__formated_value |
|
143 | return self.__formated_value | |
143 |
|
144 | |||
144 | if format == 'multilist': |
|
145 | if format == 'multilist': | |
145 | """ |
|
146 | """ | |
146 | Example: |
|
147 | Example: | |
147 | value = (0,1,2),(3,4,5) |
|
148 | value = (0,1,2),(3,4,5) | |
148 | """ |
|
149 | """ | |
149 | multiList = ast.literal_eval(value) |
|
150 | multiList = ast.literal_eval(value) | |
150 |
|
151 | |||
151 | if type(multiList[0]) == int: |
|
152 | if type(multiList[0]) == int: | |
152 | multiList = ast.literal_eval("(" + value + ")") |
|
153 | multiList = ast.literal_eval("(" + value + ")") | |
153 |
|
154 | |||
154 | self.__formated_value = multiList |
|
155 | self.__formated_value = multiList | |
155 |
|
156 | |||
156 | return self.__formated_value |
|
157 | return self.__formated_value | |
157 |
|
158 | |||
158 | if format == 'bool': |
|
159 | if format == 'bool': | |
159 | value = int(value) |
|
160 | value = int(value) | |
160 |
|
161 | |||
161 | if format == 'int': |
|
162 | if format == 'int': | |
162 | value = float(value) |
|
163 | value = float(value) | |
163 |
|
164 | |||
164 | format_func = eval(format) |
|
165 | format_func = eval(format) | |
165 |
|
166 | |||
166 | self.__formated_value = format_func(value) |
|
167 | self.__formated_value = format_func(value) | |
167 |
|
168 | |||
168 | return self.__formated_value |
|
169 | return self.__formated_value | |
169 |
|
170 | |||
170 | def updateId(self, new_id): |
|
171 | def updateId(self, new_id): | |
171 |
|
172 | |||
172 | self.id = str(new_id) |
|
173 | self.id = str(new_id) | |
173 |
|
174 | |||
174 | def setup(self, id, name, value, format='str'): |
|
175 | def setup(self, id, name, value, format='str'): | |
175 |
|
176 | |||
176 | self.id = str(id) |
|
177 | self.id = str(id) | |
177 | self.name = name |
|
178 | self.name = name | |
178 | self.value = str(value) |
|
179 | self.value = str(value) | |
179 | self.format = str.lower(format) |
|
180 | self.format = str.lower(format) | |
180 |
|
181 | |||
181 | try: |
|
182 | try: | |
182 | self.getValue() |
|
183 | self.getValue() | |
183 | except: |
|
184 | except: | |
184 | return 0 |
|
185 | return 0 | |
185 |
|
186 | |||
186 | return 1 |
|
187 | return 1 | |
187 |
|
188 | |||
188 | def update(self, name, value, format='str'): |
|
189 | def update(self, name, value, format='str'): | |
189 |
|
190 | |||
190 | self.name = name |
|
191 | self.name = name | |
191 | self.value = str(value) |
|
192 | self.value = str(value) | |
192 | self.format = format |
|
193 | self.format = format | |
193 |
|
194 | |||
194 | def makeXml(self, opElement): |
|
195 | def makeXml(self, opElement): | |
195 |
|
196 | |||
196 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
197 | parmElement = SubElement(opElement, self.ELEMENTNAME) | |
197 | parmElement.set('id', str(self.id)) |
|
198 | parmElement.set('id', str(self.id)) | |
198 | parmElement.set('name', self.name) |
|
199 | parmElement.set('name', self.name) | |
199 | parmElement.set('value', self.value) |
|
200 | parmElement.set('value', self.value) | |
200 | parmElement.set('format', self.format) |
|
201 | parmElement.set('format', self.format) | |
201 |
|
202 | |||
202 | def readXml(self, parmElement): |
|
203 | def readXml(self, parmElement): | |
203 |
|
204 | |||
204 | self.id = parmElement.get('id') |
|
205 | self.id = parmElement.get('id') | |
205 | self.name = parmElement.get('name') |
|
206 | self.name = parmElement.get('name') | |
206 | self.value = parmElement.get('value') |
|
207 | self.value = parmElement.get('value') | |
207 | self.format = str.lower(parmElement.get('format')) |
|
208 | self.format = str.lower(parmElement.get('format')) | |
208 |
|
209 | |||
209 | #Compatible with old signal chain version |
|
210 | #Compatible with old signal chain version | |
210 | if self.format == 'int' and self.name == 'idfigure': |
|
211 | if self.format == 'int' and self.name == 'idfigure': | |
211 | self.name = 'id' |
|
212 | self.name = 'id' | |
212 |
|
213 | |||
213 | def printattr(self): |
|
214 | def printattr(self): | |
214 |
|
215 | |||
215 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
216 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) | |
216 |
|
217 | |||
217 | class OperationConf(): |
|
218 | class OperationConf(): | |
218 |
|
219 | |||
219 | id = None |
|
220 | id = None | |
220 | name = None |
|
221 | name = None | |
221 | priority = None |
|
222 | priority = None | |
222 | type = None |
|
223 | type = None | |
223 |
|
224 | |||
224 | parmConfObjList = [] |
|
225 | parmConfObjList = [] | |
225 |
|
226 | |||
226 | ELEMENTNAME = 'Operation' |
|
227 | ELEMENTNAME = 'Operation' | |
227 |
|
228 | |||
228 | def __init__(self): |
|
229 | def __init__(self): | |
229 |
|
230 | |||
230 | self.id = '0' |
|
231 | self.id = '0' | |
231 | self.name = None |
|
232 | self.name = None | |
232 | self.priority = None |
|
233 | self.priority = None | |
233 | self.type = 'self' |
|
234 | self.type = 'self' | |
234 |
|
235 | |||
235 |
|
236 | |||
236 | def __getNewId(self): |
|
237 | def __getNewId(self): | |
237 |
|
238 | |||
238 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
239 | return int(self.id)*10 + len(self.parmConfObjList) + 1 | |
239 |
|
240 | |||
240 | def updateId(self, new_id): |
|
241 | def updateId(self, new_id): | |
241 |
|
242 | |||
242 | self.id = str(new_id) |
|
243 | self.id = str(new_id) | |
243 |
|
244 | |||
244 | n = 1 |
|
245 | n = 1 | |
245 | for parmObj in self.parmConfObjList: |
|
246 | for parmObj in self.parmConfObjList: | |
246 |
|
247 | |||
247 | idParm = str(int(new_id)*10 + n) |
|
248 | idParm = str(int(new_id)*10 + n) | |
248 | parmObj.updateId(idParm) |
|
249 | parmObj.updateId(idParm) | |
249 |
|
250 | |||
250 | n += 1 |
|
251 | n += 1 | |
251 |
|
252 | |||
252 | def getElementName(self): |
|
253 | def getElementName(self): | |
253 |
|
254 | |||
254 | return self.ELEMENTNAME |
|
255 | return self.ELEMENTNAME | |
255 |
|
256 | |||
256 | def getParameterObjList(self): |
|
257 | def getParameterObjList(self): | |
257 |
|
258 | |||
258 | return self.parmConfObjList |
|
259 | return self.parmConfObjList | |
259 |
|
260 | |||
260 | def getParameterObj(self, parameterName): |
|
261 | def getParameterObj(self, parameterName): | |
261 |
|
262 | |||
262 | for parmConfObj in self.parmConfObjList: |
|
263 | for parmConfObj in self.parmConfObjList: | |
263 |
|
264 | |||
264 | if parmConfObj.name != parameterName: |
|
265 | if parmConfObj.name != parameterName: | |
265 | continue |
|
266 | continue | |
266 |
|
267 | |||
267 | return parmConfObj |
|
268 | return parmConfObj | |
268 |
|
269 | |||
269 | return None |
|
270 | return None | |
270 |
|
271 | |||
271 | def getParameterObjfromValue(self, parameterValue): |
|
272 | def getParameterObjfromValue(self, parameterValue): | |
272 |
|
273 | |||
273 | for parmConfObj in self.parmConfObjList: |
|
274 | for parmConfObj in self.parmConfObjList: | |
274 |
|
275 | |||
275 | if parmConfObj.getValue() != parameterValue: |
|
276 | if parmConfObj.getValue() != parameterValue: | |
276 | continue |
|
277 | continue | |
277 |
|
278 | |||
278 | return parmConfObj.getValue() |
|
279 | return parmConfObj.getValue() | |
279 |
|
280 | |||
280 | return None |
|
281 | return None | |
281 |
|
282 | |||
282 | def getParameterValue(self, parameterName): |
|
283 | def getParameterValue(self, parameterName): | |
283 |
|
284 | |||
284 | parameterObj = self.getParameterObj(parameterName) |
|
285 | parameterObj = self.getParameterObj(parameterName) | |
285 |
|
286 | |||
286 | # if not parameterObj: |
|
287 | # if not parameterObj: | |
287 | # return None |
|
288 | # return None | |
288 |
|
289 | |||
289 | value = parameterObj.getValue() |
|
290 | value = parameterObj.getValue() | |
290 |
|
291 | |||
291 | return value |
|
292 | return value | |
292 |
|
293 | |||
293 | def setup(self, id, name, priority, type): |
|
294 | def setup(self, id, name, priority, type): | |
294 |
|
295 | |||
295 | self.id = str(id) |
|
296 | self.id = str(id) | |
296 | self.name = name |
|
297 | self.name = name | |
297 | self.type = type |
|
298 | self.type = type | |
298 | self.priority = priority |
|
299 | self.priority = priority | |
299 |
|
300 | |||
300 | self.parmConfObjList = [] |
|
301 | self.parmConfObjList = [] | |
301 |
|
302 | |||
302 | def removeParameters(self): |
|
303 | def removeParameters(self): | |
303 |
|
304 | |||
304 | for obj in self.parmConfObjList: |
|
305 | for obj in self.parmConfObjList: | |
305 | del obj |
|
306 | del obj | |
306 |
|
307 | |||
307 | self.parmConfObjList = [] |
|
308 | self.parmConfObjList = [] | |
308 |
|
309 | |||
309 | def addParameter(self, name, value, format='str'): |
|
310 | def addParameter(self, name, value, format='str'): | |
310 |
|
311 | |||
311 | id = self.__getNewId() |
|
312 | id = self.__getNewId() | |
312 |
|
313 | |||
313 | parmConfObj = ParameterConf() |
|
314 | parmConfObj = ParameterConf() | |
314 | if not parmConfObj.setup(id, name, value, format): |
|
315 | if not parmConfObj.setup(id, name, value, format): | |
315 | return None |
|
316 | return None | |
316 |
|
317 | |||
317 | self.parmConfObjList.append(parmConfObj) |
|
318 | self.parmConfObjList.append(parmConfObj) | |
318 |
|
319 | |||
319 | return parmConfObj |
|
320 | return parmConfObj | |
320 |
|
321 | |||
321 | def changeParameter(self, name, value, format='str'): |
|
322 | def changeParameter(self, name, value, format='str'): | |
322 |
|
323 | |||
323 | parmConfObj = self.getParameterObj(name) |
|
324 | parmConfObj = self.getParameterObj(name) | |
324 | parmConfObj.update(name, value, format) |
|
325 | parmConfObj.update(name, value, format) | |
325 |
|
326 | |||
326 | return parmConfObj |
|
327 | return parmConfObj | |
327 |
|
328 | |||
328 | def makeXml(self, procUnitElement): |
|
329 | def makeXml(self, procUnitElement): | |
329 |
|
330 | |||
330 | opElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
331 | opElement = SubElement(procUnitElement, self.ELEMENTNAME) | |
331 | opElement.set('id', str(self.id)) |
|
332 | opElement.set('id', str(self.id)) | |
332 | opElement.set('name', self.name) |
|
333 | opElement.set('name', self.name) | |
333 | opElement.set('type', self.type) |
|
334 | opElement.set('type', self.type) | |
334 | opElement.set('priority', str(self.priority)) |
|
335 | opElement.set('priority', str(self.priority)) | |
335 |
|
336 | |||
336 | for parmConfObj in self.parmConfObjList: |
|
337 | for parmConfObj in self.parmConfObjList: | |
337 | parmConfObj.makeXml(opElement) |
|
338 | parmConfObj.makeXml(opElement) | |
338 |
|
339 | |||
339 | def readXml(self, opElement): |
|
340 | def readXml(self, opElement): | |
340 |
|
341 | |||
341 | self.id = opElement.get('id') |
|
342 | self.id = opElement.get('id') | |
342 | self.name = opElement.get('name') |
|
343 | self.name = opElement.get('name') | |
343 | self.type = opElement.get('type') |
|
344 | self.type = opElement.get('type') | |
344 | self.priority = opElement.get('priority') |
|
345 | self.priority = opElement.get('priority') | |
345 |
|
346 | |||
346 | #Compatible with old signal chain version |
|
347 | #Compatible with old signal chain version | |
347 | #Use of 'run' method instead 'init' |
|
348 | #Use of 'run' method instead 'init' | |
348 | if self.type == 'self' and self.name == 'init': |
|
349 | if self.type == 'self' and self.name == 'init': | |
349 | self.name = 'run' |
|
350 | self.name = 'run' | |
350 |
|
351 | |||
351 | self.parmConfObjList = [] |
|
352 | self.parmConfObjList = [] | |
352 |
|
353 | |||
353 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
354 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) | |
354 |
|
355 | |||
355 | for parmElement in parmElementList: |
|
356 | for parmElement in parmElementList: | |
356 | parmConfObj = ParameterConf() |
|
357 | parmConfObj = ParameterConf() | |
357 | parmConfObj.readXml(parmElement) |
|
358 | parmConfObj.readXml(parmElement) | |
358 |
|
359 | |||
359 | #Compatible with old signal chain version |
|
360 | #Compatible with old signal chain version | |
360 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
361 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER | |
361 | if self.type != 'self' and self.name == 'Plot': |
|
362 | if self.type != 'self' and self.name == 'Plot': | |
362 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
363 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': | |
363 | self.name = parmConfObj.value |
|
364 | self.name = parmConfObj.value | |
364 | continue |
|
365 | continue | |
365 |
|
366 | |||
366 | self.parmConfObjList.append(parmConfObj) |
|
367 | self.parmConfObjList.append(parmConfObj) | |
367 |
|
368 | |||
368 | def printattr(self): |
|
369 | def printattr(self): | |
369 |
|
370 | |||
370 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
371 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, | |
371 | self.id, |
|
372 | self.id, | |
372 | self.name, |
|
373 | self.name, | |
373 | self.type, |
|
374 | self.type, | |
374 | self.priority) |
|
375 | self.priority) | |
375 |
|
376 | |||
376 | for parmConfObj in self.parmConfObjList: |
|
377 | for parmConfObj in self.parmConfObjList: | |
377 | parmConfObj.printattr() |
|
378 | parmConfObj.printattr() | |
378 |
|
379 | |||
379 | def createObject(self): |
|
380 | def createObject(self): | |
380 |
|
381 | |||
381 | if self.type == 'self': |
|
382 | if self.type == 'self': | |
382 | raise ValueError, "This operation type cannot be created" |
|
383 | raise ValueError, "This operation type cannot be created" | |
383 |
|
384 | |||
384 | if self.type == 'external' or self.type == 'other': |
|
385 | if self.type == 'external' or self.type == 'other': | |
385 | className = eval(self.name) |
|
386 | className = eval(self.name) | |
386 | opObj = className() |
|
387 | opObj = className() | |
387 |
|
388 | |||
388 | return opObj |
|
389 | return opObj | |
389 |
|
390 | |||
390 | class ProcUnitConf(): |
|
391 | class ProcUnitConf(): | |
391 |
|
392 | |||
392 | id = None |
|
393 | id = None | |
393 | name = None |
|
394 | name = None | |
394 | datatype = None |
|
395 | datatype = None | |
395 | inputId = None |
|
396 | inputId = None | |
396 | parentId = None |
|
397 | parentId = None | |
397 |
|
398 | |||
398 | opConfObjList = [] |
|
399 | opConfObjList = [] | |
399 |
|
400 | |||
400 | procUnitObj = None |
|
401 | procUnitObj = None | |
401 | opObjList = [] |
|
402 | opObjList = [] | |
402 |
|
403 | |||
403 | ELEMENTNAME = 'ProcUnit' |
|
404 | ELEMENTNAME = 'ProcUnit' | |
404 |
|
405 | |||
405 | def __init__(self): |
|
406 | def __init__(self): | |
406 |
|
407 | |||
407 | self.id = None |
|
408 | self.id = None | |
408 | self.datatype = None |
|
409 | self.datatype = None | |
409 | self.name = None |
|
410 | self.name = None | |
410 | self.inputId = None |
|
411 | self.inputId = None | |
411 |
|
412 | |||
412 | self.opConfObjList = [] |
|
413 | self.opConfObjList = [] | |
413 |
|
414 | |||
414 | self.procUnitObj = None |
|
415 | self.procUnitObj = None | |
415 | self.opObjDict = {} |
|
416 | self.opObjDict = {} | |
416 |
|
417 | |||
417 | def __getPriority(self): |
|
418 | def __getPriority(self): | |
418 |
|
419 | |||
419 | return len(self.opConfObjList)+1 |
|
420 | return len(self.opConfObjList)+1 | |
420 |
|
421 | |||
421 | def __getNewId(self): |
|
422 | def __getNewId(self): | |
422 |
|
423 | |||
423 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
424 | return int(self.id)*10 + len(self.opConfObjList) + 1 | |
424 |
|
425 | |||
425 | def getElementName(self): |
|
426 | def getElementName(self): | |
426 |
|
427 | |||
427 | return self.ELEMENTNAME |
|
428 | return self.ELEMENTNAME | |
428 |
|
429 | |||
429 | def getId(self): |
|
430 | def getId(self): | |
430 |
|
431 | |||
431 | return self.id |
|
432 | return self.id | |
432 |
|
433 | |||
433 | def updateId(self, new_id, parentId=parentId): |
|
434 | def updateId(self, new_id, parentId=parentId): | |
434 |
|
435 | |||
435 |
|
436 | |||
436 | new_id = int(parentId)*10 + (int(self.id) % 10) |
|
437 | new_id = int(parentId)*10 + (int(self.id) % 10) | |
437 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) |
|
438 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) | |
438 |
|
439 | |||
439 | #If this proc unit has not inputs |
|
440 | #If this proc unit has not inputs | |
440 | if self.inputId == '0': |
|
441 | if self.inputId == '0': | |
441 | new_inputId = 0 |
|
442 | new_inputId = 0 | |
442 |
|
443 | |||
443 | n = 1 |
|
444 | n = 1 | |
444 | for opConfObj in self.opConfObjList: |
|
445 | for opConfObj in self.opConfObjList: | |
445 |
|
446 | |||
446 | idOp = str(int(new_id)*10 + n) |
|
447 | idOp = str(int(new_id)*10 + n) | |
447 | opConfObj.updateId(idOp) |
|
448 | opConfObj.updateId(idOp) | |
448 |
|
449 | |||
449 | n += 1 |
|
450 | n += 1 | |
450 |
|
451 | |||
451 | self.parentId = str(parentId) |
|
452 | self.parentId = str(parentId) | |
452 | self.id = str(new_id) |
|
453 | self.id = str(new_id) | |
453 | self.inputId = str(new_inputId) |
|
454 | self.inputId = str(new_inputId) | |
454 |
|
455 | |||
455 |
|
456 | |||
456 | def getInputId(self): |
|
457 | def getInputId(self): | |
457 |
|
458 | |||
458 | return self.inputId |
|
459 | return self.inputId | |
459 |
|
460 | |||
460 | def getOperationObjList(self): |
|
461 | def getOperationObjList(self): | |
461 |
|
462 | |||
462 | return self.opConfObjList |
|
463 | return self.opConfObjList | |
463 |
|
464 | |||
464 | def getOperationObj(self, name=None): |
|
465 | def getOperationObj(self, name=None): | |
465 |
|
466 | |||
466 | for opConfObj in self.opConfObjList: |
|
467 | for opConfObj in self.opConfObjList: | |
467 |
|
468 | |||
468 | if opConfObj.name != name: |
|
469 | if opConfObj.name != name: | |
469 | continue |
|
470 | continue | |
470 |
|
471 | |||
471 | return opConfObj |
|
472 | return opConfObj | |
472 |
|
473 | |||
473 | return None |
|
474 | return None | |
474 |
|
475 | |||
475 | def getOpObjfromParamValue(self, value=None): |
|
476 | def getOpObjfromParamValue(self, value=None): | |
476 |
|
477 | |||
477 | for opConfObj in self.opConfObjList: |
|
478 | for opConfObj in self.opConfObjList: | |
478 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
479 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: | |
479 | continue |
|
480 | continue | |
480 | return opConfObj |
|
481 | return opConfObj | |
481 | return None |
|
482 | return None | |
482 |
|
483 | |||
483 | def getProcUnitObj(self): |
|
484 | def getProcUnitObj(self): | |
484 |
|
485 | |||
485 | return self.procUnitObj |
|
486 | return self.procUnitObj | |
486 |
|
487 | |||
487 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
488 | def setup(self, id, name, datatype, inputId, parentId=None): | |
488 |
|
489 | |||
489 | #Compatible with old signal chain version |
|
490 | #Compatible with old signal chain version | |
490 | if datatype==None and name==None: |
|
491 | if datatype==None and name==None: | |
491 | raise ValueError, "datatype or name should be defined" |
|
492 | raise ValueError, "datatype or name should be defined" | |
492 |
|
493 | |||
493 | if name==None: |
|
494 | if name==None: | |
494 | if 'Proc' in datatype: |
|
495 | if 'Proc' in datatype: | |
495 | name = datatype |
|
496 | name = datatype | |
496 | else: |
|
497 | else: | |
497 | name = '%sProc' %(datatype) |
|
498 | name = '%sProc' %(datatype) | |
498 |
|
499 | |||
499 | if datatype==None: |
|
500 | if datatype==None: | |
500 | datatype = name.replace('Proc','') |
|
501 | datatype = name.replace('Proc','') | |
501 |
|
502 | |||
502 | self.id = str(id) |
|
503 | self.id = str(id) | |
503 | self.name = name |
|
504 | self.name = name | |
504 | self.datatype = datatype |
|
505 | self.datatype = datatype | |
505 | self.inputId = inputId |
|
506 | self.inputId = inputId | |
506 | self.parentId = parentId |
|
507 | self.parentId = parentId | |
507 |
|
508 | |||
508 | self.opConfObjList = [] |
|
509 | self.opConfObjList = [] | |
509 |
|
510 | |||
510 | self.addOperation(name='run', optype='self') |
|
511 | self.addOperation(name='run', optype='self') | |
511 |
|
512 | |||
512 | def removeOperations(self): |
|
513 | def removeOperations(self): | |
513 |
|
514 | |||
514 | for obj in self.opConfObjList: |
|
515 | for obj in self.opConfObjList: | |
515 | del obj |
|
516 | del obj | |
516 |
|
517 | |||
517 | self.opConfObjList = [] |
|
518 | self.opConfObjList = [] | |
518 | self.addOperation(name='run') |
|
519 | self.addOperation(name='run') | |
519 |
|
520 | |||
520 | def addParameter(self, **kwargs): |
|
521 | def addParameter(self, **kwargs): | |
521 | ''' |
|
522 | ''' | |
522 | Add parameters to "run" operation |
|
523 | Add parameters to "run" operation | |
523 | ''' |
|
524 | ''' | |
524 | opObj = self.opConfObjList[0] |
|
525 | opObj = self.opConfObjList[0] | |
525 |
|
526 | |||
526 | opObj.addParameter(**kwargs) |
|
527 | opObj.addParameter(**kwargs) | |
527 |
|
528 | |||
528 | return opObj |
|
529 | return opObj | |
529 |
|
530 | |||
530 | def addOperation(self, name, optype='self'): |
|
531 | def addOperation(self, name, optype='self'): | |
531 |
|
532 | |||
532 | id = self.__getNewId() |
|
533 | id = self.__getNewId() | |
533 | priority = self.__getPriority() |
|
534 | priority = self.__getPriority() | |
534 |
|
535 | |||
535 | opConfObj = OperationConf() |
|
536 | opConfObj = OperationConf() | |
536 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
537 | opConfObj.setup(id, name=name, priority=priority, type=optype) | |
537 |
|
538 | |||
538 | self.opConfObjList.append(opConfObj) |
|
539 | self.opConfObjList.append(opConfObj) | |
539 |
|
540 | |||
540 | return opConfObj |
|
541 | return opConfObj | |
541 |
|
542 | |||
542 | def makeXml(self, projectElement): |
|
543 | def makeXml(self, projectElement): | |
543 |
|
544 | |||
544 | procUnitElement = SubElement(projectElement, self.ELEMENTNAME) |
|
545 | procUnitElement = SubElement(projectElement, self.ELEMENTNAME) | |
545 | procUnitElement.set('id', str(self.id)) |
|
546 | procUnitElement.set('id', str(self.id)) | |
546 | procUnitElement.set('name', self.name) |
|
547 | procUnitElement.set('name', self.name) | |
547 | procUnitElement.set('datatype', self.datatype) |
|
548 | procUnitElement.set('datatype', self.datatype) | |
548 | procUnitElement.set('inputId', str(self.inputId)) |
|
549 | procUnitElement.set('inputId', str(self.inputId)) | |
549 |
|
550 | |||
550 | for opConfObj in self.opConfObjList: |
|
551 | for opConfObj in self.opConfObjList: | |
551 | opConfObj.makeXml(procUnitElement) |
|
552 | opConfObj.makeXml(procUnitElement) | |
552 |
|
553 | |||
553 | def readXml(self, upElement): |
|
554 | def readXml(self, upElement): | |
554 |
|
555 | |||
555 | self.id = upElement.get('id') |
|
556 | self.id = upElement.get('id') | |
556 | self.name = upElement.get('name') |
|
557 | self.name = upElement.get('name') | |
557 | self.datatype = upElement.get('datatype') |
|
558 | self.datatype = upElement.get('datatype') | |
558 | self.inputId = upElement.get('inputId') |
|
559 | self.inputId = upElement.get('inputId') | |
559 |
|
560 | |||
560 | if self.ELEMENTNAME == "ReadUnit": |
|
561 | if self.ELEMENTNAME == "ReadUnit": | |
561 | self.datatype = self.datatype.replace("Reader", "") |
|
562 | self.datatype = self.datatype.replace("Reader", "") | |
562 |
|
563 | |||
563 | if self.ELEMENTNAME == "ProcUnit": |
|
564 | if self.ELEMENTNAME == "ProcUnit": | |
564 | self.datatype = self.datatype.replace("Proc", "") |
|
565 | self.datatype = self.datatype.replace("Proc", "") | |
565 |
|
566 | |||
566 | if self.inputId == 'None': |
|
567 | if self.inputId == 'None': | |
567 | self.inputId = '0' |
|
568 | self.inputId = '0' | |
568 |
|
569 | |||
569 | self.opConfObjList = [] |
|
570 | self.opConfObjList = [] | |
570 |
|
571 | |||
571 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
572 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
572 |
|
573 | |||
573 | for opElement in opElementList: |
|
574 | for opElement in opElementList: | |
574 | opConfObj = OperationConf() |
|
575 | opConfObj = OperationConf() | |
575 | opConfObj.readXml(opElement) |
|
576 | opConfObj.readXml(opElement) | |
576 | self.opConfObjList.append(opConfObj) |
|
577 | self.opConfObjList.append(opConfObj) | |
577 |
|
578 | |||
578 | def printattr(self): |
|
579 | def printattr(self): | |
579 |
|
580 | |||
580 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
581 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, | |
581 | self.id, |
|
582 | self.id, | |
582 | self.name, |
|
583 | self.name, | |
583 | self.datatype, |
|
584 | self.datatype, | |
584 | self.inputId) |
|
585 | self.inputId) | |
585 |
|
586 | |||
586 | for opConfObj in self.opConfObjList: |
|
587 | for opConfObj in self.opConfObjList: | |
587 | opConfObj.printattr() |
|
588 | opConfObj.printattr() | |
588 |
|
589 | |||
589 | def createObjects(self): |
|
590 | def createObjects(self): | |
590 |
|
591 | |||
591 | className = eval(self.name) |
|
592 | className = eval(self.name) | |
592 | procUnitObj = className() |
|
593 | procUnitObj = className() | |
593 |
|
594 | |||
594 | for opConfObj in self.opConfObjList: |
|
595 | for opConfObj in self.opConfObjList: | |
595 |
|
596 | |||
596 | if opConfObj.type == 'self': |
|
597 | if opConfObj.type == 'self': | |
597 | continue |
|
598 | continue | |
598 |
|
599 | |||
599 | opObj = opConfObj.createObject() |
|
600 | opObj = opConfObj.createObject() | |
600 |
|
601 | |||
601 | self.opObjDict[opConfObj.id] = opObj |
|
602 | self.opObjDict[opConfObj.id] = opObj | |
602 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
603 | procUnitObj.addOperation(opObj, opConfObj.id) | |
603 |
|
604 | |||
604 | self.procUnitObj = procUnitObj |
|
605 | self.procUnitObj = procUnitObj | |
605 |
|
606 | |||
606 | return procUnitObj |
|
607 | return procUnitObj | |
607 |
|
608 | |||
608 | def run(self): |
|
609 | def run(self): | |
609 |
|
610 | |||
610 | is_ok = False |
|
611 | is_ok = False | |
611 |
|
612 | |||
612 | for opConfObj in self.opConfObjList: |
|
613 | for opConfObj in self.opConfObjList: | |
613 |
|
614 | |||
614 | kwargs = {} |
|
615 | kwargs = {} | |
615 | for parmConfObj in opConfObj.getParameterObjList(): |
|
616 | for parmConfObj in opConfObj.getParameterObjList(): | |
616 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
617 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': | |
617 | continue |
|
618 | continue | |
618 |
|
619 | |||
619 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
620 | kwargs[parmConfObj.name] = parmConfObj.getValue() | |
620 |
|
621 | |||
621 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
622 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) | |
622 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
623 | sts = self.procUnitObj.call(opType = opConfObj.type, | |
623 | opName = opConfObj.name, |
|
624 | opName = opConfObj.name, | |
624 | opId = opConfObj.id, |
|
625 | opId = opConfObj.id, | |
625 | **kwargs) |
|
626 | **kwargs) | |
626 | is_ok = is_ok or sts |
|
627 | is_ok = is_ok or sts | |
627 |
|
628 | |||
628 | return is_ok |
|
629 | return is_ok | |
629 |
|
630 | |||
630 | def close(self): |
|
631 | def close(self): | |
631 |
|
632 | |||
632 | for opConfObj in self.opConfObjList: |
|
633 | for opConfObj in self.opConfObjList: | |
633 | if opConfObj.type == 'self': |
|
634 | if opConfObj.type == 'self': | |
634 | continue |
|
635 | continue | |
635 |
|
636 | |||
636 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
637 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) | |
637 | opObj.close() |
|
638 | opObj.close() | |
638 |
|
639 | |||
639 | self.procUnitObj.close() |
|
640 | self.procUnitObj.close() | |
640 |
|
641 | |||
641 | return |
|
642 | return | |
642 |
|
643 | |||
643 | class ReadUnitConf(ProcUnitConf): |
|
644 | class ReadUnitConf(ProcUnitConf): | |
644 |
|
645 | |||
645 | path = None |
|
646 | path = None | |
646 | startDate = None |
|
647 | startDate = None | |
647 | endDate = None |
|
648 | endDate = None | |
648 | startTime = None |
|
649 | startTime = None | |
649 | endTime = None |
|
650 | endTime = None | |
650 |
|
651 | |||
651 | ELEMENTNAME = 'ReadUnit' |
|
652 | ELEMENTNAME = 'ReadUnit' | |
652 |
|
653 | |||
653 | def __init__(self): |
|
654 | def __init__(self): | |
654 |
|
655 | |||
655 | self.id = None |
|
656 | self.id = None | |
656 | self.datatype = None |
|
657 | self.datatype = None | |
657 | self.name = None |
|
658 | self.name = None | |
658 | self.inputId = None |
|
659 | self.inputId = None | |
659 |
|
660 | |||
660 | self.parentId = None |
|
661 | self.parentId = None | |
661 |
|
662 | |||
662 | self.opConfObjList = [] |
|
663 | self.opConfObjList = [] | |
663 | self.opObjList = [] |
|
664 | self.opObjList = [] | |
664 |
|
665 | |||
665 | def getElementName(self): |
|
666 | def getElementName(self): | |
666 |
|
667 | |||
667 | return self.ELEMENTNAME |
|
668 | return self.ELEMENTNAME | |
668 |
|
669 | |||
669 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
670 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): | |
670 |
|
671 | |||
671 | #Compatible with old signal chain version |
|
672 | #Compatible with old signal chain version | |
672 | if datatype==None and name==None: |
|
673 | if datatype==None and name==None: | |
673 | raise ValueError, "datatype or name should be defined" |
|
674 | raise ValueError, "datatype or name should be defined" | |
674 |
|
675 | |||
675 | if name==None: |
|
676 | if name==None: | |
676 | if 'Reader' in datatype: |
|
677 | if 'Reader' in datatype: | |
677 | name = datatype |
|
678 | name = datatype | |
678 | else: |
|
679 | else: | |
679 | name = '%sReader' %(datatype) |
|
680 | name = '%sReader' %(datatype) | |
680 |
|
681 | |||
681 | if datatype==None: |
|
682 | if datatype==None: | |
682 | datatype = name.replace('Reader','') |
|
683 | datatype = name.replace('Reader','') | |
683 |
|
684 | |||
684 | self.id = id |
|
685 | self.id = id | |
685 | self.name = name |
|
686 | self.name = name | |
686 | self.datatype = datatype |
|
687 | self.datatype = datatype | |
687 |
|
688 | |||
688 | self.path = path |
|
689 | self.path = os.path.abspath(path) | |
689 | self.startDate = startDate |
|
690 | self.startDate = startDate | |
690 | self.endDate = endDate |
|
691 | self.endDate = endDate | |
691 | self.startTime = startTime |
|
692 | self.startTime = startTime | |
692 | self.endTime = endTime |
|
693 | self.endTime = endTime | |
693 |
|
694 | |||
694 | self.inputId = '0' |
|
695 | self.inputId = '0' | |
695 | self.parentId = parentId |
|
696 | self.parentId = parentId | |
696 |
|
697 | |||
697 | self.addRunOperation(**kwargs) |
|
698 | self.addRunOperation(**kwargs) | |
698 |
|
699 | |||
699 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): |
|
700 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): | |
700 |
|
701 | |||
701 | #Compatible with old signal chain version |
|
702 | #Compatible with old signal chain version | |
702 | if datatype==None and name==None: |
|
703 | if datatype==None and name==None: | |
703 | raise ValueError, "datatype or name should be defined" |
|
704 | raise ValueError, "datatype or name should be defined" | |
704 |
|
705 | |||
705 | if name==None: |
|
706 | if name==None: | |
706 | if 'Reader' in datatype: |
|
707 | if 'Reader' in datatype: | |
707 | name = datatype |
|
708 | name = datatype | |
708 | else: |
|
709 | else: | |
709 | name = '%sReader' %(datatype) |
|
710 | name = '%sReader' %(datatype) | |
710 |
|
711 | |||
711 | if datatype==None: |
|
712 | if datatype==None: | |
712 | datatype = name.replace('Reader','') |
|
713 | datatype = name.replace('Reader','') | |
713 |
|
714 | |||
714 | self.datatype = datatype |
|
715 | self.datatype = datatype | |
715 | self.name = name |
|
716 | self.name = name | |
716 | self.path = path |
|
717 | self.path = path | |
717 | self.startDate = startDate |
|
718 | self.startDate = startDate | |
718 | self.endDate = endDate |
|
719 | self.endDate = endDate | |
719 | self.startTime = startTime |
|
720 | self.startTime = startTime | |
720 | self.endTime = endTime |
|
721 | self.endTime = endTime | |
721 |
|
722 | |||
722 | self.inputId = '0' |
|
723 | self.inputId = '0' | |
723 | self.parentId = parentId |
|
724 | self.parentId = parentId | |
724 |
|
725 | |||
725 | self.updateRunOperation(**kwargs) |
|
726 | self.updateRunOperation(**kwargs) | |
|
727 | ||||
|
728 | def removeOperations(self): | |||
|
729 | ||||
|
730 | for obj in self.opConfObjList: | |||
|
731 | del obj | |||
|
732 | ||||
|
733 | self.opConfObjList = [] | |||
726 |
|
734 | |||
727 | def addRunOperation(self, **kwargs): |
|
735 | def addRunOperation(self, **kwargs): | |
728 |
|
736 | |||
729 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
737 | opObj = self.addOperation(name = 'run', optype = 'self') | |
730 |
|
738 | |||
731 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
739 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
732 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
740 | opObj.addParameter(name='path' , value=self.path, format='str') | |
733 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
741 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
734 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
742 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
735 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
743 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
736 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
744 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
737 |
|
745 | |||
738 | for key, value in kwargs.items(): |
|
746 | for key, value in kwargs.items(): | |
739 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
747 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
740 |
|
748 | |||
741 | return opObj |
|
749 | return opObj | |
742 |
|
750 | |||
743 | def updateRunOperation(self, **kwargs): |
|
751 | def updateRunOperation(self, **kwargs): | |
744 |
|
752 | |||
745 | opObj = self.getOperationObj(name = 'run') |
|
753 | opObj = self.getOperationObj(name = 'run') | |
746 | opObj.removeParameters() |
|
754 | opObj.removeParameters() | |
747 |
|
755 | |||
748 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
756 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
749 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
757 | opObj.addParameter(name='path' , value=self.path, format='str') | |
750 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
758 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
751 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
759 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
752 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
760 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
753 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
761 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
754 |
|
762 | |||
755 | for key, value in kwargs.items(): |
|
763 | for key, value in kwargs.items(): | |
756 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
764 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
757 |
|
765 | |||
758 | return opObj |
|
766 | return opObj | |
759 |
|
767 | |||
760 | # def makeXml(self, projectElement): |
|
768 | # def makeXml(self, projectElement): | |
761 | # |
|
769 | # | |
762 | # procUnitElement = SubElement(projectElement, self.ELEMENTNAME) |
|
770 | # procUnitElement = SubElement(projectElement, self.ELEMENTNAME) | |
763 | # procUnitElement.set('id', str(self.id)) |
|
771 | # procUnitElement.set('id', str(self.id)) | |
764 | # procUnitElement.set('name', self.name) |
|
772 | # procUnitElement.set('name', self.name) | |
765 | # procUnitElement.set('datatype', self.datatype) |
|
773 | # procUnitElement.set('datatype', self.datatype) | |
766 | # procUnitElement.set('inputId', str(self.inputId)) |
|
774 | # procUnitElement.set('inputId', str(self.inputId)) | |
767 | # |
|
775 | # | |
768 | # for opConfObj in self.opConfObjList: |
|
776 | # for opConfObj in self.opConfObjList: | |
769 | # opConfObj.makeXml(procUnitElement) |
|
777 | # opConfObj.makeXml(procUnitElement) | |
770 |
|
778 | |||
771 | def readXml(self, upElement): |
|
779 | def readXml(self, upElement): | |
772 |
|
780 | |||
773 | self.id = upElement.get('id') |
|
781 | self.id = upElement.get('id') | |
774 | self.name = upElement.get('name') |
|
782 | self.name = upElement.get('name') | |
775 | self.datatype = upElement.get('datatype') |
|
783 | self.datatype = upElement.get('datatype') | |
776 | self.inputId = upElement.get('inputId') |
|
784 | self.inputId = upElement.get('inputId') | |
777 |
|
785 | |||
778 | if self.ELEMENTNAME == "ReadUnit": |
|
786 | if self.ELEMENTNAME == "ReadUnit": | |
779 | self.datatype = self.datatype.replace("Reader", "") |
|
787 | self.datatype = self.datatype.replace("Reader", "") | |
780 |
|
788 | |||
781 | if self.inputId == 'None': |
|
789 | if self.inputId == 'None': | |
782 | self.inputId = '0' |
|
790 | self.inputId = '0' | |
783 |
|
791 | |||
784 | self.opConfObjList = [] |
|
792 | self.opConfObjList = [] | |
785 |
|
793 | |||
786 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
794 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
787 |
|
795 | |||
788 | for opElement in opElementList: |
|
796 | for opElement in opElementList: | |
789 | opConfObj = OperationConf() |
|
797 | opConfObj = OperationConf() | |
790 | opConfObj.readXml(opElement) |
|
798 | opConfObj.readXml(opElement) | |
791 | self.opConfObjList.append(opConfObj) |
|
799 | self.opConfObjList.append(opConfObj) | |
792 |
|
800 | |||
793 | if opConfObj.name == 'run': |
|
801 | if opConfObj.name == 'run': | |
794 | self.path = opConfObj.getParameterValue('path') |
|
802 | self.path = opConfObj.getParameterValue('path') | |
795 | self.startDate = opConfObj.getParameterValue('startDate') |
|
803 | self.startDate = opConfObj.getParameterValue('startDate') | |
796 | self.endDate = opConfObj.getParameterValue('endDate') |
|
804 | self.endDate = opConfObj.getParameterValue('endDate') | |
797 | self.startTime = opConfObj.getParameterValue('startTime') |
|
805 | self.startTime = opConfObj.getParameterValue('startTime') | |
798 | self.endTime = opConfObj.getParameterValue('endTime') |
|
806 | self.endTime = opConfObj.getParameterValue('endTime') | |
799 |
|
807 | |||
800 | class Project(): |
|
808 | class Project(): | |
801 |
|
809 | |||
802 | id = None |
|
810 | id = None | |
803 | name = None |
|
811 | name = None | |
804 | description = None |
|
812 | description = None | |
805 | filename = None |
|
813 | filename = None | |
806 |
|
814 | |||
807 | procUnitConfObjDict = None |
|
815 | procUnitConfObjDict = None | |
808 |
|
816 | |||
809 | ELEMENTNAME = 'Project' |
|
817 | ELEMENTNAME = 'Project' | |
810 |
|
818 | |||
811 | def __init__(self): |
|
819 | def __init__(self): | |
812 |
|
820 | |||
813 | self.id = None |
|
821 | self.id = None | |
814 | self.name = None |
|
822 | self.name = None | |
815 | self.description = None |
|
823 | self.description = None | |
816 |
|
824 | |||
817 | self.procUnitConfObjDict = {} |
|
825 | self.procUnitConfObjDict = {} | |
818 |
|
826 | |||
819 | def __getNewId(self): |
|
827 | def __getNewId(self): | |
820 |
|
828 | |||
821 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
829 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 | |
822 |
|
830 | |||
823 | return str(id) |
|
831 | return str(id) | |
824 |
|
832 | |||
825 | def getElementName(self): |
|
833 | def getElementName(self): | |
826 |
|
834 | |||
827 | return self.ELEMENTNAME |
|
835 | return self.ELEMENTNAME | |
828 |
|
836 | |||
829 | def getId(self): |
|
837 | def getId(self): | |
830 |
|
838 | |||
831 | return self.id |
|
839 | return self.id | |
832 |
|
840 | |||
833 | def updateId(self, new_id): |
|
841 | def updateId(self, new_id): | |
834 |
|
842 | |||
835 | self.id = str(new_id) |
|
843 | self.id = str(new_id) | |
836 |
|
844 | |||
837 | keyList = self.procUnitConfObjDict.keys() |
|
845 | keyList = self.procUnitConfObjDict.keys() | |
838 | keyList.sort() |
|
846 | keyList.sort() | |
839 |
|
847 | |||
840 | n = 1 |
|
848 | n = 1 | |
841 | newProcUnitConfObjDict = {} |
|
849 | newProcUnitConfObjDict = {} | |
842 |
|
850 | |||
843 | for procKey in keyList: |
|
851 | for procKey in keyList: | |
844 |
|
852 | |||
845 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
853 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
846 | idProcUnit = str(int(self.id)*10 + n) |
|
854 | idProcUnit = str(int(self.id)*10 + n) | |
847 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) |
|
855 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) | |
848 |
|
856 | |||
849 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj |
|
857 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj | |
850 | n += 1 |
|
858 | n += 1 | |
851 |
|
859 | |||
852 | self.procUnitConfObjDict = newProcUnitConfObjDict |
|
860 | self.procUnitConfObjDict = newProcUnitConfObjDict | |
853 |
|
861 | |||
854 | def setup(self, id, name, description): |
|
862 | def setup(self, id, name, description): | |
855 |
|
863 | |||
856 | self.id = str(id) |
|
864 | self.id = str(id) | |
857 | self.name = name |
|
865 | self.name = name | |
858 | self.description = description |
|
866 | self.description = description | |
859 |
|
867 | |||
860 | def update(self, name, description): |
|
868 | def update(self, name, description): | |
861 |
|
869 | |||
862 | self.name = name |
|
870 | self.name = name | |
863 | self.description = description |
|
871 | self.description = description | |
864 |
|
872 | |||
865 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
873 | def addReadUnit(self, id=None, datatype=None, name=None, **kwargs): | |
866 |
|
874 | |||
867 | idReadUnit = self.__getNewId() |
|
875 | if id is None: | |
|
876 | idReadUnit = self.__getNewId() | |||
|
877 | else: | |||
|
878 | idReadUnit = str(id) | |||
868 |
|
879 | |||
869 | readUnitConfObj = ReadUnitConf() |
|
880 | readUnitConfObj = ReadUnitConf() | |
870 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) |
|
881 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) | |
871 |
|
882 | |||
872 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
883 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
873 |
|
884 | |||
874 | return readUnitConfObj |
|
885 | return readUnitConfObj | |
875 |
|
886 | |||
876 | def addProcUnit(self, inputId='0', datatype=None, name=None): |
|
887 | def addProcUnit(self, inputId='0', datatype=None, name=None): | |
877 |
|
888 | |||
878 | idProcUnit = self.__getNewId() |
|
889 | idProcUnit = self.__getNewId() | |
879 |
|
890 | |||
880 | procUnitConfObj = ProcUnitConf() |
|
891 | procUnitConfObj = ProcUnitConf() | |
881 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) |
|
892 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) | |
882 |
|
893 | |||
883 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
894 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
884 |
|
895 | |||
885 | return procUnitConfObj |
|
896 | return procUnitConfObj | |
886 |
|
897 | |||
887 | def removeProcUnit(self, id): |
|
898 | def removeProcUnit(self, id): | |
888 |
|
899 | |||
889 | if id in self.procUnitConfObjDict.keys(): |
|
900 | if id in self.procUnitConfObjDict.keys(): | |
890 | self.procUnitConfObjDict.pop(id) |
|
901 | self.procUnitConfObjDict.pop(id) | |
891 |
|
902 | |||
892 | def getReadUnitId(self): |
|
903 | def getReadUnitId(self): | |
893 |
|
904 | |||
894 | readUnitConfObj = self.getReadUnitObj() |
|
905 | readUnitConfObj = self.getReadUnitObj() | |
895 |
|
906 | |||
896 | return readUnitConfObj.id |
|
907 | return readUnitConfObj.id | |
897 |
|
908 | |||
898 | def getReadUnitObj(self): |
|
909 | def getReadUnitObj(self): | |
899 |
|
910 | |||
900 | for obj in self.procUnitConfObjDict.values(): |
|
911 | for obj in self.procUnitConfObjDict.values(): | |
901 | if obj.getElementName() == "ReadUnit": |
|
912 | if obj.getElementName() == "ReadUnit": | |
902 | return obj |
|
913 | return obj | |
903 |
|
914 | |||
904 | return None |
|
915 | return None | |
905 |
|
916 | |||
906 | def getProcUnitObj(self, id=None, name=None): |
|
917 | def getProcUnitObj(self, id=None, name=None): | |
907 |
|
918 | |||
908 | if id != None: |
|
919 | if id != None: | |
909 | return self.procUnitConfObjDict[id] |
|
920 | return self.procUnitConfObjDict[id] | |
910 |
|
921 | |||
911 | if name != None: |
|
922 | if name != None: | |
912 | return self.getProcUnitObjByName(name) |
|
923 | return self.getProcUnitObjByName(name) | |
913 |
|
924 | |||
914 | return None |
|
925 | return None | |
915 |
|
926 | |||
916 | def getProcUnitObjByName(self, name): |
|
927 | def getProcUnitObjByName(self, name): | |
917 |
|
928 | |||
918 | for obj in self.procUnitConfObjDict.values(): |
|
929 | for obj in self.procUnitConfObjDict.values(): | |
919 | if obj.name == name: |
|
930 | if obj.name == name: | |
920 | return obj |
|
931 | return obj | |
921 |
|
932 | |||
922 | return None |
|
933 | return None | |
923 |
|
934 | |||
924 | def procUnitItems(self): |
|
935 | def procUnitItems(self): | |
925 |
|
936 | |||
926 | return self.procUnitConfObjDict.items() |
|
937 | return self.procUnitConfObjDict.items() | |
927 |
|
938 | |||
928 | def makeXml(self): |
|
939 | def makeXml(self): | |
929 |
|
940 | |||
930 | projectElement = Element('Project') |
|
941 | projectElement = Element('Project') | |
931 | projectElement.set('id', str(self.id)) |
|
942 | projectElement.set('id', str(self.id)) | |
932 | projectElement.set('name', self.name) |
|
943 | projectElement.set('name', self.name) | |
933 | projectElement.set('description', self.description) |
|
944 | projectElement.set('description', self.description) | |
934 |
|
945 | |||
935 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
946 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
936 | procUnitConfObj.makeXml(projectElement) |
|
947 | procUnitConfObj.makeXml(projectElement) | |
937 |
|
948 | |||
938 | self.projectElement = projectElement |
|
949 | self.projectElement = projectElement | |
939 |
|
950 | |||
940 | def writeXml(self, filename): |
|
951 | def writeXml(self, filename): | |
941 |
|
952 | |||
942 | if not os.access(os.path.dirname(filename), os.W_OK): |
|
953 | abs_file = os.path.abspath(filename) | |
|
954 | ||||
|
955 | if not os.access(os.path.dirname(abs_file), os.W_OK): | |||
|
956 | print "No write permission on %s" %os.path.dirname(abs_file) | |||
943 | return 0 |
|
957 | return 0 | |
944 |
|
958 | |||
945 |
if os.path.isfile(file |
|
959 | if os.path.isfile(abs_file) and not(os.access(abs_file, os.W_OK)): | |
|
960 | print "File %s already exists and it could not be overwriten" %abs_file | |||
946 | return 0 |
|
961 | return 0 | |
947 |
|
962 | |||
948 | self.makeXml() |
|
963 | self.makeXml() | |
949 |
|
964 | |||
950 |
ElementTree(self.projectElement).write(file |
|
965 | ElementTree(self.projectElement).write(abs_file, method='xml') | |
951 |
|
966 | |||
952 |
self.filename = file |
|
967 | self.filename = abs_file | |
953 |
|
968 | |||
954 | return 1 |
|
969 | return 1 | |
955 |
|
970 | |||
956 | def readXml(self, filename): |
|
971 | def readXml(self, filename): | |
957 |
|
972 | |||
958 |
|
|
973 | abs_file = os.path.abspath(filename) | |
959 | print "%s does not exist" %filename |
|
974 | ||
|
975 | if not os.path.isfile(abs_file): | |||
|
976 | print "%s does not exist" %abs_file | |||
960 | return 0 |
|
977 | return 0 | |
961 |
|
978 | |||
962 | self.projectElement = None |
|
979 | self.projectElement = None | |
963 | self.procUnitConfObjDict = {} |
|
980 | self.procUnitConfObjDict = {} | |
964 |
|
981 | |||
965 |
self.projectElement = ElementTree().parse(file |
|
982 | self.projectElement = ElementTree().parse(abs_file) | |
966 |
|
983 | |||
967 | self.project = self.projectElement.tag |
|
984 | self.project = self.projectElement.tag | |
968 |
|
985 | |||
969 | self.id = self.projectElement.get('id') |
|
986 | self.id = self.projectElement.get('id') | |
970 | self.name = self.projectElement.get('name') |
|
987 | self.name = self.projectElement.get('name') | |
971 | self.description = self.projectElement.get('description') |
|
988 | self.description = self.projectElement.get('description') | |
972 |
|
989 | |||
973 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
990 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) | |
974 |
|
991 | |||
975 | for readUnitElement in readUnitElementList: |
|
992 | for readUnitElement in readUnitElementList: | |
976 | readUnitConfObj = ReadUnitConf() |
|
993 | readUnitConfObj = ReadUnitConf() | |
977 | readUnitConfObj.readXml(readUnitElement) |
|
994 | readUnitConfObj.readXml(readUnitElement) | |
978 |
|
995 | |||
979 | if readUnitConfObj.parentId == None: |
|
996 | if readUnitConfObj.parentId == None: | |
980 | readUnitConfObj.parentId = self.id |
|
997 | readUnitConfObj.parentId = self.id | |
981 |
|
998 | |||
982 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
999 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
983 |
|
1000 | |||
984 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
1001 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) | |
985 |
|
1002 | |||
986 | for procUnitElement in procUnitElementList: |
|
1003 | for procUnitElement in procUnitElementList: | |
987 | procUnitConfObj = ProcUnitConf() |
|
1004 | procUnitConfObj = ProcUnitConf() | |
988 | procUnitConfObj.readXml(procUnitElement) |
|
1005 | procUnitConfObj.readXml(procUnitElement) | |
989 |
|
1006 | |||
990 | if procUnitConfObj.parentId == None: |
|
1007 | if procUnitConfObj.parentId == None: | |
991 | procUnitConfObj.parentId = self.id |
|
1008 | procUnitConfObj.parentId = self.id | |
992 |
|
1009 | |||
993 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
1010 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
994 |
|
1011 | |||
995 | return 1 |
|
1012 | return 1 | |
996 |
|
1013 | |||
997 | def printattr(self): |
|
1014 | def printattr(self): | |
998 |
|
1015 | |||
999 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
1016 | print "Project[%s]: name = %s, description = %s" %(self.id, | |
1000 | self.name, |
|
1017 | self.name, | |
1001 | self.description) |
|
1018 | self.description) | |
1002 |
|
1019 | |||
1003 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
1020 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
1004 | procUnitConfObj.printattr() |
|
1021 | procUnitConfObj.printattr() | |
1005 |
|
1022 | |||
1006 | def createObjects(self): |
|
1023 | def createObjects(self): | |
1007 |
|
1024 | |||
1008 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
1025 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
1009 | procUnitConfObj.createObjects() |
|
1026 | procUnitConfObj.createObjects() | |
1010 |
|
1027 | |||
1011 | def __connect(self, objIN, thisObj): |
|
1028 | def __connect(self, objIN, thisObj): | |
1012 |
|
1029 | |||
1013 | thisObj.setInput(objIN.getOutputObj()) |
|
1030 | thisObj.setInput(objIN.getOutputObj()) | |
1014 |
|
1031 | |||
1015 | def connectObjects(self): |
|
1032 | def connectObjects(self): | |
1016 |
|
1033 | |||
1017 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
1034 | for thisPUConfObj in self.procUnitConfObjDict.values(): | |
1018 |
|
1035 | |||
1019 | inputId = thisPUConfObj.getInputId() |
|
1036 | inputId = thisPUConfObj.getInputId() | |
1020 |
|
1037 | |||
1021 | if int(inputId) == 0: |
|
1038 | if int(inputId) == 0: | |
1022 | continue |
|
1039 | continue | |
1023 |
|
1040 | |||
1024 | #Get input object |
|
1041 | #Get input object | |
1025 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
1042 | puConfINObj = self.procUnitConfObjDict[inputId] | |
1026 | puObjIN = puConfINObj.getProcUnitObj() |
|
1043 | puObjIN = puConfINObj.getProcUnitObj() | |
1027 |
|
1044 | |||
1028 | #Get current object |
|
1045 | #Get current object | |
1029 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
1046 | thisPUObj = thisPUConfObj.getProcUnitObj() | |
1030 |
|
1047 | |||
1031 | self.__connect(puObjIN, thisPUObj) |
|
1048 | self.__connect(puObjIN, thisPUObj) | |
1032 |
|
1049 | |||
|
1050 | def __handleError(self, procUnitConfObj): | |||
|
1051 | ||||
|
1052 | import socket | |||
|
1053 | ||||
|
1054 | err = traceback.format_exception(sys.exc_info()[0], | |||
|
1055 | sys.exc_info()[1], | |||
|
1056 | sys.exc_info()[2]) | |||
|
1057 | ||||
|
1058 | subject = "SChain v%s: Error running %s\n" %(schainpy.__version__, procUnitConfObj.name) | |||
|
1059 | ||||
|
1060 | subtitle = "%s: %s\n" %(procUnitConfObj.getElementName() ,procUnitConfObj.name) | |||
|
1061 | subtitle += "Hostname: %s\n" %socket.gethostbyname(socket.gethostname()) | |||
|
1062 | subtitle += "Working directory: %s\n" %os.path.abspath("./") | |||
|
1063 | subtitle += "Configuration file: %s\n" %self.filename | |||
|
1064 | subtitle += "Time: %s\n" %str(datetime.datetime.now()) | |||
|
1065 | ||||
|
1066 | readUnitConfObj = self.getReadUnitObj() | |||
|
1067 | if readUnitConfObj: | |||
|
1068 | subtitle += "\nInput parameters:\n" | |||
|
1069 | subtitle += "[Data path = %s]\n" %readUnitConfObj.path | |||
|
1070 | subtitle += "[Data type = %s]\n" %readUnitConfObj.datatype | |||
|
1071 | subtitle += "[Start date = %s]\n" %readUnitConfObj.startDate | |||
|
1072 | subtitle += "[End date = %s]\n" %readUnitConfObj.endDate | |||
|
1073 | subtitle += "[Start time = %s]\n" %readUnitConfObj.startTime | |||
|
1074 | subtitle += "[End time = %s]\n" %readUnitConfObj.endTime | |||
|
1075 | ||||
|
1076 | message = "".join(err) | |||
|
1077 | ||||
|
1078 | sys.stderr.write(message) | |||
|
1079 | ||||
|
1080 | adminObj = schainpy.admin.SchainNotify() | |||
|
1081 | adminObj.sendAlert(message=message, | |||
|
1082 | subject=subject, | |||
|
1083 | subtitle=subtitle, | |||
|
1084 | filename=self.filename) | |||
|
1085 | ||||
1033 | def isPaused(self): |
|
1086 | def isPaused(self): | |
1034 | return 0 |
|
1087 | return 0 | |
1035 |
|
1088 | |||
1036 | def isStopped(self): |
|
1089 | def isStopped(self): | |
1037 | return 0 |
|
1090 | return 0 | |
1038 |
|
1091 | |||
1039 | def runController(self): |
|
1092 | def runController(self): | |
1040 | """ |
|
1093 | """ | |
1041 | returns 0 when this process has been stopped, 1 otherwise |
|
1094 | returns 0 when this process has been stopped, 1 otherwise | |
1042 | """ |
|
1095 | """ | |
1043 |
|
1096 | |||
1044 | if self.isPaused(): |
|
1097 | if self.isPaused(): | |
1045 | print "Process suspended" |
|
1098 | print "Process suspended" | |
1046 |
|
1099 | |||
1047 | while True: |
|
1100 | while True: | |
1048 | sleep(0.1) |
|
1101 | sleep(0.1) | |
1049 |
|
1102 | |||
1050 | if not self.isPaused(): |
|
1103 | if not self.isPaused(): | |
1051 | break |
|
1104 | break | |
1052 |
|
1105 | |||
1053 | if self.isStopped(): |
|
1106 | if self.isStopped(): | |
1054 | break |
|
1107 | break | |
1055 |
|
1108 | |||
1056 | print "Process reinitialized" |
|
1109 | print "Process reinitialized" | |
1057 |
|
1110 | |||
1058 | if self.isStopped(): |
|
1111 | if self.isStopped(): | |
1059 | print "Process stopped" |
|
1112 | print "Process stopped" | |
1060 | return 0 |
|
1113 | return 0 | |
1061 |
|
1114 | |||
1062 | return 1 |
|
1115 | return 1 | |
1063 |
|
1116 | |||
1064 | def run(self): |
|
1117 | def run(self): | |
1065 |
|
1118 | |||
1066 |
|
1119 | |||
1067 | print "*"*60 |
|
1120 | print "*"*60 | |
1068 | print " Starting SIGNAL CHAIN PROCESSING v%s " %schainpy.__version__ |
|
1121 | print " Starting SIGNAL CHAIN PROCESSING v%s " %schainpy.__version__ | |
1069 | print "*"*60 |
|
1122 | print "*"*60 | |
1070 |
|
1123 | |||
1071 |
|
1124 | |||
1072 | keyList = self.procUnitConfObjDict.keys() |
|
1125 | keyList = self.procUnitConfObjDict.keys() | |
1073 | keyList.sort() |
|
1126 | keyList.sort() | |
1074 |
|
1127 | |||
1075 | while(True): |
|
1128 | while(True): | |
1076 |
|
1129 | |||
1077 | is_ok = False |
|
1130 | is_ok = False | |
1078 |
|
1131 | |||
1079 | for procKey in keyList: |
|
1132 | for procKey in keyList: | |
1080 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
1133 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) | |
1081 |
|
1134 | |||
1082 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1135 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1083 |
|
1136 | |||
1084 | try: |
|
1137 | try: | |
1085 | sts = procUnitConfObj.run() |
|
1138 | sts = procUnitConfObj.run() | |
1086 | is_ok = is_ok or sts |
|
1139 | is_ok = is_ok or sts | |
|
1140 | except ValueError, e: | |||
|
1141 | print "***** Error occurred in %s *****" %(procUnitConfObj.name) | |||
|
1142 | sleep(0.5) | |||
|
1143 | print e | |||
|
1144 | is_ok = False | |||
|
1145 | break | |||
1087 | except: |
|
1146 | except: | |
1088 | print "***** Error occurred in %s *****" %(procUnitConfObj.name) |
|
1147 | print "***** Error occurred in %s *****" %(procUnitConfObj.name) | |
1089 |
|
||||
1090 | sleep(0.5) |
|
1148 | sleep(0.5) | |
1091 |
|
1149 | self.__handleError(procUnitConfObj) | ||
1092 | err = traceback.format_exception(sys.exc_info()[0], |
|
|||
1093 | sys.exc_info()[1], |
|
|||
1094 | sys.exc_info()[2]) |
|
|||
1095 |
|
||||
1096 | import socket |
|
|||
1097 |
|
||||
1098 | subject = "SChain v%s: Error running %s\n" %(schainpy.__version__, procUnitConfObj.name) |
|
|||
1099 |
|
||||
1100 | subtitle = "%s: %s\n" %(procUnitConfObj.getElementName() ,procUnitConfObj.name) |
|
|||
1101 | subtitle += "Hostname: %s\n" %socket.gethostbyname(socket.gethostname()) |
|
|||
1102 | subtitle += "Working directory: %s\n" %os.path.abspath("./") |
|
|||
1103 | subtitle += "Configuration file: %s\n" %self.filename |
|
|||
1104 |
|
||||
1105 | readUnitConfObj = self.getReadUnitObj() |
|
|||
1106 | if readUnitConfObj: |
|
|||
1107 | subtitle += "Data path: %s\n" %readUnitConfObj.path |
|
|||
1108 | subtitle += "Data type: %s\n" %readUnitConfObj.datatype |
|
|||
1109 | subtitle += "Start date: %s\n" %readUnitConfObj.startDate |
|
|||
1110 | subtitle += "End date: %s\n" %readUnitConfObj.endDate |
|
|||
1111 | subtitle += "Start time: %s\n" %readUnitConfObj.startTime |
|
|||
1112 | subtitle += "End time: %s\n" %readUnitConfObj.endTime |
|
|||
1113 |
|
||||
1114 | message = "".join(err) |
|
|||
1115 |
|
||||
1116 | sys.stderr.write(message) |
|
|||
1117 |
|
||||
1118 | adminObj = schainpy.admin.SchainNotify() |
|
|||
1119 | adminObj.sendAlert(message=message, |
|
|||
1120 | subject=subject, |
|
|||
1121 | subtitle=subtitle, |
|
|||
1122 | filename=self.filename) |
|
|||
1123 |
|
||||
1124 | is_ok = False |
|
1150 | is_ok = False | |
1125 |
|
||||
1126 | break |
|
1151 | break | |
1127 |
|
1152 | |||
1128 | #If every process unit finished so end process |
|
1153 | #If every process unit finished so end process | |
1129 | if not(is_ok): |
|
1154 | if not(is_ok): | |
1130 | print "Every process unit have finished" |
|
1155 | print "Every process unit have finished" | |
1131 | break |
|
1156 | break | |
1132 |
|
1157 | |||
1133 | if not self.runController(): |
|
1158 | if not self.runController(): | |
1134 | break |
|
1159 | break | |
1135 |
|
1160 | |||
1136 | #Closing every process |
|
1161 | #Closing every process | |
1137 | for procKey in keyList: |
|
1162 | for procKey in keyList: | |
1138 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1163 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1139 | procUnitConfObj.close() |
|
1164 | procUnitConfObj.close() | |
1140 |
|
1165 | |||
1141 | print "Process finished" |
|
1166 | print "Process finished" | |
1142 |
|
1167 | |||
1143 | def start(self, filename): |
|
1168 | def start(self, filename): | |
1144 |
|
1169 | |||
1145 | self.writeXml(filename) |
|
1170 | if not self.writeXml(filename): | |
1146 | self.readXml(filename) |
|
1171 | return | |
|
1172 | ||||
|
1173 | if not self.readXml(filename): | |||
|
1174 | return | |||
1147 |
|
1175 | |||
1148 | self.createObjects() |
|
1176 | self.createObjects() | |
1149 | self.connectObjects() |
|
1177 | self.connectObjects() | |
1150 | self.run() |
|
1178 | self.run() | |
1151 |
|
1179 | |||
1152 | if __name__ == '__main__': |
|
1180 | if __name__ == '__main__': | |
1153 |
|
1181 | |||
1154 | desc = "Segundo Test" |
|
1182 | desc = "Segundo Test" | |
1155 | filename = "schain.xml" |
|
1183 | filename = "schain.xml" | |
1156 |
|
1184 | |||
1157 | controllerObj = Project() |
|
1185 | controllerObj = Project() | |
1158 |
|
1186 | |||
1159 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
1187 | controllerObj.setup(id = '191', name='test01', description=desc) | |
1160 |
|
1188 | |||
1161 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
1189 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
1162 | path='data/rawdata/', |
|
1190 | path='data/rawdata/', | |
1163 | startDate='2011/01/01', |
|
1191 | startDate='2011/01/01', | |
1164 | endDate='2012/12/31', |
|
1192 | endDate='2012/12/31', | |
1165 | startTime='00:00:00', |
|
1193 | startTime='00:00:00', | |
1166 | endTime='23:59:59', |
|
1194 | endTime='23:59:59', | |
1167 | online=1, |
|
1195 | online=1, | |
1168 | walk=1) |
|
1196 | walk=1) | |
1169 |
|
1197 | |||
1170 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
1198 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
1171 |
|
1199 | |||
1172 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
1200 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') | |
1173 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
1201 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') | |
1174 |
|
1202 | |||
1175 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
1203 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') | |
1176 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
1204 | opObj10.addParameter(name='minHei', value='90', format='float') | |
1177 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
1205 | opObj10.addParameter(name='maxHei', value='180', format='float') | |
1178 |
|
1206 | |||
1179 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
1207 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |
1180 | opObj12.addParameter(name='n', value='10', format='int') |
|
1208 | opObj12.addParameter(name='n', value='10', format='int') | |
1181 |
|
1209 | |||
1182 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
1210 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
1183 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
1211 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') | |
1184 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
1212 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') | |
1185 |
|
1213 | |||
1186 |
|
1214 | |||
1187 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1215 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1188 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
1216 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
1189 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
1217 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
1190 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
1218 | opObj11.addParameter(name='zmin', value='40', format='int') | |
1191 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
1219 | opObj11.addParameter(name='zmax', value='90', format='int') | |
1192 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1220 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
1193 |
|
1221 | |||
1194 | print "Escribiendo el archivo XML" |
|
1222 | print "Escribiendo el archivo XML" | |
1195 |
|
1223 | |||
1196 | controllerObj.writeXml(filename) |
|
1224 | controllerObj.writeXml(filename) | |
1197 |
|
1225 | |||
1198 | print "Leyendo el archivo XML" |
|
1226 | print "Leyendo el archivo XML" | |
1199 | controllerObj.readXml(filename) |
|
1227 | controllerObj.readXml(filename) | |
1200 | #controllerObj.printattr() |
|
1228 | #controllerObj.printattr() | |
1201 |
|
1229 | |||
1202 | controllerObj.createObjects() |
|
1230 | controllerObj.createObjects() | |
1203 | controllerObj.connectObjects() |
|
1231 | controllerObj.connectObjects() | |
1204 | controllerObj.run() |
|
1232 | controllerObj.run() | |
1205 |
|
1233 | |||
1206 | No newline at end of file |
|
1234 |
@@ -1,5899 +1,5859 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | Module implementing MainWindow. |
|
3 | Module implementing MainWindow. | |
4 | #+++++++++++++GUI V1++++++++++++++# |
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± |
|
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± | |
6 | """ |
|
6 | """ | |
7 | import os, sys, time |
|
7 | import os, sys, time | |
8 | import datetime |
|
8 | import datetime | |
9 | import numpy |
|
9 | import numpy | |
10 | import Queue |
|
10 | import Queue | |
11 |
|
11 | |||
12 | from collections import OrderedDict |
|
12 | from collections import OrderedDict | |
13 | from os.path import expanduser |
|
13 | from os.path import expanduser | |
14 | from time import sleep |
|
14 | from time import sleep | |
15 | # from gevent import sleep |
|
15 | # from gevent import sleep | |
16 |
|
16 | |||
17 | import ast |
|
17 | import ast | |
18 |
|
18 | |||
19 | from PyQt4.QtGui import QMainWindow |
|
19 | from PyQt4.QtGui import QMainWindow | |
20 | from PyQt4.QtCore import pyqtSignature |
|
20 | from PyQt4.QtCore import pyqtSignature | |
21 | from PyQt4.QtCore import pyqtSignal |
|
21 | from PyQt4.QtCore import pyqtSignal | |
22 | from PyQt4 import QtCore |
|
22 | from PyQt4 import QtCore | |
23 | from PyQt4 import QtGui |
|
23 | from PyQt4 import QtGui | |
24 | # from PyQt4.QtCore import QThread |
|
24 | # from PyQt4.QtCore import QThread | |
25 | # from PyQt4.QtCore import QObject, SIGNAL |
|
25 | # from PyQt4.QtCore import QObject, SIGNAL | |
26 |
|
26 | |||
27 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
27 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess | |
28 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
28 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp | |
29 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
29 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow | |
30 | from schainpy.controller_api import ControllerThread |
|
30 | from schainpy.controller_api import ControllerThread | |
31 | from schainpy.controller import Project |
|
31 | from schainpy.controller import Project | |
32 |
|
32 | |||
33 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
33 | from propertiesViewModel import TreeModel, PropertyBuffer | |
34 | from parametersModel import ProjectParms |
|
34 | from parametersModel import ProjectParms | |
35 |
|
35 | |||
36 | from schainpy.gui.figures import tools |
|
36 | from schainpy.gui.figures import tools | |
37 |
|
37 | |||
38 | FIGURES_PATH = tools.get_path() |
|
38 | FIGURES_PATH = tools.get_path() | |
39 | TEMPORAL_FILE = ".temp.xml" |
|
39 | TEMPORAL_FILE = ".temp.xml" | |
40 |
|
40 | |||
41 | def isRadarFile(file): |
|
41 | def isRadarFile(file): | |
42 | try: |
|
42 | try: | |
43 | year = int(file[1:5]) |
|
43 | year = int(file[1:5]) | |
44 | doy = int(file[5:8]) |
|
44 | doy = int(file[5:8]) | |
45 | set = int(file[8:11]) |
|
45 | set = int(file[8:11]) | |
46 | except: |
|
46 | except: | |
47 | return 0 |
|
47 | return 0 | |
48 |
|
48 | |||
49 | return 1 |
|
49 | return 1 | |
50 |
|
50 | |||
51 | def isRadarPath(path): |
|
51 | def isRadarPath(path): | |
52 | try: |
|
52 | try: | |
53 | year = int(path[1:5]) |
|
53 | year = int(path[1:5]) | |
54 | doy = int(path[5:8]) |
|
54 | doy = int(path[5:8]) | |
55 | except: |
|
55 | except: | |
56 | return 0 |
|
56 | return 0 | |
57 |
|
57 | |||
58 | return 1 |
|
58 | return 1 | |
59 |
|
59 | |||
60 | def isInt(value): |
|
60 | def isInt(value): | |
61 |
|
61 | |||
62 | try: |
|
62 | try: | |
63 | int(value) |
|
63 | int(value) | |
64 | except: |
|
64 | except: | |
65 | return 0 |
|
65 | return 0 | |
66 |
|
66 | |||
67 | return 1 |
|
67 | return 1 | |
68 |
|
68 | |||
69 | def isFloat(value): |
|
69 | def isFloat(value): | |
70 |
|
70 | |||
71 | try: |
|
71 | try: | |
72 | float(value) |
|
72 | float(value) | |
73 | except: |
|
73 | except: | |
74 | return 0 |
|
74 | return 0 | |
75 |
|
75 | |||
76 | return 1 |
|
76 | return 1 | |
77 |
|
77 | |||
78 | def isList(value): |
|
78 | def isList(value): | |
79 |
|
79 | |||
80 | x = ast.literal_eval(value) |
|
80 | x = ast.literal_eval(value) | |
81 |
|
81 | |||
82 | if type(x) in (tuple, list): |
|
82 | if type(x) in (tuple, list): | |
83 | return 1 |
|
83 | return 1 | |
84 |
|
84 | |||
85 | return 0 |
|
85 | return 0 | |
86 |
|
86 | |||
87 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
87 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
88 | """ |
|
88 | """ | |
89 | """ |
|
89 | """ | |
90 | def __init__(self, parent=None): |
|
90 | def __init__(self, parent=None): | |
91 | """ |
|
91 | """ | |
92 |
|
92 | |||
93 | """ |
|
93 | """ | |
94 | QMainWindow.__init__(self, parent) |
|
94 | QMainWindow.__init__(self, parent) | |
95 | self.setupUi(self) |
|
95 | self.setupUi(self) | |
96 | self.__puObjDict = {} |
|
96 | self.__puObjDict = {} | |
97 | self.__itemTreeDict = {} |
|
97 | self.__itemTreeDict = {} | |
98 | self.readUnitConfObjList = [] |
|
98 | self.readUnitConfObjList = [] | |
99 | self.operObjList = [] |
|
99 | self.operObjList = [] | |
100 | self.projecObjView = None |
|
100 | self.projecObjView = None | |
101 | self.idProject = 0 |
|
101 | self.idProject = 0 | |
102 | # self.idImag = 0 |
|
102 | # self.idImag = 0 | |
103 |
|
103 | |||
104 | self.idImagscope = 0 |
|
104 | self.idImagscope = 0 | |
105 | self.idImagspectra = 0 |
|
105 | self.idImagspectra = 0 | |
106 | self.idImagcross = 0 |
|
106 | self.idImagcross = 0 | |
107 | self.idImagrti = 0 |
|
107 | self.idImagrti = 0 | |
108 | self.idImagcoherence = 0 |
|
108 | self.idImagcoherence = 0 | |
109 | self.idImagpower = 0 |
|
109 | self.idImagpower = 0 | |
110 | self.idImagrtinoise = 0 |
|
110 | self.idImagrtinoise = 0 | |
111 | self.idImagspectraHeis = 0 |
|
111 | self.idImagspectraHeis = 0 | |
112 | self.idImagrtiHeis = 0 |
|
112 | self.idImagrtiHeis = 0 | |
113 |
|
113 | |||
114 | self.dataPath = None |
|
114 | self.dataPath = None | |
115 | self.online = 0 |
|
115 | self.online = 0 | |
116 | self.walk = 0 |
|
116 | self.walk = 0 | |
117 | self.create = False |
|
117 | self.create = False | |
118 | self.selectedItemTree = None |
|
118 | self.selectedItemTree = None | |
119 | self.controllerThread = None |
|
119 | self.controllerThread = None | |
120 | # self.commCtrlPThread = None |
|
120 | # self.commCtrlPThread = None | |
121 | # self.create_figure() |
|
121 | # self.create_figure() | |
122 | self.temporalFTP = ftpBuffer() |
|
122 | self.temporalFTP = ftpBuffer() | |
123 | self.projectProperCaracteristica = [] |
|
123 | self.projectProperCaracteristica = [] | |
124 | self.projectProperPrincipal = [] |
|
124 | self.projectProperPrincipal = [] | |
125 | self.projectProperDescripcion = [] |
|
125 | self.projectProperDescripcion = [] | |
126 | self.volProperCaracteristica = [] |
|
126 | self.volProperCaracteristica = [] | |
127 | self.volProperPrincipal = [] |
|
127 | self.volProperPrincipal = [] | |
128 | self.volProperDescripcion = [] |
|
128 | self.volProperDescripcion = [] | |
129 | self.specProperCaracteristica = [] |
|
129 | self.specProperCaracteristica = [] | |
130 | self.specProperPrincipal = [] |
|
130 | self.specProperPrincipal = [] | |
131 | self.specProperDescripcion = [] |
|
131 | self.specProperDescripcion = [] | |
132 |
|
132 | |||
133 | self.specHeisProperCaracteristica = [] |
|
133 | self.specHeisProperCaracteristica = [] | |
134 | self.specHeisProperPrincipal = [] |
|
134 | self.specHeisProperPrincipal = [] | |
135 | self.specHeisProperDescripcion = [] |
|
135 | self.specHeisProperDescripcion = [] | |
136 |
|
136 | |||
137 | # self.pathWorkSpace = './' |
|
137 | # self.pathWorkSpace = './' | |
138 |
|
138 | |||
139 | self.__projectObjDict = {} |
|
139 | self.__projectObjDict = {} | |
140 | self.__operationObjDict = {} |
|
140 | self.__operationObjDict = {} | |
141 |
|
141 | |||
142 | self.__puLocalFolder2FTP = {} |
|
142 | self.__puLocalFolder2FTP = {} | |
143 | self.threadStarted = False |
|
143 | self.threadStarted = False | |
144 |
|
144 | |||
145 | # self.create_comm() |
|
145 | # self.create_comm() | |
146 | self.create_updating_timer() |
|
146 | self.create_updating_timer() | |
147 | self.setGUIStatus() |
|
147 | self.setGUIStatus() | |
148 |
|
148 | |||
149 | @pyqtSignature("") |
|
149 | @pyqtSignature("") | |
150 | def on_actionOpen_triggered(self): |
|
150 | def on_actionOpen_triggered(self): | |
151 | """ |
|
151 | """ | |
152 | Slot documentation goes here. |
|
152 | Slot documentation goes here. | |
153 | """ |
|
153 | """ | |
154 | self.openProject() |
|
154 | self.openProject() | |
155 |
|
155 | |||
156 | @pyqtSignature("") |
|
156 | @pyqtSignature("") | |
157 | def on_actionCreate_triggered(self): |
|
157 | def on_actionCreate_triggered(self): | |
158 | """ |
|
158 | """ | |
159 | Slot documentation goes here. |
|
159 | Slot documentation goes here. | |
160 | """ |
|
160 | """ | |
161 | self.setInputsProject_View() |
|
161 | self.setInputsProject_View() | |
162 | self.create = True |
|
162 | self.create = True | |
163 |
|
163 | |||
164 | @pyqtSignature("") |
|
164 | @pyqtSignature("") | |
165 | def on_actionSave_triggered(self): |
|
165 | def on_actionSave_triggered(self): | |
166 | """ |
|
166 | """ | |
167 | Slot documentation goes here. |
|
167 | Slot documentation goes here. | |
168 | """ |
|
168 | """ | |
169 | self.saveProject() |
|
169 | self.saveProject() | |
170 |
|
170 | |||
171 | @pyqtSignature("") |
|
171 | @pyqtSignature("") | |
172 | def on_actionClose_triggered(self): |
|
172 | def on_actionClose_triggered(self): | |
173 | """ |
|
173 | """ | |
174 | Slot documentation goes here. |
|
174 | Slot documentation goes here. | |
175 | """ |
|
175 | """ | |
176 | self.close() |
|
176 | self.close() | |
177 |
|
177 | |||
178 | @pyqtSignature("") |
|
178 | @pyqtSignature("") | |
179 | def on_actionStart_triggered(self): |
|
179 | def on_actionStart_triggered(self): | |
180 | """ |
|
180 | """ | |
181 | """ |
|
181 | """ | |
182 | self.playProject() |
|
182 | self.playProject() | |
183 |
|
183 | |||
184 | @pyqtSignature("") |
|
184 | @pyqtSignature("") | |
185 | def on_actionPause_triggered(self): |
|
185 | def on_actionPause_triggered(self): | |
186 | """ |
|
186 | """ | |
187 | """ |
|
187 | """ | |
188 | self.pauseProject() |
|
188 | self.pauseProject() | |
189 |
|
189 | |||
190 | @pyqtSignature("") |
|
190 | @pyqtSignature("") | |
191 | def on_actionStop_triggered(self): |
|
191 | def on_actionStop_triggered(self): | |
192 | """ |
|
192 | """ | |
193 | """ |
|
193 | """ | |
194 | self.stopProject() |
|
194 | self.stopProject() | |
195 |
|
195 | |||
196 | @pyqtSignature("") |
|
196 | @pyqtSignature("") | |
197 | def on_actionAbout_triggered(self): |
|
197 | def on_actionAbout_triggered(self): | |
198 | """ |
|
198 | """ | |
199 | """ |
|
199 | """ | |
200 | self.aboutEvent() |
|
200 | self.aboutEvent() | |
201 |
|
201 | |||
202 | @pyqtSignature("") |
|
202 | @pyqtSignature("") | |
203 | def on_actionFTP_triggered(self): |
|
203 | def on_actionFTP_triggered(self): | |
204 | """ |
|
204 | """ | |
205 | """ |
|
205 | """ | |
206 | self.configFTPWindowObj = Ftp(self) |
|
206 | self.configFTPWindowObj = Ftp(self) | |
207 |
|
207 | |||
208 | if not self.temporalFTP.create: |
|
208 | if not self.temporalFTP.create: | |
209 | self.temporalFTP.setwithoutconfiguration() |
|
209 | self.temporalFTP.setwithoutconfiguration() | |
210 |
|
210 | |||
211 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, |
|
211 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |
212 | self.temporalFTP.remotefolder, |
|
212 | self.temporalFTP.remotefolder, | |
213 | self.temporalFTP.username, |
|
213 | self.temporalFTP.username, | |
214 | self.temporalFTP.password, |
|
214 | self.temporalFTP.password, | |
215 | self.temporalFTP.ftp_wei, |
|
215 | self.temporalFTP.ftp_wei, | |
216 | self.temporalFTP.exp_code, |
|
216 | self.temporalFTP.exp_code, | |
217 | self.temporalFTP.sub_exp_code, |
|
217 | self.temporalFTP.sub_exp_code, | |
218 | self.temporalFTP.plot_pos) |
|
218 | self.temporalFTP.plot_pos) | |
219 |
|
219 | |||
220 | self.configFTPWindowObj.show() |
|
220 | self.configFTPWindowObj.show() | |
221 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
221 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
222 |
|
222 | |||
223 | def createFTPConfig(self): |
|
223 | def createFTPConfig(self): | |
224 |
|
224 | |||
225 | if not self.configFTPWindowObj.create: |
|
225 | if not self.configFTPWindowObj.create: | |
226 | self.console.clear() |
|
226 | self.console.clear() | |
227 | self.console.append("There is no FTP configuration") |
|
227 | self.console.append("There is no FTP configuration") | |
228 | return |
|
228 | return | |
229 |
|
229 | |||
230 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
230 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
231 |
|
231 | |||
232 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
232 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
233 | self.temporalFTP.save(server=server, |
|
233 | self.temporalFTP.save(server=server, | |
234 | remotefolder=remotefolder, |
|
234 | remotefolder=remotefolder, | |
235 | username=username, |
|
235 | username=username, | |
236 | password=password, |
|
236 | password=password, | |
237 | ftp_wei=ftp_wei, |
|
237 | ftp_wei=ftp_wei, | |
238 | exp_code=exp_code, |
|
238 | exp_code=exp_code, | |
239 | sub_exp_code=sub_exp_code, |
|
239 | sub_exp_code=sub_exp_code, | |
240 | plot_pos=plot_pos) |
|
240 | plot_pos=plot_pos) | |
241 |
|
241 | |||
242 | @pyqtSignature("") |
|
242 | @pyqtSignature("") | |
243 | def on_actionOpenToolbar_triggered(self): |
|
243 | def on_actionOpenToolbar_triggered(self): | |
244 | """ |
|
244 | """ | |
245 | Slot documentation goes here. |
|
245 | Slot documentation goes here. | |
246 | """ |
|
246 | """ | |
247 | self.openProject() |
|
247 | self.openProject() | |
248 |
|
248 | |||
249 | @pyqtSignature("") |
|
249 | @pyqtSignature("") | |
250 | def on_actionCreateToolbar_triggered(self): |
|
250 | def on_actionCreateToolbar_triggered(self): | |
251 | """ |
|
251 | """ | |
252 | Slot documentation goes here. |
|
252 | Slot documentation goes here. | |
253 | """ |
|
253 | """ | |
254 | self.setInputsProject_View() |
|
254 | self.setInputsProject_View() | |
255 | self.create = True |
|
255 | self.create = True | |
256 |
|
256 | |||
257 | @pyqtSignature("") |
|
257 | @pyqtSignature("") | |
258 | def on_actionAddPU_triggered(self): |
|
258 | def on_actionAddPU_triggered(self): | |
259 |
|
259 | |||
260 | if len(self.__projectObjDict) == 0: |
|
260 | if len(self.__projectObjDict) == 0: | |
261 | outputstr = "First create a Project before add any Processing Unit" |
|
261 | outputstr = "First create a Project before add any Processing Unit" | |
262 | self.console.clear() |
|
262 | self.console.clear() | |
263 | self.console.append(outputstr) |
|
263 | self.console.append(outputstr) | |
264 | return |
|
264 | return | |
265 | else: |
|
265 | else: | |
266 | self.addPUWindow() |
|
266 | self.addPUWindow() | |
267 | self.console.clear() |
|
267 | self.console.clear() | |
268 | self.console.append("Please, Choose the type of Processing Unit") |
|
268 | 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") |
|
269 | # 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") |
|
270 | # 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") |
|
271 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
272 |
|
272 | |||
273 |
|
273 | |||
274 | @pyqtSignature("") |
|
274 | @pyqtSignature("") | |
275 | def on_actionSaveToolbar_triggered(self): |
|
275 | def on_actionSaveToolbar_triggered(self): | |
276 | """ |
|
276 | """ | |
277 | Slot documentation goes here. |
|
277 | Slot documentation goes here. | |
278 | """ |
|
278 | """ | |
279 | self.saveProject() |
|
279 | self.saveProject() | |
280 |
|
280 | |||
281 | @pyqtSignature("") |
|
281 | @pyqtSignature("") | |
282 | def on_actionStarToolbar_triggered(self): |
|
282 | def on_actionStarToolbar_triggered(self): | |
283 | """ |
|
283 | """ | |
284 | Slot documentation goes here. |
|
284 | Slot documentation goes here. | |
285 | """ |
|
285 | """ | |
286 | self.playProject() |
|
286 | self.playProject() | |
287 |
|
287 | |||
288 | @pyqtSignature("") |
|
288 | @pyqtSignature("") | |
289 | def on_actionPauseToolbar_triggered(self): |
|
289 | def on_actionPauseToolbar_triggered(self): | |
290 |
|
290 | |||
291 | self.pauseProject() |
|
291 | self.pauseProject() | |
292 |
|
292 | |||
293 | @pyqtSignature("") |
|
293 | @pyqtSignature("") | |
294 | def on_actionStopToolbar_triggered(self): |
|
294 | def on_actionStopToolbar_triggered(self): | |
295 | """ |
|
295 | """ | |
296 | Slot documentation goes here. |
|
296 | Slot documentation goes here. | |
297 | """ |
|
297 | """ | |
298 | self.stopProject() |
|
298 | self.stopProject() | |
299 |
|
299 | |||
300 | @pyqtSignature("int") |
|
300 | @pyqtSignature("int") | |
301 | def on_proComReadMode_activated(self, index): |
|
301 | def on_proComReadMode_activated(self, index): | |
302 | """ |
|
302 | """ | |
303 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
303 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
304 | """ |
|
304 | """ | |
305 | if index == 0: |
|
305 | if index == 0: | |
306 | self.online = 0 |
|
306 | self.online = 0 | |
307 | self.proDelay.setText("0") |
|
307 | self.proDelay.setText("0") | |
308 | self.proSet.setText("") |
|
308 | self.proSet.setText("") | |
309 | self.proSet.setEnabled(False) |
|
309 | self.proSet.setEnabled(False) | |
310 | self.proDelay.setEnabled(False) |
|
310 | self.proDelay.setEnabled(False) | |
311 | elif index == 1: |
|
311 | elif index == 1: | |
312 | self.online = 1 |
|
312 | self.online = 1 | |
313 | self.proSet.setText("") |
|
313 | self.proSet.setText("") | |
314 | self.proDelay.setText("5") |
|
314 | self.proDelay.setText("5") | |
315 | self.proSet.setEnabled(True) |
|
315 | self.proSet.setEnabled(True) | |
316 | self.proDelay.setEnabled(True) |
|
316 | self.proDelay.setEnabled(True) | |
317 |
|
317 | |||
318 | @pyqtSignature("int") |
|
318 | @pyqtSignature("int") | |
319 | def on_proComDataType_activated(self, index): |
|
319 | def on_proComDataType_activated(self, index): | |
320 | """ |
|
320 | """ | |
321 | Voltage or Spectra |
|
321 | Voltage or Spectra | |
322 | """ |
|
322 | """ | |
323 | self.labelSet.show() |
|
323 | self.labelSet.show() | |
324 | self.proSet.show() |
|
324 | self.proSet.show() | |
325 |
|
325 | |||
326 | self.labExpLabel.show() |
|
326 | self.labExpLabel.show() | |
327 | self.proExpLabel.show() |
|
327 | self.proExpLabel.show() | |
328 |
|
328 | |||
329 | self.labelIPPKm.hide() |
|
329 | self.labelIPPKm.hide() | |
330 | self.proIPPKm.hide() |
|
330 | self.proIPPKm.hide() | |
331 |
|
331 | |||
332 | if index == 0: |
|
332 | if index == 0: | |
333 | extension = '.r' |
|
333 | extension = '.r' | |
334 | elif index == 1: |
|
334 | elif index == 1: | |
335 | extension = '.pdata' |
|
335 | extension = '.pdata' | |
336 | elif index == 2: |
|
336 | elif index == 2: | |
337 | extension = '.fits' |
|
337 | extension = '.fits' | |
338 | elif index == 3: |
|
338 | elif index == 3: | |
339 | extension = '.hdf5' |
|
339 | extension = '.hdf5' | |
340 |
|
340 | |||
341 | self.labelIPPKm.show() |
|
341 | self.labelIPPKm.show() | |
342 | self.proIPPKm.show() |
|
342 | self.proIPPKm.show() | |
343 |
|
343 | |||
344 | self.labelSet.hide() |
|
344 | self.labelSet.hide() | |
345 | self.proSet.hide() |
|
345 | self.proSet.hide() | |
346 |
|
346 | |||
347 | self.labExpLabel.hide() |
|
347 | self.labExpLabel.hide() | |
348 | self.proExpLabel.hide() |
|
348 | self.proExpLabel.hide() | |
349 |
|
349 | |||
350 | self.proDataType.setText(extension) |
|
350 | self.proDataType.setText(extension) | |
351 |
|
351 | |||
352 | @pyqtSignature("int") |
|
352 | @pyqtSignature("int") | |
353 | def on_proComWalk_activated(self, index): |
|
353 | def on_proComWalk_activated(self, index): | |
354 | """ |
|
354 | """ | |
355 |
|
355 | |||
356 | """ |
|
356 | """ | |
357 | if index == 0: |
|
357 | if index == 0: | |
358 | self.walk = 0 |
|
358 | self.walk = 0 | |
359 | elif index == 1: |
|
359 | elif index == 1: | |
360 | self.walk = 1 |
|
360 | self.walk = 1 | |
361 |
|
361 | |||
362 | @pyqtSignature("") |
|
362 | @pyqtSignature("") | |
363 | def on_proToolPath_clicked(self): |
|
363 | def on_proToolPath_clicked(self): | |
364 | """ |
|
364 | """ | |
365 | Choose your path |
|
365 | Choose your path | |
366 | """ |
|
366 | """ | |
367 |
|
367 | |||
368 | current_dpath = './' |
|
368 | current_dpath = './' | |
369 | if self.dataPath: |
|
369 | if self.dataPath: | |
370 | current_dpath = self.dataPath |
|
370 | current_dpath = self.dataPath | |
371 |
|
371 | |||
372 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
372 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
373 |
|
373 | |||
374 | #If it was canceled |
|
374 | #If it was canceled | |
375 | if not datapath: |
|
375 | if not datapath: | |
376 | return |
|
376 | return | |
377 |
|
377 | |||
378 | #If any change was done |
|
378 | #If any change was done | |
379 | if datapath == self.dataPath: |
|
379 | if datapath == self.dataPath: | |
380 | return |
|
380 | return | |
381 |
|
381 | |||
382 | self.proDataPath.setText(datapath) |
|
382 | self.proDataPath.setText(datapath) | |
383 |
|
383 | |||
384 | self._disable_play_button() |
|
384 | self._disable_play_button() | |
385 | self._disable_save_button() |
|
385 | self._disable_save_button() | |
386 | self.proOk.setEnabled(False) |
|
386 | self.proOk.setEnabled(False) | |
387 |
|
387 | |||
388 | self.proComStartDate.clear() |
|
388 | self.proComStartDate.clear() | |
389 | self.proComEndDate.clear() |
|
389 | self.proComEndDate.clear() | |
390 |
|
390 | |||
391 | if not os.path.exists(datapath): |
|
391 | if not os.path.exists(datapath): | |
392 |
|
392 | |||
393 | self.console.clear() |
|
393 | self.console.clear() | |
394 | self.console.append("Write a valid path") |
|
394 | self.console.append("Write a valid path") | |
395 | return |
|
395 | return | |
396 |
|
396 | |||
397 | self.dataPath = datapath |
|
397 | self.dataPath = datapath | |
398 |
|
398 | |||
399 | self.console.clear() |
|
399 | self.console.clear() | |
400 | self.console.append("Select the read mode and press 'load button'") |
|
400 | self.console.append("Select the read mode and press 'load button'") | |
401 |
|
401 | |||
402 |
|
402 | |||
403 | @pyqtSignature("") |
|
403 | @pyqtSignature("") | |
404 | def on_proLoadButton_clicked(self): |
|
404 | def on_proLoadButton_clicked(self): | |
405 |
|
405 | |||
406 | self.console.clear() |
|
406 | self.console.clear() | |
407 |
|
407 | |||
408 | parameter_list = self.checkInputsProject() |
|
408 | parameter_list = self.checkInputsProject() | |
409 |
|
409 | |||
410 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list |
|
410 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list | |
411 |
|
411 | |||
412 | if read_mode == "Offline": |
|
412 | if read_mode == "Offline": | |
413 | self.proComStartDate.clear() |
|
413 | self.proComStartDate.clear() | |
414 | self.proComEndDate.clear() |
|
414 | self.proComEndDate.clear() | |
415 | self.proComStartDate.setEnabled(True) |
|
415 | self.proComStartDate.setEnabled(True) | |
416 | self.proComEndDate.setEnabled(True) |
|
416 | self.proComEndDate.setEnabled(True) | |
417 | self.proStartTime.setEnabled(True) |
|
417 | self.proStartTime.setEnabled(True) | |
418 | self.proEndTime.setEnabled(True) |
|
418 | self.proEndTime.setEnabled(True) | |
419 | self.frame_2.setEnabled(True) |
|
419 | self.frame_2.setEnabled(True) | |
420 |
|
420 | |||
421 | if read_mode == "Online": |
|
421 | if read_mode == "Online": | |
422 | self.proComStartDate.addItem("1960/01/30") |
|
422 | self.proComStartDate.addItem("1960/01/30") | |
423 | self.proComEndDate.addItem("2018/12/31") |
|
423 | self.proComEndDate.addItem("2018/12/31") | |
424 | self.proComStartDate.setEnabled(False) |
|
424 | self.proComStartDate.setEnabled(False) | |
425 | self.proComEndDate.setEnabled(False) |
|
425 | self.proComEndDate.setEnabled(False) | |
426 | self.proStartTime.setEnabled(False) |
|
426 | self.proStartTime.setEnabled(False) | |
427 | self.proEndTime.setEnabled(False) |
|
427 | self.proEndTime.setEnabled(False) | |
428 | self.frame_2.setEnabled(True) |
|
428 | self.frame_2.setEnabled(True) | |
429 |
|
429 | |||
430 | if self.loadDays(data_path, ext, walk, expLabel) == []: |
|
430 | if self.loadDays(data_path, ext, walk, expLabel) == []: | |
431 | self._disable_save_button() |
|
431 | self._disable_save_button() | |
432 | self._disable_play_button() |
|
432 | self._disable_play_button() | |
433 | self.proOk.setEnabled(False) |
|
433 | self.proOk.setEnabled(False) | |
434 | else: |
|
434 | else: | |
435 | self._enable_save_button() |
|
435 | self._enable_save_button() | |
436 | self._enable_play_button() |
|
436 | self._enable_play_button() | |
437 | self.proOk.setEnabled(True) |
|
437 | self.proOk.setEnabled(True) | |
438 |
|
438 | |||
439 | @pyqtSignature("int") |
|
439 | @pyqtSignature("int") | |
440 | def on_proComStartDate_activated(self, index): |
|
440 | def on_proComStartDate_activated(self, index): | |
441 | """ |
|
441 | """ | |
442 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
442 | SELECCION DEL RANGO DE FECHAS -START DATE | |
443 | """ |
|
443 | """ | |
444 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
444 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
445 |
|
445 | |||
446 | self.proComEndDate.clear() |
|
446 | self.proComEndDate.clear() | |
447 | for i in self.dateList[index:]: |
|
447 | for i in self.dateList[index:]: | |
448 | self.proComEndDate.addItem(i) |
|
448 | self.proComEndDate.addItem(i) | |
449 |
|
449 | |||
450 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
450 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
451 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
451 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
452 | else: |
|
452 | else: | |
453 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
453 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
454 |
|
454 | |||
455 | @pyqtSignature("int") |
|
455 | @pyqtSignature("int") | |
456 | def on_proComEndDate_activated(self, index): |
|
456 | def on_proComEndDate_activated(self, index): | |
457 | """ |
|
457 | """ | |
458 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
458 | SELECCION DEL RANGO DE FECHAS-END DATE | |
459 | """ |
|
459 | """ | |
460 | pass |
|
460 | pass | |
461 |
|
461 | |||
462 | @pyqtSignature("") |
|
462 | @pyqtSignature("") | |
463 | def on_proOk_clicked(self): |
|
463 | def on_proOk_clicked(self): | |
464 | """ |
|
464 | """ | |
465 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
465 | 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 |
|
466 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
467 | """ |
|
467 | """ | |
468 |
|
468 | |||
469 | self._disable_play_button() |
|
469 | self._disable_play_button() | |
470 | self._disable_save_button() |
|
470 | self._disable_save_button() | |
471 |
|
471 | |||
472 | self.console.clear() |
|
472 | self.console.clear() | |
473 |
|
473 | |||
474 | if self.create: |
|
474 | if self.create: | |
475 |
|
475 | |||
476 | projectId = self.__getNewProjectId() |
|
476 | projectId = self.__getNewProjectId() | |
477 |
|
477 | |||
478 | if not projectId: |
|
478 | if not projectId: | |
479 | return 0 |
|
479 | return 0 | |
480 |
|
480 | |||
481 | projectObjView = self.createProjectView(projectId) |
|
481 | projectObjView = self.createProjectView(projectId) | |
482 |
|
482 | |||
483 | if not projectObjView: |
|
483 | if not projectObjView: | |
484 | return 0 |
|
484 | return 0 | |
485 |
|
485 | |||
486 | self.create = False |
|
486 | self.create = False | |
487 |
|
487 | |||
488 | readUnitObj = self.createReadUnitView(projectObjView) |
|
488 | readUnitObj = self.createReadUnitView(projectObjView) | |
489 |
|
489 | |||
490 | if not readUnitObj: |
|
490 | if not readUnitObj: | |
491 | return 0 |
|
491 | return 0 | |
492 |
|
492 | |||
493 | else: |
|
493 | else: | |
494 | projectObjView = self.updateProjectView() |
|
494 | projectObjView = self.updateProjectView() | |
495 |
|
495 | |||
496 | if not projectObjView: |
|
496 | if not projectObjView: | |
497 | return 0 |
|
497 | return 0 | |
498 |
|
498 | |||
499 | projectId = projectObjView.getId() |
|
499 | projectId = projectObjView.getId() | |
500 | idReadUnit = projectObjView.getReadUnitId() |
|
500 | idReadUnit = projectObjView.getReadUnitId() | |
501 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
501 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
502 |
|
502 | |||
503 | if not readUnitObj: |
|
503 | if not readUnitObj: | |
504 | return 0 |
|
504 | return 0 | |
505 |
|
505 | |||
506 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
506 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
507 | # Project Properties |
|
507 | # Project Properties | |
508 | self.refreshProjectProperties(projectObjView) |
|
508 | self.refreshProjectProperties(projectObjView) | |
509 | # Disable tabProject after finish the creation |
|
509 | # Disable tabProject after finish the creation | |
510 |
|
510 | |||
511 | self._enable_play_button() |
|
511 | self._enable_play_button() | |
512 | self._enable_save_button() |
|
512 | self._enable_save_button() | |
513 |
|
513 | |||
514 | self.console.clear() |
|
514 | self.console.clear() | |
515 | self.console.append("The project parameters were validated") |
|
515 | self.console.append("The project parameters were validated") | |
516 |
|
516 | |||
517 | return 1 |
|
517 | return 1 | |
518 |
|
518 | |||
519 | @pyqtSignature("") |
|
519 | @pyqtSignature("") | |
520 | def on_proClear_clicked(self): |
|
520 | def on_proClear_clicked(self): | |
521 |
|
521 | |||
522 | self.console.clear() |
|
522 | self.console.clear() | |
523 |
|
523 | |||
524 | @pyqtSignature("int") |
|
524 | @pyqtSignature("int") | |
525 | def on_volOpCebChannels_stateChanged(self, p0): |
|
525 | def on_volOpCebChannels_stateChanged(self, p0): | |
526 | """ |
|
526 | """ | |
527 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
527 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
528 | """ |
|
528 | """ | |
529 | if p0 == 2: |
|
529 | if p0 == 2: | |
530 | self.volOpComChannels.setEnabled(True) |
|
530 | self.volOpComChannels.setEnabled(True) | |
531 | self.volOpChannel.setEnabled(True) |
|
531 | self.volOpChannel.setEnabled(True) | |
532 |
|
532 | |||
533 | if p0 == 0: |
|
533 | if p0 == 0: | |
534 | self.volOpComChannels.setEnabled(False) |
|
534 | self.volOpComChannels.setEnabled(False) | |
535 | self.volOpChannel.setEnabled(False) |
|
535 | self.volOpChannel.setEnabled(False) | |
536 | self.volOpChannel.clear() |
|
536 | self.volOpChannel.clear() | |
537 |
|
537 | |||
538 | @pyqtSignature("int") |
|
538 | @pyqtSignature("int") | |
539 | def on_volOpCebHeights_stateChanged(self, p0): |
|
539 | def on_volOpCebHeights_stateChanged(self, p0): | |
540 | """ |
|
540 | """ | |
541 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
541 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
542 | """ |
|
542 | """ | |
543 | if p0 == 2: |
|
543 | if p0 == 2: | |
544 | self.volOpHeights.setEnabled(True) |
|
544 | self.volOpHeights.setEnabled(True) | |
545 | self.volOpComHeights.setEnabled(True) |
|
545 | self.volOpComHeights.setEnabled(True) | |
546 |
|
546 | |||
547 | if p0 == 0: |
|
547 | if p0 == 0: | |
548 | self.volOpHeights.setEnabled(False) |
|
548 | self.volOpHeights.setEnabled(False) | |
549 | self.volOpHeights.clear() |
|
549 | self.volOpHeights.clear() | |
550 | self.volOpComHeights.setEnabled(False) |
|
550 | self.volOpComHeights.setEnabled(False) | |
551 |
|
551 | |||
552 | @pyqtSignature("int") |
|
552 | @pyqtSignature("int") | |
553 | def on_volOpCebFilter_stateChanged(self, p0): |
|
553 | def on_volOpCebFilter_stateChanged(self, p0): | |
554 | """ |
|
554 | """ | |
555 | Name='Decoder', optype='other' |
|
555 | Name='Decoder', optype='other' | |
556 | """ |
|
556 | """ | |
557 | if p0 == 2: |
|
557 | if p0 == 2: | |
558 | self.volOpFilter.setEnabled(True) |
|
558 | self.volOpFilter.setEnabled(True) | |
559 |
|
559 | |||
560 | if p0 == 0: |
|
560 | if p0 == 0: | |
561 | self.volOpFilter.setEnabled(False) |
|
561 | self.volOpFilter.setEnabled(False) | |
562 | self.volOpFilter.clear() |
|
562 | self.volOpFilter.clear() | |
563 |
|
563 | |||
564 | @pyqtSignature("int") |
|
564 | @pyqtSignature("int") | |
565 | def on_volOpCebProfile_stateChanged(self, p0): |
|
565 | def on_volOpCebProfile_stateChanged(self, p0): | |
566 | """ |
|
566 | """ | |
567 | Check Box habilita ingreso del rango de Perfiles |
|
567 | Check Box habilita ingreso del rango de Perfiles | |
568 | """ |
|
568 | """ | |
569 | if p0 == 2: |
|
569 | if p0 == 2: | |
570 | self.volOpComProfile.setEnabled(True) |
|
570 | self.volOpComProfile.setEnabled(True) | |
571 | self.volOpProfile.setEnabled(True) |
|
571 | self.volOpProfile.setEnabled(True) | |
572 |
|
572 | |||
573 | if p0 == 0: |
|
573 | if p0 == 0: | |
574 | self.volOpComProfile.setEnabled(False) |
|
574 | self.volOpComProfile.setEnabled(False) | |
575 | self.volOpProfile.setEnabled(False) |
|
575 | self.volOpProfile.setEnabled(False) | |
576 | self.volOpProfile.clear() |
|
576 | self.volOpProfile.clear() | |
577 |
|
577 | |||
578 | @pyqtSignature("int") |
|
578 | @pyqtSignature("int") | |
579 | def on_volOpComProfile_activated(self, index): |
|
579 | def on_volOpComProfile_activated(self, index): | |
580 | """ |
|
580 | """ | |
581 | Check Box habilita ingreso del rango de Perfiles |
|
581 | Check Box habilita ingreso del rango de Perfiles | |
582 | """ |
|
582 | """ | |
583 | #Profile List |
|
583 | #Profile List | |
584 | if index == 0: |
|
584 | if index == 0: | |
585 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
585 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
586 |
|
586 | |||
587 | #Profile Range |
|
587 | #Profile Range | |
588 | if index == 1: |
|
588 | if index == 1: | |
589 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
589 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
590 |
|
590 | |||
591 | #Profile Range List |
|
591 | #Profile Range List | |
592 | if index == 2: |
|
592 | if index == 2: | |
593 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
593 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
594 |
|
594 | |||
595 | @pyqtSignature("int") |
|
595 | @pyqtSignature("int") | |
596 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
596 | def on_volOpCebDecodification_stateChanged(self, p0): | |
597 | """ |
|
597 | """ | |
598 | Check Box habilita |
|
598 | Check Box habilita | |
599 | """ |
|
599 | """ | |
600 | if p0 == 2: |
|
600 | if p0 == 2: | |
601 | self.volOpComCode.setEnabled(True) |
|
601 | self.volOpComCode.setEnabled(True) | |
602 | self.volOpComMode.setEnabled(True) |
|
602 | self.volOpComMode.setEnabled(True) | |
603 | if p0 == 0: |
|
603 | if p0 == 0: | |
604 | self.volOpComCode.setEnabled(False) |
|
604 | self.volOpComCode.setEnabled(False) | |
605 | self.volOpComMode.setEnabled(False) |
|
605 | self.volOpComMode.setEnabled(False) | |
606 |
|
606 | |||
607 | @pyqtSignature("int") |
|
607 | @pyqtSignature("int") | |
608 | def on_volOpComCode_activated(self, index): |
|
608 | def on_volOpComCode_activated(self, index): | |
609 | """ |
|
609 | """ | |
610 | Check Box habilita ingreso |
|
610 | Check Box habilita ingreso | |
611 | """ |
|
611 | """ | |
612 | if index == 13: |
|
612 | if index == 13: | |
613 | self.volOpCode.setEnabled(True) |
|
613 | self.volOpCode.setEnabled(True) | |
614 | else: |
|
614 | else: | |
615 | self.volOpCode.setEnabled(False) |
|
615 | self.volOpCode.setEnabled(False) | |
616 |
|
616 | |||
617 | if index == 0: |
|
617 | if index == 0: | |
618 | code = '' |
|
618 | code = '' | |
619 | self.volOpCode.setText(str(code)) |
|
619 | self.volOpCode.setText(str(code)) | |
620 | return |
|
620 | return | |
621 |
|
621 | |||
622 | if index == 1: |
|
622 | if index == 1: | |
623 | code = '(1,1,-1)' |
|
623 | code = '(1,1,-1)' | |
624 | nCode = '1' |
|
624 | nCode = '1' | |
625 | nBaud = '3' |
|
625 | nBaud = '3' | |
626 | if index == 2: |
|
626 | if index == 2: | |
627 | code = '(1,1,-1,1)' |
|
627 | code = '(1,1,-1,1)' | |
628 | nCode = '1' |
|
628 | nCode = '1' | |
629 | nBaud = '4' |
|
629 | nBaud = '4' | |
630 | if index == 3: |
|
630 | if index == 3: | |
631 | code = '(1,1,1,-1,1)' |
|
631 | code = '(1,1,1,-1,1)' | |
632 | nCode = '1' |
|
632 | nCode = '1' | |
633 | nBaud = '5' |
|
633 | nBaud = '5' | |
634 | if index == 4: |
|
634 | if index == 4: | |
635 | code = '(1,1,1,-1,-1,1,-1)' |
|
635 | code = '(1,1,1,-1,-1,1,-1)' | |
636 | nCode = '1' |
|
636 | nCode = '1' | |
637 | nBaud = '7' |
|
637 | nBaud = '7' | |
638 | if index == 5: |
|
638 | if index == 5: | |
639 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
639 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
640 | nCode = '1' |
|
640 | nCode = '1' | |
641 | nBaud = '11' |
|
641 | nBaud = '11' | |
642 | if index == 6: |
|
642 | if index == 6: | |
643 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
643 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
644 | nCode = '1' |
|
644 | nCode = '1' | |
645 | nBaud = '13' |
|
645 | nBaud = '13' | |
646 | if index == 7: |
|
646 | if index == 7: | |
647 | code = '(1,1,-1,-1,-1,1)' |
|
647 | code = '(1,1,-1,-1,-1,1)' | |
648 | nCode = '2' |
|
648 | nCode = '2' | |
649 | nBaud = '3' |
|
649 | nBaud = '3' | |
650 | if index == 8: |
|
650 | if index == 8: | |
651 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
651 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
652 | nCode = '2' |
|
652 | nCode = '2' | |
653 | nBaud = '4' |
|
653 | nBaud = '4' | |
654 | if index == 9: |
|
654 | if index == 9: | |
655 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
655 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
656 | nCode = '2' |
|
656 | nCode = '2' | |
657 | nBaud = '5' |
|
657 | nBaud = '5' | |
658 | if index == 10: |
|
658 | if index == 10: | |
659 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
659 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
660 | nCode = '2' |
|
660 | nCode = '2' | |
661 | nBaud = '7' |
|
661 | nBaud = '7' | |
662 | if index == 11: |
|
662 | 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)' |
|
663 | 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' |
|
664 | nCode = '2' | |
665 | nBaud = '11' |
|
665 | nBaud = '11' | |
666 | if index == 12: |
|
666 | 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)' |
|
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)' | |
668 | nCode = '2' |
|
668 | nCode = '2' | |
669 | nBaud = '13' |
|
669 | nBaud = '13' | |
670 |
|
670 | |||
671 | code = ast.literal_eval(code) |
|
671 | code = ast.literal_eval(code) | |
672 | nCode = int(nCode) |
|
672 | nCode = int(nCode) | |
673 | nBaud = int(nBaud) |
|
673 | nBaud = int(nBaud) | |
674 |
|
674 | |||
675 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
675 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
676 |
|
676 | |||
677 | self.volOpCode.setText(str(code)) |
|
677 | self.volOpCode.setText(str(code)) | |
678 |
|
678 | |||
679 | @pyqtSignature("int") |
|
679 | @pyqtSignature("int") | |
680 | def on_volOpCebFlip_stateChanged(self, p0): |
|
680 | def on_volOpCebFlip_stateChanged(self, p0): | |
681 | """ |
|
681 | """ | |
682 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
682 | Check Box habilita ingresode del numero de Integraciones a realizar | |
683 | """ |
|
683 | """ | |
684 | if p0 == 2: |
|
684 | if p0 == 2: | |
685 | self.volOpFlip.setEnabled(True) |
|
685 | self.volOpFlip.setEnabled(True) | |
686 | if p0 == 0: |
|
686 | if p0 == 0: | |
687 | self.volOpFlip.setEnabled(False) |
|
687 | self.volOpFlip.setEnabled(False) | |
688 | self.volOpFlip.clear() |
|
688 | self.volOpFlip.clear() | |
689 |
|
689 | |||
690 | @pyqtSignature("int") |
|
690 | @pyqtSignature("int") | |
691 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
691 | def on_volOpCebCohInt_stateChanged(self, p0): | |
692 | """ |
|
692 | """ | |
693 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
693 | Check Box habilita ingresode del numero de Integraciones a realizar | |
694 | """ |
|
694 | """ | |
695 | if p0 == 2: |
|
695 | if p0 == 2: | |
696 | self.volOpCohInt.setEnabled(True) |
|
696 | self.volOpCohInt.setEnabled(True) | |
697 | if p0 == 0: |
|
697 | if p0 == 0: | |
698 | self.volOpCohInt.setEnabled(False) |
|
698 | self.volOpCohInt.setEnabled(False) | |
699 | self.volOpCohInt.clear() |
|
699 | self.volOpCohInt.clear() | |
700 |
|
700 | |||
701 | @pyqtSignature("int") |
|
701 | @pyqtSignature("int") | |
702 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
702 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
703 | """ |
|
703 | """ | |
704 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
704 | Check Box habilita ingresode del numero de Integraciones a realizar | |
705 | """ |
|
705 | """ | |
706 | if p0 == 2: |
|
706 | if p0 == 2: | |
707 | self.volOpRadarfrequency.setEnabled(True) |
|
707 | self.volOpRadarfrequency.setEnabled(True) | |
708 | if p0 == 0: |
|
708 | if p0 == 0: | |
709 | self.volOpRadarfrequency.clear() |
|
709 | self.volOpRadarfrequency.clear() | |
710 | self.volOpRadarfrequency.setEnabled(False) |
|
710 | self.volOpRadarfrequency.setEnabled(False) | |
711 |
|
711 | |||
712 | @pyqtSignature("") |
|
712 | @pyqtSignature("") | |
713 | def on_volOutputToolPath_clicked(self): |
|
713 | def on_volOutputToolPath_clicked(self): | |
714 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
714 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
715 | self.volOutputPath.setText(dirOutPath) |
|
715 | self.volOutputPath.setText(dirOutPath) | |
716 |
|
716 | |||
717 | @pyqtSignature("") |
|
717 | @pyqtSignature("") | |
718 | def on_specOutputToolPath_clicked(self): |
|
718 | def on_specOutputToolPath_clicked(self): | |
719 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
719 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
720 | self.specOutputPath.setText(dirOutPath) |
|
720 | self.specOutputPath.setText(dirOutPath) | |
721 |
|
721 | |||
722 | @pyqtSignature("") |
|
722 | @pyqtSignature("") | |
723 | def on_specHeisOutputToolPath_clicked(self): |
|
723 | def on_specHeisOutputToolPath_clicked(self): | |
724 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
724 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
725 | self.specHeisOutputPath.setText(dirOutPath) |
|
725 | self.specHeisOutputPath.setText(dirOutPath) | |
726 |
|
726 | |||
727 | @pyqtSignature("") |
|
727 | @pyqtSignature("") | |
728 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
728 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
729 |
|
729 | |||
730 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
730 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
731 | self.specHeisOutputMetada.setText(filename) |
|
731 | self.specHeisOutputMetada.setText(filename) | |
732 |
|
732 | |||
733 | @pyqtSignature("") |
|
733 | @pyqtSignature("") | |
734 | def on_volOpOk_clicked(self): |
|
734 | def on_volOpOk_clicked(self): | |
735 | """ |
|
735 | """ | |
736 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
736 | 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 |
|
737 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
738 | """ |
|
738 | """ | |
739 |
|
739 | |||
740 | checkPath = False |
|
740 | checkPath = False | |
741 |
|
741 | |||
742 | self._disable_play_button() |
|
742 | self._disable_play_button() | |
743 | self._disable_save_button() |
|
743 | self._disable_save_button() | |
744 |
|
744 | |||
745 | self.console.clear() |
|
745 | self.console.clear() | |
746 | self.console.append("Checking input parameters ...") |
|
746 | self.console.append("Checking input parameters ...") | |
747 |
|
747 | |||
748 | puObj = self.getSelectedItemObj() |
|
748 | puObj = self.getSelectedItemObj() | |
749 | puObj.removeOperations() |
|
749 | puObj.removeOperations() | |
750 |
|
750 | |||
751 | if self.volOpCebRadarfrequency.isChecked(): |
|
751 | if self.volOpCebRadarfrequency.isChecked(): | |
752 | value = str(self.volOpRadarfrequency.text()) |
|
752 | value = str(self.volOpRadarfrequency.text()) | |
753 | format = 'float' |
|
753 | format = 'float' | |
754 | name_operation = 'setRadarFrequency' |
|
754 | name_operation = 'setRadarFrequency' | |
755 | name_parameter = 'frequency' |
|
755 | name_parameter = 'frequency' | |
756 | if not value == "": |
|
756 | if not value == "": | |
757 | try: |
|
757 | try: | |
758 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 |
|
758 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
759 | except: |
|
759 | except: | |
760 | self.console.clear() |
|
760 | self.console.clear() | |
761 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
761 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
762 | return 0 |
|
762 | return 0 | |
763 |
|
763 | |||
764 | opObj = puObj.addOperation(name=name_operation) |
|
764 | opObj = puObj.addOperation(name=name_operation) | |
765 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): |
|
765 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): | |
766 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
766 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
767 | return 0 |
|
767 | return 0 | |
768 |
|
768 | |||
769 | if self.volOpCebChannels.isChecked(): |
|
769 | if self.volOpCebChannels.isChecked(): | |
770 | value = str(self.volOpChannel.text()) |
|
770 | value = str(self.volOpChannel.text()) | |
771 |
|
771 | |||
772 | if value == "": |
|
772 | if value == "": | |
773 | print "Please fill channel list" |
|
773 | print "Please fill channel list" | |
774 | return 0 |
|
774 | return 0 | |
775 |
|
775 | |||
776 | format = 'intlist' |
|
776 | format = 'intlist' | |
777 | if self.volOpComChannels.currentIndex() == 0: |
|
777 | if self.volOpComChannels.currentIndex() == 0: | |
778 | name_operation = "selectChannels" |
|
778 | name_operation = "selectChannels" | |
779 | name_parameter = 'channelList' |
|
779 | name_parameter = 'channelList' | |
780 | else: |
|
780 | else: | |
781 | name_operation = "selectChannelsByIndex" |
|
781 | name_operation = "selectChannelsByIndex" | |
782 | name_parameter = 'channelIndexList' |
|
782 | name_parameter = 'channelIndexList' | |
783 |
|
783 | |||
784 | opObj = puObj.addOperation(name=name_operation) |
|
784 | opObj = puObj.addOperation(name=name_operation) | |
785 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
785 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
786 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
786 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
787 | return 0 |
|
787 | return 0 | |
788 |
|
788 | |||
789 | if self.volOpCebHeights.isChecked(): |
|
789 | if self.volOpCebHeights.isChecked(): | |
790 | value = str(self.volOpHeights.text()) |
|
790 | value = str(self.volOpHeights.text()) | |
791 |
|
791 | |||
792 | if value == "": |
|
792 | if value == "": | |
793 | print "Please fill height range" |
|
793 | print "Please fill height range" | |
794 | return 0 |
|
794 | return 0 | |
795 |
|
795 | |||
796 | valueList = value.split(',') |
|
796 | valueList = value.split(',') | |
797 |
|
797 | |||
798 | if self.volOpComHeights.currentIndex() == 0: |
|
798 | if self.volOpComHeights.currentIndex() == 0: | |
799 | format = 'float' |
|
799 | format = 'float' | |
800 | name_operation = 'selectHeights' |
|
800 | name_operation = 'selectHeights' | |
801 | name_parameter1 = 'minHei' |
|
801 | name_parameter1 = 'minHei' | |
802 | name_parameter2 = 'maxHei' |
|
802 | name_parameter2 = 'maxHei' | |
803 | else: |
|
803 | else: | |
804 | format = 'int' |
|
804 | format = 'int' | |
805 | name_operation = 'selectHeightsByIndex' |
|
805 | name_operation = 'selectHeightsByIndex' | |
806 | name_parameter1 = 'minIndex' |
|
806 | name_parameter1 = 'minIndex' | |
807 | name_parameter2 = 'maxIndex' |
|
807 | name_parameter2 = 'maxIndex' | |
808 |
|
808 | |||
809 | opObj = puObj.addOperation(name=name_operation) |
|
809 | opObj = puObj.addOperation(name=name_operation) | |
810 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
810 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
811 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
811 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
812 |
|
812 | |||
813 | if self.volOpCebFilter.isChecked(): |
|
813 | if self.volOpCebFilter.isChecked(): | |
814 | value = str(self.volOpFilter.text()) |
|
814 | value = str(self.volOpFilter.text()) | |
815 | if value == "": |
|
815 | if value == "": | |
816 | print "Please fill filter value" |
|
816 | print "Please fill filter value" | |
817 | return 0 |
|
817 | return 0 | |
818 |
|
818 | |||
819 | format = 'int' |
|
819 | format = 'int' | |
820 | name_operation = 'filterByHeights' |
|
820 | name_operation = 'filterByHeights' | |
821 | name_parameter = 'window' |
|
821 | name_parameter = 'window' | |
822 | opObj = puObj.addOperation(name=name_operation) |
|
822 | opObj = puObj.addOperation(name=name_operation) | |
823 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
823 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
824 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
824 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
825 | return 0 |
|
825 | return 0 | |
826 |
|
826 | |||
827 | if self.volOpCebProfile.isChecked(): |
|
827 | if self.volOpCebProfile.isChecked(): | |
828 | value = str(self.volOpProfile.text()) |
|
828 | value = str(self.volOpProfile.text()) | |
829 |
|
829 | |||
830 | if value == "": |
|
830 | if value == "": | |
831 | print "Please fill profile value" |
|
831 | print "Please fill profile value" | |
832 | return 0 |
|
832 | return 0 | |
833 |
|
833 | |||
834 | format = 'intlist' |
|
834 | format = 'intlist' | |
835 | optype = 'other' |
|
835 | optype = 'other' | |
836 | name_operation = 'ProfileSelector' |
|
836 | name_operation = 'ProfileSelector' | |
837 | if self.volOpComProfile.currentIndex() == 0: |
|
837 | if self.volOpComProfile.currentIndex() == 0: | |
838 | name_parameter = 'profileList' |
|
838 | name_parameter = 'profileList' | |
839 | if self.volOpComProfile.currentIndex() == 1: |
|
839 | if self.volOpComProfile.currentIndex() == 1: | |
840 | name_parameter = 'profileRangeList' |
|
840 | name_parameter = 'profileRangeList' | |
841 | if self.volOpComProfile.currentIndex() == 2: |
|
841 | if self.volOpComProfile.currentIndex() == 2: | |
842 | name_parameter = 'rangeList' |
|
842 | name_parameter = 'rangeList' | |
843 |
|
843 | |||
844 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
844 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
845 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
845 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
846 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
846 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
847 | return 0 |
|
847 | return 0 | |
848 |
|
848 | |||
849 | if self.volOpCebDecodification.isChecked(): |
|
849 | if self.volOpCebDecodification.isChecked(): | |
850 | name_operation = 'Decoder' |
|
850 | name_operation = 'Decoder' | |
851 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
851 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
852 |
|
852 | |||
853 | #User defined |
|
853 | #User defined | |
854 | nBaud = None |
|
854 | nBaud = None | |
855 | nCode = None |
|
855 | nCode = None | |
856 |
|
856 | |||
857 | code = str(self.volOpCode.text()) |
|
857 | code = str(self.volOpCode.text()) | |
858 | try: |
|
858 | try: | |
859 | code_tmp = ast.literal_eval(code) |
|
859 | code_tmp = ast.literal_eval(code) | |
860 | except: |
|
860 | except: | |
861 | code_tmp = [] |
|
861 | code_tmp = [] | |
862 |
|
862 | |||
863 | if len(code_tmp) > 0: |
|
863 | if len(code_tmp) > 0: | |
864 |
|
864 | |||
865 | if type(code_tmp) not in (tuple, list): |
|
865 | 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])") |
|
866 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
867 | return 0 |
|
867 | return 0 | |
868 |
|
868 | |||
869 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] |
|
869 | 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]) |
|
870 | nBaud = len(code_tmp[0]) | |
871 | nCode = len(code_tmp) |
|
871 | nCode = len(code_tmp) | |
872 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] |
|
872 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] | |
873 | nBaud = len(code_tmp[0]) |
|
873 | nBaud = len(code_tmp[0]) | |
874 | nCode = 1 |
|
874 | nCode = 1 | |
875 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) |
|
875 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) | |
876 | nBaud = len(code_tmp) |
|
876 | nBaud = len(code_tmp) | |
877 | nCode = 1 |
|
877 | nCode = 1 | |
878 | else: |
|
878 | else: | |
879 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
879 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
880 | return 0 |
|
880 | return 0 | |
881 |
|
881 | |||
882 | if not nBaud or not nCode: |
|
882 | if not nBaud or not nCode: | |
883 | self.console.append("Please write a right value for Code") |
|
883 | self.console.append("Please write a right value for Code") | |
884 | return 0 |
|
884 | return 0 | |
885 |
|
885 | |||
886 | code = code.replace("(", "") |
|
886 | code = code.replace("(", "") | |
887 | code = code.replace(")", "") |
|
887 | code = code.replace(")", "") | |
888 | code = code.replace("[", "") |
|
888 | code = code.replace("[", "") | |
889 | code = code.replace("]", "") |
|
889 | code = code.replace("]", "") | |
890 |
|
890 | |||
891 | if not opObj.addParameter(name='code', value=code, format='intlist'): |
|
891 | if not opObj.addParameter(name='code', value=code, format='intlist'): | |
892 | self.console.append("Please write a right value for Code") |
|
892 | self.console.append("Please write a right value for Code") | |
893 | return 0 |
|
893 | return 0 | |
894 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): |
|
894 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): | |
895 | self.console.append("Please write a right value for Code") |
|
895 | self.console.append("Please write a right value for Code") | |
896 | return 0 |
|
896 | return 0 | |
897 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): |
|
897 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): | |
898 | self.console.append("Please write a right value for Code") |
|
898 | self.console.append("Please write a right value for Code") | |
899 | return 0 |
|
899 | return 0 | |
900 |
|
900 | |||
901 | name_parameter = 'mode' |
|
901 | name_parameter = 'mode' | |
902 | format = 'int' |
|
902 | format = 'int' | |
903 |
|
903 | |||
904 | value = str(self.volOpComMode.currentIndex()) |
|
904 | value = str(self.volOpComMode.currentIndex()) | |
905 |
|
905 | |||
906 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
906 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
907 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
907 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
908 | return 0 |
|
908 | return 0 | |
909 |
|
909 | |||
910 |
|
910 | |||
911 | if self.volOpCebFlip.isChecked(): |
|
911 | if self.volOpCebFlip.isChecked(): | |
912 | name_operation = 'deFlip' |
|
912 | name_operation = 'deFlip' | |
913 | optype = 'self' |
|
913 | optype = 'self' | |
914 |
|
914 | |||
915 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
915 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
916 |
|
916 | |||
917 | name_parameter = 'channelList' |
|
917 | name_parameter = 'channelList' | |
918 | format = 'intlist' |
|
918 | format = 'intlist' | |
919 | value = str(self.volOpFlip.text()) |
|
919 | value = str(self.volOpFlip.text()) | |
920 |
|
920 | |||
921 | if value != "": |
|
921 | if value != "": | |
922 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
922 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
923 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
923 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
924 | return 0 |
|
924 | return 0 | |
925 |
|
925 | |||
926 | if self.volOpCebCohInt.isChecked(): |
|
926 | if self.volOpCebCohInt.isChecked(): | |
927 | name_operation = 'CohInt' |
|
927 | name_operation = 'CohInt' | |
928 | optype = 'other' |
|
928 | optype = 'other' | |
929 | value = str(self.volOpCohInt.text()) |
|
929 | value = str(self.volOpCohInt.text()) | |
930 |
|
930 | |||
931 | if value == "": |
|
931 | if value == "": | |
932 | print "Please fill number of coherent integrations" |
|
932 | print "Please fill number of coherent integrations" | |
933 | return 0 |
|
933 | return 0 | |
934 |
|
934 | |||
935 | name_parameter = 'n' |
|
935 | name_parameter = 'n' | |
936 | format = 'int' |
|
936 | format = 'int' | |
937 |
|
937 | |||
938 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
938 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
939 |
|
939 | |||
940 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
940 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
941 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
941 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
942 | return 0 |
|
942 | return 0 | |
943 |
|
943 | |||
944 | if self.volGraphCebshow.isChecked(): |
|
944 | if self.volGraphCebshow.isChecked(): | |
945 | name_operation = 'Scope' |
|
945 | name_operation = 'Scope' | |
946 | optype = 'other' |
|
946 | optype = 'other' | |
947 | name_parameter = 'type' |
|
947 | name_parameter = 'type' | |
948 | value = 'Scope' |
|
948 | value = 'Scope' | |
949 | if self.idImagscope == 0: |
|
949 | if self.idImagscope == 0: | |
950 | self.idImagscope = 100 |
|
950 | self.idImagscope = 100 | |
951 | else: |
|
951 | else: | |
952 | self.idImagscope = self.idImagscope + 1 |
|
952 | self.idImagscope = self.idImagscope + 1 | |
953 |
|
953 | |||
954 | name_parameter1 = 'id' |
|
954 | name_parameter1 = 'id' | |
955 | value1 = int(self.idImagscope) |
|
955 | value1 = int(self.idImagscope) | |
956 | format1 = 'int' |
|
956 | format1 = 'int' | |
957 | format = 'str' |
|
957 | format = 'str' | |
958 |
|
958 | |||
959 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
959 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
960 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
960 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
961 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
961 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
962 |
|
962 | |||
963 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
963 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
964 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
964 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
965 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
965 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
966 |
|
966 | |||
967 | if channelList: |
|
967 | if channelList: | |
968 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
968 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
969 |
|
969 | |||
970 | if xvalue: |
|
970 | if xvalue: | |
971 | xvalueList = xvalue.split(',') |
|
971 | xvalueList = xvalue.split(',') | |
972 | try: |
|
972 | try: | |
973 | value0 = float(xvalueList[0]) |
|
973 | value0 = float(xvalueList[0]) | |
974 | value1 = float(xvalueList[1]) |
|
974 | value1 = float(xvalueList[1]) | |
975 | except: |
|
975 | except: | |
976 | return 0 |
|
976 | return 0 | |
977 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
977 | opObj.addParameter(name='xmin', value=value0, format='float') | |
978 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
978 | opObj.addParameter(name='xmax', value=value1, format='float') | |
979 |
|
979 | |||
980 |
|
980 | |||
981 | if not yvalue == "": |
|
981 | if not yvalue == "": | |
982 | yvalueList = yvalue.split(",") |
|
982 | yvalueList = yvalue.split(",") | |
983 | try: |
|
983 | try: | |
984 | value0 = int(yvalueList[0]) |
|
984 | value0 = int(yvalueList[0]) | |
985 | value1 = int(yvalueList[1]) |
|
985 | value1 = int(yvalueList[1]) | |
986 | except: |
|
986 | except: | |
987 | return 0 |
|
987 | return 0 | |
988 |
|
988 | |||
989 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
989 | opObj.addParameter(name='ymin', value=value0, format='int') | |
990 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
990 | opObj.addParameter(name='ymax', value=value1, format='int') | |
991 |
|
991 | |||
992 | if self.volGraphCebSave.isChecked(): |
|
992 | if self.volGraphCebSave.isChecked(): | |
993 | checkPath = True |
|
993 | checkPath = True | |
994 | opObj.addParameter(name='save', value='1', format='int') |
|
994 | opObj.addParameter(name='save', value='1', format='int') | |
995 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') |
|
995 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') | |
996 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
996 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
997 | if value: |
|
997 | if value: | |
998 | opObj.addParameter(name='figfile', value=value, format='str') |
|
998 | opObj.addParameter(name='figfile', value=value, format='str') | |
999 |
|
999 | |||
1000 | localfolder = None |
|
1000 | localfolder = None | |
1001 | if checkPath: |
|
1001 | if checkPath: | |
1002 | localfolder = str(self.volGraphPath.text()) |
|
1002 | localfolder = str(self.volGraphPath.text()) | |
1003 | if localfolder == '': |
|
1003 | if localfolder == '': | |
1004 | self.console.clear() |
|
1004 | self.console.clear() | |
1005 | self.console.append("Graphic path should be defined") |
|
1005 | self.console.append("Graphic path should be defined") | |
1006 | return 0 |
|
1006 | return 0 | |
1007 |
|
1007 | |||
1008 | # if something happend |
|
1008 | # if something happend | |
1009 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1009 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1010 | if parms_ok: |
|
1010 | if parms_ok: | |
1011 | name_operation = 'VoltageWriter' |
|
1011 | name_operation = 'VoltageWriter' | |
1012 | optype = 'other' |
|
1012 | optype = 'other' | |
1013 | name_parameter1 = 'path' |
|
1013 | name_parameter1 = 'path' | |
1014 | name_parameter2 = 'blocksPerFile' |
|
1014 | name_parameter2 = 'blocksPerFile' | |
1015 | name_parameter3 = 'profilesPerBlock' |
|
1015 | name_parameter3 = 'profilesPerBlock' | |
1016 | value1 = output_path |
|
1016 | value1 = output_path | |
1017 | value2 = blocksperfile |
|
1017 | value2 = blocksperfile | |
1018 | value3 = profilesperblock |
|
1018 | value3 = profilesperblock | |
1019 | format = "int" |
|
1019 | format = "int" | |
1020 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1020 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1021 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1021 | opObj.addParameter(name=name_parameter1, value=value1) | |
1022 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1022 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1023 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1023 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1024 |
|
1024 | |||
1025 | self.console.clear() |
|
1025 | self.console.clear() | |
1026 | try: |
|
1026 | try: | |
1027 | self.refreshPUProperties(puObj) |
|
1027 | self.refreshPUProperties(puObj) | |
1028 | except: |
|
1028 | except: | |
1029 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1029 | self.console.append("An error reading input parameters was found ...Check them!") | |
1030 | return 0 |
|
1030 | return 0 | |
1031 |
|
1031 | |||
1032 | self.console.append("Save your project and press Play button to start signal processing") |
|
1032 | self.console.append("Save your project and press Play button to start signal processing") | |
1033 |
|
1033 | |||
1034 | self._enable_play_button() |
|
1034 | self._enable_play_button() | |
1035 | self._enable_save_button() |
|
1035 | self._enable_save_button() | |
1036 |
|
1036 | |||
1037 | return 1 |
|
1037 | return 1 | |
1038 |
|
1038 | |||
1039 | """ |
|
1039 | """ | |
1040 | Voltage Graph |
|
1040 | Voltage Graph | |
1041 | """ |
|
1041 | """ | |
1042 | @pyqtSignature("int") |
|
1042 | @pyqtSignature("int") | |
1043 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1043 | def on_volGraphCebSave_stateChanged(self, p0): | |
1044 | """ |
|
1044 | """ | |
1045 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1045 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1046 | """ |
|
1046 | """ | |
1047 | if p0 == 2: |
|
1047 | if p0 == 2: | |
1048 | self.volGraphPath.setEnabled(True) |
|
1048 | self.volGraphPath.setEnabled(True) | |
1049 | self.volGraphPrefix.setEnabled(True) |
|
1049 | self.volGraphPrefix.setEnabled(True) | |
1050 | self.volGraphToolPath.setEnabled(True) |
|
1050 | self.volGraphToolPath.setEnabled(True) | |
1051 |
|
1051 | |||
1052 | if p0 == 0: |
|
1052 | if p0 == 0: | |
1053 | self.volGraphPath.setEnabled(False) |
|
1053 | self.volGraphPath.setEnabled(False) | |
1054 | self.volGraphPrefix.setEnabled(False) |
|
1054 | self.volGraphPrefix.setEnabled(False) | |
1055 | self.volGraphToolPath.setEnabled(False) |
|
1055 | self.volGraphToolPath.setEnabled(False) | |
1056 |
|
1056 | |||
1057 | @pyqtSignature("") |
|
1057 | @pyqtSignature("") | |
1058 | def on_volGraphToolPath_clicked(self): |
|
1058 | def on_volGraphToolPath_clicked(self): | |
1059 | """ |
|
1059 | """ | |
1060 | Donde se guardan los DATOS |
|
1060 | Donde se guardan los DATOS | |
1061 | """ |
|
1061 | """ | |
1062 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1062 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1063 | self.volGraphPath.setText(save_path) |
|
1063 | self.volGraphPath.setText(save_path) | |
1064 |
|
1064 | |||
1065 | if not os.path.exists(save_path): |
|
1065 | if not os.path.exists(save_path): | |
1066 | self.console.clear() |
|
1066 | self.console.clear() | |
1067 | self.console.append("Set a valid path") |
|
1067 | self.console.append("Set a valid path") | |
1068 | self.volGraphOk.setEnabled(False) |
|
1068 | self.volGraphOk.setEnabled(False) | |
1069 | return |
|
1069 | return | |
1070 |
|
1070 | |||
1071 | @pyqtSignature("int") |
|
1071 | @pyqtSignature("int") | |
1072 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1072 | def on_volGraphCebshow_stateChanged(self, p0): | |
1073 | """ |
|
1073 | """ | |
1074 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1074 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1075 | """ |
|
1075 | """ | |
1076 | if p0 == 0: |
|
1076 | if p0 == 0: | |
1077 |
|
1077 | |||
1078 | self.volGraphChannelList.setEnabled(False) |
|
1078 | self.volGraphChannelList.setEnabled(False) | |
1079 | self.volGraphfreqrange.setEnabled(False) |
|
1079 | self.volGraphfreqrange.setEnabled(False) | |
1080 | self.volGraphHeightrange.setEnabled(False) |
|
1080 | self.volGraphHeightrange.setEnabled(False) | |
1081 | if p0 == 2: |
|
1081 | if p0 == 2: | |
1082 |
|
1082 | |||
1083 | self.volGraphChannelList.setEnabled(True) |
|
1083 | self.volGraphChannelList.setEnabled(True) | |
1084 | self.volGraphfreqrange.setEnabled(True) |
|
1084 | self.volGraphfreqrange.setEnabled(True) | |
1085 | self.volGraphHeightrange.setEnabled(True) |
|
1085 | self.volGraphHeightrange.setEnabled(True) | |
1086 |
|
1086 | |||
1087 | """ |
|
1087 | """ | |
1088 | Spectra operation |
|
1088 | Spectra operation | |
1089 | """ |
|
1089 | """ | |
1090 | @pyqtSignature("int") |
|
1090 | @pyqtSignature("int") | |
1091 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1091 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1092 | """ |
|
1092 | """ | |
1093 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1093 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1094 | """ |
|
1094 | """ | |
1095 | if p0 == 2: |
|
1095 | if p0 == 2: | |
1096 | self.specOpRadarfrequency.setEnabled(True) |
|
1096 | self.specOpRadarfrequency.setEnabled(True) | |
1097 | if p0 == 0: |
|
1097 | if p0 == 0: | |
1098 | self.specOpRadarfrequency.clear() |
|
1098 | self.specOpRadarfrequency.clear() | |
1099 | self.specOpRadarfrequency.setEnabled(False) |
|
1099 | self.specOpRadarfrequency.setEnabled(False) | |
1100 |
|
1100 | |||
1101 |
|
1101 | |||
1102 | @pyqtSignature("int") |
|
1102 | @pyqtSignature("int") | |
1103 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1103 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1104 | """ |
|
1104 | """ | |
1105 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1105 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1106 | """ |
|
1106 | """ | |
1107 | if p0 == 2: |
|
1107 | if p0 == 2: | |
1108 | # self.specOpnFFTpoints.setEnabled(True) |
|
1108 | # self.specOpnFFTpoints.setEnabled(True) | |
1109 | self.specOppairsList.setEnabled(True) |
|
1109 | self.specOppairsList.setEnabled(True) | |
1110 | if p0 == 0: |
|
1110 | if p0 == 0: | |
1111 | # self.specOpnFFTpoints.setEnabled(False) |
|
1111 | # self.specOpnFFTpoints.setEnabled(False) | |
1112 | self.specOppairsList.setEnabled(False) |
|
1112 | self.specOppairsList.setEnabled(False) | |
1113 |
|
1113 | |||
1114 | @pyqtSignature("int") |
|
1114 | @pyqtSignature("int") | |
1115 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1115 | def on_specOpCebChannel_stateChanged(self, p0): | |
1116 | """ |
|
1116 | """ | |
1117 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1117 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1118 | """ |
|
1118 | """ | |
1119 | if p0 == 2: |
|
1119 | if p0 == 2: | |
1120 | self.specOpChannel.setEnabled(True) |
|
1120 | self.specOpChannel.setEnabled(True) | |
1121 | self.specOpComChannel.setEnabled(True) |
|
1121 | self.specOpComChannel.setEnabled(True) | |
1122 | if p0 == 0: |
|
1122 | if p0 == 0: | |
1123 | self.specOpChannel.setEnabled(False) |
|
1123 | self.specOpChannel.setEnabled(False) | |
1124 | self.specOpComChannel.setEnabled(False) |
|
1124 | self.specOpComChannel.setEnabled(False) | |
1125 |
|
1125 | |||
1126 | @pyqtSignature("int") |
|
1126 | @pyqtSignature("int") | |
1127 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1127 | def on_specOpCebHeights_stateChanged(self, p0): | |
1128 | """ |
|
1128 | """ | |
1129 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1129 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1130 | """ |
|
1130 | """ | |
1131 | if p0 == 2: |
|
1131 | if p0 == 2: | |
1132 | self.specOpComHeights.setEnabled(True) |
|
1132 | self.specOpComHeights.setEnabled(True) | |
1133 | self.specOpHeights.setEnabled(True) |
|
1133 | self.specOpHeights.setEnabled(True) | |
1134 | if p0 == 0: |
|
1134 | if p0 == 0: | |
1135 | self.specOpComHeights.setEnabled(False) |
|
1135 | self.specOpComHeights.setEnabled(False) | |
1136 | self.specOpHeights.setEnabled(False) |
|
1136 | self.specOpHeights.setEnabled(False) | |
1137 |
|
1137 | |||
1138 |
|
1138 | |||
1139 | @pyqtSignature("int") |
|
1139 | @pyqtSignature("int") | |
1140 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1140 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1141 | """ |
|
1141 | """ | |
1142 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1142 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1143 | """ |
|
1143 | """ | |
1144 | if p0 == 2: |
|
1144 | if p0 == 2: | |
1145 | self.specOpIncoherent.setEnabled(True) |
|
1145 | self.specOpIncoherent.setEnabled(True) | |
1146 | if p0 == 0: |
|
1146 | if p0 == 0: | |
1147 | self.specOpIncoherent.setEnabled(False) |
|
1147 | self.specOpIncoherent.setEnabled(False) | |
1148 |
|
1148 | |||
1149 | @pyqtSignature("int") |
|
1149 | @pyqtSignature("int") | |
1150 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1150 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1151 | """ |
|
1151 | """ | |
1152 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1152 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1153 | """ |
|
1153 | """ | |
1154 | if p0 == 2: |
|
1154 | if p0 == 2: | |
1155 | self.specOpComRemoveDC.setEnabled(True) |
|
1155 | self.specOpComRemoveDC.setEnabled(True) | |
1156 | if p0 == 0: |
|
1156 | if p0 == 0: | |
1157 | self.specOpComRemoveDC.setEnabled(False) |
|
1157 | self.specOpComRemoveDC.setEnabled(False) | |
1158 |
|
1158 | |||
1159 | @pyqtSignature("int") |
|
1159 | @pyqtSignature("int") | |
1160 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1160 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1161 | """ |
|
1161 | """ | |
1162 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1162 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1163 | """ |
|
1163 | """ | |
1164 | if p0 == 2: |
|
1164 | if p0 == 2: | |
1165 | self.specOpgetNoise.setEnabled(True) |
|
1165 | self.specOpgetNoise.setEnabled(True) | |
1166 |
|
1166 | |||
1167 | if p0 == 0: |
|
1167 | if p0 == 0: | |
1168 | self.specOpgetNoise.setEnabled(False) |
|
1168 | self.specOpgetNoise.setEnabled(False) | |
1169 |
|
1169 | |||
1170 | @pyqtSignature("") |
|
1170 | @pyqtSignature("") | |
1171 | def on_specOpOk_clicked(self): |
|
1171 | def on_specOpOk_clicked(self): | |
1172 | """ |
|
1172 | """ | |
1173 | AΓADE OPERACION SPECTRA |
|
1173 | AΓADE OPERACION SPECTRA | |
1174 | """ |
|
1174 | """ | |
1175 |
|
1175 | |||
1176 | addFTP = False |
|
1176 | addFTP = False | |
1177 | checkPath = False |
|
1177 | checkPath = False | |
1178 |
|
1178 | |||
1179 | self._disable_play_button() |
|
1179 | self._disable_play_button() | |
1180 | self._disable_save_button() |
|
1180 | self._disable_save_button() | |
1181 |
|
1181 | |||
1182 | self.console.clear() |
|
1182 | self.console.clear() | |
1183 | self.console.append("Checking input parameters ...") |
|
1183 | self.console.append("Checking input parameters ...") | |
1184 |
|
1184 | |||
1185 | projectObj = self.getSelectedProjectObj() |
|
1185 | projectObj = self.getSelectedProjectObj() | |
1186 |
|
1186 | |||
1187 | if not projectObj: |
|
1187 | if not projectObj: | |
1188 | self.console.append("Please select a project before update it") |
|
1188 | self.console.append("Please select a project before update it") | |
1189 | return |
|
1189 | return | |
1190 |
|
1190 | |||
1191 | puObj = self.getSelectedItemObj() |
|
1191 | puObj = self.getSelectedItemObj() | |
1192 |
|
1192 | |||
1193 | puObj.removeOperations() |
|
1193 | puObj.removeOperations() | |
1194 |
|
1194 | |||
1195 | if self.specOpCebRadarfrequency.isChecked(): |
|
1195 | if self.specOpCebRadarfrequency.isChecked(): | |
1196 | value = str(self.specOpRadarfrequency.text()) |
|
1196 | value = str(self.specOpRadarfrequency.text()) | |
1197 | format = 'float' |
|
1197 | format = 'float' | |
1198 | name_operation = 'setRadarFrequency' |
|
1198 | name_operation = 'setRadarFrequency' | |
1199 | name_parameter = 'frequency' |
|
1199 | name_parameter = 'frequency' | |
1200 |
|
1200 | |||
1201 | if not isFloat(value): |
|
1201 | if not isFloat(value): | |
1202 | self.console.clear() |
|
1202 | self.console.clear() | |
1203 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1203 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1204 | return 0 |
|
1204 | return 0 | |
1205 |
|
1205 | |||
1206 | radarfreq = float(value)*1e6 |
|
1206 | radarfreq = float(value)*1e6 | |
1207 | opObj = puObj.addOperation(name=name_operation) |
|
1207 | opObj = puObj.addOperation(name=name_operation) | |
1208 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1208 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1209 |
|
1209 | |||
1210 | inputId = puObj.getInputId() |
|
1210 | inputId = puObj.getInputId() | |
1211 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1211 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1212 |
|
1212 | |||
1213 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1213 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1214 |
|
1214 | |||
1215 | value = str(self.specOpnFFTpoints.text()) |
|
1215 | value = str(self.specOpnFFTpoints.text()) | |
1216 |
|
1216 | |||
1217 | if not isInt(value): |
|
1217 | if not isInt(value): | |
1218 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) |
|
1218 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) | |
1219 | return 0 |
|
1219 | return 0 | |
1220 |
|
1220 | |||
1221 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1221 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1222 |
|
1222 | |||
1223 | value = str(self.specOpProfiles.text()) |
|
1223 | value = str(self.specOpProfiles.text()) | |
1224 | if not isInt(value): |
|
1224 | if not isInt(value): | |
1225 | self.console.append("Please write a value on Profiles field") |
|
1225 | self.console.append("Please write a value on Profiles field") | |
1226 | else: |
|
1226 | else: | |
1227 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1227 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1228 |
|
1228 | |||
1229 | value = str(self.specOpippFactor.text()) |
|
1229 | value = str(self.specOpippFactor.text()) | |
1230 | if not isInt(value): |
|
1230 | if not isInt(value): | |
1231 | self.console.append("Please write a value on IppFactor field") |
|
1231 | self.console.append("Please write a value on IppFactor field") | |
1232 | else: |
|
1232 | else: | |
1233 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1233 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1234 |
|
1234 | |||
1235 | if self.specOpCebCrossSpectra.isChecked(): |
|
1235 | if self.specOpCebCrossSpectra.isChecked(): | |
1236 | name_parameter = 'pairsList' |
|
1236 | name_parameter = 'pairsList' | |
1237 | format = 'pairslist' |
|
1237 | format = 'pairslist' | |
1238 | value = str(self.specOppairsList.text()) |
|
1238 | value = str(self.specOppairsList.text()) | |
1239 |
|
1239 | |||
1240 | if value == "": |
|
1240 | if value == "": | |
1241 | print "Please fill the pairs list field" |
|
1241 | print "Please fill the pairs list field" | |
1242 | return 0 |
|
1242 | return 0 | |
1243 |
|
1243 | |||
1244 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
1244 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
1245 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1245 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1246 | return 0 |
|
1246 | return 0 | |
1247 |
|
1247 | |||
1248 | if self.specOpCebHeights.isChecked(): |
|
1248 | if self.specOpCebHeights.isChecked(): | |
1249 | value = str(self.specOpHeights.text()) |
|
1249 | value = str(self.specOpHeights.text()) | |
1250 |
|
1250 | |||
1251 | if value == "": |
|
1251 | if value == "": | |
1252 | self.console.append("Empty value for '%s'" %(value, "Height range")) |
|
1252 | self.console.append("Empty value for '%s'" %(value, "Height range")) | |
1253 | return 0 |
|
1253 | return 0 | |
1254 |
|
1254 | |||
1255 | valueList = value.split(',') |
|
1255 | valueList = value.split(',') | |
1256 | format = 'float' |
|
1256 | format = 'float' | |
1257 | value0 = valueList[0] |
|
1257 | value0 = valueList[0] | |
1258 | value1 = valueList[1] |
|
1258 | value1 = valueList[1] | |
1259 |
|
1259 | |||
1260 | if not isFloat(value0) or not isFloat(value1): |
|
1260 | if not isFloat(value0) or not isFloat(value1): | |
1261 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) |
|
1261 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) | |
1262 | return 0 |
|
1262 | return 0 | |
1263 |
|
1263 | |||
1264 | if self.specOpComHeights.currentIndex() == 0: |
|
1264 | if self.specOpComHeights.currentIndex() == 0: | |
1265 | name_operation = 'selectHeights' |
|
1265 | name_operation = 'selectHeights' | |
1266 | name_parameter1 = 'minHei' |
|
1266 | name_parameter1 = 'minHei' | |
1267 | name_parameter2 = 'maxHei' |
|
1267 | name_parameter2 = 'maxHei' | |
1268 | else: |
|
1268 | else: | |
1269 | name_operation = 'selectHeightsByIndex' |
|
1269 | name_operation = 'selectHeightsByIndex' | |
1270 | name_parameter1 = 'minIndex' |
|
1270 | name_parameter1 = 'minIndex' | |
1271 | name_parameter2 = 'maxIndex' |
|
1271 | name_parameter2 = 'maxIndex' | |
1272 |
|
1272 | |||
1273 | opObj = puObj.addOperation(name=name_operation) |
|
1273 | opObj = puObj.addOperation(name=name_operation) | |
1274 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1274 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1275 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1275 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1276 |
|
1276 | |||
1277 | if self.specOpCebChannel.isChecked(): |
|
1277 | if self.specOpCebChannel.isChecked(): | |
1278 |
|
1278 | |||
1279 | if self.specOpComChannel.currentIndex() == 0: |
|
1279 | if self.specOpComChannel.currentIndex() == 0: | |
1280 | name_operation = "selectChannels" |
|
1280 | name_operation = "selectChannels" | |
1281 | name_parameter = 'channelList' |
|
1281 | name_parameter = 'channelList' | |
1282 | else: |
|
1282 | else: | |
1283 | name_operation = "selectChannelsByIndex" |
|
1283 | name_operation = "selectChannelsByIndex" | |
1284 | name_parameter = 'channelIndexList' |
|
1284 | name_parameter = 'channelIndexList' | |
1285 |
|
1285 | |||
1286 | format = 'intlist' |
|
1286 | format = 'intlist' | |
1287 | value = str(self.specOpChannel.text()) |
|
1287 | value = str(self.specOpChannel.text()) | |
1288 |
|
1288 | |||
1289 | if value == "": |
|
1289 | if value == "": | |
1290 | print "Please fill channel list" |
|
1290 | print "Please fill channel list" | |
1291 | return 0 |
|
1291 | return 0 | |
1292 |
|
1292 | |||
1293 | if not isList(value): |
|
1293 | if not isList(value): | |
1294 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1294 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1295 | return 0 |
|
1295 | return 0 | |
1296 |
|
1296 | |||
1297 | opObj = puObj.addOperation(name=name_operation) |
|
1297 | opObj = puObj.addOperation(name=name_operation) | |
1298 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1298 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1299 |
|
1299 | |||
1300 | if self.specOpCebIncoherent.isChecked(): |
|
1300 | if self.specOpCebIncoherent.isChecked(): | |
1301 |
|
1301 | |||
1302 | name_operation = 'IncohInt' |
|
1302 | name_operation = 'IncohInt' | |
1303 | optype = 'other' |
|
1303 | optype = 'other' | |
1304 |
|
1304 | |||
1305 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1305 | if self.specOpCobIncInt.currentIndex() == 0: | |
1306 | name_parameter = 'timeInterval' |
|
1306 | name_parameter = 'timeInterval' | |
1307 | format = 'float' |
|
1307 | format = 'float' | |
1308 | else: |
|
1308 | else: | |
1309 | name_parameter = 'n' |
|
1309 | name_parameter = 'n' | |
1310 | format = 'int' |
|
1310 | format = 'int' | |
1311 |
|
1311 | |||
1312 | value = str(self.specOpIncoherent.text()) |
|
1312 | value = str(self.specOpIncoherent.text()) | |
1313 |
|
1313 | |||
1314 | if value == "": |
|
1314 | if value == "": | |
1315 | print "Please fill Incoherent integration value" |
|
1315 | print "Please fill Incoherent integration value" | |
1316 | return 0 |
|
1316 | return 0 | |
1317 |
|
1317 | |||
1318 | if not isFloat(value): |
|
1318 | if not isFloat(value): | |
1319 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1319 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1320 | return 0 |
|
1320 | return 0 | |
1321 |
|
1321 | |||
1322 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1322 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1323 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1323 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1324 |
|
1324 | |||
1325 | if self.specOpCebRemoveDC.isChecked(): |
|
1325 | if self.specOpCebRemoveDC.isChecked(): | |
1326 | name_operation = 'removeDC' |
|
1326 | name_operation = 'removeDC' | |
1327 | name_parameter = 'mode' |
|
1327 | name_parameter = 'mode' | |
1328 | format = 'int' |
|
1328 | format = 'int' | |
1329 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1329 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1330 | value = 1 |
|
1330 | value = 1 | |
1331 | else: |
|
1331 | else: | |
1332 | value = 2 |
|
1332 | value = 2 | |
1333 | opObj = puObj.addOperation(name=name_operation) |
|
1333 | opObj = puObj.addOperation(name=name_operation) | |
1334 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1334 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1335 |
|
1335 | |||
1336 | if self.specOpCebRemoveInt.isChecked(): |
|
1336 | if self.specOpCebRemoveInt.isChecked(): | |
1337 | name_operation = 'removeInterference' |
|
1337 | name_operation = 'removeInterference' | |
1338 | opObj = puObj.addOperation(name=name_operation) |
|
1338 | opObj = puObj.addOperation(name=name_operation) | |
1339 |
|
1339 | |||
1340 |
|
1340 | |||
1341 | if self.specOpCebgetNoise.isChecked(): |
|
1341 | if self.specOpCebgetNoise.isChecked(): | |
1342 | value = str(self.specOpgetNoise.text()) |
|
1342 | value = str(self.specOpgetNoise.text()) | |
1343 | valueList = value.split(',') |
|
1343 | valueList = value.split(',') | |
1344 | format = 'float' |
|
1344 | format = 'float' | |
1345 | name_operation = "getNoise" |
|
1345 | name_operation = "getNoise" | |
1346 | opObj = puObj.addOperation(name=name_operation) |
|
1346 | opObj = puObj.addOperation(name=name_operation) | |
1347 |
|
1347 | |||
1348 | if not value == '': |
|
1348 | if not value == '': | |
1349 | valueList = value.split(',') |
|
1349 | valueList = value.split(',') | |
1350 | length = len(valueList) |
|
1350 | length = len(valueList) | |
1351 | if length == 1: |
|
1351 | if length == 1: | |
1352 | try: |
|
1352 | try: | |
1353 | value1 = float(valueList[0]) |
|
1353 | value1 = float(valueList[0]) | |
1354 | except: |
|
1354 | except: | |
1355 | self.console.clear() |
|
1355 | self.console.clear() | |
1356 | self.console.append("Please Write correct parameter Get Noise") |
|
1356 | self.console.append("Please Write correct parameter Get Noise") | |
1357 | return 0 |
|
1357 | return 0 | |
1358 | name1 = 'minHei' |
|
1358 | name1 = 'minHei' | |
1359 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1359 | opObj.addParameter(name=name1, value=value1, format=format) | |
1360 | elif length == 2: |
|
1360 | elif length == 2: | |
1361 | try: |
|
1361 | try: | |
1362 | value1 = float(valueList[0]) |
|
1362 | value1 = float(valueList[0]) | |
1363 | value2 = float(valueList[1]) |
|
1363 | value2 = float(valueList[1]) | |
1364 | except: |
|
1364 | except: | |
1365 | self.console.clear() |
|
1365 | self.console.clear() | |
1366 | self.console.append("Please Write corrects parameter Get Noise") |
|
1366 | self.console.append("Please Write corrects parameter Get Noise") | |
1367 | return 0 |
|
1367 | return 0 | |
1368 | name1 = 'minHei' |
|
1368 | name1 = 'minHei' | |
1369 | name2 = 'maxHei' |
|
1369 | name2 = 'maxHei' | |
1370 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1370 | opObj.addParameter(name=name1, value=value1, format=format) | |
1371 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1371 | opObj.addParameter(name=name2, value=value2, format=format) | |
1372 |
|
1372 | |||
1373 | elif length == 3: |
|
1373 | elif length == 3: | |
1374 | try: |
|
1374 | try: | |
1375 | value1 = float(valueList[0]) |
|
1375 | value1 = float(valueList[0]) | |
1376 | value2 = float(valueList[1]) |
|
1376 | value2 = float(valueList[1]) | |
1377 | value3 = float(valueList[2]) |
|
1377 | value3 = float(valueList[2]) | |
1378 | except: |
|
1378 | except: | |
1379 | self.console.clear() |
|
1379 | self.console.clear() | |
1380 | self.console.append("Please Write corrects parameter Get Noise") |
|
1380 | self.console.append("Please Write corrects parameter Get Noise") | |
1381 | return 0 |
|
1381 | return 0 | |
1382 | name1 = 'minHei' |
|
1382 | name1 = 'minHei' | |
1383 | name2 = 'maxHei' |
|
1383 | name2 = 'maxHei' | |
1384 | name3 = 'minVel' |
|
1384 | name3 = 'minVel' | |
1385 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1385 | opObj.addParameter(name=name1, value=value1, format=format) | |
1386 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1386 | opObj.addParameter(name=name2, value=value2, format=format) | |
1387 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1387 | opObj.addParameter(name=name3, value=value3, format=format) | |
1388 |
|
1388 | |||
1389 | elif length == 4: |
|
1389 | elif length == 4: | |
1390 | try: |
|
1390 | try: | |
1391 | value1 = float(valueList[0]) |
|
1391 | value1 = float(valueList[0]) | |
1392 | value2 = float(valueList[1]) |
|
1392 | value2 = float(valueList[1]) | |
1393 | value3 = float(valueList[2]) |
|
1393 | value3 = float(valueList[2]) | |
1394 | value4 = float(valueList[3]) |
|
1394 | value4 = float(valueList[3]) | |
1395 | except: |
|
1395 | except: | |
1396 | self.console.clear() |
|
1396 | self.console.clear() | |
1397 | self.console.append("Please Write corrects parameter Get Noise") |
|
1397 | self.console.append("Please Write corrects parameter Get Noise") | |
1398 | return 0 |
|
1398 | return 0 | |
1399 | name1 = 'minHei' |
|
1399 | name1 = 'minHei' | |
1400 | name2 = 'maxHei' |
|
1400 | name2 = 'maxHei' | |
1401 | name3 = 'minVel' |
|
1401 | name3 = 'minVel' | |
1402 | name4 = 'maxVel' |
|
1402 | name4 = 'maxVel' | |
1403 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1403 | opObj.addParameter(name=name1, value=value1, format=format) | |
1404 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1404 | opObj.addParameter(name=name2, value=value2, format=format) | |
1405 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1405 | opObj.addParameter(name=name3, value=value3, format=format) | |
1406 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1406 | opObj.addParameter(name=name4, value=value4, format=format) | |
1407 |
|
1407 | |||
1408 | elif length > 4: |
|
1408 | elif length > 4: | |
1409 | self.console.clear() |
|
1409 | self.console.clear() | |
1410 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1410 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1411 | return 0 |
|
1411 | return 0 | |
1412 |
|
1412 | |||
1413 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1413 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1414 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1414 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1415 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1415 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1416 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1416 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1417 |
|
1417 | |||
1418 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1418 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1419 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1419 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1420 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1420 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1421 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1421 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1422 |
|
1422 | |||
1423 | figpath = str(self.specGraphPath.text()) |
|
1423 | figpath = str(self.specGraphPath.text()) | |
1424 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1424 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1425 | try: |
|
1425 | try: | |
1426 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1426 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1427 | except: |
|
1427 | except: | |
1428 | wrperiod = None |
|
1428 | wrperiod = None | |
1429 |
|
1429 | |||
1430 | #-----Spectra Plot----- |
|
1430 | #-----Spectra Plot----- | |
1431 | if self.specGraphCebSpectraplot.isChecked(): |
|
1431 | if self.specGraphCebSpectraplot.isChecked(): | |
1432 |
|
1432 | |||
1433 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1433 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1434 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1434 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1435 |
|
1435 | |||
1436 | if not channelList == '': |
|
1436 | if not channelList == '': | |
1437 |
|
1437 | |||
1438 | if not isList(channelList): |
|
1438 | if not isList(channelList): | |
1439 | self.console.append("Invalid channelList") |
|
1439 | self.console.append("Invalid channelList") | |
1440 | return 0 |
|
1440 | return 0 | |
1441 |
|
1441 | |||
1442 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1442 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1443 |
|
1443 | |||
1444 | if not vel_range == '': |
|
1444 | if not vel_range == '': | |
1445 | xvalueList = vel_range.split(',') |
|
1445 | xvalueList = vel_range.split(',') | |
1446 | try: |
|
1446 | try: | |
1447 | value1 = float(xvalueList[0]) |
|
1447 | value1 = float(xvalueList[0]) | |
1448 | value2 = float(xvalueList[1]) |
|
1448 | value2 = float(xvalueList[1]) | |
1449 | except: |
|
1449 | except: | |
1450 | self.console.clear() |
|
1450 | self.console.clear() | |
1451 | self.console.append("Invalid velocity/frequency range") |
|
1451 | self.console.append("Invalid velocity/frequency range") | |
1452 | return 0 |
|
1452 | return 0 | |
1453 |
|
1453 | |||
1454 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1454 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1455 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1455 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1456 |
|
1456 | |||
1457 | if not hei_range == '': |
|
1457 | if not hei_range == '': | |
1458 | yvalueList = hei_range.split(",") |
|
1458 | yvalueList = hei_range.split(",") | |
1459 | try: |
|
1459 | try: | |
1460 | value1 = float(yvalueList[0]) |
|
1460 | value1 = float(yvalueList[0]) | |
1461 | value2 = float(yvalueList[1]) |
|
1461 | value2 = float(yvalueList[1]) | |
1462 | except: |
|
1462 | except: | |
1463 | self.console.clear() |
|
1463 | self.console.clear() | |
1464 | self.console.append("Invalid height range") |
|
1464 | self.console.append("Invalid height range") | |
1465 | return 0 |
|
1465 | return 0 | |
1466 |
|
1466 | |||
1467 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1467 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1468 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1468 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1469 |
|
1469 | |||
1470 | if not db_range == '': |
|
1470 | if not db_range == '': | |
1471 | zvalueList = db_range.split(",") |
|
1471 | zvalueList = db_range.split(",") | |
1472 | try: |
|
1472 | try: | |
1473 | value1 = float(zvalueList[0]) |
|
1473 | value1 = float(zvalueList[0]) | |
1474 | value2 = float(zvalueList[1]) |
|
1474 | value2 = float(zvalueList[1]) | |
1475 | except: |
|
1475 | except: | |
1476 | self.console.clear() |
|
1476 | self.console.clear() | |
1477 | self.console.append("Invalid db range") |
|
1477 | self.console.append("Invalid db range") | |
1478 | return 0 |
|
1478 | return 0 | |
1479 |
|
1479 | |||
1480 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1480 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1481 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1481 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1482 |
|
1482 | |||
1483 | if self.specGraphSaveSpectra.isChecked(): |
|
1483 | if self.specGraphSaveSpectra.isChecked(): | |
1484 | checkPath = True |
|
1484 | checkPath = True | |
1485 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1485 | opObj.addParameter(name='save', value=1 , format='bool') | |
1486 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1486 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1487 | if figfile: |
|
1487 | if figfile: | |
1488 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1488 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1489 | if wrperiod: |
|
1489 | if wrperiod: | |
1490 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1490 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1491 |
|
1491 | |||
1492 | if self.specGraphftpSpectra.isChecked(): |
|
1492 | if self.specGraphftpSpectra.isChecked(): | |
1493 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1493 | opObj.addParameter(name='ftp', value='1', format='int') | |
1494 | self.addFTPConf2Operation(puObj, opObj) |
|
1494 | self.addFTPConf2Operation(puObj, opObj) | |
1495 | addFTP = True |
|
1495 | addFTP = True | |
1496 |
|
1496 | |||
1497 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1497 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1498 |
|
1498 | |||
1499 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1499 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1500 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1500 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1501 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1501 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1502 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1502 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1503 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1503 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1504 |
|
1504 | |||
1505 | if not vel_range == '': |
|
1505 | if not vel_range == '': | |
1506 | xvalueList = vel_range.split(',') |
|
1506 | xvalueList = vel_range.split(',') | |
1507 | try: |
|
1507 | try: | |
1508 | value1 = float(xvalueList[0]) |
|
1508 | value1 = float(xvalueList[0]) | |
1509 | value2 = float(xvalueList[1]) |
|
1509 | value2 = float(xvalueList[1]) | |
1510 | except: |
|
1510 | except: | |
1511 | self.console.clear() |
|
1511 | self.console.clear() | |
1512 | self.console.append("Invalid velocity/frequency range") |
|
1512 | self.console.append("Invalid velocity/frequency range") | |
1513 | return 0 |
|
1513 | return 0 | |
1514 |
|
1514 | |||
1515 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1515 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1516 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1516 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1517 |
|
1517 | |||
1518 | if not hei_range == '': |
|
1518 | if not hei_range == '': | |
1519 | yvalueList = hei_range.split(",") |
|
1519 | yvalueList = hei_range.split(",") | |
1520 | try: |
|
1520 | try: | |
1521 | value1 = float(yvalueList[0]) |
|
1521 | value1 = float(yvalueList[0]) | |
1522 | value2 = float(yvalueList[1]) |
|
1522 | value2 = float(yvalueList[1]) | |
1523 | except: |
|
1523 | except: | |
1524 | self.console.clear() |
|
1524 | self.console.clear() | |
1525 | self.console.append("Invalid height range") |
|
1525 | self.console.append("Invalid height range") | |
1526 | return 0 |
|
1526 | return 0 | |
1527 |
|
1527 | |||
1528 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1528 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1529 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1529 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1530 |
|
1530 | |||
1531 | if not db_range == '': |
|
1531 | if not db_range == '': | |
1532 | zvalueList = db_range.split(",") |
|
1532 | zvalueList = db_range.split(",") | |
1533 | try: |
|
1533 | try: | |
1534 | value1 = float(zvalueList[0]) |
|
1534 | value1 = float(zvalueList[0]) | |
1535 | value2 = float(zvalueList[1]) |
|
1535 | value2 = float(zvalueList[1]) | |
1536 | except: |
|
1536 | except: | |
1537 | self.console.clear() |
|
1537 | self.console.clear() | |
1538 | self.console.append("Invalid db range") |
|
1538 | self.console.append("Invalid db range") | |
1539 | return 0 |
|
1539 | return 0 | |
1540 |
|
1540 | |||
1541 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1541 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1542 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1542 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1543 |
|
1543 | |||
1544 | if not magrange == '': |
|
1544 | if not magrange == '': | |
1545 | zvalueList = magrange.split(",") |
|
1545 | zvalueList = magrange.split(",") | |
1546 | try: |
|
1546 | try: | |
1547 | value1 = float(zvalueList[0]) |
|
1547 | value1 = float(zvalueList[0]) | |
1548 | value2 = float(zvalueList[1]) |
|
1548 | value2 = float(zvalueList[1]) | |
1549 | except: |
|
1549 | except: | |
1550 | self.console.clear() |
|
1550 | self.console.clear() | |
1551 | self.console.append("Invalid magnitude range") |
|
1551 | self.console.append("Invalid magnitude range") | |
1552 | return 0 |
|
1552 | return 0 | |
1553 |
|
1553 | |||
1554 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1554 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1555 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1555 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1556 |
|
1556 | |||
1557 | if not phaserange == '': |
|
1557 | if not phaserange == '': | |
1558 | zvalueList = phaserange.split(",") |
|
1558 | zvalueList = phaserange.split(",") | |
1559 | try: |
|
1559 | try: | |
1560 | value1 = float(zvalueList[0]) |
|
1560 | value1 = float(zvalueList[0]) | |
1561 | value2 = float(zvalueList[1]) |
|
1561 | value2 = float(zvalueList[1]) | |
1562 | except: |
|
1562 | except: | |
1563 | self.console.clear() |
|
1563 | self.console.clear() | |
1564 | self.console.append("Invalid phase range") |
|
1564 | self.console.append("Invalid phase range") | |
1565 | return 0 |
|
1565 | return 0 | |
1566 |
|
1566 | |||
1567 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1567 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1568 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1568 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1569 |
|
1569 | |||
1570 | if self.specGraphSaveCross.isChecked(): |
|
1570 | if self.specGraphSaveCross.isChecked(): | |
1571 | checkPath = True |
|
1571 | checkPath = True | |
1572 | opObj.addParameter(name='save', value='1', format='bool') |
|
1572 | opObj.addParameter(name='save', value='1', format='bool') | |
1573 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1573 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1574 | if figfile: |
|
1574 | if figfile: | |
1575 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1575 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1576 | if wrperiod: |
|
1576 | if wrperiod: | |
1577 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1577 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1578 |
|
1578 | |||
1579 | if self.specGraphftpCross.isChecked(): |
|
1579 | if self.specGraphftpCross.isChecked(): | |
1580 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1580 | opObj.addParameter(name='ftp', value='1', format='int') | |
1581 | self.addFTPConf2Operation(puObj, opObj) |
|
1581 | self.addFTPConf2Operation(puObj, opObj) | |
1582 | addFTP = True |
|
1582 | addFTP = True | |
1583 |
|
1583 | |||
1584 | if self.specGraphCebRTIplot.isChecked(): |
|
1584 | if self.specGraphCebRTIplot.isChecked(): | |
1585 |
|
1585 | |||
1586 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1586 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1587 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1587 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1588 |
|
1588 | |||
1589 | if not channelList == '': |
|
1589 | if not channelList == '': | |
1590 | if not isList(channelList): |
|
1590 | if not isList(channelList): | |
1591 | self.console.append("Invalid channelList") |
|
1591 | self.console.append("Invalid channelList") | |
1592 | return 0 |
|
1592 | return 0 | |
1593 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1593 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1594 |
|
1594 | |||
1595 | if not trange == '': |
|
1595 | if not trange == '': | |
1596 | xvalueList = trange.split(',') |
|
1596 | xvalueList = trange.split(',') | |
1597 | try: |
|
1597 | try: | |
1598 | value1 = float(xvalueList[0]) |
|
1598 | value1 = float(xvalueList[0]) | |
1599 | value2 = float(xvalueList[1]) |
|
1599 | value2 = float(xvalueList[1]) | |
1600 | except: |
|
1600 | except: | |
1601 | self.console.clear() |
|
1601 | self.console.clear() | |
1602 | self.console.append("Invalid time range") |
|
1602 | self.console.append("Invalid time range") | |
1603 | return 0 |
|
1603 | return 0 | |
1604 |
|
1604 | |||
1605 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1605 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1606 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1606 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1607 |
|
1607 | |||
1608 | # if not timerange == '': |
|
1608 | # if not timerange == '': | |
1609 | # try: |
|
1609 | # try: | |
1610 | # timerange = float(timerange) |
|
1610 | # timerange = float(timerange) | |
1611 | # except: |
|
1611 | # except: | |
1612 | # self.console.clear() |
|
1612 | # self.console.clear() | |
1613 | # self.console.append("Invalid time range") |
|
1613 | # self.console.append("Invalid time range") | |
1614 | # return 0 |
|
1614 | # return 0 | |
1615 | # |
|
1615 | # | |
1616 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1616 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1617 |
|
1617 | |||
1618 | if not hei_range == '': |
|
1618 | if not hei_range == '': | |
1619 | yvalueList = hei_range.split(",") |
|
1619 | yvalueList = hei_range.split(",") | |
1620 | try: |
|
1620 | try: | |
1621 | value1 = float(yvalueList[0]) |
|
1621 | value1 = float(yvalueList[0]) | |
1622 | value2 = float(yvalueList[1]) |
|
1622 | value2 = float(yvalueList[1]) | |
1623 | except: |
|
1623 | except: | |
1624 | self.console.clear() |
|
1624 | self.console.clear() | |
1625 | self.console.append("Invalid height range") |
|
1625 | self.console.append("Invalid height range") | |
1626 | return 0 |
|
1626 | return 0 | |
1627 |
|
1627 | |||
1628 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1628 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1629 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1629 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1630 |
|
1630 | |||
1631 | if not db_range == '': |
|
1631 | if not db_range == '': | |
1632 | zvalueList = db_range.split(",") |
|
1632 | zvalueList = db_range.split(",") | |
1633 | try: |
|
1633 | try: | |
1634 | value1 = float(zvalueList[0]) |
|
1634 | value1 = float(zvalueList[0]) | |
1635 | value2 = float(zvalueList[1]) |
|
1635 | value2 = float(zvalueList[1]) | |
1636 | except: |
|
1636 | except: | |
1637 | self.console.clear() |
|
1637 | self.console.clear() | |
1638 | self.console.append("Invalid db range") |
|
1638 | self.console.append("Invalid db range") | |
1639 | return 0 |
|
1639 | return 0 | |
1640 |
|
1640 | |||
1641 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1641 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1642 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1642 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1643 |
|
1643 | |||
1644 | if self.specGraphSaveRTIplot.isChecked(): |
|
1644 | if self.specGraphSaveRTIplot.isChecked(): | |
1645 | checkPath = True |
|
1645 | checkPath = True | |
1646 | opObj.addParameter(name='save', value='1', format='bool') |
|
1646 | opObj.addParameter(name='save', value='1', format='bool') | |
1647 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1647 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1648 | if figfile: |
|
1648 | if figfile: | |
1649 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1649 | opObj.addParameter(name='figfile', value=value, format='str') | |
1650 | if wrperiod: |
|
1650 | if wrperiod: | |
1651 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1651 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1652 |
|
1652 | |||
1653 | if self.specGraphftpRTIplot.isChecked(): |
|
1653 | if self.specGraphftpRTIplot.isChecked(): | |
1654 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1654 | opObj.addParameter(name='ftp', value='1', format='int') | |
1655 | self.addFTPConf2Operation(puObj, opObj) |
|
1655 | self.addFTPConf2Operation(puObj, opObj) | |
1656 | addFTP = True |
|
1656 | addFTP = True | |
1657 |
|
1657 | |||
1658 | if self.specGraphCebCoherencmap.isChecked(): |
|
1658 | if self.specGraphCebCoherencmap.isChecked(): | |
1659 |
|
1659 | |||
1660 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1660 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1661 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1661 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1662 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1662 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1663 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1663 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1664 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1664 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1665 |
|
1665 | |||
1666 | # if not timerange == '': |
|
1666 | # if not timerange == '': | |
1667 | # try: |
|
1667 | # try: | |
1668 | # timerange = int(timerange) |
|
1668 | # timerange = int(timerange) | |
1669 | # except: |
|
1669 | # except: | |
1670 | # self.console.clear() |
|
1670 | # self.console.clear() | |
1671 | # self.console.append("Invalid time range") |
|
1671 | # self.console.append("Invalid time range") | |
1672 | # return 0 |
|
1672 | # return 0 | |
1673 | # |
|
1673 | # | |
1674 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1674 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1675 |
|
1675 | |||
1676 | if not trange == '': |
|
1676 | if not trange == '': | |
1677 | xvalueList = trange.split(',') |
|
1677 | xvalueList = trange.split(',') | |
1678 | try: |
|
1678 | try: | |
1679 | value1 = float(xvalueList[0]) |
|
1679 | value1 = float(xvalueList[0]) | |
1680 | value2 = float(xvalueList[1]) |
|
1680 | value2 = float(xvalueList[1]) | |
1681 | except: |
|
1681 | except: | |
1682 | self.console.clear() |
|
1682 | self.console.clear() | |
1683 | self.console.append("Invalid time range") |
|
1683 | self.console.append("Invalid time range") | |
1684 | return 0 |
|
1684 | return 0 | |
1685 |
|
1685 | |||
1686 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1686 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1687 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1687 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1688 |
|
1688 | |||
1689 | if not hei_range == '': |
|
1689 | if not hei_range == '': | |
1690 | yvalueList = hei_range.split(",") |
|
1690 | yvalueList = hei_range.split(",") | |
1691 | try: |
|
1691 | try: | |
1692 | value1 = float(yvalueList[0]) |
|
1692 | value1 = float(yvalueList[0]) | |
1693 | value2 = float(yvalueList[1]) |
|
1693 | value2 = float(yvalueList[1]) | |
1694 | except: |
|
1694 | except: | |
1695 | self.console.clear() |
|
1695 | self.console.clear() | |
1696 | self.console.append("Invalid height range") |
|
1696 | self.console.append("Invalid height range") | |
1697 | return 0 |
|
1697 | return 0 | |
1698 |
|
1698 | |||
1699 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1699 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1700 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1700 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1701 |
|
1701 | |||
1702 | if not magrange == '': |
|
1702 | if not magrange == '': | |
1703 | zvalueList = magrange.split(",") |
|
1703 | zvalueList = magrange.split(",") | |
1704 | try: |
|
1704 | try: | |
1705 | value1 = float(zvalueList[0]) |
|
1705 | value1 = float(zvalueList[0]) | |
1706 | value2 = float(zvalueList[1]) |
|
1706 | value2 = float(zvalueList[1]) | |
1707 | except: |
|
1707 | except: | |
1708 | self.console.clear() |
|
1708 | self.console.clear() | |
1709 | self.console.append("Invalid magnitude range") |
|
1709 | self.console.append("Invalid magnitude range") | |
1710 | return 0 |
|
1710 | return 0 | |
1711 |
|
1711 | |||
1712 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1712 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1713 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1713 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1714 |
|
1714 | |||
1715 | if not phaserange == '': |
|
1715 | if not phaserange == '': | |
1716 | zvalueList = phaserange.split(",") |
|
1716 | zvalueList = phaserange.split(",") | |
1717 | try: |
|
1717 | try: | |
1718 | value1 = float(zvalueList[0]) |
|
1718 | value1 = float(zvalueList[0]) | |
1719 | value2 = float(zvalueList[1]) |
|
1719 | value2 = float(zvalueList[1]) | |
1720 | except: |
|
1720 | except: | |
1721 | self.console.clear() |
|
1721 | self.console.clear() | |
1722 | self.console.append("Invalid phase range") |
|
1722 | self.console.append("Invalid phase range") | |
1723 | return 0 |
|
1723 | return 0 | |
1724 |
|
1724 | |||
1725 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1725 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1726 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1726 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1727 |
|
1727 | |||
1728 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1728 | if self.specGraphSaveCoherencemap.isChecked(): | |
1729 | checkPath = True |
|
1729 | checkPath = True | |
1730 | opObj.addParameter(name='save', value='1', format='bool') |
|
1730 | opObj.addParameter(name='save', value='1', format='bool') | |
1731 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1731 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1732 | if figfile: |
|
1732 | if figfile: | |
1733 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1733 | opObj.addParameter(name='figfile', value=value, format='str') | |
1734 | if wrperiod: |
|
1734 | if wrperiod: | |
1735 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1735 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1736 |
|
1736 | |||
1737 | if self.specGraphftpCoherencemap.isChecked(): |
|
1737 | if self.specGraphftpCoherencemap.isChecked(): | |
1738 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1738 | opObj.addParameter(name='ftp', value='1', format='int') | |
1739 | self.addFTPConf2Operation(puObj, opObj) |
|
1739 | self.addFTPConf2Operation(puObj, opObj) | |
1740 | addFTP = True |
|
1740 | addFTP = True | |
1741 |
|
1741 | |||
1742 | if self.specGraphPowerprofile.isChecked(): |
|
1742 | if self.specGraphPowerprofile.isChecked(): | |
1743 |
|
1743 | |||
1744 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1744 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1745 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1745 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1746 |
|
1746 | |||
1747 | if not channelList == '': |
|
1747 | if not channelList == '': | |
1748 | if not isList(channelList): |
|
1748 | if not isList(channelList): | |
1749 | self.console.append("Invalid channelList") |
|
1749 | self.console.append("Invalid channelList") | |
1750 | return 0 |
|
1750 | return 0 | |
1751 |
|
1751 | |||
1752 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1752 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1753 |
|
1753 | |||
1754 | if not db_range == '': |
|
1754 | if not db_range == '': | |
1755 | xvalueList = db_range.split(',') |
|
1755 | xvalueList = db_range.split(',') | |
1756 | try: |
|
1756 | try: | |
1757 | value1 = float(xvalueList[0]) |
|
1757 | value1 = float(xvalueList[0]) | |
1758 | value2 = float(xvalueList[1]) |
|
1758 | value2 = float(xvalueList[1]) | |
1759 | except: |
|
1759 | except: | |
1760 | self.console.clear() |
|
1760 | self.console.clear() | |
1761 | self.console.append("Invalid db range") |
|
1761 | self.console.append("Invalid db range") | |
1762 | return 0 |
|
1762 | return 0 | |
1763 |
|
1763 | |||
1764 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1764 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1765 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1765 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1766 |
|
1766 | |||
1767 | if not hei_range == '': |
|
1767 | if not hei_range == '': | |
1768 | yvalueList = hei_range.split(",") |
|
1768 | yvalueList = hei_range.split(",") | |
1769 | try: |
|
1769 | try: | |
1770 | value1 = float(yvalueList[0]) |
|
1770 | value1 = float(yvalueList[0]) | |
1771 | value2 = float(yvalueList[1]) |
|
1771 | value2 = float(yvalueList[1]) | |
1772 | except: |
|
1772 | except: | |
1773 | self.console.clear() |
|
1773 | self.console.clear() | |
1774 | self.console.append("Invalid height range") |
|
1774 | self.console.append("Invalid height range") | |
1775 | return 0 |
|
1775 | return 0 | |
1776 |
|
1776 | |||
1777 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1777 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1778 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1778 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1779 |
|
1779 | |||
1780 | if self.specGraphSavePowerprofile.isChecked(): |
|
1780 | if self.specGraphSavePowerprofile.isChecked(): | |
1781 | checkPath = True |
|
1781 | checkPath = True | |
1782 | opObj.addParameter(name='save', value='1', format='bool') |
|
1782 | opObj.addParameter(name='save', value='1', format='bool') | |
1783 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1783 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1784 | if figfile: |
|
1784 | if figfile: | |
1785 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1785 | opObj.addParameter(name='figfile', value=value, format='str') | |
1786 | if wrperiod: |
|
1786 | if wrperiod: | |
1787 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1787 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1788 |
|
1788 | |||
1789 | if self.specGraphftpPowerprofile.isChecked(): |
|
1789 | if self.specGraphftpPowerprofile.isChecked(): | |
1790 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1790 | opObj.addParameter(name='ftp', value='1', format='int') | |
1791 | self.addFTPConf2Operation(puObj, opObj) |
|
1791 | self.addFTPConf2Operation(puObj, opObj) | |
1792 | addFTP = True |
|
1792 | addFTP = True | |
1793 | # rti noise |
|
1793 | # rti noise | |
1794 |
|
1794 | |||
1795 | if self.specGraphCebRTInoise.isChecked(): |
|
1795 | if self.specGraphCebRTInoise.isChecked(): | |
1796 |
|
1796 | |||
1797 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1797 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1798 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1798 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1799 |
|
1799 | |||
1800 | if not channelList == '': |
|
1800 | if not channelList == '': | |
1801 | if not isList(channelList): |
|
1801 | if not isList(channelList): | |
1802 | self.console.append("Invalid channelList") |
|
1802 | self.console.append("Invalid channelList") | |
1803 | return 0 |
|
1803 | return 0 | |
1804 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1804 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1805 |
|
1805 | |||
1806 | # if not timerange == '': |
|
1806 | # if not timerange == '': | |
1807 | # try: |
|
1807 | # try: | |
1808 | # timerange = float(timerange) |
|
1808 | # timerange = float(timerange) | |
1809 | # except: |
|
1809 | # except: | |
1810 | # self.console.clear() |
|
1810 | # self.console.clear() | |
1811 | # self.console.append("Invalid time range") |
|
1811 | # self.console.append("Invalid time range") | |
1812 | # return 0 |
|
1812 | # return 0 | |
1813 | # |
|
1813 | # | |
1814 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1814 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1815 |
|
1815 | |||
1816 | if not trange == '': |
|
1816 | if not trange == '': | |
1817 | xvalueList = trange.split(',') |
|
1817 | xvalueList = trange.split(',') | |
1818 | try: |
|
1818 | try: | |
1819 | value1 = float(xvalueList[0]) |
|
1819 | value1 = float(xvalueList[0]) | |
1820 | value2 = float(xvalueList[1]) |
|
1820 | value2 = float(xvalueList[1]) | |
1821 | except: |
|
1821 | except: | |
1822 | self.console.clear() |
|
1822 | self.console.clear() | |
1823 | self.console.append("Invalid time range") |
|
1823 | self.console.append("Invalid time range") | |
1824 | return 0 |
|
1824 | return 0 | |
1825 |
|
1825 | |||
1826 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1826 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1827 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1827 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1828 |
|
1828 | |||
1829 | if not db_range == '': |
|
1829 | if not db_range == '': | |
1830 | yvalueList = db_range.split(",") |
|
1830 | yvalueList = db_range.split(",") | |
1831 | try: |
|
1831 | try: | |
1832 | value1 = float(yvalueList[0]) |
|
1832 | value1 = float(yvalueList[0]) | |
1833 | value2 = float(yvalueList[1]) |
|
1833 | value2 = float(yvalueList[1]) | |
1834 | except: |
|
1834 | except: | |
1835 | self.console.clear() |
|
1835 | self.console.clear() | |
1836 | self.console.append("Invalid db range") |
|
1836 | self.console.append("Invalid db range") | |
1837 | return 0 |
|
1837 | return 0 | |
1838 |
|
1838 | |||
1839 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1839 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1840 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1840 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1841 |
|
1841 | |||
1842 | if self.specGraphSaveRTInoise.isChecked(): |
|
1842 | if self.specGraphSaveRTInoise.isChecked(): | |
1843 | checkPath = True |
|
1843 | checkPath = True | |
1844 | opObj.addParameter(name='save', value='1', format='bool') |
|
1844 | opObj.addParameter(name='save', value='1', format='bool') | |
1845 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1845 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1846 | if figfile: |
|
1846 | if figfile: | |
1847 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1847 | opObj.addParameter(name='figfile', value=value, format='str') | |
1848 | if wrperiod: |
|
1848 | if wrperiod: | |
1849 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1849 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1850 |
|
1850 | |||
1851 | # test_ftp |
|
1851 | # test_ftp | |
1852 | if self.specGraphftpRTInoise.isChecked(): |
|
1852 | if self.specGraphftpRTInoise.isChecked(): | |
1853 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1853 | opObj.addParameter(name='ftp', value='1', format='int') | |
1854 | self.addFTPConf2Operation(puObj, opObj) |
|
1854 | self.addFTPConf2Operation(puObj, opObj) | |
1855 | addFTP = True |
|
1855 | addFTP = True | |
1856 |
|
1856 | |||
1857 | if checkPath: |
|
1857 | if checkPath: | |
1858 | if not figpath: |
|
1858 | if not figpath: | |
1859 | self.console.clear() |
|
1859 | self.console.clear() | |
1860 | self.console.append("Graphic path should be defined") |
|
1860 | self.console.append("Graphic path should be defined") | |
1861 | return 0 |
|
1861 | return 0 | |
1862 |
|
1862 | |||
1863 | if addFTP and not figpath: |
|
1863 | if addFTP and not figpath: | |
1864 | self.console.clear() |
|
1864 | self.console.clear() | |
1865 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1865 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1866 | return 0 |
|
1866 | return 0 | |
1867 |
|
1867 | |||
1868 | # if something happend |
|
1868 | # if something happend | |
1869 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1869 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1870 | if parms_ok: |
|
1870 | if parms_ok: | |
1871 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1871 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1872 | opObj.addParameter(name='path', value=output_path) |
|
1872 | opObj.addParameter(name='path', value=output_path) | |
1873 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1873 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1874 |
|
1874 | |||
1875 | self.console.clear() |
|
1875 | self.console.clear() | |
1876 | try: |
|
1876 | try: | |
1877 | self.refreshPUProperties(puObj) |
|
1877 | self.refreshPUProperties(puObj) | |
1878 | except: |
|
1878 | except: | |
1879 | self.console.append("An error reading input parameters was found ... Check them!") |
|
1879 | self.console.append("An error reading input parameters was found ... Check them!") | |
1880 | return 0 |
|
1880 | return 0 | |
1881 |
|
1881 | |||
1882 | self.console.append("Save your project and press Play button to start signal processing") |
|
1882 | self.console.append("Save your project and press Play button to start signal processing") | |
1883 |
|
1883 | |||
1884 | self._enable_play_button() |
|
1884 | self._enable_play_button() | |
1885 | self._enable_save_button() |
|
1885 | self._enable_save_button() | |
1886 |
|
1886 | |||
1887 | return 1 |
|
1887 | return 1 | |
1888 |
|
1888 | |||
1889 | """ |
|
1889 | """ | |
1890 | Spectra Graph |
|
1890 | Spectra Graph | |
1891 | """ |
|
1891 | """ | |
1892 | @pyqtSignature("int") |
|
1892 | @pyqtSignature("int") | |
1893 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1893 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1894 |
|
1894 | |||
1895 | self.__checkSpecGraphFilters() |
|
1895 | self.__checkSpecGraphFilters() | |
1896 |
|
1896 | |||
1897 |
|
1897 | |||
1898 | @pyqtSignature("int") |
|
1898 | @pyqtSignature("int") | |
1899 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1899 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1900 |
|
1900 | |||
1901 | self.__checkSpecGraphFilters() |
|
1901 | self.__checkSpecGraphFilters() | |
1902 |
|
1902 | |||
1903 | @pyqtSignature("int") |
|
1903 | @pyqtSignature("int") | |
1904 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1904 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1905 |
|
1905 | |||
1906 | self.__checkSpecGraphFilters() |
|
1906 | self.__checkSpecGraphFilters() | |
1907 |
|
1907 | |||
1908 |
|
1908 | |||
1909 | @pyqtSignature("int") |
|
1909 | @pyqtSignature("int") | |
1910 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1910 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1911 |
|
1911 | |||
1912 | self.__checkSpecGraphFilters() |
|
1912 | self.__checkSpecGraphFilters() | |
1913 |
|
1913 | |||
1914 |
|
1914 | |||
1915 | @pyqtSignature("int") |
|
1915 | @pyqtSignature("int") | |
1916 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1916 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1917 |
|
1917 | |||
1918 | self.__checkSpecGraphFilters() |
|
1918 | self.__checkSpecGraphFilters() | |
1919 |
|
1919 | |||
1920 | @pyqtSignature("int") |
|
1920 | @pyqtSignature("int") | |
1921 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1921 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1922 |
|
1922 | |||
1923 | self.__checkSpecGraphFilters() |
|
1923 | self.__checkSpecGraphFilters() | |
1924 |
|
1924 | |||
1925 | @pyqtSignature("int") |
|
1925 | @pyqtSignature("int") | |
1926 | def on_specGraphPhase_stateChanged(self, p0): |
|
1926 | def on_specGraphPhase_stateChanged(self, p0): | |
1927 |
|
1927 | |||
1928 | self.__checkSpecGraphFilters() |
|
1928 | self.__checkSpecGraphFilters() | |
1929 |
|
1929 | |||
1930 | @pyqtSignature("int") |
|
1930 | @pyqtSignature("int") | |
1931 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1931 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1932 | """ |
|
1932 | """ | |
1933 | """ |
|
1933 | """ | |
1934 | self.__checkSpecGraphSaving() |
|
1934 | self.__checkSpecGraphSaving() | |
1935 |
|
1935 | |||
1936 | @pyqtSignature("int") |
|
1936 | @pyqtSignature("int") | |
1937 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1937 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1938 |
|
1938 | |||
1939 | self.__checkSpecGraphSaving() |
|
1939 | self.__checkSpecGraphSaving() | |
1940 |
|
1940 | |||
1941 | @pyqtSignature("int") |
|
1941 | @pyqtSignature("int") | |
1942 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1942 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1943 |
|
1943 | |||
1944 | self.__checkSpecGraphSaving() |
|
1944 | self.__checkSpecGraphSaving() | |
1945 |
|
1945 | |||
1946 | @pyqtSignature("int") |
|
1946 | @pyqtSignature("int") | |
1947 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1947 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1948 |
|
1948 | |||
1949 | self.__checkSpecGraphSaving() |
|
1949 | self.__checkSpecGraphSaving() | |
1950 |
|
1950 | |||
1951 | @pyqtSignature("int") |
|
1951 | @pyqtSignature("int") | |
1952 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1952 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1953 |
|
1953 | |||
1954 | self.__checkSpecGraphSaving() |
|
1954 | self.__checkSpecGraphSaving() | |
1955 |
|
1955 | |||
1956 | @pyqtSignature("int") |
|
1956 | @pyqtSignature("int") | |
1957 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1957 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1958 |
|
1958 | |||
1959 | self.__checkSpecGraphSaving() |
|
1959 | self.__checkSpecGraphSaving() | |
1960 |
|
1960 | |||
1961 | @pyqtSignature("int") |
|
1961 | @pyqtSignature("int") | |
1962 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1962 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1963 | """ |
|
1963 | """ | |
1964 | """ |
|
1964 | """ | |
1965 | self.__checkSpecGraphFTP() |
|
1965 | self.__checkSpecGraphFTP() | |
1966 |
|
1966 | |||
1967 |
|
1967 | |||
1968 | @pyqtSignature("int") |
|
1968 | @pyqtSignature("int") | |
1969 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1969 | def on_specGraphftpCross_stateChanged(self, p0): | |
1970 |
|
1970 | |||
1971 | self.__checkSpecGraphFTP() |
|
1971 | self.__checkSpecGraphFTP() | |
1972 |
|
1972 | |||
1973 | @pyqtSignature("int") |
|
1973 | @pyqtSignature("int") | |
1974 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1974 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1975 |
|
1975 | |||
1976 | self.__checkSpecGraphFTP() |
|
1976 | self.__checkSpecGraphFTP() | |
1977 |
|
1977 | |||
1978 | @pyqtSignature("int") |
|
1978 | @pyqtSignature("int") | |
1979 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1979 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1980 |
|
1980 | |||
1981 | self.__checkSpecGraphFTP() |
|
1981 | self.__checkSpecGraphFTP() | |
1982 |
|
1982 | |||
1983 | @pyqtSignature("int") |
|
1983 | @pyqtSignature("int") | |
1984 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1984 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1985 |
|
1985 | |||
1986 | self.__checkSpecGraphFTP() |
|
1986 | self.__checkSpecGraphFTP() | |
1987 |
|
1987 | |||
1988 | @pyqtSignature("int") |
|
1988 | @pyqtSignature("int") | |
1989 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1989 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1990 |
|
1990 | |||
1991 | self.__checkSpecGraphFTP() |
|
1991 | self.__checkSpecGraphFTP() | |
1992 |
|
1992 | |||
1993 | @pyqtSignature("") |
|
1993 | @pyqtSignature("") | |
1994 | def on_specGraphToolPath_clicked(self): |
|
1994 | def on_specGraphToolPath_clicked(self): | |
1995 | """ |
|
1995 | """ | |
1996 | """ |
|
1996 | """ | |
1997 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1997 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1998 | self.specGraphPath.setText(save_path) |
|
1998 | self.specGraphPath.setText(save_path) | |
1999 | if not os.path.exists(save_path): |
|
1999 | if not os.path.exists(save_path): | |
2000 | self.console.clear() |
|
2000 | self.console.clear() | |
2001 | self.console.append("Write a valid path") |
|
2001 | self.console.append("Write a valid path") | |
2002 | return |
|
2002 | return | |
2003 |
|
2003 | |||
2004 | @pyqtSignature("") |
|
2004 | @pyqtSignature("") | |
2005 | def on_specGraphClear_clicked(self): |
|
2005 | def on_specGraphClear_clicked(self): | |
2006 | return |
|
2006 | return | |
2007 |
|
2007 | |||
2008 | @pyqtSignature("") |
|
2008 | @pyqtSignature("") | |
2009 | def on_specHeisGraphToolPath_clicked(self): |
|
2009 | def on_specHeisGraphToolPath_clicked(self): | |
2010 | """ |
|
2010 | """ | |
2011 | """ |
|
2011 | """ | |
2012 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2012 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2013 | self.specHeisGraphPath.setText(save_path) |
|
2013 | self.specHeisGraphPath.setText(save_path) | |
2014 | if not os.path.exists(save_path): |
|
2014 | if not os.path.exists(save_path): | |
2015 | self.console.clear() |
|
2015 | self.console.clear() | |
2016 | self.console.append("Write a valid path") |
|
2016 | self.console.append("Write a valid path") | |
2017 | return |
|
2017 | return | |
2018 |
|
2018 | |||
2019 | @pyqtSignature("int") |
|
2019 | @pyqtSignature("int") | |
2020 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2020 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2021 | """ |
|
2021 | """ | |
2022 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2022 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2023 | """ |
|
2023 | """ | |
2024 | if p0 == 2: |
|
2024 | if p0 == 2: | |
2025 | self.specHeisOpIncoherent.setEnabled(True) |
|
2025 | self.specHeisOpIncoherent.setEnabled(True) | |
2026 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2026 | self.specHeisOpCobIncInt.setEnabled(True) | |
2027 | if p0 == 0: |
|
2027 | if p0 == 0: | |
2028 | self.specHeisOpIncoherent.setEnabled(False) |
|
2028 | self.specHeisOpIncoherent.setEnabled(False) | |
2029 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2029 | self.specHeisOpCobIncInt.setEnabled(False) | |
2030 |
|
2030 | |||
2031 | @pyqtSignature("") |
|
2031 | @pyqtSignature("") | |
2032 | def on_specHeisOpOk_clicked(self): |
|
2032 | def on_specHeisOpOk_clicked(self): | |
2033 | """ |
|
2033 | """ | |
2034 | AΓADE OPERACION SPECTRAHEIS |
|
2034 | AΓADE OPERACION SPECTRAHEIS | |
2035 | """ |
|
2035 | """ | |
2036 | addFTP = False |
|
2036 | addFTP = False | |
2037 | checkPath = False |
|
2037 | checkPath = False | |
2038 |
|
2038 | |||
2039 | self._disable_play_button() |
|
2039 | self._disable_play_button() | |
2040 | self._disable_save_button() |
|
2040 | self._disable_save_button() | |
2041 |
|
2041 | |||
2042 | self.console.clear() |
|
2042 | self.console.clear() | |
2043 | self.console.append("Checking input parameters ...") |
|
2043 | self.console.append("Checking input parameters ...") | |
2044 |
|
2044 | |||
2045 | puObj = self.getSelectedItemObj() |
|
2045 | puObj = self.getSelectedItemObj() | |
2046 | puObj.removeOperations() |
|
2046 | puObj.removeOperations() | |
2047 |
|
2047 | |||
2048 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2048 | if self.specHeisOpCebIncoherent.isChecked(): | |
2049 | value = str(self.specHeisOpIncoherent.text()) |
|
2049 | value = str(self.specHeisOpIncoherent.text()) | |
2050 | name_operation = 'IncohInt4SpectraHeis' |
|
2050 | name_operation = 'IncohInt4SpectraHeis' | |
2051 | optype = 'other' |
|
2051 | optype = 'other' | |
2052 |
|
2052 | |||
2053 | name_parameter = 'timeInterval' |
|
2053 | name_parameter = 'timeInterval' | |
2054 | format = 'float' |
|
2054 | format = 'float' | |
2055 |
|
2055 | |||
2056 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2056 | if self.specOpCobIncInt.currentIndex() == 0: | |
2057 | name_parameter = 'timeInterval' |
|
2057 | name_parameter = 'timeInterval' | |
2058 | format = 'float' |
|
2058 | format = 'float' | |
2059 |
|
2059 | |||
2060 | if not isFloat(value): |
|
2060 | if not isFloat(value): | |
2061 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2061 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2062 | return 0 |
|
2062 | return 0 | |
2063 |
|
2063 | |||
2064 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2064 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2065 |
|
2065 | |||
2066 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2066 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2067 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2067 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2068 | return 0 |
|
2068 | return 0 | |
2069 |
|
2069 | |||
2070 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2070 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2071 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2071 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2072 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2072 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2073 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2073 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2074 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2074 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2075 |
|
2075 | |||
2076 | # ---- Spectra Plot----- |
|
2076 | # ---- Spectra Plot----- | |
2077 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2077 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2078 |
|
2078 | |||
2079 | name_operation = 'SpectraHeisScope' |
|
2079 | name_operation = 'SpectraHeisScope' | |
2080 | optype = 'other' |
|
2080 | optype = 'other' | |
2081 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2081 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2082 |
|
2082 | |||
2083 | name_parameter = 'id' |
|
2083 | name_parameter = 'id' | |
2084 | format = 'int' |
|
2084 | format = 'int' | |
2085 | value = opObj.id |
|
2085 | value = opObj.id | |
2086 |
|
2086 | |||
2087 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2087 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2088 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2088 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2089 | return 0 |
|
2089 | return 0 | |
2090 |
|
2090 | |||
2091 | if not (channelList == ''): |
|
2091 | if not (channelList == ''): | |
2092 | name_parameter = 'channelList' |
|
2092 | name_parameter = 'channelList' | |
2093 | format = 'intlist' |
|
2093 | format = 'intlist' | |
2094 |
|
2094 | |||
2095 | if not isList(channelList): |
|
2095 | if not isList(channelList): | |
2096 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2096 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2097 | return 0 |
|
2097 | return 0 | |
2098 |
|
2098 | |||
2099 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2099 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2100 |
|
2100 | |||
2101 | if not freq_range == '': |
|
2101 | if not freq_range == '': | |
2102 | xvalueList = freq_range.split(',') |
|
2102 | xvalueList = freq_range.split(',') | |
2103 |
|
2103 | |||
2104 | if len(xvalueList) != 2: |
|
2104 | if len(xvalueList) != 2: | |
2105 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2105 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2106 | return 0 |
|
2106 | return 0 | |
2107 |
|
2107 | |||
2108 | value1 = xvalueList[0] |
|
2108 | value1 = xvalueList[0] | |
2109 | value2 = xvalueList[1] |
|
2109 | value2 = xvalueList[1] | |
2110 |
|
2110 | |||
2111 | if not isFloat(value1) or not isFloat(value2): |
|
2111 | if not isFloat(value1) or not isFloat(value2): | |
2112 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2112 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2113 | return 0 |
|
2113 | return 0 | |
2114 |
|
2114 | |||
2115 | name1 = 'xmin' |
|
2115 | name1 = 'xmin' | |
2116 | name2 = 'xmax' |
|
2116 | name2 = 'xmax' | |
2117 | format = 'float' |
|
2117 | format = 'float' | |
2118 |
|
2118 | |||
2119 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2119 | opObj.addParameter(name=name1, value=value1, format=format) | |
2120 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2120 | opObj.addParameter(name=name2, value=value2, format=format) | |
2121 |
|
2121 | |||
2122 | #------specHeisGgraphYmin-Ymax--- |
|
2122 | #------specHeisGgraphYmin-Ymax--- | |
2123 | if not power_range == '': |
|
2123 | if not power_range == '': | |
2124 | yvalueList = power_range.split(",") |
|
2124 | yvalueList = power_range.split(",") | |
2125 |
|
2125 | |||
2126 | if len(yvalueList) != 2: |
|
2126 | if len(yvalueList) != 2: | |
2127 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2127 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2128 | return 0 |
|
2128 | return 0 | |
2129 |
|
2129 | |||
2130 | value1 = yvalueList[0] |
|
2130 | value1 = yvalueList[0] | |
2131 | value2 = yvalueList[1] |
|
2131 | value2 = yvalueList[1] | |
2132 |
|
2132 | |||
2133 | if not isFloat(value1) or not isFloat(value2): |
|
2133 | if not isFloat(value1) or not isFloat(value2): | |
2134 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2134 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2135 | return 0 |
|
2135 | return 0 | |
2136 |
|
2136 | |||
2137 | name1 = 'ymin' |
|
2137 | name1 = 'ymin' | |
2138 | name2 = 'ymax' |
|
2138 | name2 = 'ymax' | |
2139 | format = 'float' |
|
2139 | format = 'float' | |
2140 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2140 | opObj.addParameter(name=name1, value=value1, format=format) | |
2141 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2141 | opObj.addParameter(name=name2, value=value2, format=format) | |
2142 |
|
2142 | |||
2143 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2143 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2144 | checkPath = True |
|
2144 | checkPath = True | |
2145 | name_parameter1 = 'save' |
|
2145 | name_parameter1 = 'save' | |
2146 | name_parameter2 = 'figpath' |
|
2146 | name_parameter2 = 'figpath' | |
2147 | name_parameter3 = 'figfile' |
|
2147 | name_parameter3 = 'figfile' | |
2148 | value1 = '1' |
|
2148 | value1 = '1' | |
2149 | value2 = str(self.specHeisGraphPath.text()) |
|
2149 | value2 = str(self.specHeisGraphPath.text()) | |
2150 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2150 | value3 = str(self.specHeisGraphPrefix.text()) | |
2151 | format1 = 'bool' |
|
2151 | format1 = 'bool' | |
2152 | format2 = 'str' |
|
2152 | format2 = 'str' | |
2153 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2153 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2154 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2154 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2155 | if not value3 == "": |
|
2155 | if not value3 == "": | |
2156 | try: |
|
2156 | try: | |
2157 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2157 | value3 = str(self.specHeisGraphPrefix.text()) | |
2158 | except: |
|
2158 | except: | |
2159 | self.console.clear() |
|
2159 | self.console.clear() | |
2160 | self.console.append("Please Write prefix") |
|
2160 | self.console.append("Please Write prefix") | |
2161 | return 0 |
|
2161 | return 0 | |
2162 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2162 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2163 |
|
2163 | |||
2164 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2164 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2165 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2165 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2166 |
|
2166 | |||
2167 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2167 | if self.specHeisGraphftpSpectra.isChecked(): | |
2168 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2168 | opObj.addParameter(name='ftp', value='1', format='int') | |
2169 | self.addFTPConf2Operation(puObj, opObj) |
|
2169 | self.addFTPConf2Operation(puObj, opObj) | |
2170 | addFTP = True |
|
2170 | addFTP = True | |
2171 |
|
2171 | |||
2172 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2172 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2173 | name_operation = 'RTIfromSpectraHeis' |
|
2173 | name_operation = 'RTIfromSpectraHeis' | |
2174 | optype = 'other' |
|
2174 | optype = 'other' | |
2175 |
|
2175 | |||
2176 | name_parameter = 'id' |
|
2176 | name_parameter = 'id' | |
2177 | format = 'int' |
|
2177 | format = 'int' | |
2178 |
|
2178 | |||
2179 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2179 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2180 | value = opObj.id |
|
2180 | value = opObj.id | |
2181 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2181 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2182 |
|
2182 | |||
2183 | if not channelList == '': |
|
2183 | if not channelList == '': | |
2184 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2184 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2185 |
|
2185 | |||
2186 | if not time_range == '': |
|
2186 | if not time_range == '': | |
2187 | xvalueList = time_range.split(',') |
|
2187 | xvalueList = time_range.split(',') | |
2188 | try: |
|
2188 | try: | |
2189 | value = float(xvalueList[0]) |
|
2189 | value = float(xvalueList[0]) | |
2190 | value = float(xvalueList[1]) |
|
2190 | value = float(xvalueList[1]) | |
2191 | except: |
|
2191 | except: | |
2192 | return 0 |
|
2192 | return 0 | |
2193 | format = 'float' |
|
2193 | format = 'float' | |
2194 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2194 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2195 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2195 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2196 |
|
2196 | |||
2197 | if not timerange == '': |
|
2197 | if not timerange == '': | |
2198 | format = 'int' |
|
2198 | format = 'int' | |
2199 | try: |
|
2199 | try: | |
2200 | timerange = int(timerange) |
|
2200 | timerange = int(timerange) | |
2201 | except: |
|
2201 | except: | |
2202 | return 0 |
|
2202 | return 0 | |
2203 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2203 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2204 |
|
2204 | |||
2205 |
|
2205 | |||
2206 | if not power_range == '': |
|
2206 | if not power_range == '': | |
2207 | yvalueList = power_range.split(",") |
|
2207 | yvalueList = power_range.split(",") | |
2208 | try: |
|
2208 | try: | |
2209 | value = float(yvalueList[0]) |
|
2209 | value = float(yvalueList[0]) | |
2210 | value = float(yvalueList[1]) |
|
2210 | value = float(yvalueList[1]) | |
2211 | except: |
|
2211 | except: | |
2212 | return 0 |
|
2212 | return 0 | |
2213 |
|
2213 | |||
2214 | format = 'float' |
|
2214 | format = 'float' | |
2215 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2215 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2216 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2216 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2217 |
|
2217 | |||
2218 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2218 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2219 | checkPath = True |
|
2219 | checkPath = True | |
2220 | opObj.addParameter(name='save', value='1', format='bool') |
|
2220 | opObj.addParameter(name='save', value='1', format='bool') | |
2221 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2221 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2222 | value = str(self.specHeisGraphPrefix.text()) |
|
2222 | value = str(self.specHeisGraphPrefix.text()) | |
2223 | if not value == "": |
|
2223 | if not value == "": | |
2224 | try: |
|
2224 | try: | |
2225 | value = str(self.specHeisGraphPrefix.text()) |
|
2225 | value = str(self.specHeisGraphPrefix.text()) | |
2226 | except: |
|
2226 | except: | |
2227 | self.console.clear() |
|
2227 | self.console.clear() | |
2228 | self.console.append("Please Write prefix") |
|
2228 | self.console.append("Please Write prefix") | |
2229 | return 0 |
|
2229 | return 0 | |
2230 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2230 | opObj.addParameter(name='figfile', value=value, format='str') | |
2231 |
|
2231 | |||
2232 | # test_ftp |
|
2232 | # test_ftp | |
2233 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2233 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2234 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2234 | opObj.addParameter(name='ftp', value='1', format='int') | |
2235 | self.addFTPConf2Operation(puObj, opObj) |
|
2235 | self.addFTPConf2Operation(puObj, opObj) | |
2236 | addFTP = True |
|
2236 | addFTP = True | |
2237 |
|
2237 | |||
2238 | localfolder = None |
|
2238 | localfolder = None | |
2239 | if checkPath: |
|
2239 | if checkPath: | |
2240 | localfolder = str(self.specHeisGraphPath.text()) |
|
2240 | localfolder = str(self.specHeisGraphPath.text()) | |
2241 | if localfolder == '': |
|
2241 | if localfolder == '': | |
2242 | self.console.clear() |
|
2242 | self.console.clear() | |
2243 | self.console.append("Graphic path should be defined") |
|
2243 | self.console.append("Graphic path should be defined") | |
2244 | return 0 |
|
2244 | return 0 | |
2245 |
|
2245 | |||
2246 | if addFTP and not localfolder: |
|
2246 | if addFTP and not localfolder: | |
2247 | self.console.clear() |
|
2247 | self.console.clear() | |
2248 | self.console.append("You should save plots before send them to FTP Server") |
|
2248 | self.console.append("You should save plots before send them to FTP Server") | |
2249 | return 0 |
|
2249 | return 0 | |
2250 |
|
2250 | |||
2251 | # if something happened |
|
2251 | # if something happened | |
2252 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2252 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2253 | if parms_ok: |
|
2253 | if parms_ok: | |
2254 | name_operation = 'FitsWriter' |
|
2254 | name_operation = 'FitsWriter' | |
2255 | optype = 'other' |
|
2255 | optype = 'other' | |
2256 | name_parameter1 = 'path' |
|
2256 | name_parameter1 = 'path' | |
2257 | name_parameter2 = 'dataBlocksPerFile' |
|
2257 | name_parameter2 = 'dataBlocksPerFile' | |
2258 | name_parameter3 = 'metadatafile' |
|
2258 | name_parameter3 = 'metadatafile' | |
2259 | value1 = output_path |
|
2259 | value1 = output_path | |
2260 | value2 = blocksperfile |
|
2260 | value2 = blocksperfile | |
2261 | value3 = metadata_file |
|
2261 | value3 = metadata_file | |
2262 | format2 = "int" |
|
2262 | format2 = "int" | |
2263 | format3 = "str" |
|
2263 | format3 = "str" | |
2264 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2264 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2265 |
|
2265 | |||
2266 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2266 | opObj.addParameter(name=name_parameter1, value=value1) | |
2267 |
|
2267 | |||
2268 | if blocksperfile: |
|
2268 | if blocksperfile: | |
2269 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2269 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2270 |
|
2270 | |||
2271 | if metadata_file: |
|
2271 | if metadata_file: | |
2272 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2272 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2273 |
|
2273 | |||
2274 | self.console.clear() |
|
2274 | self.console.clear() | |
2275 | try: |
|
2275 | try: | |
2276 | self.refreshPUProperties(puObj) |
|
2276 | self.refreshPUProperties(puObj) | |
2277 | except: |
|
2277 | except: | |
2278 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2278 | self.console.append("An error reading input parameters was found ... Check them!") | |
2279 | return 0 |
|
2279 | return 0 | |
2280 |
|
2280 | |||
2281 | self.console.append("Save your project and press Play button to start signal processing") |
|
2281 | self.console.append("Save your project and press Play button to start signal processing") | |
2282 |
|
2282 | |||
2283 | self._enable_save_button() |
|
2283 | self._enable_save_button() | |
2284 | self._enable_play_button() |
|
2284 | self._enable_play_button() | |
2285 |
|
2285 | |||
2286 | return 1 |
|
2286 | return 1 | |
2287 | @pyqtSignature("int") |
|
2287 | @pyqtSignature("int") | |
2288 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2288 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2289 |
|
2289 | |||
2290 | if p0 == 2: |
|
2290 | if p0 == 2: | |
2291 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2291 | self.specHeisGgraphChannelList.setEnabled(True) | |
2292 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2292 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2293 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2293 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2294 | if p0 == 0: |
|
2294 | if p0 == 0: | |
2295 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2295 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2296 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2296 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2297 |
|
2297 | |||
2298 | @pyqtSignature("int") |
|
2298 | @pyqtSignature("int") | |
2299 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2299 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2300 |
|
2300 | |||
2301 | if p0 == 2: |
|
2301 | if p0 == 2: | |
2302 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2302 | self.specHeisGgraphChannelList.setEnabled(True) | |
2303 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2303 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2304 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2304 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2305 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2305 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2306 |
|
2306 | |||
2307 | if p0 == 0: |
|
2307 | if p0 == 0: | |
2308 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2308 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2309 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2309 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2310 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2310 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2311 |
|
2311 | |||
2312 | @pyqtSignature("int") |
|
2312 | @pyqtSignature("int") | |
2313 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2313 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2314 | """ |
|
2314 | """ | |
2315 | """ |
|
2315 | """ | |
2316 | if p0 == 2: |
|
2316 | if p0 == 2: | |
2317 | self.specHeisGraphPath.setEnabled(True) |
|
2317 | self.specHeisGraphPath.setEnabled(True) | |
2318 | self.specHeisGraphPrefix.setEnabled(True) |
|
2318 | self.specHeisGraphPrefix.setEnabled(True) | |
2319 | self.specHeisGraphToolPath.setEnabled(True) |
|
2319 | self.specHeisGraphToolPath.setEnabled(True) | |
2320 | if p0 == 0: |
|
2320 | if p0 == 0: | |
2321 | self.specHeisGraphPath.setEnabled(False) |
|
2321 | self.specHeisGraphPath.setEnabled(False) | |
2322 | self.specHeisGraphPrefix.setEnabled(False) |
|
2322 | self.specHeisGraphPrefix.setEnabled(False) | |
2323 | self.specHeisGraphToolPath.setEnabled(False) |
|
2323 | self.specHeisGraphToolPath.setEnabled(False) | |
2324 |
|
2324 | |||
2325 | @pyqtSignature("int") |
|
2325 | @pyqtSignature("int") | |
2326 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2326 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2327 | if p0 == 2: |
|
2327 | if p0 == 2: | |
2328 | self.specHeisGraphPath.setEnabled(True) |
|
2328 | self.specHeisGraphPath.setEnabled(True) | |
2329 | self.specHeisGraphPrefix.setEnabled(True) |
|
2329 | self.specHeisGraphPrefix.setEnabled(True) | |
2330 | self.specHeisGraphToolPath.setEnabled(True) |
|
2330 | self.specHeisGraphToolPath.setEnabled(True) | |
2331 |
|
2331 | |||
2332 | @pyqtSignature("int") |
|
2332 | @pyqtSignature("int") | |
2333 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2333 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2334 | """ |
|
2334 | """ | |
2335 | """ |
|
2335 | """ | |
2336 | if p0 == 2: |
|
2336 | if p0 == 2: | |
2337 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2337 | self.specHeisGgraphftpratio.setEnabled(True) | |
2338 |
|
2338 | |||
2339 | if p0 == 0: |
|
2339 | if p0 == 0: | |
2340 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2340 | self.specHeisGgraphftpratio.setEnabled(False) | |
2341 |
|
2341 | |||
2342 | @pyqtSignature("int") |
|
2342 | @pyqtSignature("int") | |
2343 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2343 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2344 | if p0 == 2: |
|
2344 | if p0 == 2: | |
2345 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2345 | self.specHeisGgraphftpratio.setEnabled(True) | |
2346 |
|
2346 | |||
2347 | @pyqtSignature("") |
|
2347 | @pyqtSignature("") | |
2348 | def on_specHeisGraphClear_clicked(self): |
|
2348 | def on_specHeisGraphClear_clicked(self): | |
2349 | pass |
|
2349 | pass | |
2350 |
|
2350 | |||
2351 | def __checkSpecGraphSaving(self): |
|
2351 | def __checkSpecGraphSaving(self): | |
2352 |
|
2352 | |||
2353 | enable = False |
|
2353 | enable = False | |
2354 |
|
2354 | |||
2355 | if self.specGraphSaveSpectra.checkState(): |
|
2355 | if self.specGraphSaveSpectra.checkState(): | |
2356 | enable = True |
|
2356 | enable = True | |
2357 |
|
2357 | |||
2358 | if self.specGraphSaveCross.checkState(): |
|
2358 | if self.specGraphSaveCross.checkState(): | |
2359 | enable = True |
|
2359 | enable = True | |
2360 |
|
2360 | |||
2361 | if self.specGraphSaveRTIplot.checkState(): |
|
2361 | if self.specGraphSaveRTIplot.checkState(): | |
2362 | enable = True |
|
2362 | enable = True | |
2363 |
|
2363 | |||
2364 | if self.specGraphSaveCoherencemap.checkState(): |
|
2364 | if self.specGraphSaveCoherencemap.checkState(): | |
2365 | enable = True |
|
2365 | enable = True | |
2366 |
|
2366 | |||
2367 | if self.specGraphSavePowerprofile.checkState(): |
|
2367 | if self.specGraphSavePowerprofile.checkState(): | |
2368 | enable = True |
|
2368 | enable = True | |
2369 |
|
2369 | |||
2370 | if self.specGraphSaveRTInoise.checkState(): |
|
2370 | if self.specGraphSaveRTInoise.checkState(): | |
2371 | enable = True |
|
2371 | enable = True | |
2372 |
|
2372 | |||
2373 | self.specGraphPath.setEnabled(enable) |
|
2373 | self.specGraphPath.setEnabled(enable) | |
2374 | self.specGraphPrefix.setEnabled(enable) |
|
2374 | self.specGraphPrefix.setEnabled(enable) | |
2375 | self.specGraphToolPath.setEnabled(enable) |
|
2375 | self.specGraphToolPath.setEnabled(enable) | |
2376 |
|
2376 | |||
2377 | self.specGgraphftpratio.setEnabled(enable) |
|
2377 | self.specGgraphftpratio.setEnabled(enable) | |
2378 |
|
2378 | |||
2379 | def __checkSpecGraphFTP(self): |
|
2379 | def __checkSpecGraphFTP(self): | |
2380 |
|
2380 | |||
2381 | enable = False |
|
2381 | enable = False | |
2382 |
|
2382 | |||
2383 | if self.specGraphftpSpectra.checkState(): |
|
2383 | if self.specGraphftpSpectra.checkState(): | |
2384 | enable = True |
|
2384 | enable = True | |
2385 |
|
2385 | |||
2386 | if self.specGraphftpCross.checkState(): |
|
2386 | if self.specGraphftpCross.checkState(): | |
2387 | enable = True |
|
2387 | enable = True | |
2388 |
|
2388 | |||
2389 | if self.specGraphftpRTIplot.checkState(): |
|
2389 | if self.specGraphftpRTIplot.checkState(): | |
2390 | enable = True |
|
2390 | enable = True | |
2391 |
|
2391 | |||
2392 | if self.specGraphftpCoherencemap.checkState(): |
|
2392 | if self.specGraphftpCoherencemap.checkState(): | |
2393 | enable = True |
|
2393 | enable = True | |
2394 |
|
2394 | |||
2395 | if self.specGraphftpPowerprofile.checkState(): |
|
2395 | if self.specGraphftpPowerprofile.checkState(): | |
2396 | enable = True |
|
2396 | enable = True | |
2397 |
|
2397 | |||
2398 | if self.specGraphftpRTInoise.checkState(): |
|
2398 | if self.specGraphftpRTInoise.checkState(): | |
2399 | enable = True |
|
2399 | enable = True | |
2400 |
|
2400 | |||
2401 | # self.specGgraphftpratio.setEnabled(enable) |
|
2401 | # self.specGgraphftpratio.setEnabled(enable) | |
2402 |
|
2402 | |||
2403 | def __checkSpecGraphFilters(self): |
|
2403 | def __checkSpecGraphFilters(self): | |
2404 |
|
2404 | |||
2405 | freq = False |
|
2405 | freq = False | |
2406 | height = False |
|
2406 | height = False | |
2407 | db = False |
|
2407 | db = False | |
2408 | time = False |
|
2408 | time = False | |
2409 | magnitud = False |
|
2409 | magnitud = False | |
2410 | phase = False |
|
2410 | phase = False | |
2411 | channelList = False |
|
2411 | channelList = False | |
2412 |
|
2412 | |||
2413 | if self.specGraphCebSpectraplot.checkState(): |
|
2413 | if self.specGraphCebSpectraplot.checkState(): | |
2414 | freq = True |
|
2414 | freq = True | |
2415 | height = True |
|
2415 | height = True | |
2416 | db = True |
|
2416 | db = True | |
2417 | channelList = True |
|
2417 | channelList = True | |
2418 |
|
2418 | |||
2419 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2419 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2420 | freq = True |
|
2420 | freq = True | |
2421 | height = True |
|
2421 | height = True | |
2422 | db = True |
|
2422 | db = True | |
2423 | magnitud = True |
|
2423 | magnitud = True | |
2424 | phase = True |
|
2424 | phase = True | |
2425 |
|
2425 | |||
2426 | if self.specGraphCebRTIplot.checkState(): |
|
2426 | if self.specGraphCebRTIplot.checkState(): | |
2427 | height = True |
|
2427 | height = True | |
2428 | db = True |
|
2428 | db = True | |
2429 | time = True |
|
2429 | time = True | |
2430 | channelList = True |
|
2430 | channelList = True | |
2431 |
|
2431 | |||
2432 | if self.specGraphCebCoherencmap.checkState(): |
|
2432 | if self.specGraphCebCoherencmap.checkState(): | |
2433 | height = True |
|
2433 | height = True | |
2434 | time = True |
|
2434 | time = True | |
2435 | magnitud = True |
|
2435 | magnitud = True | |
2436 | phase = True |
|
2436 | phase = True | |
2437 |
|
2437 | |||
2438 | if self.specGraphPowerprofile.checkState(): |
|
2438 | if self.specGraphPowerprofile.checkState(): | |
2439 | height = True |
|
2439 | height = True | |
2440 | db = True |
|
2440 | db = True | |
2441 | channelList = True |
|
2441 | channelList = True | |
2442 |
|
2442 | |||
2443 | if self.specGraphCebRTInoise.checkState(): |
|
2443 | if self.specGraphCebRTInoise.checkState(): | |
2444 | db = True |
|
2444 | db = True | |
2445 | time = True |
|
2445 | time = True | |
2446 | channelList = True |
|
2446 | channelList = True | |
2447 |
|
2447 | |||
2448 |
|
2448 | |||
2449 | self.specGgraphFreq.setEnabled(freq) |
|
2449 | self.specGgraphFreq.setEnabled(freq) | |
2450 | self.specGgraphHeight.setEnabled(height) |
|
2450 | self.specGgraphHeight.setEnabled(height) | |
2451 | self.specGgraphDbsrange.setEnabled(db) |
|
2451 | self.specGgraphDbsrange.setEnabled(db) | |
2452 | self.specGgraphTminTmax.setEnabled(time) |
|
2452 | self.specGgraphTminTmax.setEnabled(time) | |
2453 |
|
2453 | |||
2454 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2454 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2455 | self.specGgraphPhase.setEnabled(phase) |
|
2455 | self.specGgraphPhase.setEnabled(phase) | |
2456 | self.specGgraphChannelList.setEnabled(channelList) |
|
2456 | self.specGgraphChannelList.setEnabled(channelList) | |
2457 |
|
2457 | |||
2458 | def __getParmsFromProjectWindow(self): |
|
2458 | def __getParmsFromProjectWindow(self): | |
2459 | """ |
|
2459 | """ | |
2460 | Check Inputs Project: |
|
2460 | Check Inputs Project: | |
2461 | - project_name |
|
2461 | - project_name | |
2462 | - datatype |
|
2462 | - datatype | |
2463 | - ext |
|
2463 | - ext | |
2464 | - data_path |
|
2464 | - data_path | |
2465 | - readmode |
|
2465 | - readmode | |
2466 | - delay |
|
2466 | - delay | |
2467 | - set |
|
2467 | - set | |
2468 | - walk |
|
2468 | - walk | |
2469 | """ |
|
2469 | """ | |
2470 | parms_ok = True |
|
2470 | parms_ok = True | |
2471 |
|
2471 | |||
2472 | project_name = str(self.proName.text()) |
|
2472 | project_name = str(self.proName.text()) | |
2473 |
|
2473 | |||
2474 | if project_name == '' or project_name == None: |
|
2474 | if project_name == '' or project_name == None: | |
2475 | outputstr = "Enter a project Name" |
|
2475 | outputstr = "Enter a project Name" | |
2476 | self.console.append(outputstr) |
|
2476 | self.console.append(outputstr) | |
2477 | parms_ok = False |
|
2477 | parms_ok = False | |
2478 | project_name = None |
|
2478 | project_name = None | |
2479 |
|
2479 | |||
2480 | description = str(self.proDescription.toPlainText()) |
|
2480 | description = str(self.proDescription.toPlainText()) | |
2481 |
|
2481 | |||
2482 | datatype = str(self.proComDataType.currentText()) |
|
2482 | datatype = str(self.proComDataType.currentText()) | |
2483 |
|
2483 | |||
2484 | ext = str(self.proDataType.text()) |
|
2484 | ext = str(self.proDataType.text()) | |
2485 |
|
2485 | |||
2486 | dpath = str(self.proDataPath.text()) |
|
2486 | dpath = str(self.proDataPath.text()) | |
2487 |
|
2487 | |||
2488 | if dpath == '': |
|
2488 | if dpath == '': | |
2489 | outputstr = 'Datapath is empty' |
|
2489 | outputstr = 'Datapath is empty' | |
2490 | self.console.append(outputstr) |
|
2490 | self.console.append(outputstr) | |
2491 | parms_ok = False |
|
2491 | parms_ok = False | |
2492 | dpath = None |
|
2492 | dpath = None | |
2493 |
|
2493 | |||
2494 | if dpath != None: |
|
2494 | if dpath != None: | |
2495 | if not os.path.isdir(dpath): |
|
2495 | if not os.path.isdir(dpath): | |
2496 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2496 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2497 | self.console.append(outputstr) |
|
2497 | self.console.append(outputstr) | |
2498 | parms_ok = False |
|
2498 | parms_ok = False | |
2499 | dpath = None |
|
2499 | dpath = None | |
2500 |
|
2500 | |||
2501 | online = int(self.proComReadMode.currentIndex()) |
|
2501 | online = int(self.proComReadMode.currentIndex()) | |
2502 |
|
2502 | |||
2503 | delay = None |
|
2503 | delay = None | |
2504 | if online==1: |
|
2504 | if online==1: | |
2505 | try: |
|
2505 | try: | |
2506 | delay = int(str(self.proDelay.text())) |
|
2506 | delay = int(str(self.proDelay.text())) | |
2507 | except: |
|
2507 | except: | |
2508 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2508 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2509 | self.console.append(outputstr) |
|
2509 | self.console.append(outputstr) | |
2510 | parms_ok = False |
|
2510 | parms_ok = False | |
2511 |
|
2511 | |||
2512 |
|
2512 | |||
2513 | set = None |
|
2513 | set = None | |
2514 | value = str(self.proSet.text()) |
|
2514 | value = str(self.proSet.text()) | |
2515 | try: |
|
2515 | try: | |
2516 | set = int(value) |
|
2516 | set = int(value) | |
2517 | except: |
|
2517 | except: | |
2518 | pass |
|
2518 | pass | |
2519 |
|
2519 | |||
2520 | ippKm = None |
|
2520 | ippKm = None | |
2521 |
|
2521 | |||
2522 | value = str(self.proIPPKm.text()) |
|
2522 | value = str(self.proIPPKm.text()) | |
2523 |
|
2523 | |||
2524 | try: |
|
2524 | try: | |
2525 | ippKm = float(value) |
|
2525 | ippKm = float(value) | |
2526 | except: |
|
2526 | except: | |
2527 | if datatype=="USRP": |
|
2527 | if datatype=="USRP": | |
2528 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2528 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2529 | self.console.append(outputstr) |
|
2529 | self.console.append(outputstr) | |
2530 | parms_ok = False |
|
2530 | parms_ok = False | |
2531 |
|
2531 | |||
2532 | walk = int(self.proComWalk.currentIndex()) |
|
2532 | walk = int(self.proComWalk.currentIndex()) | |
2533 | expLabel = str(self.proExpLabel.text()) |
|
2533 | expLabel = str(self.proExpLabel.text()) | |
2534 |
|
2534 | |||
2535 | startDate = str(self.proComStartDate.currentText()) |
|
2535 | startDate = str(self.proComStartDate.currentText()) | |
2536 | endDate = str(self.proComEndDate.currentText()) |
|
2536 | endDate = str(self.proComEndDate.currentText()) | |
2537 |
|
2537 | |||
2538 | # startDateList = startDate.split("/") |
|
2538 | # startDateList = startDate.split("/") | |
2539 | # endDateList = endDate.split("/") |
|
2539 | # endDateList = endDate.split("/") | |
2540 | # |
|
2540 | # | |
2541 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2541 | # 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])) |
|
2542 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2543 |
|
2543 | |||
2544 | startTime = self.proStartTime.time() |
|
2544 | startTime = self.proStartTime.time() | |
2545 | endTime = self.proEndTime.time() |
|
2545 | endTime = self.proEndTime.time() | |
2546 |
|
2546 | |||
2547 | startTime = str(startTime.toString("H:m:s")) |
|
2547 | startTime = str(startTime.toString("H:m:s")) | |
2548 | endTime = str(endTime.toString("H:m:s")) |
|
2548 | endTime = str(endTime.toString("H:m:s")) | |
2549 |
|
2549 | |||
2550 | projectParms = ProjectParms() |
|
2550 | projectParms = ProjectParms() | |
2551 |
|
2551 | |||
2552 | projectParms.name = project_name |
|
2552 | projectParms.name = project_name | |
2553 | projectParms.description = description |
|
2553 | projectParms.description = description | |
2554 | projectParms.datatype = datatype |
|
2554 | projectParms.datatype = datatype | |
2555 | projectParms.ext = ext |
|
2555 | projectParms.ext = ext | |
2556 | projectParms.dpath = dpath |
|
2556 | projectParms.dpath = dpath | |
2557 | projectParms.online = online |
|
2557 | projectParms.online = online | |
2558 | projectParms.startDate = startDate |
|
2558 | projectParms.startDate = startDate | |
2559 | projectParms.endDate = endDate |
|
2559 | projectParms.endDate = endDate | |
2560 | projectParms.startTime = startTime |
|
2560 | projectParms.startTime = startTime | |
2561 | projectParms.endTime = endTime |
|
2561 | projectParms.endTime = endTime | |
2562 | projectParms.delay = delay |
|
2562 | projectParms.delay = delay | |
2563 | projectParms.walk = walk |
|
2563 | projectParms.walk = walk | |
2564 | projectParms.expLabel = expLabel |
|
2564 | projectParms.expLabel = expLabel | |
2565 | projectParms.set = set |
|
2565 | projectParms.set = set | |
2566 | projectParms.ippKm = ippKm |
|
2566 | projectParms.ippKm = ippKm | |
2567 | projectParms.parmsOk = parms_ok |
|
2567 | projectParms.parmsOk = parms_ok | |
2568 |
|
2568 | |||
2569 | return projectParms |
|
2569 | return projectParms | |
2570 |
|
2570 | |||
2571 |
|
2571 | |||
2572 | def __getParmsFromProjectObj(self, projectObjView): |
|
2572 | def __getParmsFromProjectObj(self, projectObjView): | |
2573 |
|
2573 | |||
2574 | parms_ok = True |
|
2574 | parms_ok = True | |
2575 |
|
2575 | |||
2576 | project_name, description = projectObjView.name, projectObjView.description |
|
2576 | project_name, description = projectObjView.name, projectObjView.description | |
2577 |
|
2577 | |||
2578 | readUnitObj = projectObjView.getReadUnitObj() |
|
2578 | readUnitObj = projectObjView.getReadUnitObj() | |
2579 | datatype = readUnitObj.datatype |
|
2579 | datatype = readUnitObj.datatype | |
2580 |
|
2580 | |||
2581 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2581 | operationObj = readUnitObj.getOperationObj(name='run') | |
2582 |
|
2582 | |||
2583 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2583 | dpath = operationObj.getParameterValue(parameterName='path') | |
2584 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2584 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2585 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2585 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2586 |
|
2586 | |||
2587 | startDate = startDate.strftime("%Y/%m/%d") |
|
2587 | startDate = startDate.strftime("%Y/%m/%d") | |
2588 | endDate = endDate.strftime("%Y/%m/%d") |
|
2588 | endDate = endDate.strftime("%Y/%m/%d") | |
2589 |
|
2589 | |||
2590 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2590 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2591 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2591 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2592 |
|
2592 | |||
2593 | startTime = startTime.strftime("%H:%M:%S") |
|
2593 | startTime = startTime.strftime("%H:%M:%S") | |
2594 | endTime = endTime.strftime("%H:%M:%S") |
|
2594 | endTime = endTime.strftime("%H:%M:%S") | |
2595 |
|
2595 | |||
2596 | online = 0 |
|
2596 | online = 0 | |
2597 | try: |
|
2597 | try: | |
2598 | online = operationObj.getParameterValue(parameterName='online') |
|
2598 | online = operationObj.getParameterValue(parameterName='online') | |
2599 | except: |
|
2599 | except: | |
2600 | pass |
|
2600 | pass | |
2601 |
|
2601 | |||
2602 | delay = '' |
|
2602 | delay = '' | |
2603 | try: |
|
2603 | try: | |
2604 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2604 | delay = operationObj.getParameterValue(parameterName='delay') | |
2605 | except: |
|
2605 | except: | |
2606 | pass |
|
2606 | pass | |
2607 |
|
2607 | |||
2608 | walk = 0 |
|
2608 | walk = 0 | |
2609 | try: |
|
2609 | try: | |
2610 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2610 | walk = operationObj.getParameterValue(parameterName='walk') | |
2611 | except: |
|
2611 | except: | |
2612 | pass |
|
2612 | pass | |
2613 |
|
2613 | |||
2614 | set = '' |
|
2614 | set = '' | |
2615 | try: |
|
2615 | try: | |
2616 | set = operationObj.getParameterValue(parameterName='set') |
|
2616 | set = operationObj.getParameterValue(parameterName='set') | |
2617 | except: |
|
2617 | except: | |
2618 | pass |
|
2618 | pass | |
2619 |
|
2619 | |||
2620 | expLabel = '' |
|
2620 | expLabel = '' | |
2621 | try: |
|
2621 | try: | |
2622 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2622 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2623 | except: |
|
2623 | except: | |
2624 | pass |
|
2624 | pass | |
2625 |
|
2625 | |||
2626 | ippKm = '' |
|
2626 | ippKm = '' | |
2627 | if datatype.lower() == 'usrp': |
|
2627 | if datatype.lower() == 'usrp': | |
2628 | try: |
|
2628 | try: | |
2629 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2629 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2630 | except: |
|
2630 | except: | |
2631 | pass |
|
2631 | pass | |
2632 |
|
2632 | |||
2633 | projectParms = ProjectParms() |
|
2633 | projectParms = ProjectParms() | |
2634 |
|
2634 | |||
2635 | projectParms.name = project_name |
|
2635 | projectParms.name = project_name | |
2636 | projectParms.description = description |
|
2636 | projectParms.description = description | |
2637 | projectParms.datatype = datatype |
|
2637 | projectParms.datatype = datatype | |
2638 | projectParms.ext = None |
|
2638 | projectParms.ext = None | |
2639 | projectParms.dpath = dpath |
|
2639 | projectParms.dpath = dpath | |
2640 | projectParms.online = online |
|
2640 | projectParms.online = online | |
2641 | projectParms.startDate = startDate |
|
2641 | projectParms.startDate = startDate | |
2642 | projectParms.endDate = endDate |
|
2642 | projectParms.endDate = endDate | |
2643 | projectParms.startTime = startTime |
|
2643 | projectParms.startTime = startTime | |
2644 | projectParms.endTime = endTime |
|
2644 | projectParms.endTime = endTime | |
2645 | projectParms.delay=delay |
|
2645 | projectParms.delay=delay | |
2646 | projectParms.walk=walk |
|
2646 | projectParms.walk=walk | |
2647 | projectParms.set=set |
|
2647 | projectParms.set=set | |
2648 | projectParms.ippKm=ippKm |
|
2648 | projectParms.ippKm=ippKm | |
2649 | projectParms.expLabel = expLabel |
|
2649 | projectParms.expLabel = expLabel | |
2650 | projectParms.parmsOk=parms_ok |
|
2650 | projectParms.parmsOk=parms_ok | |
2651 |
|
2651 | |||
2652 | return projectParms |
|
2652 | return projectParms | |
2653 |
|
2653 | |||
2654 | def refreshProjectWindow(self, projectObjView): |
|
2654 | def refreshProjectWindow(self, projectObjView): | |
2655 |
|
2655 | |||
2656 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2656 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2657 |
|
2657 | |||
2658 | index = projectParms.getDatatypeIndex() |
|
2658 | index = projectParms.getDatatypeIndex() | |
2659 |
|
2659 | |||
2660 | self.proName.setText(projectParms.name) |
|
2660 | self.proName.setText(projectParms.name) | |
2661 | self.proDescription.clear() |
|
2661 | self.proDescription.clear() | |
2662 | self.proDescription.append(projectParms.description) |
|
2662 | self.proDescription.append(projectParms.description) | |
2663 |
|
2663 | |||
2664 | self.on_proComDataType_activated(index=index) |
|
2664 | self.on_proComDataType_activated(index=index) | |
2665 | self.proDataPath.setText(projectParms.dpath) |
|
2665 | self.proDataPath.setText(projectParms.dpath) | |
2666 | self.proComDataType.setCurrentIndex(index) |
|
2666 | self.proComDataType.setCurrentIndex(index) | |
2667 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2667 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2668 | self.proDelay.setText(str(projectParms.delay)) |
|
2668 | self.proDelay.setText(str(projectParms.delay)) | |
2669 | self.proSet.setText(str(projectParms.set)) |
|
2669 | self.proSet.setText(str(projectParms.set)) | |
2670 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2670 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2671 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2671 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2672 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2672 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2673 |
|
2673 | |||
2674 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2674 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2675 | ext = projectParms.getExt(), |
|
2675 | ext = projectParms.getExt(), | |
2676 | walk = projectParms.walk, |
|
2676 | walk = projectParms.walk, | |
2677 | expLabel = projectParms.expLabel) |
|
2677 | expLabel = projectParms.expLabel) | |
2678 |
|
2678 | |||
2679 | try: |
|
2679 | try: | |
2680 | startDateIndex = dateList.index(projectParms.startDate) |
|
2680 | startDateIndex = dateList.index(projectParms.startDate) | |
2681 | except: |
|
2681 | except: | |
2682 | startDateIndex = 0 |
|
2682 | startDateIndex = 0 | |
2683 |
|
2683 | |||
2684 | try: |
|
2684 | try: | |
2685 | endDateIndex = dateList.index(projectParms.endDate) |
|
2685 | endDateIndex = dateList.index(projectParms.endDate) | |
2686 | except: |
|
2686 | except: | |
2687 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2687 | endDateIndex = int(self.proComEndDate.count()-1) | |
2688 |
|
2688 | |||
2689 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2689 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2690 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2690 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2691 |
|
2691 | |||
2692 | startlist = projectParms.startTime.split(":") |
|
2692 | startlist = projectParms.startTime.split(":") | |
2693 | endlist = projectParms.endTime.split(":") |
|
2693 | endlist = projectParms.endTime.split(":") | |
2694 |
|
2694 | |||
2695 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2695 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2696 | self.proStartTime.setTime(self.time) |
|
2696 | self.proStartTime.setTime(self.time) | |
2697 |
|
2697 | |||
2698 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2698 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2699 | self.proEndTime.setTime(self.time) |
|
2699 | self.proEndTime.setTime(self.time) | |
2700 |
|
2700 | |||
2701 |
|
2701 | |||
2702 | def __refreshVoltageWindow(self, puObj): |
|
2702 | def __refreshVoltageWindow(self, puObj): | |
2703 |
|
2703 | |||
2704 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2704 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2705 | if opObj == None: |
|
2705 | if opObj == None: | |
2706 | self.volOpRadarfrequency.clear() |
|
2706 | self.volOpRadarfrequency.clear() | |
2707 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2707 | self.volOpCebRadarfrequency.setCheckState(0) | |
2708 | else: |
|
2708 | else: | |
2709 | value = opObj.getParameterValue(parameterName='frequency') |
|
2709 | value = opObj.getParameterValue(parameterName='frequency') | |
2710 | value = str(float(value)/1e6) |
|
2710 | value = str(float(value)/1e6) | |
2711 | self.volOpRadarfrequency.setText(value) |
|
2711 | self.volOpRadarfrequency.setText(value) | |
2712 | self.volOpRadarfrequency.setEnabled(True) |
|
2712 | self.volOpRadarfrequency.setEnabled(True) | |
2713 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2713 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2714 |
|
2714 | |||
2715 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2715 | opObj = puObj.getOperationObj(name="selectChannels") | |
2716 |
|
2716 | |||
2717 | if opObj == None: |
|
2717 | if opObj == None: | |
2718 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2718 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2719 |
|
2719 | |||
2720 | if opObj == None: |
|
2720 | if opObj == None: | |
2721 | self.volOpChannel.clear() |
|
2721 | self.volOpChannel.clear() | |
2722 | self.volOpCebChannels.setCheckState(0) |
|
2722 | self.volOpCebChannels.setCheckState(0) | |
2723 | else: |
|
2723 | else: | |
2724 | channelEnabled = False |
|
2724 | channelEnabled = False | |
2725 | try: |
|
2725 | try: | |
2726 | value = opObj.getParameterValue(parameterName='channelList') |
|
2726 | value = opObj.getParameterValue(parameterName='channelList') | |
2727 | value = str(value)[1:-1] |
|
2727 | value = str(value)[1:-1] | |
2728 | channelEnabled = True |
|
2728 | channelEnabled = True | |
2729 | channelMode = 0 |
|
2729 | channelMode = 0 | |
2730 | except: |
|
2730 | except: | |
2731 | pass |
|
2731 | pass | |
2732 | try: |
|
2732 | try: | |
2733 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2733 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2734 | value = str(value)[1:-1] |
|
2734 | value = str(value)[1:-1] | |
2735 | channelEnabled = True |
|
2735 | channelEnabled = True | |
2736 | channelMode = 1 |
|
2736 | channelMode = 1 | |
2737 | except: |
|
2737 | except: | |
2738 | pass |
|
2738 | pass | |
2739 |
|
2739 | |||
2740 | if channelEnabled: |
|
2740 | if channelEnabled: | |
2741 | self.volOpChannel.setText(value) |
|
2741 | self.volOpChannel.setText(value) | |
2742 | self.volOpChannel.setEnabled(True) |
|
2742 | self.volOpChannel.setEnabled(True) | |
2743 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2743 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2744 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2744 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2745 |
|
2745 | |||
2746 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2746 | opObj = puObj.getOperationObj(name="selectHeights") | |
2747 | if opObj == None: |
|
2747 | if opObj == None: | |
2748 | self.volOpHeights.clear() |
|
2748 | self.volOpHeights.clear() | |
2749 | self.volOpCebHeights.setCheckState(0) |
|
2749 | self.volOpCebHeights.setCheckState(0) | |
2750 | else: |
|
2750 | else: | |
2751 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2751 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2752 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2752 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2753 | value = value1 + "," + value2 |
|
2753 | value = value1 + "," + value2 | |
2754 | self.volOpHeights.setText(value) |
|
2754 | self.volOpHeights.setText(value) | |
2755 | self.volOpHeights.setEnabled(True) |
|
2755 | self.volOpHeights.setEnabled(True) | |
2756 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2756 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2757 |
|
2757 | |||
2758 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2758 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2759 | if opObj == None: |
|
2759 | if opObj == None: | |
2760 | self.volOpFilter.clear() |
|
2760 | self.volOpFilter.clear() | |
2761 | self.volOpCebFilter.setCheckState(0) |
|
2761 | self.volOpCebFilter.setCheckState(0) | |
2762 | else: |
|
2762 | else: | |
2763 | value = opObj.getParameterValue(parameterName='window') |
|
2763 | value = opObj.getParameterValue(parameterName='window') | |
2764 | value = str(value) |
|
2764 | value = str(value) | |
2765 | self.volOpFilter.setText(value) |
|
2765 | self.volOpFilter.setText(value) | |
2766 | self.volOpFilter.setEnabled(True) |
|
2766 | self.volOpFilter.setEnabled(True) | |
2767 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2767 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2768 |
|
2768 | |||
2769 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2769 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2770 | if opObj == None: |
|
2770 | if opObj == None: | |
2771 | self.volOpProfile.clear() |
|
2771 | self.volOpProfile.clear() | |
2772 | self.volOpCebProfile.setCheckState(0) |
|
2772 | self.volOpCebProfile.setCheckState(0) | |
2773 | else: |
|
2773 | else: | |
2774 | for parmObj in opObj.getParameterObjList(): |
|
2774 | for parmObj in opObj.getParameterObjList(): | |
2775 |
|
2775 | |||
2776 | if parmObj.name == "profileList": |
|
2776 | if parmObj.name == "profileList": | |
2777 | value = parmObj.getValue() |
|
2777 | value = parmObj.getValue() | |
2778 | value = str(value)[1:-1] |
|
2778 | value = str(value)[1:-1] | |
2779 | self.volOpProfile.setText(value) |
|
2779 | self.volOpProfile.setText(value) | |
2780 | self.volOpProfile.setEnabled(True) |
|
2780 | self.volOpProfile.setEnabled(True) | |
2781 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2781 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2782 | self.volOpComProfile.setCurrentIndex(0) |
|
2782 | self.volOpComProfile.setCurrentIndex(0) | |
2783 |
|
2783 | |||
2784 | if parmObj.name == "profileRangeList": |
|
2784 | if parmObj.name == "profileRangeList": | |
2785 | value = parmObj.getValue() |
|
2785 | value = parmObj.getValue() | |
2786 | value = str(value)[1:-1] |
|
2786 | value = str(value)[1:-1] | |
2787 | self.volOpProfile.setText(value) |
|
2787 | self.volOpProfile.setText(value) | |
2788 | self.volOpProfile.setEnabled(True) |
|
2788 | self.volOpProfile.setEnabled(True) | |
2789 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2789 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2790 | self.volOpComProfile.setCurrentIndex(1) |
|
2790 | self.volOpComProfile.setCurrentIndex(1) | |
2791 |
|
2791 | |||
2792 | if parmObj.name == "rangeList": |
|
2792 | if parmObj.name == "rangeList": | |
2793 | value = parmObj.getValue() |
|
2793 | value = parmObj.getValue() | |
2794 | value = str(value)[1:-1] |
|
2794 | value = str(value)[1:-1] | |
2795 | self.volOpProfile.setText(value) |
|
2795 | self.volOpProfile.setText(value) | |
2796 | self.volOpProfile.setEnabled(True) |
|
2796 | self.volOpProfile.setEnabled(True) | |
2797 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2797 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2798 | self.volOpComProfile.setCurrentIndex(2) |
|
2798 | self.volOpComProfile.setCurrentIndex(2) | |
2799 |
|
2799 | |||
2800 | opObj = puObj.getOperationObj(name="Decoder") |
|
2800 | opObj = puObj.getOperationObj(name="Decoder") | |
2801 | self.volOpCode.setText("") |
|
2801 | self.volOpCode.setText("") | |
2802 | if opObj == None: |
|
2802 | if opObj == None: | |
2803 | self.volOpCebDecodification.setCheckState(0) |
|
2803 | self.volOpCebDecodification.setCheckState(0) | |
2804 | else: |
|
2804 | else: | |
2805 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2805 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2806 |
|
2806 | |||
2807 | parmObj = opObj.getParameterObj('code') |
|
2807 | parmObj = opObj.getParameterObj('code') | |
2808 |
|
2808 | |||
2809 | if parmObj == None: |
|
2809 | if parmObj == None: | |
2810 | self.volOpComCode.setCurrentIndex(0) |
|
2810 | self.volOpComCode.setCurrentIndex(0) | |
2811 | else: |
|
2811 | else: | |
2812 |
|
2812 | |||
2813 | parmObj1 = opObj.getParameterObj('nCode') |
|
2813 | parmObj1 = opObj.getParameterObj('nCode') | |
2814 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2814 | parmObj2 = opObj.getParameterObj('nBaud') | |
2815 |
|
2815 | |||
2816 | if parmObj1 == None or parmObj2 == None: |
|
2816 | if parmObj1 == None or parmObj2 == None: | |
2817 | self.volOpComCode.setCurrentIndex(0) |
|
2817 | self.volOpComCode.setCurrentIndex(0) | |
2818 | else: |
|
2818 | else: | |
2819 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2819 | code = ast.literal_eval(str(parmObj.getValue())) | |
2820 | nCode = parmObj1.getValue() |
|
2820 | nCode = parmObj1.getValue() | |
2821 | nBaud = parmObj2.getValue() |
|
2821 | nBaud = parmObj2.getValue() | |
2822 |
|
2822 | |||
2823 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2823 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2824 |
|
2824 | |||
2825 | #User defined by default |
|
2825 | #User defined by default | |
2826 | self.volOpComCode.setCurrentIndex(13) |
|
2826 | self.volOpComCode.setCurrentIndex(13) | |
2827 | self.volOpCode.setText(str(code)) |
|
2827 | self.volOpCode.setText(str(code)) | |
2828 |
|
2828 | |||
2829 | if nCode == 1: |
|
2829 | if nCode == 1: | |
2830 | if nBaud == 3: |
|
2830 | if nBaud == 3: | |
2831 | self.volOpComCode.setCurrentIndex(1) |
|
2831 | self.volOpComCode.setCurrentIndex(1) | |
2832 | if nBaud == 4: |
|
2832 | if nBaud == 4: | |
2833 | self.volOpComCode.setCurrentIndex(2) |
|
2833 | self.volOpComCode.setCurrentIndex(2) | |
2834 | if nBaud == 5: |
|
2834 | if nBaud == 5: | |
2835 | self.volOpComCode.setCurrentIndex(3) |
|
2835 | self.volOpComCode.setCurrentIndex(3) | |
2836 | if nBaud == 7: |
|
2836 | if nBaud == 7: | |
2837 | self.volOpComCode.setCurrentIndex(4) |
|
2837 | self.volOpComCode.setCurrentIndex(4) | |
2838 | if nBaud == 11: |
|
2838 | if nBaud == 11: | |
2839 | self.volOpComCode.setCurrentIndex(5) |
|
2839 | self.volOpComCode.setCurrentIndex(5) | |
2840 | if nBaud == 13: |
|
2840 | if nBaud == 13: | |
2841 | self.volOpComCode.setCurrentIndex(6) |
|
2841 | self.volOpComCode.setCurrentIndex(6) | |
2842 |
|
2842 | |||
2843 | if nCode == 2: |
|
2843 | if nCode == 2: | |
2844 | if nBaud == 3: |
|
2844 | if nBaud == 3: | |
2845 | self.volOpComCode.setCurrentIndex(7) |
|
2845 | self.volOpComCode.setCurrentIndex(7) | |
2846 | if nBaud == 4: |
|
2846 | if nBaud == 4: | |
2847 | self.volOpComCode.setCurrentIndex(8) |
|
2847 | self.volOpComCode.setCurrentIndex(8) | |
2848 | if nBaud == 5: |
|
2848 | if nBaud == 5: | |
2849 | self.volOpComCode.setCurrentIndex(9) |
|
2849 | self.volOpComCode.setCurrentIndex(9) | |
2850 | if nBaud == 7: |
|
2850 | if nBaud == 7: | |
2851 | self.volOpComCode.setCurrentIndex(10) |
|
2851 | self.volOpComCode.setCurrentIndex(10) | |
2852 | if nBaud == 11: |
|
2852 | if nBaud == 11: | |
2853 | self.volOpComCode.setCurrentIndex(11) |
|
2853 | self.volOpComCode.setCurrentIndex(11) | |
2854 | if nBaud == 13: |
|
2854 | if nBaud == 13: | |
2855 | self.volOpComCode.setCurrentIndex(12) |
|
2855 | self.volOpComCode.setCurrentIndex(12) | |
2856 |
|
2856 | |||
2857 |
|
2857 | |||
2858 | opObj = puObj.getOperationObj(name="deFlip") |
|
2858 | opObj = puObj.getOperationObj(name="deFlip") | |
2859 | if opObj == None: |
|
2859 | if opObj == None: | |
2860 | self.volOpFlip.clear() |
|
2860 | self.volOpFlip.clear() | |
2861 | self.volOpFlip.setEnabled(False) |
|
2861 | self.volOpFlip.setEnabled(False) | |
2862 | self.volOpCebFlip.setCheckState(0) |
|
2862 | self.volOpCebFlip.setCheckState(0) | |
2863 | else: |
|
2863 | else: | |
2864 | try: |
|
2864 | try: | |
2865 | value = opObj.getParameterValue(parameterName='channelList') |
|
2865 | value = opObj.getParameterValue(parameterName='channelList') | |
2866 | value = str(value)[1:-1] |
|
2866 | value = str(value)[1:-1] | |
2867 | except: |
|
2867 | except: | |
2868 | value = "" |
|
2868 | value = "" | |
2869 |
|
2869 | |||
2870 | self.volOpFlip.setText(value) |
|
2870 | self.volOpFlip.setText(value) | |
2871 | self.volOpFlip.setEnabled(True) |
|
2871 | self.volOpFlip.setEnabled(True) | |
2872 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2872 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2873 |
|
2873 | |||
2874 | opObj = puObj.getOperationObj(name="CohInt") |
|
2874 | opObj = puObj.getOperationObj(name="CohInt") | |
2875 | if opObj == None: |
|
2875 | if opObj == None: | |
2876 | self.volOpCohInt.clear() |
|
2876 | self.volOpCohInt.clear() | |
2877 | self.volOpCebCohInt.setCheckState(0) |
|
2877 | self.volOpCebCohInt.setCheckState(0) | |
2878 | else: |
|
2878 | else: | |
2879 | value = opObj.getParameterValue(parameterName='n') |
|
2879 | value = opObj.getParameterValue(parameterName='n') | |
2880 | self.volOpCohInt.setText(str(value)) |
|
2880 | self.volOpCohInt.setText(str(value)) | |
2881 | self.volOpCohInt.setEnabled(True) |
|
2881 | self.volOpCohInt.setEnabled(True) | |
2882 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2882 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2883 |
|
2883 | |||
2884 | opObj = puObj.getOperationObj(name='Scope') |
|
2884 | opObj = puObj.getOperationObj(name='Scope') | |
2885 | if opObj == None: |
|
2885 | if opObj == None: | |
2886 | self.volGraphCebshow.setCheckState(0) |
|
2886 | self.volGraphCebshow.setCheckState(0) | |
2887 | else: |
|
2887 | else: | |
2888 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2888 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2889 |
|
2889 | |||
2890 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2890 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2891 |
|
2891 | |||
2892 | if parmObj == None: |
|
2892 | if parmObj == None: | |
2893 | self.volGraphChannelList.clear() |
|
2893 | self.volGraphChannelList.clear() | |
2894 | else: |
|
2894 | else: | |
2895 | value = parmObj.getValue() |
|
2895 | value = parmObj.getValue() | |
2896 | value = str(value) |
|
2896 | value = str(value) | |
2897 | self.volGraphChannelList.setText(value) |
|
2897 | self.volGraphChannelList.setText(value) | |
2898 | self.volOpProfile.setEnabled(True) |
|
2898 | self.volOpProfile.setEnabled(True) | |
2899 |
|
2899 | |||
2900 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2900 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2901 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2901 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2902 |
|
2902 | |||
2903 | if parmObj1 == None or parmObj2 ==None: |
|
2903 | if parmObj1 == None or parmObj2 ==None: | |
2904 | self.volGraphfreqrange.clear() |
|
2904 | self.volGraphfreqrange.clear() | |
2905 | else: |
|
2905 | else: | |
2906 | value1 = parmObj1.getValue() |
|
2906 | value1 = parmObj1.getValue() | |
2907 | value1 = str(value1) |
|
2907 | value1 = str(value1) | |
2908 | value2 = parmObj2.getValue() |
|
2908 | value2 = parmObj2.getValue() | |
2909 | value2 = str(value2) |
|
2909 | value2 = str(value2) | |
2910 | value = value1 + "," + value2 |
|
2910 | value = value1 + "," + value2 | |
2911 | self.volGraphfreqrange.setText(value) |
|
2911 | self.volGraphfreqrange.setText(value) | |
2912 |
|
2912 | |||
2913 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2913 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2914 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2914 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2915 |
|
2915 | |||
2916 | if parmObj1 == None or parmObj2 ==None: |
|
2916 | if parmObj1 == None or parmObj2 ==None: | |
2917 | self.volGraphHeightrange.clear() |
|
2917 | self.volGraphHeightrange.clear() | |
2918 | else: |
|
2918 | else: | |
2919 | value1 = parmObj1.getValue() |
|
2919 | value1 = parmObj1.getValue() | |
2920 | value1 = str(value1) |
|
2920 | value1 = str(value1) | |
2921 | value2 = parmObj2.getValue() |
|
2921 | value2 = parmObj2.getValue() | |
2922 | value2 = str(value2) |
|
2922 | value2 = str(value2) | |
2923 | value = value1 + "," + value2 |
|
2923 | value = value1 + "," + value2 | |
2924 | value2 = str(value2) |
|
2924 | value2 = str(value2) | |
2925 | self.volGraphHeightrange.setText(value) |
|
2925 | self.volGraphHeightrange.setText(value) | |
2926 |
|
2926 | |||
2927 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2927 | parmObj = opObj.getParameterObj(parameterName='save') | |
2928 |
|
2928 | |||
2929 | if parmObj == None: |
|
2929 | if parmObj == None: | |
2930 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2930 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2931 | else: |
|
2931 | else: | |
2932 | value = parmObj.getValue() |
|
2932 | value = parmObj.getValue() | |
2933 | if value: |
|
2933 | if value: | |
2934 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2934 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2935 | else: |
|
2935 | else: | |
2936 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2936 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2937 |
|
2937 | |||
2938 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2938 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2939 | if parmObj == None: |
|
2939 | if parmObj == None: | |
2940 | self.volGraphPath.clear() |
|
2940 | self.volGraphPath.clear() | |
2941 | else: |
|
2941 | else: | |
2942 | value = parmObj.getValue() |
|
2942 | value = parmObj.getValue() | |
2943 | path = str(value) |
|
2943 | path = str(value) | |
2944 | self.volGraphPath.setText(path) |
|
2944 | self.volGraphPath.setText(path) | |
2945 |
|
2945 | |||
2946 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2946 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2947 | if parmObj == None: |
|
2947 | if parmObj == None: | |
2948 | self.volGraphPrefix.clear() |
|
2948 | self.volGraphPrefix.clear() | |
2949 | else: |
|
2949 | else: | |
2950 | value = parmObj.getValue() |
|
2950 | value = parmObj.getValue() | |
2951 | figfile = str(value) |
|
2951 | figfile = str(value) | |
2952 | self.volGraphPrefix.setText(figfile) |
|
2952 | self.volGraphPrefix.setText(figfile) | |
2953 |
|
2953 | |||
2954 | # outputVoltageWrite |
|
2954 | # outputVoltageWrite | |
2955 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2955 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2956 |
|
2956 | |||
2957 | if opObj == None: |
|
2957 | if opObj == None: | |
2958 | self.volOutputPath.clear() |
|
2958 | self.volOutputPath.clear() | |
2959 | self.volOutputblocksperfile.clear() |
|
2959 | self.volOutputblocksperfile.clear() | |
2960 | self.volOutputprofilesperblock.clear() |
|
2960 | self.volOutputprofilesperblock.clear() | |
2961 | else: |
|
2961 | else: | |
2962 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2962 | parmObj = opObj.getParameterObj(parameterName='path') | |
2963 | if parmObj == None: |
|
2963 | if parmObj == None: | |
2964 | self.volOutputPath.clear() |
|
2964 | self.volOutputPath.clear() | |
2965 | else: |
|
2965 | else: | |
2966 | value = parmObj.getValue() |
|
2966 | value = parmObj.getValue() | |
2967 | path = str(value) |
|
2967 | path = str(value) | |
2968 | self.volOutputPath.setText(path) |
|
2968 | self.volOutputPath.setText(path) | |
2969 |
|
2969 | |||
2970 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2970 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2971 | if parmObj == None: |
|
2971 | if parmObj == None: | |
2972 | self.volOutputblocksperfile.clear() |
|
2972 | self.volOutputblocksperfile.clear() | |
2973 | else: |
|
2973 | else: | |
2974 | value = parmObj.getValue() |
|
2974 | value = parmObj.getValue() | |
2975 | blocksperfile = str(value) |
|
2975 | blocksperfile = str(value) | |
2976 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2976 | self.volOutputblocksperfile.setText(blocksperfile) | |
2977 |
|
2977 | |||
2978 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2978 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2979 | if parmObj == None: |
|
2979 | if parmObj == None: | |
2980 | self.volOutputprofilesperblock.clear() |
|
2980 | self.volOutputprofilesperblock.clear() | |
2981 | else: |
|
2981 | else: | |
2982 | value = parmObj.getValue() |
|
2982 | value = parmObj.getValue() | |
2983 | profilesPerBlock = str(value) |
|
2983 | profilesPerBlock = str(value) | |
2984 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2984 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2985 |
|
2985 | |||
2986 | return |
|
2986 | return | |
2987 |
|
2987 | |||
2988 | def __refreshSpectraWindow(self, puObj): |
|
2988 | def __refreshSpectraWindow(self, puObj): | |
2989 |
|
2989 | |||
2990 | inputId = puObj.getInputId() |
|
2990 | inputId = puObj.getInputId() | |
2991 | inputPUObj = self.__puObjDict[inputId] |
|
2991 | inputPUObj = self.__puObjDict[inputId] | |
2992 |
|
2992 | |||
2993 | if inputPUObj.datatype == 'Voltage': |
|
2993 | if inputPUObj.datatype == 'Voltage': | |
2994 | self.specOpnFFTpoints.setEnabled(True) |
|
2994 | self.specOpnFFTpoints.setEnabled(True) | |
2995 | self.specOpProfiles.setEnabled(True) |
|
2995 | self.specOpProfiles.setEnabled(True) | |
2996 | self.specOpippFactor.setEnabled(True) |
|
2996 | self.specOpippFactor.setEnabled(True) | |
2997 | else: |
|
2997 | else: | |
2998 | self.specOpnFFTpoints.setEnabled(False) |
|
2998 | self.specOpnFFTpoints.setEnabled(False) | |
2999 | self.specOpProfiles.setEnabled(False) |
|
2999 | self.specOpProfiles.setEnabled(False) | |
3000 | self.specOpippFactor.setEnabled(False) |
|
3000 | self.specOpippFactor.setEnabled(False) | |
3001 |
|
3001 | |||
3002 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3002 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3003 | if opObj == None: |
|
3003 | if opObj == None: | |
3004 | self.specOpRadarfrequency.clear() |
|
3004 | self.specOpRadarfrequency.clear() | |
3005 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3005 | self.specOpCebRadarfrequency.setCheckState(0) | |
3006 | else: |
|
3006 | else: | |
3007 | value = opObj.getParameterValue(parameterName='frequency') |
|
3007 | value = opObj.getParameterValue(parameterName='frequency') | |
3008 | value = str(float(value)/1e6) |
|
3008 | value = str(float(value)/1e6) | |
3009 | self.specOpRadarfrequency.setText(value) |
|
3009 | self.specOpRadarfrequency.setText(value) | |
3010 | self.specOpRadarfrequency.setEnabled(True) |
|
3010 | self.specOpRadarfrequency.setEnabled(True) | |
3011 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3011 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3012 |
|
3012 | |||
3013 | opObj = puObj.getOperationObj(name="run") |
|
3013 | opObj = puObj.getOperationObj(name="run") | |
3014 | if opObj == None: |
|
3014 | if opObj == None: | |
3015 | self.specOpnFFTpoints.clear() |
|
3015 | self.specOpnFFTpoints.clear() | |
3016 | self.specOpProfiles.clear() |
|
3016 | self.specOpProfiles.clear() | |
3017 | self.specOpippFactor.clear() |
|
3017 | self.specOpippFactor.clear() | |
3018 | else: |
|
3018 | else: | |
3019 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3019 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3020 | if parmObj == None: |
|
3020 | if parmObj == None: | |
3021 | self.specOpnFFTpoints.clear() |
|
3021 | self.specOpnFFTpoints.clear() | |
3022 | else: |
|
3022 | else: | |
3023 | self.specOpnFFTpoints.setEnabled(True) |
|
3023 | self.specOpnFFTpoints.setEnabled(True) | |
3024 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3024 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3025 | self.specOpnFFTpoints.setText(str(value)) |
|
3025 | self.specOpnFFTpoints.setText(str(value)) | |
3026 |
|
3026 | |||
3027 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3027 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3028 | if parmObj == None: |
|
3028 | if parmObj == None: | |
3029 | self.specOpProfiles.clear() |
|
3029 | self.specOpProfiles.clear() | |
3030 | else: |
|
3030 | else: | |
3031 | self.specOpProfiles.setEnabled(True) |
|
3031 | self.specOpProfiles.setEnabled(True) | |
3032 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3032 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3033 | self.specOpProfiles.setText(str(value)) |
|
3033 | self.specOpProfiles.setText(str(value)) | |
3034 |
|
3034 | |||
3035 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3035 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3036 | if parmObj == None: |
|
3036 | if parmObj == None: | |
3037 | self.specOpippFactor.clear() |
|
3037 | self.specOpippFactor.clear() | |
3038 | else: |
|
3038 | else: | |
3039 | self.specOpippFactor.setEnabled(True) |
|
3039 | self.specOpippFactor.setEnabled(True) | |
3040 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3040 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3041 | self.specOpippFactor.setText(str(value)) |
|
3041 | self.specOpippFactor.setText(str(value)) | |
3042 |
|
3042 | |||
3043 | opObj = puObj.getOperationObj(name="run") |
|
3043 | opObj = puObj.getOperationObj(name="run") | |
3044 | if opObj == None: |
|
3044 | if opObj == None: | |
3045 | self.specOppairsList.clear() |
|
3045 | self.specOppairsList.clear() | |
3046 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3046 | self.specOpCebCrossSpectra.setCheckState(0) | |
3047 | else: |
|
3047 | else: | |
3048 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3048 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3049 | if parmObj == None: |
|
3049 | if parmObj == None: | |
3050 | self.specOppairsList.clear() |
|
3050 | self.specOppairsList.clear() | |
3051 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3051 | self.specOpCebCrossSpectra.setCheckState(0) | |
3052 | else: |
|
3052 | else: | |
3053 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3053 | value = opObj.getParameterValue(parameterName='pairsList') | |
3054 | value = str(value)[1:-1] |
|
3054 | value = str(value)[1:-1] | |
3055 | self.specOppairsList.setText(str(value)) |
|
3055 | self.specOppairsList.setText(str(value)) | |
3056 | self.specOppairsList.setEnabled(True) |
|
3056 | self.specOppairsList.setEnabled(True) | |
3057 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3057 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3058 |
|
3058 | |||
3059 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3059 | opObj = puObj.getOperationObj(name="selectChannels") | |
3060 |
|
3060 | |||
3061 | if opObj == None: |
|
3061 | if opObj == None: | |
3062 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3062 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3063 |
|
3063 | |||
3064 | if opObj == None: |
|
3064 | if opObj == None: | |
3065 | self.specOpChannel.clear() |
|
3065 | self.specOpChannel.clear() | |
3066 | self.specOpCebChannel.setCheckState(0) |
|
3066 | self.specOpCebChannel.setCheckState(0) | |
3067 | else: |
|
3067 | else: | |
3068 | channelEnabled = False |
|
3068 | channelEnabled = False | |
3069 | try: |
|
3069 | try: | |
3070 | value = opObj.getParameterValue(parameterName='channelList') |
|
3070 | value = opObj.getParameterValue(parameterName='channelList') | |
3071 | value = str(value)[1:-1] |
|
3071 | value = str(value)[1:-1] | |
3072 | channelEnabled = True |
|
3072 | channelEnabled = True | |
3073 | channelMode = 0 |
|
3073 | channelMode = 0 | |
3074 | except: |
|
3074 | except: | |
3075 | pass |
|
3075 | pass | |
3076 | try: |
|
3076 | try: | |
3077 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3077 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3078 | value = str(value)[1:-1] |
|
3078 | value = str(value)[1:-1] | |
3079 | channelEnabled = True |
|
3079 | channelEnabled = True | |
3080 | channelMode = 1 |
|
3080 | channelMode = 1 | |
3081 | except: |
|
3081 | except: | |
3082 | pass |
|
3082 | pass | |
3083 |
|
3083 | |||
3084 | if channelEnabled: |
|
3084 | if channelEnabled: | |
3085 | self.specOpChannel.setText(value) |
|
3085 | self.specOpChannel.setText(value) | |
3086 | self.specOpChannel.setEnabled(True) |
|
3086 | self.specOpChannel.setEnabled(True) | |
3087 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3087 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3088 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3088 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3089 |
|
3089 | |||
3090 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3090 | opObj = puObj.getOperationObj(name="selectHeights") | |
3091 | if opObj == None: |
|
3091 | if opObj == None: | |
3092 | self.specOpHeights.clear() |
|
3092 | self.specOpHeights.clear() | |
3093 | self.specOpCebHeights.setCheckState(0) |
|
3093 | self.specOpCebHeights.setCheckState(0) | |
3094 | else: |
|
3094 | else: | |
3095 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3095 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3096 | value1 = str(value1) |
|
3096 | value1 = str(value1) | |
3097 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3097 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3098 | value2 = str(value2) |
|
3098 | value2 = str(value2) | |
3099 | value = value1 + "," + value2 |
|
3099 | value = value1 + "," + value2 | |
3100 | self.specOpHeights.setText(value) |
|
3100 | self.specOpHeights.setText(value) | |
3101 | self.specOpHeights.setEnabled(True) |
|
3101 | self.specOpHeights.setEnabled(True) | |
3102 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3102 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3103 |
|
3103 | |||
3104 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3104 | opObj = puObj.getOperationObj(name="IncohInt") | |
3105 | if opObj == None: |
|
3105 | if opObj == None: | |
3106 | self.specOpIncoherent.clear() |
|
3106 | self.specOpIncoherent.clear() | |
3107 | self.specOpCebIncoherent.setCheckState(0) |
|
3107 | self.specOpCebIncoherent.setCheckState(0) | |
3108 | else: |
|
3108 | else: | |
3109 | for parmObj in opObj.getParameterObjList(): |
|
3109 | for parmObj in opObj.getParameterObjList(): | |
3110 | if parmObj.name == 'timeInterval': |
|
3110 | if parmObj.name == 'timeInterval': | |
3111 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3111 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3112 | self.specOpIncoherent.setText(str(value)) |
|
3112 | self.specOpIncoherent.setText(str(value)) | |
3113 | self.specOpIncoherent.setEnabled(True) |
|
3113 | self.specOpIncoherent.setEnabled(True) | |
3114 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3114 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3115 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3115 | self.specOpCobIncInt.setCurrentIndex(0) | |
3116 |
|
3116 | |||
3117 | if parmObj.name == 'n': |
|
3117 | if parmObj.name == 'n': | |
3118 | value = opObj.getParameterValue(parameterName='n') |
|
3118 | value = opObj.getParameterValue(parameterName='n') | |
3119 | self.specOpIncoherent.setText(str(value)) |
|
3119 | self.specOpIncoherent.setText(str(value)) | |
3120 | self.specOpIncoherent.setEnabled(True) |
|
3120 | self.specOpIncoherent.setEnabled(True) | |
3121 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3121 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3122 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3122 | self.specOpCobIncInt.setCurrentIndex(1) | |
3123 |
|
3123 | |||
3124 | opObj = puObj.getOperationObj(name="removeDC") |
|
3124 | opObj = puObj.getOperationObj(name="removeDC") | |
3125 | if opObj == None: |
|
3125 | if opObj == None: | |
3126 | self.specOpCebRemoveDC.setCheckState(0) |
|
3126 | self.specOpCebRemoveDC.setCheckState(0) | |
3127 | else: |
|
3127 | else: | |
3128 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3128 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3129 | value = opObj.getParameterValue(parameterName='mode') |
|
3129 | value = opObj.getParameterValue(parameterName='mode') | |
3130 | if value == 1: |
|
3130 | if value == 1: | |
3131 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3131 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3132 | elif value == 2: |
|
3132 | elif value == 2: | |
3133 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3133 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3134 |
|
3134 | |||
3135 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3135 | opObj = puObj.getOperationObj(name="removeInterference") | |
3136 | if opObj == None: |
|
3136 | if opObj == None: | |
3137 | self.specOpCebRemoveInt.setCheckState(0) |
|
3137 | self.specOpCebRemoveInt.setCheckState(0) | |
3138 | else: |
|
3138 | else: | |
3139 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3139 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3140 |
|
3140 | |||
3141 | opObj = puObj.getOperationObj(name='getNoise') |
|
3141 | opObj = puObj.getOperationObj(name='getNoise') | |
3142 | if opObj == None: |
|
3142 | if opObj == None: | |
3143 | self.specOpCebgetNoise.setCheckState(0) |
|
3143 | self.specOpCebgetNoise.setCheckState(0) | |
3144 | self.specOpgetNoise.clear() |
|
3144 | self.specOpgetNoise.clear() | |
3145 | else: |
|
3145 | else: | |
3146 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3146 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3147 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3147 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3148 | if parmObj == None: |
|
3148 | if parmObj == None: | |
3149 | self.specOpgetNoise.clear() |
|
3149 | self.specOpgetNoise.clear() | |
3150 | value1 = None |
|
3150 | value1 = None | |
3151 | else: |
|
3151 | else: | |
3152 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3152 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3153 | value1 = str(value1) |
|
3153 | value1 = str(value1) | |
3154 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3154 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3155 | if parmObj == None: |
|
3155 | if parmObj == None: | |
3156 | value2 = None |
|
3156 | value2 = None | |
3157 | value = value1 |
|
3157 | value = value1 | |
3158 | self.specOpgetNoise.setText(value) |
|
3158 | self.specOpgetNoise.setText(value) | |
3159 | self.specOpgetNoise.setEnabled(True) |
|
3159 | self.specOpgetNoise.setEnabled(True) | |
3160 | else: |
|
3160 | else: | |
3161 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3161 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3162 | value2 = str(value2) |
|
3162 | value2 = str(value2) | |
3163 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3163 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3164 | if parmObj == None: |
|
3164 | if parmObj == None: | |
3165 | value3 = None |
|
3165 | value3 = None | |
3166 | value = value1 + "," + value2 |
|
3166 | value = value1 + "," + value2 | |
3167 | self.specOpgetNoise.setText(value) |
|
3167 | self.specOpgetNoise.setText(value) | |
3168 | self.specOpgetNoise.setEnabled(True) |
|
3168 | self.specOpgetNoise.setEnabled(True) | |
3169 | else: |
|
3169 | else: | |
3170 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3170 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3171 | value3 = str(value3) |
|
3171 | value3 = str(value3) | |
3172 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3172 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3173 | if parmObj == None: |
|
3173 | if parmObj == None: | |
3174 | value4 = None |
|
3174 | value4 = None | |
3175 | value = value1 + "," + value2 + "," + value3 |
|
3175 | value = value1 + "," + value2 + "," + value3 | |
3176 | self.specOpgetNoise.setText(value) |
|
3176 | self.specOpgetNoise.setText(value) | |
3177 | self.specOpgetNoise.setEnabled(True) |
|
3177 | self.specOpgetNoise.setEnabled(True) | |
3178 | else: |
|
3178 | else: | |
3179 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3179 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3180 | value4 = str(value4) |
|
3180 | value4 = str(value4) | |
3181 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3181 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3182 | self.specOpgetNoise.setText(value) |
|
3182 | self.specOpgetNoise.setText(value) | |
3183 | self.specOpgetNoise.setEnabled(True) |
|
3183 | self.specOpgetNoise.setEnabled(True) | |
3184 |
|
3184 | |||
3185 | self.specGraphPath.clear() |
|
3185 | self.specGraphPath.clear() | |
3186 | self.specGraphPrefix.clear() |
|
3186 | self.specGraphPrefix.clear() | |
3187 | self.specGgraphFreq.clear() |
|
3187 | self.specGgraphFreq.clear() | |
3188 | self.specGgraphHeight.clear() |
|
3188 | self.specGgraphHeight.clear() | |
3189 | self.specGgraphDbsrange.clear() |
|
3189 | self.specGgraphDbsrange.clear() | |
3190 | self.specGgraphmagnitud.clear() |
|
3190 | self.specGgraphmagnitud.clear() | |
3191 | self.specGgraphPhase.clear() |
|
3191 | self.specGgraphPhase.clear() | |
3192 | self.specGgraphChannelList.clear() |
|
3192 | self.specGgraphChannelList.clear() | |
3193 | self.specGgraphTminTmax.clear() |
|
3193 | self.specGgraphTminTmax.clear() | |
3194 | self.specGgraphTimeRange.clear() |
|
3194 | self.specGgraphTimeRange.clear() | |
3195 | self.specGgraphftpratio.clear() |
|
3195 | self.specGgraphftpratio.clear() | |
3196 |
|
3196 | |||
3197 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3197 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3198 |
|
3198 | |||
3199 | if opObj == None: |
|
3199 | if opObj == None: | |
3200 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3200 | self.specGraphCebSpectraplot.setCheckState(0) | |
3201 | self.specGraphSaveSpectra.setCheckState(0) |
|
3201 | self.specGraphSaveSpectra.setCheckState(0) | |
3202 | self.specGraphftpSpectra.setCheckState(0) |
|
3202 | self.specGraphftpSpectra.setCheckState(0) | |
3203 | else: |
|
3203 | else: | |
3204 | operationSpectraPlot = "Enable" |
|
3204 | operationSpectraPlot = "Enable" | |
3205 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3205 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3206 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3206 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3207 | if parmObj == None: |
|
3207 | if parmObj == None: | |
3208 | self.specGgraphChannelList.clear() |
|
3208 | self.specGgraphChannelList.clear() | |
3209 | else: |
|
3209 | else: | |
3210 | value = opObj.getParameterValue(parameterName='channelList') |
|
3210 | value = opObj.getParameterValue(parameterName='channelList') | |
3211 | channelListSpectraPlot = str(value)[1:-1] |
|
3211 | channelListSpectraPlot = str(value)[1:-1] | |
3212 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3212 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3213 | self.specGgraphChannelList.setEnabled(True) |
|
3213 | self.specGgraphChannelList.setEnabled(True) | |
3214 |
|
3214 | |||
3215 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3215 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3216 | if parmObj == None: |
|
3216 | if parmObj == None: | |
3217 | self.specGgraphFreq.clear() |
|
3217 | self.specGgraphFreq.clear() | |
3218 | else: |
|
3218 | else: | |
3219 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3219 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3220 | value1 = str(value1) |
|
3220 | value1 = str(value1) | |
3221 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3221 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3222 | value2 = str(value2) |
|
3222 | value2 = str(value2) | |
3223 | value = value1 + "," + value2 |
|
3223 | value = value1 + "," + value2 | |
3224 | self.specGgraphFreq.setText(value) |
|
3224 | self.specGgraphFreq.setText(value) | |
3225 | self.specGgraphFreq.setEnabled(True) |
|
3225 | self.specGgraphFreq.setEnabled(True) | |
3226 |
|
3226 | |||
3227 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3227 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3228 | if parmObj == None: |
|
3228 | if parmObj == None: | |
3229 | self.specGgraphHeight.clear() |
|
3229 | self.specGgraphHeight.clear() | |
3230 | else: |
|
3230 | else: | |
3231 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3231 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3232 | value1 = str(value1) |
|
3232 | value1 = str(value1) | |
3233 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3233 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3234 | value2 = str(value2) |
|
3234 | value2 = str(value2) | |
3235 | value = value1 + "," + value2 |
|
3235 | value = value1 + "," + value2 | |
3236 | self.specGgraphHeight.setText(value) |
|
3236 | self.specGgraphHeight.setText(value) | |
3237 | self.specGgraphHeight.setEnabled(True) |
|
3237 | self.specGgraphHeight.setEnabled(True) | |
3238 |
|
3238 | |||
3239 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3239 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3240 | if parmObj == None: |
|
3240 | if parmObj == None: | |
3241 | self.specGgraphDbsrange.clear() |
|
3241 | self.specGgraphDbsrange.clear() | |
3242 | else: |
|
3242 | else: | |
3243 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3243 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3244 | value1 = str(value1) |
|
3244 | value1 = str(value1) | |
3245 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3245 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3246 | value2 = str(value2) |
|
3246 | value2 = str(value2) | |
3247 | value = value1 + "," + value2 |
|
3247 | value = value1 + "," + value2 | |
3248 | self.specGgraphDbsrange.setText(value) |
|
3248 | self.specGgraphDbsrange.setText(value) | |
3249 | self.specGgraphDbsrange.setEnabled(True) |
|
3249 | self.specGgraphDbsrange.setEnabled(True) | |
3250 |
|
3250 | |||
3251 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3251 | parmObj = opObj.getParameterObj(parameterName="save") | |
3252 | if parmObj == None: |
|
3252 | if parmObj == None: | |
3253 | self.specGraphSaveSpectra.setCheckState(0) |
|
3253 | self.specGraphSaveSpectra.setCheckState(0) | |
3254 | else: |
|
3254 | else: | |
3255 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3255 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3256 |
|
3256 | |||
3257 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3257 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3258 | if parmObj == None: |
|
3258 | if parmObj == None: | |
3259 | self.specGraphftpSpectra.setCheckState(0) |
|
3259 | self.specGraphftpSpectra.setCheckState(0) | |
3260 | else: |
|
3260 | else: | |
3261 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3261 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3262 |
|
3262 | |||
3263 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3263 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3264 | if parmObj: |
|
3264 | if parmObj: | |
3265 | value = parmObj.getValue() |
|
3265 | value = parmObj.getValue() | |
3266 | self.specGraphPath.setText(value) |
|
3266 | self.specGraphPath.setText(value) | |
3267 |
|
3267 | |||
3268 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3268 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3269 | if parmObj: |
|
3269 | if parmObj: | |
3270 | value = parmObj.getValue() |
|
3270 | value = parmObj.getValue() | |
3271 | self.specGgraphftpratio.setText(str(value)) |
|
3271 | self.specGgraphftpratio.setText(str(value)) | |
3272 |
|
3272 | |||
3273 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3273 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3274 |
|
3274 | |||
3275 | if opObj == None: |
|
3275 | if opObj == None: | |
3276 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3276 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3277 | self.specGraphSaveCross.setCheckState(0) |
|
3277 | self.specGraphSaveCross.setCheckState(0) | |
3278 | self.specGraphftpCross.setCheckState(0) |
|
3278 | self.specGraphftpCross.setCheckState(0) | |
3279 | else: |
|
3279 | else: | |
3280 | operationCrossSpectraPlot = "Enable" |
|
3280 | operationCrossSpectraPlot = "Enable" | |
3281 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3281 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3282 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3282 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3283 | if parmObj == None: |
|
3283 | if parmObj == None: | |
3284 | self.specGgraphFreq.clear() |
|
3284 | self.specGgraphFreq.clear() | |
3285 | else: |
|
3285 | else: | |
3286 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3286 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3287 | value1 = str(value1) |
|
3287 | value1 = str(value1) | |
3288 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3288 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3289 | value2 = str(value2) |
|
3289 | value2 = str(value2) | |
3290 | value = value1 + "," + value2 |
|
3290 | value = value1 + "," + value2 | |
3291 | self.specGgraphFreq.setText(value) |
|
3291 | self.specGgraphFreq.setText(value) | |
3292 | self.specGgraphFreq.setEnabled(True) |
|
3292 | self.specGgraphFreq.setEnabled(True) | |
3293 |
|
3293 | |||
3294 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3294 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3295 | if parmObj == None: |
|
3295 | if parmObj == None: | |
3296 | self.specGgraphHeight.clear() |
|
3296 | self.specGgraphHeight.clear() | |
3297 | else: |
|
3297 | else: | |
3298 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3298 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3299 | value1 = str(value1) |
|
3299 | value1 = str(value1) | |
3300 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3300 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3301 | value2 = str(value2) |
|
3301 | value2 = str(value2) | |
3302 | value = value1 + "," + value2 |
|
3302 | value = value1 + "," + value2 | |
3303 | self.specGgraphHeight.setText(value) |
|
3303 | self.specGgraphHeight.setText(value) | |
3304 | self.specGgraphHeight.setEnabled(True) |
|
3304 | self.specGgraphHeight.setEnabled(True) | |
3305 |
|
3305 | |||
3306 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3306 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3307 | if parmObj == None: |
|
3307 | if parmObj == None: | |
3308 | self.specGgraphDbsrange.clear() |
|
3308 | self.specGgraphDbsrange.clear() | |
3309 | else: |
|
3309 | else: | |
3310 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3310 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3311 | value1 = str(value1) |
|
3311 | value1 = str(value1) | |
3312 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3312 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3313 | value2 = str(value2) |
|
3313 | value2 = str(value2) | |
3314 | value = value1 + "," + value2 |
|
3314 | value = value1 + "," + value2 | |
3315 | self.specGgraphDbsrange.setText(value) |
|
3315 | self.specGgraphDbsrange.setText(value) | |
3316 | self.specGgraphDbsrange.setEnabled(True) |
|
3316 | self.specGgraphDbsrange.setEnabled(True) | |
3317 |
|
3317 | |||
3318 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3318 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3319 | if parmObj == None: |
|
3319 | if parmObj == None: | |
3320 | self.specGgraphmagnitud.clear() |
|
3320 | self.specGgraphmagnitud.clear() | |
3321 | else: |
|
3321 | else: | |
3322 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3322 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3323 | value1 = str(value1) |
|
3323 | value1 = str(value1) | |
3324 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3324 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3325 | value2 = str(value2) |
|
3325 | value2 = str(value2) | |
3326 | value = value1 + "," + value2 |
|
3326 | value = value1 + "," + value2 | |
3327 | self.specGgraphmagnitud.setText(value) |
|
3327 | self.specGgraphmagnitud.setText(value) | |
3328 | self.specGgraphmagnitud.setEnabled(True) |
|
3328 | self.specGgraphmagnitud.setEnabled(True) | |
3329 |
|
3329 | |||
3330 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3330 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3331 | if parmObj == None: |
|
3331 | if parmObj == None: | |
3332 | self.specGgraphPhase.clear() |
|
3332 | self.specGgraphPhase.clear() | |
3333 | else: |
|
3333 | else: | |
3334 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3334 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3335 | value1 = str(value1) |
|
3335 | value1 = str(value1) | |
3336 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3336 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3337 | value2 = str(value2) |
|
3337 | value2 = str(value2) | |
3338 | value = value1 + "," + value2 |
|
3338 | value = value1 + "," + value2 | |
3339 | self.specGgraphPhase.setText(value) |
|
3339 | self.specGgraphPhase.setText(value) | |
3340 | self.specGgraphPhase.setEnabled(True) |
|
3340 | self.specGgraphPhase.setEnabled(True) | |
3341 |
|
3341 | |||
3342 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3342 | parmObj = opObj.getParameterObj(parameterName="save") | |
3343 | if parmObj == None: |
|
3343 | if parmObj == None: | |
3344 | self.specGraphSaveCross.setCheckState(0) |
|
3344 | self.specGraphSaveCross.setCheckState(0) | |
3345 | else: |
|
3345 | else: | |
3346 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3346 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3347 |
|
3347 | |||
3348 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3348 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3349 | if parmObj == None: |
|
3349 | if parmObj == None: | |
3350 | self.specGraphftpCross.setCheckState(0) |
|
3350 | self.specGraphftpCross.setCheckState(0) | |
3351 | else: |
|
3351 | else: | |
3352 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3352 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3353 |
|
3353 | |||
3354 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3354 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3355 | if parmObj: |
|
3355 | if parmObj: | |
3356 | value = parmObj.getValue() |
|
3356 | value = parmObj.getValue() | |
3357 | self.specGraphPath.setText(value) |
|
3357 | self.specGraphPath.setText(value) | |
3358 |
|
3358 | |||
3359 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3359 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3360 | if parmObj: |
|
3360 | if parmObj: | |
3361 | value = parmObj.getValue() |
|
3361 | value = parmObj.getValue() | |
3362 | self.specGgraphftpratio.setText(str(value)) |
|
3362 | self.specGgraphftpratio.setText(str(value)) | |
3363 |
|
3363 | |||
3364 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3364 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3365 |
|
3365 | |||
3366 | if opObj == None: |
|
3366 | if opObj == None: | |
3367 | self.specGraphCebRTIplot.setCheckState(0) |
|
3367 | self.specGraphCebRTIplot.setCheckState(0) | |
3368 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3368 | self.specGraphSaveRTIplot.setCheckState(0) | |
3369 | self.specGraphftpRTIplot.setCheckState(0) |
|
3369 | self.specGraphftpRTIplot.setCheckState(0) | |
3370 | else: |
|
3370 | else: | |
3371 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3371 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3372 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3372 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3373 | if parmObj == None: |
|
3373 | if parmObj == None: | |
3374 | self.specGgraphChannelList.clear() |
|
3374 | self.specGgraphChannelList.clear() | |
3375 | else: |
|
3375 | else: | |
3376 | value = opObj.getParameterValue(parameterName='channelList') |
|
3376 | value = opObj.getParameterValue(parameterName='channelList') | |
3377 | channelListRTIPlot = str(value)[1:-1] |
|
3377 | channelListRTIPlot = str(value)[1:-1] | |
3378 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3378 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3379 | self.specGgraphChannelList.setEnabled(True) |
|
3379 | self.specGgraphChannelList.setEnabled(True) | |
3380 |
|
3380 | |||
3381 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3381 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3382 | if parmObj == None: |
|
3382 | if parmObj == None: | |
3383 | self.specGgraphTminTmax.clear() |
|
3383 | self.specGgraphTminTmax.clear() | |
3384 | else: |
|
3384 | else: | |
3385 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3385 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3386 | value1 = str(value1) |
|
3386 | value1 = str(value1) | |
3387 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3387 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3388 | value2 = str(value2) |
|
3388 | value2 = str(value2) | |
3389 | value = value1 + "," + value2 |
|
3389 | value = value1 + "," + value2 | |
3390 | self.specGgraphTminTmax.setText(value) |
|
3390 | self.specGgraphTminTmax.setText(value) | |
3391 | self.specGgraphTminTmax.setEnabled(True) |
|
3391 | self.specGgraphTminTmax.setEnabled(True) | |
3392 |
|
3392 | |||
3393 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3393 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3394 | if parmObj == None: |
|
3394 | if parmObj == None: | |
3395 | self.specGgraphTimeRange.clear() |
|
3395 | self.specGgraphTimeRange.clear() | |
3396 | else: |
|
3396 | else: | |
3397 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3397 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3398 | value1 = str(value1) |
|
3398 | value1 = str(value1) | |
3399 | self.specGgraphTimeRange.setText(value1) |
|
3399 | self.specGgraphTimeRange.setText(value1) | |
3400 | self.specGgraphTimeRange.setEnabled(True) |
|
3400 | self.specGgraphTimeRange.setEnabled(True) | |
3401 |
|
3401 | |||
3402 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3402 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3403 | if parmObj == None: |
|
3403 | if parmObj == None: | |
3404 | self.specGgraphHeight.clear() |
|
3404 | self.specGgraphHeight.clear() | |
3405 | else: |
|
3405 | else: | |
3406 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3406 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3407 | value1 = str(value1) |
|
3407 | value1 = str(value1) | |
3408 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3408 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3409 | value2 = str(value2) |
|
3409 | value2 = str(value2) | |
3410 | value = value1 + "," + value2 |
|
3410 | value = value1 + "," + value2 | |
3411 | self.specGgraphHeight.setText(value) |
|
3411 | self.specGgraphHeight.setText(value) | |
3412 | self.specGgraphHeight.setEnabled(True) |
|
3412 | self.specGgraphHeight.setEnabled(True) | |
3413 |
|
3413 | |||
3414 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3414 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3415 | if parmObj == None: |
|
3415 | if parmObj == None: | |
3416 | self.specGgraphDbsrange.clear() |
|
3416 | self.specGgraphDbsrange.clear() | |
3417 | else: |
|
3417 | else: | |
3418 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3418 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3419 | value1 = str(value1) |
|
3419 | value1 = str(value1) | |
3420 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3420 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3421 | value2 = str(value2) |
|
3421 | value2 = str(value2) | |
3422 | value = value1 + "," + value2 |
|
3422 | value = value1 + "," + value2 | |
3423 | self.specGgraphDbsrange.setText(value) |
|
3423 | self.specGgraphDbsrange.setText(value) | |
3424 | self.specGgraphDbsrange.setEnabled(True) |
|
3424 | self.specGgraphDbsrange.setEnabled(True) | |
3425 |
|
3425 | |||
3426 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3426 | parmObj = opObj.getParameterObj(parameterName="save") | |
3427 | if parmObj == None: |
|
3427 | if parmObj == None: | |
3428 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3428 | self.specGraphSaveRTIplot.setCheckState(0) | |
3429 | else: |
|
3429 | else: | |
3430 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3430 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3431 |
|
3431 | |||
3432 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3432 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3433 | if parmObj == None: |
|
3433 | if parmObj == None: | |
3434 | self.specGraphftpRTIplot.setCheckState(0) |
|
3434 | self.specGraphftpRTIplot.setCheckState(0) | |
3435 | else: |
|
3435 | else: | |
3436 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3436 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3437 |
|
3437 | |||
3438 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3438 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3439 | if parmObj: |
|
3439 | if parmObj: | |
3440 | value = parmObj.getValue() |
|
3440 | value = parmObj.getValue() | |
3441 | self.specGraphPath.setText(value) |
|
3441 | self.specGraphPath.setText(value) | |
3442 |
|
3442 | |||
3443 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3443 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3444 | if parmObj: |
|
3444 | if parmObj: | |
3445 | value = parmObj.getValue() |
|
3445 | value = parmObj.getValue() | |
3446 | self.specGgraphftpratio.setText(str(value)) |
|
3446 | self.specGgraphftpratio.setText(str(value)) | |
3447 |
|
3447 | |||
3448 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3448 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3449 |
|
3449 | |||
3450 | if opObj == None: |
|
3450 | if opObj == None: | |
3451 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3451 | self.specGraphCebCoherencmap.setCheckState(0) | |
3452 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3452 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3453 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3453 | self.specGraphftpCoherencemap.setCheckState(0) | |
3454 | else: |
|
3454 | else: | |
3455 | operationCoherenceMap = "Enable" |
|
3455 | operationCoherenceMap = "Enable" | |
3456 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3456 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3457 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3457 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3458 | if parmObj == None: |
|
3458 | if parmObj == None: | |
3459 | self.specGgraphTminTmax.clear() |
|
3459 | self.specGgraphTminTmax.clear() | |
3460 | else: |
|
3460 | else: | |
3461 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3461 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3462 | value1 = str(value1) |
|
3462 | value1 = str(value1) | |
3463 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3463 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3464 | value2 = str(value2) |
|
3464 | value2 = str(value2) | |
3465 | value = value1 + "," + value2 |
|
3465 | value = value1 + "," + value2 | |
3466 | self.specGgraphTminTmax.setText(value) |
|
3466 | self.specGgraphTminTmax.setText(value) | |
3467 | self.specGgraphTminTmax.setEnabled(True) |
|
3467 | self.specGgraphTminTmax.setEnabled(True) | |
3468 |
|
3468 | |||
3469 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3469 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3470 | if parmObj == None: |
|
3470 | if parmObj == None: | |
3471 | self.specGgraphTimeRange.clear() |
|
3471 | self.specGgraphTimeRange.clear() | |
3472 | else: |
|
3472 | else: | |
3473 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3473 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3474 | value1 = str(value1) |
|
3474 | value1 = str(value1) | |
3475 | self.specGgraphTimeRange.setText(value1) |
|
3475 | self.specGgraphTimeRange.setText(value1) | |
3476 | self.specGgraphTimeRange.setEnabled(True) |
|
3476 | self.specGgraphTimeRange.setEnabled(True) | |
3477 |
|
3477 | |||
3478 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3478 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3479 | if parmObj == None: |
|
3479 | if parmObj == None: | |
3480 | self.specGgraphHeight.clear() |
|
3480 | self.specGgraphHeight.clear() | |
3481 | else: |
|
3481 | else: | |
3482 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3482 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3483 | value1 = str(value1) |
|
3483 | value1 = str(value1) | |
3484 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3484 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3485 | value2 = str(value2) |
|
3485 | value2 = str(value2) | |
3486 | value = value1 + "," + value2 |
|
3486 | value = value1 + "," + value2 | |
3487 | self.specGgraphHeight.setText(value) |
|
3487 | self.specGgraphHeight.setText(value) | |
3488 | self.specGgraphHeight.setEnabled(True) |
|
3488 | self.specGgraphHeight.setEnabled(True) | |
3489 |
|
3489 | |||
3490 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3490 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3491 | if parmObj == None: |
|
3491 | if parmObj == None: | |
3492 | self.specGgraphmagnitud.clear() |
|
3492 | self.specGgraphmagnitud.clear() | |
3493 | else: |
|
3493 | else: | |
3494 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3494 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3495 | value1 = str(value1) |
|
3495 | value1 = str(value1) | |
3496 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3496 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3497 | value2 = str(value2) |
|
3497 | value2 = str(value2) | |
3498 | value = value1 + "," + value2 |
|
3498 | value = value1 + "," + value2 | |
3499 | self.specGgraphmagnitud.setText(value) |
|
3499 | self.specGgraphmagnitud.setText(value) | |
3500 | self.specGgraphmagnitud.setEnabled(True) |
|
3500 | self.specGgraphmagnitud.setEnabled(True) | |
3501 |
|
3501 | |||
3502 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3502 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3503 | if parmObj == None: |
|
3503 | if parmObj == None: | |
3504 | self.specGgraphmagnitud.clear() |
|
3504 | self.specGgraphmagnitud.clear() | |
3505 | else: |
|
3505 | else: | |
3506 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3506 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3507 | value1 = str(value1) |
|
3507 | value1 = str(value1) | |
3508 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3508 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3509 | value2 = str(value2) |
|
3509 | value2 = str(value2) | |
3510 | value = value1 + "," + value2 |
|
3510 | value = value1 + "," + value2 | |
3511 | self.specGgraphmagnitud.setText(value) |
|
3511 | self.specGgraphmagnitud.setText(value) | |
3512 | self.specGgraphmagnitud.setEnabled(True) |
|
3512 | self.specGgraphmagnitud.setEnabled(True) | |
3513 |
|
3513 | |||
3514 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3514 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3515 | if parmObj == None: |
|
3515 | if parmObj == None: | |
3516 | self.specGgraphPhase.clear() |
|
3516 | self.specGgraphPhase.clear() | |
3517 | else: |
|
3517 | else: | |
3518 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3518 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3519 | value1 = str(value1) |
|
3519 | value1 = str(value1) | |
3520 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3520 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3521 | value2 = str(value2) |
|
3521 | value2 = str(value2) | |
3522 | value = value1 + "," + value2 |
|
3522 | value = value1 + "," + value2 | |
3523 | self.specGgraphPhase.setText(value) |
|
3523 | self.specGgraphPhase.setText(value) | |
3524 | self.specGgraphPhase.setEnabled(True) |
|
3524 | self.specGgraphPhase.setEnabled(True) | |
3525 |
|
3525 | |||
3526 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3526 | parmObj = opObj.getParameterObj(parameterName="save") | |
3527 | if parmObj == None: |
|
3527 | if parmObj == None: | |
3528 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3528 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3529 | else: |
|
3529 | else: | |
3530 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3530 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3531 |
|
3531 | |||
3532 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3532 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3533 | if parmObj == None: |
|
3533 | if parmObj == None: | |
3534 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3534 | self.specGraphftpCoherencemap.setCheckState(0) | |
3535 | else: |
|
3535 | else: | |
3536 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3536 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3537 |
|
3537 | |||
3538 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3538 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3539 | if parmObj: |
|
3539 | if parmObj: | |
3540 | value = parmObj.getValue() |
|
3540 | value = parmObj.getValue() | |
3541 | self.specGraphPath.setText(value) |
|
3541 | self.specGraphPath.setText(value) | |
3542 |
|
3542 | |||
3543 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3543 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3544 | if parmObj: |
|
3544 | if parmObj: | |
3545 | value = parmObj.getValue() |
|
3545 | value = parmObj.getValue() | |
3546 | self.specGgraphftpratio.setText(str(value)) |
|
3546 | self.specGgraphftpratio.setText(str(value)) | |
3547 |
|
3547 | |||
3548 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3548 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3549 |
|
3549 | |||
3550 | if opObj == None: |
|
3550 | if opObj == None: | |
3551 | self.specGraphPowerprofile.setCheckState(0) |
|
3551 | self.specGraphPowerprofile.setCheckState(0) | |
3552 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3552 | self.specGraphSavePowerprofile.setCheckState(0) | |
3553 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3553 | self.specGraphftpPowerprofile.setCheckState(0) | |
3554 | operationPowerProfilePlot = "Disabled" |
|
3554 | operationPowerProfilePlot = "Disabled" | |
3555 | channelList = None |
|
3555 | channelList = None | |
3556 | freq_vel = None |
|
3556 | freq_vel = None | |
3557 | heightsrange = None |
|
3557 | heightsrange = None | |
3558 | else: |
|
3558 | else: | |
3559 | operationPowerProfilePlot = "Enable" |
|
3559 | operationPowerProfilePlot = "Enable" | |
3560 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3560 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3561 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3561 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3562 | if parmObj == None: |
|
3562 | if parmObj == None: | |
3563 | self.specGgraphDbsrange.clear() |
|
3563 | self.specGgraphDbsrange.clear() | |
3564 | else: |
|
3564 | else: | |
3565 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3565 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3566 | value1 = str(value1) |
|
3566 | value1 = str(value1) | |
3567 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3567 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3568 | value2 = str(value2) |
|
3568 | value2 = str(value2) | |
3569 | value = value1 + "," + value2 |
|
3569 | value = value1 + "," + value2 | |
3570 | self.specGgraphDbsrange.setText(value) |
|
3570 | self.specGgraphDbsrange.setText(value) | |
3571 | self.specGgraphDbsrange.setEnabled(True) |
|
3571 | self.specGgraphDbsrange.setEnabled(True) | |
3572 |
|
3572 | |||
3573 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3573 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3574 | if parmObj == None: |
|
3574 | if parmObj == None: | |
3575 | self.specGgraphHeight.clear() |
|
3575 | self.specGgraphHeight.clear() | |
3576 | else: |
|
3576 | else: | |
3577 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3577 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3578 | value1 = str(value1) |
|
3578 | value1 = str(value1) | |
3579 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3579 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3580 | value2 = str(value2) |
|
3580 | value2 = str(value2) | |
3581 | value = value1 + "," + value2 |
|
3581 | value = value1 + "," + value2 | |
3582 | self.specGgraphHeight.setText(value) |
|
3582 | self.specGgraphHeight.setText(value) | |
3583 | self.specGgraphHeight.setEnabled(True) |
|
3583 | self.specGgraphHeight.setEnabled(True) | |
3584 |
|
3584 | |||
3585 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3585 | parmObj = opObj.getParameterObj(parameterName="save") | |
3586 | if parmObj == None: |
|
3586 | if parmObj == None: | |
3587 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3587 | self.specGraphSavePowerprofile.setCheckState(0) | |
3588 | else: |
|
3588 | else: | |
3589 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3589 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3590 |
|
3590 | |||
3591 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3591 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3592 | if parmObj == None: |
|
3592 | if parmObj == None: | |
3593 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3593 | self.specGraphftpPowerprofile.setCheckState(0) | |
3594 | else: |
|
3594 | else: | |
3595 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3595 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3596 |
|
3596 | |||
3597 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3597 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3598 | if parmObj: |
|
3598 | if parmObj: | |
3599 | value = parmObj.getValue() |
|
3599 | value = parmObj.getValue() | |
3600 | self.specGraphPath.setText(value) |
|
3600 | self.specGraphPath.setText(value) | |
3601 |
|
3601 | |||
3602 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3602 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3603 | if parmObj: |
|
3603 | if parmObj: | |
3604 | value = parmObj.getValue() |
|
3604 | value = parmObj.getValue() | |
3605 | self.specGgraphftpratio.setText(str(value)) |
|
3605 | self.specGgraphftpratio.setText(str(value)) | |
3606 |
|
3606 | |||
3607 | opObj = puObj.getOperationObj(name='Noise') |
|
3607 | opObj = puObj.getOperationObj(name='Noise') | |
3608 |
|
3608 | |||
3609 | if opObj == None: |
|
3609 | if opObj == None: | |
3610 | self.specGraphCebRTInoise.setCheckState(0) |
|
3610 | self.specGraphCebRTInoise.setCheckState(0) | |
3611 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3611 | self.specGraphSaveRTInoise.setCheckState(0) | |
3612 | self.specGraphftpRTInoise.setCheckState(0) |
|
3612 | self.specGraphftpRTInoise.setCheckState(0) | |
3613 | else: |
|
3613 | else: | |
3614 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3614 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3615 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3615 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3616 | if parmObj == None: |
|
3616 | if parmObj == None: | |
3617 | self.specGgraphChannelList.clear() |
|
3617 | self.specGgraphChannelList.clear() | |
3618 | else: |
|
3618 | else: | |
3619 | value = opObj.getParameterValue(parameterName='channelList') |
|
3619 | value = opObj.getParameterValue(parameterName='channelList') | |
3620 | channelListRTINoise = str(value)[1:-1] |
|
3620 | channelListRTINoise = str(value)[1:-1] | |
3621 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3621 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3622 | self.specGgraphChannelList.setEnabled(True) |
|
3622 | self.specGgraphChannelList.setEnabled(True) | |
3623 |
|
3623 | |||
3624 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3624 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3625 | if parmObj == None: |
|
3625 | if parmObj == None: | |
3626 | self.specGgraphTminTmax.clear() |
|
3626 | self.specGgraphTminTmax.clear() | |
3627 | else: |
|
3627 | else: | |
3628 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3628 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3629 | value1 = str(value1) |
|
3629 | value1 = str(value1) | |
3630 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3630 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3631 | value2 = str(value2) |
|
3631 | value2 = str(value2) | |
3632 | value = value1 + "," + value2 |
|
3632 | value = value1 + "," + value2 | |
3633 | self.specGgraphTminTmax.setText(value) |
|
3633 | self.specGgraphTminTmax.setText(value) | |
3634 | self.specGgraphTminTmax.setEnabled(True) |
|
3634 | self.specGgraphTminTmax.setEnabled(True) | |
3635 |
|
3635 | |||
3636 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3636 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3637 | if parmObj == None: |
|
3637 | if parmObj == None: | |
3638 | self.specGgraphTimeRange.clear() |
|
3638 | self.specGgraphTimeRange.clear() | |
3639 | else: |
|
3639 | else: | |
3640 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3640 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3641 | value1 = str(value1) |
|
3641 | value1 = str(value1) | |
3642 | self.specGgraphTimeRange.setText(value1) |
|
3642 | self.specGgraphTimeRange.setText(value1) | |
3643 | self.specGgraphTimeRange.setEnabled(True) |
|
3643 | self.specGgraphTimeRange.setEnabled(True) | |
3644 |
|
3644 | |||
3645 |
|
3645 | |||
3646 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3646 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3647 | if parmObj == None: |
|
3647 | if parmObj == None: | |
3648 | self.specGgraphDbsrange.clear() |
|
3648 | self.specGgraphDbsrange.clear() | |
3649 | else: |
|
3649 | else: | |
3650 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3650 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3651 | value1 = str(value1) |
|
3651 | value1 = str(value1) | |
3652 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3652 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3653 | value2 = str(value2) |
|
3653 | value2 = str(value2) | |
3654 | value = value1 + "," + value2 |
|
3654 | value = value1 + "," + value2 | |
3655 | self.specGgraphDbsrange.setText(value) |
|
3655 | self.specGgraphDbsrange.setText(value) | |
3656 | self.specGgraphDbsrange.setEnabled(True) |
|
3656 | self.specGgraphDbsrange.setEnabled(True) | |
3657 |
|
3657 | |||
3658 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3658 | parmObj = opObj.getParameterObj(parameterName="save") | |
3659 | if parmObj == None: |
|
3659 | if parmObj == None: | |
3660 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3660 | self.specGraphSaveRTInoise.setCheckState(0) | |
3661 | else: |
|
3661 | else: | |
3662 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3662 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3663 |
|
3663 | |||
3664 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3664 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3665 | if parmObj == None: |
|
3665 | if parmObj == None: | |
3666 | self.specGraphftpRTInoise.setCheckState(0) |
|
3666 | self.specGraphftpRTInoise.setCheckState(0) | |
3667 | else: |
|
3667 | else: | |
3668 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3668 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3669 |
|
3669 | |||
3670 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3670 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3671 | if parmObj: |
|
3671 | if parmObj: | |
3672 | value = parmObj.getValue() |
|
3672 | value = parmObj.getValue() | |
3673 | self.specGraphPath.setText(value) |
|
3673 | self.specGraphPath.setText(value) | |
3674 |
|
3674 | |||
3675 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3675 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3676 | if parmObj: |
|
3676 | if parmObj: | |
3677 | value = parmObj.getValue() |
|
3677 | value = parmObj.getValue() | |
3678 | self.specGgraphftpratio.setText(str(value)) |
|
3678 | self.specGgraphftpratio.setText(str(value)) | |
3679 |
|
3679 | |||
3680 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3680 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3681 | if opObj == None: |
|
3681 | if opObj == None: | |
3682 | self.specOutputPath.clear() |
|
3682 | self.specOutputPath.clear() | |
3683 | self.specOutputblocksperfile.clear() |
|
3683 | self.specOutputblocksperfile.clear() | |
3684 | else: |
|
3684 | else: | |
3685 | value = opObj.getParameterObj(parameterName='path') |
|
3685 | value = opObj.getParameterObj(parameterName='path') | |
3686 | if value == None: |
|
3686 | if value == None: | |
3687 | self.specOutputPath.clear() |
|
3687 | self.specOutputPath.clear() | |
3688 | else: |
|
3688 | else: | |
3689 | value = opObj.getParameterValue(parameterName='path') |
|
3689 | value = opObj.getParameterValue(parameterName='path') | |
3690 | path = str(value) |
|
3690 | path = str(value) | |
3691 | self.specOutputPath.setText(path) |
|
3691 | self.specOutputPath.setText(path) | |
3692 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3692 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3693 | if value == None: |
|
3693 | if value == None: | |
3694 | self.specOutputblocksperfile.clear() |
|
3694 | self.specOutputblocksperfile.clear() | |
3695 | else: |
|
3695 | else: | |
3696 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3696 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3697 | blocksperfile = str(value) |
|
3697 | blocksperfile = str(value) | |
3698 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3698 | self.specOutputblocksperfile.setText(blocksperfile) | |
3699 |
|
3699 | |||
3700 | return |
|
3700 | return | |
3701 |
|
3701 | |||
3702 | def __refreshSpectraHeisWindow(self, puObj): |
|
3702 | def __refreshSpectraHeisWindow(self, puObj): | |
3703 |
|
3703 | |||
3704 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3704 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3705 | if opObj == None: |
|
3705 | if opObj == None: | |
3706 | self.specHeisOpIncoherent.clear() |
|
3706 | self.specHeisOpIncoherent.clear() | |
3707 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3707 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3708 | else: |
|
3708 | else: | |
3709 | for parmObj in opObj.getParameterObjList(): |
|
3709 | for parmObj in opObj.getParameterObjList(): | |
3710 | if parmObj.name == 'timeInterval': |
|
3710 | if parmObj.name == 'timeInterval': | |
3711 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3711 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3712 | self.specHeisOpIncoherent.setText(str(value)) |
|
3712 | self.specHeisOpIncoherent.setText(str(value)) | |
3713 | self.specHeisOpIncoherent.setEnabled(True) |
|
3713 | self.specHeisOpIncoherent.setEnabled(True) | |
3714 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3714 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3715 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3715 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3716 |
|
3716 | |||
3717 | # SpectraHeis Graph |
|
3717 | # SpectraHeis Graph | |
3718 |
|
3718 | |||
3719 | self.specHeisGgraphXminXmax.clear() |
|
3719 | self.specHeisGgraphXminXmax.clear() | |
3720 | self.specHeisGgraphYminYmax.clear() |
|
3720 | self.specHeisGgraphYminYmax.clear() | |
3721 |
|
3721 | |||
3722 | self.specHeisGgraphChannelList.clear() |
|
3722 | self.specHeisGgraphChannelList.clear() | |
3723 | self.specHeisGgraphTminTmax.clear() |
|
3723 | self.specHeisGgraphTminTmax.clear() | |
3724 | self.specHeisGgraphTimeRange.clear() |
|
3724 | self.specHeisGgraphTimeRange.clear() | |
3725 | self.specHeisGgraphftpratio.clear() |
|
3725 | self.specHeisGgraphftpratio.clear() | |
3726 |
|
3726 | |||
3727 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3727 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3728 | if opObj == None: |
|
3728 | if opObj == None: | |
3729 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3729 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3730 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3730 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3731 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3731 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3732 | else: |
|
3732 | else: | |
3733 | operationSpectraHeisScope = "Enable" |
|
3733 | operationSpectraHeisScope = "Enable" | |
3734 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3734 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3735 |
|
3735 | |||
3736 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3736 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3737 | if parmObj == None: |
|
3737 | if parmObj == None: | |
3738 | self.specHeisGgraphChannelList.clear() |
|
3738 | self.specHeisGgraphChannelList.clear() | |
3739 | else: |
|
3739 | else: | |
3740 | value = opObj.getParameterValue(parameterName='channelList') |
|
3740 | value = opObj.getParameterValue(parameterName='channelList') | |
3741 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3741 | channelListSpectraHeisScope = str(value)[1:-1] | |
3742 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3742 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3743 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3743 | self.specHeisGgraphChannelList.setEnabled(True) | |
3744 |
|
3744 | |||
3745 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3745 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3746 | if parmObj == None: |
|
3746 | if parmObj == None: | |
3747 | self.specHeisGgraphXminXmax.clear() |
|
3747 | self.specHeisGgraphXminXmax.clear() | |
3748 | else: |
|
3748 | else: | |
3749 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3749 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3750 | value1 = str(value1) |
|
3750 | value1 = str(value1) | |
3751 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3751 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3752 | value2 = str(value2) |
|
3752 | value2 = str(value2) | |
3753 | value = value1 + "," + value2 |
|
3753 | value = value1 + "," + value2 | |
3754 | self.specHeisGgraphXminXmax.setText(value) |
|
3754 | self.specHeisGgraphXminXmax.setText(value) | |
3755 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3755 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3756 |
|
3756 | |||
3757 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3757 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3758 | if parmObj == None: |
|
3758 | if parmObj == None: | |
3759 | self.specHeisGgraphYminYmax.clear() |
|
3759 | self.specHeisGgraphYminYmax.clear() | |
3760 | else: |
|
3760 | else: | |
3761 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3761 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3762 | value1 = str(value1) |
|
3762 | value1 = str(value1) | |
3763 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3763 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3764 | value2 = str(value2) |
|
3764 | value2 = str(value2) | |
3765 | value = value1 + "," + value2 |
|
3765 | value = value1 + "," + value2 | |
3766 | self.specHeisGgraphYminYmax.setText(value) |
|
3766 | self.specHeisGgraphYminYmax.setText(value) | |
3767 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3767 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3768 |
|
3768 | |||
3769 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3769 | parmObj = opObj.getParameterObj(parameterName="save") | |
3770 | if parmObj == None: |
|
3770 | if parmObj == None: | |
3771 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3771 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3772 | else: |
|
3772 | else: | |
3773 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3773 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3774 |
|
3774 | |||
3775 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3775 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3776 | if parmObj == None: |
|
3776 | if parmObj == None: | |
3777 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3777 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3778 | else: |
|
3778 | else: | |
3779 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3779 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3780 |
|
3780 | |||
3781 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3781 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3782 | if parmObj: |
|
3782 | if parmObj: | |
3783 | value = parmObj.getValue() |
|
3783 | value = parmObj.getValue() | |
3784 | self.specHeisGraphPath.setText(value) |
|
3784 | self.specHeisGraphPath.setText(value) | |
3785 |
|
3785 | |||
3786 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3786 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3787 | if parmObj: |
|
3787 | if parmObj: | |
3788 | value = parmObj.getValue() |
|
3788 | value = parmObj.getValue() | |
3789 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3789 | self.specHeisGgraphftpratio.setText(str(value)) | |
3790 |
|
3790 | |||
3791 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3791 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3792 |
|
3792 | |||
3793 | if opObj == None: |
|
3793 | if opObj == None: | |
3794 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3794 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3795 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3795 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3796 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3796 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3797 | else: |
|
3797 | else: | |
3798 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3798 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3799 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3799 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3800 | if parmObj == None: |
|
3800 | if parmObj == None: | |
3801 | self.specHeisGgraphChannelList.clear() |
|
3801 | self.specHeisGgraphChannelList.clear() | |
3802 | else: |
|
3802 | else: | |
3803 | value = opObj.getParameterValue(parameterName='channelList') |
|
3803 | value = opObj.getParameterValue(parameterName='channelList') | |
3804 | channelListRTIPlot = str(value)[1:-1] |
|
3804 | channelListRTIPlot = str(value)[1:-1] | |
3805 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3805 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3806 | self.specGgraphChannelList.setEnabled(True) |
|
3806 | self.specGgraphChannelList.setEnabled(True) | |
3807 |
|
3807 | |||
3808 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3808 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3809 | if parmObj == None: |
|
3809 | if parmObj == None: | |
3810 | self.specHeisGgraphTminTmax.clear() |
|
3810 | self.specHeisGgraphTminTmax.clear() | |
3811 | else: |
|
3811 | else: | |
3812 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3812 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3813 | value1 = str(value1) |
|
3813 | value1 = str(value1) | |
3814 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3814 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3815 | value2 = str(value2) |
|
3815 | value2 = str(value2) | |
3816 | value = value1 + "," + value2 |
|
3816 | value = value1 + "," + value2 | |
3817 | self.specHeisGgraphTminTmax.setText(value) |
|
3817 | self.specHeisGgraphTminTmax.setText(value) | |
3818 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3818 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3819 |
|
3819 | |||
3820 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3820 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3821 | if parmObj == None: |
|
3821 | if parmObj == None: | |
3822 | self.specGgraphTimeRange.clear() |
|
3822 | self.specGgraphTimeRange.clear() | |
3823 | else: |
|
3823 | else: | |
3824 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3824 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3825 | value1 = str(value1) |
|
3825 | value1 = str(value1) | |
3826 | self.specHeisGgraphTimeRange.setText(value1) |
|
3826 | self.specHeisGgraphTimeRange.setText(value1) | |
3827 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3827 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3828 |
|
3828 | |||
3829 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3829 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3830 | if parmObj == None: |
|
3830 | if parmObj == None: | |
3831 | self.specHeisGgraphYminYmax.clear() |
|
3831 | self.specHeisGgraphYminYmax.clear() | |
3832 | else: |
|
3832 | else: | |
3833 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3833 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3834 | value1 = str(value1) |
|
3834 | value1 = str(value1) | |
3835 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3835 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3836 | value2 = str(value2) |
|
3836 | value2 = str(value2) | |
3837 | value = value1 + "," + value2 |
|
3837 | value = value1 + "," + value2 | |
3838 | self.specHeisGgraphYminYmax.setText(value) |
|
3838 | self.specHeisGgraphYminYmax.setText(value) | |
3839 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3839 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3840 |
|
3840 | |||
3841 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3841 | parmObj = opObj.getParameterObj(parameterName="save") | |
3842 | if parmObj == None: |
|
3842 | if parmObj == None: | |
3843 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3843 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3844 | else: |
|
3844 | else: | |
3845 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3845 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3846 |
|
3846 | |||
3847 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3847 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3848 | if parmObj == None: |
|
3848 | if parmObj == None: | |
3849 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3849 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3850 | else: |
|
3850 | else: | |
3851 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3851 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3852 |
|
3852 | |||
3853 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3853 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3854 | if parmObj: |
|
3854 | if parmObj: | |
3855 | value = parmObj.getValue() |
|
3855 | value = parmObj.getValue() | |
3856 | self.specHeisGraphPath.setText(value) |
|
3856 | self.specHeisGraphPath.setText(value) | |
3857 |
|
3857 | |||
3858 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3858 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3859 | if parmObj: |
|
3859 | if parmObj: | |
3860 | value = parmObj.getValue() |
|
3860 | value = parmObj.getValue() | |
3861 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3861 | self.specHeisGgraphftpratio.setText(str(value)) | |
3862 |
|
3862 | |||
3863 | # outputSpectraHeisWrite |
|
3863 | # outputSpectraHeisWrite | |
3864 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3864 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3865 | if opObj == None: |
|
3865 | if opObj == None: | |
3866 | self.specHeisOutputPath.clear() |
|
3866 | self.specHeisOutputPath.clear() | |
3867 | self.specHeisOutputblocksperfile.clear() |
|
3867 | self.specHeisOutputblocksperfile.clear() | |
3868 | self.specHeisOutputMetada.clear() |
|
3868 | self.specHeisOutputMetada.clear() | |
3869 | else: |
|
3869 | else: | |
3870 | value = opObj.getParameterObj(parameterName='path') |
|
3870 | value = opObj.getParameterObj(parameterName='path') | |
3871 | if value == None: |
|
3871 | if value == None: | |
3872 | self.specHeisOutputPath.clear() |
|
3872 | self.specHeisOutputPath.clear() | |
3873 | else: |
|
3873 | else: | |
3874 | value = opObj.getParameterValue(parameterName='path') |
|
3874 | value = opObj.getParameterValue(parameterName='path') | |
3875 | path = str(value) |
|
3875 | path = str(value) | |
3876 | self.specHeisOutputPath.setText(path) |
|
3876 | self.specHeisOutputPath.setText(path) | |
3877 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3877 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3878 | if value == None: |
|
3878 | if value == None: | |
3879 | self.specHeisOutputblocksperfile.clear() |
|
3879 | self.specHeisOutputblocksperfile.clear() | |
3880 | else: |
|
3880 | else: | |
3881 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3881 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3882 | blocksperfile = str(value) |
|
3882 | blocksperfile = str(value) | |
3883 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3883 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3884 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3884 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3885 | if value == None: |
|
3885 | if value == None: | |
3886 | self.specHeisOutputMetada.clear() |
|
3886 | self.specHeisOutputMetada.clear() | |
3887 | else: |
|
3887 | else: | |
3888 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3888 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3889 | metadata_file = str(value) |
|
3889 | metadata_file = str(value) | |
3890 | self.specHeisOutputMetada.setText(metadata_file) |
|
3890 | self.specHeisOutputMetada.setText(metadata_file) | |
3891 |
|
3891 | |||
3892 | return |
|
3892 | return | |
3893 |
|
3893 | |||
3894 | def __refreshCorrelationWindow(self, puObj): |
|
3894 | def __refreshCorrelationWindow(self, puObj): | |
3895 | pass |
|
3895 | pass | |
3896 |
|
3896 | |||
3897 | def refreshPUWindow(self, puObj): |
|
3897 | def refreshPUWindow(self, puObj): | |
3898 |
|
3898 | |||
3899 | if puObj.datatype == 'Voltage': |
|
3899 | if puObj.datatype == 'Voltage': | |
3900 | self.__refreshVoltageWindow(puObj) |
|
3900 | self.__refreshVoltageWindow(puObj) | |
3901 |
|
3901 | |||
3902 | if puObj.datatype == 'Spectra': |
|
3902 | if puObj.datatype == 'Spectra': | |
3903 | self.__refreshSpectraWindow(puObj) |
|
3903 | self.__refreshSpectraWindow(puObj) | |
3904 |
|
3904 | |||
3905 | if puObj.datatype == 'SpectraHeis': |
|
3905 | if puObj.datatype == 'SpectraHeis': | |
3906 | self.__refreshSpectraHeisWindow(puObj) |
|
3906 | self.__refreshSpectraHeisWindow(puObj) | |
3907 |
|
3907 | |||
3908 | def refreshProjectProperties(self, projectObjView): |
|
3908 | def refreshProjectProperties(self, projectObjView): | |
3909 |
|
3909 | |||
3910 | propertyBuffObj = PropertyBuffer() |
|
3910 | propertyBuffObj = PropertyBuffer() | |
3911 | name = projectObjView.name |
|
3911 | name = projectObjView.name | |
3912 |
|
3912 | |||
3913 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3913 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3914 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3914 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3915 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3915 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3916 |
|
3916 | |||
3917 | readUnitObj = projectObjView.getReadUnitObj() |
|
3917 | readUnitObj = projectObjView.getReadUnitObj() | |
3918 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3918 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3919 |
|
3919 | |||
3920 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3920 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3921 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3921 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3922 |
|
3922 | |||
3923 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3923 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3924 |
|
3924 | |||
3925 | self.treeProjectProperties.setModel(propertiesModel) |
|
3925 | self.treeProjectProperties.setModel(propertiesModel) | |
3926 | self.treeProjectProperties.expandAll() |
|
3926 | self.treeProjectProperties.expandAll() | |
3927 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3927 | self.treeProjectProperties.resizeColumnToContents(0) | |
3928 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3928 | self.treeProjectProperties.resizeColumnToContents(1) | |
3929 |
|
3929 | |||
3930 | def refreshPUProperties(self, puObjView): |
|
3930 | def refreshPUProperties(self, puObjView): | |
3931 |
|
3931 | |||
3932 | ############ FTP CONFIG ################################ |
|
3932 | ############ FTP CONFIG ################################ | |
3933 | #Deleting FTP Conf. This processing unit have not got any |
|
3933 | #Deleting FTP Conf. This processing unit have not got any | |
3934 | #FTP configuration by default |
|
3934 | #FTP configuration by default | |
3935 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
3935 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
3936 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
3936 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
3937 | ######################################################## |
|
3937 | ######################################################## | |
3938 |
|
3938 | |||
3939 | propertyBuffObj = PropertyBuffer() |
|
3939 | propertyBuffObj = PropertyBuffer() | |
3940 |
|
3940 | |||
3941 | for thisOp in puObjView.getOperationObjList(): |
|
3941 | for thisOp in puObjView.getOperationObjList(): | |
3942 |
|
3942 | |||
3943 | operationName = thisOp.name |
|
3943 | operationName = thisOp.name | |
3944 |
|
3944 | |||
3945 | if operationName == 'run': |
|
3945 | if operationName == 'run': | |
3946 | operationName = 'Properties' |
|
3946 | operationName = 'Properties' | |
3947 |
|
3947 | |||
3948 | else: |
|
3948 | else: | |
3949 | if not thisOp.getParameterObjList(): |
|
3949 | if not thisOp.getParameterObjList(): | |
3950 | propertyBuffObj.append(operationName, '--', '--') |
|
3950 | propertyBuffObj.append(operationName, '--', '--') | |
3951 | continue |
|
3951 | continue | |
3952 |
|
3952 | |||
3953 | for thisParmObj in thisOp.getParameterObjList(): |
|
3953 | for thisParmObj in thisOp.getParameterObjList(): | |
3954 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3954 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3955 |
|
3955 | |||
3956 | ############ FTP CONFIG ################################ |
|
3956 | ############ FTP CONFIG ################################ | |
3957 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
3957 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
3958 | value = thisParmObj.getValue() |
|
3958 | value = thisParmObj.getValue() | |
3959 | self.temporalFTP.ftp_wei = value |
|
3959 | self.temporalFTP.ftp_wei = value | |
3960 |
|
3960 | |||
3961 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
3961 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
3962 | value = thisParmObj.getValue() |
|
3962 | value = thisParmObj.getValue() | |
3963 | self.temporalFTP.exp_code = value |
|
3963 | self.temporalFTP.exp_code = value | |
3964 |
|
3964 | |||
3965 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
3965 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
3966 | value = thisParmObj.getValue() |
|
3966 | value = thisParmObj.getValue() | |
3967 | self.temporalFTP.sub_exp_code = value |
|
3967 | self.temporalFTP.sub_exp_code = value | |
3968 |
|
3968 | |||
3969 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
3969 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
3970 | value = thisParmObj.getValue() |
|
3970 | value = thisParmObj.getValue() | |
3971 | self.temporalFTP.plot_pos = value |
|
3971 | self.temporalFTP.plot_pos = value | |
3972 |
|
3972 | |||
3973 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
3973 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
3974 | figpathObj = thisOp.getParameterObj('figpath') |
|
3974 | figpathObj = thisOp.getParameterObj('figpath') | |
3975 | if figpathObj: |
|
3975 | if figpathObj: | |
3976 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
3976 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
3977 |
|
3977 | |||
3978 | ######################################################## |
|
3978 | ######################################################## | |
3979 |
|
3979 | |||
3980 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3980 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3981 |
|
3981 | |||
3982 | self.treeProjectProperties.setModel(propertiesModel) |
|
3982 | self.treeProjectProperties.setModel(propertiesModel) | |
3983 | self.treeProjectProperties.expandAll() |
|
3983 | self.treeProjectProperties.expandAll() | |
3984 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3984 | self.treeProjectProperties.resizeColumnToContents(0) | |
3985 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3985 | self.treeProjectProperties.resizeColumnToContents(1) | |
3986 |
|
3986 | |||
3987 | def refreshGraphicsId(self): |
|
3987 | def refreshGraphicsId(self): | |
3988 |
|
3988 | |||
3989 | projectObj = self.getSelectedProjectObj() |
|
3989 | projectObj = self.getSelectedProjectObj() | |
3990 |
|
3990 | |||
3991 | if not projectObj: |
|
3991 | if not projectObj: | |
3992 | return |
|
3992 | return | |
3993 |
|
3993 | |||
3994 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
3994 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
3995 |
|
3995 | |||
3996 | for opObj in puObj.getOperationObjList(): |
|
3996 | for opObj in puObj.getOperationObjList(): | |
3997 |
|
3997 | |||
3998 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
3998 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
3999 | continue |
|
3999 | continue | |
4000 |
|
4000 | |||
4001 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4001 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4002 |
|
4002 | |||
4003 | def on_click(self, index): |
|
4003 | def on_click(self, index): | |
4004 |
|
4004 | |||
4005 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4005 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4006 |
|
4006 | |||
4007 | projectObjView = self.getSelectedProjectObj() |
|
4007 | projectObjView = self.getSelectedProjectObj() | |
4008 |
|
4008 | |||
4009 | if not projectObjView: |
|
4009 | if not projectObjView: | |
4010 | return |
|
4010 | return | |
4011 |
|
4011 | |||
4012 | self.create = False |
|
4012 | self.create = False | |
4013 | selectedObjView = self.getSelectedItemObj() |
|
4013 | selectedObjView = self.getSelectedItemObj() | |
4014 |
|
4014 | |||
4015 | #A project has been selected |
|
4015 | #A project has been selected | |
4016 | if projectObjView == selectedObjView: |
|
4016 | if projectObjView == selectedObjView: | |
4017 |
|
4017 | |||
4018 | self.refreshProjectWindow(projectObjView) |
|
4018 | self.refreshProjectWindow(projectObjView) | |
4019 | self.refreshProjectProperties(projectObjView) |
|
4019 | self.refreshProjectProperties(projectObjView) | |
4020 |
|
4020 | |||
4021 | self.tabProject.setEnabled(True) |
|
4021 | self.tabProject.setEnabled(True) | |
4022 | self.tabVoltage.setEnabled(False) |
|
4022 | self.tabVoltage.setEnabled(False) | |
4023 | self.tabSpectra.setEnabled(False) |
|
4023 | self.tabSpectra.setEnabled(False) | |
4024 | self.tabCorrelation.setEnabled(False) |
|
4024 | self.tabCorrelation.setEnabled(False) | |
4025 | self.tabSpectraHeis.setEnabled(False) |
|
4025 | self.tabSpectraHeis.setEnabled(False) | |
4026 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4026 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4027 |
|
4027 | |||
4028 | return |
|
4028 | return | |
4029 |
|
4029 | |||
4030 | #A processing unit has been selected |
|
4030 | #A processing unit has been selected | |
4031 | voltEnable = False |
|
4031 | voltEnable = False | |
4032 | specEnable = False |
|
4032 | specEnable = False | |
4033 | corrEnable = False |
|
4033 | corrEnable = False | |
4034 | specHeisEnable = False |
|
4034 | specHeisEnable = False | |
4035 | tabSelected = self.tabProject |
|
4035 | tabSelected = self.tabProject | |
4036 |
|
4036 | |||
4037 | puObj = selectedObjView |
|
4037 | puObj = selectedObjView | |
4038 |
|
4038 | |||
4039 | self.refreshPUWindow(puObj) |
|
4039 | self.refreshPUWindow(puObj) | |
4040 | self.refreshPUProperties(puObj) |
|
4040 | self.refreshPUProperties(puObj) | |
4041 | self.showtabPUCreated(puObj.datatype) |
|
4041 | self.showtabPUCreated(puObj.datatype) | |
4042 |
|
4042 | |||
4043 | def on_right_click(self, pos): |
|
4043 | def on_right_click(self, pos): | |
4044 |
|
4044 | |||
4045 | self.menu = QtGui.QMenu() |
|
4045 | self.menu = QtGui.QMenu() | |
4046 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4046 | quitAction0 = self.menu.addAction("Create a New Project") | |
4047 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4047 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4048 | quitAction2 = self.menu.addAction("Delete Item") |
|
4048 | quitAction2 = self.menu.addAction("Delete Item") | |
4049 | quitAction3 = self.menu.addAction("Quit") |
|
4049 | quitAction3 = self.menu.addAction("Quit") | |
4050 |
|
4050 | |||
4051 | if len(self.__itemTreeDict) == 0: |
|
4051 | if len(self.__itemTreeDict) == 0: | |
4052 | quitAction2.setEnabled(False) |
|
4052 | quitAction2.setEnabled(False) | |
4053 | else: |
|
4053 | else: | |
4054 | quitAction2.setEnabled(True) |
|
4054 | quitAction2.setEnabled(True) | |
4055 |
|
4055 | |||
4056 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4056 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4057 |
|
4057 | |||
4058 | if action == quitAction0: |
|
4058 | if action == quitAction0: | |
4059 | self. setInputsProject_View() |
|
4059 | self. setInputsProject_View() | |
4060 | self.create = True |
|
4060 | self.create = True | |
4061 |
|
4061 | |||
4062 | if action == quitAction1: |
|
4062 | if action == quitAction1: | |
4063 | if len(self.__projectObjDict) == 0: |
|
4063 | if len(self.__projectObjDict) == 0: | |
4064 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4064 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4065 | self.console.clear() |
|
4065 | self.console.clear() | |
4066 | self.console.append(outputstr) |
|
4066 | self.console.append(outputstr) | |
4067 | return 0 |
|
4067 | return 0 | |
4068 | else: |
|
4068 | else: | |
4069 | self.addPUWindow() |
|
4069 | self.addPUWindow() | |
4070 | self.console.clear() |
|
4070 | self.console.clear() | |
4071 | self.console.append("Please, Choose the type of Processing Unit") |
|
4071 | self.console.append("Please, Choose the type of Processing Unit") | |
4072 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4072 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4073 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4073 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4074 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4074 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4075 |
|
4075 | |||
4076 | if action == quitAction2: |
|
4076 | if action == quitAction2: | |
4077 | index = self.selectedItemTree |
|
4077 | index = self.selectedItemTree | |
4078 | try: |
|
4078 | try: | |
4079 | index.parent() |
|
4079 | index.parent() | |
4080 | except: |
|
4080 | except: | |
4081 | self.console.append('Please, first at all select a Project or Processing Unit') |
|
4081 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4082 | return 0 |
|
4082 | return 0 | |
4083 | # print index.parent(),index |
|
4083 | # print index.parent(),index | |
4084 | if index.parent() == None: |
|
4084 | if index.parent() == None: | |
4085 | self.projectExplorerModel.removeRow(index.row()) |
|
4085 | self.projectExplorerModel.removeRow(index.row()) | |
4086 | else: |
|
4086 | else: | |
4087 | index.parent().removeRow(index.row()) |
|
4087 | index.parent().removeRow(index.row()) | |
4088 | self.removeItemTreeFromProject() |
|
4088 | self.removeItemTreeFromProject() | |
4089 | self.console.clear() |
|
4089 | self.console.clear() | |
4090 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4090 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4091 | # print i.row() |
|
4091 | # print i.row() | |
4092 |
|
4092 | |||
4093 | if action == quitAction3: |
|
4093 | if action == quitAction3: | |
4094 | self.close() |
|
4094 | self.close() | |
4095 | return 0 |
|
4095 | return 0 | |
4096 |
|
4096 | |||
4097 | def createProjectView(self, id): |
|
4097 | def createProjectView(self, id): | |
4098 |
|
4098 | |||
4099 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4099 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4100 | id = str(id) |
|
4100 | id = str(id) | |
4101 | projectParms = self.__getParmsFromProjectWindow() |
|
4101 | projectParms = self.__getParmsFromProjectWindow() | |
4102 |
|
4102 | |||
4103 | if not projectParms.isValid(): |
|
4103 | if not projectParms.isValid(): | |
4104 | return None |
|
4104 | return None | |
4105 |
|
4105 | |||
4106 | projectObjView = Project() |
|
4106 | projectObjView = Project() | |
4107 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4107 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4108 |
|
4108 | |||
4109 | self.__projectObjDict[id] = projectObjView |
|
4109 | self.__projectObjDict[id] = projectObjView | |
4110 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4110 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4111 |
|
4111 | |||
4112 | return projectObjView |
|
4112 | return projectObjView | |
4113 |
|
4113 | |||
4114 | def updateProjectView(self): |
|
4114 | def updateProjectView(self): | |
4115 |
|
4115 | |||
4116 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4116 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4117 |
|
4117 | |||
4118 | projectParms = self.__getParmsFromProjectWindow() |
|
4118 | projectParms = self.__getParmsFromProjectWindow() | |
4119 |
|
4119 | |||
4120 | if not projectParms.isValid(): |
|
4120 | if not projectParms.isValid(): | |
4121 | return None |
|
4121 | return None | |
4122 |
|
4122 | |||
4123 | projectObjView = self.getSelectedProjectObj() |
|
4123 | projectObjView = self.getSelectedProjectObj() | |
4124 |
|
4124 | |||
4125 | if not projectObjView: |
|
4125 | if not projectObjView: | |
4126 | self.console.append("Please select a project before update it") |
|
4126 | self.console.append("Please select a project before update it") | |
4127 | return None |
|
4127 | return None | |
4128 |
|
4128 | |||
4129 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4129 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4130 |
|
4130 | |||
4131 | return projectObjView |
|
4131 | return projectObjView | |
4132 |
|
4132 | |||
4133 | def createReadUnitView(self, projectObjView): |
|
4133 | def createReadUnitView(self, projectObjView, idReadUnit=None): | |
4134 |
|
||||
4135 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
|||
4136 |
|
4134 | |||
4137 | projectParms = self.__getParmsFromProjectWindow() |
|
4135 | projectParms = self.__getParmsFromProjectWindow() | |
4138 |
|
4136 | |||
4139 | if not projectParms.isValid(): |
|
4137 | if not projectParms.isValid(): | |
4140 | return None |
|
4138 | return None | |
4141 |
|
4139 | |||
4142 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4140 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4143 |
readUnitConfObj = projectObjView.addReadUnit(d |
|
4141 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
|
4142 | datatype=projectParms.datatype, | |||
4144 | path=projectParms.dpath, |
|
4143 | path=projectParms.dpath, | |
4145 | startDate=projectParms.startDate, |
|
4144 | startDate=projectParms.startDate, | |
4146 | endDate=projectParms.endDate, |
|
4145 | endDate=projectParms.endDate, | |
4147 | startTime=projectParms.startTime, |
|
4146 | startTime=projectParms.startTime, | |
4148 | endTime=projectParms.endTime, |
|
4147 | endTime=projectParms.endTime, | |
4149 | online=projectParms.online, |
|
4148 | online=projectParms.online, | |
4150 | walk=projectParms.walk |
|
4149 | walk=projectParms.walk | |
4151 | ) |
|
4150 | ) | |
4152 |
|
4151 | |||
4153 | if projectParms.set: |
|
4152 | if projectParms.set: | |
4154 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4153 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4155 |
|
4154 | |||
4156 | if projectParms.delay: |
|
4155 | if projectParms.delay: | |
4157 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4156 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4158 |
|
4157 | |||
4159 | if projectParms.expLabel: |
|
4158 | if projectParms.expLabel: | |
4160 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4159 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4161 |
|
4160 | |||
4162 | readUnitConfObj.addOperation(name="printInfo") |
|
4161 | readUnitConfObj.addOperation(name="printInfo") | |
4163 |
|
4162 | |||
4164 | if projectParms.datatype == "USRP": |
|
4163 | if projectParms.datatype == "USRP": | |
4165 |
readUnitConfObj = projectObjView.addReadUnit(d |
|
4164 | readUnitConfObj = projectObjView.addReadUnit(id=idReadUnit, | |
|
4165 | datatype=projectParms.datatype, | |||
4166 | path=projectParms.dpath, |
|
4166 | path=projectParms.dpath, | |
4167 | startDate=projectParms.startDate, |
|
4167 | startDate=projectParms.startDate, | |
4168 | endDate=projectParms.endDate, |
|
4168 | endDate=projectParms.endDate, | |
4169 | startTime=projectParms.startTime, |
|
4169 | startTime=projectParms.startTime, | |
4170 | endTime=projectParms.endTime, |
|
4170 | endTime=projectParms.endTime, | |
4171 | online=projectParms.online, |
|
4171 | online=projectParms.online, | |
4172 | ippKm=projectParms.ippKm |
|
4172 | ippKm=projectParms.ippKm | |
4173 | ) |
|
4173 | ) | |
4174 |
|
4174 | |||
4175 | if projectParms.delay: |
|
4175 | if projectParms.delay: | |
4176 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4176 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4177 |
|
4177 | |||
4178 | return readUnitConfObj |
|
4178 | return readUnitConfObj | |
4179 |
|
4179 | |||
4180 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4180 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4181 |
|
4181 | |||
4182 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
4182 | projectObjView.removeProcUnit(idReadUnit) | |
4183 |
|
||||
4184 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
|||
4185 |
|
||||
4186 | projectParms = self.__getParmsFromProjectWindow() |
|
|||
4187 |
|
4183 | |||
4188 | if not projectParms.isValid(): |
|
4184 | readUnitConfObj = self.createReadUnitView(projectObjView, idReadUnit) | |
4189 | return None |
|
|||
4190 |
|
4185 | |||
4191 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: |
|
|||
4192 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
|||
4193 | path=projectParms.dpath, |
|
|||
4194 | startDate=projectParms.startDate, |
|
|||
4195 | endDate=projectParms.endDate, |
|
|||
4196 | startTime=projectParms.startTime, |
|
|||
4197 | endTime=projectParms.endTime, |
|
|||
4198 | online=projectParms.online, |
|
|||
4199 | walk=projectParms.walk |
|
|||
4200 | ) |
|
|||
4201 | if projectParms.set: |
|
|||
4202 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
|||
4203 |
|
||||
4204 | if projectParms.delay: |
|
|||
4205 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
|||
4206 |
|
||||
4207 | if projectParms.expLabel: |
|
|||
4208 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
|||
4209 |
|
||||
4210 | readUnitConfObj.addOperation(name="printInfo") |
|
|||
4211 |
|
||||
4212 | if projectParms.datatype == "USRP": |
|
|||
4213 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
|||
4214 | path=projectParms.dpath, |
|
|||
4215 | startDate=projectParms.startDate, |
|
|||
4216 | endDate=projectParms.endDate, |
|
|||
4217 | startTime=projectParms.startTime, |
|
|||
4218 | endTime=projectParms.endTime, |
|
|||
4219 | online=projectParms.online, |
|
|||
4220 | ippKm=projectParms.ippKm |
|
|||
4221 | ) |
|
|||
4222 |
|
||||
4223 | if projectParms.delay: |
|
|||
4224 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
|||
4225 |
|
||||
4226 | return readUnitConfObj |
|
4186 | return readUnitConfObj | |
4227 |
|
4187 | |||
4228 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4188 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4229 |
|
4189 | |||
4230 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4190 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4231 |
|
4191 | |||
4232 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4192 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4233 |
|
4193 | |||
4234 | return procUnitConfObj |
|
4194 | return procUnitConfObj | |
4235 |
|
4195 | |||
4236 | def updateProcUnitView(self, id): |
|
4196 | def updateProcUnitView(self, id): | |
4237 |
|
4197 | |||
4238 | pass |
|
4198 | pass | |
4239 |
|
4199 | |||
4240 | def addPUWindow(self): |
|
4200 | def addPUWindow(self): | |
4241 |
|
4201 | |||
4242 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4202 | self.configUPWindowObj = UnitProcessWindow(self) | |
4243 | fatherObj = self.getSelectedItemObj() |
|
4203 | fatherObj = self.getSelectedItemObj() | |
4244 | try: |
|
4204 | try: | |
4245 | fatherObj.getElementName() |
|
4205 | fatherObj.getElementName() | |
4246 | except: |
|
4206 | except: | |
4247 | self.console.append("First left click on Project or Processing Unit") |
|
4207 | self.console.append("First left click on Project or Processing Unit") | |
4248 | return 0 |
|
4208 | return 0 | |
4249 |
|
4209 | |||
4250 | if fatherObj.getElementName() == 'Project': |
|
4210 | if fatherObj.getElementName() == 'Project': | |
4251 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4211 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4252 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4212 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4253 |
|
4213 | |||
4254 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4214 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4255 | self.configUPWindowObj.loadTotalList() |
|
4215 | self.configUPWindowObj.loadTotalList() | |
4256 | self.configUPWindowObj.show() |
|
4216 | self.configUPWindowObj.show() | |
4257 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4217 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4258 |
|
4218 | |||
4259 | def createPUWindow(self): |
|
4219 | def createPUWindow(self): | |
4260 |
|
4220 | |||
4261 | if not self.configUPWindowObj.create: |
|
4221 | if not self.configUPWindowObj.create: | |
4262 | return |
|
4222 | return | |
4263 |
|
4223 | |||
4264 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4224 | fatherObj = self.configUPWindowObj.getFromWindow | |
4265 | datatype = self.configUPWindowObj.typeofUP |
|
4225 | datatype = self.configUPWindowObj.typeofUP | |
4266 |
|
4226 | |||
4267 | if fatherObj.getElementName() == 'Project': |
|
4227 | if fatherObj.getElementName() == 'Project': | |
4268 | inputId = fatherObj.getReadUnitId() |
|
4228 | inputId = fatherObj.getReadUnitId() | |
4269 | projectObjView = fatherObj |
|
4229 | projectObjView = fatherObj | |
4270 | else: |
|
4230 | else: | |
4271 | inputId = fatherObj.getId() |
|
4231 | inputId = fatherObj.getId() | |
4272 | projectObjView = self.getSelectedProjectObj() |
|
4232 | projectObjView = self.getSelectedProjectObj() | |
4273 |
|
4233 | |||
4274 | if not projectObjView: |
|
4234 | if not projectObjView: | |
4275 | return |
|
4235 | return | |
4276 |
|
4236 | |||
4277 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4237 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4278 |
|
4238 | |||
4279 | self.addPU2ProjectExplorer(puObj) |
|
4239 | self.addPU2ProjectExplorer(puObj) | |
4280 |
|
4240 | |||
4281 | self.showtabPUCreated(datatype) |
|
4241 | self.showtabPUCreated(datatype) | |
4282 |
|
4242 | |||
4283 | self.clearPUWindow(datatype) |
|
4243 | self.clearPUWindow(datatype) | |
4284 |
|
4244 | |||
4285 | self.showPUinitView() |
|
4245 | self.showPUinitView() | |
4286 |
|
4246 | |||
4287 | def addFTPConf2Operation(self, puObj, opObj): |
|
4247 | def addFTPConf2Operation(self, puObj, opObj): | |
4288 |
|
4248 | |||
4289 | if not self.temporalFTP.create: |
|
4249 | if not self.temporalFTP.create: | |
4290 | self.temporalFTP.setwithoutconfiguration() |
|
4250 | self.temporalFTP.setwithoutconfiguration() | |
4291 |
|
4251 | |||
4292 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4252 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4293 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4253 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4294 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4254 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4295 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4255 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4296 |
|
4256 | |||
4297 | if self.temporalFTP.ftp_wei: |
|
4257 | if self.temporalFTP.ftp_wei: | |
4298 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4258 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4299 | if self.temporalFTP.exp_code: |
|
4259 | if self.temporalFTP.exp_code: | |
4300 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4260 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4301 | if self.temporalFTP.sub_exp_code: |
|
4261 | if self.temporalFTP.sub_exp_code: | |
4302 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4262 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4303 | if self.temporalFTP.plot_pos: |
|
4263 | if self.temporalFTP.plot_pos: | |
4304 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4264 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4305 |
|
4265 | |||
4306 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4266 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4307 | # |
|
4267 | # | |
4308 | # puId = None |
|
4268 | # puId = None | |
4309 | # puObj = None |
|
4269 | # puObj = None | |
4310 | # |
|
4270 | # | |
4311 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4271 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4312 | # |
|
4272 | # | |
4313 | # if not thisPuObj.name == "SendToServer": |
|
4273 | # if not thisPuObj.name == "SendToServer": | |
4314 | # continue |
|
4274 | # continue | |
4315 | # |
|
4275 | # | |
4316 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4276 | # opObj = thisPuObj.getOperationObj(name='run') | |
4317 | # |
|
4277 | # | |
4318 | # parmObj = opObj.getParameterObj('localfolder') |
|
4278 | # parmObj = opObj.getParameterObj('localfolder') | |
4319 | # |
|
4279 | # | |
4320 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4280 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4321 | # if not parmObj: |
|
4281 | # if not parmObj: | |
4322 | # projectObj.removeProcUnit(thisPuId) |
|
4282 | # projectObj.removeProcUnit(thisPuId) | |
4323 | # continue |
|
4283 | # continue | |
4324 | # |
|
4284 | # | |
4325 | # thisLocalfolder = parmObj.getValue() |
|
4285 | # thisLocalfolder = parmObj.getValue() | |
4326 | # |
|
4286 | # | |
4327 | # if localfolder != thisLocalfolder: |
|
4287 | # if localfolder != thisLocalfolder: | |
4328 | # continue |
|
4288 | # continue | |
4329 | # |
|
4289 | # | |
4330 | # puId = thisPuId |
|
4290 | # puId = thisPuId | |
4331 | # puObj = thisPuObj |
|
4291 | # puObj = thisPuObj | |
4332 | # break |
|
4292 | # break | |
4333 | # |
|
4293 | # | |
4334 | # return puObj |
|
4294 | # return puObj | |
4335 |
|
4295 | |||
4336 | def createFTPProcUnitView(self): |
|
4296 | def createFTPProcUnitView(self): | |
4337 |
|
4297 | |||
4338 | if not self.temporalFTP.create: |
|
4298 | if not self.temporalFTP.create: | |
4339 | self.temporalFTP.setwithoutconfiguration() |
|
4299 | self.temporalFTP.setwithoutconfiguration() | |
4340 |
|
4300 | |||
4341 | projectObj = self.getSelectedProjectObj() |
|
4301 | projectObj = self.getSelectedProjectObj() | |
4342 |
|
4302 | |||
4343 | if not projectObj: |
|
4303 | if not projectObj: | |
4344 | return |
|
4304 | return | |
4345 |
|
4305 | |||
4346 | self.removeAllFTPProcUnitView(projectObj) |
|
4306 | self.removeAllFTPProcUnitView(projectObj) | |
4347 |
|
4307 | |||
4348 | if not self.__puLocalFolder2FTP: |
|
4308 | if not self.__puLocalFolder2FTP: | |
4349 | return |
|
4309 | return | |
4350 |
|
4310 | |||
4351 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4311 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4352 |
|
4312 | |||
4353 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4313 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4354 |
|
4314 | |||
4355 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4315 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4356 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4316 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4357 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4317 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4358 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4318 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4359 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4319 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4360 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4320 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4361 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4321 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4362 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4322 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4363 |
|
4323 | |||
4364 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4324 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4365 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4325 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4366 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4326 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4367 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4327 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4368 |
|
4328 | |||
4369 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4329 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4370 |
|
4330 | |||
4371 | def removeAllFTPProcUnitView(self, projectObj): |
|
4331 | def removeAllFTPProcUnitView(self, projectObj): | |
4372 |
|
4332 | |||
4373 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4333 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4374 |
|
4334 | |||
4375 | if not thisPuObj.name == "SendToServer": |
|
4335 | if not thisPuObj.name == "SendToServer": | |
4376 | continue |
|
4336 | continue | |
4377 |
|
4337 | |||
4378 | projectObj.removeProcUnit(thisPuId) |
|
4338 | projectObj.removeProcUnit(thisPuId) | |
4379 |
|
4339 | |||
4380 | if thisPuId not in self.__puObjDict.keys(): |
|
4340 | if thisPuId not in self.__puObjDict.keys(): | |
4381 | continue |
|
4341 | continue | |
4382 |
|
4342 | |||
4383 | self.__puObjDict.pop(thisPuId) |
|
4343 | self.__puObjDict.pop(thisPuId) | |
4384 |
|
4344 | |||
4385 | def showPUinitView(self): |
|
4345 | def showPUinitView(self): | |
4386 |
|
4346 | |||
4387 | self.propertiesModel = TreeModel() |
|
4347 | self.propertiesModel = TreeModel() | |
4388 | self.propertiesModel.initPUVoltageView() |
|
4348 | self.propertiesModel.initPUVoltageView() | |
4389 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4349 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4390 | self.treeProjectProperties.expandAll() |
|
4350 | self.treeProjectProperties.expandAll() | |
4391 | self.treeProjectProperties.allColumnsShowFocus() |
|
4351 | self.treeProjectProperties.allColumnsShowFocus() | |
4392 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4352 | self.treeProjectProperties.resizeColumnToContents(1) | |
4393 |
|
4353 | |||
4394 | def saveFTPFromOpObj(self, operationObj): |
|
4354 | def saveFTPFromOpObj(self, operationObj): | |
4395 |
|
4355 | |||
4396 | if operationObj.name != "SendByFTP": |
|
4356 | if operationObj.name != "SendByFTP": | |
4397 | return |
|
4357 | return | |
4398 |
|
4358 | |||
4399 | server = operationObj.getParameterValue("server") |
|
4359 | server = operationObj.getParameterValue("server") | |
4400 | username = operationObj.getParameterValue("username") |
|
4360 | username = operationObj.getParameterValue("username") | |
4401 | password = operationObj.getParameterValue("password") |
|
4361 | password = operationObj.getParameterValue("password") | |
4402 | localfolder = operationObj.getParameterValue("localfolder") |
|
4362 | localfolder = operationObj.getParameterValue("localfolder") | |
4403 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4363 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4404 | ext = operationObj.getParameterValue("ext") |
|
4364 | ext = operationObj.getParameterValue("ext") | |
4405 | period = operationObj.getParameterValue("period") |
|
4365 | period = operationObj.getParameterValue("period") | |
4406 |
|
4366 | |||
4407 | self.temporalFTP.save(server=server, |
|
4367 | self.temporalFTP.save(server=server, | |
4408 | remotefolder=remotefolder, |
|
4368 | remotefolder=remotefolder, | |
4409 | username=username, |
|
4369 | username=username, | |
4410 | password=password, |
|
4370 | password=password, | |
4411 | localfolder=localfolder, |
|
4371 | localfolder=localfolder, | |
4412 | extension=ext) |
|
4372 | extension=ext) | |
4413 |
|
4373 | |||
4414 | return |
|
4374 | return | |
4415 |
|
4375 | |||
4416 | def saveFTPFromProcUnitObj(self, puObj): |
|
4376 | def saveFTPFromProcUnitObj(self, puObj): | |
4417 |
|
4377 | |||
4418 | opObj = puObj.getOperationObj(name="run") |
|
4378 | opObj = puObj.getOperationObj(name="run") | |
4419 |
|
4379 | |||
4420 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4380 | parmObj = opObj.getParameterObj(parameterName="server") | |
4421 | if parmObj == None: |
|
4381 | if parmObj == None: | |
4422 | server = 'jro-app.igp.gob.pe' |
|
4382 | server = 'jro-app.igp.gob.pe' | |
4423 | else: |
|
4383 | else: | |
4424 | server = parmObj.getValue() |
|
4384 | server = parmObj.getValue() | |
4425 |
|
4385 | |||
4426 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4386 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4427 | if parmObj == None: |
|
4387 | if parmObj == None: | |
4428 | remotefolder = '/home/wmaster/graficos' |
|
4388 | remotefolder = '/home/wmaster/graficos' | |
4429 | else: |
|
4389 | else: | |
4430 | remotefolder = parmObj.getValue() |
|
4390 | remotefolder = parmObj.getValue() | |
4431 |
|
4391 | |||
4432 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4392 | parmObj = opObj.getParameterObj(parameterName="username") | |
4433 | if parmObj == None: |
|
4393 | if parmObj == None: | |
4434 | username = 'wmaster' |
|
4394 | username = 'wmaster' | |
4435 | else: |
|
4395 | else: | |
4436 | username = parmObj.getValue() |
|
4396 | username = parmObj.getValue() | |
4437 |
|
4397 | |||
4438 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4398 | parmObj = opObj.getParameterObj(parameterName="password") | |
4439 | if parmObj == None: |
|
4399 | if parmObj == None: | |
4440 | password = 'mst2010vhf' |
|
4400 | password = 'mst2010vhf' | |
4441 | else: |
|
4401 | else: | |
4442 | password = parmObj.getValue() |
|
4402 | password = parmObj.getValue() | |
4443 |
|
4403 | |||
4444 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4404 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4445 | if parmObj == None: |
|
4405 | if parmObj == None: | |
4446 | ftp_wei = 0 |
|
4406 | ftp_wei = 0 | |
4447 | else: |
|
4407 | else: | |
4448 | ftp_wei = parmObj.getValue() |
|
4408 | ftp_wei = parmObj.getValue() | |
4449 |
|
4409 | |||
4450 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4410 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4451 | if parmObj == None: |
|
4411 | if parmObj == None: | |
4452 | exp_code = 0 |
|
4412 | exp_code = 0 | |
4453 | else: |
|
4413 | else: | |
4454 | exp_code = parmObj.getValue() |
|
4414 | exp_code = parmObj.getValue() | |
4455 |
|
4415 | |||
4456 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4416 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4457 | if parmObj == None: |
|
4417 | if parmObj == None: | |
4458 | sub_exp_code = 0 |
|
4418 | sub_exp_code = 0 | |
4459 | else: |
|
4419 | else: | |
4460 | sub_exp_code = parmObj.getValue() |
|
4420 | sub_exp_code = parmObj.getValue() | |
4461 |
|
4421 | |||
4462 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4422 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4463 | if parmObj == None: |
|
4423 | if parmObj == None: | |
4464 | plot_pos = 0 |
|
4424 | plot_pos = 0 | |
4465 | else: |
|
4425 | else: | |
4466 | plot_pos = parmObj.getValue() |
|
4426 | plot_pos = parmObj.getValue() | |
4467 |
|
4427 | |||
4468 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4428 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4469 | if parmObj == None: |
|
4429 | if parmObj == None: | |
4470 | localfolder = None |
|
4430 | localfolder = None | |
4471 | else: |
|
4431 | else: | |
4472 | localfolder = parmObj.getValue() |
|
4432 | localfolder = parmObj.getValue() | |
4473 |
|
4433 | |||
4474 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4434 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4475 | if parmObj == None: |
|
4435 | if parmObj == None: | |
4476 | extension = '.png' |
|
4436 | extension = '.png' | |
4477 | else: |
|
4437 | else: | |
4478 | extension = parmObj.getValue() |
|
4438 | extension = parmObj.getValue() | |
4479 |
|
4439 | |||
4480 | self.temporalFTP.save(server=server, |
|
4440 | self.temporalFTP.save(server=server, | |
4481 | remotefolder=remotefolder, |
|
4441 | remotefolder=remotefolder, | |
4482 | username=username, |
|
4442 | username=username, | |
4483 | password=password, |
|
4443 | password=password, | |
4484 | ftp_wei=ftp_wei, |
|
4444 | ftp_wei=ftp_wei, | |
4485 | exp_code=exp_code, |
|
4445 | exp_code=exp_code, | |
4486 | sub_exp_code=sub_exp_code, |
|
4446 | sub_exp_code=sub_exp_code, | |
4487 | plot_pos=plot_pos, |
|
4447 | plot_pos=plot_pos, | |
4488 | localfolder=localfolder, |
|
4448 | localfolder=localfolder, | |
4489 | extension=extension) |
|
4449 | extension=extension) | |
4490 |
|
4450 | |||
4491 | def addProject2ProjectExplorer(self, id, name): |
|
4451 | def addProject2ProjectExplorer(self, id, name): | |
4492 |
|
4452 | |||
4493 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4453 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4494 |
|
4454 | |||
4495 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4455 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4496 | parentItem.appendRow(itemTree) |
|
4456 | parentItem.appendRow(itemTree) | |
4497 |
|
4457 | |||
4498 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4458 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4499 |
|
4459 | |||
4500 | self.selectedItemTree = itemTree |
|
4460 | self.selectedItemTree = itemTree | |
4501 |
|
4461 | |||
4502 | self.__itemTreeDict[id] = itemTree |
|
4462 | self.__itemTreeDict[id] = itemTree | |
4503 |
|
4463 | |||
4504 | def addPU2ProjectExplorer(self, puObj): |
|
4464 | def addPU2ProjectExplorer(self, puObj): | |
4505 |
|
4465 | |||
4506 | id, name = puObj.id, puObj.datatype |
|
4466 | id, name = puObj.id, puObj.datatype | |
4507 |
|
4467 | |||
4508 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4468 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4509 |
|
4469 | |||
4510 | parentItem = self.selectedItemTree |
|
4470 | parentItem = self.selectedItemTree | |
4511 | parentItem.appendRow(itemTree) |
|
4471 | parentItem.appendRow(itemTree) | |
4512 | self.projectExplorerTree.expandAll() |
|
4472 | self.projectExplorerTree.expandAll() | |
4513 |
|
4473 | |||
4514 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4474 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4515 |
|
4475 | |||
4516 | self.selectedItemTree = itemTree |
|
4476 | self.selectedItemTree = itemTree | |
4517 |
|
4477 | |||
4518 | self.__itemTreeDict[id] = itemTree |
|
4478 | self.__itemTreeDict[id] = itemTree | |
4519 |
|
4479 | |||
4520 | def addPU2PELoadXML(self, puObj): |
|
4480 | def addPU2PELoadXML(self, puObj): | |
4521 |
|
4481 | |||
4522 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4482 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4523 |
|
4483 | |||
4524 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4484 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4525 |
|
4485 | |||
4526 | if self.__itemTreeDict.has_key(inputId): |
|
4486 | if self.__itemTreeDict.has_key(inputId): | |
4527 | parentItem = self.__itemTreeDict[inputId] |
|
4487 | parentItem = self.__itemTreeDict[inputId] | |
4528 | else: |
|
4488 | else: | |
4529 | #If parent is a Reader object |
|
4489 | #If parent is a Reader object | |
4530 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4490 | parentItem = self.__itemTreeDict[id[:-1]] | |
4531 |
|
4491 | |||
4532 | parentItem.appendRow(itemTree) |
|
4492 | parentItem.appendRow(itemTree) | |
4533 | self.projectExplorerTree.expandAll() |
|
4493 | self.projectExplorerTree.expandAll() | |
4534 | parentItem = itemTree |
|
4494 | parentItem = itemTree | |
4535 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4495 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4536 |
|
4496 | |||
4537 | self.__itemTreeDict[id] = itemTree |
|
4497 | self.__itemTreeDict[id] = itemTree | |
4538 | self.selectedItemTree = itemTree |
|
4498 | self.selectedItemTree = itemTree | |
4539 |
|
4499 | |||
4540 | def getSelectedProjectObj(self): |
|
4500 | def getSelectedProjectObj(self): | |
4541 | """ |
|
4501 | """ | |
4542 | Return the current project object selected. If a processing unit is |
|
4502 | Return the current project object selected. If a processing unit is | |
4543 | actually selected this function returns associated project. |
|
4503 | actually selected this function returns associated project. | |
4544 |
|
4504 | |||
4545 | None if any project or processing unit is selected |
|
4505 | None if any project or processing unit is selected | |
4546 | """ |
|
4506 | """ | |
4547 | for key in self.__itemTreeDict.keys(): |
|
4507 | for key in self.__itemTreeDict.keys(): | |
4548 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4508 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4549 | continue |
|
4509 | continue | |
4550 |
|
4510 | |||
4551 | if self.__projectObjDict.has_key(key): |
|
4511 | if self.__projectObjDict.has_key(key): | |
4552 | projectObj = self.__projectObjDict[key] |
|
4512 | projectObj = self.__projectObjDict[key] | |
4553 | return projectObj |
|
4513 | return projectObj | |
4554 |
|
4514 | |||
4555 | puObj = self.__puObjDict[key] |
|
4515 | puObj = self.__puObjDict[key] | |
4556 |
|
4516 | |||
4557 | if puObj.parentId == None: |
|
4517 | if puObj.parentId == None: | |
4558 | projectId = puObj.getId()[0] |
|
4518 | projectId = puObj.getId()[0] | |
4559 | else: |
|
4519 | else: | |
4560 | projectId = puObj.parentId |
|
4520 | projectId = puObj.parentId | |
4561 |
|
4521 | |||
4562 | projectObj = self.__projectObjDict[projectId] |
|
4522 | projectObj = self.__projectObjDict[projectId] | |
4563 | return projectObj |
|
4523 | return projectObj | |
4564 |
|
4524 | |||
4565 | return None |
|
4525 | return None | |
4566 |
|
4526 | |||
4567 | def getSelectedItemObj(self): |
|
4527 | def getSelectedItemObj(self): | |
4568 | """ |
|
4528 | """ | |
4569 | Return the current project or processing unit object selected |
|
4529 | Return the current project or processing unit object selected | |
4570 |
|
4530 | |||
4571 | None if any project or processing unit is selected |
|
4531 | None if any project or processing unit is selected | |
4572 | """ |
|
4532 | """ | |
4573 | for key in self.__itemTreeDict.keys(): |
|
4533 | for key in self.__itemTreeDict.keys(): | |
4574 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4534 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4575 | continue |
|
4535 | continue | |
4576 |
|
4536 | |||
4577 | if self.__projectObjDict.has_key(key) == True: |
|
4537 | if self.__projectObjDict.has_key(key) == True: | |
4578 | fatherObj = self.__projectObjDict[key] |
|
4538 | fatherObj = self.__projectObjDict[key] | |
4579 | else: |
|
4539 | else: | |
4580 | fatherObj = self.__puObjDict[key] |
|
4540 | fatherObj = self.__puObjDict[key] | |
4581 |
|
4541 | |||
4582 | return fatherObj |
|
4542 | return fatherObj | |
4583 |
|
4543 | |||
4584 | return None |
|
4544 | return None | |
4585 |
|
4545 | |||
4586 | def _WarningWindow(self, text, information): |
|
4546 | def _WarningWindow(self, text, information): | |
4587 |
|
4547 | |||
4588 | msgBox = QtGui.QMessageBox() |
|
4548 | msgBox = QtGui.QMessageBox() | |
4589 | msgBox.setText(text) |
|
4549 | msgBox.setText(text) | |
4590 | msgBox.setInformativeText(information) |
|
4550 | msgBox.setInformativeText(information) | |
4591 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4551 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4592 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4552 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4593 | ret = msgBox.exec_() |
|
4553 | ret = msgBox.exec_() | |
4594 |
|
4554 | |||
4595 | answer = False |
|
4555 | answer = False | |
4596 |
|
4556 | |||
4597 | if ret == QtGui.QMessageBox.Ok: |
|
4557 | if ret == QtGui.QMessageBox.Ok: | |
4598 | answer = True |
|
4558 | answer = True | |
4599 |
|
4559 | |||
4600 | return answer |
|
4560 | return answer | |
4601 |
|
4561 | |||
4602 | def __getNewProjectId(self): |
|
4562 | def __getNewProjectId(self): | |
4603 |
|
4563 | |||
4604 | loadProject = False |
|
4564 | loadProject = False | |
4605 |
|
4565 | |||
4606 | for thisId in range(1,10): |
|
4566 | for thisId in range(1,10): | |
4607 | newId = str(thisId) |
|
4567 | newId = str(thisId) | |
4608 | if newId in self.__projectObjDict.keys(): |
|
4568 | if newId in self.__projectObjDict.keys(): | |
4609 | continue |
|
4569 | continue | |
4610 |
|
4570 | |||
4611 | loadProject = True |
|
4571 | loadProject = True | |
4612 | projectId = newId |
|
4572 | projectId = newId | |
4613 | break |
|
4573 | break | |
4614 |
|
4574 | |||
4615 | if not loadProject: |
|
4575 | if not loadProject: | |
4616 | self.console.clear() |
|
4576 | self.console.clear() | |
4617 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4577 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4618 | return None |
|
4578 | return None | |
4619 |
|
4579 | |||
4620 | return projectId |
|
4580 | return projectId | |
4621 |
|
4581 | |||
4622 | def openProject(self): |
|
4582 | def openProject(self): | |
4623 |
|
4583 | |||
4624 | self._disable_save_button() |
|
4584 | self._disable_save_button() | |
4625 | self._disable_play_button() |
|
4585 | self._disable_play_button() | |
4626 |
|
4586 | |||
4627 | self.frame_2.setEnabled(True) |
|
4587 | self.frame_2.setEnabled(True) | |
4628 |
|
4588 | |||
4629 | # print self.dir |
|
4589 | # print self.dir | |
4630 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4590 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4631 |
|
4591 | |||
4632 | projectObjLoad = Project() |
|
4592 | projectObjLoad = Project() | |
4633 |
|
4593 | |||
4634 | try: |
|
4594 | try: | |
4635 | projectObjLoad.readXml(filename) |
|
4595 | projectObjLoad.readXml(filename) | |
4636 | except: |
|
4596 | except: | |
4637 | self.console.clear() |
|
4597 | self.console.clear() | |
4638 | self.console.append("The selected xml file could not be loaded ...") |
|
4598 | self.console.append("The selected xml file could not be loaded ...") | |
4639 | return 0 |
|
4599 | return 0 | |
4640 |
|
4600 | |||
4641 | self.create = False |
|
4601 | self.create = False | |
4642 | self.refreshProjectWindow(projectObjLoad) |
|
4602 | self.refreshProjectWindow(projectObjLoad) | |
4643 | self.refreshProjectProperties(projectObjLoad) |
|
4603 | self.refreshProjectProperties(projectObjLoad) | |
4644 |
|
4604 | |||
4645 | projectId = projectObjLoad.id |
|
4605 | projectId = projectObjLoad.id | |
4646 |
|
4606 | |||
4647 | if projectId in self.__projectObjDict.keys(): |
|
4607 | if projectId in self.__projectObjDict.keys(): | |
4648 |
|
4608 | |||
4649 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4609 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4650 | # "Do you want to load the file anyway?") |
|
4610 | # "Do you want to load the file anyway?") | |
4651 | # if not answer: |
|
4611 | # if not answer: | |
4652 | # return |
|
4612 | # return | |
4653 |
|
4613 | |||
4654 | projectId = self.__getNewProjectId() |
|
4614 | projectId = self.__getNewProjectId() | |
4655 |
|
4615 | |||
4656 | if not projectId: |
|
4616 | if not projectId: | |
4657 | return |
|
4617 | return | |
4658 |
|
4618 | |||
4659 | projectObjLoad.updateId(projectId) |
|
4619 | projectObjLoad.updateId(projectId) | |
4660 |
|
4620 | |||
4661 | self.__projectObjDict[projectId] = projectObjLoad |
|
4621 | self.__projectObjDict[projectId] = projectObjLoad | |
4662 |
|
4622 | |||
4663 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4623 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4664 |
|
4624 | |||
4665 | self.tabWidgetProject.setEnabled(True) |
|
4625 | self.tabWidgetProject.setEnabled(True) | |
4666 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4626 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4667 | # Disable tabProject after finish the creation |
|
4627 | # Disable tabProject after finish the creation | |
4668 | self.tabProject.setEnabled(True) |
|
4628 | self.tabProject.setEnabled(True) | |
4669 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4629 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4670 |
|
4630 | |||
4671 | for puId, puObj in puObjorderList.items(): |
|
4631 | for puId, puObj in puObjorderList.items(): | |
4672 |
|
4632 | |||
4673 | self.__puObjDict[puId] = puObj |
|
4633 | self.__puObjDict[puId] = puObj | |
4674 |
|
4634 | |||
4675 | if puObj.name == "SendToServer": |
|
4635 | if puObj.name == "SendToServer": | |
4676 | self.saveFTPFromProcUnitObj(puObj) |
|
4636 | self.saveFTPFromProcUnitObj(puObj) | |
4677 |
|
4637 | |||
4678 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4638 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4679 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4639 | operationObj = puObj.getOperationObj("SendByFTP") | |
4680 |
|
4640 | |||
4681 | if operationObj: |
|
4641 | if operationObj: | |
4682 | self.saveFTPFromOpObj(operationObj) |
|
4642 | self.saveFTPFromOpObj(operationObj) | |
4683 | ############################################################ |
|
4643 | ############################################################ | |
4684 |
|
4644 | |||
4685 | if puObj.inputId == '0': |
|
4645 | if puObj.inputId == '0': | |
4686 | continue |
|
4646 | continue | |
4687 |
|
4647 | |||
4688 | self.addPU2PELoadXML(puObj) |
|
4648 | self.addPU2PELoadXML(puObj) | |
4689 |
|
4649 | |||
4690 | self.refreshPUWindow(puObj) |
|
4650 | self.refreshPUWindow(puObj) | |
4691 | self.refreshPUProperties(puObj) |
|
4651 | self.refreshPUProperties(puObj) | |
4692 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4652 | self.showtabPUCreated(datatype=puObj.datatype) | |
4693 |
|
4653 | |||
4694 | self.console.clear() |
|
4654 | self.console.clear() | |
4695 | self.console.append("The selected xml file has been loaded successfully") |
|
4655 | self.console.append("The selected xml file has been loaded successfully") | |
4696 |
|
4656 | |||
4697 | self._disable_save_button() |
|
4657 | self._disable_save_button() | |
4698 | self._enable_play_button() |
|
4658 | self._enable_play_button() | |
4699 |
|
4659 | |||
4700 | def create_updating_timer(self): |
|
4660 | def create_updating_timer(self): | |
4701 | self.comm_data_timer = QtCore.QTimer(self) |
|
4661 | self.comm_data_timer = QtCore.QTimer(self) | |
4702 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4662 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4703 | self.comm_data_timer.start(1000) |
|
4663 | self.comm_data_timer.start(1000) | |
4704 |
|
4664 | |||
4705 | def on_comm_updating_timer(self): |
|
4665 | def on_comm_updating_timer(self): | |
4706 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4666 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4707 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4667 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4708 | if not self.threadStarted: |
|
4668 | if not self.threadStarted: | |
4709 | return |
|
4669 | return | |
4710 |
|
4670 | |||
4711 | if self.controllerThread.isFinished(): |
|
4671 | if self.controllerThread.isFinished(): | |
4712 | self.stopProject() |
|
4672 | self.stopProject() | |
4713 |
|
4673 | |||
4714 | def playProject(self, ext=".xml", save=1): |
|
4674 | def playProject(self, ext=".xml", save=1): | |
4715 |
|
4675 | |||
4716 | self._disable_play_button() |
|
4676 | self._disable_play_button() | |
4717 | self._disable_save_button() |
|
4677 | self._disable_save_button() | |
4718 |
|
4678 | |||
4719 | if self.controllerThread: |
|
4679 | if self.controllerThread: | |
4720 | if self.controllerThread.isRunning(): |
|
4680 | if self.controllerThread.isRunning(): | |
4721 | self.console.append("There is already another process running") |
|
4681 | self.console.append("There is already another process running") | |
4722 | self._enable_stop_button() |
|
4682 | self._enable_stop_button() | |
4723 | return |
|
4683 | return | |
4724 |
|
4684 | |||
4725 | projectObj = self.getSelectedProjectObj() |
|
4685 | projectObj = self.getSelectedProjectObj() | |
4726 |
|
4686 | |||
4727 | if not projectObj: |
|
4687 | if not projectObj: | |
4728 | self.console.append("Please, select a project to start it") |
|
4688 | self.console.append("Please, select a project to start it") | |
4729 | return |
|
4689 | return | |
4730 |
|
4690 | |||
4731 | if save: |
|
4691 | if save: | |
4732 | filename = self.saveProject() |
|
4692 | filename = self.saveProject() | |
4733 | if filename == None: |
|
4693 | if filename == None: | |
4734 | self.console.append("Process not initialized.") |
|
4694 | self.console.append("Process not initialized.") | |
4735 | return |
|
4695 | return | |
4736 | else: |
|
4696 | else: | |
4737 | filename = TEMPORAL_FILE |
|
4697 | filename = TEMPORAL_FILE | |
4738 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4698 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4739 |
|
4699 | |||
4740 | self.console.append("Please Wait...") |
|
4700 | self.console.append("Please Wait...") | |
4741 |
|
4701 | |||
4742 | self.controllerThread = ControllerThread(filename) |
|
4702 | self.controllerThread = ControllerThread(filename) | |
4743 |
|
4703 | |||
4744 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) |
|
4704 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) | |
4745 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) |
|
4705 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) | |
4746 | self.console.clear() |
|
4706 | self.console.clear() | |
4747 | self.controllerThread.start() |
|
4707 | self.controllerThread.start() | |
4748 | sleep(0.5) |
|
4708 | sleep(0.5) | |
4749 | self.threadStarted = True |
|
4709 | self.threadStarted = True | |
4750 |
|
4710 | |||
4751 | self._disable_play_button() |
|
4711 | self._disable_play_button() | |
4752 | self._disable_save_button() |
|
4712 | self._disable_save_button() | |
4753 | self._enable_stop_button() |
|
4713 | self._enable_stop_button() | |
4754 |
|
4714 | |||
4755 | def stopProject(self): |
|
4715 | def stopProject(self): | |
4756 |
|
4716 | |||
4757 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) |
|
4717 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
4758 | self.controllerThread.stop() |
|
4718 | self.controllerThread.stop() | |
4759 | self.threadStarted = False |
|
4719 | self.threadStarted = False | |
4760 |
|
4720 | |||
4761 | while self.controllerThread.isRunning(): |
|
4721 | while self.controllerThread.isRunning(): | |
4762 | sleep(0.5) |
|
4722 | sleep(0.5) | |
4763 |
|
4723 | |||
4764 | self._disable_stop_button() |
|
4724 | self._disable_stop_button() | |
4765 | self._enable_play_button() |
|
4725 | self._enable_play_button() | |
4766 |
|
4726 | |||
4767 | def pauseProject(self): |
|
4727 | def pauseProject(self): | |
4768 |
|
4728 | |||
4769 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4729 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4770 | paused = self.controllerThread.pause() |
|
4730 | paused = self.controllerThread.pause() | |
4771 |
|
4731 | |||
4772 | self.changePauseIcon(paused) |
|
4732 | self.changePauseIcon(paused) | |
4773 |
|
4733 | |||
4774 | def saveProject(self, filename=None): |
|
4734 | def saveProject(self, filename=None): | |
4775 |
|
4735 | |||
4776 | self._disable_save_button() |
|
4736 | self._disable_save_button() | |
4777 | self._disable_play_button() |
|
4737 | self._disable_play_button() | |
4778 |
|
4738 | |||
4779 | projectObj = self.getSelectedProjectObj() |
|
4739 | projectObj = self.getSelectedProjectObj() | |
4780 |
|
4740 | |||
4781 | if not projectObj: |
|
4741 | if not projectObj: | |
4782 |
|
4742 | |||
4783 | if self.create: |
|
4743 | if self.create: | |
4784 | self.console.append("Please press Ok before save it") |
|
4744 | self.console.append("Please press Ok before save it") | |
4785 | else: |
|
4745 | else: | |
4786 | self.console.append("Please select a project before save it") |
|
4746 | self.console.append("Please select a project before save it") | |
4787 | return |
|
4747 | return | |
4788 |
|
4748 | |||
4789 | self.refreshGraphicsId() |
|
4749 | self.refreshGraphicsId() | |
4790 |
|
4750 | |||
4791 | sts = True |
|
4751 | sts = True | |
4792 | selectedItemObj = self.getSelectedItemObj() |
|
4752 | selectedItemObj = self.getSelectedItemObj() | |
4793 |
|
4753 | |||
4794 | #A Processing Unit has been selected |
|
4754 | #A Processing Unit has been selected | |
4795 | if projectObj == selectedItemObj: |
|
4755 | if projectObj == selectedItemObj: | |
4796 | if not self.on_proOk_clicked(): |
|
4756 | if not self.on_proOk_clicked(): | |
4797 | return None |
|
4757 | return None | |
4798 |
|
4758 | |||
4799 | #A Processing Unit has been selected |
|
4759 | #A Processing Unit has been selected | |
4800 | if projectObj != selectedItemObj: |
|
4760 | if projectObj != selectedItemObj: | |
4801 | puObj = selectedItemObj |
|
4761 | puObj = selectedItemObj | |
4802 |
|
4762 | |||
4803 | if puObj.name == 'VoltageProc': |
|
4763 | if puObj.name == 'VoltageProc': | |
4804 | sts = self.on_volOpOk_clicked() |
|
4764 | sts = self.on_volOpOk_clicked() | |
4805 | if puObj.name == 'SpectraProc': |
|
4765 | if puObj.name == 'SpectraProc': | |
4806 | sts = self.on_specOpOk_clicked() |
|
4766 | sts = self.on_specOpOk_clicked() | |
4807 | if puObj.name == 'SpectraHeisProc': |
|
4767 | if puObj.name == 'SpectraHeisProc': | |
4808 | sts = self.on_specHeisOpOk_clicked() |
|
4768 | sts = self.on_specHeisOpOk_clicked() | |
4809 |
|
4769 | |||
4810 | if not sts: |
|
4770 | if not sts: | |
4811 | return None |
|
4771 | return None | |
4812 |
|
4772 | |||
4813 | self.createFTPProcUnitView() |
|
4773 | self.createFTPProcUnitView() | |
4814 |
|
4774 | |||
4815 | if not filename: |
|
4775 | if not filename: | |
4816 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4776 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4817 |
|
4777 | |||
4818 | projectObj.writeXml(filename) |
|
4778 | projectObj.writeXml(filename) | |
4819 | self.console.clear() |
|
4779 | self.console.clear() | |
4820 | self.console.append("Project saved") |
|
4780 | self.console.append("Project saved") | |
4821 | self.console.append("Press Play button to start data processing ...") |
|
4781 | self.console.append("Press Play button to start data processing ...") | |
4822 |
|
4782 | |||
4823 | self._disable_save_button() |
|
4783 | self._disable_save_button() | |
4824 | self._enable_play_button() |
|
4784 | self._enable_play_button() | |
4825 |
|
4785 | |||
4826 | return filename |
|
4786 | return filename | |
4827 |
|
4787 | |||
4828 | def removeItemTreeFromProject(self): |
|
4788 | def removeItemTreeFromProject(self): | |
4829 | """ |
|
4789 | """ | |
4830 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4790 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4831 | """ |
|
4791 | """ | |
4832 | for key in self.__itemTreeDict.keys(): |
|
4792 | for key in self.__itemTreeDict.keys(): | |
4833 |
|
4793 | |||
4834 | #Check again because an item can delete multiple items (childs) |
|
4794 | #Check again because an item can delete multiple items (childs) | |
4835 | if key not in self.__itemTreeDict.keys(): |
|
4795 | if key not in self.__itemTreeDict.keys(): | |
4836 | continue |
|
4796 | continue | |
4837 |
|
4797 | |||
4838 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4798 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4839 | continue |
|
4799 | continue | |
4840 |
|
4800 | |||
4841 | if self.__projectObjDict.has_key(key) == True: |
|
4801 | if self.__projectObjDict.has_key(key) == True: | |
4842 |
|
4802 | |||
4843 | del self.__projectObjDict[key] |
|
4803 | del self.__projectObjDict[key] | |
4844 | del self.__itemTreeDict[key] |
|
4804 | del self.__itemTreeDict[key] | |
4845 |
|
4805 | |||
4846 | else: |
|
4806 | else: | |
4847 | puObj = self.__puObjDict[key] |
|
4807 | puObj = self.__puObjDict[key] | |
4848 | idProjectParent = puObj.parentId |
|
4808 | idProjectParent = puObj.parentId | |
4849 | projectObj = self.__projectObjDict[idProjectParent] |
|
4809 | projectObj = self.__projectObjDict[idProjectParent] | |
4850 |
|
4810 | |||
4851 | del self.__puObjDict[key] |
|
4811 | del self.__puObjDict[key] | |
4852 | del self.__itemTreeDict[key] |
|
4812 | del self.__itemTreeDict[key] | |
4853 | del projectObj.procUnitConfObjDict[key] |
|
4813 | del projectObj.procUnitConfObjDict[key] | |
4854 |
|
4814 | |||
4855 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4815 | for key in projectObj.procUnitConfObjDict.keys(): | |
4856 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4816 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4857 | continue |
|
4817 | continue | |
4858 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4818 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4859 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4819 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4860 | del projectObj.procUnitConfObjDict[key] |
|
4820 | del projectObj.procUnitConfObjDict[key] | |
4861 | # print projectObj.procUnitConfObjDict |
|
4821 | # print projectObj.procUnitConfObjDict | |
4862 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4822 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4863 |
|
4823 | |||
4864 | def setInputsProject_View(self): |
|
4824 | def setInputsProject_View(self): | |
4865 |
|
4825 | |||
4866 | self.tabWidgetProject.setEnabled(True) |
|
4826 | self.tabWidgetProject.setEnabled(True) | |
4867 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4827 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4868 | self.tabProject.setEnabled(True) |
|
4828 | self.tabProject.setEnabled(True) | |
4869 | self.frame_2.setEnabled(False) |
|
4829 | self.frame_2.setEnabled(False) | |
4870 | self.proName.clear() |
|
4830 | self.proName.clear() | |
4871 | self.proName.setFocus() |
|
4831 | self.proName.setFocus() | |
4872 | self.proName.setSelection(0, 0) |
|
4832 | self.proName.setSelection(0, 0) | |
4873 | self.proName.setCursorPosition(0) |
|
4833 | self.proName.setCursorPosition(0) | |
4874 | self.proDataType.setText('.r') |
|
4834 | self.proDataType.setText('.r') | |
4875 | self.proDataPath.clear() |
|
4835 | self.proDataPath.clear() | |
4876 | self.proComDataType.clear() |
|
4836 | self.proComDataType.clear() | |
4877 | self.proComDataType.addItem("Voltage") |
|
4837 | self.proComDataType.addItem("Voltage") | |
4878 | self.proComDataType.addItem("Spectra") |
|
4838 | self.proComDataType.addItem("Spectra") | |
4879 | self.proComDataType.addItem("Fits") |
|
4839 | self.proComDataType.addItem("Fits") | |
4880 | self.proComDataType.addItem("USRP") |
|
4840 | self.proComDataType.addItem("USRP") | |
4881 |
|
4841 | |||
4882 | self.proComStartDate.clear() |
|
4842 | self.proComStartDate.clear() | |
4883 | self.proComEndDate.clear() |
|
4843 | self.proComEndDate.clear() | |
4884 |
|
4844 | |||
4885 | startTime = "00:00:00" |
|
4845 | startTime = "00:00:00" | |
4886 | endTime = "23:59:59" |
|
4846 | endTime = "23:59:59" | |
4887 | starlist = startTime.split(":") |
|
4847 | starlist = startTime.split(":") | |
4888 | endlist = endTime.split(":") |
|
4848 | endlist = endTime.split(":") | |
4889 | self.proDelay.setText("60") |
|
4849 | self.proDelay.setText("60") | |
4890 | self.proSet.setText("") |
|
4850 | self.proSet.setText("") | |
4891 |
|
4851 | |||
4892 | self.labelSet.show() |
|
4852 | self.labelSet.show() | |
4893 | self.proSet.show() |
|
4853 | self.proSet.show() | |
4894 |
|
4854 | |||
4895 | self.labelIPPKm.hide() |
|
4855 | self.labelIPPKm.hide() | |
4896 | self.proIPPKm.hide() |
|
4856 | self.proIPPKm.hide() | |
4897 |
|
4857 | |||
4898 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4858 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4899 | self.proStartTime.setTime(self.time) |
|
4859 | self.proStartTime.setTime(self.time) | |
4900 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4860 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4901 | self.proEndTime.setTime(self.time) |
|
4861 | self.proEndTime.setTime(self.time) | |
4902 | self.proDescription.clear() |
|
4862 | self.proDescription.clear() | |
4903 | self.proOk.setEnabled(False) |
|
4863 | self.proOk.setEnabled(False) | |
4904 | # self.console.append("Please, Write a name Project") |
|
4864 | # self.console.append("Please, Write a name Project") | |
4905 | # self.console.append("Introduce Project Parameters")DC |
|
4865 | # self.console.append("Introduce Project Parameters")DC | |
4906 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4866 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4907 |
|
4867 | |||
4908 | def clearPUWindow(self, datatype): |
|
4868 | def clearPUWindow(self, datatype): | |
4909 |
|
4869 | |||
4910 | projectObjView = self.getSelectedProjectObj() |
|
4870 | projectObjView = self.getSelectedProjectObj() | |
4911 |
|
4871 | |||
4912 | if not projectObjView: |
|
4872 | if not projectObjView: | |
4913 | return |
|
4873 | return | |
4914 |
|
4874 | |||
4915 | puObj = self.getSelectedItemObj() |
|
4875 | puObj = self.getSelectedItemObj() | |
4916 | inputId = puObj.getInputId() |
|
4876 | inputId = puObj.getInputId() | |
4917 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4877 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4918 |
|
4878 | |||
4919 | if datatype == 'Voltage': |
|
4879 | if datatype == 'Voltage': | |
4920 | self.volOpComChannels.setEnabled(False) |
|
4880 | self.volOpComChannels.setEnabled(False) | |
4921 | self.volOpComHeights.setEnabled(False) |
|
4881 | self.volOpComHeights.setEnabled(False) | |
4922 | self.volOpFilter.setEnabled(False) |
|
4882 | self.volOpFilter.setEnabled(False) | |
4923 | self.volOpComProfile.setEnabled(False) |
|
4883 | self.volOpComProfile.setEnabled(False) | |
4924 | self.volOpComCode.setEnabled(False) |
|
4884 | self.volOpComCode.setEnabled(False) | |
4925 | self.volOpCohInt.setEnabled(False) |
|
4885 | self.volOpCohInt.setEnabled(False) | |
4926 | self.volOpChannel.setEnabled(False) |
|
4886 | self.volOpChannel.setEnabled(False) | |
4927 | self.volOpHeights.setEnabled(False) |
|
4887 | self.volOpHeights.setEnabled(False) | |
4928 | self.volOpProfile.setEnabled(False) |
|
4888 | self.volOpProfile.setEnabled(False) | |
4929 | self.volOpRadarfrequency.setEnabled(False) |
|
4889 | self.volOpRadarfrequency.setEnabled(False) | |
4930 | self.volOpCebChannels.setCheckState(0) |
|
4890 | self.volOpCebChannels.setCheckState(0) | |
4931 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4891 | self.volOpCebRadarfrequency.setCheckState(0) | |
4932 | self.volOpCebHeights.setCheckState(0) |
|
4892 | self.volOpCebHeights.setCheckState(0) | |
4933 | self.volOpCebFilter.setCheckState(0) |
|
4893 | self.volOpCebFilter.setCheckState(0) | |
4934 | self.volOpCebProfile.setCheckState(0) |
|
4894 | self.volOpCebProfile.setCheckState(0) | |
4935 | self.volOpCebDecodification.setCheckState(0) |
|
4895 | self.volOpCebDecodification.setCheckState(0) | |
4936 | self.volOpCebCohInt.setCheckState(0) |
|
4896 | self.volOpCebCohInt.setCheckState(0) | |
4937 |
|
4897 | |||
4938 | self.volOpChannel.clear() |
|
4898 | self.volOpChannel.clear() | |
4939 | self.volOpHeights.clear() |
|
4899 | self.volOpHeights.clear() | |
4940 | self.volOpProfile.clear() |
|
4900 | self.volOpProfile.clear() | |
4941 | self.volOpFilter.clear() |
|
4901 | self.volOpFilter.clear() | |
4942 | self.volOpCohInt.clear() |
|
4902 | self.volOpCohInt.clear() | |
4943 | self.volOpRadarfrequency.clear() |
|
4903 | self.volOpRadarfrequency.clear() | |
4944 |
|
4904 | |||
4945 | if datatype == 'Spectra': |
|
4905 | if datatype == 'Spectra': | |
4946 |
|
4906 | |||
4947 | if inputPUObj.datatype == 'Spectra': |
|
4907 | if inputPUObj.datatype == 'Spectra': | |
4948 | self.specOpnFFTpoints.setEnabled(False) |
|
4908 | self.specOpnFFTpoints.setEnabled(False) | |
4949 | self.specOpProfiles.setEnabled(False) |
|
4909 | self.specOpProfiles.setEnabled(False) | |
4950 | self.specOpippFactor.setEnabled(False) |
|
4910 | self.specOpippFactor.setEnabled(False) | |
4951 | else: |
|
4911 | else: | |
4952 | self.specOpnFFTpoints.setEnabled(True) |
|
4912 | self.specOpnFFTpoints.setEnabled(True) | |
4953 | self.specOpProfiles.setEnabled(True) |
|
4913 | self.specOpProfiles.setEnabled(True) | |
4954 | self.specOpippFactor.setEnabled(True) |
|
4914 | self.specOpippFactor.setEnabled(True) | |
4955 |
|
4915 | |||
4956 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4916 | self.specOpCebCrossSpectra.setCheckState(0) | |
4957 | self.specOpCebChannel.setCheckState(0) |
|
4917 | self.specOpCebChannel.setCheckState(0) | |
4958 | self.specOpCebHeights.setCheckState(0) |
|
4918 | self.specOpCebHeights.setCheckState(0) | |
4959 | self.specOpCebIncoherent.setCheckState(0) |
|
4919 | self.specOpCebIncoherent.setCheckState(0) | |
4960 | self.specOpCebRemoveDC.setCheckState(0) |
|
4920 | self.specOpCebRemoveDC.setCheckState(0) | |
4961 | self.specOpCebRemoveInt.setCheckState(0) |
|
4921 | self.specOpCebRemoveInt.setCheckState(0) | |
4962 | self.specOpCebgetNoise.setCheckState(0) |
|
4922 | self.specOpCebgetNoise.setCheckState(0) | |
4963 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4923 | self.specOpCebRadarfrequency.setCheckState(0) | |
4964 |
|
4924 | |||
4965 | self.specOpRadarfrequency.setEnabled(False) |
|
4925 | self.specOpRadarfrequency.setEnabled(False) | |
4966 | self.specOppairsList.setEnabled(False) |
|
4926 | self.specOppairsList.setEnabled(False) | |
4967 | self.specOpChannel.setEnabled(False) |
|
4927 | self.specOpChannel.setEnabled(False) | |
4968 | self.specOpHeights.setEnabled(False) |
|
4928 | self.specOpHeights.setEnabled(False) | |
4969 | self.specOpIncoherent.setEnabled(False) |
|
4929 | self.specOpIncoherent.setEnabled(False) | |
4970 | self.specOpgetNoise.setEnabled(False) |
|
4930 | self.specOpgetNoise.setEnabled(False) | |
4971 |
|
4931 | |||
4972 | self.specOpRadarfrequency.clear() |
|
4932 | self.specOpRadarfrequency.clear() | |
4973 | self.specOpnFFTpoints.clear() |
|
4933 | self.specOpnFFTpoints.clear() | |
4974 | self.specOpProfiles.clear() |
|
4934 | self.specOpProfiles.clear() | |
4975 | self.specOpippFactor.clear |
|
4935 | self.specOpippFactor.clear | |
4976 | self.specOppairsList.clear() |
|
4936 | self.specOppairsList.clear() | |
4977 | self.specOpChannel.clear() |
|
4937 | self.specOpChannel.clear() | |
4978 | self.specOpHeights.clear() |
|
4938 | self.specOpHeights.clear() | |
4979 | self.specOpIncoherent.clear() |
|
4939 | self.specOpIncoherent.clear() | |
4980 | self.specOpgetNoise.clear() |
|
4940 | self.specOpgetNoise.clear() | |
4981 |
|
4941 | |||
4982 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4942 | self.specGraphCebSpectraplot.setCheckState(0) | |
4983 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4943 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4984 | self.specGraphCebRTIplot.setCheckState(0) |
|
4944 | self.specGraphCebRTIplot.setCheckState(0) | |
4985 | self.specGraphCebRTInoise.setCheckState(0) |
|
4945 | self.specGraphCebRTInoise.setCheckState(0) | |
4986 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4946 | self.specGraphCebCoherencmap.setCheckState(0) | |
4987 | self.specGraphPowerprofile.setCheckState(0) |
|
4947 | self.specGraphPowerprofile.setCheckState(0) | |
4988 |
|
4948 | |||
4989 | self.specGraphSaveSpectra.setCheckState(0) |
|
4949 | self.specGraphSaveSpectra.setCheckState(0) | |
4990 | self.specGraphSaveCross.setCheckState(0) |
|
4950 | self.specGraphSaveCross.setCheckState(0) | |
4991 | self.specGraphSaveRTIplot.setCheckState(0) |
|
4951 | self.specGraphSaveRTIplot.setCheckState(0) | |
4992 | self.specGraphSaveRTInoise.setCheckState(0) |
|
4952 | self.specGraphSaveRTInoise.setCheckState(0) | |
4993 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
4953 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4994 | self.specGraphSavePowerprofile.setCheckState(0) |
|
4954 | self.specGraphSavePowerprofile.setCheckState(0) | |
4995 |
|
4955 | |||
4996 | self.specGraphftpRTIplot.setCheckState(0) |
|
4956 | self.specGraphftpRTIplot.setCheckState(0) | |
4997 | self.specGraphftpRTInoise.setCheckState(0) |
|
4957 | self.specGraphftpRTInoise.setCheckState(0) | |
4998 | self.specGraphftpCoherencemap.setCheckState(0) |
|
4958 | self.specGraphftpCoherencemap.setCheckState(0) | |
4999 |
|
4959 | |||
5000 | self.specGraphPath.clear() |
|
4960 | self.specGraphPath.clear() | |
5001 | self.specGraphPrefix.clear() |
|
4961 | self.specGraphPrefix.clear() | |
5002 |
|
4962 | |||
5003 | self.specGgraphftpratio.clear() |
|
4963 | self.specGgraphftpratio.clear() | |
5004 |
|
4964 | |||
5005 | self.specGgraphChannelList.clear() |
|
4965 | self.specGgraphChannelList.clear() | |
5006 | self.specGgraphFreq.clear() |
|
4966 | self.specGgraphFreq.clear() | |
5007 | self.specGgraphHeight.clear() |
|
4967 | self.specGgraphHeight.clear() | |
5008 | self.specGgraphDbsrange.clear() |
|
4968 | self.specGgraphDbsrange.clear() | |
5009 | self.specGgraphmagnitud.clear() |
|
4969 | self.specGgraphmagnitud.clear() | |
5010 | self.specGgraphTminTmax.clear() |
|
4970 | self.specGgraphTminTmax.clear() | |
5011 | self.specGgraphTimeRange.clear() |
|
4971 | self.specGgraphTimeRange.clear() | |
5012 |
|
4972 | |||
5013 | if datatype == 'SpectraHeis': |
|
4973 | if datatype == 'SpectraHeis': | |
5014 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
4974 | self.specHeisOpCebIncoherent.setCheckState(0) | |
5015 | self.specHeisOpIncoherent.setEnabled(False) |
|
4975 | self.specHeisOpIncoherent.setEnabled(False) | |
5016 | self.specHeisOpIncoherent.clear() |
|
4976 | self.specHeisOpIncoherent.clear() | |
5017 |
|
4977 | |||
5018 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
4978 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5019 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
4979 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5020 |
|
4980 | |||
5021 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
4981 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5022 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
4982 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5023 |
|
4983 | |||
5024 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
4984 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5025 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
4985 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5026 |
|
4986 | |||
5027 | self.specHeisGraphPath.clear() |
|
4987 | self.specHeisGraphPath.clear() | |
5028 | self.specHeisGraphPrefix.clear() |
|
4988 | self.specHeisGraphPrefix.clear() | |
5029 | self.specHeisGgraphChannelList.clear() |
|
4989 | self.specHeisGgraphChannelList.clear() | |
5030 | self.specHeisGgraphXminXmax.clear() |
|
4990 | self.specHeisGgraphXminXmax.clear() | |
5031 | self.specHeisGgraphYminYmax.clear() |
|
4991 | self.specHeisGgraphYminYmax.clear() | |
5032 | self.specHeisGgraphTminTmax.clear() |
|
4992 | self.specHeisGgraphTminTmax.clear() | |
5033 | self.specHeisGgraphTimeRange.clear() |
|
4993 | self.specHeisGgraphTimeRange.clear() | |
5034 | self.specHeisGgraphftpratio.clear() |
|
4994 | self.specHeisGgraphftpratio.clear() | |
5035 |
|
4995 | |||
5036 | def showtabPUCreated(self, datatype): |
|
4996 | def showtabPUCreated(self, datatype): | |
5037 |
|
4997 | |||
5038 | if datatype == "Voltage": |
|
4998 | if datatype == "Voltage": | |
5039 | self.tabVoltage.setEnabled(True) |
|
4999 | self.tabVoltage.setEnabled(True) | |
5040 | self.tabProject.setEnabled(False) |
|
5000 | self.tabProject.setEnabled(False) | |
5041 | self.tabSpectra.setEnabled(False) |
|
5001 | self.tabSpectra.setEnabled(False) | |
5042 | self.tabCorrelation.setEnabled(False) |
|
5002 | self.tabCorrelation.setEnabled(False) | |
5043 | self.tabSpectraHeis.setEnabled(False) |
|
5003 | self.tabSpectraHeis.setEnabled(False) | |
5044 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5004 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5045 |
|
5005 | |||
5046 | if datatype == "Spectra": |
|
5006 | if datatype == "Spectra": | |
5047 | self.tabVoltage.setEnabled(False) |
|
5007 | self.tabVoltage.setEnabled(False) | |
5048 | self.tabProject.setEnabled(False) |
|
5008 | self.tabProject.setEnabled(False) | |
5049 | self.tabSpectra.setEnabled(True) |
|
5009 | self.tabSpectra.setEnabled(True) | |
5050 | self.tabCorrelation.setEnabled(False) |
|
5010 | self.tabCorrelation.setEnabled(False) | |
5051 | self.tabSpectraHeis.setEnabled(False) |
|
5011 | self.tabSpectraHeis.setEnabled(False) | |
5052 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5012 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5053 |
|
5013 | |||
5054 | if datatype == "SpectraHeis": |
|
5014 | if datatype == "SpectraHeis": | |
5055 | self.tabVoltage.setEnabled(False) |
|
5015 | self.tabVoltage.setEnabled(False) | |
5056 | self.tabProject.setEnabled(False) |
|
5016 | self.tabProject.setEnabled(False) | |
5057 | self.tabSpectra.setEnabled(False) |
|
5017 | self.tabSpectra.setEnabled(False) | |
5058 | self.tabCorrelation.setEnabled(False) |
|
5018 | self.tabCorrelation.setEnabled(False) | |
5059 | self.tabSpectraHeis.setEnabled(True) |
|
5019 | self.tabSpectraHeis.setEnabled(True) | |
5060 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5020 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5061 |
|
5021 | |||
5062 | def checkInputsProject(self): |
|
5022 | def checkInputsProject(self): | |
5063 | """ |
|
5023 | """ | |
5064 | Check Inputs Project: |
|
5024 | Check Inputs Project: | |
5065 | - project_name |
|
5025 | - project_name | |
5066 | - datatype |
|
5026 | - datatype | |
5067 | - ext |
|
5027 | - ext | |
5068 | - data_path |
|
5028 | - data_path | |
5069 | - readmode |
|
5029 | - readmode | |
5070 | - delay |
|
5030 | - delay | |
5071 | - set |
|
5031 | - set | |
5072 | - walk |
|
5032 | - walk | |
5073 | """ |
|
5033 | """ | |
5074 | parms_ok = True |
|
5034 | parms_ok = True | |
5075 | project_name = str(self.proName.text()) |
|
5035 | project_name = str(self.proName.text()) | |
5076 | if project_name == '' or project_name == None: |
|
5036 | if project_name == '' or project_name == None: | |
5077 | outputstr = "Enter the Project Name" |
|
5037 | outputstr = "Enter the Project Name" | |
5078 | self.console.append(outputstr) |
|
5038 | self.console.append(outputstr) | |
5079 | parms_ok = False |
|
5039 | parms_ok = False | |
5080 | project_name = None |
|
5040 | project_name = None | |
5081 |
|
5041 | |||
5082 | datatype = str(self.proComDataType.currentText()) |
|
5042 | datatype = str(self.proComDataType.currentText()) | |
5083 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5043 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5084 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5044 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5085 | self.console.append(outputstr) |
|
5045 | self.console.append(outputstr) | |
5086 | parms_ok = False |
|
5046 | parms_ok = False | |
5087 | datatype = None |
|
5047 | datatype = None | |
5088 |
|
5048 | |||
5089 | ext = str(self.proDataType.text()) |
|
5049 | ext = str(self.proDataType.text()) | |
5090 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5050 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5091 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5051 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5092 | self.console.append(outputstr) |
|
5052 | self.console.append(outputstr) | |
5093 | parms_ok = False |
|
5053 | parms_ok = False | |
5094 | ext = None |
|
5054 | ext = None | |
5095 |
|
5055 | |||
5096 | data_path = str(self.proDataPath.text()) |
|
5056 | data_path = str(self.proDataPath.text()) | |
5097 |
|
5057 | |||
5098 | if data_path == '': |
|
5058 | if data_path == '': | |
5099 | outputstr = 'Datapath is empty' |
|
5059 | outputstr = 'Datapath is empty' | |
5100 | self.console.append(outputstr) |
|
5060 | self.console.append(outputstr) | |
5101 | parms_ok = False |
|
5061 | parms_ok = False | |
5102 | data_path = None |
|
5062 | data_path = None | |
5103 |
|
5063 | |||
5104 | if data_path != None: |
|
5064 | if data_path != None: | |
5105 | if not os.path.isdir(data_path): |
|
5065 | if not os.path.isdir(data_path): | |
5106 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5066 | outputstr = 'Datapath:%s does not exists' % data_path | |
5107 | self.console.append(outputstr) |
|
5067 | self.console.append(outputstr) | |
5108 | parms_ok = False |
|
5068 | parms_ok = False | |
5109 | data_path = None |
|
5069 | data_path = None | |
5110 |
|
5070 | |||
5111 | read_mode = str(self.proComReadMode.currentText()) |
|
5071 | read_mode = str(self.proComReadMode.currentText()) | |
5112 | if not(read_mode in ['Online', 'Offline']): |
|
5072 | if not(read_mode in ['Online', 'Offline']): | |
5113 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5073 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5114 | self.console.append(outputstr) |
|
5074 | self.console.append(outputstr) | |
5115 | parms_ok = False |
|
5075 | parms_ok = False | |
5116 | read_mode = None |
|
5076 | read_mode = None | |
5117 |
|
5077 | |||
5118 | delay = None |
|
5078 | delay = None | |
5119 | if read_mode == "Online": |
|
5079 | if read_mode == "Online": | |
5120 | parms_ok = False |
|
5080 | parms_ok = False | |
5121 | try: |
|
5081 | try: | |
5122 | delay = int(str(self.proDelay.text())) |
|
5082 | delay = int(str(self.proDelay.text())) | |
5123 | parms_ok = True |
|
5083 | parms_ok = True | |
5124 | except: |
|
5084 | except: | |
5125 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5085 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5126 | self.console.append(outputstr) |
|
5086 | self.console.append(outputstr) | |
5127 |
|
5087 | |||
5128 | try: |
|
5088 | try: | |
5129 | set = int(str(self.proSet.text())) |
|
5089 | set = int(str(self.proSet.text())) | |
5130 | except: |
|
5090 | except: | |
5131 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5091 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5132 | # self.console.append(outputstr) |
|
5092 | # self.console.append(outputstr) | |
5133 | # parms_ok = False |
|
5093 | # parms_ok = False | |
5134 | set = None |
|
5094 | set = None | |
5135 |
|
5095 | |||
5136 | walk = int(self.proComWalk.currentIndex()) |
|
5096 | walk = int(self.proComWalk.currentIndex()) | |
5137 | expLabel = str(self.proExpLabel.text()) |
|
5097 | expLabel = str(self.proExpLabel.text()) | |
5138 |
|
5098 | |||
5139 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5099 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5140 |
|
5100 | |||
5141 | def checkInputsPUSave(self, datatype): |
|
5101 | def checkInputsPUSave(self, datatype): | |
5142 | """ |
|
5102 | """ | |
5143 | Check Inputs Spectra Save: |
|
5103 | Check Inputs Spectra Save: | |
5144 | - path |
|
5104 | - path | |
5145 | - blocks Per File |
|
5105 | - blocks Per File | |
5146 | - sufix |
|
5106 | - sufix | |
5147 | - dataformat |
|
5107 | - dataformat | |
5148 | """ |
|
5108 | """ | |
5149 | parms_ok = True |
|
5109 | parms_ok = True | |
5150 |
|
5110 | |||
5151 | if datatype == "Voltage": |
|
5111 | if datatype == "Voltage": | |
5152 | output_path = str(self.volOutputPath.text()) |
|
5112 | output_path = str(self.volOutputPath.text()) | |
5153 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5113 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5154 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5114 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5155 |
|
5115 | |||
5156 | if datatype == "Spectra": |
|
5116 | if datatype == "Spectra": | |
5157 | output_path = str(self.specOutputPath.text()) |
|
5117 | output_path = str(self.specOutputPath.text()) | |
5158 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5118 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5159 | profilesperblock = 0 |
|
5119 | profilesperblock = 0 | |
5160 |
|
5120 | |||
5161 | if datatype == "SpectraHeis": |
|
5121 | if datatype == "SpectraHeis": | |
5162 | output_path = str(self.specHeisOutputPath.text()) |
|
5122 | output_path = str(self.specHeisOutputPath.text()) | |
5163 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5123 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5164 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5124 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5165 |
|
5125 | |||
5166 | if output_path == '': |
|
5126 | if output_path == '': | |
5167 | outputstr = 'Outputpath is empty' |
|
5127 | outputstr = 'Outputpath is empty' | |
5168 | self.console.append(outputstr) |
|
5128 | self.console.append(outputstr) | |
5169 | parms_ok = False |
|
5129 | parms_ok = False | |
5170 |
|
5130 | |||
5171 | if not os.path.isdir(output_path): |
|
5131 | if not os.path.isdir(output_path): | |
5172 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5132 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5173 | self.console.append(outputstr) |
|
5133 | self.console.append(outputstr) | |
5174 | parms_ok = False |
|
5134 | parms_ok = False | |
5175 |
|
5135 | |||
5176 | try: |
|
5136 | try: | |
5177 | profilesperblock = int(profilesperblock) |
|
5137 | profilesperblock = int(profilesperblock) | |
5178 | except: |
|
5138 | except: | |
5179 | if datatype == "Voltage": |
|
5139 | if datatype == "Voltage": | |
5180 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5140 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5181 | self.console.append(outputstr) |
|
5141 | self.console.append(outputstr) | |
5182 | parms_ok = False |
|
5142 | parms_ok = False | |
5183 | profilesperblock = None |
|
5143 | profilesperblock = None | |
5184 |
|
5144 | |||
5185 | try: |
|
5145 | try: | |
5186 | blocksperfile = int(blocksperfile) |
|
5146 | blocksperfile = int(blocksperfile) | |
5187 | except: |
|
5147 | except: | |
5188 | if datatype == "Voltage": |
|
5148 | if datatype == "Voltage": | |
5189 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5149 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5190 | elif datatype == "Spectra": |
|
5150 | elif datatype == "Spectra": | |
5191 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5151 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5192 | elif datatype == "SpectraHeis": |
|
5152 | elif datatype == "SpectraHeis": | |
5193 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5153 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5194 |
|
5154 | |||
5195 | self.console.append(outputstr) |
|
5155 | self.console.append(outputstr) | |
5196 | parms_ok = False |
|
5156 | parms_ok = False | |
5197 | blocksperfile = None |
|
5157 | blocksperfile = None | |
5198 |
|
5158 | |||
5199 | if datatype == "SpectraHeis": |
|
5159 | if datatype == "SpectraHeis": | |
5200 | if metadata_file != '': |
|
5160 | if metadata_file != '': | |
5201 | if not os.path.isfile(metadata_file): |
|
5161 | if not os.path.isfile(metadata_file): | |
5202 | outputstr = 'Metadata file %s does not exist' % metadata_file |
|
5162 | outputstr = 'Metadata file %s does not exist' % metadata_file | |
5203 | self.console.append(outputstr) |
|
5163 | self.console.append(outputstr) | |
5204 | parms_ok = False |
|
5164 | parms_ok = False | |
5205 |
|
5165 | |||
5206 | if datatype == "Voltage": |
|
5166 | if datatype == "Voltage": | |
5207 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5167 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5208 |
|
5168 | |||
5209 |
|
5169 | |||
5210 | if datatype == "Spectra": |
|
5170 | if datatype == "Spectra": | |
5211 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5171 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5212 |
|
5172 | |||
5213 |
|
5173 | |||
5214 | if datatype == "SpectraHeis": |
|
5174 | if datatype == "SpectraHeis": | |
5215 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5175 | return parms_ok, output_path, blocksperfile, metadata_file | |
5216 |
|
5176 | |||
5217 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5177 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5218 |
|
5178 | |||
5219 | dateList = [] |
|
5179 | dateList = [] | |
5220 | fileList = [] |
|
5180 | fileList = [] | |
5221 |
|
5181 | |||
5222 | if ext == ".r": |
|
5182 | if ext == ".r": | |
5223 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5183 | from schainpy.model.io.jroIO_base import JRODataReader | |
5224 |
|
5184 | |||
5225 | readerObj = JRODataReader() |
|
5185 | readerObj = JRODataReader() | |
5226 | dateList = readerObj.findDatafiles(path=data_path, |
|
5186 | dateList = readerObj.findDatafiles(path=data_path, | |
5227 | expLabel=expLabel, |
|
5187 | expLabel=expLabel, | |
5228 | ext=ext, |
|
5188 | ext=ext, | |
5229 | walk=walk) |
|
5189 | walk=walk) | |
5230 |
|
5190 | |||
5231 | if ext == ".pdata": |
|
5191 | if ext == ".pdata": | |
5232 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5192 | from schainpy.model.io.jroIO_base import JRODataReader | |
5233 |
|
5193 | |||
5234 | readerObj = JRODataReader() |
|
5194 | readerObj = JRODataReader() | |
5235 | dateList = readerObj.findDatafiles(path=data_path, |
|
5195 | dateList = readerObj.findDatafiles(path=data_path, | |
5236 | expLabel=expLabel, |
|
5196 | expLabel=expLabel, | |
5237 | ext=ext, |
|
5197 | ext=ext, | |
5238 | walk=walk) |
|
5198 | walk=walk) | |
5239 |
|
5199 | |||
5240 | if ext == ".fits": |
|
5200 | if ext == ".fits": | |
5241 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5201 | from schainpy.model.io.jroIO_base import JRODataReader | |
5242 |
|
5202 | |||
5243 | readerObj = JRODataReader() |
|
5203 | readerObj = JRODataReader() | |
5244 | dateList = readerObj.findDatafiles(path=data_path, |
|
5204 | dateList = readerObj.findDatafiles(path=data_path, | |
5245 | expLabel=expLabel, |
|
5205 | expLabel=expLabel, | |
5246 | ext=ext, |
|
5206 | ext=ext, | |
5247 | walk=walk) |
|
5207 | walk=walk) | |
5248 |
|
5208 | |||
5249 | if ext == ".hdf5": |
|
5209 | if ext == ".hdf5": | |
5250 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5210 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5251 |
|
5211 | |||
5252 | readerObj = USRPReader() |
|
5212 | readerObj = USRPReader() | |
5253 | dateList = readerObj.findDatafiles(path=data_path) |
|
5213 | dateList = readerObj.findDatafiles(path=data_path) | |
5254 |
|
5214 | |||
5255 | return dateList |
|
5215 | return dateList | |
5256 |
|
5216 | |||
5257 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5217 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5258 | """ |
|
5218 | """ | |
5259 | Method to loads day |
|
5219 | Method to loads day | |
5260 | """ |
|
5220 | """ | |
5261 | # self._disable_save_button() |
|
5221 | # self._disable_save_button() | |
5262 | # self._disable_play_button() |
|
5222 | # self._disable_play_button() | |
5263 | # self.proOk.setEnabled(False) |
|
5223 | # self.proOk.setEnabled(False) | |
5264 |
|
5224 | |||
5265 | self.proComStartDate.clear() |
|
5225 | self.proComStartDate.clear() | |
5266 | self.proComEndDate.clear() |
|
5226 | self.proComEndDate.clear() | |
5267 |
|
5227 | |||
5268 | self.dateList = [] |
|
5228 | self.dateList = [] | |
5269 |
|
5229 | |||
5270 | if not data_path: |
|
5230 | if not data_path: | |
5271 | return [] |
|
5231 | return [] | |
5272 |
|
5232 | |||
5273 | if not os.path.isdir(data_path): |
|
5233 | if not os.path.isdir(data_path): | |
5274 | return [] |
|
5234 | return [] | |
5275 |
|
5235 | |||
5276 | self.dataPath = data_path |
|
5236 | self.dataPath = data_path | |
5277 |
|
5237 | |||
5278 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5238 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5279 |
|
5239 | |||
5280 | if not dateList: |
|
5240 | if not dateList: | |
5281 | # self.console.clear() |
|
5241 | # self.console.clear() | |
5282 | if walk: |
|
5242 | if walk: | |
5283 | if expLabel: |
|
5243 | if expLabel: | |
5284 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5244 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5285 | else: |
|
5245 | else: | |
5286 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5246 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5287 | else: |
|
5247 | else: | |
5288 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5248 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5289 |
|
5249 | |||
5290 | self.console.append(outputstr) |
|
5250 | self.console.append(outputstr) | |
5291 | return [] |
|
5251 | return [] | |
5292 |
|
5252 | |||
5293 | dateStrList = [] |
|
5253 | dateStrList = [] | |
5294 | for thisDate in dateList: |
|
5254 | for thisDate in dateList: | |
5295 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5255 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5296 |
|
5256 | |||
5297 | self.proComStartDate.addItem(dateStr) |
|
5257 | self.proComStartDate.addItem(dateStr) | |
5298 | self.proComEndDate.addItem(dateStr) |
|
5258 | self.proComEndDate.addItem(dateStr) | |
5299 | dateStrList.append(dateStr) |
|
5259 | dateStrList.append(dateStr) | |
5300 |
|
5260 | |||
5301 | self.proComStartDate.setCurrentIndex(0) |
|
5261 | self.proComStartDate.setCurrentIndex(0) | |
5302 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5262 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5303 |
|
5263 | |||
5304 | self.dateList = dateStrList |
|
5264 | self.dateList = dateStrList | |
5305 |
|
5265 | |||
5306 | self.console.clear() |
|
5266 | self.console.clear() | |
5307 | self.console.append("Successful load") |
|
5267 | self.console.append("Successful load") | |
5308 |
|
5268 | |||
5309 | # self.proOk.setEnabled(True) |
|
5269 | # self.proOk.setEnabled(True) | |
5310 | # self._enable_play_button() |
|
5270 | # self._enable_play_button() | |
5311 | # self._enable_save_button() |
|
5271 | # self._enable_save_button() | |
5312 |
|
5272 | |||
5313 | return self.dateList |
|
5273 | return self.dateList | |
5314 |
|
5274 | |||
5315 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5275 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5316 |
|
5276 | |||
5317 | if pathWorkSpace == None: |
|
5277 | if pathWorkSpace == None: | |
5318 | home = os.path.expanduser("~") |
|
5278 | home = os.path.expanduser("~") | |
5319 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5279 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5320 |
|
5280 | |||
5321 | self.pathWorkSpace = pathWorkSpace |
|
5281 | self.pathWorkSpace = pathWorkSpace | |
5322 |
|
5282 | |||
5323 | """ |
|
5283 | """ | |
5324 | Comandos Usados en Console |
|
5284 | Comandos Usados en Console | |
5325 | """ |
|
5285 | """ | |
5326 | def __del__(self): |
|
5286 | def __del__(self): | |
5327 | sys.stdout = sys.__stdout__ |
|
5287 | sys.stdout = sys.__stdout__ | |
5328 | sys.stderr = sys.__stderr__ |
|
5288 | sys.stderr = sys.__stderr__ | |
5329 |
|
5289 | |||
5330 | def normalOutputWritten(self, text): |
|
5290 | def normalOutputWritten(self, text): | |
5331 | color_black = QtGui.QColor(0,0,0) |
|
5291 | color_black = QtGui.QColor(0,0,0) | |
5332 | self.console.setTextColor(color_black) |
|
5292 | self.console.setTextColor(color_black) | |
5333 | self.console.append(text) |
|
5293 | self.console.append(text) | |
5334 |
|
5294 | |||
5335 | def errorOutputWritten(self, text): |
|
5295 | def errorOutputWritten(self, text): | |
5336 | color_red = QtGui.QColor(255,0,0) |
|
5296 | color_red = QtGui.QColor(255,0,0) | |
5337 | color_black = QtGui.QColor(0,0,0) |
|
5297 | color_black = QtGui.QColor(0,0,0) | |
5338 |
|
5298 | |||
5339 | self.console.setTextColor(color_red) |
|
5299 | self.console.setTextColor(color_red) | |
5340 | self.console.append(text) |
|
5300 | self.console.append(text) | |
5341 | self.console.setTextColor(color_black) |
|
5301 | self.console.setTextColor(color_black) | |
5342 |
|
5302 | |||
5343 | def _enable_save_button(self): |
|
5303 | def _enable_save_button(self): | |
5344 |
|
5304 | |||
5345 | self.actionSaveToolbar.setEnabled(True) |
|
5305 | self.actionSaveToolbar.setEnabled(True) | |
5346 | self.actionSave.setEnabled(True) |
|
5306 | self.actionSave.setEnabled(True) | |
5347 |
|
5307 | |||
5348 | def _disable_save_button(self): |
|
5308 | def _disable_save_button(self): | |
5349 |
|
5309 | |||
5350 | self.actionSaveToolbar.setEnabled(False) |
|
5310 | self.actionSaveToolbar.setEnabled(False) | |
5351 | self.actionSave.setEnabled(False) |
|
5311 | self.actionSave.setEnabled(False) | |
5352 |
|
5312 | |||
5353 | def _enable_play_button(self): |
|
5313 | def _enable_play_button(self): | |
5354 |
|
5314 | |||
5355 | self.actionStart.setEnabled(True) |
|
5315 | self.actionStart.setEnabled(True) | |
5356 | self.actionStarToolbar.setEnabled(True) |
|
5316 | self.actionStarToolbar.setEnabled(True) | |
5357 |
|
5317 | |||
5358 | self.changeStartIcon(started=False) |
|
5318 | self.changeStartIcon(started=False) | |
5359 |
|
5319 | |||
5360 | def _disable_play_button(self): |
|
5320 | def _disable_play_button(self): | |
5361 |
|
5321 | |||
5362 | self.actionStart.setEnabled(False) |
|
5322 | self.actionStart.setEnabled(False) | |
5363 | self.actionStarToolbar.setEnabled(False) |
|
5323 | self.actionStarToolbar.setEnabled(False) | |
5364 |
|
5324 | |||
5365 | self.changeStartIcon(started=True) |
|
5325 | self.changeStartIcon(started=True) | |
5366 |
|
5326 | |||
5367 | def _enable_stop_button(self): |
|
5327 | def _enable_stop_button(self): | |
5368 |
|
5328 | |||
5369 | self.actionPause.setEnabled(True) |
|
5329 | self.actionPause.setEnabled(True) | |
5370 | self.actionStop.setEnabled(True) |
|
5330 | self.actionStop.setEnabled(True) | |
5371 |
|
5331 | |||
5372 | self.actionPauseToolbar.setEnabled(True) |
|
5332 | self.actionPauseToolbar.setEnabled(True) | |
5373 | self.actionStopToolbar.setEnabled(True) |
|
5333 | self.actionStopToolbar.setEnabled(True) | |
5374 |
|
5334 | |||
5375 | self.changePauseIcon(paused=False) |
|
5335 | self.changePauseIcon(paused=False) | |
5376 | self.changeStopIcon(started=True) |
|
5336 | self.changeStopIcon(started=True) | |
5377 |
|
5337 | |||
5378 | def _disable_stop_button(self): |
|
5338 | def _disable_stop_button(self): | |
5379 |
|
5339 | |||
5380 | self.actionPause.setEnabled(False) |
|
5340 | self.actionPause.setEnabled(False) | |
5381 | self.actionStop.setEnabled(False) |
|
5341 | self.actionStop.setEnabled(False) | |
5382 |
|
5342 | |||
5383 | self.actionPauseToolbar.setEnabled(False) |
|
5343 | self.actionPauseToolbar.setEnabled(False) | |
5384 | self.actionStopToolbar.setEnabled(False) |
|
5344 | self.actionStopToolbar.setEnabled(False) | |
5385 |
|
5345 | |||
5386 | self.changePauseIcon(paused=False) |
|
5346 | self.changePauseIcon(paused=False) | |
5387 | self.changeStopIcon(started=False) |
|
5347 | self.changeStopIcon(started=False) | |
5388 |
|
5348 | |||
5389 | def setGUIStatus(self): |
|
5349 | def setGUIStatus(self): | |
5390 |
|
5350 | |||
5391 | self.setWindowTitle("ROJ-Signal Chain") |
|
5351 | self.setWindowTitle("ROJ-Signal Chain") | |
5392 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5352 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5393 |
|
5353 | |||
5394 | self.tabWidgetProject.setEnabled(False) |
|
5354 | self.tabWidgetProject.setEnabled(False) | |
5395 | self.tabVoltage.setEnabled(False) |
|
5355 | self.tabVoltage.setEnabled(False) | |
5396 | self.tabSpectra.setEnabled(False) |
|
5356 | self.tabSpectra.setEnabled(False) | |
5397 | self.tabCorrelation.setEnabled(False) |
|
5357 | self.tabCorrelation.setEnabled(False) | |
5398 | self.frame_2.setEnabled(False) |
|
5358 | self.frame_2.setEnabled(False) | |
5399 |
|
5359 | |||
5400 | self.actionCreate.setShortcut('Ctrl+N') |
|
5360 | self.actionCreate.setShortcut('Ctrl+N') | |
5401 | self.actionOpen.setShortcut('Ctrl+O') |
|
5361 | self.actionOpen.setShortcut('Ctrl+O') | |
5402 | self.actionSave.setShortcut('Ctrl+S') |
|
5362 | self.actionSave.setShortcut('Ctrl+S') | |
5403 | self.actionClose.setShortcut('Ctrl+X') |
|
5363 | self.actionClose.setShortcut('Ctrl+X') | |
5404 |
|
5364 | |||
5405 | self.actionStart.setShortcut('Ctrl+1') |
|
5365 | self.actionStart.setShortcut('Ctrl+1') | |
5406 | self.actionPause.setShortcut('Ctrl+2') |
|
5366 | self.actionPause.setShortcut('Ctrl+2') | |
5407 | self.actionStop.setShortcut('Ctrl+3') |
|
5367 | self.actionStop.setShortcut('Ctrl+3') | |
5408 |
|
5368 | |||
5409 | self.actionFTP.setShortcut('Ctrl+F') |
|
5369 | self.actionFTP.setShortcut('Ctrl+F') | |
5410 |
|
5370 | |||
5411 | self.actionStart.setEnabled(False) |
|
5371 | self.actionStart.setEnabled(False) | |
5412 | self.actionPause.setEnabled(False) |
|
5372 | self.actionPause.setEnabled(False) | |
5413 | self.actionStop.setEnabled(False) |
|
5373 | self.actionStop.setEnabled(False) | |
5414 |
|
5374 | |||
5415 | self.actionStarToolbar.setEnabled(False) |
|
5375 | self.actionStarToolbar.setEnabled(False) | |
5416 | self.actionPauseToolbar.setEnabled(False) |
|
5376 | self.actionPauseToolbar.setEnabled(False) | |
5417 | self.actionStopToolbar.setEnabled(False) |
|
5377 | self.actionStopToolbar.setEnabled(False) | |
5418 |
|
5378 | |||
5419 | self.proName.clear() |
|
5379 | self.proName.clear() | |
5420 | self.proDataPath.setText('') |
|
5380 | self.proDataPath.setText('') | |
5421 | self.console.setReadOnly(True) |
|
5381 | self.console.setReadOnly(True) | |
5422 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5382 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5423 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5383 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5424 | self.proDataType.setEnabled(False) |
|
5384 | self.proDataType.setEnabled(False) | |
5425 | self.time = QtCore.QTime() |
|
5385 | self.time = QtCore.QTime() | |
5426 | self.hour = 0 |
|
5386 | self.hour = 0 | |
5427 | self.min = 0 |
|
5387 | self.min = 0 | |
5428 | self.sec = 0 |
|
5388 | self.sec = 0 | |
5429 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5389 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5430 | startTime = "00:00:00" |
|
5390 | startTime = "00:00:00" | |
5431 | endTime = "23:59:59" |
|
5391 | endTime = "23:59:59" | |
5432 | starlist = startTime.split(":") |
|
5392 | starlist = startTime.split(":") | |
5433 | endlist = endTime.split(":") |
|
5393 | endlist = endTime.split(":") | |
5434 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5394 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5435 | self.proStartTime.setTime(self.time) |
|
5395 | self.proStartTime.setTime(self.time) | |
5436 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5396 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5437 | self.proEndTime.setTime(self.time) |
|
5397 | self.proEndTime.setTime(self.time) | |
5438 | self.proOk.setEnabled(False) |
|
5398 | self.proOk.setEnabled(False) | |
5439 | # set model Project Explorer |
|
5399 | # set model Project Explorer | |
5440 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5400 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5441 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5401 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5442 | layout = QtGui.QVBoxLayout() |
|
5402 | layout = QtGui.QVBoxLayout() | |
5443 | layout.addWidget(self.projectExplorerTree) |
|
5403 | layout.addWidget(self.projectExplorerTree) | |
5444 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5404 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5445 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5405 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5446 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5406 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5447 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5407 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5448 | self.projectExplorerTree.expandAll() |
|
5408 | self.projectExplorerTree.expandAll() | |
5449 | # set model Project Properties |
|
5409 | # set model Project Properties | |
5450 |
|
5410 | |||
5451 | self.propertiesModel = TreeModel() |
|
5411 | self.propertiesModel = TreeModel() | |
5452 | self.propertiesModel.initProjectView() |
|
5412 | self.propertiesModel.initProjectView() | |
5453 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5413 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5454 | self.treeProjectProperties.expandAll() |
|
5414 | self.treeProjectProperties.expandAll() | |
5455 | self.treeProjectProperties.allColumnsShowFocus() |
|
5415 | self.treeProjectProperties.allColumnsShowFocus() | |
5456 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5416 | self.treeProjectProperties.resizeColumnToContents(1) | |
5457 |
|
5417 | |||
5458 | # set Project |
|
5418 | # set Project | |
5459 | self.proExpLabel.setEnabled(True) |
|
5419 | self.proExpLabel.setEnabled(True) | |
5460 | self.proDelay.setEnabled(False) |
|
5420 | self.proDelay.setEnabled(False) | |
5461 | self.proSet.setEnabled(True) |
|
5421 | self.proSet.setEnabled(True) | |
5462 | self.proDataType.setReadOnly(True) |
|
5422 | self.proDataType.setReadOnly(True) | |
5463 |
|
5423 | |||
5464 | # set Operation Voltage |
|
5424 | # set Operation Voltage | |
5465 | self.volOpComChannels.setEnabled(False) |
|
5425 | self.volOpComChannels.setEnabled(False) | |
5466 | self.volOpComHeights.setEnabled(False) |
|
5426 | self.volOpComHeights.setEnabled(False) | |
5467 | self.volOpFilter.setEnabled(False) |
|
5427 | self.volOpFilter.setEnabled(False) | |
5468 | self.volOpComProfile.setEnabled(False) |
|
5428 | self.volOpComProfile.setEnabled(False) | |
5469 | self.volOpComCode.setEnabled(False) |
|
5429 | self.volOpComCode.setEnabled(False) | |
5470 | self.volOpFlip.setEnabled(False) |
|
5430 | self.volOpFlip.setEnabled(False) | |
5471 | self.volOpCohInt.setEnabled(False) |
|
5431 | self.volOpCohInt.setEnabled(False) | |
5472 | self.volOpRadarfrequency.setEnabled(False) |
|
5432 | self.volOpRadarfrequency.setEnabled(False) | |
5473 |
|
5433 | |||
5474 | self.volOpChannel.setEnabled(False) |
|
5434 | self.volOpChannel.setEnabled(False) | |
5475 | self.volOpHeights.setEnabled(False) |
|
5435 | self.volOpHeights.setEnabled(False) | |
5476 | self.volOpProfile.setEnabled(False) |
|
5436 | self.volOpProfile.setEnabled(False) | |
5477 | self.volOpComMode.setEnabled(False) |
|
5437 | self.volOpComMode.setEnabled(False) | |
5478 |
|
5438 | |||
5479 | self.volGraphPath.setEnabled(False) |
|
5439 | self.volGraphPath.setEnabled(False) | |
5480 | self.volGraphPrefix.setEnabled(False) |
|
5440 | self.volGraphPrefix.setEnabled(False) | |
5481 | self.volGraphToolPath.setEnabled(False) |
|
5441 | self.volGraphToolPath.setEnabled(False) | |
5482 |
|
5442 | |||
5483 | # set Graph Voltage |
|
5443 | # set Graph Voltage | |
5484 | self.volGraphChannelList.setEnabled(False) |
|
5444 | self.volGraphChannelList.setEnabled(False) | |
5485 | self.volGraphfreqrange.setEnabled(False) |
|
5445 | self.volGraphfreqrange.setEnabled(False) | |
5486 | self.volGraphHeightrange.setEnabled(False) |
|
5446 | self.volGraphHeightrange.setEnabled(False) | |
5487 |
|
5447 | |||
5488 | # set Operation Spectra |
|
5448 | # set Operation Spectra | |
5489 | self.specOpnFFTpoints.setEnabled(False) |
|
5449 | self.specOpnFFTpoints.setEnabled(False) | |
5490 | self.specOpProfiles.setEnabled(False) |
|
5450 | self.specOpProfiles.setEnabled(False) | |
5491 | self.specOpippFactor.setEnabled(False) |
|
5451 | self.specOpippFactor.setEnabled(False) | |
5492 | self.specOppairsList.setEnabled(False) |
|
5452 | self.specOppairsList.setEnabled(False) | |
5493 | self.specOpComChannel.setEnabled(False) |
|
5453 | self.specOpComChannel.setEnabled(False) | |
5494 | self.specOpComHeights.setEnabled(False) |
|
5454 | self.specOpComHeights.setEnabled(False) | |
5495 | self.specOpIncoherent.setEnabled(False) |
|
5455 | self.specOpIncoherent.setEnabled(False) | |
5496 | self.specOpgetNoise.setEnabled(False) |
|
5456 | self.specOpgetNoise.setEnabled(False) | |
5497 | self.specOpRadarfrequency.setEnabled(False) |
|
5457 | self.specOpRadarfrequency.setEnabled(False) | |
5498 |
|
5458 | |||
5499 |
|
5459 | |||
5500 | self.specOpChannel.setEnabled(False) |
|
5460 | self.specOpChannel.setEnabled(False) | |
5501 | self.specOpHeights.setEnabled(False) |
|
5461 | self.specOpHeights.setEnabled(False) | |
5502 | # set Graph Spectra |
|
5462 | # set Graph Spectra | |
5503 | self.specGgraphChannelList.setEnabled(False) |
|
5463 | self.specGgraphChannelList.setEnabled(False) | |
5504 | self.specGgraphFreq.setEnabled(False) |
|
5464 | self.specGgraphFreq.setEnabled(False) | |
5505 | self.specGgraphHeight.setEnabled(False) |
|
5465 | self.specGgraphHeight.setEnabled(False) | |
5506 | self.specGgraphDbsrange.setEnabled(False) |
|
5466 | self.specGgraphDbsrange.setEnabled(False) | |
5507 | self.specGgraphmagnitud.setEnabled(False) |
|
5467 | self.specGgraphmagnitud.setEnabled(False) | |
5508 | self.specGgraphTminTmax.setEnabled(False) |
|
5468 | self.specGgraphTminTmax.setEnabled(False) | |
5509 | self.specGgraphTimeRange.setEnabled(False) |
|
5469 | self.specGgraphTimeRange.setEnabled(False) | |
5510 | self.specGraphPath.setEnabled(False) |
|
5470 | self.specGraphPath.setEnabled(False) | |
5511 | self.specGraphToolPath.setEnabled(False) |
|
5471 | self.specGraphToolPath.setEnabled(False) | |
5512 | self.specGraphPrefix.setEnabled(False) |
|
5472 | self.specGraphPrefix.setEnabled(False) | |
5513 |
|
5473 | |||
5514 | self.specGgraphftpratio.setEnabled(False) |
|
5474 | self.specGgraphftpratio.setEnabled(False) | |
5515 | # set Operation SpectraHeis |
|
5475 | # set Operation SpectraHeis | |
5516 | self.specHeisOpIncoherent.setEnabled(False) |
|
5476 | self.specHeisOpIncoherent.setEnabled(False) | |
5517 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5477 | self.specHeisOpCobIncInt.setEnabled(False) | |
5518 | # set Graph SpectraHeis |
|
5478 | # set Graph SpectraHeis | |
5519 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5479 | self.specHeisGgraphChannelList.setEnabled(False) | |
5520 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5480 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5521 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5481 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5522 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5482 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5523 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5483 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5524 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5484 | self.specHeisGgraphftpratio.setEnabled(False) | |
5525 | self.specHeisGraphPath.setEnabled(False) |
|
5485 | self.specHeisGraphPath.setEnabled(False) | |
5526 | self.specHeisGraphPrefix.setEnabled(False) |
|
5486 | self.specHeisGraphPrefix.setEnabled(False) | |
5527 | self.specHeisGraphToolPath.setEnabled(False) |
|
5487 | self.specHeisGraphToolPath.setEnabled(False) | |
5528 |
|
5488 | |||
5529 |
|
5489 | |||
5530 | # tool tip gui |
|
5490 | # tool tip gui | |
5531 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5491 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5532 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5492 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5533 | # tool tip gui project |
|
5493 | # tool tip gui project | |
5534 | 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>') |
|
5494 | 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>') | |
5535 | self.proComWalk.setCurrentIndex(0) |
|
5495 | self.proComWalk.setCurrentIndex(0) | |
5536 | # tool tip gui volOp |
|
5496 | # tool tip gui volOp | |
5537 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5497 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5538 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5498 | self.volOpHeights.setToolTip('Example: 90,180') | |
5539 | self.volOpFilter.setToolTip('Example: 2') |
|
5499 | self.volOpFilter.setToolTip('Example: 2') | |
5540 | self.volOpProfile.setToolTip('Example:0,127') |
|
5500 | self.volOpProfile.setToolTip('Example:0,127') | |
5541 | self.volOpCohInt.setToolTip('Example: 128') |
|
5501 | self.volOpCohInt.setToolTip('Example: 128') | |
5542 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5502 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5543 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5503 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5544 | # tool tip gui volGraph |
|
5504 | # tool tip gui volGraph | |
5545 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5505 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5546 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5506 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5547 | # tool tip gui specOp |
|
5507 | # tool tip gui specOp | |
5548 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5508 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5549 | self.specOpProfiles.setToolTip('Example: 128') |
|
5509 | self.specOpProfiles.setToolTip('Example: 128') | |
5550 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5510 | self.specOpippFactor.setToolTip('Example:1.0') | |
5551 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5511 | self.specOpIncoherent.setToolTip('Example: 10') | |
5552 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5512 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5553 |
|
5513 | |||
5554 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5514 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5555 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5515 | self.specOpHeights.setToolTip('Example: 90,180') | |
5556 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5516 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5557 | # tool tip gui specGraph |
|
5517 | # tool tip gui specGraph | |
5558 |
|
5518 | |||
5559 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5519 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5560 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5520 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5561 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5521 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5562 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5522 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5563 |
|
5523 | |||
5564 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5524 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5565 |
|
5525 | |||
5566 |
|
5526 | |||
5567 | self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5527 | self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5568 |
|
5528 | |||
5569 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5529 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5570 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5530 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5571 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5531 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5572 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5532 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5573 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5533 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5574 |
|
5534 | |||
5575 | self.labelSet.show() |
|
5535 | self.labelSet.show() | |
5576 | self.proSet.show() |
|
5536 | self.proSet.show() | |
5577 |
|
5537 | |||
5578 | self.labelIPPKm.hide() |
|
5538 | self.labelIPPKm.hide() | |
5579 | self.proIPPKm.hide() |
|
5539 | self.proIPPKm.hide() | |
5580 |
|
5540 | |||
5581 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5541 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5582 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5542 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5583 |
|
5543 | |||
5584 |
|
5544 | |||
5585 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5545 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5586 | """ |
|
5546 | """ | |
5587 | Class documentation goes here. |
|
5547 | Class documentation goes here. | |
5588 | """ |
|
5548 | """ | |
5589 | closed = pyqtSignal() |
|
5549 | closed = pyqtSignal() | |
5590 | create = False |
|
5550 | create = False | |
5591 |
|
5551 | |||
5592 | def __init__(self, parent=None): |
|
5552 | def __init__(self, parent=None): | |
5593 | """ |
|
5553 | """ | |
5594 | Constructor |
|
5554 | Constructor | |
5595 | """ |
|
5555 | """ | |
5596 | QMainWindow.__init__(self, parent) |
|
5556 | QMainWindow.__init__(self, parent) | |
5597 | self.setupUi(self) |
|
5557 | self.setupUi(self) | |
5598 | self.getFromWindow = None |
|
5558 | self.getFromWindow = None | |
5599 | self.getfromWindowList = [] |
|
5559 | self.getfromWindowList = [] | |
5600 | self.dataTypeProject = None |
|
5560 | self.dataTypeProject = None | |
5601 |
|
5561 | |||
5602 | self.listUP = None |
|
5562 | self.listUP = None | |
5603 |
|
5563 | |||
5604 | @pyqtSignature("") |
|
5564 | @pyqtSignature("") | |
5605 | def on_unitPokbut_clicked(self): |
|
5565 | def on_unitPokbut_clicked(self): | |
5606 | """ |
|
5566 | """ | |
5607 | Slot documentation goes here. |
|
5567 | Slot documentation goes here. | |
5608 | """ |
|
5568 | """ | |
5609 | self.create = True |
|
5569 | self.create = True | |
5610 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5570 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5611 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5571 | # self.nameofUP= str(self.nameUptxt.text()) | |
5612 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5572 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5613 | self.close() |
|
5573 | self.close() | |
5614 |
|
5574 | |||
5615 |
|
5575 | |||
5616 | @pyqtSignature("") |
|
5576 | @pyqtSignature("") | |
5617 | def on_unitPcancelbut_clicked(self): |
|
5577 | def on_unitPcancelbut_clicked(self): | |
5618 | """ |
|
5578 | """ | |
5619 | Slot documentation goes here. |
|
5579 | Slot documentation goes here. | |
5620 | """ |
|
5580 | """ | |
5621 | self.create = False |
|
5581 | self.create = False | |
5622 | self.close() |
|
5582 | self.close() | |
5623 |
|
5583 | |||
5624 | def loadTotalList(self): |
|
5584 | def loadTotalList(self): | |
5625 | self.comboInputBox.clear() |
|
5585 | self.comboInputBox.clear() | |
5626 | for i in self.getfromWindowList: |
|
5586 | for i in self.getfromWindowList: | |
5627 |
|
5587 | |||
5628 | name = i.getElementName() |
|
5588 | name = i.getElementName() | |
5629 | if name == 'Project': |
|
5589 | if name == 'Project': | |
5630 | id = i.id |
|
5590 | id = i.id | |
5631 | name = i.name |
|
5591 | name = i.name | |
5632 | if self.dataTypeProject == 'Voltage': |
|
5592 | if self.dataTypeProject == 'Voltage': | |
5633 | self.comboTypeBox.clear() |
|
5593 | self.comboTypeBox.clear() | |
5634 | self.comboTypeBox.addItem("Voltage") |
|
5594 | self.comboTypeBox.addItem("Voltage") | |
5635 |
|
5595 | |||
5636 | if self.dataTypeProject == 'Spectra': |
|
5596 | if self.dataTypeProject == 'Spectra': | |
5637 | self.comboTypeBox.clear() |
|
5597 | self.comboTypeBox.clear() | |
5638 | self.comboTypeBox.addItem("Spectra") |
|
5598 | self.comboTypeBox.addItem("Spectra") | |
5639 | self.comboTypeBox.addItem("Correlation") |
|
5599 | self.comboTypeBox.addItem("Correlation") | |
5640 | if self.dataTypeProject == 'Fits': |
|
5600 | if self.dataTypeProject == 'Fits': | |
5641 | self.comboTypeBox.clear() |
|
5601 | self.comboTypeBox.clear() | |
5642 | self.comboTypeBox.addItem("SpectraHeis") |
|
5602 | self.comboTypeBox.addItem("SpectraHeis") | |
5643 |
|
5603 | |||
5644 |
|
5604 | |||
5645 | if name == 'ProcUnit': |
|
5605 | if name == 'ProcUnit': | |
5646 | id = int(i.id) - 1 |
|
5606 | id = int(i.id) - 1 | |
5647 | name = i.datatype |
|
5607 | name = i.datatype | |
5648 | if name == 'Voltage': |
|
5608 | if name == 'Voltage': | |
5649 | self.comboTypeBox.clear() |
|
5609 | self.comboTypeBox.clear() | |
5650 | self.comboTypeBox.addItem("Spectra") |
|
5610 | self.comboTypeBox.addItem("Spectra") | |
5651 | self.comboTypeBox.addItem("SpectraHeis") |
|
5611 | self.comboTypeBox.addItem("SpectraHeis") | |
5652 | self.comboTypeBox.addItem("Correlation") |
|
5612 | self.comboTypeBox.addItem("Correlation") | |
5653 | if name == 'Spectra': |
|
5613 | if name == 'Spectra': | |
5654 | self.comboTypeBox.clear() |
|
5614 | self.comboTypeBox.clear() | |
5655 | self.comboTypeBox.addItem("Spectra") |
|
5615 | self.comboTypeBox.addItem("Spectra") | |
5656 | self.comboTypeBox.addItem("SpectraHeis") |
|
5616 | self.comboTypeBox.addItem("SpectraHeis") | |
5657 | self.comboTypeBox.addItem("Correlation") |
|
5617 | self.comboTypeBox.addItem("Correlation") | |
5658 | if name == 'SpectraHeis': |
|
5618 | if name == 'SpectraHeis': | |
5659 | self.comboTypeBox.clear() |
|
5619 | self.comboTypeBox.clear() | |
5660 | self.comboTypeBox.addItem("SpectraHeis") |
|
5620 | self.comboTypeBox.addItem("SpectraHeis") | |
5661 |
|
5621 | |||
5662 | self.comboInputBox.addItem(str(name)) |
|
5622 | self.comboInputBox.addItem(str(name)) | |
5663 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5623 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5664 |
|
5624 | |||
5665 | def closeEvent(self, event): |
|
5625 | def closeEvent(self, event): | |
5666 | self.closed.emit() |
|
5626 | self.closed.emit() | |
5667 | event.accept() |
|
5627 | event.accept() | |
5668 |
|
5628 | |||
5669 | class Ftp(QMainWindow, Ui_Ftp): |
|
5629 | class Ftp(QMainWindow, Ui_Ftp): | |
5670 | """ |
|
5630 | """ | |
5671 | Class documentation goes here. |
|
5631 | Class documentation goes here. | |
5672 | """ |
|
5632 | """ | |
5673 | create = False |
|
5633 | create = False | |
5674 | closed = pyqtSignal() |
|
5634 | closed = pyqtSignal() | |
5675 | server = None |
|
5635 | server = None | |
5676 | remotefolder = None |
|
5636 | remotefolder = None | |
5677 | username = None |
|
5637 | username = None | |
5678 | password = None |
|
5638 | password = None | |
5679 | ftp_wei = None |
|
5639 | ftp_wei = None | |
5680 | exp_code = None |
|
5640 | exp_code = None | |
5681 | sub_exp_code = None |
|
5641 | sub_exp_code = None | |
5682 | plot_pos = None |
|
5642 | plot_pos = None | |
5683 |
|
5643 | |||
5684 | def __init__(self, parent=None): |
|
5644 | def __init__(self, parent=None): | |
5685 | """ |
|
5645 | """ | |
5686 | Constructor |
|
5646 | Constructor | |
5687 | """ |
|
5647 | """ | |
5688 | QMainWindow.__init__(self, parent) |
|
5648 | QMainWindow.__init__(self, parent) | |
5689 | self.setupUi(self) |
|
5649 | self.setupUi(self) | |
5690 | self.setGUIStatus() |
|
5650 | self.setGUIStatus() | |
5691 |
|
5651 | |||
5692 | def setGUIStatus(self): |
|
5652 | def setGUIStatus(self): | |
5693 | self.setWindowTitle("ROJ-Signal Chain") |
|
5653 | self.setWindowTitle("ROJ-Signal Chain") | |
5694 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5654 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5695 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5655 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5696 | self.usernameFTP.setToolTip('Example: myusername') |
|
5656 | self.usernameFTP.setToolTip('Example: myusername') | |
5697 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5657 | self.passwordFTP.setToolTip('Example: mypass ') | |
5698 | self.weightFTP.setToolTip('Example: 0') |
|
5658 | self.weightFTP.setToolTip('Example: 0') | |
5699 | self.expcodeFTP.setToolTip('Example: 0') |
|
5659 | self.expcodeFTP.setToolTip('Example: 0') | |
5700 | self.subexpFTP.setToolTip('Example: 0') |
|
5660 | self.subexpFTP.setToolTip('Example: 0') | |
5701 | self.plotposFTP.setToolTip('Example: 0') |
|
5661 | self.plotposFTP.setToolTip('Example: 0') | |
5702 |
|
5662 | |||
5703 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5663 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5704 | self.serverFTP.setText(str(server)) |
|
5664 | self.serverFTP.setText(str(server)) | |
5705 | self.folderFTP.setText(str(remotefolder)) |
|
5665 | self.folderFTP.setText(str(remotefolder)) | |
5706 | self.usernameFTP.setText(str(username)) |
|
5666 | self.usernameFTP.setText(str(username)) | |
5707 | self.passwordFTP.setText(str(password)) |
|
5667 | self.passwordFTP.setText(str(password)) | |
5708 | self.weightFTP.setText(str(ftp_wei)) |
|
5668 | self.weightFTP.setText(str(ftp_wei)) | |
5709 | self.expcodeFTP.setText(str(exp_code)) |
|
5669 | self.expcodeFTP.setText(str(exp_code)) | |
5710 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5670 | self.subexpFTP.setText(str(sub_exp_code)) | |
5711 | self.plotposFTP.setText(str(plot_pos)) |
|
5671 | self.plotposFTP.setText(str(plot_pos)) | |
5712 |
|
5672 | |||
5713 | def getParmsFromFtpWindow(self): |
|
5673 | def getParmsFromFtpWindow(self): | |
5714 | """ |
|
5674 | """ | |
5715 | Return Inputs Project: |
|
5675 | Return Inputs Project: | |
5716 | - server |
|
5676 | - server | |
5717 | - remotefolder |
|
5677 | - remotefolder | |
5718 | - username |
|
5678 | - username | |
5719 | - password |
|
5679 | - password | |
5720 | - ftp_wei |
|
5680 | - ftp_wei | |
5721 | - exp_code |
|
5681 | - exp_code | |
5722 | - sub_exp_code |
|
5682 | - sub_exp_code | |
5723 | - plot_pos |
|
5683 | - plot_pos | |
5724 | """ |
|
5684 | """ | |
5725 | name_server_ftp = str(self.serverFTP.text()) |
|
5685 | name_server_ftp = str(self.serverFTP.text()) | |
5726 | if not name_server_ftp: |
|
5686 | if not name_server_ftp: | |
5727 | self.console.clear() |
|
5687 | self.console.clear() | |
5728 | self.console.append("Please Write a FTP Server") |
|
5688 | self.console.append("Please Write a FTP Server") | |
5729 | return 0 |
|
5689 | return 0 | |
5730 |
|
5690 | |||
5731 | folder_server_ftp = str(self.folderFTP.text()) |
|
5691 | folder_server_ftp = str(self.folderFTP.text()) | |
5732 | if not folder_server_ftp: |
|
5692 | if not folder_server_ftp: | |
5733 | self.console.clear() |
|
5693 | self.console.clear() | |
5734 | self.console.append("Please Write a Folder") |
|
5694 | self.console.append("Please Write a Folder") | |
5735 | return 0 |
|
5695 | return 0 | |
5736 |
|
5696 | |||
5737 | username_ftp = str(self.usernameFTP.text()) |
|
5697 | username_ftp = str(self.usernameFTP.text()) | |
5738 | if not username_ftp: |
|
5698 | if not username_ftp: | |
5739 | self.console.clear() |
|
5699 | self.console.clear() | |
5740 | self.console.append("Please Write a User Name") |
|
5700 | self.console.append("Please Write a User Name") | |
5741 | return 0 |
|
5701 | return 0 | |
5742 |
|
5702 | |||
5743 | password_ftp = str(self.passwordFTP.text()) |
|
5703 | password_ftp = str(self.passwordFTP.text()) | |
5744 | if not password_ftp: |
|
5704 | if not password_ftp: | |
5745 | self.console.clear() |
|
5705 | self.console.clear() | |
5746 | self.console.append("Please Write a passwordFTP") |
|
5706 | self.console.append("Please Write a passwordFTP") | |
5747 | return 0 |
|
5707 | return 0 | |
5748 |
|
5708 | |||
5749 | ftp_wei = str(self.weightFTP.text()) |
|
5709 | ftp_wei = str(self.weightFTP.text()) | |
5750 | if not ftp_wei == "": |
|
5710 | if not ftp_wei == "": | |
5751 | try: |
|
5711 | try: | |
5752 | ftp_wei = int(self.weightFTP.text()) |
|
5712 | ftp_wei = int(self.weightFTP.text()) | |
5753 | except: |
|
5713 | except: | |
5754 | self.console.clear() |
|
5714 | self.console.clear() | |
5755 | self.console.append("Please Write a ftp_wei number") |
|
5715 | self.console.append("Please Write a ftp_wei number") | |
5756 | return 0 |
|
5716 | return 0 | |
5757 |
|
5717 | |||
5758 | exp_code = str(self.expcodeFTP.text()) |
|
5718 | exp_code = str(self.expcodeFTP.text()) | |
5759 | if not exp_code == "": |
|
5719 | if not exp_code == "": | |
5760 | try: |
|
5720 | try: | |
5761 | exp_code = int(self.expcodeFTP.text()) |
|
5721 | exp_code = int(self.expcodeFTP.text()) | |
5762 | except: |
|
5722 | except: | |
5763 | self.console.clear() |
|
5723 | self.console.clear() | |
5764 | self.console.append("Please Write a exp_code number") |
|
5724 | self.console.append("Please Write a exp_code number") | |
5765 | return 0 |
|
5725 | return 0 | |
5766 |
|
5726 | |||
5767 |
|
5727 | |||
5768 | sub_exp_code = str(self.subexpFTP.text()) |
|
5728 | sub_exp_code = str(self.subexpFTP.text()) | |
5769 | if not sub_exp_code == "": |
|
5729 | if not sub_exp_code == "": | |
5770 | try: |
|
5730 | try: | |
5771 | sub_exp_code = int(self.subexpFTP.text()) |
|
5731 | sub_exp_code = int(self.subexpFTP.text()) | |
5772 | except: |
|
5732 | except: | |
5773 | self.console.clear() |
|
5733 | self.console.clear() | |
5774 | self.console.append("Please Write a sub_exp_code number") |
|
5734 | self.console.append("Please Write a sub_exp_code number") | |
5775 | return 0 |
|
5735 | return 0 | |
5776 |
|
5736 | |||
5777 | plot_pos = str(self.plotposFTP.text()) |
|
5737 | plot_pos = str(self.plotposFTP.text()) | |
5778 | if not plot_pos == "": |
|
5738 | if not plot_pos == "": | |
5779 | try: |
|
5739 | try: | |
5780 | plot_pos = int(self.plotposFTP.text()) |
|
5740 | plot_pos = int(self.plotposFTP.text()) | |
5781 | except: |
|
5741 | except: | |
5782 | self.console.clear() |
|
5742 | self.console.clear() | |
5783 | self.console.append("Please Write a plot_pos number") |
|
5743 | self.console.append("Please Write a plot_pos number") | |
5784 | return 0 |
|
5744 | return 0 | |
5785 |
|
5745 | |||
5786 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5746 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5787 |
|
5747 | |||
5788 | @pyqtSignature("") |
|
5748 | @pyqtSignature("") | |
5789 | def on_ftpOkButton_clicked(self): |
|
5749 | def on_ftpOkButton_clicked(self): | |
5790 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5750 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5791 | self.create = True |
|
5751 | self.create = True | |
5792 | self.close() |
|
5752 | self.close() | |
5793 |
|
5753 | |||
5794 | @pyqtSignature("") |
|
5754 | @pyqtSignature("") | |
5795 | def on_ftpCancelButton_clicked(self): |
|
5755 | def on_ftpCancelButton_clicked(self): | |
5796 | self.create = False |
|
5756 | self.create = False | |
5797 | self.close() |
|
5757 | self.close() | |
5798 |
|
5758 | |||
5799 | def closeEvent(self, event): |
|
5759 | def closeEvent(self, event): | |
5800 | self.closed.emit() |
|
5760 | self.closed.emit() | |
5801 | event.accept() |
|
5761 | event.accept() | |
5802 |
|
5762 | |||
5803 | class ftpBuffer(): |
|
5763 | class ftpBuffer(): | |
5804 |
|
5764 | |||
5805 | server = None |
|
5765 | server = None | |
5806 | remotefolder = None |
|
5766 | remotefolder = None | |
5807 | username = None |
|
5767 | username = None | |
5808 | password = None |
|
5768 | password = None | |
5809 | ftp_wei = None |
|
5769 | ftp_wei = None | |
5810 | exp_code = None |
|
5770 | exp_code = None | |
5811 | sub_exp_code = None |
|
5771 | sub_exp_code = None | |
5812 | plot_pos = None |
|
5772 | plot_pos = None | |
5813 | create = False |
|
5773 | create = False | |
5814 | withoutconfig = False |
|
5774 | withoutconfig = False | |
5815 | createforView = False |
|
5775 | createforView = False | |
5816 | localfolder = None |
|
5776 | localfolder = None | |
5817 | extension = None |
|
5777 | extension = None | |
5818 | period = None |
|
5778 | period = None | |
5819 | protocol = None |
|
5779 | protocol = None | |
5820 |
|
5780 | |||
5821 | def __init__(self): |
|
5781 | def __init__(self): | |
5822 |
|
5782 | |||
5823 | self.create = False |
|
5783 | self.create = False | |
5824 | self.server = None |
|
5784 | self.server = None | |
5825 | self.remotefolder = None |
|
5785 | self.remotefolder = None | |
5826 | self.username = None |
|
5786 | self.username = None | |
5827 | self.password = None |
|
5787 | self.password = None | |
5828 | self.ftp_wei = None |
|
5788 | self.ftp_wei = None | |
5829 | self.exp_code = None |
|
5789 | self.exp_code = None | |
5830 | self.sub_exp_code = None |
|
5790 | self.sub_exp_code = None | |
5831 | self.plot_pos = None |
|
5791 | self.plot_pos = None | |
5832 | # self.create = False |
|
5792 | # self.create = False | |
5833 | self.localfolder = None |
|
5793 | self.localfolder = None | |
5834 | self.extension = None |
|
5794 | self.extension = None | |
5835 | self.period = None |
|
5795 | self.period = None | |
5836 | self.protocol = None |
|
5796 | self.protocol = None | |
5837 |
|
5797 | |||
5838 | def setwithoutconfiguration(self): |
|
5798 | def setwithoutconfiguration(self): | |
5839 |
|
5799 | |||
5840 | self.create = False |
|
5800 | self.create = False | |
5841 | self.server = "jro-app.igp.gob.pe" |
|
5801 | self.server = "jro-app.igp.gob.pe" | |
5842 | self.remotefolder = "/home/wmaster/graficos" |
|
5802 | self.remotefolder = "/home/wmaster/graficos" | |
5843 | self.username = "wmaster" |
|
5803 | self.username = "wmaster" | |
5844 | self.password = "mst2010vhf" |
|
5804 | self.password = "mst2010vhf" | |
5845 | self.withoutconfig = True |
|
5805 | self.withoutconfig = True | |
5846 | self.localfolder = './' |
|
5806 | self.localfolder = './' | |
5847 | self.extension = '.png' |
|
5807 | self.extension = '.png' | |
5848 | self.period = 60 |
|
5808 | self.period = 60 | |
5849 | self.protocol = 'ftp' |
|
5809 | self.protocol = 'ftp' | |
5850 | self.createforView = True |
|
5810 | self.createforView = True | |
5851 |
|
5811 | |||
5852 | if not self.ftp_wei: |
|
5812 | if not self.ftp_wei: | |
5853 | self.ftp_wei = 0 |
|
5813 | self.ftp_wei = 0 | |
5854 |
|
5814 | |||
5855 | if not self.exp_code: |
|
5815 | if not self.exp_code: | |
5856 | self.exp_code = 0 |
|
5816 | self.exp_code = 0 | |
5857 |
|
5817 | |||
5858 | if not self.sub_exp_code: |
|
5818 | if not self.sub_exp_code: | |
5859 | self.sub_exp_code = 0 |
|
5819 | self.sub_exp_code = 0 | |
5860 |
|
5820 | |||
5861 | if not self.plot_pos: |
|
5821 | if not self.plot_pos: | |
5862 | self.plot_pos = 0 |
|
5822 | self.plot_pos = 0 | |
5863 |
|
5823 | |||
5864 | 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'): |
|
5824 | 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'): | |
5865 |
|
5825 | |||
5866 | self.server = server |
|
5826 | self.server = server | |
5867 | self.remotefolder = remotefolder |
|
5827 | self.remotefolder = remotefolder | |
5868 | self.username = username |
|
5828 | self.username = username | |
5869 | self.password = password |
|
5829 | self.password = password | |
5870 | self.ftp_wei = ftp_wei |
|
5830 | self.ftp_wei = ftp_wei | |
5871 | self.exp_code = exp_code |
|
5831 | self.exp_code = exp_code | |
5872 | self.sub_exp_code = sub_exp_code |
|
5832 | self.sub_exp_code = sub_exp_code | |
5873 | self.plot_pos = plot_pos |
|
5833 | self.plot_pos = plot_pos | |
5874 | self.create = True |
|
5834 | self.create = True | |
5875 | self.withoutconfig = False |
|
5835 | self.withoutconfig = False | |
5876 | self.createforView = True |
|
5836 | self.createforView = True | |
5877 | self.localfolder = localfolder |
|
5837 | self.localfolder = localfolder | |
5878 | self.extension = extension |
|
5838 | self.extension = extension | |
5879 | self.period = period |
|
5839 | self.period = period | |
5880 | self.protocol = protocol |
|
5840 | self.protocol = protocol | |
5881 |
|
5841 | |||
5882 | def recover(self): |
|
5842 | def recover(self): | |
5883 |
|
5843 | |||
5884 | 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 |
|
5844 | 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 | |
5885 |
|
5845 | |||
5886 | class ShowMeConsole(QtCore.QObject): |
|
5846 | class ShowMeConsole(QtCore.QObject): | |
5887 |
|
5847 | |||
5888 | textWritten = QtCore.pyqtSignal(str) |
|
5848 | textWritten = QtCore.pyqtSignal(str) | |
5889 |
|
5849 | |||
5890 | def write(self, text): |
|
5850 | def write(self, text): | |
5891 |
|
5851 | |||
5892 | if len(text) == 0: |
|
5852 | if len(text) == 0: | |
5893 | self.textWritten.emit("\n") |
|
5853 | self.textWritten.emit("\n") | |
5894 | return |
|
5854 | return | |
5895 |
|
5855 | |||
5896 | if text[-1] == "\n": |
|
5856 | if text[-1] == "\n": | |
5897 | text = text[:-1] |
|
5857 | text = text[:-1] | |
5898 |
|
5858 | |||
5899 | self.textWritten.emit(str(text)) |
|
5859 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now