@@ -1,1097 +1,1097 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on September , 2012 |
|
2 | Created on September , 2012 | |
3 | @author: |
|
3 | @author: | |
4 | ''' |
|
4 | ''' | |
5 | from xml.etree.ElementTree import Element, SubElement |
|
5 | from xml.etree.ElementTree import Element, SubElement | |
6 | from xml.etree import ElementTree as ET |
|
6 | from xml.etree import ElementTree as ET | |
7 | from xml.dom import minidom |
|
7 | from xml.dom import minidom | |
8 |
|
8 | |||
9 | from model import * |
|
9 | from model import * | |
10 |
|
10 | |||
11 | try: |
|
11 | try: | |
12 | from gevent import sleep |
|
12 | from gevent import sleep | |
13 | except: |
|
13 | except: | |
14 | from time import sleep |
|
14 | from time import sleep | |
15 |
|
15 | |||
16 | import ast |
|
16 | import ast | |
17 |
|
17 | |||
18 | def prettify(elem): |
|
18 | def prettify(elem): | |
19 | """Return a pretty-printed XML string for the Element. |
|
19 | """Return a pretty-printed XML string for the Element. | |
20 | """ |
|
20 | """ | |
21 | rough_string = ET.tostring(elem, 'utf-8') |
|
21 | rough_string = ET.tostring(elem, 'utf-8') | |
22 | reparsed = minidom.parseString(rough_string) |
|
22 | reparsed = minidom.parseString(rough_string) | |
23 | return reparsed.toprettyxml(indent=" ") |
|
23 | return reparsed.toprettyxml(indent=" ") | |
24 |
|
24 | |||
25 | class ParameterConf(): |
|
25 | class ParameterConf(): | |
26 |
|
26 | |||
27 | id = None |
|
27 | id = None | |
28 | name = None |
|
28 | name = None | |
29 | value = None |
|
29 | value = None | |
30 | format = None |
|
30 | format = None | |
31 |
|
31 | |||
32 | __formated_value = None |
|
32 | __formated_value = None | |
33 |
|
33 | |||
34 | ELEMENTNAME = 'Parameter' |
|
34 | ELEMENTNAME = 'Parameter' | |
35 |
|
35 | |||
36 | def __init__(self): |
|
36 | def __init__(self): | |
37 |
|
37 | |||
38 | self.format = 'str' |
|
38 | self.format = 'str' | |
39 |
|
39 | |||
40 | def getElementName(self): |
|
40 | def getElementName(self): | |
41 |
|
41 | |||
42 | return self.ELEMENTNAME |
|
42 | return self.ELEMENTNAME | |
43 |
|
43 | |||
44 | def getValue(self): |
|
44 | def getValue(self): | |
45 |
|
45 | |||
46 | value = self.value |
|
46 | value = self.value | |
47 | format = self.format |
|
47 | format = self.format | |
48 |
|
48 | |||
49 | if self.__formated_value != None: |
|
49 | if self.__formated_value != None: | |
50 |
|
50 | |||
51 | return self.__formated_value |
|
51 | return self.__formated_value | |
52 |
|
52 | |||
53 | if format == 'str': |
|
53 | if format == 'str': | |
54 | self.__formated_value = str(value) |
|
54 | self.__formated_value = str(value) | |
55 | return self.__formated_value |
|
55 | return self.__formated_value | |
56 |
|
56 | |||
57 | if value == '': |
|
57 | if value == '': | |
58 | raise ValueError, "%s: This parameter value is empty" %self.name |
|
58 | raise ValueError, "%s: This parameter value is empty" %self.name | |
59 |
|
59 | |||
60 | if format == 'bool': |
|
60 | if format == 'bool': | |
61 | value = int(value) |
|
61 | value = int(value) | |
62 |
|
62 | |||
63 | if format == 'list': |
|
63 | if format == 'list': | |
64 | strList = value.split(',') |
|
64 | strList = value.split(',') | |
65 |
|
65 | |||
66 | self.__formated_value = strList |
|
66 | self.__formated_value = strList | |
67 |
|
67 | |||
68 | return self.__formated_value |
|
68 | return self.__formated_value | |
69 |
|
69 | |||
70 | if format == 'intlist': |
|
70 | if format == 'intlist': | |
71 | """ |
|
71 | """ | |
72 | Example: |
|
72 | Example: | |
73 | value = (0,1,2) |
|
73 | value = (0,1,2) | |
74 | """ |
|
74 | """ | |
75 | value = value.replace('(', '') |
|
75 | value = value.replace('(', '') | |
76 | value = value.replace(')', '') |
|
76 | value = value.replace(')', '') | |
77 |
|
77 | |||
78 | value = value.replace('[', '') |
|
78 | value = value.replace('[', '') | |
79 | value = value.replace(']', '') |
|
79 | value = value.replace(']', '') | |
80 |
|
80 | |||
81 | strList = value.split(',') |
|
81 | strList = value.split(',') | |
82 | intList = [int(float(x)) for x in strList] |
|
82 | intList = [int(float(x)) for x in strList] | |
83 |
|
83 | |||
84 | self.__formated_value = intList |
|
84 | self.__formated_value = intList | |
85 |
|
85 | |||
86 | return self.__formated_value |
|
86 | return self.__formated_value | |
87 |
|
87 | |||
88 | if format == 'floatlist': |
|
88 | if format == 'floatlist': | |
89 | """ |
|
89 | """ | |
90 | Example: |
|
90 | Example: | |
91 | value = (0.5, 1.4, 2.7) |
|
91 | value = (0.5, 1.4, 2.7) | |
92 | """ |
|
92 | """ | |
93 |
|
93 | |||
94 | value = value.replace('(', '') |
|
94 | value = value.replace('(', '') | |
95 | value = value.replace(')', '') |
|
95 | value = value.replace(')', '') | |
96 |
|
96 | |||
97 | value = value.replace('[', '') |
|
97 | value = value.replace('[', '') | |
98 | value = value.replace(']', '') |
|
98 | value = value.replace(']', '') | |
99 |
|
99 | |||
100 | strList = value.split(',') |
|
100 | strList = value.split(',') | |
101 | floatList = [float(x) for x in strList] |
|
101 | floatList = [float(x) for x in strList] | |
102 |
|
102 | |||
103 | self.__formated_value = floatList |
|
103 | self.__formated_value = floatList | |
104 |
|
104 | |||
105 | return self.__formated_value |
|
105 | return self.__formated_value | |
106 |
|
106 | |||
107 | if format == 'date': |
|
107 | if format == 'date': | |
108 | strList = value.split('/') |
|
108 | strList = value.split('/') | |
109 | intList = [int(x) for x in strList] |
|
109 | intList = [int(x) for x in strList] | |
110 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
110 | date = datetime.date(intList[0], intList[1], intList[2]) | |
111 |
|
111 | |||
112 | self.__formated_value = date |
|
112 | self.__formated_value = date | |
113 |
|
113 | |||
114 | return self.__formated_value |
|
114 | return self.__formated_value | |
115 |
|
115 | |||
116 | if format == 'time': |
|
116 | if format == 'time': | |
117 | strList = value.split(':') |
|
117 | strList = value.split(':') | |
118 | intList = [int(x) for x in strList] |
|
118 | intList = [int(x) for x in strList] | |
119 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
119 | time = datetime.time(intList[0], intList[1], intList[2]) | |
120 |
|
120 | |||
121 | self.__formated_value = time |
|
121 | self.__formated_value = time | |
122 |
|
122 | |||
123 | return self.__formated_value |
|
123 | return self.__formated_value | |
124 |
|
124 | |||
125 | if format == 'pairslist': |
|
125 | if format == 'pairslist': | |
126 | """ |
|
126 | """ | |
127 | Example: |
|
127 | Example: | |
128 | value = (0,1),(1,2) |
|
128 | value = (0,1),(1,2) | |
129 | """ |
|
129 | """ | |
130 |
|
130 | |||
131 | value = value.replace('(', '') |
|
131 | value = value.replace('(', '') | |
132 | value = value.replace(')', '') |
|
132 | value = value.replace(')', '') | |
133 |
|
133 | |||
134 | value = value.replace('[', '') |
|
134 | value = value.replace('[', '') | |
135 | value = value.replace(']', '') |
|
135 | value = value.replace(']', '') | |
136 |
|
136 | |||
137 | strList = value.split(',') |
|
137 | strList = value.split(',') | |
138 | intList = [int(item) for item in strList] |
|
138 | intList = [int(item) for item in strList] | |
139 | pairList = [] |
|
139 | pairList = [] | |
140 | for i in range(len(intList)/2): |
|
140 | for i in range(len(intList)/2): | |
141 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
141 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
142 |
|
142 | |||
143 | self.__formated_value = pairList |
|
143 | self.__formated_value = pairList | |
144 |
|
144 | |||
145 | return self.__formated_value |
|
145 | return self.__formated_value | |
146 |
|
146 | |||
147 | if format == 'multilist': |
|
147 | if format == 'multilist': | |
148 | """ |
|
148 | """ | |
149 | Example: |
|
149 | Example: | |
150 | value = (0,1,2),(3,4,5) |
|
150 | value = (0,1,2),(3,4,5) | |
151 | """ |
|
151 | """ | |
152 | multiList = ast.literal_eval(value) |
|
152 | multiList = ast.literal_eval(value) | |
153 |
|
153 | |||
154 | if type(multiList[0]) == int: |
|
154 | if type(multiList[0]) == int: | |
155 | multiList = ast.literal_eval("(" + value + ")") |
|
155 | multiList = ast.literal_eval("(" + value + ")") | |
156 |
|
156 | |||
157 | self.__formated_value = multiList |
|
157 | self.__formated_value = multiList | |
158 |
|
158 | |||
159 | return self.__formated_value |
|
159 | return self.__formated_value | |
160 |
|
160 | |||
161 | format_func = eval(format) |
|
161 | format_func = eval(format) | |
162 |
|
162 | |||
163 | self.__formated_value = format_func(value) |
|
163 | self.__formated_value = format_func(value) | |
164 |
|
164 | |||
165 | return self.__formated_value |
|
165 | return self.__formated_value | |
166 |
|
166 | |||
167 | def updateId(self, new_id): |
|
167 | def updateId(self, new_id): | |
168 |
|
168 | |||
169 | self.id = str(new_id) |
|
169 | self.id = str(new_id) | |
170 |
|
170 | |||
171 | def setup(self, id, name, value, format='str'): |
|
171 | def setup(self, id, name, value, format='str'): | |
172 |
|
172 | |||
173 | self.id = str(id) |
|
173 | self.id = str(id) | |
174 | self.name = name |
|
174 | self.name = name | |
175 | self.value = str(value) |
|
175 | self.value = str(value) | |
176 | self.format = str.lower(format) |
|
176 | self.format = str.lower(format) | |
177 |
|
177 | |||
178 | try: |
|
178 | try: | |
179 | self.getValue() |
|
179 | self.getValue() | |
180 | except: |
|
180 | except: | |
181 | return 0 |
|
181 | return 0 | |
182 |
|
182 | |||
183 | return 1 |
|
183 | return 1 | |
184 |
|
184 | |||
185 | def update(self, name, value, format='str'): |
|
185 | def update(self, name, value, format='str'): | |
186 |
|
186 | |||
187 | self.name = name |
|
187 | self.name = name | |
188 | self.value = str(value) |
|
188 | self.value = str(value) | |
189 | self.format = format |
|
189 | self.format = format | |
190 |
|
190 | |||
191 | def makeXml(self, opElement): |
|
191 | def makeXml(self, opElement): | |
192 |
|
192 | |||
193 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
193 | parmElement = SubElement(opElement, self.ELEMENTNAME) | |
194 | parmElement.set('id', str(self.id)) |
|
194 | parmElement.set('id', str(self.id)) | |
195 | parmElement.set('name', self.name) |
|
195 | parmElement.set('name', self.name) | |
196 | parmElement.set('value', self.value) |
|
196 | parmElement.set('value', self.value) | |
197 | parmElement.set('format', self.format) |
|
197 | parmElement.set('format', self.format) | |
198 |
|
198 | |||
199 | def readXml(self, parmElement): |
|
199 | def readXml(self, parmElement): | |
200 |
|
200 | |||
201 | self.id = parmElement.get('id') |
|
201 | self.id = parmElement.get('id') | |
202 | self.name = parmElement.get('name') |
|
202 | self.name = parmElement.get('name') | |
203 | self.value = parmElement.get('value') |
|
203 | self.value = parmElement.get('value') | |
204 | self.format = str.lower(parmElement.get('format')) |
|
204 | self.format = str.lower(parmElement.get('format')) | |
205 |
|
205 | |||
206 | #Compatible with old signal chain version |
|
206 | #Compatible with old signal chain version | |
207 | if self.format == 'int' and self.name == 'idfigure': |
|
207 | if self.format == 'int' and self.name == 'idfigure': | |
208 | self.name = 'id' |
|
208 | self.name = 'id' | |
209 |
|
209 | |||
210 | def printattr(self): |
|
210 | def printattr(self): | |
211 |
|
211 | |||
212 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
212 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) | |
213 |
|
213 | |||
214 | class OperationConf(): |
|
214 | class OperationConf(): | |
215 |
|
215 | |||
216 | id = None |
|
216 | id = None | |
217 | name = None |
|
217 | name = None | |
218 | priority = None |
|
218 | priority = None | |
219 | type = None |
|
219 | type = None | |
220 |
|
220 | |||
221 | parmConfObjList = [] |
|
221 | parmConfObjList = [] | |
222 |
|
222 | |||
223 | ELEMENTNAME = 'Operation' |
|
223 | ELEMENTNAME = 'Operation' | |
224 |
|
224 | |||
225 | def __init__(self): |
|
225 | def __init__(self): | |
226 |
|
226 | |||
227 | self.id = '0' |
|
227 | self.id = '0' | |
228 | self.name = None |
|
228 | self.name = None | |
229 | self.priority = None |
|
229 | self.priority = None | |
230 | self.type = 'self' |
|
230 | self.type = 'self' | |
231 |
|
231 | |||
232 |
|
232 | |||
233 | def __getNewId(self): |
|
233 | def __getNewId(self): | |
234 |
|
234 | |||
235 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
235 | return int(self.id)*10 + len(self.parmConfObjList) + 1 | |
236 |
|
236 | |||
237 | def updateId(self, new_id): |
|
237 | def updateId(self, new_id): | |
238 |
|
238 | |||
239 | self.id = str(new_id) |
|
239 | self.id = str(new_id) | |
240 |
|
240 | |||
241 | n = 1 |
|
241 | n = 1 | |
242 | for parmObj in self.parmConfObjList: |
|
242 | for parmObj in self.parmConfObjList: | |
243 |
|
243 | |||
244 | idParm = str(int(new_id)*10 + n) |
|
244 | idParm = str(int(new_id)*10 + n) | |
245 | parmObj.updateId(idParm) |
|
245 | parmObj.updateId(idParm) | |
246 |
|
246 | |||
247 | n += 1 |
|
247 | n += 1 | |
248 |
|
248 | |||
249 | def getElementName(self): |
|
249 | def getElementName(self): | |
250 |
|
250 | |||
251 | return self.ELEMENTNAME |
|
251 | return self.ELEMENTNAME | |
252 |
|
252 | |||
253 | def getParameterObjList(self): |
|
253 | def getParameterObjList(self): | |
254 |
|
254 | |||
255 | return self.parmConfObjList |
|
255 | return self.parmConfObjList | |
256 |
|
256 | |||
257 | def getParameterObj(self, parameterName): |
|
257 | def getParameterObj(self, parameterName): | |
258 |
|
258 | |||
259 | for parmConfObj in self.parmConfObjList: |
|
259 | for parmConfObj in self.parmConfObjList: | |
260 |
|
260 | |||
261 | if parmConfObj.name != parameterName: |
|
261 | if parmConfObj.name != parameterName: | |
262 | continue |
|
262 | continue | |
263 |
|
263 | |||
264 | return parmConfObj |
|
264 | return parmConfObj | |
265 |
|
265 | |||
266 | return None |
|
266 | return None | |
267 |
|
267 | |||
268 | def getParameterObjfromValue(self, parameterValue): |
|
268 | def getParameterObjfromValue(self, parameterValue): | |
269 |
|
269 | |||
270 | for parmConfObj in self.parmConfObjList: |
|
270 | for parmConfObj in self.parmConfObjList: | |
271 |
|
271 | |||
272 | if parmConfObj.getValue() != parameterValue: |
|
272 | if parmConfObj.getValue() != parameterValue: | |
273 | continue |
|
273 | continue | |
274 |
|
274 | |||
275 | return parmConfObj.getValue() |
|
275 | return parmConfObj.getValue() | |
276 |
|
276 | |||
277 | return None |
|
277 | return None | |
278 |
|
278 | |||
279 | def getParameterValue(self, parameterName): |
|
279 | def getParameterValue(self, parameterName): | |
280 |
|
280 | |||
281 | parameterObj = self.getParameterObj(parameterName) |
|
281 | parameterObj = self.getParameterObj(parameterName) | |
282 |
|
282 | |||
283 | # if not parameterObj: |
|
283 | # if not parameterObj: | |
284 | # return None |
|
284 | # return None | |
285 |
|
285 | |||
286 | value = parameterObj.getValue() |
|
286 | value = parameterObj.getValue() | |
287 |
|
287 | |||
288 | return value |
|
288 | return value | |
289 |
|
289 | |||
290 | def setup(self, id, name, priority, type): |
|
290 | def setup(self, id, name, priority, type): | |
291 |
|
291 | |||
292 | self.id = str(id) |
|
292 | self.id = str(id) | |
293 | self.name = name |
|
293 | self.name = name | |
294 | self.type = type |
|
294 | self.type = type | |
295 | self.priority = priority |
|
295 | self.priority = priority | |
296 |
|
296 | |||
297 | self.parmConfObjList = [] |
|
297 | self.parmConfObjList = [] | |
298 |
|
298 | |||
299 | def removeParameters(self): |
|
299 | def removeParameters(self): | |
300 |
|
300 | |||
301 | for obj in self.parmConfObjList: |
|
301 | for obj in self.parmConfObjList: | |
302 | del obj |
|
302 | del obj | |
303 |
|
303 | |||
304 | self.parmConfObjList = [] |
|
304 | self.parmConfObjList = [] | |
305 |
|
305 | |||
306 | def addParameter(self, name, value, format='str'): |
|
306 | def addParameter(self, name, value, format='str'): | |
307 |
|
307 | |||
308 | id = self.__getNewId() |
|
308 | id = self.__getNewId() | |
309 |
|
309 | |||
310 | parmConfObj = ParameterConf() |
|
310 | parmConfObj = ParameterConf() | |
311 | if not parmConfObj.setup(id, name, value, format): |
|
311 | if not parmConfObj.setup(id, name, value, format): | |
312 | return None |
|
312 | return None | |
313 |
|
313 | |||
314 | self.parmConfObjList.append(parmConfObj) |
|
314 | self.parmConfObjList.append(parmConfObj) | |
315 |
|
315 | |||
316 | return parmConfObj |
|
316 | return parmConfObj | |
317 |
|
317 | |||
318 | def changeParameter(self, name, value, format='str'): |
|
318 | def changeParameter(self, name, value, format='str'): | |
319 |
|
319 | |||
320 | parmConfObj = self.getParameterObj(name) |
|
320 | parmConfObj = self.getParameterObj(name) | |
321 | parmConfObj.update(name, value, format) |
|
321 | parmConfObj.update(name, value, format) | |
322 |
|
322 | |||
323 | return parmConfObj |
|
323 | return parmConfObj | |
324 |
|
324 | |||
325 | def makeXml(self, upElement): |
|
325 | def makeXml(self, upElement): | |
326 |
|
326 | |||
327 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
327 | opElement = SubElement(upElement, self.ELEMENTNAME) | |
328 | opElement.set('id', str(self.id)) |
|
328 | opElement.set('id', str(self.id)) | |
329 | opElement.set('name', self.name) |
|
329 | opElement.set('name', self.name) | |
330 | opElement.set('type', self.type) |
|
330 | opElement.set('type', self.type) | |
331 | opElement.set('priority', str(self.priority)) |
|
331 | opElement.set('priority', str(self.priority)) | |
332 |
|
332 | |||
333 | for parmConfObj in self.parmConfObjList: |
|
333 | for parmConfObj in self.parmConfObjList: | |
334 | parmConfObj.makeXml(opElement) |
|
334 | parmConfObj.makeXml(opElement) | |
335 |
|
335 | |||
336 | def readXml(self, opElement): |
|
336 | def readXml(self, opElement): | |
337 |
|
337 | |||
338 | self.id = opElement.get('id') |
|
338 | self.id = opElement.get('id') | |
339 | self.name = opElement.get('name') |
|
339 | self.name = opElement.get('name') | |
340 | self.type = opElement.get('type') |
|
340 | self.type = opElement.get('type') | |
341 | self.priority = opElement.get('priority') |
|
341 | self.priority = opElement.get('priority') | |
342 |
|
342 | |||
343 | #Compatible with old signal chain version |
|
343 | #Compatible with old signal chain version | |
344 | #Use of 'run' method instead 'init' |
|
344 | #Use of 'run' method instead 'init' | |
345 | if self.type == 'self' and self.name == 'init': |
|
345 | if self.type == 'self' and self.name == 'init': | |
346 | self.name = 'run' |
|
346 | self.name = 'run' | |
347 |
|
347 | |||
348 | self.parmConfObjList = [] |
|
348 | self.parmConfObjList = [] | |
349 |
|
349 | |||
350 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
350 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) | |
351 |
|
351 | |||
352 | for parmElement in parmElementList: |
|
352 | for parmElement in parmElementList: | |
353 | parmConfObj = ParameterConf() |
|
353 | parmConfObj = ParameterConf() | |
354 | parmConfObj.readXml(parmElement) |
|
354 | parmConfObj.readXml(parmElement) | |
355 |
|
355 | |||
356 | #Compatible with old signal chain version |
|
356 | #Compatible with old signal chain version | |
357 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
357 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER | |
358 | if self.type != 'self' and self.name == 'Plot': |
|
358 | if self.type != 'self' and self.name == 'Plot': | |
359 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
359 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': | |
360 | self.name = parmConfObj.value |
|
360 | self.name = parmConfObj.value | |
361 | continue |
|
361 | continue | |
362 |
|
362 | |||
363 | self.parmConfObjList.append(parmConfObj) |
|
363 | self.parmConfObjList.append(parmConfObj) | |
364 |
|
364 | |||
365 | def printattr(self): |
|
365 | def printattr(self): | |
366 |
|
366 | |||
367 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
367 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, | |
368 | self.id, |
|
368 | self.id, | |
369 | self.name, |
|
369 | self.name, | |
370 | self.type, |
|
370 | self.type, | |
371 | self.priority) |
|
371 | self.priority) | |
372 |
|
372 | |||
373 | for parmConfObj in self.parmConfObjList: |
|
373 | for parmConfObj in self.parmConfObjList: | |
374 | parmConfObj.printattr() |
|
374 | parmConfObj.printattr() | |
375 |
|
375 | |||
376 | def createObject(self): |
|
376 | def createObject(self): | |
377 |
|
377 | |||
378 | if self.type == 'self': |
|
378 | if self.type == 'self': | |
379 | raise ValueError, "This operation type cannot be created" |
|
379 | raise ValueError, "This operation type cannot be created" | |
380 |
|
380 | |||
381 | if self.type == 'external' or self.type == 'other': |
|
381 | if self.type == 'external' or self.type == 'other': | |
382 | className = eval(self.name) |
|
382 | className = eval(self.name) | |
383 | opObj = className() |
|
383 | opObj = className() | |
384 |
|
384 | |||
385 | return opObj |
|
385 | return opObj | |
386 |
|
386 | |||
387 | class ProcUnitConf(): |
|
387 | class ProcUnitConf(): | |
388 |
|
388 | |||
389 | id = None |
|
389 | id = None | |
390 | name = None |
|
390 | name = None | |
391 | datatype = None |
|
391 | datatype = None | |
392 | inputId = None |
|
392 | inputId = None | |
393 | parentId = None |
|
393 | parentId = None | |
394 |
|
394 | |||
395 | opConfObjList = [] |
|
395 | opConfObjList = [] | |
396 |
|
396 | |||
397 | procUnitObj = None |
|
397 | procUnitObj = None | |
398 | opObjList = [] |
|
398 | opObjList = [] | |
399 |
|
399 | |||
400 | ELEMENTNAME = 'ProcUnit' |
|
400 | ELEMENTNAME = 'ProcUnit' | |
401 |
|
401 | |||
402 | def __init__(self): |
|
402 | def __init__(self): | |
403 |
|
403 | |||
404 | self.id = None |
|
404 | self.id = None | |
405 | self.datatype = None |
|
405 | self.datatype = None | |
406 | self.name = None |
|
406 | self.name = None | |
407 | self.inputId = None |
|
407 | self.inputId = None | |
408 |
|
408 | |||
409 | self.opConfObjList = [] |
|
409 | self.opConfObjList = [] | |
410 |
|
410 | |||
411 | self.procUnitObj = None |
|
411 | self.procUnitObj = None | |
412 | self.opObjDict = {} |
|
412 | self.opObjDict = {} | |
413 |
|
413 | |||
414 | def __getPriority(self): |
|
414 | def __getPriority(self): | |
415 |
|
415 | |||
416 | return len(self.opConfObjList)+1 |
|
416 | return len(self.opConfObjList)+1 | |
417 |
|
417 | |||
418 | def __getNewId(self): |
|
418 | def __getNewId(self): | |
419 |
|
419 | |||
420 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
420 | return int(self.id)*10 + len(self.opConfObjList) + 1 | |
421 |
|
421 | |||
422 | def getElementName(self): |
|
422 | def getElementName(self): | |
423 |
|
423 | |||
424 | return self.ELEMENTNAME |
|
424 | return self.ELEMENTNAME | |
425 |
|
425 | |||
426 | def getId(self): |
|
426 | def getId(self): | |
427 |
|
427 | |||
428 | return self.id |
|
428 | return self.id | |
429 |
|
429 | |||
430 | def updateId(self, new_id, parentId=parentId): |
|
430 | def updateId(self, new_id, parentId=parentId): | |
431 |
|
431 | |||
432 |
|
432 | |||
433 | new_id = int(parentId)*10 + (int(self.id) % 10) |
|
433 | new_id = int(parentId)*10 + (int(self.id) % 10) | |
434 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) |
|
434 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) | |
435 |
|
435 | |||
436 | #If this proc unit has not inputs |
|
436 | #If this proc unit has not inputs | |
437 | if self.inputId == '0': |
|
437 | if self.inputId == '0': | |
438 | new_inputId = 0 |
|
438 | new_inputId = 0 | |
439 |
|
439 | |||
440 | n = 1 |
|
440 | n = 1 | |
441 | for opConfObj in self.opConfObjList: |
|
441 | for opConfObj in self.opConfObjList: | |
442 |
|
442 | |||
443 | idOp = str(int(new_id)*10 + n) |
|
443 | idOp = str(int(new_id)*10 + n) | |
444 | opConfObj.updateId(idOp) |
|
444 | opConfObj.updateId(idOp) | |
445 |
|
445 | |||
446 | n += 1 |
|
446 | n += 1 | |
447 |
|
447 | |||
448 | self.parentId = str(parentId) |
|
448 | self.parentId = str(parentId) | |
449 | self.id = str(new_id) |
|
449 | self.id = str(new_id) | |
450 | self.inputId = str(new_inputId) |
|
450 | self.inputId = str(new_inputId) | |
451 |
|
451 | |||
452 |
|
452 | |||
453 | def getInputId(self): |
|
453 | def getInputId(self): | |
454 |
|
454 | |||
455 | return self.inputId |
|
455 | return self.inputId | |
456 |
|
456 | |||
457 | def getOperationObjList(self): |
|
457 | def getOperationObjList(self): | |
458 |
|
458 | |||
459 | return self.opConfObjList |
|
459 | return self.opConfObjList | |
460 |
|
460 | |||
461 | def getOperationObj(self, name=None): |
|
461 | def getOperationObj(self, name=None): | |
462 |
|
462 | |||
463 | for opConfObj in self.opConfObjList: |
|
463 | for opConfObj in self.opConfObjList: | |
464 |
|
464 | |||
465 | if opConfObj.name != name: |
|
465 | if opConfObj.name != name: | |
466 | continue |
|
466 | continue | |
467 |
|
467 | |||
468 | return opConfObj |
|
468 | return opConfObj | |
469 |
|
469 | |||
470 | return None |
|
470 | return None | |
471 |
|
471 | |||
472 | def getOpObjfromParamValue(self, value=None): |
|
472 | def getOpObjfromParamValue(self, value=None): | |
473 |
|
473 | |||
474 | for opConfObj in self.opConfObjList: |
|
474 | for opConfObj in self.opConfObjList: | |
475 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
475 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: | |
476 | continue |
|
476 | continue | |
477 | return opConfObj |
|
477 | return opConfObj | |
478 | return None |
|
478 | return None | |
479 |
|
479 | |||
480 | def getProcUnitObj(self): |
|
480 | def getProcUnitObj(self): | |
481 |
|
481 | |||
482 | return self.procUnitObj |
|
482 | return self.procUnitObj | |
483 |
|
483 | |||
484 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
484 | def setup(self, id, name, datatype, inputId, parentId=None): | |
485 |
|
485 | |||
486 | #Compatible with old signal chain version |
|
486 | #Compatible with old signal chain version | |
487 | if datatype==None and name==None: |
|
487 | if datatype==None and name==None: | |
488 | raise ValueError, "datatype or name should be defined" |
|
488 | raise ValueError, "datatype or name should be defined" | |
489 |
|
489 | |||
490 | if name==None: |
|
490 | if name==None: | |
491 | if 'Proc' in datatype: |
|
491 | if 'Proc' in datatype: | |
492 | name = datatype |
|
492 | name = datatype | |
493 | else: |
|
493 | else: | |
494 | name = '%sProc' %(datatype) |
|
494 | name = '%sProc' %(datatype) | |
495 |
|
495 | |||
496 | if datatype==None: |
|
496 | if datatype==None: | |
497 | datatype = name.replace('Proc','') |
|
497 | datatype = name.replace('Proc','') | |
498 |
|
498 | |||
499 | self.id = str(id) |
|
499 | self.id = str(id) | |
500 | self.name = name |
|
500 | self.name = name | |
501 | self.datatype = datatype |
|
501 | self.datatype = datatype | |
502 | self.inputId = inputId |
|
502 | self.inputId = inputId | |
503 | self.parentId = parentId |
|
503 | self.parentId = parentId | |
504 |
|
504 | |||
505 | self.opConfObjList = [] |
|
505 | self.opConfObjList = [] | |
506 |
|
506 | |||
507 | self.addOperation(name='run', optype='self') |
|
507 | self.addOperation(name='run', optype='self') | |
508 |
|
508 | |||
509 | def removeOperations(self): |
|
509 | def removeOperations(self): | |
510 |
|
510 | |||
511 | for obj in self.opConfObjList: |
|
511 | for obj in self.opConfObjList: | |
512 | del obj |
|
512 | del obj | |
513 |
|
513 | |||
514 | self.opConfObjList = [] |
|
514 | self.opConfObjList = [] | |
515 | self.addOperation(name='run') |
|
515 | self.addOperation(name='run') | |
516 |
|
516 | |||
517 | def addParameter(self, **kwargs): |
|
517 | def addParameter(self, **kwargs): | |
518 | ''' |
|
518 | ''' | |
519 | Add parameters to "run" operation |
|
519 | Add parameters to "run" operation | |
520 | ''' |
|
520 | ''' | |
521 | opObj = self.opConfObjList[0] |
|
521 | opObj = self.opConfObjList[0] | |
522 |
|
522 | |||
523 | opObj.addParameter(**kwargs) |
|
523 | opObj.addParameter(**kwargs) | |
524 |
|
524 | |||
525 | return opObj |
|
525 | return opObj | |
526 |
|
526 | |||
527 | def addOperation(self, name, optype='self'): |
|
527 | def addOperation(self, name, optype='self'): | |
528 |
|
528 | |||
529 | id = self.__getNewId() |
|
529 | id = self.__getNewId() | |
530 | priority = self.__getPriority() |
|
530 | priority = self.__getPriority() | |
531 |
|
531 | |||
532 | opConfObj = OperationConf() |
|
532 | opConfObj = OperationConf() | |
533 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
533 | opConfObj.setup(id, name=name, priority=priority, type=optype) | |
534 |
|
534 | |||
535 | self.opConfObjList.append(opConfObj) |
|
535 | self.opConfObjList.append(opConfObj) | |
536 |
|
536 | |||
537 | return opConfObj |
|
537 | return opConfObj | |
538 |
|
538 | |||
539 | def makeXml(self, procUnitElement): |
|
539 | def makeXml(self, procUnitElement): | |
540 |
|
540 | |||
541 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
541 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) | |
542 | upElement.set('id', str(self.id)) |
|
542 | upElement.set('id', str(self.id)) | |
543 | upElement.set('name', self.name) |
|
543 | upElement.set('name', self.name) | |
544 | upElement.set('datatype', self.datatype) |
|
544 | upElement.set('datatype', self.datatype) | |
545 | upElement.set('inputId', str(self.inputId)) |
|
545 | upElement.set('inputId', str(self.inputId)) | |
546 |
|
546 | |||
547 | for opConfObj in self.opConfObjList: |
|
547 | for opConfObj in self.opConfObjList: | |
548 | opConfObj.makeXml(upElement) |
|
548 | opConfObj.makeXml(upElement) | |
549 |
|
549 | |||
550 | def readXml(self, upElement): |
|
550 | def readXml(self, upElement): | |
551 |
|
551 | |||
552 | self.id = upElement.get('id') |
|
552 | self.id = upElement.get('id') | |
553 | self.name = upElement.get('name') |
|
553 | self.name = upElement.get('name') | |
554 | self.datatype = upElement.get('datatype') |
|
554 | self.datatype = upElement.get('datatype') | |
555 | self.inputId = upElement.get('inputId') |
|
555 | self.inputId = upElement.get('inputId') | |
556 |
|
556 | |||
557 | if self.ELEMENTNAME == "ReadUnit": |
|
557 | if self.ELEMENTNAME == "ReadUnit": | |
558 | self.datatype = self.datatype.replace("Reader", "") |
|
558 | self.datatype = self.datatype.replace("Reader", "") | |
559 |
|
559 | |||
560 | if self.ELEMENTNAME == "ProcUnit": |
|
560 | if self.ELEMENTNAME == "ProcUnit": | |
561 | self.datatype = self.datatype.replace("Proc", "") |
|
561 | self.datatype = self.datatype.replace("Proc", "") | |
562 |
|
562 | |||
563 | if self.inputId == 'None': |
|
563 | if self.inputId == 'None': | |
564 | self.inputId = '0' |
|
564 | self.inputId = '0' | |
565 |
|
565 | |||
566 | self.opConfObjList = [] |
|
566 | self.opConfObjList = [] | |
567 |
|
567 | |||
568 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
568 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
569 |
|
569 | |||
570 | for opElement in opElementList: |
|
570 | for opElement in opElementList: | |
571 | opConfObj = OperationConf() |
|
571 | opConfObj = OperationConf() | |
572 | opConfObj.readXml(opElement) |
|
572 | opConfObj.readXml(opElement) | |
573 | self.opConfObjList.append(opConfObj) |
|
573 | self.opConfObjList.append(opConfObj) | |
574 |
|
574 | |||
575 | def printattr(self): |
|
575 | def printattr(self): | |
576 |
|
576 | |||
577 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
577 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, | |
578 | self.id, |
|
578 | self.id, | |
579 | self.name, |
|
579 | self.name, | |
580 | self.datatype, |
|
580 | self.datatype, | |
581 | self.inputId) |
|
581 | self.inputId) | |
582 |
|
582 | |||
583 | for opConfObj in self.opConfObjList: |
|
583 | for opConfObj in self.opConfObjList: | |
584 | opConfObj.printattr() |
|
584 | opConfObj.printattr() | |
585 |
|
585 | |||
586 | def createObjects(self): |
|
586 | def createObjects(self): | |
587 |
|
587 | |||
588 | className = eval(self.name) |
|
588 | className = eval(self.name) | |
589 | procUnitObj = className() |
|
589 | procUnitObj = className() | |
590 |
|
590 | |||
591 | for opConfObj in self.opConfObjList: |
|
591 | for opConfObj in self.opConfObjList: | |
592 |
|
592 | |||
593 | if opConfObj.type == 'self': |
|
593 | if opConfObj.type == 'self': | |
594 | continue |
|
594 | continue | |
595 |
|
595 | |||
596 | opObj = opConfObj.createObject() |
|
596 | opObj = opConfObj.createObject() | |
597 |
|
597 | |||
598 | self.opObjDict[opConfObj.id] = opObj |
|
598 | self.opObjDict[opConfObj.id] = opObj | |
599 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
599 | procUnitObj.addOperation(opObj, opConfObj.id) | |
600 |
|
600 | |||
601 | self.procUnitObj = procUnitObj |
|
601 | self.procUnitObj = procUnitObj | |
602 |
|
602 | |||
603 | return procUnitObj |
|
603 | return procUnitObj | |
604 |
|
604 | |||
605 | def run(self): |
|
605 | def run(self): | |
606 |
|
606 | |||
607 | finalSts = False |
|
607 | finalSts = False | |
608 |
|
608 | |||
609 | for opConfObj in self.opConfObjList: |
|
609 | for opConfObj in self.opConfObjList: | |
610 |
|
610 | |||
611 | kwargs = {} |
|
611 | kwargs = {} | |
612 | for parmConfObj in opConfObj.getParameterObjList(): |
|
612 | for parmConfObj in opConfObj.getParameterObjList(): | |
613 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
613 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': | |
614 | continue |
|
614 | continue | |
615 |
|
615 | |||
616 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
616 | kwargs[parmConfObj.name] = parmConfObj.getValue() | |
617 |
|
617 | |||
618 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
618 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) | |
619 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
619 | sts = self.procUnitObj.call(opType = opConfObj.type, | |
620 | opName = opConfObj.name, |
|
620 | opName = opConfObj.name, | |
621 | opId = opConfObj.id, |
|
621 | opId = opConfObj.id, | |
622 | **kwargs) |
|
622 | **kwargs) | |
623 | finalSts = finalSts or sts |
|
623 | finalSts = finalSts or sts | |
624 |
|
624 | |||
625 | return finalSts |
|
625 | return finalSts | |
626 |
|
626 | |||
627 | def close(self): |
|
627 | def close(self): | |
628 |
|
628 | |||
629 | for opConfObj in self.opConfObjList: |
|
629 | for opConfObj in self.opConfObjList: | |
630 | if opConfObj.type == 'self': |
|
630 | if opConfObj.type == 'self': | |
631 | continue |
|
631 | continue | |
632 |
|
632 | |||
633 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
633 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) | |
634 | opObj.close() |
|
634 | opObj.close() | |
635 |
|
635 | |||
636 | self.procUnitObj.close() |
|
636 | self.procUnitObj.close() | |
637 |
|
637 | |||
638 | return |
|
638 | return | |
639 |
|
639 | |||
640 | class ReadUnitConf(ProcUnitConf): |
|
640 | class ReadUnitConf(ProcUnitConf): | |
641 |
|
641 | |||
642 | path = None |
|
642 | path = None | |
643 | startDate = None |
|
643 | startDate = None | |
644 | endDate = None |
|
644 | endDate = None | |
645 | startTime = None |
|
645 | startTime = None | |
646 | endTime = None |
|
646 | endTime = None | |
647 |
|
647 | |||
648 | ELEMENTNAME = 'ReadUnit' |
|
648 | ELEMENTNAME = 'ReadUnit' | |
649 |
|
649 | |||
650 | def __init__(self): |
|
650 | def __init__(self): | |
651 |
|
651 | |||
652 | self.id = None |
|
652 | self.id = None | |
653 | self.datatype = None |
|
653 | self.datatype = None | |
654 | self.name = None |
|
654 | self.name = None | |
655 | self.inputId = None |
|
655 | self.inputId = None | |
656 |
|
656 | |||
657 | self.parentId = None |
|
657 | self.parentId = None | |
658 |
|
658 | |||
659 | self.opConfObjList = [] |
|
659 | self.opConfObjList = [] | |
660 | self.opObjList = [] |
|
660 | self.opObjList = [] | |
661 |
|
661 | |||
662 | def getElementName(self): |
|
662 | def getElementName(self): | |
663 |
|
663 | |||
664 | return self.ELEMENTNAME |
|
664 | return self.ELEMENTNAME | |
665 |
|
665 | |||
666 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
666 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): | |
667 |
|
667 | |||
668 | #Compatible with old signal chain version |
|
668 | #Compatible with old signal chain version | |
669 | if datatype==None and name==None: |
|
669 | if datatype==None and name==None: | |
670 | raise ValueError, "datatype or name should be defined" |
|
670 | raise ValueError, "datatype or name should be defined" | |
671 |
|
671 | |||
672 | if name==None: |
|
672 | if name==None: | |
673 | if 'Reader' in datatype: |
|
673 | if 'Reader' in datatype: | |
674 | name = datatype |
|
674 | name = datatype | |
675 | else: |
|
675 | else: | |
676 | name = '%sReader' %(datatype) |
|
676 | name = '%sReader' %(datatype) | |
677 |
|
677 | |||
678 | if datatype==None: |
|
678 | if datatype==None: | |
679 | datatype = name.replace('Reader','') |
|
679 | datatype = name.replace('Reader','') | |
680 |
|
680 | |||
681 | self.id = id |
|
681 | self.id = id | |
682 | self.name = name |
|
682 | self.name = name | |
683 | self.datatype = datatype |
|
683 | self.datatype = datatype | |
684 |
|
684 | |||
685 | self.path = path |
|
685 | self.path = path | |
686 | self.startDate = startDate |
|
686 | self.startDate = startDate | |
687 | self.endDate = endDate |
|
687 | self.endDate = endDate | |
688 | self.startTime = startTime |
|
688 | self.startTime = startTime | |
689 | self.endTime = endTime |
|
689 | self.endTime = endTime | |
690 |
|
690 | |||
691 | self.inputId = '0' |
|
691 | self.inputId = '0' | |
692 | self.parentId = parentId |
|
692 | self.parentId = parentId | |
693 |
|
693 | |||
694 | self.addRunOperation(**kwargs) |
|
694 | self.addRunOperation(**kwargs) | |
695 |
|
695 | |||
696 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): |
|
696 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): | |
697 |
|
697 | |||
698 | #Compatible with old signal chain version |
|
698 | #Compatible with old signal chain version | |
699 | if datatype==None and name==None: |
|
699 | if datatype==None and name==None: | |
700 | raise ValueError, "datatype or name should be defined" |
|
700 | raise ValueError, "datatype or name should be defined" | |
701 |
|
701 | |||
702 | if name==None: |
|
702 | if name==None: | |
703 | if 'Reader' in datatype: |
|
703 | if 'Reader' in datatype: | |
704 | name = datatype |
|
704 | name = datatype | |
705 | else: |
|
705 | else: | |
706 | name = '%sReader' %(datatype) |
|
706 | name = '%sReader' %(datatype) | |
707 |
|
707 | |||
708 | if datatype==None: |
|
708 | if datatype==None: | |
709 | datatype = name.replace('Reader','') |
|
709 | datatype = name.replace('Reader','') | |
710 |
|
710 | |||
711 | self.datatype = datatype |
|
711 | self.datatype = datatype | |
712 | self.name = name |
|
712 | self.name = name | |
713 | self.path = path |
|
713 | self.path = path | |
714 | self.startDate = startDate |
|
714 | self.startDate = startDate | |
715 | self.endDate = endDate |
|
715 | self.endDate = endDate | |
716 | self.startTime = startTime |
|
716 | self.startTime = startTime | |
717 | self.endTime = endTime |
|
717 | self.endTime = endTime | |
718 |
|
718 | |||
719 | self.inputId = '0' |
|
719 | self.inputId = '0' | |
720 | self.parentId = parentId |
|
720 | self.parentId = parentId | |
721 |
|
721 | |||
722 | self.updateRunOperation(**kwargs) |
|
722 | self.updateRunOperation(**kwargs) | |
723 |
|
723 | |||
724 | def addRunOperation(self, **kwargs): |
|
724 | def addRunOperation(self, **kwargs): | |
725 |
|
725 | |||
726 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
726 | opObj = self.addOperation(name = 'run', optype = 'self') | |
727 |
|
727 | |||
728 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
728 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
729 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
729 | opObj.addParameter(name='path' , value=self.path, format='str') | |
730 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
730 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
731 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
731 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
732 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
732 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
733 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
733 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
734 |
|
734 | |||
735 | for key, value in kwargs.items(): |
|
735 | for key, value in kwargs.items(): | |
736 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
736 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
737 |
|
737 | |||
738 | return opObj |
|
738 | return opObj | |
739 |
|
739 | |||
740 | def updateRunOperation(self, **kwargs): |
|
740 | def updateRunOperation(self, **kwargs): | |
741 |
|
741 | |||
742 | opObj = self.getOperationObj(name = 'run') |
|
742 | opObj = self.getOperationObj(name = 'run') | |
743 | opObj.removeParameters() |
|
743 | opObj.removeParameters() | |
744 |
|
744 | |||
745 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
745 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
746 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
746 | opObj.addParameter(name='path' , value=self.path, format='str') | |
747 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
747 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
748 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
748 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
749 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
749 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
750 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
750 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
751 |
|
751 | |||
752 | for key, value in kwargs.items(): |
|
752 | for key, value in kwargs.items(): | |
753 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
753 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
754 |
|
754 | |||
755 | return opObj |
|
755 | return opObj | |
756 |
|
756 | |||
757 | class Project(): |
|
757 | class Project(): | |
758 |
|
758 | |||
759 | id = None |
|
759 | id = None | |
760 | name = None |
|
760 | name = None | |
761 | description = None |
|
761 | description = None | |
762 | # readUnitConfObjList = None |
|
762 | # readUnitConfObjList = None | |
763 | procUnitConfObjDict = None |
|
763 | procUnitConfObjDict = None | |
764 |
|
764 | |||
765 | ELEMENTNAME = 'Project' |
|
765 | ELEMENTNAME = 'Project' | |
766 |
|
766 | |||
767 | def __init__(self, control=None, dataq=None): |
|
767 | def __init__(self, control=None, dataq=None): | |
768 |
|
768 | |||
769 | self.id = None |
|
769 | self.id = None | |
770 | self.name = None |
|
770 | self.name = None | |
771 | self.description = None |
|
771 | self.description = None | |
772 |
|
772 | |||
773 | self.procUnitConfObjDict = {} |
|
773 | self.procUnitConfObjDict = {} | |
774 |
|
774 | |||
775 | #global data_q |
|
775 | #global data_q | |
776 | #data_q = dataq |
|
776 | #data_q = dataq | |
777 |
|
777 | |||
778 | if control==None: |
|
778 | if control==None: | |
779 | control = {'stop':False,'pause':False} |
|
779 | control = {'stop':False,'pause':False} | |
780 |
|
780 | |||
781 | self.control = control |
|
781 | self.control = control | |
782 |
|
782 | |||
783 | def __getNewId(self): |
|
783 | def __getNewId(self): | |
784 |
|
784 | |||
785 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
785 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 | |
786 |
|
786 | |||
787 | return str(id) |
|
787 | return str(id) | |
788 |
|
788 | |||
789 | def getElementName(self): |
|
789 | def getElementName(self): | |
790 |
|
790 | |||
791 | return self.ELEMENTNAME |
|
791 | return self.ELEMENTNAME | |
792 |
|
792 | |||
793 | def getId(self): |
|
793 | def getId(self): | |
794 |
|
794 | |||
795 | return self.id |
|
795 | return self.id | |
796 |
|
796 | |||
797 | def updateId(self, new_id): |
|
797 | def updateId(self, new_id): | |
798 |
|
798 | |||
799 | self.id = str(new_id) |
|
799 | self.id = str(new_id) | |
800 |
|
800 | |||
801 | keyList = self.procUnitConfObjDict.keys() |
|
801 | keyList = self.procUnitConfObjDict.keys() | |
802 | keyList.sort() |
|
802 | keyList.sort() | |
803 |
|
803 | |||
804 | n = 1 |
|
804 | n = 1 | |
805 | newProcUnitConfObjDict = {} |
|
805 | newProcUnitConfObjDict = {} | |
806 |
|
806 | |||
807 | for procKey in keyList: |
|
807 | for procKey in keyList: | |
808 |
|
808 | |||
809 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
809 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
810 | idProcUnit = str(int(self.id)*10 + n) |
|
810 | idProcUnit = str(int(self.id)*10 + n) | |
811 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) |
|
811 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) | |
812 |
|
812 | |||
813 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj |
|
813 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj | |
814 | n += 1 |
|
814 | n += 1 | |
815 |
|
815 | |||
816 | self.procUnitConfObjDict = newProcUnitConfObjDict |
|
816 | self.procUnitConfObjDict = newProcUnitConfObjDict | |
817 |
|
817 | |||
818 | def setup(self, id, name, description): |
|
818 | def setup(self, id, name, description): | |
819 |
|
819 | |||
820 | self.id = str(id) |
|
820 | self.id = str(id) | |
821 | self.name = name |
|
821 | self.name = name | |
822 | self.description = description |
|
822 | self.description = description | |
823 |
|
823 | |||
824 | def update(self, name, description): |
|
824 | def update(self, name, description): | |
825 |
|
825 | |||
826 | self.name = name |
|
826 | self.name = name | |
827 | self.description = description |
|
827 | self.description = description | |
828 |
|
828 | |||
829 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
829 | def addReadUnit(self, datatype=None, name=None, **kwargs): | |
830 |
|
830 | |||
831 | idReadUnit = self.__getNewId() |
|
831 | idReadUnit = self.__getNewId() | |
832 |
|
832 | |||
833 | readUnitConfObj = ReadUnitConf() |
|
833 | readUnitConfObj = ReadUnitConf() | |
834 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) |
|
834 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) | |
835 |
|
835 | |||
836 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
836 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
837 |
|
837 | |||
838 | return readUnitConfObj |
|
838 | return readUnitConfObj | |
839 |
|
839 | |||
840 | def addProcUnit(self, inputId='0', datatype=None, name=None): |
|
840 | def addProcUnit(self, inputId='0', datatype=None, name=None): | |
841 |
|
841 | |||
842 | idProcUnit = self.__getNewId() |
|
842 | idProcUnit = self.__getNewId() | |
843 |
|
843 | |||
844 | procUnitConfObj = ProcUnitConf() |
|
844 | procUnitConfObj = ProcUnitConf() | |
845 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) |
|
845 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) | |
846 |
|
846 | |||
847 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
847 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
848 |
|
848 | |||
849 | return procUnitConfObj |
|
849 | return procUnitConfObj | |
850 |
|
850 | |||
851 | def removeProcUnit(self, id): |
|
851 | def removeProcUnit(self, id): | |
852 |
|
852 | |||
853 | if id in self.procUnitConfObjDict.keys(): |
|
853 | if id in self.procUnitConfObjDict.keys(): | |
854 | self.procUnitConfObjDict.pop(id) |
|
854 | self.procUnitConfObjDict.pop(id) | |
855 |
|
855 | |||
856 | def getReadUnitId(self): |
|
856 | def getReadUnitId(self): | |
857 |
|
857 | |||
858 | readUnitConfObj = self.getReadUnitObj() |
|
858 | readUnitConfObj = self.getReadUnitObj() | |
859 |
|
859 | |||
860 | return readUnitConfObj.id |
|
860 | return readUnitConfObj.id | |
861 |
|
861 | |||
862 | def getReadUnitObj(self): |
|
862 | def getReadUnitObj(self): | |
863 |
|
863 | |||
864 | for obj in self.procUnitConfObjDict.values(): |
|
864 | for obj in self.procUnitConfObjDict.values(): | |
865 | if obj.getElementName() == "ReadUnit": |
|
865 | if obj.getElementName() == "ReadUnit": | |
866 | return obj |
|
866 | return obj | |
867 |
|
867 | |||
868 | return None |
|
868 | return None | |
869 |
|
869 | |||
870 | def getProcUnitObj(self, id=None, name=None): |
|
870 | def getProcUnitObj(self, id=None, name=None): | |
871 |
|
871 | |||
872 | if id != None: |
|
872 | if id != None: | |
873 | return self.procUnitConfObjDict[id] |
|
873 | return self.procUnitConfObjDict[id] | |
874 |
|
874 | |||
875 | if name != None: |
|
875 | if name != None: | |
876 | return self.getProcUnitObjByName(name) |
|
876 | return self.getProcUnitObjByName(name) | |
877 |
|
877 | |||
878 | return None |
|
878 | return None | |
879 |
|
879 | |||
880 | def getProcUnitObjByName(self, name): |
|
880 | def getProcUnitObjByName(self, name): | |
881 |
|
881 | |||
882 | for obj in self.procUnitConfObjDict.values(): |
|
882 | for obj in self.procUnitConfObjDict.values(): | |
883 | if obj.name == name: |
|
883 | if obj.name == name: | |
884 | return obj |
|
884 | return obj | |
885 |
|
885 | |||
886 | return None |
|
886 | return None | |
887 |
|
887 | |||
888 | def procUnitItems(self): |
|
888 | def procUnitItems(self): | |
889 |
|
889 | |||
890 | return self.procUnitConfObjDict.items() |
|
890 | return self.procUnitConfObjDict.items() | |
891 |
|
891 | |||
892 | def makeXml(self): |
|
892 | def makeXml(self): | |
893 |
|
893 | |||
894 | projectElement = Element('Project') |
|
894 | projectElement = Element('Project') | |
895 | projectElement.set('id', str(self.id)) |
|
895 | projectElement.set('id', str(self.id)) | |
896 | projectElement.set('name', self.name) |
|
896 | projectElement.set('name', self.name) | |
897 | projectElement.set('description', self.description) |
|
897 | projectElement.set('description', self.description) | |
898 |
|
898 | |||
899 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
899 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
900 | procUnitConfObj.makeXml(projectElement) |
|
900 | procUnitConfObj.makeXml(projectElement) | |
901 |
|
901 | |||
902 | self.projectElement = projectElement |
|
902 | self.projectElement = projectElement | |
903 |
|
903 | |||
904 | def writeXml(self, filename): |
|
904 | def writeXml(self, filename): | |
905 |
|
905 | |||
906 | self.makeXml() |
|
906 | self.makeXml() | |
907 |
|
907 | |||
908 | #print prettify(self.projectElement) |
|
908 | #print prettify(self.projectElement) | |
909 |
|
909 | |||
910 | ElementTree(self.projectElement).write(filename, method='xml') |
|
910 | ElementTree(self.projectElement).write(filename, method='xml') | |
911 |
|
911 | |||
912 | def readXml(self, filename): |
|
912 | def readXml(self, filename): | |
913 |
|
913 | |||
914 | self.projectElement = None |
|
914 | self.projectElement = None | |
915 | self.procUnitConfObjDict = {} |
|
915 | self.procUnitConfObjDict = {} | |
916 |
|
916 | |||
917 | self.projectElement = ElementTree().parse(filename) |
|
917 | self.projectElement = ElementTree().parse(filename) | |
918 |
|
918 | |||
919 | self.project = self.projectElement.tag |
|
919 | self.project = self.projectElement.tag | |
920 |
|
920 | |||
921 | self.id = self.projectElement.get('id') |
|
921 | self.id = self.projectElement.get('id') | |
922 | self.name = self.projectElement.get('name') |
|
922 | self.name = self.projectElement.get('name') | |
923 | self.description = self.projectElement.get('description') |
|
923 | self.description = self.projectElement.get('description') | |
924 |
|
924 | |||
925 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
925 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) | |
926 |
|
926 | |||
927 | for readUnitElement in readUnitElementList: |
|
927 | for readUnitElement in readUnitElementList: | |
928 | readUnitConfObj = ReadUnitConf() |
|
928 | readUnitConfObj = ReadUnitConf() | |
929 | readUnitConfObj.readXml(readUnitElement) |
|
929 | readUnitConfObj.readXml(readUnitElement) | |
930 |
|
930 | |||
931 | if readUnitConfObj.parentId == None: |
|
931 | if readUnitConfObj.parentId == None: | |
932 | readUnitConfObj.parentId = self.id |
|
932 | readUnitConfObj.parentId = self.id | |
933 |
|
933 | |||
934 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
934 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
935 |
|
935 | |||
936 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
936 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) | |
937 |
|
937 | |||
938 | for procUnitElement in procUnitElementList: |
|
938 | for procUnitElement in procUnitElementList: | |
939 | procUnitConfObj = ProcUnitConf() |
|
939 | procUnitConfObj = ProcUnitConf() | |
940 | procUnitConfObj.readXml(procUnitElement) |
|
940 | procUnitConfObj.readXml(procUnitElement) | |
941 |
|
941 | |||
942 | if procUnitConfObj.parentId == None: |
|
942 | if procUnitConfObj.parentId == None: | |
943 | procUnitConfObj.parentId = self.id |
|
943 | procUnitConfObj.parentId = self.id | |
944 |
|
944 | |||
945 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
945 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
946 |
|
946 | |||
947 | def printattr(self): |
|
947 | def printattr(self): | |
948 |
|
948 | |||
949 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
949 | print "Project[%s]: name = %s, description = %s" %(self.id, | |
950 | self.name, |
|
950 | self.name, | |
951 | self.description) |
|
951 | self.description) | |
952 |
|
952 | |||
953 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
953 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
954 | procUnitConfObj.printattr() |
|
954 | procUnitConfObj.printattr() | |
955 |
|
955 | |||
956 | def createObjects(self): |
|
956 | def createObjects(self): | |
957 |
|
957 | |||
958 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
958 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
959 | procUnitConfObj.createObjects() |
|
959 | procUnitConfObj.createObjects() | |
960 |
|
960 | |||
961 | def __connect(self, objIN, thisObj): |
|
961 | def __connect(self, objIN, thisObj): | |
962 |
|
962 | |||
963 | thisObj.setInput(objIN.getOutputObj()) |
|
963 | thisObj.setInput(objIN.getOutputObj()) | |
964 |
|
964 | |||
965 | def connectObjects(self): |
|
965 | def connectObjects(self): | |
966 |
|
966 | |||
967 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
967 | for thisPUConfObj in self.procUnitConfObjDict.values(): | |
968 |
|
968 | |||
969 | inputId = thisPUConfObj.getInputId() |
|
969 | inputId = thisPUConfObj.getInputId() | |
970 |
|
970 | |||
971 | if int(inputId) == 0: |
|
971 | if int(inputId) == 0: | |
972 | continue |
|
972 | continue | |
973 |
|
973 | |||
974 | #Get input object |
|
974 | #Get input object | |
975 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
975 | puConfINObj = self.procUnitConfObjDict[inputId] | |
976 | puObjIN = puConfINObj.getProcUnitObj() |
|
976 | puObjIN = puConfINObj.getProcUnitObj() | |
977 |
|
977 | |||
978 | #Get current object |
|
978 | #Get current object | |
979 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
979 | thisPUObj = thisPUConfObj.getProcUnitObj() | |
980 |
|
980 | |||
981 | self.__connect(puObjIN, thisPUObj) |
|
981 | self.__connect(puObjIN, thisPUObj) | |
982 |
|
982 | |||
983 | def run(self): |
|
983 | def run(self): | |
984 |
|
984 | |||
985 |
|
985 | |||
986 |
print "*"* |
|
986 | print "*"*50 | |
987 | print " Starting SIGNAL CHAIN PROCESSING " |
|
987 | print " Starting SIGNAL CHAIN PROCESSING " | |
988 |
print "*"* |
|
988 | print "*"*50 | |
989 |
|
989 | |||
990 |
|
990 | |||
991 | keyList = self.procUnitConfObjDict.keys() |
|
991 | keyList = self.procUnitConfObjDict.keys() | |
992 | keyList.sort() |
|
992 | keyList.sort() | |
993 |
|
993 | |||
994 | while(True): |
|
994 | while(True): | |
995 |
|
995 | |||
996 | finalSts = False |
|
996 | finalSts = False | |
997 |
|
997 | |||
998 | for procKey in keyList: |
|
998 | for procKey in keyList: | |
999 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
999 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) | |
1000 |
|
1000 | |||
1001 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1001 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1002 | sts = procUnitConfObj.run() |
|
1002 | sts = procUnitConfObj.run() | |
1003 | finalSts = finalSts or sts |
|
1003 | finalSts = finalSts or sts | |
1004 |
|
1004 | |||
1005 | #If every process unit finished so end process |
|
1005 | #If every process unit finished so end process | |
1006 | if not(finalSts): |
|
1006 | if not(finalSts): | |
1007 | print "Every process unit have finished" |
|
1007 | print "Every process unit have finished" | |
1008 | break |
|
1008 | break | |
1009 |
|
1009 | |||
1010 | if self.control['pause']: |
|
1010 | if self.control['pause']: | |
1011 | print "Process suspended" |
|
1011 | print "Process suspended" | |
1012 |
|
1012 | |||
1013 | while True: |
|
1013 | while True: | |
1014 | sleep(0.1) |
|
1014 | sleep(0.1) | |
1015 |
|
1015 | |||
1016 | if not self.control['pause']: |
|
1016 | if not self.control['pause']: | |
1017 | break |
|
1017 | break | |
1018 |
|
1018 | |||
1019 | if self.control['stop']: |
|
1019 | if self.control['stop']: | |
1020 | break |
|
1020 | break | |
1021 | print "Process reinitialized" |
|
1021 | print "Process reinitialized" | |
1022 |
|
1022 | |||
1023 | if self.control['stop']: |
|
1023 | if self.control['stop']: | |
1024 | # print "Process stopped" |
|
1024 | # print "Process stopped" | |
1025 | break |
|
1025 | break | |
1026 |
|
1026 | |||
1027 | #Closing every process |
|
1027 | #Closing every process | |
1028 | for procKey in keyList: |
|
1028 | for procKey in keyList: | |
1029 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1029 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1030 | procUnitConfObj.close() |
|
1030 | procUnitConfObj.close() | |
1031 |
|
1031 | |||
1032 | print "Process finished" |
|
1032 | print "Process finished" | |
1033 |
|
1033 | |||
1034 | def start(self, filename): |
|
1034 | def start(self, filename): | |
1035 |
|
1035 | |||
1036 | self.writeXml(filename) |
|
1036 | self.writeXml(filename) | |
1037 | self.readXml(filename) |
|
1037 | self.readXml(filename) | |
1038 |
|
1038 | |||
1039 | self.createObjects() |
|
1039 | self.createObjects() | |
1040 | self.connectObjects() |
|
1040 | self.connectObjects() | |
1041 | self.run() |
|
1041 | self.run() | |
1042 |
|
1042 | |||
1043 | if __name__ == '__main__': |
|
1043 | if __name__ == '__main__': | |
1044 |
|
1044 | |||
1045 | desc = "Segundo Test" |
|
1045 | desc = "Segundo Test" | |
1046 | filename = "schain.xml" |
|
1046 | filename = "schain.xml" | |
1047 |
|
1047 | |||
1048 | controllerObj = Project() |
|
1048 | controllerObj = Project() | |
1049 |
|
1049 | |||
1050 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
1050 | controllerObj.setup(id = '191', name='test01', description=desc) | |
1051 |
|
1051 | |||
1052 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
1052 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
1053 | path='data/rawdata/', |
|
1053 | path='data/rawdata/', | |
1054 | startDate='2011/01/01', |
|
1054 | startDate='2011/01/01', | |
1055 | endDate='2012/12/31', |
|
1055 | endDate='2012/12/31', | |
1056 | startTime='00:00:00', |
|
1056 | startTime='00:00:00', | |
1057 | endTime='23:59:59', |
|
1057 | endTime='23:59:59', | |
1058 | online=1, |
|
1058 | online=1, | |
1059 | walk=1) |
|
1059 | walk=1) | |
1060 |
|
1060 | |||
1061 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
1061 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
1062 |
|
1062 | |||
1063 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
1063 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') | |
1064 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
1064 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') | |
1065 |
|
1065 | |||
1066 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
1066 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') | |
1067 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
1067 | opObj10.addParameter(name='minHei', value='90', format='float') | |
1068 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
1068 | opObj10.addParameter(name='maxHei', value='180', format='float') | |
1069 |
|
1069 | |||
1070 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
1070 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |
1071 | opObj12.addParameter(name='n', value='10', format='int') |
|
1071 | opObj12.addParameter(name='n', value='10', format='int') | |
1072 |
|
1072 | |||
1073 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
1073 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
1074 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
1074 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') | |
1075 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
1075 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') | |
1076 |
|
1076 | |||
1077 |
|
1077 | |||
1078 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1078 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1079 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
1079 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
1080 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
1080 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
1081 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
1081 | opObj11.addParameter(name='zmin', value='40', format='int') | |
1082 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
1082 | opObj11.addParameter(name='zmax', value='90', format='int') | |
1083 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1083 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
1084 |
|
1084 | |||
1085 | print "Escribiendo el archivo XML" |
|
1085 | print "Escribiendo el archivo XML" | |
1086 |
|
1086 | |||
1087 | controllerObj.writeXml(filename) |
|
1087 | controllerObj.writeXml(filename) | |
1088 |
|
1088 | |||
1089 | print "Leyendo el archivo XML" |
|
1089 | print "Leyendo el archivo XML" | |
1090 | controllerObj.readXml(filename) |
|
1090 | controllerObj.readXml(filename) | |
1091 | #controllerObj.printattr() |
|
1091 | #controllerObj.printattr() | |
1092 |
|
1092 | |||
1093 | controllerObj.createObjects() |
|
1093 | controllerObj.createObjects() | |
1094 | controllerObj.connectObjects() |
|
1094 | controllerObj.connectObjects() | |
1095 | controllerObj.run() |
|
1095 | controllerObj.run() | |
1096 |
|
1096 | |||
1097 | No newline at end of file |
|
1097 |
@@ -1,5811 +1,5854 | |||||
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.__enable = False |
|
143 | self.__enable = 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 | if len(self.__projectObjDict) == 0: |
|
259 | if len(self.__projectObjDict) == 0: | |
260 | outputstr = "First Create a Project then add Processing Unit" |
|
260 | outputstr = "First Create a Project then add Processing Unit" | |
261 | self.console.clear() |
|
261 | self.console.clear() | |
262 | self.console.append(outputstr) |
|
262 | self.console.append(outputstr) | |
263 | return 0 |
|
263 | return 0 | |
264 | else: |
|
264 | else: | |
265 | self.addPUWindow() |
|
265 | self.addPUWindow() | |
266 | self.console.clear() |
|
266 | self.console.clear() | |
267 | self.console.append("Please, Choose the type of Processing Unit") |
|
267 | self.console.append("Please, Choose the type of Processing Unit") | |
268 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
268 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
269 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
269 | 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 fits, you will start with processing unit Type SpectraHeis") |
|
270 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
271 |
|
271 | |||
272 |
|
272 | |||
273 | @pyqtSignature("") |
|
273 | @pyqtSignature("") | |
274 | def on_actionSaveToolbar_triggered(self): |
|
274 | def on_actionSaveToolbar_triggered(self): | |
275 | """ |
|
275 | """ | |
276 | Slot documentation goes here. |
|
276 | Slot documentation goes here. | |
277 | """ |
|
277 | """ | |
278 | self.saveProject() |
|
278 | self.saveProject() | |
279 |
|
279 | |||
280 | @pyqtSignature("") |
|
280 | @pyqtSignature("") | |
281 | def on_actionStarToolbar_triggered(self): |
|
281 | def on_actionStarToolbar_triggered(self): | |
282 | """ |
|
282 | """ | |
283 | Slot documentation goes here. |
|
283 | Slot documentation goes here. | |
284 | """ |
|
284 | """ | |
285 | self.playProject() |
|
285 | self.playProject() | |
286 |
|
286 | |||
287 | @pyqtSignature("") |
|
287 | @pyqtSignature("") | |
288 | def on_actionPauseToolbar_triggered(self): |
|
288 | def on_actionPauseToolbar_triggered(self): | |
289 |
|
289 | |||
290 | self.pauseProject() |
|
290 | self.pauseProject() | |
291 |
|
291 | |||
292 | @pyqtSignature("") |
|
292 | @pyqtSignature("") | |
293 | def on_actionStopToolbar_triggered(self): |
|
293 | def on_actionStopToolbar_triggered(self): | |
294 | """ |
|
294 | """ | |
295 | Slot documentation goes here. |
|
295 | Slot documentation goes here. | |
296 | """ |
|
296 | """ | |
297 | self.stopProject() |
|
297 | self.stopProject() | |
298 |
|
298 | |||
299 | @pyqtSignature("int") |
|
299 | @pyqtSignature("int") | |
300 | def on_proComReadMode_activated(self, index): |
|
300 | def on_proComReadMode_activated(self, index): | |
301 | """ |
|
301 | """ | |
302 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
302 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
303 | """ |
|
303 | """ | |
304 | if index == 0: |
|
304 | if index == 0: | |
305 | self.online = 0 |
|
305 | self.online = 0 | |
306 | self.proDelay.setText("0") |
|
306 | self.proDelay.setText("0") | |
307 | self.proSet.setText("") |
|
307 | self.proSet.setText("") | |
308 | self.proSet.setEnabled(False) |
|
308 | self.proSet.setEnabled(False) | |
309 | self.proDelay.setEnabled(False) |
|
309 | self.proDelay.setEnabled(False) | |
310 | elif index == 1: |
|
310 | elif index == 1: | |
311 | self.online = 1 |
|
311 | self.online = 1 | |
312 | self.proSet.setText("") |
|
312 | self.proSet.setText("") | |
313 | self.proDelay.setText("5") |
|
313 | self.proDelay.setText("5") | |
314 | self.proSet.setEnabled(True) |
|
314 | self.proSet.setEnabled(True) | |
315 | self.proDelay.setEnabled(True) |
|
315 | self.proDelay.setEnabled(True) | |
316 |
|
316 | |||
317 | @pyqtSignature("int") |
|
317 | @pyqtSignature("int") | |
318 | def on_proComDataType_activated(self, index): |
|
318 | def on_proComDataType_activated(self, index): | |
319 | """ |
|
319 | """ | |
320 | Voltage or Spectra |
|
320 | Voltage or Spectra | |
321 | """ |
|
321 | """ | |
322 | self.labelSet.show() |
|
322 | self.labelSet.show() | |
323 | self.proSet.show() |
|
323 | self.proSet.show() | |
324 |
|
324 | |||
325 | self.labExpLabel.show() |
|
325 | self.labExpLabel.show() | |
326 | self.proExpLabel.show() |
|
326 | self.proExpLabel.show() | |
327 |
|
327 | |||
328 | self.labelIPPKm.hide() |
|
328 | self.labelIPPKm.hide() | |
329 | self.proIPPKm.hide() |
|
329 | self.proIPPKm.hide() | |
330 |
|
330 | |||
331 | if index == 0: |
|
331 | if index == 0: | |
332 | extension = '.r' |
|
332 | extension = '.r' | |
333 | elif index == 1: |
|
333 | elif index == 1: | |
334 | extension = '.pdata' |
|
334 | extension = '.pdata' | |
335 | elif index == 2: |
|
335 | elif index == 2: | |
336 | extension = '.fits' |
|
336 | extension = '.fits' | |
337 | elif index == 3: |
|
337 | elif index == 3: | |
338 | extension = '.hdf5' |
|
338 | extension = '.hdf5' | |
339 |
|
339 | |||
340 | self.labelIPPKm.show() |
|
340 | self.labelIPPKm.show() | |
341 | self.proIPPKm.show() |
|
341 | self.proIPPKm.show() | |
342 |
|
342 | |||
343 | self.labelSet.hide() |
|
343 | self.labelSet.hide() | |
344 | self.proSet.hide() |
|
344 | self.proSet.hide() | |
345 |
|
345 | |||
346 | self.labExpLabel.hide() |
|
346 | self.labExpLabel.hide() | |
347 | self.proExpLabel.hide() |
|
347 | self.proExpLabel.hide() | |
348 |
|
348 | |||
349 | self.proDataType.setText(extension) |
|
349 | self.proDataType.setText(extension) | |
350 |
|
350 | |||
351 | @pyqtSignature("int") |
|
351 | @pyqtSignature("int") | |
352 | def on_proComWalk_activated(self, index): |
|
352 | def on_proComWalk_activated(self, index): | |
353 | """ |
|
353 | """ | |
354 |
|
354 | |||
355 | """ |
|
355 | """ | |
356 | if index == 0: |
|
356 | if index == 0: | |
357 | self.walk = 0 |
|
357 | self.walk = 0 | |
358 | elif index == 1: |
|
358 | elif index == 1: | |
359 | self.walk = 1 |
|
359 | self.walk = 1 | |
360 |
|
360 | |||
361 | @pyqtSignature("") |
|
361 | @pyqtSignature("") | |
362 | def on_proToolPath_clicked(self): |
|
362 | def on_proToolPath_clicked(self): | |
363 | """ |
|
363 | """ | |
364 | Choose your path |
|
364 | Choose your path | |
365 | """ |
|
365 | """ | |
366 |
|
366 | |||
367 | current_dpath = './' |
|
367 | current_dpath = './' | |
368 | if self.dataPath: |
|
368 | if self.dataPath: | |
369 | current_dpath = self.dataPath |
|
369 | current_dpath = self.dataPath | |
370 |
|
370 | |||
371 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
371 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
372 |
|
372 | |||
373 | #If it was canceled |
|
373 | #If it was canceled | |
374 | if not datapath: |
|
374 | if not datapath: | |
375 | return |
|
375 | return | |
376 |
|
376 | |||
377 | #If any change was done |
|
377 | #If any change was done | |
378 | if datapath == self.dataPath: |
|
378 | if datapath == self.dataPath: | |
379 | return |
|
379 | return | |
380 |
|
380 | |||
381 | self.proDataPath.setText(datapath) |
|
381 | self.proDataPath.setText(datapath) | |
382 |
|
382 | |||
383 | self.actionStart.setEnabled(False) |
|
383 | self.actionStart.setEnabled(False) | |
384 | self.actionStarToolbar.setEnabled(False) |
|
384 | self.actionStarToolbar.setEnabled(False) | |
385 | self.proOk.setEnabled(False) |
|
385 | self.proOk.setEnabled(False) | |
386 |
|
386 | |||
387 | self.proComStartDate.clear() |
|
387 | self.proComStartDate.clear() | |
388 | self.proComEndDate.clear() |
|
388 | self.proComEndDate.clear() | |
389 |
|
389 | |||
390 | if not os.path.exists(datapath): |
|
390 | if not os.path.exists(datapath): | |
391 |
|
391 | |||
392 | self.console.clear() |
|
392 | self.console.clear() | |
393 | self.console.append("Write a valid path") |
|
393 | self.console.append("Write a valid path") | |
394 | return |
|
394 | return | |
395 |
|
395 | |||
396 | self.dataPath = datapath |
|
396 | self.dataPath = datapath | |
397 |
|
397 | |||
398 | self.console.clear() |
|
398 | self.console.clear() | |
399 | self.console.append("Select the read mode and press 'load button'") |
|
399 | self.console.append("Select the read mode and press 'load button'") | |
400 |
|
400 | |||
401 |
|
401 | |||
402 | @pyqtSignature("") |
|
402 | @pyqtSignature("") | |
403 | def on_proLoadButton_clicked(self): |
|
403 | def on_proLoadButton_clicked(self): | |
404 |
|
404 | |||
405 | self.console.clear() |
|
405 | self.console.clear() | |
406 |
|
406 | |||
|
407 | if not self.getSelectedProjectObj(): | |||
|
408 | self.console.append("Please select a Project before Load files") | |||
|
409 | return | |||
|
410 | ||||
407 | parameter_list = self.checkInputsProject() |
|
411 | parameter_list = self.checkInputsProject() | |
408 |
|
412 | |||
409 | if not parameter_list[0]: |
|
413 | if not parameter_list[0]: | |
410 | return |
|
414 | return | |
411 |
|
415 | |||
412 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list |
|
416 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list | |
413 |
|
417 | |||
414 | if read_mode == "Offline": |
|
418 | if read_mode == "Offline": | |
415 | self.proComStartDate.clear() |
|
419 | self.proComStartDate.clear() | |
416 | self.proComEndDate.clear() |
|
420 | self.proComEndDate.clear() | |
417 | self.proComStartDate.setEnabled(True) |
|
421 | self.proComStartDate.setEnabled(True) | |
418 | self.proComEndDate.setEnabled(True) |
|
422 | self.proComEndDate.setEnabled(True) | |
419 | self.proStartTime.setEnabled(True) |
|
423 | self.proStartTime.setEnabled(True) | |
420 | self.proEndTime.setEnabled(True) |
|
424 | self.proEndTime.setEnabled(True) | |
421 | self.frame_2.setEnabled(True) |
|
425 | self.frame_2.setEnabled(True) | |
422 |
|
426 | |||
423 | if read_mode == "Online": |
|
427 | if read_mode == "Online": | |
424 | self.proComStartDate.addItem("1960/01/30") |
|
428 | self.proComStartDate.addItem("1960/01/30") | |
425 | self.proComEndDate.addItem("2018/12/31") |
|
429 | self.proComEndDate.addItem("2018/12/31") | |
426 | self.proComStartDate.setEnabled(False) |
|
430 | self.proComStartDate.setEnabled(False) | |
427 | self.proComEndDate.setEnabled(False) |
|
431 | self.proComEndDate.setEnabled(False) | |
428 | self.proStartTime.setEnabled(False) |
|
432 | self.proStartTime.setEnabled(False) | |
429 | self.proEndTime.setEnabled(False) |
|
433 | self.proEndTime.setEnabled(False) | |
430 | self.frame_2.setEnabled(True) |
|
434 | self.frame_2.setEnabled(True) | |
431 |
|
435 | |||
432 | self.loadDays(data_path, ext, walk, expLabel) |
|
436 | self.loadDays(data_path, ext, walk, expLabel) | |
433 |
|
437 | |||
434 | @pyqtSignature("int") |
|
438 | @pyqtSignature("int") | |
435 | def on_proComStartDate_activated(self, index): |
|
439 | def on_proComStartDate_activated(self, index): | |
436 | """ |
|
440 | """ | |
437 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
441 | SELECCION DEL RANGO DE FECHAS -START DATE | |
438 | """ |
|
442 | """ | |
439 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
443 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
440 |
|
444 | |||
441 | self.proComEndDate.clear() |
|
445 | self.proComEndDate.clear() | |
442 | for i in self.dateList[index:]: |
|
446 | for i in self.dateList[index:]: | |
443 | self.proComEndDate.addItem(i) |
|
447 | self.proComEndDate.addItem(i) | |
444 |
|
448 | |||
445 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
449 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
446 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
450 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
447 | else: |
|
451 | else: | |
448 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
452 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
449 |
|
453 | |||
450 | @pyqtSignature("int") |
|
454 | @pyqtSignature("int") | |
451 | def on_proComEndDate_activated(self, index): |
|
455 | def on_proComEndDate_activated(self, index): | |
452 | """ |
|
456 | """ | |
453 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
457 | SELECCION DEL RANGO DE FECHAS-END DATE | |
454 | """ |
|
458 | """ | |
455 | pass |
|
459 | pass | |
456 |
|
460 | |||
457 | @pyqtSignature("") |
|
461 | @pyqtSignature("") | |
458 | def on_proOk_clicked(self): |
|
462 | def on_proOk_clicked(self): | |
459 | """ |
|
463 | """ | |
460 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
464 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
461 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
465 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
462 | """ |
|
466 | """ | |
463 |
|
467 | |||
464 | self.actionStart.setEnabled(False) |
|
468 | self.actionStart.setEnabled(False) | |
465 | self.actionStarToolbar.setEnabled(False) |
|
469 | self.actionStarToolbar.setEnabled(False) | |
466 |
|
470 | |||
467 | self.console.clear() |
|
471 | self.console.clear() | |
468 |
|
472 | |||
469 | if self.create: |
|
473 | if self.create: | |
470 |
|
474 | |||
471 | projectId = self.__getNewProjectId() |
|
475 | projectId = self.__getNewProjectId() | |
472 |
|
476 | |||
473 | if not projectId: |
|
477 | if not projectId: | |
474 | return 0 |
|
478 | return 0 | |
475 |
|
479 | |||
476 | projectObjView = self.createProjectView(projectId) |
|
480 | projectObjView = self.createProjectView(projectId) | |
477 |
|
481 | |||
478 | if not projectObjView: |
|
482 | if not projectObjView: | |
479 | return 0 |
|
483 | return 0 | |
480 |
|
484 | |||
481 | readUnitObj = self.createReadUnitView(projectObjView) |
|
485 | readUnitObj = self.createReadUnitView(projectObjView) | |
482 |
|
486 | |||
483 | if not readUnitObj: |
|
487 | if not readUnitObj: | |
484 | return 0 |
|
488 | return 0 | |
485 |
|
489 | |||
486 | else: |
|
490 | else: | |
487 | projectObjView = self.updateProjectView() |
|
491 | projectObjView = self.updateProjectView() | |
488 |
|
492 | |||
489 | if not projectObjView: |
|
493 | if not projectObjView: | |
490 | return 0 |
|
494 | return 0 | |
491 |
|
495 | |||
492 | projectId = projectObjView.getId() |
|
496 | projectId = projectObjView.getId() | |
493 | idReadUnit = projectObjView.getReadUnitId() |
|
497 | idReadUnit = projectObjView.getReadUnitId() | |
494 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
498 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
495 |
|
499 | |||
496 | if not readUnitObj: |
|
500 | if not readUnitObj: | |
497 | return 0 |
|
501 | return 0 | |
498 |
|
502 | |||
499 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
503 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
500 | # Project Properties |
|
504 | # Project Properties | |
501 | self.refreshProjectProperties(projectObjView) |
|
505 | self.refreshProjectProperties(projectObjView) | |
502 | # Disable tabProject after finish the creation |
|
506 | # Disable tabProject after finish the creation | |
503 |
|
507 | |||
504 | self.actionStart.setEnabled(True) |
|
508 | self.actionStart.setEnabled(True) | |
505 | self.actionStarToolbar.setEnabled(True) |
|
509 | self.actionStarToolbar.setEnabled(True) | |
506 | self.console.clear() |
|
510 | self.console.clear() | |
507 | self.console.append("The project parameters were validated") |
|
511 | self.console.append("The project parameters were validated") | |
508 |
|
512 | |||
509 | return 1 |
|
513 | return 1 | |
510 |
|
514 | |||
511 | @pyqtSignature("") |
|
515 | @pyqtSignature("") | |
512 | def on_proClear_clicked(self): |
|
516 | def on_proClear_clicked(self): | |
513 |
|
517 | |||
514 | self.console.clear() |
|
518 | self.console.clear() | |
515 |
|
519 | |||
516 | @pyqtSignature("int") |
|
520 | @pyqtSignature("int") | |
517 | def on_volOpCebChannels_stateChanged(self, p0): |
|
521 | def on_volOpCebChannels_stateChanged(self, p0): | |
518 | """ |
|
522 | """ | |
519 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
523 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
520 | """ |
|
524 | """ | |
521 | if p0 == 2: |
|
525 | if p0 == 2: | |
522 | self.volOpComChannels.setEnabled(True) |
|
526 | self.volOpComChannels.setEnabled(True) | |
523 | self.volOpChannel.setEnabled(True) |
|
527 | self.volOpChannel.setEnabled(True) | |
524 |
|
528 | |||
525 | if p0 == 0: |
|
529 | if p0 == 0: | |
526 | self.volOpComChannels.setEnabled(False) |
|
530 | self.volOpComChannels.setEnabled(False) | |
527 | self.volOpChannel.setEnabled(False) |
|
531 | self.volOpChannel.setEnabled(False) | |
528 | self.volOpChannel.clear() |
|
532 | self.volOpChannel.clear() | |
529 |
|
533 | |||
530 | @pyqtSignature("int") |
|
534 | @pyqtSignature("int") | |
531 | def on_volOpCebHeights_stateChanged(self, p0): |
|
535 | def on_volOpCebHeights_stateChanged(self, p0): | |
532 | """ |
|
536 | """ | |
533 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
537 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
534 | """ |
|
538 | """ | |
535 | if p0 == 2: |
|
539 | if p0 == 2: | |
536 | self.volOpHeights.setEnabled(True) |
|
540 | self.volOpHeights.setEnabled(True) | |
537 | self.volOpComHeights.setEnabled(True) |
|
541 | self.volOpComHeights.setEnabled(True) | |
538 |
|
542 | |||
539 | if p0 == 0: |
|
543 | if p0 == 0: | |
540 | self.volOpHeights.setEnabled(False) |
|
544 | self.volOpHeights.setEnabled(False) | |
541 | self.volOpHeights.clear() |
|
545 | self.volOpHeights.clear() | |
542 | self.volOpComHeights.setEnabled(False) |
|
546 | self.volOpComHeights.setEnabled(False) | |
543 |
|
547 | |||
544 | @pyqtSignature("int") |
|
548 | @pyqtSignature("int") | |
545 | def on_volOpCebFilter_stateChanged(self, p0): |
|
549 | def on_volOpCebFilter_stateChanged(self, p0): | |
546 | """ |
|
550 | """ | |
547 | Name='Decoder', optype='other' |
|
551 | Name='Decoder', optype='other' | |
548 | """ |
|
552 | """ | |
549 | if p0 == 2: |
|
553 | if p0 == 2: | |
550 | self.volOpFilter.setEnabled(True) |
|
554 | self.volOpFilter.setEnabled(True) | |
551 |
|
555 | |||
552 | if p0 == 0: |
|
556 | if p0 == 0: | |
553 | self.volOpFilter.setEnabled(False) |
|
557 | self.volOpFilter.setEnabled(False) | |
554 | self.volOpFilter.clear() |
|
558 | self.volOpFilter.clear() | |
555 |
|
559 | |||
556 | @pyqtSignature("int") |
|
560 | @pyqtSignature("int") | |
557 | def on_volOpCebProfile_stateChanged(self, p0): |
|
561 | def on_volOpCebProfile_stateChanged(self, p0): | |
558 | """ |
|
562 | """ | |
559 | Check Box habilita ingreso del rango de Perfiles |
|
563 | Check Box habilita ingreso del rango de Perfiles | |
560 | """ |
|
564 | """ | |
561 | if p0 == 2: |
|
565 | if p0 == 2: | |
562 | self.volOpComProfile.setEnabled(True) |
|
566 | self.volOpComProfile.setEnabled(True) | |
563 | self.volOpProfile.setEnabled(True) |
|
567 | self.volOpProfile.setEnabled(True) | |
564 |
|
568 | |||
565 | if p0 == 0: |
|
569 | if p0 == 0: | |
566 | self.volOpComProfile.setEnabled(False) |
|
570 | self.volOpComProfile.setEnabled(False) | |
567 | self.volOpProfile.setEnabled(False) |
|
571 | self.volOpProfile.setEnabled(False) | |
568 | self.volOpProfile.clear() |
|
572 | self.volOpProfile.clear() | |
569 |
|
573 | |||
570 | @pyqtSignature("int") |
|
574 | @pyqtSignature("int") | |
571 | def on_volOpComProfile_activated(self, index): |
|
575 | def on_volOpComProfile_activated(self, index): | |
572 | """ |
|
576 | """ | |
573 | Check Box habilita ingreso del rango de Perfiles |
|
577 | Check Box habilita ingreso del rango de Perfiles | |
574 | """ |
|
578 | """ | |
575 | #Profile List |
|
579 | #Profile List | |
576 | if index == 0: |
|
580 | if index == 0: | |
577 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
581 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
578 |
|
582 | |||
579 | #Profile Range |
|
583 | #Profile Range | |
580 | if index == 1: |
|
584 | if index == 1: | |
581 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
585 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
582 |
|
586 | |||
583 | #Profile Range List |
|
587 | #Profile Range List | |
584 | if index == 2: |
|
588 | if index == 2: | |
585 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
589 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
586 |
|
590 | |||
587 | @pyqtSignature("int") |
|
591 | @pyqtSignature("int") | |
588 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
592 | def on_volOpCebDecodification_stateChanged(self, p0): | |
589 | """ |
|
593 | """ | |
590 | Check Box habilita |
|
594 | Check Box habilita | |
591 | """ |
|
595 | """ | |
592 | if p0 == 2: |
|
596 | if p0 == 2: | |
593 | self.volOpComCode.setEnabled(True) |
|
597 | self.volOpComCode.setEnabled(True) | |
594 | self.volOpComMode.setEnabled(True) |
|
598 | self.volOpComMode.setEnabled(True) | |
595 | if p0 == 0: |
|
599 | if p0 == 0: | |
596 | self.volOpComCode.setEnabled(False) |
|
600 | self.volOpComCode.setEnabled(False) | |
597 | self.volOpComMode.setEnabled(False) |
|
601 | self.volOpComMode.setEnabled(False) | |
598 |
|
602 | |||
599 | @pyqtSignature("int") |
|
603 | @pyqtSignature("int") | |
600 | def on_volOpComCode_activated(self, index): |
|
604 | def on_volOpComCode_activated(self, index): | |
601 | """ |
|
605 | """ | |
602 | Check Box habilita ingreso |
|
606 | Check Box habilita ingreso | |
603 | """ |
|
607 | """ | |
604 | if index == 13: |
|
608 | if index == 13: | |
605 | self.volOpCode.setEnabled(True) |
|
609 | self.volOpCode.setEnabled(True) | |
606 | else: |
|
610 | else: | |
607 | self.volOpCode.setEnabled(False) |
|
611 | self.volOpCode.setEnabled(False) | |
608 |
|
612 | |||
609 | if index == 0: |
|
613 | if index == 0: | |
610 | code = '' |
|
614 | code = '' | |
611 | self.volOpCode.setText(str(code)) |
|
615 | self.volOpCode.setText(str(code)) | |
612 | return |
|
616 | return | |
613 |
|
617 | |||
614 | if index == 1: |
|
618 | if index == 1: | |
615 | code = '(1,1,-1)' |
|
619 | code = '(1,1,-1)' | |
616 | nCode = '1' |
|
620 | nCode = '1' | |
617 | nBaud = '3' |
|
621 | nBaud = '3' | |
618 | if index == 2: |
|
622 | if index == 2: | |
619 | code = '(1,1,-1,1)' |
|
623 | code = '(1,1,-1,1)' | |
620 | nCode = '1' |
|
624 | nCode = '1' | |
621 | nBaud = '4' |
|
625 | nBaud = '4' | |
622 | if index == 3: |
|
626 | if index == 3: | |
623 | code = '(1,1,1,-1,1)' |
|
627 | code = '(1,1,1,-1,1)' | |
624 | nCode = '1' |
|
628 | nCode = '1' | |
625 | nBaud = '5' |
|
629 | nBaud = '5' | |
626 | if index == 4: |
|
630 | if index == 4: | |
627 | code = '(1,1,1,-1,-1,1,-1)' |
|
631 | code = '(1,1,1,-1,-1,1,-1)' | |
628 | nCode = '1' |
|
632 | nCode = '1' | |
629 | nBaud = '7' |
|
633 | nBaud = '7' | |
630 | if index == 5: |
|
634 | if index == 5: | |
631 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
635 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
632 | nCode = '1' |
|
636 | nCode = '1' | |
633 | nBaud = '11' |
|
637 | nBaud = '11' | |
634 | if index == 6: |
|
638 | if index == 6: | |
635 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
639 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
636 | nCode = '1' |
|
640 | nCode = '1' | |
637 | nBaud = '13' |
|
641 | nBaud = '13' | |
638 | if index == 7: |
|
642 | if index == 7: | |
639 | code = '(1,1,-1,-1,-1,1)' |
|
643 | code = '(1,1,-1,-1,-1,1)' | |
640 | nCode = '2' |
|
644 | nCode = '2' | |
641 | nBaud = '3' |
|
645 | nBaud = '3' | |
642 | if index == 8: |
|
646 | if index == 8: | |
643 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
647 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
644 | nCode = '2' |
|
648 | nCode = '2' | |
645 | nBaud = '4' |
|
649 | nBaud = '4' | |
646 | if index == 9: |
|
650 | if index == 9: | |
647 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
651 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
648 | nCode = '2' |
|
652 | nCode = '2' | |
649 | nBaud = '5' |
|
653 | nBaud = '5' | |
650 | if index == 10: |
|
654 | if index == 10: | |
651 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
655 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
652 | nCode = '2' |
|
656 | nCode = '2' | |
653 | nBaud = '7' |
|
657 | nBaud = '7' | |
654 | if index == 11: |
|
658 | if index == 11: | |
655 | code = '(1,1,1,-1,-1,-1,1,-1,-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 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
656 | nCode = '2' |
|
660 | nCode = '2' | |
657 | nBaud = '11' |
|
661 | nBaud = '11' | |
658 | if index == 12: |
|
662 | if index == 12: | |
659 | 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)' |
|
663 | 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)' | |
660 | nCode = '2' |
|
664 | nCode = '2' | |
661 | nBaud = '13' |
|
665 | nBaud = '13' | |
662 |
|
666 | |||
663 | code = ast.literal_eval(code) |
|
667 | code = ast.literal_eval(code) | |
664 | nCode = int(nCode) |
|
668 | nCode = int(nCode) | |
665 | nBaud = int(nBaud) |
|
669 | nBaud = int(nBaud) | |
666 |
|
670 | |||
667 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
671 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
668 |
|
672 | |||
669 | self.volOpCode.setText(str(code)) |
|
673 | self.volOpCode.setText(str(code)) | |
670 |
|
674 | |||
671 | @pyqtSignature("int") |
|
675 | @pyqtSignature("int") | |
672 | def on_volOpCebFlip_stateChanged(self, p0): |
|
676 | def on_volOpCebFlip_stateChanged(self, p0): | |
673 | """ |
|
677 | """ | |
674 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
678 | Check Box habilita ingresode del numero de Integraciones a realizar | |
675 | """ |
|
679 | """ | |
676 | if p0 == 2: |
|
680 | if p0 == 2: | |
677 | self.volOpFlip.setEnabled(True) |
|
681 | self.volOpFlip.setEnabled(True) | |
678 | if p0 == 0: |
|
682 | if p0 == 0: | |
679 | self.volOpFlip.setEnabled(False) |
|
683 | self.volOpFlip.setEnabled(False) | |
680 | self.volOpFlip.clear() |
|
684 | self.volOpFlip.clear() | |
681 |
|
685 | |||
682 | @pyqtSignature("int") |
|
686 | @pyqtSignature("int") | |
683 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
687 | def on_volOpCebCohInt_stateChanged(self, p0): | |
684 | """ |
|
688 | """ | |
685 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
689 | Check Box habilita ingresode del numero de Integraciones a realizar | |
686 | """ |
|
690 | """ | |
687 | if p0 == 2: |
|
691 | if p0 == 2: | |
688 | self.volOpCohInt.setEnabled(True) |
|
692 | self.volOpCohInt.setEnabled(True) | |
689 | if p0 == 0: |
|
693 | if p0 == 0: | |
690 | self.volOpCohInt.setEnabled(False) |
|
694 | self.volOpCohInt.setEnabled(False) | |
691 | self.volOpCohInt.clear() |
|
695 | self.volOpCohInt.clear() | |
692 |
|
696 | |||
693 | @pyqtSignature("int") |
|
697 | @pyqtSignature("int") | |
694 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
698 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
695 | """ |
|
699 | """ | |
696 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
700 | Check Box habilita ingresode del numero de Integraciones a realizar | |
697 | """ |
|
701 | """ | |
698 | if p0 == 2: |
|
702 | if p0 == 2: | |
699 | self.volOpRadarfrequency.setEnabled(True) |
|
703 | self.volOpRadarfrequency.setEnabled(True) | |
700 | if p0 == 0: |
|
704 | if p0 == 0: | |
701 | self.volOpRadarfrequency.clear() |
|
705 | self.volOpRadarfrequency.clear() | |
702 | self.volOpRadarfrequency.setEnabled(False) |
|
706 | self.volOpRadarfrequency.setEnabled(False) | |
703 |
|
707 | |||
704 | @pyqtSignature("") |
|
708 | @pyqtSignature("") | |
705 | def on_volOutputToolPath_clicked(self): |
|
709 | def on_volOutputToolPath_clicked(self): | |
706 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
710 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
707 | self.volOutputPath.setText(dirOutPath) |
|
711 | self.volOutputPath.setText(dirOutPath) | |
708 |
|
712 | |||
709 | @pyqtSignature("") |
|
713 | @pyqtSignature("") | |
710 | def on_specOutputToolPath_clicked(self): |
|
714 | def on_specOutputToolPath_clicked(self): | |
711 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
715 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
712 | self.specOutputPath.setText(dirOutPath) |
|
716 | self.specOutputPath.setText(dirOutPath) | |
713 |
|
717 | |||
714 | @pyqtSignature("") |
|
718 | @pyqtSignature("") | |
715 | def on_specHeisOutputToolPath_clicked(self): |
|
719 | def on_specHeisOutputToolPath_clicked(self): | |
716 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
720 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
717 | self.specHeisOutputPath.setText(dirOutPath) |
|
721 | self.specHeisOutputPath.setText(dirOutPath) | |
718 |
|
722 | |||
719 | @pyqtSignature("") |
|
723 | @pyqtSignature("") | |
720 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
724 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
721 |
|
725 | |||
722 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
726 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
723 | self.specHeisOutputMetada.setText(filename) |
|
727 | self.specHeisOutputMetada.setText(filename) | |
724 |
|
728 | |||
725 | @pyqtSignature("") |
|
729 | @pyqtSignature("") | |
726 | def on_volOpOk_clicked(self): |
|
730 | def on_volOpOk_clicked(self): | |
727 | """ |
|
731 | """ | |
728 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
732 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
729 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
733 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
730 | """ |
|
734 | """ | |
731 |
|
735 | |||
732 | checkPath = False |
|
736 | checkPath = False | |
733 |
|
737 | |||
734 | self.actionSaveToolbar.setEnabled(False) |
|
738 | self.actionSaveToolbar.setEnabled(False) | |
735 | self.actionStarToolbar.setEnabled(False) |
|
739 | self.actionStarToolbar.setEnabled(False) | |
736 |
|
740 | |||
737 | self.console.clear() |
|
741 | self.console.clear() | |
738 | self.console.append("Checking input parameters ...") |
|
742 | self.console.append("Checking input parameters ...") | |
739 |
|
743 | |||
740 | puObj = self.getSelectedItemObj() |
|
744 | puObj = self.getSelectedItemObj() | |
741 | puObj.removeOperations() |
|
745 | puObj.removeOperations() | |
742 |
|
746 | |||
743 | if self.volOpCebRadarfrequency.isChecked(): |
|
747 | if self.volOpCebRadarfrequency.isChecked(): | |
744 | value = str(self.volOpRadarfrequency.text()) |
|
748 | value = str(self.volOpRadarfrequency.text()) | |
745 | format = 'float' |
|
749 | format = 'float' | |
746 | name_operation = 'setRadarFrequency' |
|
750 | name_operation = 'setRadarFrequency' | |
747 | name_parameter = 'frequency' |
|
751 | name_parameter = 'frequency' | |
748 | if not value == "": |
|
752 | if not value == "": | |
749 | try: |
|
753 | try: | |
750 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 |
|
754 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
751 | except: |
|
755 | except: | |
752 | self.console.clear() |
|
756 | self.console.clear() | |
753 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
757 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
754 | return 0 |
|
758 | return 0 | |
755 |
|
759 | |||
756 | opObj = puObj.addOperation(name=name_operation) |
|
760 | opObj = puObj.addOperation(name=name_operation) | |
757 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): |
|
761 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): | |
758 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
762 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
759 | return 0 |
|
763 | return 0 | |
760 |
|
764 | |||
761 | if self.volOpCebChannels.isChecked(): |
|
765 | if self.volOpCebChannels.isChecked(): | |
762 | value = str(self.volOpChannel.text()) |
|
766 | value = str(self.volOpChannel.text()) | |
763 |
|
767 | |||
764 | if value == "": |
|
768 | if value == "": | |
765 | print "Please fill channel list" |
|
769 | print "Please fill channel list" | |
766 | return 0 |
|
770 | return 0 | |
767 |
|
771 | |||
768 | format = 'intlist' |
|
772 | format = 'intlist' | |
769 | if self.volOpComChannels.currentIndex() == 0: |
|
773 | if self.volOpComChannels.currentIndex() == 0: | |
770 | name_operation = "selectChannels" |
|
774 | name_operation = "selectChannels" | |
771 | name_parameter = 'channelList' |
|
775 | name_parameter = 'channelList' | |
772 | else: |
|
776 | else: | |
773 | name_operation = "selectChannelsByIndex" |
|
777 | name_operation = "selectChannelsByIndex" | |
774 | name_parameter = 'channelIndexList' |
|
778 | name_parameter = 'channelIndexList' | |
775 |
|
779 | |||
776 | opObj = puObj.addOperation(name=name_operation) |
|
780 | opObj = puObj.addOperation(name=name_operation) | |
777 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
781 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
778 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
782 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
779 | return 0 |
|
783 | return 0 | |
780 |
|
784 | |||
781 | if self.volOpCebHeights.isChecked(): |
|
785 | if self.volOpCebHeights.isChecked(): | |
782 | value = str(self.volOpHeights.text()) |
|
786 | value = str(self.volOpHeights.text()) | |
783 |
|
787 | |||
784 | if value == "": |
|
788 | if value == "": | |
785 | print "Please fill height range" |
|
789 | print "Please fill height range" | |
786 | return 0 |
|
790 | return 0 | |
787 |
|
791 | |||
788 | valueList = value.split(',') |
|
792 | valueList = value.split(',') | |
789 | format = 'float' |
|
793 | format = 'float' | |
790 | if self.volOpComHeights.currentIndex() == 0: |
|
794 | if self.volOpComHeights.currentIndex() == 0: | |
791 | name_operation = 'selectHeights' |
|
795 | name_operation = 'selectHeights' | |
792 | name_parameter1 = 'minHei' |
|
796 | name_parameter1 = 'minHei' | |
793 | name_parameter2 = 'maxHei' |
|
797 | name_parameter2 = 'maxHei' | |
794 | else: |
|
798 | else: | |
795 | name_operation = 'selectHeightsByIndex' |
|
799 | name_operation = 'selectHeightsByIndex' | |
796 | name_parameter1 = 'minIndex' |
|
800 | name_parameter1 = 'minIndex' | |
797 | name_parameter2 = 'maxIndex' |
|
801 | name_parameter2 = 'maxIndex' | |
798 |
|
802 | |||
799 | opObj = puObj.addOperation(name=name_operation) |
|
803 | opObj = puObj.addOperation(name=name_operation) | |
800 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
804 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
801 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
805 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
802 |
|
806 | |||
803 | if self.volOpCebFilter.isChecked(): |
|
807 | if self.volOpCebFilter.isChecked(): | |
804 | value = str(self.volOpFilter.text()) |
|
808 | value = str(self.volOpFilter.text()) | |
805 | if value == "": |
|
809 | if value == "": | |
806 | print "Please fill filter value" |
|
810 | print "Please fill filter value" | |
807 | return 0 |
|
811 | return 0 | |
808 |
|
812 | |||
809 | format = 'int' |
|
813 | format = 'int' | |
810 | name_operation = 'filterByHeights' |
|
814 | name_operation = 'filterByHeights' | |
811 | name_parameter = 'window' |
|
815 | name_parameter = 'window' | |
812 | opObj = puObj.addOperation(name=name_operation) |
|
816 | opObj = puObj.addOperation(name=name_operation) | |
813 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
817 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
814 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
818 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
815 | return 0 |
|
819 | return 0 | |
816 |
|
820 | |||
817 | if self.volOpCebProfile.isChecked(): |
|
821 | if self.volOpCebProfile.isChecked(): | |
818 | value = str(self.volOpProfile.text()) |
|
822 | value = str(self.volOpProfile.text()) | |
819 |
|
823 | |||
820 | if value == "": |
|
824 | if value == "": | |
821 | print "Please fill profile value" |
|
825 | print "Please fill profile value" | |
822 | return 0 |
|
826 | return 0 | |
823 |
|
827 | |||
824 | format = 'intlist' |
|
828 | format = 'intlist' | |
825 | optype = 'other' |
|
829 | optype = 'other' | |
826 | name_operation = 'ProfileSelector' |
|
830 | name_operation = 'ProfileSelector' | |
827 | if self.volOpComProfile.currentIndex() == 0: |
|
831 | if self.volOpComProfile.currentIndex() == 0: | |
828 | name_parameter = 'profileList' |
|
832 | name_parameter = 'profileList' | |
829 | if self.volOpComProfile.currentIndex() == 1: |
|
833 | if self.volOpComProfile.currentIndex() == 1: | |
830 | name_parameter = 'profileRangeList' |
|
834 | name_parameter = 'profileRangeList' | |
831 | if self.volOpComProfile.currentIndex() == 2: |
|
835 | if self.volOpComProfile.currentIndex() == 2: | |
832 | name_parameter = 'rangeList' |
|
836 | name_parameter = 'rangeList' | |
833 |
|
837 | |||
834 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
838 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
835 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
839 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
836 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
840 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
837 | return 0 |
|
841 | return 0 | |
838 |
|
842 | |||
839 | if self.volOpCebDecodification.isChecked(): |
|
843 | if self.volOpCebDecodification.isChecked(): | |
840 | name_operation = 'Decoder' |
|
844 | name_operation = 'Decoder' | |
841 |
|
845 | |||
842 | #User defined |
|
846 | #User defined | |
843 | nBaud = None |
|
847 | nBaud = None | |
844 | nCode = None |
|
848 | nCode = None | |
845 |
|
849 | |||
846 | code = str(self.volOpCode.text()) |
|
850 | code = str(self.volOpCode.text()) | |
847 | try: |
|
851 | try: | |
848 | code_tmp = ast.literal_eval(code) |
|
852 | code_tmp = ast.literal_eval(code) | |
849 | except: |
|
853 | except: | |
850 | code_tmp = [] |
|
854 | code_tmp = [] | |
851 |
|
855 | |||
852 | if len(code_tmp) < 1: |
|
856 | if len(code_tmp) < 1: | |
853 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
857 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
854 | return 0 |
|
858 | return 0 | |
855 |
|
859 | |||
856 | if type(code_tmp) not in (tuple, list): |
|
860 | if type(code_tmp) not in (tuple, list): | |
857 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
861 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
858 | return 0 |
|
862 | return 0 | |
859 |
|
863 | |||
860 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] |
|
864 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] | |
861 | nBaud = len(code_tmp[0]) |
|
865 | nBaud = len(code_tmp[0]) | |
862 | nCode = len(code_tmp) |
|
866 | nCode = len(code_tmp) | |
863 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] |
|
867 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] | |
864 | nBaud = len(code_tmp[0]) |
|
868 | nBaud = len(code_tmp[0]) | |
865 | nCode = 1 |
|
869 | nCode = 1 | |
866 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) |
|
870 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) | |
867 | nBaud = len(code_tmp) |
|
871 | nBaud = len(code_tmp) | |
868 | nCode = 1 |
|
872 | nCode = 1 | |
869 | else: |
|
873 | else: | |
870 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
874 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
871 | return 0 |
|
875 | return 0 | |
872 |
|
876 | |||
873 | if not nBaud or not nCode: |
|
877 | if not nBaud or not nCode: | |
874 | self.console.append("Please write a right value for Code") |
|
878 | self.console.append("Please write a right value for Code") | |
875 | return 0 |
|
879 | return 0 | |
876 |
|
880 | |||
877 | opObj = puObj.addOperation(name='Decoder', optype='other') |
|
881 | opObj = puObj.addOperation(name='Decoder', optype='other') | |
878 |
|
882 | |||
879 | code = code.replace("(", "") |
|
883 | code = code.replace("(", "") | |
880 | code = code.replace(")", "") |
|
884 | code = code.replace(")", "") | |
881 | code = code.replace("[", "") |
|
885 | code = code.replace("[", "") | |
882 | code = code.replace("]", "") |
|
886 | code = code.replace("]", "") | |
883 |
|
887 | |||
884 | if not opObj.addParameter(name='code', value=code, format='intlist'): |
|
888 | if not opObj.addParameter(name='code', value=code, format='intlist'): | |
885 | self.console.append("Please write a right value for Code") |
|
889 | self.console.append("Please write a right value for Code") | |
886 | return 0 |
|
890 | return 0 | |
887 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): |
|
891 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): | |
888 | self.console.append("Please write a right value for Code") |
|
892 | self.console.append("Please write a right value for Code") | |
889 | return 0 |
|
893 | return 0 | |
890 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): |
|
894 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): | |
891 | self.console.append("Please write a right value for Code") |
|
895 | self.console.append("Please write a right value for Code") | |
892 | return 0 |
|
896 | return 0 | |
893 |
|
897 | |||
894 | name_parameter = 'mode' |
|
898 | name_parameter = 'mode' | |
895 | format = 'int' |
|
899 | format = 'int' | |
896 |
|
900 | |||
897 | value = str(self.volOpComMode.currentIndex()) |
|
901 | value = str(self.volOpComMode.currentIndex()) | |
898 |
|
902 | |||
899 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
903 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
900 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
904 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
901 | return 0 |
|
905 | return 0 | |
902 |
|
906 | |||
903 |
|
907 | |||
904 | if self.volOpCebFlip.isChecked(): |
|
908 | if self.volOpCebFlip.isChecked(): | |
905 | name_operation = 'deFlip' |
|
909 | name_operation = 'deFlip' | |
906 | optype = 'self' |
|
910 | optype = 'self' | |
907 |
|
911 | |||
908 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
912 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
909 |
|
913 | |||
910 | name_parameter = 'channelList' |
|
914 | name_parameter = 'channelList' | |
911 | format = 'intlist' |
|
915 | format = 'intlist' | |
912 | value = str(self.volOpFlip.text()) |
|
916 | value = str(self.volOpFlip.text()) | |
913 |
|
917 | |||
914 | if value != "": |
|
918 | if value != "": | |
915 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
919 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
916 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
920 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
917 | return 0 |
|
921 | return 0 | |
918 |
|
922 | |||
919 | if self.volOpCebCohInt.isChecked(): |
|
923 | if self.volOpCebCohInt.isChecked(): | |
920 | name_operation = 'CohInt' |
|
924 | name_operation = 'CohInt' | |
921 | optype = 'other' |
|
925 | optype = 'other' | |
922 | value = str(self.volOpCohInt.text()) |
|
926 | value = str(self.volOpCohInt.text()) | |
923 |
|
927 | |||
924 | if value == "": |
|
928 | if value == "": | |
925 | print "Please fill number of coherent integrations" |
|
929 | print "Please fill number of coherent integrations" | |
926 | return 0 |
|
930 | return 0 | |
927 |
|
931 | |||
928 | name_parameter = 'n' |
|
932 | name_parameter = 'n' | |
929 | format = 'float' |
|
933 | format = 'float' | |
930 |
|
934 | |||
931 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
935 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
932 |
|
936 | |||
933 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
937 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
934 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
938 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
935 | return 0 |
|
939 | return 0 | |
936 |
|
940 | |||
937 | if self.volGraphCebshow.isChecked(): |
|
941 | if self.volGraphCebshow.isChecked(): | |
938 | name_operation = 'Scope' |
|
942 | name_operation = 'Scope' | |
939 | optype = 'other' |
|
943 | optype = 'other' | |
940 | name_parameter = 'type' |
|
944 | name_parameter = 'type' | |
941 | value = 'Scope' |
|
945 | value = 'Scope' | |
942 | if self.idImagscope == 0: |
|
946 | if self.idImagscope == 0: | |
943 | self.idImagscope = 100 |
|
947 | self.idImagscope = 100 | |
944 | else: |
|
948 | else: | |
945 | self.idImagscope = self.idImagscope + 1 |
|
949 | self.idImagscope = self.idImagscope + 1 | |
946 |
|
950 | |||
947 | name_parameter1 = 'id' |
|
951 | name_parameter1 = 'id' | |
948 | value1 = int(self.idImagscope) |
|
952 | value1 = int(self.idImagscope) | |
949 | format1 = 'int' |
|
953 | format1 = 'int' | |
950 | format = 'str' |
|
954 | format = 'str' | |
951 |
|
955 | |||
952 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
956 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
953 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
957 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
954 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
958 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
955 |
|
959 | |||
956 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
960 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
957 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
961 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
958 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
962 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
959 |
|
963 | |||
960 | if channelList: |
|
964 | if channelList: | |
961 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
965 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
962 |
|
966 | |||
963 | if xvalue: |
|
967 | if xvalue: | |
964 | xvalueList = xvalue.split(',') |
|
968 | xvalueList = xvalue.split(',') | |
965 | try: |
|
969 | try: | |
966 | value0 = float(xvalueList[0]) |
|
970 | value0 = float(xvalueList[0]) | |
967 | value1 = float(xvalueList[1]) |
|
971 | value1 = float(xvalueList[1]) | |
968 | except: |
|
972 | except: | |
969 | return 0 |
|
973 | return 0 | |
970 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
974 | opObj.addParameter(name='xmin', value=value0, format='float') | |
971 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
975 | opObj.addParameter(name='xmax', value=value1, format='float') | |
972 |
|
976 | |||
973 |
|
977 | |||
974 | if not yvalue == "": |
|
978 | if not yvalue == "": | |
975 | yvalueList = yvalue.split(",") |
|
979 | yvalueList = yvalue.split(",") | |
976 | try: |
|
980 | try: | |
977 | value0 = int(yvalueList[0]) |
|
981 | value0 = int(yvalueList[0]) | |
978 | value1 = int(yvalueList[1]) |
|
982 | value1 = int(yvalueList[1]) | |
979 | except: |
|
983 | except: | |
980 | return 0 |
|
984 | return 0 | |
981 |
|
985 | |||
982 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
986 | opObj.addParameter(name='ymin', value=value0, format='int') | |
983 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
987 | opObj.addParameter(name='ymax', value=value1, format='int') | |
984 |
|
988 | |||
985 | if self.volGraphCebSave.isChecked(): |
|
989 | if self.volGraphCebSave.isChecked(): | |
986 | checkPath = True |
|
990 | checkPath = True | |
987 | opObj.addParameter(name='save', value='1', format='int') |
|
991 | opObj.addParameter(name='save', value='1', format='int') | |
988 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') |
|
992 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') | |
989 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
993 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
990 | if value: |
|
994 | if value: | |
991 | opObj.addParameter(name='figfile', value=value, format='str') |
|
995 | opObj.addParameter(name='figfile', value=value, format='str') | |
992 |
|
996 | |||
993 | localfolder = None |
|
997 | localfolder = None | |
994 | if checkPath: |
|
998 | if checkPath: | |
995 | localfolder = str(self.volGraphPath.text()) |
|
999 | localfolder = str(self.volGraphPath.text()) | |
996 | if localfolder == '': |
|
1000 | if localfolder == '': | |
997 | self.console.clear() |
|
1001 | self.console.clear() | |
998 | self.console.append("Graphic path should be defined") |
|
1002 | self.console.append("Graphic path should be defined") | |
999 | return 0 |
|
1003 | return 0 | |
1000 |
|
1004 | |||
1001 | # if something happend |
|
1005 | # if something happend | |
1002 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1006 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1003 | if parms_ok: |
|
1007 | if parms_ok: | |
1004 | name_operation = 'VoltageWriter' |
|
1008 | name_operation = 'VoltageWriter' | |
1005 | optype = 'other' |
|
1009 | optype = 'other' | |
1006 | name_parameter1 = 'path' |
|
1010 | name_parameter1 = 'path' | |
1007 | name_parameter2 = 'blocksPerFile' |
|
1011 | name_parameter2 = 'blocksPerFile' | |
1008 | name_parameter3 = 'profilesPerBlock' |
|
1012 | name_parameter3 = 'profilesPerBlock' | |
1009 | value1 = output_path |
|
1013 | value1 = output_path | |
1010 | value2 = blocksperfile |
|
1014 | value2 = blocksperfile | |
1011 | value3 = profilesperblock |
|
1015 | value3 = profilesperblock | |
1012 | format = "int" |
|
1016 | format = "int" | |
1013 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1017 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1014 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1018 | opObj.addParameter(name=name_parameter1, value=value1) | |
1015 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1019 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1016 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1020 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1017 |
|
1021 | |||
1018 | self.console.clear() |
|
1022 | self.console.clear() | |
1019 | try: |
|
1023 | try: | |
1020 | self.refreshPUProperties(puObj) |
|
1024 | self.refreshPUProperties(puObj) | |
1021 | except: |
|
1025 | except: | |
1022 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1026 | self.console.append("An error reading input parameters was found ...Check them!") | |
1023 | return 0 |
|
1027 | return 0 | |
1024 |
|
1028 | |||
1025 | self.console.append("Save your project and press Play button to start signal processing") |
|
1029 | self.console.append("Save your project and press Play button to start signal processing") | |
1026 |
|
1030 | |||
1027 | self.actionSaveToolbar.setEnabled(True) |
|
1031 | self.actionSaveToolbar.setEnabled(True) | |
1028 | self.actionStarToolbar.setEnabled(True) |
|
1032 | self.actionStarToolbar.setEnabled(True) | |
1029 |
|
1033 | |||
1030 | return 1 |
|
1034 | return 1 | |
1031 |
|
1035 | |||
1032 | """ |
|
1036 | """ | |
1033 | Voltage Graph |
|
1037 | Voltage Graph | |
1034 | """ |
|
1038 | """ | |
1035 | @pyqtSignature("int") |
|
1039 | @pyqtSignature("int") | |
1036 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1040 | def on_volGraphCebSave_stateChanged(self, p0): | |
1037 | """ |
|
1041 | """ | |
1038 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1042 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1039 | """ |
|
1043 | """ | |
1040 | if p0 == 2: |
|
1044 | if p0 == 2: | |
1041 | self.volGraphPath.setEnabled(True) |
|
1045 | self.volGraphPath.setEnabled(True) | |
1042 | self.volGraphPrefix.setEnabled(True) |
|
1046 | self.volGraphPrefix.setEnabled(True) | |
1043 | self.volGraphToolPath.setEnabled(True) |
|
1047 | self.volGraphToolPath.setEnabled(True) | |
1044 |
|
1048 | |||
1045 | if p0 == 0: |
|
1049 | if p0 == 0: | |
1046 | self.volGraphPath.setEnabled(False) |
|
1050 | self.volGraphPath.setEnabled(False) | |
1047 | self.volGraphPrefix.setEnabled(False) |
|
1051 | self.volGraphPrefix.setEnabled(False) | |
1048 | self.volGraphToolPath.setEnabled(False) |
|
1052 | self.volGraphToolPath.setEnabled(False) | |
1049 |
|
1053 | |||
1050 | @pyqtSignature("") |
|
1054 | @pyqtSignature("") | |
1051 | def on_volGraphToolPath_clicked(self): |
|
1055 | def on_volGraphToolPath_clicked(self): | |
1052 | """ |
|
1056 | """ | |
1053 | Donde se guardan los DATOS |
|
1057 | Donde se guardan los DATOS | |
1054 | """ |
|
1058 | """ | |
1055 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1059 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1056 | self.volGraphPath.setText(save_path) |
|
1060 | self.volGraphPath.setText(save_path) | |
1057 |
|
1061 | |||
1058 | if not os.path.exists(save_path): |
|
1062 | if not os.path.exists(save_path): | |
1059 | self.console.clear() |
|
1063 | self.console.clear() | |
1060 | self.console.append("Set a valid path") |
|
1064 | self.console.append("Set a valid path") | |
1061 | self.volGraphOk.setEnabled(False) |
|
1065 | self.volGraphOk.setEnabled(False) | |
1062 | return |
|
1066 | return | |
1063 |
|
1067 | |||
1064 | @pyqtSignature("int") |
|
1068 | @pyqtSignature("int") | |
1065 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1069 | def on_volGraphCebshow_stateChanged(self, p0): | |
1066 | """ |
|
1070 | """ | |
1067 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1071 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1068 | """ |
|
1072 | """ | |
1069 | if p0 == 0: |
|
1073 | if p0 == 0: | |
1070 |
|
1074 | |||
1071 | self.volGraphChannelList.setEnabled(False) |
|
1075 | self.volGraphChannelList.setEnabled(False) | |
1072 | self.volGraphfreqrange.setEnabled(False) |
|
1076 | self.volGraphfreqrange.setEnabled(False) | |
1073 | self.volGraphHeightrange.setEnabled(False) |
|
1077 | self.volGraphHeightrange.setEnabled(False) | |
1074 | if p0 == 2: |
|
1078 | if p0 == 2: | |
1075 |
|
1079 | |||
1076 | self.volGraphChannelList.setEnabled(True) |
|
1080 | self.volGraphChannelList.setEnabled(True) | |
1077 | self.volGraphfreqrange.setEnabled(True) |
|
1081 | self.volGraphfreqrange.setEnabled(True) | |
1078 | self.volGraphHeightrange.setEnabled(True) |
|
1082 | self.volGraphHeightrange.setEnabled(True) | |
1079 |
|
1083 | |||
1080 | """ |
|
1084 | """ | |
1081 | Spectra operation |
|
1085 | Spectra operation | |
1082 | """ |
|
1086 | """ | |
1083 | @pyqtSignature("int") |
|
1087 | @pyqtSignature("int") | |
1084 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1088 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1085 | """ |
|
1089 | """ | |
1086 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1090 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1087 | """ |
|
1091 | """ | |
1088 | if p0 == 2: |
|
1092 | if p0 == 2: | |
1089 | self.specOpRadarfrequency.setEnabled(True) |
|
1093 | self.specOpRadarfrequency.setEnabled(True) | |
1090 | if p0 == 0: |
|
1094 | if p0 == 0: | |
1091 | self.specOpRadarfrequency.clear() |
|
1095 | self.specOpRadarfrequency.clear() | |
1092 | self.specOpRadarfrequency.setEnabled(False) |
|
1096 | self.specOpRadarfrequency.setEnabled(False) | |
1093 |
|
1097 | |||
1094 |
|
1098 | |||
1095 | @pyqtSignature("int") |
|
1099 | @pyqtSignature("int") | |
1096 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1100 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1097 | """ |
|
1101 | """ | |
1098 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1102 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1099 | """ |
|
1103 | """ | |
1100 | if p0 == 2: |
|
1104 | if p0 == 2: | |
1101 | # self.specOpnFFTpoints.setEnabled(True) |
|
1105 | # self.specOpnFFTpoints.setEnabled(True) | |
1102 | self.specOppairsList.setEnabled(True) |
|
1106 | self.specOppairsList.setEnabled(True) | |
1103 | if p0 == 0: |
|
1107 | if p0 == 0: | |
1104 | # self.specOpnFFTpoints.setEnabled(False) |
|
1108 | # self.specOpnFFTpoints.setEnabled(False) | |
1105 | self.specOppairsList.setEnabled(False) |
|
1109 | self.specOppairsList.setEnabled(False) | |
1106 |
|
1110 | |||
1107 | @pyqtSignature("int") |
|
1111 | @pyqtSignature("int") | |
1108 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1112 | def on_specOpCebChannel_stateChanged(self, p0): | |
1109 | """ |
|
1113 | """ | |
1110 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1114 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1111 | """ |
|
1115 | """ | |
1112 | if p0 == 2: |
|
1116 | if p0 == 2: | |
1113 | self.specOpChannel.setEnabled(True) |
|
1117 | self.specOpChannel.setEnabled(True) | |
1114 | self.specOpComChannel.setEnabled(True) |
|
1118 | self.specOpComChannel.setEnabled(True) | |
1115 | if p0 == 0: |
|
1119 | if p0 == 0: | |
1116 | self.specOpChannel.setEnabled(False) |
|
1120 | self.specOpChannel.setEnabled(False) | |
1117 | self.specOpComChannel.setEnabled(False) |
|
1121 | self.specOpComChannel.setEnabled(False) | |
1118 |
|
1122 | |||
1119 | @pyqtSignature("int") |
|
1123 | @pyqtSignature("int") | |
1120 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1124 | def on_specOpCebHeights_stateChanged(self, p0): | |
1121 | """ |
|
1125 | """ | |
1122 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1126 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1123 | """ |
|
1127 | """ | |
1124 | if p0 == 2: |
|
1128 | if p0 == 2: | |
1125 | self.specOpComHeights.setEnabled(True) |
|
1129 | self.specOpComHeights.setEnabled(True) | |
1126 | self.specOpHeights.setEnabled(True) |
|
1130 | self.specOpHeights.setEnabled(True) | |
1127 | if p0 == 0: |
|
1131 | if p0 == 0: | |
1128 | self.specOpComHeights.setEnabled(False) |
|
1132 | self.specOpComHeights.setEnabled(False) | |
1129 | self.specOpHeights.setEnabled(False) |
|
1133 | self.specOpHeights.setEnabled(False) | |
1130 |
|
1134 | |||
1131 |
|
1135 | |||
1132 | @pyqtSignature("int") |
|
1136 | @pyqtSignature("int") | |
1133 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1137 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1134 | """ |
|
1138 | """ | |
1135 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1139 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1136 | """ |
|
1140 | """ | |
1137 | if p0 == 2: |
|
1141 | if p0 == 2: | |
1138 | self.specOpIncoherent.setEnabled(True) |
|
1142 | self.specOpIncoherent.setEnabled(True) | |
1139 | if p0 == 0: |
|
1143 | if p0 == 0: | |
1140 | self.specOpIncoherent.setEnabled(False) |
|
1144 | self.specOpIncoherent.setEnabled(False) | |
1141 |
|
1145 | |||
1142 | @pyqtSignature("int") |
|
1146 | @pyqtSignature("int") | |
1143 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1147 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1144 | """ |
|
1148 | """ | |
1145 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1149 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1146 | """ |
|
1150 | """ | |
1147 | if p0 == 2: |
|
1151 | if p0 == 2: | |
1148 | self.specOpComRemoveDC.setEnabled(True) |
|
1152 | self.specOpComRemoveDC.setEnabled(True) | |
1149 | if p0 == 0: |
|
1153 | if p0 == 0: | |
1150 | self.specOpComRemoveDC.setEnabled(False) |
|
1154 | self.specOpComRemoveDC.setEnabled(False) | |
1151 |
|
1155 | |||
1152 | @pyqtSignature("int") |
|
1156 | @pyqtSignature("int") | |
1153 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1157 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1154 | """ |
|
1158 | """ | |
1155 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1159 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1156 | """ |
|
1160 | """ | |
1157 | if p0 == 2: |
|
1161 | if p0 == 2: | |
1158 | self.specOpgetNoise.setEnabled(True) |
|
1162 | self.specOpgetNoise.setEnabled(True) | |
1159 |
|
1163 | |||
1160 | if p0 == 0: |
|
1164 | if p0 == 0: | |
1161 | self.specOpgetNoise.setEnabled(False) |
|
1165 | self.specOpgetNoise.setEnabled(False) | |
1162 |
|
1166 | |||
1163 | @pyqtSignature("") |
|
1167 | @pyqtSignature("") | |
1164 | def on_specOpOk_clicked(self): |
|
1168 | def on_specOpOk_clicked(self): | |
1165 | """ |
|
1169 | """ | |
1166 | AΓADE OPERACION SPECTRA |
|
1170 | AΓADE OPERACION SPECTRA | |
1167 | """ |
|
1171 | """ | |
1168 |
|
1172 | |||
1169 | addFTP = False |
|
1173 | addFTP = False | |
1170 | checkPath = False |
|
1174 | checkPath = False | |
1171 |
|
1175 | |||
1172 | self.actionSaveToolbar.setEnabled(False) |
|
1176 | self.actionSaveToolbar.setEnabled(False) | |
1173 | self.actionStarToolbar.setEnabled(False) |
|
1177 | self.actionStarToolbar.setEnabled(False) | |
1174 |
|
1178 | |||
1175 | self.console.clear() |
|
1179 | self.console.clear() | |
1176 | self.console.append("Checking input parameters ...") |
|
1180 | self.console.append("Checking input parameters ...") | |
1177 |
|
1181 | |||
1178 | projectObj = self.getSelectedProjectObj() |
|
1182 | projectObj = self.getSelectedProjectObj() | |
|
1183 | ||||
|
1184 | if not projectObj: | |||
|
1185 | self.console.append("Please select a project before update it") | |||
|
1186 | return | |||
|
1187 | ||||
1179 | puObj = self.getSelectedItemObj() |
|
1188 | puObj = self.getSelectedItemObj() | |
1180 |
|
1189 | |||
1181 | puObj.removeOperations() |
|
1190 | puObj.removeOperations() | |
1182 |
|
1191 | |||
1183 | if self.specOpCebRadarfrequency.isChecked(): |
|
1192 | if self.specOpCebRadarfrequency.isChecked(): | |
1184 | value = str(self.specOpRadarfrequency.text()) |
|
1193 | value = str(self.specOpRadarfrequency.text()) | |
1185 | format = 'float' |
|
1194 | format = 'float' | |
1186 | name_operation = 'setRadarFrequency' |
|
1195 | name_operation = 'setRadarFrequency' | |
1187 | name_parameter = 'frequency' |
|
1196 | name_parameter = 'frequency' | |
1188 |
|
1197 | |||
1189 | if not isFloat(value): |
|
1198 | if not isFloat(value): | |
1190 | self.console.clear() |
|
1199 | self.console.clear() | |
1191 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1200 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1192 | return 0 |
|
1201 | return 0 | |
1193 |
|
1202 | |||
1194 | radarfreq = float(value)*1e6 |
|
1203 | radarfreq = float(value)*1e6 | |
1195 | opObj = puObj.addOperation(name=name_operation) |
|
1204 | opObj = puObj.addOperation(name=name_operation) | |
1196 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1205 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1197 |
|
1206 | |||
1198 | inputId = puObj.getInputId() |
|
1207 | inputId = puObj.getInputId() | |
1199 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1208 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1200 |
|
1209 | |||
1201 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1210 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1202 |
|
1211 | |||
1203 | value = str(self.specOpnFFTpoints.text()) |
|
1212 | value = str(self.specOpnFFTpoints.text()) | |
1204 |
|
1213 | |||
1205 | if not isInt(value): |
|
1214 | if not isInt(value): | |
1206 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) |
|
1215 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) | |
1207 | return 0 |
|
1216 | return 0 | |
1208 |
|
1217 | |||
1209 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1218 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1210 |
|
1219 | |||
1211 | value = str(self.specOpProfiles.text()) |
|
1220 | value = str(self.specOpProfiles.text()) | |
1212 | if not isInt(value): |
|
1221 | if not isInt(value): | |
1213 | self.console.append("Please write a value on Profiles field") |
|
1222 | self.console.append("Please write a value on Profiles field") | |
1214 | else: |
|
1223 | else: | |
1215 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1224 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1216 |
|
1225 | |||
1217 | value = str(self.specOpippFactor.text()) |
|
1226 | value = str(self.specOpippFactor.text()) | |
1218 | if not isInt(value): |
|
1227 | if not isInt(value): | |
1219 | self.console.append("Please write a value on IppFactor field") |
|
1228 | self.console.append("Please write a value on IppFactor field") | |
1220 | else: |
|
1229 | else: | |
1221 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1230 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1222 |
|
1231 | |||
1223 | if self.specOpCebCrossSpectra.isChecked(): |
|
1232 | if self.specOpCebCrossSpectra.isChecked(): | |
1224 | name_parameter = 'pairsList' |
|
1233 | name_parameter = 'pairsList' | |
1225 | format = 'pairslist' |
|
1234 | format = 'pairslist' | |
1226 | value = str(self.specOppairsList.text()) |
|
1235 | value = str(self.specOppairsList.text()) | |
1227 |
|
1236 | |||
1228 | if value == "": |
|
1237 | if value == "": | |
1229 | print "Please fill the pairs list field" |
|
1238 | print "Please fill the pairs list field" | |
1230 | return 0 |
|
1239 | return 0 | |
1231 |
|
1240 | |||
1232 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
1241 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
1233 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1242 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1234 | return 0 |
|
1243 | return 0 | |
1235 |
|
1244 | |||
1236 | if self.specOpCebHeights.isChecked(): |
|
1245 | if self.specOpCebHeights.isChecked(): | |
1237 | value = str(self.specOpHeights.text()) |
|
1246 | value = str(self.specOpHeights.text()) | |
1238 |
|
1247 | |||
1239 | if value == "": |
|
1248 | if value == "": | |
1240 | self.console.append("Empty value for '%s'" %(value, "Height range")) |
|
1249 | self.console.append("Empty value for '%s'" %(value, "Height range")) | |
1241 | return 0 |
|
1250 | return 0 | |
1242 |
|
1251 | |||
1243 | valueList = value.split(',') |
|
1252 | valueList = value.split(',') | |
1244 | format = 'float' |
|
1253 | format = 'float' | |
1245 | value0 = valueList[0] |
|
1254 | value0 = valueList[0] | |
1246 | value1 = valueList[1] |
|
1255 | value1 = valueList[1] | |
1247 |
|
1256 | |||
1248 | if not isFloat(value0) or not isFloat(value1): |
|
1257 | if not isFloat(value0) or not isFloat(value1): | |
1249 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) |
|
1258 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) | |
1250 | return 0 |
|
1259 | return 0 | |
1251 |
|
1260 | |||
1252 | if self.specOpComHeights.currentIndex() == 0: |
|
1261 | if self.specOpComHeights.currentIndex() == 0: | |
1253 | name_operation = 'selectHeights' |
|
1262 | name_operation = 'selectHeights' | |
1254 | name_parameter1 = 'minHei' |
|
1263 | name_parameter1 = 'minHei' | |
1255 | name_parameter2 = 'maxHei' |
|
1264 | name_parameter2 = 'maxHei' | |
1256 | else: |
|
1265 | else: | |
1257 | name_operation = 'selectHeightsByIndex' |
|
1266 | name_operation = 'selectHeightsByIndex' | |
1258 | name_parameter1 = 'minIndex' |
|
1267 | name_parameter1 = 'minIndex' | |
1259 | name_parameter2 = 'maxIndex' |
|
1268 | name_parameter2 = 'maxIndex' | |
1260 |
|
1269 | |||
1261 | opObj = puObj.addOperation(name=name_operation) |
|
1270 | opObj = puObj.addOperation(name=name_operation) | |
1262 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1271 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1263 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1272 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1264 |
|
1273 | |||
1265 | if self.specOpCebChannel.isChecked(): |
|
1274 | if self.specOpCebChannel.isChecked(): | |
1266 |
|
1275 | |||
1267 | if self.specOpComChannel.currentIndex() == 0: |
|
1276 | if self.specOpComChannel.currentIndex() == 0: | |
1268 | name_operation = "selectChannels" |
|
1277 | name_operation = "selectChannels" | |
1269 | name_parameter = 'channelList' |
|
1278 | name_parameter = 'channelList' | |
1270 | else: |
|
1279 | else: | |
1271 | name_operation = "selectChannelsByIndex" |
|
1280 | name_operation = "selectChannelsByIndex" | |
1272 | name_parameter = 'channelIndexList' |
|
1281 | name_parameter = 'channelIndexList' | |
1273 |
|
1282 | |||
1274 | format = 'intlist' |
|
1283 | format = 'intlist' | |
1275 | value = str(self.specOpChannel.text()) |
|
1284 | value = str(self.specOpChannel.text()) | |
1276 |
|
1285 | |||
1277 | if value == "": |
|
1286 | if value == "": | |
1278 | print "Please fill channel list" |
|
1287 | print "Please fill channel list" | |
1279 | return 0 |
|
1288 | return 0 | |
1280 |
|
1289 | |||
1281 | if not isList(value): |
|
1290 | if not isList(value): | |
1282 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1291 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1283 | return 0 |
|
1292 | return 0 | |
1284 |
|
1293 | |||
1285 | opObj = puObj.addOperation(name=name_operation) |
|
1294 | opObj = puObj.addOperation(name=name_operation) | |
1286 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1295 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1287 |
|
1296 | |||
1288 | if self.specOpCebIncoherent.isChecked(): |
|
1297 | if self.specOpCebIncoherent.isChecked(): | |
1289 |
|
1298 | |||
1290 | name_operation = 'IncohInt' |
|
1299 | name_operation = 'IncohInt' | |
1291 | optype = 'other' |
|
1300 | optype = 'other' | |
1292 |
|
1301 | |||
1293 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1302 | if self.specOpCobIncInt.currentIndex() == 0: | |
1294 | name_parameter = 'timeInterval' |
|
1303 | name_parameter = 'timeInterval' | |
1295 | format = 'float' |
|
1304 | format = 'float' | |
1296 | else: |
|
1305 | else: | |
1297 | name_parameter = 'n' |
|
1306 | name_parameter = 'n' | |
1298 | format = 'float' |
|
1307 | format = 'float' | |
1299 |
|
1308 | |||
1300 | value = str(self.specOpIncoherent.text()) |
|
1309 | value = str(self.specOpIncoherent.text()) | |
1301 |
|
1310 | |||
1302 | if value == "": |
|
1311 | if value == "": | |
1303 | print "Please fill Incoherent integration value" |
|
1312 | print "Please fill Incoherent integration value" | |
1304 | return 0 |
|
1313 | return 0 | |
1305 |
|
1314 | |||
1306 | if not isFloat(value): |
|
1315 | if not isFloat(value): | |
1307 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1316 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1308 | return 0 |
|
1317 | return 0 | |
1309 |
|
1318 | |||
1310 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1319 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1311 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1320 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1312 |
|
1321 | |||
1313 | if self.specOpCebRemoveDC.isChecked(): |
|
1322 | if self.specOpCebRemoveDC.isChecked(): | |
1314 | name_operation = 'removeDC' |
|
1323 | name_operation = 'removeDC' | |
1315 | name_parameter = 'mode' |
|
1324 | name_parameter = 'mode' | |
1316 | format = 'int' |
|
1325 | format = 'int' | |
1317 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1326 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1318 | value = 1 |
|
1327 | value = 1 | |
1319 | else: |
|
1328 | else: | |
1320 | value = 2 |
|
1329 | value = 2 | |
1321 | opObj = puObj.addOperation(name=name_operation) |
|
1330 | opObj = puObj.addOperation(name=name_operation) | |
1322 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1331 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1323 |
|
1332 | |||
1324 | if self.specOpCebRemoveInt.isChecked(): |
|
1333 | if self.specOpCebRemoveInt.isChecked(): | |
1325 | name_operation = 'removeInterference' |
|
1334 | name_operation = 'removeInterference' | |
1326 | opObj = puObj.addOperation(name=name_operation) |
|
1335 | opObj = puObj.addOperation(name=name_operation) | |
1327 |
|
1336 | |||
1328 |
|
1337 | |||
1329 | if self.specOpCebgetNoise.isChecked(): |
|
1338 | if self.specOpCebgetNoise.isChecked(): | |
1330 | value = str(self.specOpgetNoise.text()) |
|
1339 | value = str(self.specOpgetNoise.text()) | |
1331 | valueList = value.split(',') |
|
1340 | valueList = value.split(',') | |
1332 | format = 'float' |
|
1341 | format = 'float' | |
1333 | name_operation = "getNoise" |
|
1342 | name_operation = "getNoise" | |
1334 | opObj = puObj.addOperation(name=name_operation) |
|
1343 | opObj = puObj.addOperation(name=name_operation) | |
1335 |
|
1344 | |||
1336 | if not value == '': |
|
1345 | if not value == '': | |
1337 | valueList = value.split(',') |
|
1346 | valueList = value.split(',') | |
1338 | length = len(valueList) |
|
1347 | length = len(valueList) | |
1339 | if length == 1: |
|
1348 | if length == 1: | |
1340 | try: |
|
1349 | try: | |
1341 | value1 = float(valueList[0]) |
|
1350 | value1 = float(valueList[0]) | |
1342 | except: |
|
1351 | except: | |
1343 | self.console.clear() |
|
1352 | self.console.clear() | |
1344 | self.console.append("Please Write correct parameter Get Noise") |
|
1353 | self.console.append("Please Write correct parameter Get Noise") | |
1345 | return 0 |
|
1354 | return 0 | |
1346 | name1 = 'minHei' |
|
1355 | name1 = 'minHei' | |
1347 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1356 | opObj.addParameter(name=name1, value=value1, format=format) | |
1348 | elif length == 2: |
|
1357 | elif length == 2: | |
1349 | try: |
|
1358 | try: | |
1350 | value1 = float(valueList[0]) |
|
1359 | value1 = float(valueList[0]) | |
1351 | value2 = float(valueList[1]) |
|
1360 | value2 = float(valueList[1]) | |
1352 | except: |
|
1361 | except: | |
1353 | self.console.clear() |
|
1362 | self.console.clear() | |
1354 | self.console.append("Please Write corrects parameter Get Noise") |
|
1363 | self.console.append("Please Write corrects parameter Get Noise") | |
1355 | return 0 |
|
1364 | return 0 | |
1356 | name1 = 'minHei' |
|
1365 | name1 = 'minHei' | |
1357 | name2 = 'maxHei' |
|
1366 | name2 = 'maxHei' | |
1358 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1367 | opObj.addParameter(name=name1, value=value1, format=format) | |
1359 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1368 | opObj.addParameter(name=name2, value=value2, format=format) | |
1360 |
|
1369 | |||
1361 | elif length == 3: |
|
1370 | elif length == 3: | |
1362 | try: |
|
1371 | try: | |
1363 | value1 = float(valueList[0]) |
|
1372 | value1 = float(valueList[0]) | |
1364 | value2 = float(valueList[1]) |
|
1373 | value2 = float(valueList[1]) | |
1365 | value3 = float(valueList[2]) |
|
1374 | value3 = float(valueList[2]) | |
1366 | except: |
|
1375 | except: | |
1367 | self.console.clear() |
|
1376 | self.console.clear() | |
1368 | self.console.append("Please Write corrects parameter Get Noise") |
|
1377 | self.console.append("Please Write corrects parameter Get Noise") | |
1369 | return 0 |
|
1378 | return 0 | |
1370 | name1 = 'minHei' |
|
1379 | name1 = 'minHei' | |
1371 | name2 = 'maxHei' |
|
1380 | name2 = 'maxHei' | |
1372 | name3 = 'minVel' |
|
1381 | name3 = 'minVel' | |
1373 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1382 | opObj.addParameter(name=name1, value=value1, format=format) | |
1374 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1383 | opObj.addParameter(name=name2, value=value2, format=format) | |
1375 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1384 | opObj.addParameter(name=name3, value=value3, format=format) | |
1376 |
|
1385 | |||
1377 | elif length == 4: |
|
1386 | elif length == 4: | |
1378 | try: |
|
1387 | try: | |
1379 | value1 = float(valueList[0]) |
|
1388 | value1 = float(valueList[0]) | |
1380 | value2 = float(valueList[1]) |
|
1389 | value2 = float(valueList[1]) | |
1381 | value3 = float(valueList[2]) |
|
1390 | value3 = float(valueList[2]) | |
1382 | value4 = float(valueList[3]) |
|
1391 | value4 = float(valueList[3]) | |
1383 | except: |
|
1392 | except: | |
1384 | self.console.clear() |
|
1393 | self.console.clear() | |
1385 | self.console.append("Please Write corrects parameter Get Noise") |
|
1394 | self.console.append("Please Write corrects parameter Get Noise") | |
1386 | return 0 |
|
1395 | return 0 | |
1387 | name1 = 'minHei' |
|
1396 | name1 = 'minHei' | |
1388 | name2 = 'maxHei' |
|
1397 | name2 = 'maxHei' | |
1389 | name3 = 'minVel' |
|
1398 | name3 = 'minVel' | |
1390 | name4 = 'maxVel' |
|
1399 | name4 = 'maxVel' | |
1391 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1400 | opObj.addParameter(name=name1, value=value1, format=format) | |
1392 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1401 | opObj.addParameter(name=name2, value=value2, format=format) | |
1393 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1402 | opObj.addParameter(name=name3, value=value3, format=format) | |
1394 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1403 | opObj.addParameter(name=name4, value=value4, format=format) | |
1395 |
|
1404 | |||
1396 | elif length > 4: |
|
1405 | elif length > 4: | |
1397 | self.console.clear() |
|
1406 | self.console.clear() | |
1398 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1407 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1399 | return 0 |
|
1408 | return 0 | |
1400 |
|
1409 | |||
1401 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1410 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1402 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1411 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1403 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1412 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1404 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1413 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1405 |
|
1414 | |||
1406 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1415 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1407 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1416 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1408 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1417 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1409 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1418 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1410 |
|
1419 | |||
1411 | figpath = str(self.specGraphPath.text()) |
|
1420 | figpath = str(self.specGraphPath.text()) | |
1412 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1421 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1413 | try: |
|
1422 | try: | |
1414 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1423 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1415 | except: |
|
1424 | except: | |
1416 | wrperiod = None |
|
1425 | wrperiod = None | |
1417 |
|
1426 | |||
1418 | #-----Spectra Plot----- |
|
1427 | #-----Spectra Plot----- | |
1419 | if self.specGraphCebSpectraplot.isChecked(): |
|
1428 | if self.specGraphCebSpectraplot.isChecked(): | |
1420 |
|
1429 | |||
1421 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1430 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1422 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1431 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1423 |
|
1432 | |||
1424 | if not channelList == '': |
|
1433 | if not channelList == '': | |
1425 |
|
1434 | |||
1426 | if not isList(channelList): |
|
1435 | if not isList(channelList): | |
1427 | self.console.append("Invalid channelList") |
|
1436 | self.console.append("Invalid channelList") | |
1428 | return 0 |
|
1437 | return 0 | |
1429 |
|
1438 | |||
1430 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1439 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1431 |
|
1440 | |||
1432 | if not vel_range == '': |
|
1441 | if not vel_range == '': | |
1433 | xvalueList = vel_range.split(',') |
|
1442 | xvalueList = vel_range.split(',') | |
1434 | try: |
|
1443 | try: | |
1435 | value1 = float(xvalueList[0]) |
|
1444 | value1 = float(xvalueList[0]) | |
1436 | value2 = float(xvalueList[1]) |
|
1445 | value2 = float(xvalueList[1]) | |
1437 | except: |
|
1446 | except: | |
1438 | self.console.clear() |
|
1447 | self.console.clear() | |
1439 | self.console.append("Invalid velocity/frequency range") |
|
1448 | self.console.append("Invalid velocity/frequency range") | |
1440 | return 0 |
|
1449 | return 0 | |
1441 |
|
1450 | |||
1442 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1451 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1443 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1452 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1444 |
|
1453 | |||
1445 | if not hei_range == '': |
|
1454 | if not hei_range == '': | |
1446 | yvalueList = hei_range.split(",") |
|
1455 | yvalueList = hei_range.split(",") | |
1447 | try: |
|
1456 | try: | |
1448 | value1 = float(yvalueList[0]) |
|
1457 | value1 = float(yvalueList[0]) | |
1449 | value2 = float(yvalueList[1]) |
|
1458 | value2 = float(yvalueList[1]) | |
1450 | except: |
|
1459 | except: | |
1451 | self.console.clear() |
|
1460 | self.console.clear() | |
1452 | self.console.append("Invalid height range") |
|
1461 | self.console.append("Invalid height range") | |
1453 | return 0 |
|
1462 | return 0 | |
1454 |
|
1463 | |||
1455 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1464 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1456 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1465 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1457 |
|
1466 | |||
1458 | if not db_range == '': |
|
1467 | if not db_range == '': | |
1459 | zvalueList = db_range.split(",") |
|
1468 | zvalueList = db_range.split(",") | |
1460 | try: |
|
1469 | try: | |
1461 | value1 = float(zvalueList[0]) |
|
1470 | value1 = float(zvalueList[0]) | |
1462 | value2 = float(zvalueList[1]) |
|
1471 | value2 = float(zvalueList[1]) | |
1463 | except: |
|
1472 | except: | |
1464 | self.console.clear() |
|
1473 | self.console.clear() | |
1465 | self.console.append("Invalid db range") |
|
1474 | self.console.append("Invalid db range") | |
1466 | return 0 |
|
1475 | return 0 | |
1467 |
|
1476 | |||
1468 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1477 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1469 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1478 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1470 |
|
1479 | |||
1471 | if self.specGraphSaveSpectra.isChecked(): |
|
1480 | if self.specGraphSaveSpectra.isChecked(): | |
1472 | checkPath = True |
|
1481 | checkPath = True | |
1473 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1482 | opObj.addParameter(name='save', value=1 , format='bool') | |
1474 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1483 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1475 | if figfile: |
|
1484 | if figfile: | |
1476 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1485 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1477 | if wrperiod: |
|
1486 | if wrperiod: | |
1478 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1487 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1479 |
|
1488 | |||
1480 | if self.specGraphftpSpectra.isChecked(): |
|
1489 | if self.specGraphftpSpectra.isChecked(): | |
1481 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1490 | opObj.addParameter(name='ftp', value='1', format='int') | |
1482 | self.addFTPConf2Operation(puObj, opObj) |
|
1491 | self.addFTPConf2Operation(puObj, opObj) | |
1483 | addFTP = True |
|
1492 | addFTP = True | |
1484 |
|
1493 | |||
1485 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1494 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1486 |
|
1495 | |||
1487 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1496 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1488 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1497 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1489 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1498 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1490 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1499 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1491 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1500 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1492 |
|
1501 | |||
1493 | if not vel_range == '': |
|
1502 | if not vel_range == '': | |
1494 | xvalueList = vel_range.split(',') |
|
1503 | xvalueList = vel_range.split(',') | |
1495 | try: |
|
1504 | try: | |
1496 | value1 = float(xvalueList[0]) |
|
1505 | value1 = float(xvalueList[0]) | |
1497 | value2 = float(xvalueList[1]) |
|
1506 | value2 = float(xvalueList[1]) | |
1498 | except: |
|
1507 | except: | |
1499 | self.console.clear() |
|
1508 | self.console.clear() | |
1500 | self.console.append("Invalid velocity/frequency range") |
|
1509 | self.console.append("Invalid velocity/frequency range") | |
1501 | return 0 |
|
1510 | return 0 | |
1502 |
|
1511 | |||
1503 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1512 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1504 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1513 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1505 |
|
1514 | |||
1506 | if not hei_range == '': |
|
1515 | if not hei_range == '': | |
1507 | yvalueList = hei_range.split(",") |
|
1516 | yvalueList = hei_range.split(",") | |
1508 | try: |
|
1517 | try: | |
1509 | value1 = float(yvalueList[0]) |
|
1518 | value1 = float(yvalueList[0]) | |
1510 | value2 = float(yvalueList[1]) |
|
1519 | value2 = float(yvalueList[1]) | |
1511 | except: |
|
1520 | except: | |
1512 | self.console.clear() |
|
1521 | self.console.clear() | |
1513 | self.console.append("Invalid height range") |
|
1522 | self.console.append("Invalid height range") | |
1514 | return 0 |
|
1523 | return 0 | |
1515 |
|
1524 | |||
1516 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1525 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1517 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1526 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1518 |
|
1527 | |||
1519 | if not db_range == '': |
|
1528 | if not db_range == '': | |
1520 | zvalueList = db_range.split(",") |
|
1529 | zvalueList = db_range.split(",") | |
1521 | try: |
|
1530 | try: | |
1522 | value1 = float(zvalueList[0]) |
|
1531 | value1 = float(zvalueList[0]) | |
1523 | value2 = float(zvalueList[1]) |
|
1532 | value2 = float(zvalueList[1]) | |
1524 | except: |
|
1533 | except: | |
1525 | self.console.clear() |
|
1534 | self.console.clear() | |
1526 | self.console.append("Invalid db range") |
|
1535 | self.console.append("Invalid db range") | |
1527 | return 0 |
|
1536 | return 0 | |
1528 |
|
1537 | |||
1529 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1538 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1530 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1539 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1531 |
|
1540 | |||
1532 | if not magrange == '': |
|
1541 | if not magrange == '': | |
1533 | zvalueList = magrange.split(",") |
|
1542 | zvalueList = magrange.split(",") | |
1534 | try: |
|
1543 | try: | |
1535 | value1 = float(zvalueList[0]) |
|
1544 | value1 = float(zvalueList[0]) | |
1536 | value2 = float(zvalueList[1]) |
|
1545 | value2 = float(zvalueList[1]) | |
1537 | except: |
|
1546 | except: | |
1538 | self.console.clear() |
|
1547 | self.console.clear() | |
1539 | self.console.append("Invalid magnitude range") |
|
1548 | self.console.append("Invalid magnitude range") | |
1540 | return 0 |
|
1549 | return 0 | |
1541 |
|
1550 | |||
1542 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1551 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1543 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1552 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1544 |
|
1553 | |||
1545 | if not phaserange == '': |
|
1554 | if not phaserange == '': | |
1546 | zvalueList = phaserange.split(",") |
|
1555 | zvalueList = phaserange.split(",") | |
1547 | try: |
|
1556 | try: | |
1548 | value1 = float(zvalueList[0]) |
|
1557 | value1 = float(zvalueList[0]) | |
1549 | value2 = float(zvalueList[1]) |
|
1558 | value2 = float(zvalueList[1]) | |
1550 | except: |
|
1559 | except: | |
1551 | self.console.clear() |
|
1560 | self.console.clear() | |
1552 | self.console.append("Invalid phase range") |
|
1561 | self.console.append("Invalid phase range") | |
1553 | return 0 |
|
1562 | return 0 | |
1554 |
|
1563 | |||
1555 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1564 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1556 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1565 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1557 |
|
1566 | |||
1558 | if self.specGraphSaveCross.isChecked(): |
|
1567 | if self.specGraphSaveCross.isChecked(): | |
1559 | checkPath = True |
|
1568 | checkPath = True | |
1560 | opObj.addParameter(name='save', value='1', format='bool') |
|
1569 | opObj.addParameter(name='save', value='1', format='bool') | |
1561 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1570 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1562 | if figfile: |
|
1571 | if figfile: | |
1563 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1572 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1564 | if wrperiod: |
|
1573 | if wrperiod: | |
1565 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1574 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1566 |
|
1575 | |||
1567 | if self.specGraphftpCross.isChecked(): |
|
1576 | if self.specGraphftpCross.isChecked(): | |
1568 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1577 | opObj.addParameter(name='ftp', value='1', format='int') | |
1569 | self.addFTPConf2Operation(puObj, opObj) |
|
1578 | self.addFTPConf2Operation(puObj, opObj) | |
1570 | addFTP = True |
|
1579 | addFTP = True | |
1571 |
|
1580 | |||
1572 | if self.specGraphCebRTIplot.isChecked(): |
|
1581 | if self.specGraphCebRTIplot.isChecked(): | |
1573 |
|
1582 | |||
1574 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1583 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1575 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1584 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1576 |
|
1585 | |||
1577 | if not channelList == '': |
|
1586 | if not channelList == '': | |
1578 | if not isList(channelList): |
|
1587 | if not isList(channelList): | |
1579 | self.console.append("Invalid channelList") |
|
1588 | self.console.append("Invalid channelList") | |
1580 | return 0 |
|
1589 | return 0 | |
1581 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1590 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1582 |
|
1591 | |||
1583 | if not trange == '': |
|
1592 | if not trange == '': | |
1584 | xvalueList = trange.split(',') |
|
1593 | xvalueList = trange.split(',') | |
1585 | try: |
|
1594 | try: | |
1586 | value1 = float(xvalueList[0]) |
|
1595 | value1 = float(xvalueList[0]) | |
1587 | value2 = float(xvalueList[1]) |
|
1596 | value2 = float(xvalueList[1]) | |
1588 | except: |
|
1597 | except: | |
1589 | self.console.clear() |
|
1598 | self.console.clear() | |
1590 | self.console.append("Invalid time range") |
|
1599 | self.console.append("Invalid time range") | |
1591 | return 0 |
|
1600 | return 0 | |
1592 |
|
1601 | |||
1593 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1602 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1594 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1603 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1595 |
|
1604 | |||
1596 | # if not timerange == '': |
|
1605 | # if not timerange == '': | |
1597 | # try: |
|
1606 | # try: | |
1598 | # timerange = float(timerange) |
|
1607 | # timerange = float(timerange) | |
1599 | # except: |
|
1608 | # except: | |
1600 | # self.console.clear() |
|
1609 | # self.console.clear() | |
1601 | # self.console.append("Invalid time range") |
|
1610 | # self.console.append("Invalid time range") | |
1602 | # return 0 |
|
1611 | # return 0 | |
1603 | # |
|
1612 | # | |
1604 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1613 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1605 |
|
1614 | |||
1606 | if not hei_range == '': |
|
1615 | if not hei_range == '': | |
1607 | yvalueList = hei_range.split(",") |
|
1616 | yvalueList = hei_range.split(",") | |
1608 | try: |
|
1617 | try: | |
1609 | value1 = float(yvalueList[0]) |
|
1618 | value1 = float(yvalueList[0]) | |
1610 | value2 = float(yvalueList[1]) |
|
1619 | value2 = float(yvalueList[1]) | |
1611 | except: |
|
1620 | except: | |
1612 | self.console.clear() |
|
1621 | self.console.clear() | |
1613 | self.console.append("Invalid height range") |
|
1622 | self.console.append("Invalid height range") | |
1614 | return 0 |
|
1623 | return 0 | |
1615 |
|
1624 | |||
1616 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1625 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1617 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1626 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1618 |
|
1627 | |||
1619 | if not db_range == '': |
|
1628 | if not db_range == '': | |
1620 | zvalueList = db_range.split(",") |
|
1629 | zvalueList = db_range.split(",") | |
1621 | try: |
|
1630 | try: | |
1622 | value1 = float(zvalueList[0]) |
|
1631 | value1 = float(zvalueList[0]) | |
1623 | value2 = float(zvalueList[1]) |
|
1632 | value2 = float(zvalueList[1]) | |
1624 | except: |
|
1633 | except: | |
1625 | self.console.clear() |
|
1634 | self.console.clear() | |
1626 | self.console.append("Invalid db range") |
|
1635 | self.console.append("Invalid db range") | |
1627 | return 0 |
|
1636 | return 0 | |
1628 |
|
1637 | |||
1629 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1638 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1630 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1639 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1631 |
|
1640 | |||
1632 | if self.specGraphSaveRTIplot.isChecked(): |
|
1641 | if self.specGraphSaveRTIplot.isChecked(): | |
1633 | checkPath = True |
|
1642 | checkPath = True | |
1634 | opObj.addParameter(name='save', value='1', format='bool') |
|
1643 | opObj.addParameter(name='save', value='1', format='bool') | |
1635 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1644 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1636 | if figfile: |
|
1645 | if figfile: | |
1637 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1646 | opObj.addParameter(name='figfile', value=value, format='str') | |
1638 | if wrperiod: |
|
1647 | if wrperiod: | |
1639 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1648 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1640 |
|
1649 | |||
1641 | if self.specGraphftpRTIplot.isChecked(): |
|
1650 | if self.specGraphftpRTIplot.isChecked(): | |
1642 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1651 | opObj.addParameter(name='ftp', value='1', format='int') | |
1643 | self.addFTPConf2Operation(puObj, opObj) |
|
1652 | self.addFTPConf2Operation(puObj, opObj) | |
1644 | addFTP = True |
|
1653 | addFTP = True | |
1645 |
|
1654 | |||
1646 | if self.specGraphCebCoherencmap.isChecked(): |
|
1655 | if self.specGraphCebCoherencmap.isChecked(): | |
1647 |
|
1656 | |||
1648 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1657 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1649 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1658 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1650 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1659 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1651 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1660 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1652 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1661 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1653 |
|
1662 | |||
1654 | # if not timerange == '': |
|
1663 | # if not timerange == '': | |
1655 | # try: |
|
1664 | # try: | |
1656 | # timerange = int(timerange) |
|
1665 | # timerange = int(timerange) | |
1657 | # except: |
|
1666 | # except: | |
1658 | # self.console.clear() |
|
1667 | # self.console.clear() | |
1659 | # self.console.append("Invalid time range") |
|
1668 | # self.console.append("Invalid time range") | |
1660 | # return 0 |
|
1669 | # return 0 | |
1661 | # |
|
1670 | # | |
1662 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1671 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1663 |
|
1672 | |||
1664 | if not trange == '': |
|
1673 | if not trange == '': | |
1665 | xvalueList = trange.split(',') |
|
1674 | xvalueList = trange.split(',') | |
1666 | try: |
|
1675 | try: | |
1667 | value1 = float(xvalueList[0]) |
|
1676 | value1 = float(xvalueList[0]) | |
1668 | value2 = float(xvalueList[1]) |
|
1677 | value2 = float(xvalueList[1]) | |
1669 | except: |
|
1678 | except: | |
1670 | self.console.clear() |
|
1679 | self.console.clear() | |
1671 | self.console.append("Invalid time range") |
|
1680 | self.console.append("Invalid time range") | |
1672 | return 0 |
|
1681 | return 0 | |
1673 |
|
1682 | |||
1674 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1683 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1675 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1684 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1676 |
|
1685 | |||
1677 | if not hei_range == '': |
|
1686 | if not hei_range == '': | |
1678 | yvalueList = hei_range.split(",") |
|
1687 | yvalueList = hei_range.split(",") | |
1679 | try: |
|
1688 | try: | |
1680 | value1 = float(yvalueList[0]) |
|
1689 | value1 = float(yvalueList[0]) | |
1681 | value2 = float(yvalueList[1]) |
|
1690 | value2 = float(yvalueList[1]) | |
1682 | except: |
|
1691 | except: | |
1683 | self.console.clear() |
|
1692 | self.console.clear() | |
1684 | self.console.append("Invalid height range") |
|
1693 | self.console.append("Invalid height range") | |
1685 | return 0 |
|
1694 | return 0 | |
1686 |
|
1695 | |||
1687 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1696 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1688 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1697 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1689 |
|
1698 | |||
1690 | if not magrange == '': |
|
1699 | if not magrange == '': | |
1691 | zvalueList = magrange.split(",") |
|
1700 | zvalueList = magrange.split(",") | |
1692 | try: |
|
1701 | try: | |
1693 | value1 = float(zvalueList[0]) |
|
1702 | value1 = float(zvalueList[0]) | |
1694 | value2 = float(zvalueList[1]) |
|
1703 | value2 = float(zvalueList[1]) | |
1695 | except: |
|
1704 | except: | |
1696 | self.console.clear() |
|
1705 | self.console.clear() | |
1697 | self.console.append("Invalid magnitude range") |
|
1706 | self.console.append("Invalid magnitude range") | |
1698 | return 0 |
|
1707 | return 0 | |
1699 |
|
1708 | |||
1700 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1709 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1701 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1710 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1702 |
|
1711 | |||
1703 | if not phaserange == '': |
|
1712 | if not phaserange == '': | |
1704 | zvalueList = phaserange.split(",") |
|
1713 | zvalueList = phaserange.split(",") | |
1705 | try: |
|
1714 | try: | |
1706 | value1 = float(zvalueList[0]) |
|
1715 | value1 = float(zvalueList[0]) | |
1707 | value2 = float(zvalueList[1]) |
|
1716 | value2 = float(zvalueList[1]) | |
1708 | except: |
|
1717 | except: | |
1709 | self.console.clear() |
|
1718 | self.console.clear() | |
1710 | self.console.append("Invalid phase range") |
|
1719 | self.console.append("Invalid phase range") | |
1711 | return 0 |
|
1720 | return 0 | |
1712 |
|
1721 | |||
1713 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1722 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1714 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1723 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1715 |
|
1724 | |||
1716 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1725 | if self.specGraphSaveCoherencemap.isChecked(): | |
1717 | checkPath = True |
|
1726 | checkPath = True | |
1718 | opObj.addParameter(name='save', value='1', format='bool') |
|
1727 | opObj.addParameter(name='save', value='1', format='bool') | |
1719 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1728 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1720 | if figfile: |
|
1729 | if figfile: | |
1721 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1730 | opObj.addParameter(name='figfile', value=value, format='str') | |
1722 | if wrperiod: |
|
1731 | if wrperiod: | |
1723 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1732 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1724 |
|
1733 | |||
1725 | if self.specGraphftpCoherencemap.isChecked(): |
|
1734 | if self.specGraphftpCoherencemap.isChecked(): | |
1726 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1735 | opObj.addParameter(name='ftp', value='1', format='int') | |
1727 | self.addFTPConf2Operation(puObj, opObj) |
|
1736 | self.addFTPConf2Operation(puObj, opObj) | |
1728 | addFTP = True |
|
1737 | addFTP = True | |
1729 |
|
1738 | |||
1730 | if self.specGraphPowerprofile.isChecked(): |
|
1739 | if self.specGraphPowerprofile.isChecked(): | |
1731 |
|
1740 | |||
1732 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1741 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1733 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1742 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1734 |
|
1743 | |||
1735 | if not channelList == '': |
|
1744 | if not channelList == '': | |
1736 | if not isList(channelList): |
|
1745 | if not isList(channelList): | |
1737 | self.console.append("Invalid channelList") |
|
1746 | self.console.append("Invalid channelList") | |
1738 | return 0 |
|
1747 | return 0 | |
1739 |
|
1748 | |||
1740 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1749 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1741 |
|
1750 | |||
1742 | if not db_range == '': |
|
1751 | if not db_range == '': | |
1743 | xvalueList = db_range.split(',') |
|
1752 | xvalueList = db_range.split(',') | |
1744 | try: |
|
1753 | try: | |
1745 | value1 = float(xvalueList[0]) |
|
1754 | value1 = float(xvalueList[0]) | |
1746 | value2 = float(xvalueList[1]) |
|
1755 | value2 = float(xvalueList[1]) | |
1747 | except: |
|
1756 | except: | |
1748 | self.console.clear() |
|
1757 | self.console.clear() | |
1749 | self.console.append("Invalid db range") |
|
1758 | self.console.append("Invalid db range") | |
1750 | return 0 |
|
1759 | return 0 | |
1751 |
|
1760 | |||
1752 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1761 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1753 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1762 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1754 |
|
1763 | |||
1755 | if not hei_range == '': |
|
1764 | if not hei_range == '': | |
1756 | yvalueList = hei_range.split(",") |
|
1765 | yvalueList = hei_range.split(",") | |
1757 | try: |
|
1766 | try: | |
1758 | value1 = float(yvalueList[0]) |
|
1767 | value1 = float(yvalueList[0]) | |
1759 | value2 = float(yvalueList[1]) |
|
1768 | value2 = float(yvalueList[1]) | |
1760 | except: |
|
1769 | except: | |
1761 | self.console.clear() |
|
1770 | self.console.clear() | |
1762 | self.console.append("Invalid height range") |
|
1771 | self.console.append("Invalid height range") | |
1763 | return 0 |
|
1772 | return 0 | |
1764 |
|
1773 | |||
1765 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1774 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1766 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1775 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1767 |
|
1776 | |||
1768 | if self.specGraphSavePowerprofile.isChecked(): |
|
1777 | if self.specGraphSavePowerprofile.isChecked(): | |
1769 | checkPath = True |
|
1778 | checkPath = True | |
1770 | opObj.addParameter(name='save', value='1', format='bool') |
|
1779 | opObj.addParameter(name='save', value='1', format='bool') | |
1771 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1780 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1772 | if figfile: |
|
1781 | if figfile: | |
1773 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1782 | opObj.addParameter(name='figfile', value=value, format='str') | |
1774 | if wrperiod: |
|
1783 | if wrperiod: | |
1775 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1784 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1776 |
|
1785 | |||
1777 | if self.specGraphftpPowerprofile.isChecked(): |
|
1786 | if self.specGraphftpPowerprofile.isChecked(): | |
1778 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1787 | opObj.addParameter(name='ftp', value='1', format='int') | |
1779 | self.addFTPConf2Operation(puObj, opObj) |
|
1788 | self.addFTPConf2Operation(puObj, opObj) | |
1780 | addFTP = True |
|
1789 | addFTP = True | |
1781 | # rti noise |
|
1790 | # rti noise | |
1782 |
|
1791 | |||
1783 | if self.specGraphCebRTInoise.isChecked(): |
|
1792 | if self.specGraphCebRTInoise.isChecked(): | |
1784 |
|
1793 | |||
1785 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1794 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1786 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1795 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1787 |
|
1796 | |||
1788 | if not channelList == '': |
|
1797 | if not channelList == '': | |
1789 | if not isList(channelList): |
|
1798 | if not isList(channelList): | |
1790 | self.console.append("Invalid channelList") |
|
1799 | self.console.append("Invalid channelList") | |
1791 | return 0 |
|
1800 | return 0 | |
1792 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1801 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1793 |
|
1802 | |||
1794 | # if not timerange == '': |
|
1803 | # if not timerange == '': | |
1795 | # try: |
|
1804 | # try: | |
1796 | # timerange = float(timerange) |
|
1805 | # timerange = float(timerange) | |
1797 | # except: |
|
1806 | # except: | |
1798 | # self.console.clear() |
|
1807 | # self.console.clear() | |
1799 | # self.console.append("Invalid time range") |
|
1808 | # self.console.append("Invalid time range") | |
1800 | # return 0 |
|
1809 | # return 0 | |
1801 | # |
|
1810 | # | |
1802 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1811 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1803 |
|
1812 | |||
1804 | if not trange == '': |
|
1813 | if not trange == '': | |
1805 | xvalueList = trange.split(',') |
|
1814 | xvalueList = trange.split(',') | |
1806 | try: |
|
1815 | try: | |
1807 | value1 = float(xvalueList[0]) |
|
1816 | value1 = float(xvalueList[0]) | |
1808 | value2 = float(xvalueList[1]) |
|
1817 | value2 = float(xvalueList[1]) | |
1809 | except: |
|
1818 | except: | |
1810 | self.console.clear() |
|
1819 | self.console.clear() | |
1811 | self.console.append("Invalid time range") |
|
1820 | self.console.append("Invalid time range") | |
1812 | return 0 |
|
1821 | return 0 | |
1813 |
|
1822 | |||
1814 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1823 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1815 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1824 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1816 |
|
1825 | |||
1817 | if not db_range == '': |
|
1826 | if not db_range == '': | |
1818 | yvalueList = db_range.split(",") |
|
1827 | yvalueList = db_range.split(",") | |
1819 | try: |
|
1828 | try: | |
1820 | value1 = float(yvalueList[0]) |
|
1829 | value1 = float(yvalueList[0]) | |
1821 | value2 = float(yvalueList[1]) |
|
1830 | value2 = float(yvalueList[1]) | |
1822 | except: |
|
1831 | except: | |
1823 | self.console.clear() |
|
1832 | self.console.clear() | |
1824 | self.console.append("Invalid db range") |
|
1833 | self.console.append("Invalid db range") | |
1825 | return 0 |
|
1834 | return 0 | |
1826 |
|
1835 | |||
1827 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1836 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1828 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1837 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1829 |
|
1838 | |||
1830 | if self.specGraphSaveRTInoise.isChecked(): |
|
1839 | if self.specGraphSaveRTInoise.isChecked(): | |
1831 | checkPath = True |
|
1840 | checkPath = True | |
1832 | opObj.addParameter(name='save', value='1', format='bool') |
|
1841 | opObj.addParameter(name='save', value='1', format='bool') | |
1833 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1842 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1834 | if figfile: |
|
1843 | if figfile: | |
1835 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1844 | opObj.addParameter(name='figfile', value=value, format='str') | |
1836 | if wrperiod: |
|
1845 | if wrperiod: | |
1837 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1846 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1838 |
|
1847 | |||
1839 | # test_ftp |
|
1848 | # test_ftp | |
1840 | if self.specGraphftpRTInoise.isChecked(): |
|
1849 | if self.specGraphftpRTInoise.isChecked(): | |
1841 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1850 | opObj.addParameter(name='ftp', value='1', format='int') | |
1842 | self.addFTPConf2Operation(puObj, opObj) |
|
1851 | self.addFTPConf2Operation(puObj, opObj) | |
1843 | addFTP = True |
|
1852 | addFTP = True | |
1844 |
|
1853 | |||
1845 | if checkPath: |
|
1854 | if checkPath: | |
1846 | if not figpath: |
|
1855 | if not figpath: | |
1847 | self.console.clear() |
|
1856 | self.console.clear() | |
1848 | self.console.append("Graphic path should be defined") |
|
1857 | self.console.append("Graphic path should be defined") | |
1849 | return 0 |
|
1858 | return 0 | |
1850 |
|
1859 | |||
1851 | if addFTP and not figpath: |
|
1860 | if addFTP and not figpath: | |
1852 | self.console.clear() |
|
1861 | self.console.clear() | |
1853 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1862 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1854 | return 0 |
|
1863 | return 0 | |
1855 |
|
1864 | |||
1856 | # if something happend |
|
1865 | # if something happend | |
1857 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1866 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1858 | if parms_ok: |
|
1867 | if parms_ok: | |
1859 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1868 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1860 | opObj.addParameter(name='path', value=output_path) |
|
1869 | opObj.addParameter(name='path', value=output_path) | |
1861 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1870 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1862 |
|
1871 | |||
1863 | self.console.clear() |
|
1872 | self.console.clear() | |
1864 | try: |
|
1873 | try: | |
1865 | self.refreshPUProperties(puObj) |
|
1874 | self.refreshPUProperties(puObj) | |
1866 | except: |
|
1875 | except: | |
1867 | self.console.append("An error reading input parameters was found ... Check them!") |
|
1876 | self.console.append("An error reading input parameters was found ... Check them!") | |
1868 | return 0 |
|
1877 | return 0 | |
1869 |
|
1878 | |||
1870 | self.console.append("Save your project and press Play button to start signal processing") |
|
1879 | self.console.append("Save your project and press Play button to start signal processing") | |
1871 |
|
1880 | |||
1872 | self.actionSaveToolbar.setEnabled(True) |
|
1881 | self.actionSaveToolbar.setEnabled(True) | |
1873 | self.actionStarToolbar.setEnabled(True) |
|
1882 | self.actionStarToolbar.setEnabled(True) | |
1874 |
|
1883 | |||
1875 | return 1 |
|
1884 | return 1 | |
1876 |
|
1885 | |||
1877 | """ |
|
1886 | """ | |
1878 | Spectra Graph |
|
1887 | Spectra Graph | |
1879 | """ |
|
1888 | """ | |
1880 | @pyqtSignature("int") |
|
1889 | @pyqtSignature("int") | |
1881 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1890 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1882 |
|
1891 | |||
1883 | self.__checkSpecGraphFilters() |
|
1892 | self.__checkSpecGraphFilters() | |
1884 |
|
1893 | |||
1885 |
|
1894 | |||
1886 | @pyqtSignature("int") |
|
1895 | @pyqtSignature("int") | |
1887 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1896 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1888 |
|
1897 | |||
1889 | self.__checkSpecGraphFilters() |
|
1898 | self.__checkSpecGraphFilters() | |
1890 |
|
1899 | |||
1891 | @pyqtSignature("int") |
|
1900 | @pyqtSignature("int") | |
1892 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1901 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1893 |
|
1902 | |||
1894 | self.__checkSpecGraphFilters() |
|
1903 | self.__checkSpecGraphFilters() | |
1895 |
|
1904 | |||
1896 |
|
1905 | |||
1897 | @pyqtSignature("int") |
|
1906 | @pyqtSignature("int") | |
1898 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1907 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1899 |
|
1908 | |||
1900 | self.__checkSpecGraphFilters() |
|
1909 | self.__checkSpecGraphFilters() | |
1901 |
|
1910 | |||
1902 |
|
1911 | |||
1903 | @pyqtSignature("int") |
|
1912 | @pyqtSignature("int") | |
1904 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1913 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1905 |
|
1914 | |||
1906 | self.__checkSpecGraphFilters() |
|
1915 | self.__checkSpecGraphFilters() | |
1907 |
|
1916 | |||
1908 | @pyqtSignature("int") |
|
1917 | @pyqtSignature("int") | |
1909 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1918 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1910 |
|
1919 | |||
1911 | self.__checkSpecGraphFilters() |
|
1920 | self.__checkSpecGraphFilters() | |
1912 |
|
1921 | |||
1913 | @pyqtSignature("int") |
|
1922 | @pyqtSignature("int") | |
1914 | def on_specGraphPhase_stateChanged(self, p0): |
|
1923 | def on_specGraphPhase_stateChanged(self, p0): | |
1915 |
|
1924 | |||
1916 | self.__checkSpecGraphFilters() |
|
1925 | self.__checkSpecGraphFilters() | |
1917 |
|
1926 | |||
1918 | @pyqtSignature("int") |
|
1927 | @pyqtSignature("int") | |
1919 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1928 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1920 | """ |
|
1929 | """ | |
1921 | """ |
|
1930 | """ | |
1922 | self.__checkSpecGraphSaving() |
|
1931 | self.__checkSpecGraphSaving() | |
1923 |
|
1932 | |||
1924 | @pyqtSignature("int") |
|
1933 | @pyqtSignature("int") | |
1925 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1934 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1926 |
|
1935 | |||
1927 | self.__checkSpecGraphSaving() |
|
1936 | self.__checkSpecGraphSaving() | |
1928 |
|
1937 | |||
1929 | @pyqtSignature("int") |
|
1938 | @pyqtSignature("int") | |
1930 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1939 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1931 |
|
1940 | |||
1932 | self.__checkSpecGraphSaving() |
|
1941 | self.__checkSpecGraphSaving() | |
1933 |
|
1942 | |||
1934 | @pyqtSignature("int") |
|
1943 | @pyqtSignature("int") | |
1935 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1944 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1936 |
|
1945 | |||
1937 | self.__checkSpecGraphSaving() |
|
1946 | self.__checkSpecGraphSaving() | |
1938 |
|
1947 | |||
1939 | @pyqtSignature("int") |
|
1948 | @pyqtSignature("int") | |
1940 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1949 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1941 |
|
1950 | |||
1942 | self.__checkSpecGraphSaving() |
|
1951 | self.__checkSpecGraphSaving() | |
1943 |
|
1952 | |||
1944 | @pyqtSignature("int") |
|
1953 | @pyqtSignature("int") | |
1945 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1954 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1946 |
|
1955 | |||
1947 | self.__checkSpecGraphSaving() |
|
1956 | self.__checkSpecGraphSaving() | |
1948 |
|
1957 | |||
1949 | @pyqtSignature("int") |
|
1958 | @pyqtSignature("int") | |
1950 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1959 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1951 | """ |
|
1960 | """ | |
1952 | """ |
|
1961 | """ | |
1953 | self.__checkSpecGraphFTP() |
|
1962 | self.__checkSpecGraphFTP() | |
1954 |
|
1963 | |||
1955 |
|
1964 | |||
1956 | @pyqtSignature("int") |
|
1965 | @pyqtSignature("int") | |
1957 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1966 | def on_specGraphftpCross_stateChanged(self, p0): | |
1958 |
|
1967 | |||
1959 | self.__checkSpecGraphFTP() |
|
1968 | self.__checkSpecGraphFTP() | |
1960 |
|
1969 | |||
1961 | @pyqtSignature("int") |
|
1970 | @pyqtSignature("int") | |
1962 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1971 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1963 |
|
1972 | |||
1964 | self.__checkSpecGraphFTP() |
|
1973 | self.__checkSpecGraphFTP() | |
1965 |
|
1974 | |||
1966 | @pyqtSignature("int") |
|
1975 | @pyqtSignature("int") | |
1967 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1976 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1968 |
|
1977 | |||
1969 | self.__checkSpecGraphFTP() |
|
1978 | self.__checkSpecGraphFTP() | |
1970 |
|
1979 | |||
1971 | @pyqtSignature("int") |
|
1980 | @pyqtSignature("int") | |
1972 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1981 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1973 |
|
1982 | |||
1974 | self.__checkSpecGraphFTP() |
|
1983 | self.__checkSpecGraphFTP() | |
1975 |
|
1984 | |||
1976 | @pyqtSignature("int") |
|
1985 | @pyqtSignature("int") | |
1977 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1986 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1978 |
|
1987 | |||
1979 | self.__checkSpecGraphFTP() |
|
1988 | self.__checkSpecGraphFTP() | |
1980 |
|
1989 | |||
1981 | @pyqtSignature("") |
|
1990 | @pyqtSignature("") | |
1982 | def on_specGraphToolPath_clicked(self): |
|
1991 | def on_specGraphToolPath_clicked(self): | |
1983 | """ |
|
1992 | """ | |
1984 | """ |
|
1993 | """ | |
1985 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1994 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1986 | self.specGraphPath.setText(save_path) |
|
1995 | self.specGraphPath.setText(save_path) | |
1987 | if not os.path.exists(save_path): |
|
1996 | if not os.path.exists(save_path): | |
1988 | self.console.clear() |
|
1997 | self.console.clear() | |
1989 | self.console.append("Write a valid path") |
|
1998 | self.console.append("Write a valid path") | |
1990 | return |
|
1999 | return | |
1991 |
|
2000 | |||
1992 | @pyqtSignature("") |
|
2001 | @pyqtSignature("") | |
1993 | def on_specGraphClear_clicked(self): |
|
2002 | def on_specGraphClear_clicked(self): | |
1994 | return |
|
2003 | return | |
1995 |
|
2004 | |||
1996 | @pyqtSignature("") |
|
2005 | @pyqtSignature("") | |
1997 | def on_specHeisGraphToolPath_clicked(self): |
|
2006 | def on_specHeisGraphToolPath_clicked(self): | |
1998 | """ |
|
2007 | """ | |
1999 | """ |
|
2008 | """ | |
2000 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2009 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2001 | self.specHeisGraphPath.setText(save_path) |
|
2010 | self.specHeisGraphPath.setText(save_path) | |
2002 | if not os.path.exists(save_path): |
|
2011 | if not os.path.exists(save_path): | |
2003 | self.console.clear() |
|
2012 | self.console.clear() | |
2004 | self.console.append("Write a valid path") |
|
2013 | self.console.append("Write a valid path") | |
2005 | return |
|
2014 | return | |
2006 |
|
2015 | |||
2007 | @pyqtSignature("int") |
|
2016 | @pyqtSignature("int") | |
2008 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2017 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2009 | """ |
|
2018 | """ | |
2010 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2019 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2011 | """ |
|
2020 | """ | |
2012 | if p0 == 2: |
|
2021 | if p0 == 2: | |
2013 | self.specHeisOpIncoherent.setEnabled(True) |
|
2022 | self.specHeisOpIncoherent.setEnabled(True) | |
2014 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2023 | self.specHeisOpCobIncInt.setEnabled(True) | |
2015 | if p0 == 0: |
|
2024 | if p0 == 0: | |
2016 | self.specHeisOpIncoherent.setEnabled(False) |
|
2025 | self.specHeisOpIncoherent.setEnabled(False) | |
2017 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2026 | self.specHeisOpCobIncInt.setEnabled(False) | |
2018 |
|
2027 | |||
2019 | @pyqtSignature("") |
|
2028 | @pyqtSignature("") | |
2020 | def on_specHeisOpOk_clicked(self): |
|
2029 | def on_specHeisOpOk_clicked(self): | |
2021 | """ |
|
2030 | """ | |
2022 | AΓADE OPERACION SPECTRAHEIS |
|
2031 | AΓADE OPERACION SPECTRAHEIS | |
2023 | """ |
|
2032 | """ | |
2024 | addFTP = False |
|
2033 | addFTP = False | |
2025 | checkPath = False |
|
2034 | checkPath = False | |
2026 |
|
2035 | |||
2027 | self.actionSaveToolbar.setEnabled(False) |
|
2036 | self.actionSaveToolbar.setEnabled(False) | |
2028 | self.actionStarToolbar.setEnabled(False) |
|
2037 | self.actionStarToolbar.setEnabled(False) | |
2029 |
|
2038 | |||
2030 | self.console.clear() |
|
2039 | self.console.clear() | |
2031 | self.console.append("Checking input parameters ...") |
|
2040 | self.console.append("Checking input parameters ...") | |
2032 |
|
2041 | |||
2033 | puObj = self.getSelectedItemObj() |
|
2042 | puObj = self.getSelectedItemObj() | |
2034 | puObj.removeOperations() |
|
2043 | puObj.removeOperations() | |
2035 |
|
2044 | |||
2036 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2045 | if self.specHeisOpCebIncoherent.isChecked(): | |
2037 | value = str(self.specHeisOpIncoherent.text()) |
|
2046 | value = str(self.specHeisOpIncoherent.text()) | |
2038 | name_operation = 'IncohInt4SpectraHeis' |
|
2047 | name_operation = 'IncohInt4SpectraHeis' | |
2039 | optype = 'other' |
|
2048 | optype = 'other' | |
2040 |
|
2049 | |||
2041 | name_parameter = 'timeInterval' |
|
2050 | name_parameter = 'timeInterval' | |
2042 | format = 'float' |
|
2051 | format = 'float' | |
2043 |
|
2052 | |||
2044 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2053 | if self.specOpCobIncInt.currentIndex() == 0: | |
2045 | name_parameter = 'timeInterval' |
|
2054 | name_parameter = 'timeInterval' | |
2046 | format = 'float' |
|
2055 | format = 'float' | |
2047 |
|
2056 | |||
2048 | if not isFloat(value): |
|
2057 | if not isFloat(value): | |
2049 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2058 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2050 | return 0 |
|
2059 | return 0 | |
2051 |
|
2060 | |||
2052 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2061 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2053 |
|
2062 | |||
2054 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2063 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2055 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2064 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2056 | return 0 |
|
2065 | return 0 | |
2057 |
|
2066 | |||
2058 | # ---- Spectra Plot----- |
|
2067 | # ---- Spectra Plot----- | |
2059 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2068 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2060 | name_operation = 'SpectraHeisScope' |
|
2069 | name_operation = 'SpectraHeisScope' | |
2061 | optype = 'other' |
|
2070 | optype = 'other' | |
2062 |
|
2071 | |||
2063 | name_parameter = 'id' |
|
2072 | name_parameter = 'id' | |
2064 | format = 'int' |
|
2073 | format = 'int' | |
2065 |
|
2074 | |||
2066 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2075 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2067 | xvalue = str(self.specHeisGgraphXminXmax.text()) |
|
2076 | xvalue = str(self.specHeisGgraphXminXmax.text()) | |
2068 | yvalue = str(self.specHeisGgraphYminYmax.text()) |
|
2077 | yvalue = str(self.specHeisGgraphYminYmax.text()) | |
2069 |
|
2078 | |||
2070 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2079 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2071 | value = opObj.id |
|
2080 | value = opObj.id | |
2072 |
|
2081 | |||
2073 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2082 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2074 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2083 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2075 | return 0 |
|
2084 | return 0 | |
2076 |
|
2085 | |||
2077 | if not channelList == '': |
|
2086 | if not channelList == '': | |
2078 | name_parameter = 'channelList' |
|
2087 | name_parameter = 'channelList' | |
2079 | format = 'intlist' |
|
2088 | format = 'intlist' | |
2080 |
|
2089 | |||
2081 | if not isList(channelList): |
|
2090 | if not isList(channelList): | |
2082 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2091 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2083 | return 0 |
|
2092 | return 0 | |
2084 |
|
2093 | |||
2085 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2094 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2086 |
|
2095 | |||
2087 | if not xvalue == '': |
|
2096 | if not xvalue == '': | |
2088 | xvalueList = xvalue.split(',') |
|
2097 | xvalueList = xvalue.split(',') | |
2089 |
|
2098 | |||
2090 | if len(xvalueList) != 2: |
|
2099 | if len(xvalueList) != 2: | |
2091 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) |
|
2100 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) | |
2092 | return 0 |
|
2101 | return 0 | |
2093 |
|
2102 | |||
2094 | value1 = xvalueList[0] |
|
2103 | value1 = xvalueList[0] | |
2095 | value2 = xvalueList[1] |
|
2104 | value2 = xvalueList[1] | |
2096 |
|
2105 | |||
2097 | if not isFloat(value1) or not isFloat(value2): |
|
2106 | if not isFloat(value1) or not isFloat(value2): | |
2098 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) |
|
2107 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) | |
2099 | return 0 |
|
2108 | return 0 | |
2100 |
|
2109 | |||
2101 | name1 = 'xmin' |
|
2110 | name1 = 'xmin' | |
2102 | name2 = 'xmax' |
|
2111 | name2 = 'xmax' | |
2103 | format = 'float' |
|
2112 | format = 'float' | |
2104 |
|
2113 | |||
2105 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2114 | opObj.addParameter(name=name1, value=value1, format=format) | |
2106 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2115 | opObj.addParameter(name=name2, value=value2, format=format) | |
2107 |
|
2116 | |||
2108 | #------specHeisGgraphYmin-Ymax--- |
|
2117 | #------specHeisGgraphYmin-Ymax--- | |
2109 | if not yvalue == '': |
|
2118 | if not yvalue == '': | |
2110 | yvalueList = yvalue.split(",") |
|
2119 | yvalueList = yvalue.split(",") | |
2111 |
|
2120 | |||
2112 | if len(yvalueList) != 2: |
|
2121 | if len(yvalueList) != 2: | |
2113 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) |
|
2122 | self.console.append("Invalid value '%s' for '%s'" %(xvalue, "xrange")) | |
2114 | return 0 |
|
2123 | return 0 | |
2115 |
|
2124 | |||
2116 | value1 = yvalueList[0] |
|
2125 | value1 = yvalueList[0] | |
2117 | value2 = yvalueList[1] |
|
2126 | value2 = yvalueList[1] | |
2118 |
|
2127 | |||
2119 | if not isFloat(value1) or not isFloat(value2): |
|
2128 | if not isFloat(value1) or not isFloat(value2): | |
2120 | self.console.append("Invalid value '%s' for '%s'" %(yvalue, "yrange")) |
|
2129 | self.console.append("Invalid value '%s' for '%s'" %(yvalue, "yrange")) | |
2121 | return 0 |
|
2130 | return 0 | |
2122 |
|
2131 | |||
2123 | name1 = 'ymin' |
|
2132 | name1 = 'ymin' | |
2124 | name2 = 'ymax' |
|
2133 | name2 = 'ymax' | |
2125 | format = 'float' |
|
2134 | format = 'float' | |
2126 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2135 | opObj.addParameter(name=name1, value=value1, format=format) | |
2127 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2136 | opObj.addParameter(name=name2, value=value2, format=format) | |
2128 |
|
2137 | |||
2129 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2138 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2130 | checkPath = True |
|
2139 | checkPath = True | |
2131 | name_parameter1 = 'save' |
|
2140 | name_parameter1 = 'save' | |
2132 | name_parameter2 = 'figpath' |
|
2141 | name_parameter2 = 'figpath' | |
2133 | name_parameter3 = 'figfile' |
|
2142 | name_parameter3 = 'figfile' | |
2134 | value1 = '1' |
|
2143 | value1 = '1' | |
2135 | value2 = str(self.specHeisGraphPath.text()) |
|
2144 | value2 = str(self.specHeisGraphPath.text()) | |
2136 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2145 | value3 = str(self.specHeisGraphPrefix.text()) | |
2137 | format1 = 'bool' |
|
2146 | format1 = 'bool' | |
2138 | format2 = 'str' |
|
2147 | format2 = 'str' | |
2139 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2148 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2140 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2149 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2141 | if not value3 == "": |
|
2150 | if not value3 == "": | |
2142 | try: |
|
2151 | try: | |
2143 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2152 | value3 = str(self.specHeisGraphPrefix.text()) | |
2144 | except: |
|
2153 | except: | |
2145 | self.console.clear() |
|
2154 | self.console.clear() | |
2146 | self.console.append("Please Write prefix") |
|
2155 | self.console.append("Please Write prefix") | |
2147 | return 0 |
|
2156 | return 0 | |
2148 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2157 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2149 |
|
2158 | |||
2150 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2159 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2151 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2160 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2152 |
|
2161 | |||
2153 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2162 | if self.specHeisGraphftpSpectra.isChecked(): | |
2154 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2163 | opObj.addParameter(name='ftp', value='1', format='int') | |
2155 | self.addFTPConf2Operation(puObj, opObj) |
|
2164 | self.addFTPConf2Operation(puObj, opObj) | |
2156 | addFTP = True |
|
2165 | addFTP = True | |
2157 |
|
2166 | |||
2158 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2167 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2159 | name_operation = 'RTIfromSpectraHeis' |
|
2168 | name_operation = 'RTIfromSpectraHeis' | |
2160 | optype = 'other' |
|
2169 | optype = 'other' | |
2161 |
|
2170 | |||
2162 | name_parameter = 'id' |
|
2171 | name_parameter = 'id' | |
2163 | format = 'int' |
|
2172 | format = 'int' | |
2164 |
|
2173 | |||
2165 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2174 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2166 | value = opObj.id |
|
2175 | value = opObj.id | |
2167 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2176 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2168 |
|
2177 | |||
2169 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2178 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2170 | xvalue = str(self.specHeisGgraphTminTmax.text()) |
|
2179 | xvalue = str(self.specHeisGgraphTminTmax.text()) | |
2171 | yvalue = str(self.specHeisGgraphYminYmax.text()) |
|
2180 | yvalue = str(self.specHeisGgraphYminYmax.text()) | |
2172 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2181 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2173 |
|
2182 | |||
2174 | if not channelList == '': |
|
2183 | if not channelList == '': | |
2175 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2184 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2176 |
|
2185 | |||
2177 | if not xvalue == '': |
|
2186 | if not xvalue == '': | |
2178 | xvalueList = xvalue.split(',') |
|
2187 | xvalueList = xvalue.split(',') | |
2179 | try: |
|
2188 | try: | |
2180 | value = float(xvalueList[0]) |
|
2189 | value = float(xvalueList[0]) | |
2181 | value = float(xvalueList[1]) |
|
2190 | value = float(xvalueList[1]) | |
2182 | except: |
|
2191 | except: | |
2183 | return 0 |
|
2192 | return 0 | |
2184 | format = 'float' |
|
2193 | format = 'float' | |
2185 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2194 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2186 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2195 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2187 |
|
2196 | |||
2188 | if not timerange == '': |
|
2197 | if not timerange == '': | |
2189 | format = 'int' |
|
2198 | format = 'int' | |
2190 | try: |
|
2199 | try: | |
2191 | timerange = int(timerange) |
|
2200 | timerange = int(timerange) | |
2192 | except: |
|
2201 | except: | |
2193 | return 0 |
|
2202 | return 0 | |
2194 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2203 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2195 |
|
2204 | |||
2196 |
|
2205 | |||
2197 | if not yvalue == '': |
|
2206 | if not yvalue == '': | |
2198 | yvalueList = yvalue.split(",") |
|
2207 | yvalueList = yvalue.split(",") | |
2199 | try: |
|
2208 | try: | |
2200 | value = float(yvalueList[0]) |
|
2209 | value = float(yvalueList[0]) | |
2201 | value = float(yvalueList[1]) |
|
2210 | value = float(yvalueList[1]) | |
2202 | except: |
|
2211 | except: | |
2203 | return 0 |
|
2212 | return 0 | |
2204 | format = 'float' |
|
2213 | format = 'float' | |
2205 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2214 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2206 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2215 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2207 |
|
2216 | |||
2208 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2217 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2209 | checkPath = True |
|
2218 | checkPath = True | |
2210 | opObj.addParameter(name='save', value='1', format='bool') |
|
2219 | opObj.addParameter(name='save', value='1', format='bool') | |
2211 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2220 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2212 | value = str(self.specHeisGraphPrefix.text()) |
|
2221 | value = str(self.specHeisGraphPrefix.text()) | |
2213 | if not value == "": |
|
2222 | if not value == "": | |
2214 | try: |
|
2223 | try: | |
2215 | value = str(self.specHeisGraphPrefix.text()) |
|
2224 | value = str(self.specHeisGraphPrefix.text()) | |
2216 | except: |
|
2225 | except: | |
2217 | self.console.clear() |
|
2226 | self.console.clear() | |
2218 | self.console.append("Please Write prefix") |
|
2227 | self.console.append("Please Write prefix") | |
2219 | return 0 |
|
2228 | return 0 | |
2220 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2229 | opObj.addParameter(name='figfile', value=value, format='str') | |
2221 |
|
2230 | |||
2222 | # test_ftp |
|
2231 | # test_ftp | |
2223 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2232 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2224 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2233 | opObj.addParameter(name='ftp', value='1', format='int') | |
2225 | self.addFTPConf2Operation(puObj, opObj) |
|
2234 | self.addFTPConf2Operation(puObj, opObj) | |
2226 | addFTP = True |
|
2235 | addFTP = True | |
2227 |
|
2236 | |||
2228 | localfolder = None |
|
2237 | localfolder = None | |
2229 | if checkPath: |
|
2238 | if checkPath: | |
2230 | localfolder = str(self.specHeisGraphPath.text()) |
|
2239 | localfolder = str(self.specHeisGraphPath.text()) | |
2231 | if localfolder == '': |
|
2240 | if localfolder == '': | |
2232 | self.console.clear() |
|
2241 | self.console.clear() | |
2233 | self.console.append("Graphic path should be defined") |
|
2242 | self.console.append("Graphic path should be defined") | |
2234 | return 0 |
|
2243 | return 0 | |
2235 |
|
2244 | |||
2236 | if addFTP and not localfolder: |
|
2245 | if addFTP and not localfolder: | |
2237 | self.console.clear() |
|
2246 | self.console.clear() | |
2238 | self.console.append("You should save plots before send them to FTP Server") |
|
2247 | self.console.append("You should save plots before send them to FTP Server") | |
2239 | return 0 |
|
2248 | return 0 | |
2240 |
|
2249 | |||
2241 | # if something happened |
|
2250 | # if something happened | |
2242 | parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2251 | parms_ok, output_path, blocksperfile, metada = self.checkInputsPUSave(datatype='SpectraHeis') | |
2243 | if parms_ok: |
|
2252 | if parms_ok: | |
2244 | name_operation = 'FitsWriter' |
|
2253 | name_operation = 'FitsWriter' | |
2245 | optype = 'other' |
|
2254 | optype = 'other' | |
2246 | name_parameter1 = 'path' |
|
2255 | name_parameter1 = 'path' | |
2247 | name_parameter2 = 'dataBlocksPerFile' |
|
2256 | name_parameter2 = 'dataBlocksPerFile' | |
2248 | name_parameter3 = 'metadatafile' |
|
2257 | name_parameter3 = 'metadatafile' | |
2249 | value1 = output_path |
|
2258 | value1 = output_path | |
2250 | value2 = blocksperfile |
|
2259 | value2 = blocksperfile | |
2251 | value3 = metada |
|
2260 | value3 = metada | |
2252 | format2 = "int" |
|
2261 | format2 = "int" | |
2253 | format3 = "str" |
|
2262 | format3 = "str" | |
2254 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2263 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2255 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2264 | opObj.addParameter(name=name_parameter1, value=value1) | |
2256 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2265 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2257 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2266 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2258 |
|
2267 | |||
2259 | self.console.clear() |
|
2268 | self.console.clear() | |
2260 | try: |
|
2269 | try: | |
2261 | self.refreshPUProperties(puObj) |
|
2270 | self.refreshPUProperties(puObj) | |
2262 | except: |
|
2271 | except: | |
2263 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2272 | self.console.append("An error reading input parameters was found ... Check them!") | |
2264 | return 0 |
|
2273 | return 0 | |
2265 |
|
2274 | |||
2266 | self.console.append("Save your project and press Play button to start signal processing") |
|
2275 | self.console.append("Save your project and press Play button to start signal processing") | |
2267 |
|
2276 | |||
2268 | self.actionSaveToolbar.setEnabled(True) |
|
2277 | self.actionSaveToolbar.setEnabled(True) | |
2269 | self.actionStarToolbar.setEnabled(True) |
|
2278 | self.actionStarToolbar.setEnabled(True) | |
2270 |
|
2279 | |||
2271 | return 1 |
|
2280 | return 1 | |
2272 | @pyqtSignature("int") |
|
2281 | @pyqtSignature("int") | |
2273 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2282 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2274 |
|
2283 | |||
2275 | if p0 == 2: |
|
2284 | if p0 == 2: | |
2276 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2285 | self.specHeisGgraphChannelList.setEnabled(True) | |
2277 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2286 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2278 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2287 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2279 | if p0 == 0: |
|
2288 | if p0 == 0: | |
2280 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2289 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2281 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2290 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2282 |
|
2291 | |||
2283 | @pyqtSignature("int") |
|
2292 | @pyqtSignature("int") | |
2284 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2293 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2285 |
|
2294 | |||
2286 | if p0 == 2: |
|
2295 | if p0 == 2: | |
2287 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2296 | self.specHeisGgraphChannelList.setEnabled(True) | |
2288 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2297 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2289 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2298 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2290 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2299 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2291 |
|
2300 | |||
2292 | if p0 == 0: |
|
2301 | if p0 == 0: | |
2293 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2302 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2294 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2303 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2295 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2304 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2296 |
|
2305 | |||
2297 | @pyqtSignature("int") |
|
2306 | @pyqtSignature("int") | |
2298 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2307 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2299 | """ |
|
2308 | """ | |
2300 | """ |
|
2309 | """ | |
2301 | if p0 == 2: |
|
2310 | if p0 == 2: | |
2302 | self.specHeisGraphPath.setEnabled(True) |
|
2311 | self.specHeisGraphPath.setEnabled(True) | |
2303 | self.specHeisGraphPrefix.setEnabled(True) |
|
2312 | self.specHeisGraphPrefix.setEnabled(True) | |
2304 | self.specHeisGraphToolPath.setEnabled(True) |
|
2313 | self.specHeisGraphToolPath.setEnabled(True) | |
2305 | if p0 == 0: |
|
2314 | if p0 == 0: | |
2306 | self.specHeisGraphPath.setEnabled(False) |
|
2315 | self.specHeisGraphPath.setEnabled(False) | |
2307 | self.specHeisGraphPrefix.setEnabled(False) |
|
2316 | self.specHeisGraphPrefix.setEnabled(False) | |
2308 | self.specHeisGraphToolPath.setEnabled(False) |
|
2317 | self.specHeisGraphToolPath.setEnabled(False) | |
2309 |
|
2318 | |||
2310 | @pyqtSignature("int") |
|
2319 | @pyqtSignature("int") | |
2311 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2320 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2312 | if p0 == 2: |
|
2321 | if p0 == 2: | |
2313 | self.specHeisGraphPath.setEnabled(True) |
|
2322 | self.specHeisGraphPath.setEnabled(True) | |
2314 | self.specHeisGraphPrefix.setEnabled(True) |
|
2323 | self.specHeisGraphPrefix.setEnabled(True) | |
2315 | self.specHeisGraphToolPath.setEnabled(True) |
|
2324 | self.specHeisGraphToolPath.setEnabled(True) | |
2316 |
|
2325 | |||
2317 | @pyqtSignature("int") |
|
2326 | @pyqtSignature("int") | |
2318 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2327 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2319 | """ |
|
2328 | """ | |
2320 | """ |
|
2329 | """ | |
2321 | if p0 == 2: |
|
2330 | if p0 == 2: | |
2322 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2331 | self.specHeisGgraphftpratio.setEnabled(True) | |
2323 |
|
2332 | |||
2324 | if p0 == 0: |
|
2333 | if p0 == 0: | |
2325 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2334 | self.specHeisGgraphftpratio.setEnabled(False) | |
2326 |
|
2335 | |||
2327 | @pyqtSignature("int") |
|
2336 | @pyqtSignature("int") | |
2328 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2337 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2329 | if p0 == 2: |
|
2338 | if p0 == 2: | |
2330 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2339 | self.specHeisGgraphftpratio.setEnabled(True) | |
2331 |
|
2340 | |||
2332 | @pyqtSignature("") |
|
2341 | @pyqtSignature("") | |
2333 | def on_specHeisGraphClear_clicked(self): |
|
2342 | def on_specHeisGraphClear_clicked(self): | |
2334 | pass |
|
2343 | pass | |
2335 |
|
2344 | |||
2336 | def __checkSpecGraphSaving(self): |
|
2345 | def __checkSpecGraphSaving(self): | |
2337 |
|
2346 | |||
2338 | enable = False |
|
2347 | enable = False | |
2339 |
|
2348 | |||
2340 | if self.specGraphSaveSpectra.checkState(): |
|
2349 | if self.specGraphSaveSpectra.checkState(): | |
2341 | enable = True |
|
2350 | enable = True | |
2342 |
|
2351 | |||
2343 | if self.specGraphSaveCross.checkState(): |
|
2352 | if self.specGraphSaveCross.checkState(): | |
2344 | enable = True |
|
2353 | enable = True | |
2345 |
|
2354 | |||
2346 | if self.specGraphSaveRTIplot.checkState(): |
|
2355 | if self.specGraphSaveRTIplot.checkState(): | |
2347 | enable = True |
|
2356 | enable = True | |
2348 |
|
2357 | |||
2349 | if self.specGraphSaveCoherencemap.checkState(): |
|
2358 | if self.specGraphSaveCoherencemap.checkState(): | |
2350 | enable = True |
|
2359 | enable = True | |
2351 |
|
2360 | |||
2352 | if self.specGraphSavePowerprofile.checkState(): |
|
2361 | if self.specGraphSavePowerprofile.checkState(): | |
2353 | enable = True |
|
2362 | enable = True | |
2354 |
|
2363 | |||
2355 | if self.specGraphSaveRTInoise.checkState(): |
|
2364 | if self.specGraphSaveRTInoise.checkState(): | |
2356 | enable = True |
|
2365 | enable = True | |
2357 |
|
2366 | |||
2358 | self.specGraphPath.setEnabled(enable) |
|
2367 | self.specGraphPath.setEnabled(enable) | |
2359 | self.specGraphPrefix.setEnabled(enable) |
|
2368 | self.specGraphPrefix.setEnabled(enable) | |
2360 | self.specGraphToolPath.setEnabled(enable) |
|
2369 | self.specGraphToolPath.setEnabled(enable) | |
2361 |
|
2370 | |||
2362 | self.specGgraphftpratio.setEnabled(enable) |
|
2371 | self.specGgraphftpratio.setEnabled(enable) | |
2363 |
|
2372 | |||
2364 | def __checkSpecGraphFTP(self): |
|
2373 | def __checkSpecGraphFTP(self): | |
2365 |
|
2374 | |||
2366 | enable = False |
|
2375 | enable = False | |
2367 |
|
2376 | |||
2368 | if self.specGraphftpSpectra.checkState(): |
|
2377 | if self.specGraphftpSpectra.checkState(): | |
2369 | enable = True |
|
2378 | enable = True | |
2370 |
|
2379 | |||
2371 | if self.specGraphftpCross.checkState(): |
|
2380 | if self.specGraphftpCross.checkState(): | |
2372 | enable = True |
|
2381 | enable = True | |
2373 |
|
2382 | |||
2374 | if self.specGraphftpRTIplot.checkState(): |
|
2383 | if self.specGraphftpRTIplot.checkState(): | |
2375 | enable = True |
|
2384 | enable = True | |
2376 |
|
2385 | |||
2377 | if self.specGraphftpCoherencemap.checkState(): |
|
2386 | if self.specGraphftpCoherencemap.checkState(): | |
2378 | enable = True |
|
2387 | enable = True | |
2379 |
|
2388 | |||
2380 | if self.specGraphftpPowerprofile.checkState(): |
|
2389 | if self.specGraphftpPowerprofile.checkState(): | |
2381 | enable = True |
|
2390 | enable = True | |
2382 |
|
2391 | |||
2383 | if self.specGraphftpRTInoise.checkState(): |
|
2392 | if self.specGraphftpRTInoise.checkState(): | |
2384 | enable = True |
|
2393 | enable = True | |
2385 |
|
2394 | |||
2386 | # self.specGgraphftpratio.setEnabled(enable) |
|
2395 | # self.specGgraphftpratio.setEnabled(enable) | |
2387 |
|
2396 | |||
2388 | def __checkSpecGraphFilters(self): |
|
2397 | def __checkSpecGraphFilters(self): | |
2389 |
|
2398 | |||
2390 | freq = False |
|
2399 | freq = False | |
2391 | height = False |
|
2400 | height = False | |
2392 | db = False |
|
2401 | db = False | |
2393 | time = False |
|
2402 | time = False | |
2394 | magnitud = False |
|
2403 | magnitud = False | |
2395 | phase = False |
|
2404 | phase = False | |
2396 | channelList = False |
|
2405 | channelList = False | |
2397 |
|
2406 | |||
2398 | if self.specGraphCebSpectraplot.checkState(): |
|
2407 | if self.specGraphCebSpectraplot.checkState(): | |
2399 | freq = True |
|
2408 | freq = True | |
2400 | height = True |
|
2409 | height = True | |
2401 | db = True |
|
2410 | db = True | |
2402 | channelList = True |
|
2411 | channelList = True | |
2403 |
|
2412 | |||
2404 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2413 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2405 | freq = True |
|
2414 | freq = True | |
2406 | height = True |
|
2415 | height = True | |
2407 | db = True |
|
2416 | db = True | |
2408 | magnitud = True |
|
2417 | magnitud = True | |
2409 | phase = True |
|
2418 | phase = True | |
2410 |
|
2419 | |||
2411 | if self.specGraphCebRTIplot.checkState(): |
|
2420 | if self.specGraphCebRTIplot.checkState(): | |
2412 | height = True |
|
2421 | height = True | |
2413 | db = True |
|
2422 | db = True | |
2414 | time = True |
|
2423 | time = True | |
2415 | channelList = True |
|
2424 | channelList = True | |
2416 |
|
2425 | |||
2417 | if self.specGraphCebCoherencmap.checkState(): |
|
2426 | if self.specGraphCebCoherencmap.checkState(): | |
2418 | height = True |
|
2427 | height = True | |
2419 | time = True |
|
2428 | time = True | |
2420 | magnitud = True |
|
2429 | magnitud = True | |
2421 | phase = True |
|
2430 | phase = True | |
2422 |
|
2431 | |||
2423 | if self.specGraphPowerprofile.checkState(): |
|
2432 | if self.specGraphPowerprofile.checkState(): | |
2424 | height = True |
|
2433 | height = True | |
2425 | db = True |
|
2434 | db = True | |
2426 | channelList = True |
|
2435 | channelList = True | |
2427 |
|
2436 | |||
2428 | if self.specGraphCebRTInoise.checkState(): |
|
2437 | if self.specGraphCebRTInoise.checkState(): | |
2429 | db = True |
|
2438 | db = True | |
2430 | time = True |
|
2439 | time = True | |
2431 | channelList = True |
|
2440 | channelList = True | |
2432 |
|
2441 | |||
2433 |
|
2442 | |||
2434 | self.specGgraphFreq.setEnabled(freq) |
|
2443 | self.specGgraphFreq.setEnabled(freq) | |
2435 | self.specGgraphHeight.setEnabled(height) |
|
2444 | self.specGgraphHeight.setEnabled(height) | |
2436 | self.specGgraphDbsrange.setEnabled(db) |
|
2445 | self.specGgraphDbsrange.setEnabled(db) | |
2437 | self.specGgraphTminTmax.setEnabled(time) |
|
2446 | self.specGgraphTminTmax.setEnabled(time) | |
2438 |
|
2447 | |||
2439 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2448 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2440 | self.specGgraphPhase.setEnabled(phase) |
|
2449 | self.specGgraphPhase.setEnabled(phase) | |
2441 | self.specGgraphChannelList.setEnabled(channelList) |
|
2450 | self.specGgraphChannelList.setEnabled(channelList) | |
2442 |
|
2451 | |||
2443 | def __getParmsFromProjectWindow(self): |
|
2452 | def __getParmsFromProjectWindow(self): | |
2444 | """ |
|
2453 | """ | |
2445 | Check Inputs Project: |
|
2454 | Check Inputs Project: | |
2446 | - project_name |
|
2455 | - project_name | |
2447 | - datatype |
|
2456 | - datatype | |
2448 | - ext |
|
2457 | - ext | |
2449 | - data_path |
|
2458 | - data_path | |
2450 | - readmode |
|
2459 | - readmode | |
2451 | - delay |
|
2460 | - delay | |
2452 | - set |
|
2461 | - set | |
2453 | - walk |
|
2462 | - walk | |
2454 | """ |
|
2463 | """ | |
2455 | parms_ok = True |
|
2464 | parms_ok = True | |
2456 |
|
2465 | |||
2457 | project_name = str(self.proName.text()) |
|
2466 | project_name = str(self.proName.text()) | |
2458 |
|
2467 | |||
2459 | if project_name == '' or project_name == None: |
|
2468 | if project_name == '' or project_name == None: | |
2460 | outputstr = "Enter a project Name" |
|
2469 | outputstr = "Enter a project Name" | |
2461 | self.console.append(outputstr) |
|
2470 | self.console.append(outputstr) | |
2462 | parms_ok = False |
|
2471 | parms_ok = False | |
2463 | project_name = None |
|
2472 | project_name = None | |
2464 |
|
2473 | |||
2465 | description = str(self.proDescription.toPlainText()) |
|
2474 | description = str(self.proDescription.toPlainText()) | |
2466 |
|
2475 | |||
2467 | datatype = str(self.proComDataType.currentText()) |
|
2476 | datatype = str(self.proComDataType.currentText()) | |
2468 |
|
2477 | |||
2469 | ext = str(self.proDataType.text()) |
|
2478 | ext = str(self.proDataType.text()) | |
2470 |
|
2479 | |||
2471 | dpath = str(self.proDataPath.text()) |
|
2480 | dpath = str(self.proDataPath.text()) | |
2472 |
|
2481 | |||
2473 | if dpath == '': |
|
2482 | if dpath == '': | |
2474 | outputstr = 'Datapath is empty' |
|
2483 | outputstr = 'Datapath is empty' | |
2475 | self.console.append(outputstr) |
|
2484 | self.console.append(outputstr) | |
2476 | parms_ok = False |
|
2485 | parms_ok = False | |
2477 | dpath = None |
|
2486 | dpath = None | |
2478 |
|
2487 | |||
2479 | if dpath != None: |
|
2488 | if dpath != None: | |
2480 | if not os.path.isdir(dpath): |
|
2489 | if not os.path.isdir(dpath): | |
2481 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2490 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2482 | self.console.append(outputstr) |
|
2491 | self.console.append(outputstr) | |
2483 | parms_ok = False |
|
2492 | parms_ok = False | |
2484 | dpath = None |
|
2493 | dpath = None | |
2485 |
|
2494 | |||
2486 | online = int(self.proComReadMode.currentIndex()) |
|
2495 | online = int(self.proComReadMode.currentIndex()) | |
2487 |
|
2496 | |||
2488 | delay = None |
|
2497 | delay = None | |
2489 | if online==1: |
|
2498 | if online==1: | |
2490 | try: |
|
2499 | try: | |
2491 | delay = int(str(self.proDelay.text())) |
|
2500 | delay = int(str(self.proDelay.text())) | |
2492 | except: |
|
2501 | except: | |
2493 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2502 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2494 | self.console.append(outputstr) |
|
2503 | self.console.append(outputstr) | |
2495 | parms_ok = False |
|
2504 | parms_ok = False | |
2496 |
|
2505 | |||
2497 |
|
2506 | |||
2498 | set = None |
|
2507 | set = None | |
2499 | value = str(self.proSet.text()) |
|
2508 | value = str(self.proSet.text()) | |
2500 | try: |
|
2509 | try: | |
2501 | set = int(value) |
|
2510 | set = int(value) | |
2502 | except: |
|
2511 | except: | |
2503 | pass |
|
2512 | pass | |
2504 |
|
2513 | |||
2505 | ippKm = None |
|
2514 | ippKm = None | |
2506 |
|
2515 | |||
2507 | value = str(self.proIPPKm.text()) |
|
2516 | value = str(self.proIPPKm.text()) | |
2508 |
|
2517 | |||
2509 | try: |
|
2518 | try: | |
2510 | ippKm = float(value) |
|
2519 | ippKm = float(value) | |
2511 | except: |
|
2520 | except: | |
2512 | if datatype=="USRP": |
|
2521 | if datatype=="USRP": | |
2513 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2522 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2514 | self.console.append(outputstr) |
|
2523 | self.console.append(outputstr) | |
2515 | parms_ok = False |
|
2524 | parms_ok = False | |
2516 |
|
2525 | |||
2517 | walk = int(self.proComWalk.currentIndex()) |
|
2526 | walk = int(self.proComWalk.currentIndex()) | |
2518 | expLabel = str(self.proExpLabel.text()) |
|
2527 | expLabel = str(self.proExpLabel.text()) | |
2519 |
|
2528 | |||
2520 | startDate = str(self.proComStartDate.currentText()) |
|
2529 | startDate = str(self.proComStartDate.currentText()) | |
2521 | endDate = str(self.proComEndDate.currentText()) |
|
2530 | endDate = str(self.proComEndDate.currentText()) | |
2522 |
|
2531 | |||
2523 | # startDateList = startDate.split("/") |
|
2532 | # startDateList = startDate.split("/") | |
2524 | # endDateList = endDate.split("/") |
|
2533 | # endDateList = endDate.split("/") | |
2525 | # |
|
2534 | # | |
2526 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2535 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2527 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2536 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2528 |
|
2537 | |||
2529 | startTime = self.proStartTime.time() |
|
2538 | startTime = self.proStartTime.time() | |
2530 | endTime = self.proEndTime.time() |
|
2539 | endTime = self.proEndTime.time() | |
2531 |
|
2540 | |||
2532 | startTime = str(startTime.toString("H:m:s")) |
|
2541 | startTime = str(startTime.toString("H:m:s")) | |
2533 | endTime = str(endTime.toString("H:m:s")) |
|
2542 | endTime = str(endTime.toString("H:m:s")) | |
2534 |
|
2543 | |||
2535 | projectParms = ProjectParms() |
|
2544 | projectParms = ProjectParms() | |
2536 |
|
2545 | |||
2537 | projectParms.name = project_name |
|
2546 | projectParms.name = project_name | |
2538 | projectParms.description = description |
|
2547 | projectParms.description = description | |
2539 | projectParms.datatype = datatype |
|
2548 | projectParms.datatype = datatype | |
2540 | projectParms.ext = ext |
|
2549 | projectParms.ext = ext | |
2541 | projectParms.dpath = dpath |
|
2550 | projectParms.dpath = dpath | |
2542 | projectParms.online = online |
|
2551 | projectParms.online = online | |
2543 | projectParms.startDate = startDate |
|
2552 | projectParms.startDate = startDate | |
2544 | projectParms.endDate = endDate |
|
2553 | projectParms.endDate = endDate | |
2545 | projectParms.startTime = startTime |
|
2554 | projectParms.startTime = startTime | |
2546 | projectParms.endTime = endTime |
|
2555 | projectParms.endTime = endTime | |
2547 | projectParms.delay = delay |
|
2556 | projectParms.delay = delay | |
2548 | projectParms.walk = walk |
|
2557 | projectParms.walk = walk | |
2549 | projectParms.expLabel = expLabel |
|
2558 | projectParms.expLabel = expLabel | |
2550 | projectParms.set = set |
|
2559 | projectParms.set = set | |
2551 | projectParms.ippKm = ippKm |
|
2560 | projectParms.ippKm = ippKm | |
2552 | projectParms.parmsOk = parms_ok |
|
2561 | projectParms.parmsOk = parms_ok | |
2553 |
|
2562 | |||
2554 | return projectParms |
|
2563 | return projectParms | |
2555 |
|
2564 | |||
2556 |
|
2565 | |||
2557 | def __getParmsFromProjectObj(self, projectObjView): |
|
2566 | def __getParmsFromProjectObj(self, projectObjView): | |
2558 |
|
2567 | |||
2559 | parms_ok = True |
|
2568 | parms_ok = True | |
2560 |
|
2569 | |||
2561 | project_name, description = projectObjView.name, projectObjView.description |
|
2570 | project_name, description = projectObjView.name, projectObjView.description | |
2562 |
|
2571 | |||
2563 | readUnitObj = projectObjView.getReadUnitObj() |
|
2572 | readUnitObj = projectObjView.getReadUnitObj() | |
2564 | datatype = readUnitObj.datatype |
|
2573 | datatype = readUnitObj.datatype | |
2565 |
|
2574 | |||
2566 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2575 | operationObj = readUnitObj.getOperationObj(name='run') | |
2567 |
|
2576 | |||
2568 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2577 | dpath = operationObj.getParameterValue(parameterName='path') | |
2569 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2578 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2570 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2579 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2571 |
|
2580 | |||
2572 | startDate = startDate.strftime("%Y/%m/%d") |
|
2581 | startDate = startDate.strftime("%Y/%m/%d") | |
2573 | endDate = endDate.strftime("%Y/%m/%d") |
|
2582 | endDate = endDate.strftime("%Y/%m/%d") | |
2574 |
|
2583 | |||
2575 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2584 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2576 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2585 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2577 |
|
2586 | |||
2578 | startTime = startTime.strftime("%H:%M:%S") |
|
2587 | startTime = startTime.strftime("%H:%M:%S") | |
2579 | endTime = endTime.strftime("%H:%M:%S") |
|
2588 | endTime = endTime.strftime("%H:%M:%S") | |
2580 |
|
2589 | |||
2581 | online = 0 |
|
2590 | online = 0 | |
2582 | try: |
|
2591 | try: | |
2583 | online = operationObj.getParameterValue(parameterName='online') |
|
2592 | online = operationObj.getParameterValue(parameterName='online') | |
2584 | except: |
|
2593 | except: | |
2585 | pass |
|
2594 | pass | |
2586 |
|
2595 | |||
2587 | delay = '' |
|
2596 | delay = '' | |
2588 | try: |
|
2597 | try: | |
2589 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2598 | delay = operationObj.getParameterValue(parameterName='delay') | |
2590 | except: |
|
2599 | except: | |
2591 | pass |
|
2600 | pass | |
2592 |
|
2601 | |||
2593 | walk = 0 |
|
2602 | walk = 0 | |
2594 | try: |
|
2603 | try: | |
2595 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2604 | walk = operationObj.getParameterValue(parameterName='walk') | |
2596 | except: |
|
2605 | except: | |
2597 | pass |
|
2606 | pass | |
2598 |
|
2607 | |||
2599 | set = '' |
|
2608 | set = '' | |
2600 | try: |
|
2609 | try: | |
2601 | set = operationObj.getParameterValue(parameterName='set') |
|
2610 | set = operationObj.getParameterValue(parameterName='set') | |
2602 | except: |
|
2611 | except: | |
2603 | pass |
|
2612 | pass | |
2604 |
|
2613 | |||
2605 | expLabel = '' |
|
2614 | expLabel = '' | |
2606 | try: |
|
2615 | try: | |
2607 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2616 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2608 | except: |
|
2617 | except: | |
2609 | pass |
|
2618 | pass | |
2610 |
|
2619 | |||
2611 | ippKm = '' |
|
2620 | ippKm = '' | |
2612 | if datatype.lower() == 'usrp': |
|
2621 | if datatype.lower() == 'usrp': | |
2613 | try: |
|
2622 | try: | |
2614 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2623 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2615 | except: |
|
2624 | except: | |
2616 | pass |
|
2625 | pass | |
2617 |
|
2626 | |||
2618 | projectParms = ProjectParms() |
|
2627 | projectParms = ProjectParms() | |
2619 |
|
2628 | |||
2620 | projectParms.name = project_name |
|
2629 | projectParms.name = project_name | |
2621 | projectParms.description = description |
|
2630 | projectParms.description = description | |
2622 | projectParms.datatype = datatype |
|
2631 | projectParms.datatype = datatype | |
2623 | projectParms.ext = None |
|
2632 | projectParms.ext = None | |
2624 | projectParms.dpath = dpath |
|
2633 | projectParms.dpath = dpath | |
2625 | projectParms.online = online |
|
2634 | projectParms.online = online | |
2626 | projectParms.startDate = startDate |
|
2635 | projectParms.startDate = startDate | |
2627 | projectParms.endDate = endDate |
|
2636 | projectParms.endDate = endDate | |
2628 | projectParms.startTime = startTime |
|
2637 | projectParms.startTime = startTime | |
2629 | projectParms.endTime = endTime |
|
2638 | projectParms.endTime = endTime | |
2630 | projectParms.delay=delay |
|
2639 | projectParms.delay=delay | |
2631 | projectParms.walk=walk |
|
2640 | projectParms.walk=walk | |
2632 | projectParms.set=set |
|
2641 | projectParms.set=set | |
2633 | projectParms.ippKm=ippKm |
|
2642 | projectParms.ippKm=ippKm | |
2634 | projectParms.expLabel = expLabel |
|
2643 | projectParms.expLabel = expLabel | |
2635 | projectParms.parmsOk=parms_ok |
|
2644 | projectParms.parmsOk=parms_ok | |
2636 |
|
2645 | |||
2637 | return projectParms |
|
2646 | return projectParms | |
2638 |
|
2647 | |||
2639 | def refreshProjectWindow(self, projectObjView): |
|
2648 | def refreshProjectWindow(self, projectObjView): | |
2640 |
|
2649 | |||
2641 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2650 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2642 |
|
2651 | |||
2643 | index = projectParms.getDatatypeIndex() |
|
2652 | index = projectParms.getDatatypeIndex() | |
2644 |
|
2653 | |||
2645 | self.proName.setText(projectParms.name) |
|
2654 | self.proName.setText(projectParms.name) | |
2646 | self.proDescription.clear() |
|
2655 | self.proDescription.clear() | |
2647 | self.proDescription.append(projectParms.description) |
|
2656 | self.proDescription.append(projectParms.description) | |
2648 |
|
2657 | |||
2649 | self.on_proComDataType_activated(index=index) |
|
2658 | self.on_proComDataType_activated(index=index) | |
2650 | self.proDataPath.setText(projectParms.dpath) |
|
2659 | self.proDataPath.setText(projectParms.dpath) | |
2651 | self.proComDataType.setCurrentIndex(index) |
|
2660 | self.proComDataType.setCurrentIndex(index) | |
2652 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2661 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2653 | self.proDelay.setText(str(projectParms.delay)) |
|
2662 | self.proDelay.setText(str(projectParms.delay)) | |
2654 | self.proSet.setText(str(projectParms.set)) |
|
2663 | self.proSet.setText(str(projectParms.set)) | |
2655 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2664 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2656 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2665 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2657 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2666 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2658 |
|
2667 | |||
2659 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2668 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2660 | ext = projectParms.getExt(), |
|
2669 | ext = projectParms.getExt(), | |
2661 | walk = projectParms.walk, |
|
2670 | walk = projectParms.walk, | |
2662 | expLabel = projectParms.expLabel) |
|
2671 | expLabel = projectParms.expLabel) | |
2663 |
|
2672 | |||
2664 | try: |
|
2673 | try: | |
2665 | startDateIndex = dateList.index(projectParms.startDate) |
|
2674 | startDateIndex = dateList.index(projectParms.startDate) | |
2666 | except: |
|
2675 | except: | |
2667 | startDateIndex = 0 |
|
2676 | startDateIndex = 0 | |
2668 |
|
2677 | |||
2669 | try: |
|
2678 | try: | |
2670 | endDateIndex = dateList.index(projectParms.endDate) |
|
2679 | endDateIndex = dateList.index(projectParms.endDate) | |
2671 | except: |
|
2680 | except: | |
2672 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2681 | endDateIndex = int(self.proComEndDate.count()-1) | |
2673 |
|
2682 | |||
2674 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2683 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2675 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2684 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2676 |
|
2685 | |||
2677 | startlist = projectParms.startTime.split(":") |
|
2686 | startlist = projectParms.startTime.split(":") | |
2678 | endlist = projectParms.endTime.split(":") |
|
2687 | endlist = projectParms.endTime.split(":") | |
2679 |
|
2688 | |||
2680 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2689 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2681 | self.proStartTime.setTime(self.time) |
|
2690 | self.proStartTime.setTime(self.time) | |
2682 |
|
2691 | |||
2683 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2692 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2684 | self.proEndTime.setTime(self.time) |
|
2693 | self.proEndTime.setTime(self.time) | |
2685 |
|
2694 | |||
2686 |
|
2695 | |||
2687 | def __refreshVoltageWindow(self, puObj): |
|
2696 | def __refreshVoltageWindow(self, puObj): | |
2688 |
|
2697 | |||
2689 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2698 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2690 | if opObj == None: |
|
2699 | if opObj == None: | |
2691 | self.volOpRadarfrequency.clear() |
|
2700 | self.volOpRadarfrequency.clear() | |
2692 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2701 | self.volOpCebRadarfrequency.setCheckState(0) | |
2693 | else: |
|
2702 | else: | |
2694 | value = opObj.getParameterValue(parameterName='frequency') |
|
2703 | value = opObj.getParameterValue(parameterName='frequency') | |
2695 | value = str(float(value)/1e6) |
|
2704 | value = str(float(value)/1e6) | |
2696 | self.volOpRadarfrequency.setText(value) |
|
2705 | self.volOpRadarfrequency.setText(value) | |
2697 | self.volOpRadarfrequency.setEnabled(True) |
|
2706 | self.volOpRadarfrequency.setEnabled(True) | |
2698 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2707 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2699 |
|
2708 | |||
2700 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2709 | opObj = puObj.getOperationObj(name="selectChannels") | |
2701 |
|
2710 | |||
2702 | if opObj == None: |
|
2711 | if opObj == None: | |
2703 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2712 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2704 |
|
2713 | |||
2705 | if opObj == None: |
|
2714 | if opObj == None: | |
2706 | self.volOpChannel.clear() |
|
2715 | self.volOpChannel.clear() | |
2707 | self.volOpCebChannels.setCheckState(0) |
|
2716 | self.volOpCebChannels.setCheckState(0) | |
2708 | else: |
|
2717 | else: | |
2709 | channelEnabled = False |
|
2718 | channelEnabled = False | |
2710 | try: |
|
2719 | try: | |
2711 | value = opObj.getParameterValue(parameterName='channelList') |
|
2720 | value = opObj.getParameterValue(parameterName='channelList') | |
2712 | value = str(value)[1:-1] |
|
2721 | value = str(value)[1:-1] | |
2713 | channelEnabled = True |
|
2722 | channelEnabled = True | |
2714 | channelMode = 0 |
|
2723 | channelMode = 0 | |
2715 | except: |
|
2724 | except: | |
2716 | pass |
|
2725 | pass | |
2717 | try: |
|
2726 | try: | |
2718 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2727 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2719 | value = str(value)[1:-1] |
|
2728 | value = str(value)[1:-1] | |
2720 | channelEnabled = True |
|
2729 | channelEnabled = True | |
2721 | channelMode = 1 |
|
2730 | channelMode = 1 | |
2722 | except: |
|
2731 | except: | |
2723 | pass |
|
2732 | pass | |
2724 |
|
2733 | |||
2725 | if channelEnabled: |
|
2734 | if channelEnabled: | |
2726 | self.volOpChannel.setText(value) |
|
2735 | self.volOpChannel.setText(value) | |
2727 | self.volOpChannel.setEnabled(True) |
|
2736 | self.volOpChannel.setEnabled(True) | |
2728 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2737 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2729 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2738 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2730 |
|
2739 | |||
2731 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2740 | opObj = puObj.getOperationObj(name="selectHeights") | |
2732 | if opObj == None: |
|
2741 | if opObj == None: | |
2733 | self.volOpHeights.clear() |
|
2742 | self.volOpHeights.clear() | |
2734 | self.volOpCebHeights.setCheckState(0) |
|
2743 | self.volOpCebHeights.setCheckState(0) | |
2735 | else: |
|
2744 | else: | |
2736 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
2745 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
2737 | value1 = str(value1) |
|
2746 | value1 = str(value1) | |
2738 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
2747 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
2739 | value2 = str(value2) |
|
2748 | value2 = str(value2) | |
2740 | value = value1 + "," + value2 |
|
2749 | value = value1 + "," + value2 | |
2741 | self.volOpHeights.setText(value) |
|
2750 | self.volOpHeights.setText(value) | |
2742 | self.volOpHeights.setEnabled(True) |
|
2751 | self.volOpHeights.setEnabled(True) | |
2743 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2752 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2744 |
|
2753 | |||
2745 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2754 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2746 | if opObj == None: |
|
2755 | if opObj == None: | |
2747 | self.volOpFilter.clear() |
|
2756 | self.volOpFilter.clear() | |
2748 | self.volOpCebFilter.setCheckState(0) |
|
2757 | self.volOpCebFilter.setCheckState(0) | |
2749 | else: |
|
2758 | else: | |
2750 | value = opObj.getParameterValue(parameterName='window') |
|
2759 | value = opObj.getParameterValue(parameterName='window') | |
2751 | value = str(value) |
|
2760 | value = str(value) | |
2752 | self.volOpFilter.setText(value) |
|
2761 | self.volOpFilter.setText(value) | |
2753 | self.volOpFilter.setEnabled(True) |
|
2762 | self.volOpFilter.setEnabled(True) | |
2754 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2763 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2755 |
|
2764 | |||
2756 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2765 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2757 | if opObj == None: |
|
2766 | if opObj == None: | |
2758 | self.volOpProfile.clear() |
|
2767 | self.volOpProfile.clear() | |
2759 | self.volOpCebProfile.setCheckState(0) |
|
2768 | self.volOpCebProfile.setCheckState(0) | |
2760 | else: |
|
2769 | else: | |
2761 | for parmObj in opObj.getParameterObjList(): |
|
2770 | for parmObj in opObj.getParameterObjList(): | |
2762 |
|
2771 | |||
2763 | if parmObj.name == "profileList": |
|
2772 | if parmObj.name == "profileList": | |
2764 | value = parmObj.getValue() |
|
2773 | value = parmObj.getValue() | |
2765 | value = str(value)[1:-1] |
|
2774 | value = str(value)[1:-1] | |
2766 | self.volOpProfile.setText(value) |
|
2775 | self.volOpProfile.setText(value) | |
2767 | self.volOpProfile.setEnabled(True) |
|
2776 | self.volOpProfile.setEnabled(True) | |
2768 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2777 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2769 | self.volOpComProfile.setCurrentIndex(0) |
|
2778 | self.volOpComProfile.setCurrentIndex(0) | |
2770 |
|
2779 | |||
2771 | if parmObj.name == "profileRangeList": |
|
2780 | if parmObj.name == "profileRangeList": | |
2772 | value = parmObj.getValue() |
|
2781 | value = parmObj.getValue() | |
2773 | value = str(value)[1:-1] |
|
2782 | value = str(value)[1:-1] | |
2774 | self.volOpProfile.setText(value) |
|
2783 | self.volOpProfile.setText(value) | |
2775 | self.volOpProfile.setEnabled(True) |
|
2784 | self.volOpProfile.setEnabled(True) | |
2776 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2785 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2777 | self.volOpComProfile.setCurrentIndex(1) |
|
2786 | self.volOpComProfile.setCurrentIndex(1) | |
2778 |
|
2787 | |||
2779 | if parmObj.name == "rangeList": |
|
2788 | if parmObj.name == "rangeList": | |
2780 | value = parmObj.getValue() |
|
2789 | value = parmObj.getValue() | |
2781 | value = str(value)[1:-1] |
|
2790 | value = str(value)[1:-1] | |
2782 | self.volOpProfile.setText(value) |
|
2791 | self.volOpProfile.setText(value) | |
2783 | self.volOpProfile.setEnabled(True) |
|
2792 | self.volOpProfile.setEnabled(True) | |
2784 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2793 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2785 | self.volOpComProfile.setCurrentIndex(2) |
|
2794 | self.volOpComProfile.setCurrentIndex(2) | |
2786 |
|
2795 | |||
2787 | opObj = puObj.getOperationObj(name="Decoder") |
|
2796 | opObj = puObj.getOperationObj(name="Decoder") | |
2788 | self.volOpCode.setText("") |
|
2797 | self.volOpCode.setText("") | |
2789 | if opObj == None: |
|
2798 | if opObj == None: | |
2790 | self.volOpCebDecodification.setCheckState(0) |
|
2799 | self.volOpCebDecodification.setCheckState(0) | |
2791 | else: |
|
2800 | else: | |
2792 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2801 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2793 |
|
2802 | |||
2794 | parmObj = opObj.getParameterObj('code') |
|
2803 | parmObj = opObj.getParameterObj('code') | |
2795 |
|
2804 | |||
2796 | if parmObj == None: |
|
2805 | if parmObj == None: | |
2797 | self.volOpComCode.setCurrentIndex(0) |
|
2806 | self.volOpComCode.setCurrentIndex(0) | |
2798 | else: |
|
2807 | else: | |
2799 |
|
2808 | |||
2800 | parmObj1 = opObj.getParameterObj('nCode') |
|
2809 | parmObj1 = opObj.getParameterObj('nCode') | |
2801 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2810 | parmObj2 = opObj.getParameterObj('nBaud') | |
2802 |
|
2811 | |||
2803 | if parmObj1 == None or parmObj2 == None: |
|
2812 | if parmObj1 == None or parmObj2 == None: | |
2804 | self.volOpComCode.setCurrentIndex(0) |
|
2813 | self.volOpComCode.setCurrentIndex(0) | |
2805 | else: |
|
2814 | else: | |
2806 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2815 | code = ast.literal_eval(str(parmObj.getValue())) | |
2807 | nCode = parmObj1.getValue() |
|
2816 | nCode = parmObj1.getValue() | |
2808 | nBaud = parmObj2.getValue() |
|
2817 | nBaud = parmObj2.getValue() | |
2809 |
|
2818 | |||
2810 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2819 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2811 |
|
2820 | |||
2812 | #User defined by default |
|
2821 | #User defined by default | |
2813 | self.volOpComCode.setCurrentIndex(13) |
|
2822 | self.volOpComCode.setCurrentIndex(13) | |
2814 | self.volOpCode.setText(str(code)) |
|
2823 | self.volOpCode.setText(str(code)) | |
2815 |
|
2824 | |||
2816 | if nCode == 1: |
|
2825 | if nCode == 1: | |
2817 | if nBaud == 3: |
|
2826 | if nBaud == 3: | |
2818 | self.volOpComCode.setCurrentIndex(1) |
|
2827 | self.volOpComCode.setCurrentIndex(1) | |
2819 | if nBaud == 4: |
|
2828 | if nBaud == 4: | |
2820 | self.volOpComCode.setCurrentIndex(2) |
|
2829 | self.volOpComCode.setCurrentIndex(2) | |
2821 | if nBaud == 5: |
|
2830 | if nBaud == 5: | |
2822 | self.volOpComCode.setCurrentIndex(3) |
|
2831 | self.volOpComCode.setCurrentIndex(3) | |
2823 | if nBaud == 7: |
|
2832 | if nBaud == 7: | |
2824 | self.volOpComCode.setCurrentIndex(4) |
|
2833 | self.volOpComCode.setCurrentIndex(4) | |
2825 | if nBaud == 11: |
|
2834 | if nBaud == 11: | |
2826 | self.volOpComCode.setCurrentIndex(5) |
|
2835 | self.volOpComCode.setCurrentIndex(5) | |
2827 | if nBaud == 13: |
|
2836 | if nBaud == 13: | |
2828 | self.volOpComCode.setCurrentIndex(6) |
|
2837 | self.volOpComCode.setCurrentIndex(6) | |
2829 |
|
2838 | |||
2830 | if nCode == 2: |
|
2839 | if nCode == 2: | |
2831 | if nBaud == 3: |
|
2840 | if nBaud == 3: | |
2832 | self.volOpComCode.setCurrentIndex(7) |
|
2841 | self.volOpComCode.setCurrentIndex(7) | |
2833 | if nBaud == 4: |
|
2842 | if nBaud == 4: | |
2834 | self.volOpComCode.setCurrentIndex(8) |
|
2843 | self.volOpComCode.setCurrentIndex(8) | |
2835 | if nBaud == 5: |
|
2844 | if nBaud == 5: | |
2836 | self.volOpComCode.setCurrentIndex(9) |
|
2845 | self.volOpComCode.setCurrentIndex(9) | |
2837 | if nBaud == 7: |
|
2846 | if nBaud == 7: | |
2838 | self.volOpComCode.setCurrentIndex(10) |
|
2847 | self.volOpComCode.setCurrentIndex(10) | |
2839 | if nBaud == 11: |
|
2848 | if nBaud == 11: | |
2840 | self.volOpComCode.setCurrentIndex(11) |
|
2849 | self.volOpComCode.setCurrentIndex(11) | |
2841 | if nBaud == 13: |
|
2850 | if nBaud == 13: | |
2842 | self.volOpComCode.setCurrentIndex(12) |
|
2851 | self.volOpComCode.setCurrentIndex(12) | |
2843 |
|
2852 | |||
2844 |
|
2853 | |||
2845 | opObj = puObj.getOperationObj(name="deFlip") |
|
2854 | opObj = puObj.getOperationObj(name="deFlip") | |
2846 | if opObj == None: |
|
2855 | if opObj == None: | |
2847 | self.volOpFlip.clear() |
|
2856 | self.volOpFlip.clear() | |
2848 | self.volOpFlip.setEnabled(False) |
|
2857 | self.volOpFlip.setEnabled(False) | |
2849 | self.volOpCebFlip.setCheckState(0) |
|
2858 | self.volOpCebFlip.setCheckState(0) | |
2850 | else: |
|
2859 | else: | |
2851 | try: |
|
2860 | try: | |
2852 | value = opObj.getParameterValue(parameterName='channelList') |
|
2861 | value = opObj.getParameterValue(parameterName='channelList') | |
2853 | value = str(value)[1:-1] |
|
2862 | value = str(value)[1:-1] | |
2854 | except: |
|
2863 | except: | |
2855 | value = "" |
|
2864 | value = "" | |
2856 |
|
2865 | |||
2857 | self.volOpFlip.setText(value) |
|
2866 | self.volOpFlip.setText(value) | |
2858 | self.volOpFlip.setEnabled(True) |
|
2867 | self.volOpFlip.setEnabled(True) | |
2859 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2868 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2860 |
|
2869 | |||
2861 | opObj = puObj.getOperationObj(name="CohInt") |
|
2870 | opObj = puObj.getOperationObj(name="CohInt") | |
2862 | if opObj == None: |
|
2871 | if opObj == None: | |
2863 | self.volOpCohInt.clear() |
|
2872 | self.volOpCohInt.clear() | |
2864 | self.volOpCebCohInt.setCheckState(0) |
|
2873 | self.volOpCebCohInt.setCheckState(0) | |
2865 | else: |
|
2874 | else: | |
2866 | value = opObj.getParameterValue(parameterName='n') |
|
2875 | value = opObj.getParameterValue(parameterName='n') | |
2867 | self.volOpCohInt.setText(str(value)) |
|
2876 | self.volOpCohInt.setText(str(value)) | |
2868 | self.volOpCohInt.setEnabled(True) |
|
2877 | self.volOpCohInt.setEnabled(True) | |
2869 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2878 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2870 |
|
2879 | |||
2871 | opObj = puObj.getOperationObj(name='Scope') |
|
2880 | opObj = puObj.getOperationObj(name='Scope') | |
2872 | if opObj == None: |
|
2881 | if opObj == None: | |
2873 | self.volGraphCebshow.setCheckState(0) |
|
2882 | self.volGraphCebshow.setCheckState(0) | |
2874 | else: |
|
2883 | else: | |
2875 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2884 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2876 |
|
2885 | |||
2877 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2886 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2878 |
|
2887 | |||
2879 | if parmObj == None: |
|
2888 | if parmObj == None: | |
2880 | self.volGraphChannelList.clear() |
|
2889 | self.volGraphChannelList.clear() | |
2881 | else: |
|
2890 | else: | |
2882 | value = parmObj.getValue() |
|
2891 | value = parmObj.getValue() | |
2883 | value = str(value) |
|
2892 | value = str(value) | |
2884 | self.volGraphChannelList.setText(value) |
|
2893 | self.volGraphChannelList.setText(value) | |
2885 | self.volOpProfile.setEnabled(True) |
|
2894 | self.volOpProfile.setEnabled(True) | |
2886 |
|
2895 | |||
2887 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2896 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2888 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2897 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2889 |
|
2898 | |||
2890 | if parmObj1 == None or parmObj2 ==None: |
|
2899 | if parmObj1 == None or parmObj2 ==None: | |
2891 | self.volGraphfreqrange.clear() |
|
2900 | self.volGraphfreqrange.clear() | |
2892 | else: |
|
2901 | else: | |
2893 | value1 = parmObj1.getValue() |
|
2902 | value1 = parmObj1.getValue() | |
2894 | value1 = str(value1) |
|
2903 | value1 = str(value1) | |
2895 | value2 = parmObj2.getValue() |
|
2904 | value2 = parmObj2.getValue() | |
2896 | value2 = str(value2) |
|
2905 | value2 = str(value2) | |
2897 | value = value1 + "," + value2 |
|
2906 | value = value1 + "," + value2 | |
2898 | self.volGraphfreqrange.setText(value) |
|
2907 | self.volGraphfreqrange.setText(value) | |
2899 |
|
2908 | |||
2900 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2909 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2901 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2910 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2902 |
|
2911 | |||
2903 | if parmObj1 == None or parmObj2 ==None: |
|
2912 | if parmObj1 == None or parmObj2 ==None: | |
2904 | self.volGraphHeightrange.clear() |
|
2913 | self.volGraphHeightrange.clear() | |
2905 | else: |
|
2914 | else: | |
2906 | value1 = parmObj1.getValue() |
|
2915 | value1 = parmObj1.getValue() | |
2907 | value1 = str(value1) |
|
2916 | value1 = str(value1) | |
2908 | value2 = parmObj2.getValue() |
|
2917 | value2 = parmObj2.getValue() | |
2909 | value2 = str(value2) |
|
2918 | value2 = str(value2) | |
2910 | value = value1 + "," + value2 |
|
2919 | value = value1 + "," + value2 | |
2911 | value2 = str(value2) |
|
2920 | value2 = str(value2) | |
2912 | self.volGraphHeightrange.setText(value) |
|
2921 | self.volGraphHeightrange.setText(value) | |
2913 |
|
2922 | |||
2914 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2923 | parmObj = opObj.getParameterObj(parameterName='save') | |
2915 |
|
2924 | |||
2916 | if parmObj == None: |
|
2925 | if parmObj == None: | |
2917 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2926 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2918 | else: |
|
2927 | else: | |
2919 | value = parmObj.getValue() |
|
2928 | value = parmObj.getValue() | |
2920 | if int(value): |
|
2929 | if int(value): | |
2921 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2930 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2922 | else: |
|
2931 | else: | |
2923 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2932 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2924 |
|
2933 | |||
2925 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2934 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2926 | if parmObj == None: |
|
2935 | if parmObj == None: | |
2927 | self.volGraphPath.clear() |
|
2936 | self.volGraphPath.clear() | |
2928 | else: |
|
2937 | else: | |
2929 | value = parmObj.getValue() |
|
2938 | value = parmObj.getValue() | |
2930 | path = str(value) |
|
2939 | path = str(value) | |
2931 | self.volGraphPath.setText(path) |
|
2940 | self.volGraphPath.setText(path) | |
2932 |
|
2941 | |||
2933 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2942 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2934 | if parmObj == None: |
|
2943 | if parmObj == None: | |
2935 | self.volGraphPrefix.clear() |
|
2944 | self.volGraphPrefix.clear() | |
2936 | else: |
|
2945 | else: | |
2937 | value = parmObj.getValue() |
|
2946 | value = parmObj.getValue() | |
2938 | figfile = str(value) |
|
2947 | figfile = str(value) | |
2939 | self.volGraphPrefix.setText(figfile) |
|
2948 | self.volGraphPrefix.setText(figfile) | |
2940 |
|
2949 | |||
2941 | # outputVoltageWrite |
|
2950 | # outputVoltageWrite | |
2942 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2951 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2943 |
|
2952 | |||
2944 | if opObj == None: |
|
2953 | if opObj == None: | |
2945 | self.volOutputPath.clear() |
|
2954 | self.volOutputPath.clear() | |
2946 | self.volOutputblocksperfile.clear() |
|
2955 | self.volOutputblocksperfile.clear() | |
2947 | self.volOutputprofilesperblock.clear() |
|
2956 | self.volOutputprofilesperblock.clear() | |
2948 | else: |
|
2957 | else: | |
2949 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2958 | parmObj = opObj.getParameterObj(parameterName='path') | |
2950 | if parmObj == None: |
|
2959 | if parmObj == None: | |
2951 | self.volOutputPath.clear() |
|
2960 | self.volOutputPath.clear() | |
2952 | else: |
|
2961 | else: | |
2953 | value = parmObj.getValue() |
|
2962 | value = parmObj.getValue() | |
2954 | path = str(value) |
|
2963 | path = str(value) | |
2955 | self.volOutputPath.setText(path) |
|
2964 | self.volOutputPath.setText(path) | |
2956 |
|
2965 | |||
2957 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2966 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2958 | if parmObj == None: |
|
2967 | if parmObj == None: | |
2959 | self.volOutputblocksperfile.clear() |
|
2968 | self.volOutputblocksperfile.clear() | |
2960 | else: |
|
2969 | else: | |
2961 | value = parmObj.getValue() |
|
2970 | value = parmObj.getValue() | |
2962 | blocksperfile = str(value) |
|
2971 | blocksperfile = str(value) | |
2963 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2972 | self.volOutputblocksperfile.setText(blocksperfile) | |
2964 |
|
2973 | |||
2965 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2974 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2966 | if parmObj == None: |
|
2975 | if parmObj == None: | |
2967 | self.volOutputprofilesperblock.clear() |
|
2976 | self.volOutputprofilesperblock.clear() | |
2968 | else: |
|
2977 | else: | |
2969 | value = parmObj.getValue() |
|
2978 | value = parmObj.getValue() | |
2970 | profilesPerBlock = str(value) |
|
2979 | profilesPerBlock = str(value) | |
2971 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2980 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2972 |
|
2981 | |||
2973 | return |
|
2982 | return | |
2974 |
|
2983 | |||
2975 | def __refreshSpectraWindow(self, puObj): |
|
2984 | def __refreshSpectraWindow(self, puObj): | |
2976 |
|
2985 | |||
2977 | inputId = puObj.getInputId() |
|
2986 | inputId = puObj.getInputId() | |
2978 | inputPUObj = self.__puObjDict[inputId] |
|
2987 | inputPUObj = self.__puObjDict[inputId] | |
2979 |
|
2988 | |||
2980 | if inputPUObj.datatype == 'Voltage': |
|
2989 | if inputPUObj.datatype == 'Voltage': | |
2981 | self.specOpnFFTpoints.setEnabled(True) |
|
2990 | self.specOpnFFTpoints.setEnabled(True) | |
2982 | self.specOpProfiles.setEnabled(True) |
|
2991 | self.specOpProfiles.setEnabled(True) | |
2983 | self.specOpippFactor.setEnabled(True) |
|
2992 | self.specOpippFactor.setEnabled(True) | |
2984 | else: |
|
2993 | else: | |
2985 | self.specOpnFFTpoints.setEnabled(False) |
|
2994 | self.specOpnFFTpoints.setEnabled(False) | |
2986 | self.specOpProfiles.setEnabled(False) |
|
2995 | self.specOpProfiles.setEnabled(False) | |
2987 | self.specOpippFactor.setEnabled(False) |
|
2996 | self.specOpippFactor.setEnabled(False) | |
2988 |
|
2997 | |||
2989 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2998 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2990 | if opObj == None: |
|
2999 | if opObj == None: | |
2991 | self.specOpRadarfrequency.clear() |
|
3000 | self.specOpRadarfrequency.clear() | |
2992 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3001 | self.specOpCebRadarfrequency.setCheckState(0) | |
2993 | else: |
|
3002 | else: | |
2994 | value = opObj.getParameterValue(parameterName='frequency') |
|
3003 | value = opObj.getParameterValue(parameterName='frequency') | |
2995 | value = str(float(value)/1e6) |
|
3004 | value = str(float(value)/1e6) | |
2996 | self.specOpRadarfrequency.setText(value) |
|
3005 | self.specOpRadarfrequency.setText(value) | |
2997 | self.specOpRadarfrequency.setEnabled(True) |
|
3006 | self.specOpRadarfrequency.setEnabled(True) | |
2998 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3007 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2999 |
|
3008 | |||
3000 | opObj = puObj.getOperationObj(name="run") |
|
3009 | opObj = puObj.getOperationObj(name="run") | |
3001 | if opObj == None: |
|
3010 | if opObj == None: | |
3002 | self.specOpnFFTpoints.clear() |
|
3011 | self.specOpnFFTpoints.clear() | |
3003 | self.specOpProfiles.clear() |
|
3012 | self.specOpProfiles.clear() | |
3004 | self.specOpippFactor.clear() |
|
3013 | self.specOpippFactor.clear() | |
3005 | else: |
|
3014 | else: | |
3006 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3015 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3007 | if parmObj == None: |
|
3016 | if parmObj == None: | |
3008 | self.specOpnFFTpoints.clear() |
|
3017 | self.specOpnFFTpoints.clear() | |
3009 | else: |
|
3018 | else: | |
3010 | self.specOpnFFTpoints.setEnabled(True) |
|
3019 | self.specOpnFFTpoints.setEnabled(True) | |
3011 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3020 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3012 | self.specOpnFFTpoints.setText(str(value)) |
|
3021 | self.specOpnFFTpoints.setText(str(value)) | |
3013 |
|
3022 | |||
3014 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3023 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3015 | if parmObj == None: |
|
3024 | if parmObj == None: | |
3016 | self.specOpProfiles.clear() |
|
3025 | self.specOpProfiles.clear() | |
3017 | else: |
|
3026 | else: | |
3018 | self.specOpProfiles.setEnabled(True) |
|
3027 | self.specOpProfiles.setEnabled(True) | |
3019 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3028 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3020 | self.specOpProfiles.setText(str(value)) |
|
3029 | self.specOpProfiles.setText(str(value)) | |
3021 |
|
3030 | |||
3022 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3031 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3023 | if parmObj == None: |
|
3032 | if parmObj == None: | |
3024 | self.specOpippFactor.clear() |
|
3033 | self.specOpippFactor.clear() | |
3025 | else: |
|
3034 | else: | |
3026 | self.specOpippFactor.setEnabled(True) |
|
3035 | self.specOpippFactor.setEnabled(True) | |
3027 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3036 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3028 | self.specOpippFactor.setText(str(value)) |
|
3037 | self.specOpippFactor.setText(str(value)) | |
3029 |
|
3038 | |||
3030 | opObj = puObj.getOperationObj(name="run") |
|
3039 | opObj = puObj.getOperationObj(name="run") | |
3031 | if opObj == None: |
|
3040 | if opObj == None: | |
3032 | self.specOppairsList.clear() |
|
3041 | self.specOppairsList.clear() | |
3033 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3042 | self.specOpCebCrossSpectra.setCheckState(0) | |
3034 | else: |
|
3043 | else: | |
3035 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3044 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3036 | if parmObj == None: |
|
3045 | if parmObj == None: | |
3037 | self.specOppairsList.clear() |
|
3046 | self.specOppairsList.clear() | |
3038 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3047 | self.specOpCebCrossSpectra.setCheckState(0) | |
3039 | else: |
|
3048 | else: | |
3040 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3049 | value = opObj.getParameterValue(parameterName='pairsList') | |
3041 | value = str(value)[1:-1] |
|
3050 | value = str(value)[1:-1] | |
3042 | self.specOppairsList.setText(str(value)) |
|
3051 | self.specOppairsList.setText(str(value)) | |
3043 | self.specOppairsList.setEnabled(True) |
|
3052 | self.specOppairsList.setEnabled(True) | |
3044 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3053 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3045 |
|
3054 | |||
3046 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3055 | opObj = puObj.getOperationObj(name="selectChannels") | |
3047 |
|
3056 | |||
3048 | if opObj == None: |
|
3057 | if opObj == None: | |
3049 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3058 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3050 |
|
3059 | |||
3051 | if opObj == None: |
|
3060 | if opObj == None: | |
3052 | self.specOpChannel.clear() |
|
3061 | self.specOpChannel.clear() | |
3053 | self.specOpCebChannel.setCheckState(0) |
|
3062 | self.specOpCebChannel.setCheckState(0) | |
3054 | else: |
|
3063 | else: | |
3055 | channelEnabled = False |
|
3064 | channelEnabled = False | |
3056 | try: |
|
3065 | try: | |
3057 | value = opObj.getParameterValue(parameterName='channelList') |
|
3066 | value = opObj.getParameterValue(parameterName='channelList') | |
3058 | value = str(value)[1:-1] |
|
3067 | value = str(value)[1:-1] | |
3059 | channelEnabled = True |
|
3068 | channelEnabled = True | |
3060 | channelMode = 0 |
|
3069 | channelMode = 0 | |
3061 | except: |
|
3070 | except: | |
3062 | pass |
|
3071 | pass | |
3063 | try: |
|
3072 | try: | |
3064 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3073 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3065 | value = str(value)[1:-1] |
|
3074 | value = str(value)[1:-1] | |
3066 | channelEnabled = True |
|
3075 | channelEnabled = True | |
3067 | channelMode = 1 |
|
3076 | channelMode = 1 | |
3068 | except: |
|
3077 | except: | |
3069 | pass |
|
3078 | pass | |
3070 |
|
3079 | |||
3071 | if channelEnabled: |
|
3080 | if channelEnabled: | |
3072 | self.specOpChannel.setText(value) |
|
3081 | self.specOpChannel.setText(value) | |
3073 | self.specOpChannel.setEnabled(True) |
|
3082 | self.specOpChannel.setEnabled(True) | |
3074 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3083 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3075 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3084 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3076 |
|
3085 | |||
3077 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3086 | opObj = puObj.getOperationObj(name="selectHeights") | |
3078 | if opObj == None: |
|
3087 | if opObj == None: | |
3079 | self.specOpHeights.clear() |
|
3088 | self.specOpHeights.clear() | |
3080 | self.specOpCebHeights.setCheckState(0) |
|
3089 | self.specOpCebHeights.setCheckState(0) | |
3081 | else: |
|
3090 | else: | |
3082 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3091 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3083 | value1 = str(value1) |
|
3092 | value1 = str(value1) | |
3084 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3093 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3085 | value2 = str(value2) |
|
3094 | value2 = str(value2) | |
3086 | value = value1 + "," + value2 |
|
3095 | value = value1 + "," + value2 | |
3087 | self.specOpHeights.setText(value) |
|
3096 | self.specOpHeights.setText(value) | |
3088 | self.specOpHeights.setEnabled(True) |
|
3097 | self.specOpHeights.setEnabled(True) | |
3089 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3098 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3090 |
|
3099 | |||
3091 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3100 | opObj = puObj.getOperationObj(name="IncohInt") | |
3092 | if opObj == None: |
|
3101 | if opObj == None: | |
3093 | self.specOpIncoherent.clear() |
|
3102 | self.specOpIncoherent.clear() | |
3094 | self.specOpCebIncoherent.setCheckState(0) |
|
3103 | self.specOpCebIncoherent.setCheckState(0) | |
3095 | else: |
|
3104 | else: | |
3096 | for parmObj in opObj.getParameterObjList(): |
|
3105 | for parmObj in opObj.getParameterObjList(): | |
3097 | if parmObj.name == 'timeInterval': |
|
3106 | if parmObj.name == 'timeInterval': | |
3098 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3107 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3099 | value = float(value) |
|
3108 | value = float(value) | |
3100 | self.specOpIncoherent.setText(str(value)) |
|
3109 | self.specOpIncoherent.setText(str(value)) | |
3101 | self.specOpIncoherent.setEnabled(True) |
|
3110 | self.specOpIncoherent.setEnabled(True) | |
3102 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3111 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3103 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3112 | self.specOpCobIncInt.setCurrentIndex(0) | |
3104 |
|
3113 | |||
3105 | if parmObj.name == 'n': |
|
3114 | if parmObj.name == 'n': | |
3106 | value = opObj.getParameterValue(parameterName='n') |
|
3115 | value = opObj.getParameterValue(parameterName='n') | |
3107 | value = float(value) |
|
3116 | value = float(value) | |
3108 | self.specOpIncoherent.setText(str(value)) |
|
3117 | self.specOpIncoherent.setText(str(value)) | |
3109 | self.specOpIncoherent.setEnabled(True) |
|
3118 | self.specOpIncoherent.setEnabled(True) | |
3110 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3119 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3111 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3120 | self.specOpCobIncInt.setCurrentIndex(1) | |
3112 |
|
3121 | |||
3113 | opObj = puObj.getOperationObj(name="removeDC") |
|
3122 | opObj = puObj.getOperationObj(name="removeDC") | |
3114 | if opObj == None: |
|
3123 | if opObj == None: | |
3115 | self.specOpCebRemoveDC.setCheckState(0) |
|
3124 | self.specOpCebRemoveDC.setCheckState(0) | |
3116 | else: |
|
3125 | else: | |
3117 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3126 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3118 | value = opObj.getParameterValue(parameterName='mode') |
|
3127 | value = opObj.getParameterValue(parameterName='mode') | |
3119 | if value == 1: |
|
3128 | if value == 1: | |
3120 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3129 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3121 | elif value == 2: |
|
3130 | elif value == 2: | |
3122 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3131 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3123 |
|
3132 | |||
3124 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3133 | opObj = puObj.getOperationObj(name="removeInterference") | |
3125 | if opObj == None: |
|
3134 | if opObj == None: | |
3126 | self.specOpCebRemoveInt.setCheckState(0) |
|
3135 | self.specOpCebRemoveInt.setCheckState(0) | |
3127 | else: |
|
3136 | else: | |
3128 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3137 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3129 |
|
3138 | |||
3130 | opObj = puObj.getOperationObj(name='getNoise') |
|
3139 | opObj = puObj.getOperationObj(name='getNoise') | |
3131 | if opObj == None: |
|
3140 | if opObj == None: | |
3132 | self.specOpCebgetNoise.setCheckState(0) |
|
3141 | self.specOpCebgetNoise.setCheckState(0) | |
3133 | self.specOpgetNoise.clear() |
|
3142 | self.specOpgetNoise.clear() | |
3134 | else: |
|
3143 | else: | |
3135 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3144 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3136 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3145 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3137 | if parmObj == None: |
|
3146 | if parmObj == None: | |
3138 | self.specOpgetNoise.clear() |
|
3147 | self.specOpgetNoise.clear() | |
3139 | value1 = None |
|
3148 | value1 = None | |
3140 | else: |
|
3149 | else: | |
3141 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3150 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3142 | value1 = str(value1) |
|
3151 | value1 = str(value1) | |
3143 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3152 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3144 | if parmObj == None: |
|
3153 | if parmObj == None: | |
3145 | value2 = None |
|
3154 | value2 = None | |
3146 | value = value1 |
|
3155 | value = value1 | |
3147 | self.specOpgetNoise.setText(value) |
|
3156 | self.specOpgetNoise.setText(value) | |
3148 | self.specOpgetNoise.setEnabled(True) |
|
3157 | self.specOpgetNoise.setEnabled(True) | |
3149 | else: |
|
3158 | else: | |
3150 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3159 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3151 | value2 = str(value2) |
|
3160 | value2 = str(value2) | |
3152 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3161 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3153 | if parmObj == None: |
|
3162 | if parmObj == None: | |
3154 | value3 = None |
|
3163 | value3 = None | |
3155 | value = value1 + "," + value2 |
|
3164 | value = value1 + "," + value2 | |
3156 | self.specOpgetNoise.setText(value) |
|
3165 | self.specOpgetNoise.setText(value) | |
3157 | self.specOpgetNoise.setEnabled(True) |
|
3166 | self.specOpgetNoise.setEnabled(True) | |
3158 | else: |
|
3167 | else: | |
3159 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3168 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3160 | value3 = str(value3) |
|
3169 | value3 = str(value3) | |
3161 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3170 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3162 | if parmObj == None: |
|
3171 | if parmObj == None: | |
3163 | value4 = None |
|
3172 | value4 = None | |
3164 | value = value1 + "," + value2 + "," + value3 |
|
3173 | value = value1 + "," + value2 + "," + value3 | |
3165 | self.specOpgetNoise.setText(value) |
|
3174 | self.specOpgetNoise.setText(value) | |
3166 | self.specOpgetNoise.setEnabled(True) |
|
3175 | self.specOpgetNoise.setEnabled(True) | |
3167 | else: |
|
3176 | else: | |
3168 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3177 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3169 | value4 = str(value4) |
|
3178 | value4 = str(value4) | |
3170 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3179 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3171 | self.specOpgetNoise.setText(value) |
|
3180 | self.specOpgetNoise.setText(value) | |
3172 | self.specOpgetNoise.setEnabled(True) |
|
3181 | self.specOpgetNoise.setEnabled(True) | |
3173 |
|
3182 | |||
3174 | self.specGraphPath.clear() |
|
3183 | self.specGraphPath.clear() | |
3175 | self.specGraphPrefix.clear() |
|
3184 | self.specGraphPrefix.clear() | |
3176 | self.specGgraphFreq.clear() |
|
3185 | self.specGgraphFreq.clear() | |
3177 | self.specGgraphHeight.clear() |
|
3186 | self.specGgraphHeight.clear() | |
3178 | self.specGgraphDbsrange.clear() |
|
3187 | self.specGgraphDbsrange.clear() | |
3179 | self.specGgraphmagnitud.clear() |
|
3188 | self.specGgraphmagnitud.clear() | |
3180 | self.specGgraphPhase.clear() |
|
3189 | self.specGgraphPhase.clear() | |
3181 | self.specGgraphChannelList.clear() |
|
3190 | self.specGgraphChannelList.clear() | |
3182 | self.specGgraphTminTmax.clear() |
|
3191 | self.specGgraphTminTmax.clear() | |
3183 | self.specGgraphTimeRange.clear() |
|
3192 | self.specGgraphTimeRange.clear() | |
3184 | self.specGgraphftpratio.clear() |
|
3193 | self.specGgraphftpratio.clear() | |
3185 |
|
3194 | |||
3186 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3195 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3187 |
|
3196 | |||
3188 | if opObj == None: |
|
3197 | if opObj == None: | |
3189 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3198 | self.specGraphCebSpectraplot.setCheckState(0) | |
3190 | self.specGraphSaveSpectra.setCheckState(0) |
|
3199 | self.specGraphSaveSpectra.setCheckState(0) | |
3191 | self.specGraphftpSpectra.setCheckState(0) |
|
3200 | self.specGraphftpSpectra.setCheckState(0) | |
3192 | else: |
|
3201 | else: | |
3193 | operationSpectraPlot = "Enable" |
|
3202 | operationSpectraPlot = "Enable" | |
3194 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3203 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3195 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3204 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3196 | if parmObj == None: |
|
3205 | if parmObj == None: | |
3197 | self.specGgraphChannelList.clear() |
|
3206 | self.specGgraphChannelList.clear() | |
3198 | else: |
|
3207 | else: | |
3199 | value = opObj.getParameterValue(parameterName='channelList') |
|
3208 | value = opObj.getParameterValue(parameterName='channelList') | |
3200 | channelListSpectraPlot = str(value)[1:-1] |
|
3209 | channelListSpectraPlot = str(value)[1:-1] | |
3201 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3210 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3202 | self.specGgraphChannelList.setEnabled(True) |
|
3211 | self.specGgraphChannelList.setEnabled(True) | |
3203 |
|
3212 | |||
3204 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3213 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3205 | if parmObj == None: |
|
3214 | if parmObj == None: | |
3206 | self.specGgraphFreq.clear() |
|
3215 | self.specGgraphFreq.clear() | |
3207 | else: |
|
3216 | else: | |
3208 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3217 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3209 | value1 = str(value1) |
|
3218 | value1 = str(value1) | |
3210 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3219 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3211 | value2 = str(value2) |
|
3220 | value2 = str(value2) | |
3212 | value = value1 + "," + value2 |
|
3221 | value = value1 + "," + value2 | |
3213 | self.specGgraphFreq.setText(value) |
|
3222 | self.specGgraphFreq.setText(value) | |
3214 | self.specGgraphFreq.setEnabled(True) |
|
3223 | self.specGgraphFreq.setEnabled(True) | |
3215 |
|
3224 | |||
3216 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3225 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3217 | if parmObj == None: |
|
3226 | if parmObj == None: | |
3218 | self.specGgraphHeight.clear() |
|
3227 | self.specGgraphHeight.clear() | |
3219 | else: |
|
3228 | else: | |
3220 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3229 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3221 | value1 = str(value1) |
|
3230 | value1 = str(value1) | |
3222 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3231 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3223 | value2 = str(value2) |
|
3232 | value2 = str(value2) | |
3224 | value = value1 + "," + value2 |
|
3233 | value = value1 + "," + value2 | |
3225 | self.specGgraphHeight.setText(value) |
|
3234 | self.specGgraphHeight.setText(value) | |
3226 | self.specGgraphHeight.setEnabled(True) |
|
3235 | self.specGgraphHeight.setEnabled(True) | |
3227 |
|
3236 | |||
3228 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3237 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3229 | if parmObj == None: |
|
3238 | if parmObj == None: | |
3230 | self.specGgraphDbsrange.clear() |
|
3239 | self.specGgraphDbsrange.clear() | |
3231 | else: |
|
3240 | else: | |
3232 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3241 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3233 | value1 = str(value1) |
|
3242 | value1 = str(value1) | |
3234 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3243 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3235 | value2 = str(value2) |
|
3244 | value2 = str(value2) | |
3236 | value = value1 + "," + value2 |
|
3245 | value = value1 + "," + value2 | |
3237 | self.specGgraphDbsrange.setText(value) |
|
3246 | self.specGgraphDbsrange.setText(value) | |
3238 | self.specGgraphDbsrange.setEnabled(True) |
|
3247 | self.specGgraphDbsrange.setEnabled(True) | |
3239 |
|
3248 | |||
3240 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3249 | parmObj = opObj.getParameterObj(parameterName="save") | |
3241 | if parmObj == None: |
|
3250 | if parmObj == None: | |
3242 | self.specGraphSaveSpectra.setCheckState(0) |
|
3251 | self.specGraphSaveSpectra.setCheckState(0) | |
3243 | else: |
|
3252 | else: | |
3244 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3253 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3245 |
|
3254 | |||
3246 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3255 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3247 | if parmObj == None: |
|
3256 | if parmObj == None: | |
3248 | self.specGraphftpSpectra.setCheckState(0) |
|
3257 | self.specGraphftpSpectra.setCheckState(0) | |
3249 | else: |
|
3258 | else: | |
3250 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3259 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3251 |
|
3260 | |||
3252 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3261 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3253 | if parmObj: |
|
3262 | if parmObj: | |
3254 | value = parmObj.getValue() |
|
3263 | value = parmObj.getValue() | |
3255 | self.specGraphPath.setText(value) |
|
3264 | self.specGraphPath.setText(value) | |
3256 |
|
3265 | |||
3257 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3266 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3258 | if parmObj: |
|
3267 | if parmObj: | |
3259 | value = parmObj.getValue() |
|
3268 | value = parmObj.getValue() | |
3260 | self.specGgraphftpratio.setText(str(value)) |
|
3269 | self.specGgraphftpratio.setText(str(value)) | |
3261 |
|
3270 | |||
3262 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3271 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3263 |
|
3272 | |||
3264 | if opObj == None: |
|
3273 | if opObj == None: | |
3265 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3274 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3266 | self.specGraphSaveCross.setCheckState(0) |
|
3275 | self.specGraphSaveCross.setCheckState(0) | |
3267 | self.specGraphftpCross.setCheckState(0) |
|
3276 | self.specGraphftpCross.setCheckState(0) | |
3268 | else: |
|
3277 | else: | |
3269 | operationCrossSpectraPlot = "Enable" |
|
3278 | operationCrossSpectraPlot = "Enable" | |
3270 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3279 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3271 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3280 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3272 | if parmObj == None: |
|
3281 | if parmObj == None: | |
3273 | self.specGgraphFreq.clear() |
|
3282 | self.specGgraphFreq.clear() | |
3274 | else: |
|
3283 | else: | |
3275 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3284 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3276 | value1 = str(value1) |
|
3285 | value1 = str(value1) | |
3277 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3286 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3278 | value2 = str(value2) |
|
3287 | value2 = str(value2) | |
3279 | value = value1 + "," + value2 |
|
3288 | value = value1 + "," + value2 | |
3280 | self.specGgraphFreq.setText(value) |
|
3289 | self.specGgraphFreq.setText(value) | |
3281 | self.specGgraphFreq.setEnabled(True) |
|
3290 | self.specGgraphFreq.setEnabled(True) | |
3282 |
|
3291 | |||
3283 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3292 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3284 | if parmObj == None: |
|
3293 | if parmObj == None: | |
3285 | self.specGgraphHeight.clear() |
|
3294 | self.specGgraphHeight.clear() | |
3286 | else: |
|
3295 | else: | |
3287 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3296 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3288 | value1 = str(value1) |
|
3297 | value1 = str(value1) | |
3289 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3298 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3290 | value2 = str(value2) |
|
3299 | value2 = str(value2) | |
3291 | value = value1 + "," + value2 |
|
3300 | value = value1 + "," + value2 | |
3292 | self.specGgraphHeight.setText(value) |
|
3301 | self.specGgraphHeight.setText(value) | |
3293 | self.specGgraphHeight.setEnabled(True) |
|
3302 | self.specGgraphHeight.setEnabled(True) | |
3294 |
|
3303 | |||
3295 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3304 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3296 | if parmObj == None: |
|
3305 | if parmObj == None: | |
3297 | self.specGgraphDbsrange.clear() |
|
3306 | self.specGgraphDbsrange.clear() | |
3298 | else: |
|
3307 | else: | |
3299 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3308 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3300 | value1 = str(value1) |
|
3309 | value1 = str(value1) | |
3301 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3310 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3302 | value2 = str(value2) |
|
3311 | value2 = str(value2) | |
3303 | value = value1 + "," + value2 |
|
3312 | value = value1 + "," + value2 | |
3304 | self.specGgraphDbsrange.setText(value) |
|
3313 | self.specGgraphDbsrange.setText(value) | |
3305 | self.specGgraphDbsrange.setEnabled(True) |
|
3314 | self.specGgraphDbsrange.setEnabled(True) | |
3306 |
|
3315 | |||
3307 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3316 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3308 | if parmObj == None: |
|
3317 | if parmObj == None: | |
3309 | self.specGgraphmagnitud.clear() |
|
3318 | self.specGgraphmagnitud.clear() | |
3310 | else: |
|
3319 | else: | |
3311 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3320 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3312 | value1 = str(value1) |
|
3321 | value1 = str(value1) | |
3313 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3322 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3314 | value2 = str(value2) |
|
3323 | value2 = str(value2) | |
3315 | value = value1 + "," + value2 |
|
3324 | value = value1 + "," + value2 | |
3316 | self.specGgraphmagnitud.setText(value) |
|
3325 | self.specGgraphmagnitud.setText(value) | |
3317 | self.specGgraphmagnitud.setEnabled(True) |
|
3326 | self.specGgraphmagnitud.setEnabled(True) | |
3318 |
|
3327 | |||
3319 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3328 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3320 | if parmObj == None: |
|
3329 | if parmObj == None: | |
3321 | self.specGgraphPhase.clear() |
|
3330 | self.specGgraphPhase.clear() | |
3322 | else: |
|
3331 | else: | |
3323 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3332 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3324 | value1 = str(value1) |
|
3333 | value1 = str(value1) | |
3325 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3334 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3326 | value2 = str(value2) |
|
3335 | value2 = str(value2) | |
3327 | value = value1 + "," + value2 |
|
3336 | value = value1 + "," + value2 | |
3328 | self.specGgraphPhase.setText(value) |
|
3337 | self.specGgraphPhase.setText(value) | |
3329 | self.specGgraphPhase.setEnabled(True) |
|
3338 | self.specGgraphPhase.setEnabled(True) | |
3330 |
|
3339 | |||
3331 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3340 | parmObj = opObj.getParameterObj(parameterName="save") | |
3332 | if parmObj == None: |
|
3341 | if parmObj == None: | |
3333 | self.specGraphSaveCross.setCheckState(0) |
|
3342 | self.specGraphSaveCross.setCheckState(0) | |
3334 | else: |
|
3343 | else: | |
3335 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3344 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3336 |
|
3345 | |||
3337 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3346 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3338 | if parmObj == None: |
|
3347 | if parmObj == None: | |
3339 | self.specGraphftpCross.setCheckState(0) |
|
3348 | self.specGraphftpCross.setCheckState(0) | |
3340 | else: |
|
3349 | else: | |
3341 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3350 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3342 |
|
3351 | |||
3343 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3352 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3344 | if parmObj: |
|
3353 | if parmObj: | |
3345 | value = parmObj.getValue() |
|
3354 | value = parmObj.getValue() | |
3346 | self.specGraphPath.setText(value) |
|
3355 | self.specGraphPath.setText(value) | |
3347 |
|
3356 | |||
3348 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3357 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3349 | if parmObj: |
|
3358 | if parmObj: | |
3350 | value = parmObj.getValue() |
|
3359 | value = parmObj.getValue() | |
3351 | self.specGgraphftpratio.setText(str(value)) |
|
3360 | self.specGgraphftpratio.setText(str(value)) | |
3352 |
|
3361 | |||
3353 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3362 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3354 |
|
3363 | |||
3355 | if opObj == None: |
|
3364 | if opObj == None: | |
3356 | self.specGraphCebRTIplot.setCheckState(0) |
|
3365 | self.specGraphCebRTIplot.setCheckState(0) | |
3357 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3366 | self.specGraphSaveRTIplot.setCheckState(0) | |
3358 | self.specGraphftpRTIplot.setCheckState(0) |
|
3367 | self.specGraphftpRTIplot.setCheckState(0) | |
3359 | else: |
|
3368 | else: | |
3360 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3369 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3361 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3370 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3362 | if parmObj == None: |
|
3371 | if parmObj == None: | |
3363 | self.specGgraphChannelList.clear() |
|
3372 | self.specGgraphChannelList.clear() | |
3364 | else: |
|
3373 | else: | |
3365 | value = opObj.getParameterValue(parameterName='channelList') |
|
3374 | value = opObj.getParameterValue(parameterName='channelList') | |
3366 | channelListRTIPlot = str(value)[1:-1] |
|
3375 | channelListRTIPlot = str(value)[1:-1] | |
3367 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3376 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3368 | self.specGgraphChannelList.setEnabled(True) |
|
3377 | self.specGgraphChannelList.setEnabled(True) | |
3369 |
|
3378 | |||
3370 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3379 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3371 | if parmObj == None: |
|
3380 | if parmObj == None: | |
3372 | self.specGgraphTminTmax.clear() |
|
3381 | self.specGgraphTminTmax.clear() | |
3373 | else: |
|
3382 | else: | |
3374 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3383 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3375 | value1 = str(value1) |
|
3384 | value1 = str(value1) | |
3376 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3385 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3377 | value2 = str(value2) |
|
3386 | value2 = str(value2) | |
3378 | value = value1 + "," + value2 |
|
3387 | value = value1 + "," + value2 | |
3379 | self.specGgraphTminTmax.setText(value) |
|
3388 | self.specGgraphTminTmax.setText(value) | |
3380 | self.specGgraphTminTmax.setEnabled(True) |
|
3389 | self.specGgraphTminTmax.setEnabled(True) | |
3381 |
|
3390 | |||
3382 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3391 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3383 | if parmObj == None: |
|
3392 | if parmObj == None: | |
3384 | self.specGgraphTimeRange.clear() |
|
3393 | self.specGgraphTimeRange.clear() | |
3385 | else: |
|
3394 | else: | |
3386 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3395 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3387 | value1 = str(value1) |
|
3396 | value1 = str(value1) | |
3388 | self.specGgraphTimeRange.setText(value1) |
|
3397 | self.specGgraphTimeRange.setText(value1) | |
3389 | self.specGgraphTimeRange.setEnabled(True) |
|
3398 | self.specGgraphTimeRange.setEnabled(True) | |
3390 |
|
3399 | |||
3391 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3400 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3392 | if parmObj == None: |
|
3401 | if parmObj == None: | |
3393 | self.specGgraphHeight.clear() |
|
3402 | self.specGgraphHeight.clear() | |
3394 | else: |
|
3403 | else: | |
3395 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3404 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3396 | value1 = str(value1) |
|
3405 | value1 = str(value1) | |
3397 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3406 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3398 | value2 = str(value2) |
|
3407 | value2 = str(value2) | |
3399 | value = value1 + "," + value2 |
|
3408 | value = value1 + "," + value2 | |
3400 | self.specGgraphHeight.setText(value) |
|
3409 | self.specGgraphHeight.setText(value) | |
3401 | self.specGgraphHeight.setEnabled(True) |
|
3410 | self.specGgraphHeight.setEnabled(True) | |
3402 |
|
3411 | |||
3403 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3412 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3404 | if parmObj == None: |
|
3413 | if parmObj == None: | |
3405 | self.specGgraphDbsrange.clear() |
|
3414 | self.specGgraphDbsrange.clear() | |
3406 | else: |
|
3415 | else: | |
3407 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3416 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3408 | value1 = str(value1) |
|
3417 | value1 = str(value1) | |
3409 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3418 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3410 | value2 = str(value2) |
|
3419 | value2 = str(value2) | |
3411 | value = value1 + "," + value2 |
|
3420 | value = value1 + "," + value2 | |
3412 | self.specGgraphDbsrange.setText(value) |
|
3421 | self.specGgraphDbsrange.setText(value) | |
3413 | self.specGgraphDbsrange.setEnabled(True) |
|
3422 | self.specGgraphDbsrange.setEnabled(True) | |
3414 |
|
3423 | |||
3415 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3424 | parmObj = opObj.getParameterObj(parameterName="save") | |
3416 | if parmObj == None: |
|
3425 | if parmObj == None: | |
3417 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3426 | self.specGraphSaveRTIplot.setCheckState(0) | |
3418 | else: |
|
3427 | else: | |
3419 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3428 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3420 |
|
3429 | |||
3421 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3430 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3422 | if parmObj == None: |
|
3431 | if parmObj == None: | |
3423 | self.specGraphftpRTIplot.setCheckState(0) |
|
3432 | self.specGraphftpRTIplot.setCheckState(0) | |
3424 | else: |
|
3433 | else: | |
3425 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3434 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3426 |
|
3435 | |||
3427 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3436 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3428 | if parmObj: |
|
3437 | if parmObj: | |
3429 | value = parmObj.getValue() |
|
3438 | value = parmObj.getValue() | |
3430 | self.specGraphPath.setText(value) |
|
3439 | self.specGraphPath.setText(value) | |
3431 |
|
3440 | |||
3432 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3441 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3433 | if parmObj: |
|
3442 | if parmObj: | |
3434 | value = parmObj.getValue() |
|
3443 | value = parmObj.getValue() | |
3435 | self.specGgraphftpratio.setText(str(value)) |
|
3444 | self.specGgraphftpratio.setText(str(value)) | |
3436 |
|
3445 | |||
3437 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3446 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3438 |
|
3447 | |||
3439 | if opObj == None: |
|
3448 | if opObj == None: | |
3440 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3449 | self.specGraphCebCoherencmap.setCheckState(0) | |
3441 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3450 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3442 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3451 | self.specGraphftpCoherencemap.setCheckState(0) | |
3443 | else: |
|
3452 | else: | |
3444 | operationCoherenceMap = "Enable" |
|
3453 | operationCoherenceMap = "Enable" | |
3445 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3454 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3446 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3455 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3447 | if parmObj == None: |
|
3456 | if parmObj == None: | |
3448 | self.specGgraphTminTmax.clear() |
|
3457 | self.specGgraphTminTmax.clear() | |
3449 | else: |
|
3458 | else: | |
3450 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3459 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3451 | value1 = str(value1) |
|
3460 | value1 = str(value1) | |
3452 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3461 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3453 | value2 = str(value2) |
|
3462 | value2 = str(value2) | |
3454 | value = value1 + "," + value2 |
|
3463 | value = value1 + "," + value2 | |
3455 | self.specGgraphTminTmax.setText(value) |
|
3464 | self.specGgraphTminTmax.setText(value) | |
3456 | self.specGgraphTminTmax.setEnabled(True) |
|
3465 | self.specGgraphTminTmax.setEnabled(True) | |
3457 |
|
3466 | |||
3458 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3467 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3459 | if parmObj == None: |
|
3468 | if parmObj == None: | |
3460 | self.specGgraphTimeRange.clear() |
|
3469 | self.specGgraphTimeRange.clear() | |
3461 | else: |
|
3470 | else: | |
3462 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3471 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3463 | value1 = str(value1) |
|
3472 | value1 = str(value1) | |
3464 | self.specGgraphTimeRange.setText(value1) |
|
3473 | self.specGgraphTimeRange.setText(value1) | |
3465 | self.specGgraphTimeRange.setEnabled(True) |
|
3474 | self.specGgraphTimeRange.setEnabled(True) | |
3466 |
|
3475 | |||
3467 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3476 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3468 | if parmObj == None: |
|
3477 | if parmObj == None: | |
3469 | self.specGgraphHeight.clear() |
|
3478 | self.specGgraphHeight.clear() | |
3470 | else: |
|
3479 | else: | |
3471 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3480 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3472 | value1 = str(value1) |
|
3481 | value1 = str(value1) | |
3473 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3482 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3474 | value2 = str(value2) |
|
3483 | value2 = str(value2) | |
3475 | value = value1 + "," + value2 |
|
3484 | value = value1 + "," + value2 | |
3476 | self.specGgraphHeight.setText(value) |
|
3485 | self.specGgraphHeight.setText(value) | |
3477 | self.specGgraphHeight.setEnabled(True) |
|
3486 | self.specGgraphHeight.setEnabled(True) | |
3478 |
|
3487 | |||
3479 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3488 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3480 | if parmObj == None: |
|
3489 | if parmObj == None: | |
3481 | self.specGgraphmagnitud.clear() |
|
3490 | self.specGgraphmagnitud.clear() | |
3482 | else: |
|
3491 | else: | |
3483 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3492 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3484 | value1 = str(value1) |
|
3493 | value1 = str(value1) | |
3485 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3494 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3486 | value2 = str(value2) |
|
3495 | value2 = str(value2) | |
3487 | value = value1 + "," + value2 |
|
3496 | value = value1 + "," + value2 | |
3488 | self.specGgraphmagnitud.setText(value) |
|
3497 | self.specGgraphmagnitud.setText(value) | |
3489 | self.specGgraphmagnitud.setEnabled(True) |
|
3498 | self.specGgraphmagnitud.setEnabled(True) | |
3490 |
|
3499 | |||
3491 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3500 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3492 | if parmObj == None: |
|
3501 | if parmObj == None: | |
3493 | self.specGgraphmagnitud.clear() |
|
3502 | self.specGgraphmagnitud.clear() | |
3494 | else: |
|
3503 | else: | |
3495 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3504 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3496 | value1 = str(value1) |
|
3505 | value1 = str(value1) | |
3497 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3506 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3498 | value2 = str(value2) |
|
3507 | value2 = str(value2) | |
3499 | value = value1 + "," + value2 |
|
3508 | value = value1 + "," + value2 | |
3500 | self.specGgraphmagnitud.setText(value) |
|
3509 | self.specGgraphmagnitud.setText(value) | |
3501 | self.specGgraphmagnitud.setEnabled(True) |
|
3510 | self.specGgraphmagnitud.setEnabled(True) | |
3502 |
|
3511 | |||
3503 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3512 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3504 | if parmObj == None: |
|
3513 | if parmObj == None: | |
3505 | self.specGgraphPhase.clear() |
|
3514 | self.specGgraphPhase.clear() | |
3506 | else: |
|
3515 | else: | |
3507 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3516 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3508 | value1 = str(value1) |
|
3517 | value1 = str(value1) | |
3509 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3518 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3510 | value2 = str(value2) |
|
3519 | value2 = str(value2) | |
3511 | value = value1 + "," + value2 |
|
3520 | value = value1 + "," + value2 | |
3512 | self.specGgraphPhase.setText(value) |
|
3521 | self.specGgraphPhase.setText(value) | |
3513 | self.specGgraphPhase.setEnabled(True) |
|
3522 | self.specGgraphPhase.setEnabled(True) | |
3514 |
|
3523 | |||
3515 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3524 | parmObj = opObj.getParameterObj(parameterName="save") | |
3516 | if parmObj == None: |
|
3525 | if parmObj == None: | |
3517 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3526 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3518 | else: |
|
3527 | else: | |
3519 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3528 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3520 |
|
3529 | |||
3521 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3530 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3522 | if parmObj == None: |
|
3531 | if parmObj == None: | |
3523 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3532 | self.specGraphftpCoherencemap.setCheckState(0) | |
3524 | else: |
|
3533 | else: | |
3525 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3534 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3526 |
|
3535 | |||
3527 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3536 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3528 | if parmObj: |
|
3537 | if parmObj: | |
3529 | value = parmObj.getValue() |
|
3538 | value = parmObj.getValue() | |
3530 | self.specGraphPath.setText(value) |
|
3539 | self.specGraphPath.setText(value) | |
3531 |
|
3540 | |||
3532 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3541 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3533 | if parmObj: |
|
3542 | if parmObj: | |
3534 | value = parmObj.getValue() |
|
3543 | value = parmObj.getValue() | |
3535 | self.specGgraphftpratio.setText(str(value)) |
|
3544 | self.specGgraphftpratio.setText(str(value)) | |
3536 |
|
3545 | |||
3537 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3546 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3538 |
|
3547 | |||
3539 | if opObj == None: |
|
3548 | if opObj == None: | |
3540 | self.specGraphPowerprofile.setCheckState(0) |
|
3549 | self.specGraphPowerprofile.setCheckState(0) | |
3541 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3550 | self.specGraphSavePowerprofile.setCheckState(0) | |
3542 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3551 | self.specGraphftpPowerprofile.setCheckState(0) | |
3543 | operationPowerProfilePlot = "Disabled" |
|
3552 | operationPowerProfilePlot = "Disabled" | |
3544 | channelList = None |
|
3553 | channelList = None | |
3545 | freq_vel = None |
|
3554 | freq_vel = None | |
3546 | heightsrange = None |
|
3555 | heightsrange = None | |
3547 | else: |
|
3556 | else: | |
3548 | operationPowerProfilePlot = "Enable" |
|
3557 | operationPowerProfilePlot = "Enable" | |
3549 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3558 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3550 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3559 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3551 | if parmObj == None: |
|
3560 | if parmObj == None: | |
3552 | self.specGgraphDbsrange.clear() |
|
3561 | self.specGgraphDbsrange.clear() | |
3553 | else: |
|
3562 | else: | |
3554 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3563 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3555 | value1 = str(value1) |
|
3564 | value1 = str(value1) | |
3556 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3565 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3557 | value2 = str(value2) |
|
3566 | value2 = str(value2) | |
3558 | value = value1 + "," + value2 |
|
3567 | value = value1 + "," + value2 | |
3559 | self.specGgraphDbsrange.setText(value) |
|
3568 | self.specGgraphDbsrange.setText(value) | |
3560 | self.specGgraphDbsrange.setEnabled(True) |
|
3569 | self.specGgraphDbsrange.setEnabled(True) | |
3561 |
|
3570 | |||
3562 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3571 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3563 | if parmObj == None: |
|
3572 | if parmObj == None: | |
3564 | self.specGgraphHeight.clear() |
|
3573 | self.specGgraphHeight.clear() | |
3565 | else: |
|
3574 | else: | |
3566 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3575 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3567 | value1 = str(value1) |
|
3576 | value1 = str(value1) | |
3568 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3577 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3569 | value2 = str(value2) |
|
3578 | value2 = str(value2) | |
3570 | value = value1 + "," + value2 |
|
3579 | value = value1 + "," + value2 | |
3571 | self.specGgraphHeight.setText(value) |
|
3580 | self.specGgraphHeight.setText(value) | |
3572 | self.specGgraphHeight.setEnabled(True) |
|
3581 | self.specGgraphHeight.setEnabled(True) | |
3573 |
|
3582 | |||
3574 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3583 | parmObj = opObj.getParameterObj(parameterName="save") | |
3575 | if parmObj == None: |
|
3584 | if parmObj == None: | |
3576 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3585 | self.specGraphSavePowerprofile.setCheckState(0) | |
3577 | else: |
|
3586 | else: | |
3578 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3587 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3579 |
|
3588 | |||
3580 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3589 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3581 | if parmObj == None: |
|
3590 | if parmObj == None: | |
3582 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3591 | self.specGraphftpPowerprofile.setCheckState(0) | |
3583 | else: |
|
3592 | else: | |
3584 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3593 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3585 |
|
3594 | |||
3586 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3595 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3587 | if parmObj: |
|
3596 | if parmObj: | |
3588 | value = parmObj.getValue() |
|
3597 | value = parmObj.getValue() | |
3589 | self.specGraphPath.setText(value) |
|
3598 | self.specGraphPath.setText(value) | |
3590 |
|
3599 | |||
3591 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3600 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3592 | if parmObj: |
|
3601 | if parmObj: | |
3593 | value = parmObj.getValue() |
|
3602 | value = parmObj.getValue() | |
3594 | self.specGgraphftpratio.setText(str(value)) |
|
3603 | self.specGgraphftpratio.setText(str(value)) | |
3595 |
|
3604 | |||
3596 | opObj = puObj.getOperationObj(name='Noise') |
|
3605 | opObj = puObj.getOperationObj(name='Noise') | |
3597 |
|
3606 | |||
3598 | if opObj == None: |
|
3607 | if opObj == None: | |
3599 | self.specGraphCebRTInoise.setCheckState(0) |
|
3608 | self.specGraphCebRTInoise.setCheckState(0) | |
3600 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3609 | self.specGraphSaveRTInoise.setCheckState(0) | |
3601 | self.specGraphftpRTInoise.setCheckState(0) |
|
3610 | self.specGraphftpRTInoise.setCheckState(0) | |
3602 | else: |
|
3611 | else: | |
3603 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3612 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3604 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3613 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3605 | if parmObj == None: |
|
3614 | if parmObj == None: | |
3606 | self.specGgraphChannelList.clear() |
|
3615 | self.specGgraphChannelList.clear() | |
3607 | else: |
|
3616 | else: | |
3608 | value = opObj.getParameterValue(parameterName='channelList') |
|
3617 | value = opObj.getParameterValue(parameterName='channelList') | |
3609 | channelListRTINoise = str(value)[1:-1] |
|
3618 | channelListRTINoise = str(value)[1:-1] | |
3610 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3619 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3611 | self.specGgraphChannelList.setEnabled(True) |
|
3620 | self.specGgraphChannelList.setEnabled(True) | |
3612 |
|
3621 | |||
3613 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3622 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3614 | if parmObj == None: |
|
3623 | if parmObj == None: | |
3615 | self.specGgraphTminTmax.clear() |
|
3624 | self.specGgraphTminTmax.clear() | |
3616 | else: |
|
3625 | else: | |
3617 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3626 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3618 | value1 = str(value1) |
|
3627 | value1 = str(value1) | |
3619 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3628 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3620 | value2 = str(value2) |
|
3629 | value2 = str(value2) | |
3621 | value = value1 + "," + value2 |
|
3630 | value = value1 + "," + value2 | |
3622 | self.specGgraphTminTmax.setText(value) |
|
3631 | self.specGgraphTminTmax.setText(value) | |
3623 | self.specGgraphTminTmax.setEnabled(True) |
|
3632 | self.specGgraphTminTmax.setEnabled(True) | |
3624 |
|
3633 | |||
3625 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3634 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3626 | if parmObj == None: |
|
3635 | if parmObj == None: | |
3627 | self.specGgraphTimeRange.clear() |
|
3636 | self.specGgraphTimeRange.clear() | |
3628 | else: |
|
3637 | else: | |
3629 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3638 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3630 | value1 = str(value1) |
|
3639 | value1 = str(value1) | |
3631 | self.specGgraphTimeRange.setText(value1) |
|
3640 | self.specGgraphTimeRange.setText(value1) | |
3632 | self.specGgraphTimeRange.setEnabled(True) |
|
3641 | self.specGgraphTimeRange.setEnabled(True) | |
3633 |
|
3642 | |||
3634 |
|
3643 | |||
3635 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3644 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3636 | if parmObj == None: |
|
3645 | if parmObj == None: | |
3637 | self.specGgraphDbsrange.clear() |
|
3646 | self.specGgraphDbsrange.clear() | |
3638 | else: |
|
3647 | else: | |
3639 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3648 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3640 | value1 = str(value1) |
|
3649 | value1 = str(value1) | |
3641 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3650 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3642 | value2 = str(value2) |
|
3651 | value2 = str(value2) | |
3643 | value = value1 + "," + value2 |
|
3652 | value = value1 + "," + value2 | |
3644 | self.specGgraphDbsrange.setText(value) |
|
3653 | self.specGgraphDbsrange.setText(value) | |
3645 | self.specGgraphDbsrange.setEnabled(True) |
|
3654 | self.specGgraphDbsrange.setEnabled(True) | |
3646 |
|
3655 | |||
3647 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3656 | parmObj = opObj.getParameterObj(parameterName="save") | |
3648 | if parmObj == None: |
|
3657 | if parmObj == None: | |
3649 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3658 | self.specGraphSaveRTInoise.setCheckState(0) | |
3650 | else: |
|
3659 | else: | |
3651 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3660 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3652 |
|
3661 | |||
3653 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3662 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3654 | if parmObj == None: |
|
3663 | if parmObj == None: | |
3655 | self.specGraphftpRTInoise.setCheckState(0) |
|
3664 | self.specGraphftpRTInoise.setCheckState(0) | |
3656 | else: |
|
3665 | else: | |
3657 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3666 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3658 |
|
3667 | |||
3659 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3668 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3660 | if parmObj: |
|
3669 | if parmObj: | |
3661 | value = parmObj.getValue() |
|
3670 | value = parmObj.getValue() | |
3662 | self.specGraphPath.setText(value) |
|
3671 | self.specGraphPath.setText(value) | |
3663 |
|
3672 | |||
3664 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3673 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3665 | if parmObj: |
|
3674 | if parmObj: | |
3666 | value = parmObj.getValue() |
|
3675 | value = parmObj.getValue() | |
3667 | self.specGgraphftpratio.setText(str(value)) |
|
3676 | self.specGgraphftpratio.setText(str(value)) | |
3668 |
|
3677 | |||
3669 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3678 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3670 | if opObj == None: |
|
3679 | if opObj == None: | |
3671 | self.specOutputPath.clear() |
|
3680 | self.specOutputPath.clear() | |
3672 | self.specOutputblocksperfile.clear() |
|
3681 | self.specOutputblocksperfile.clear() | |
3673 | else: |
|
3682 | else: | |
3674 | value = opObj.getParameterObj(parameterName='path') |
|
3683 | value = opObj.getParameterObj(parameterName='path') | |
3675 | if value == None: |
|
3684 | if value == None: | |
3676 | self.specOutputPath.clear() |
|
3685 | self.specOutputPath.clear() | |
3677 | else: |
|
3686 | else: | |
3678 | value = opObj.getParameterValue(parameterName='path') |
|
3687 | value = opObj.getParameterValue(parameterName='path') | |
3679 | path = str(value) |
|
3688 | path = str(value) | |
3680 | self.specOutputPath.setText(path) |
|
3689 | self.specOutputPath.setText(path) | |
3681 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3690 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3682 | if value == None: |
|
3691 | if value == None: | |
3683 | self.specOutputblocksperfile.clear() |
|
3692 | self.specOutputblocksperfile.clear() | |
3684 | else: |
|
3693 | else: | |
3685 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3694 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3686 | blocksperfile = str(value) |
|
3695 | blocksperfile = str(value) | |
3687 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3696 | self.specOutputblocksperfile.setText(blocksperfile) | |
3688 |
|
3697 | |||
3689 | return |
|
3698 | return | |
3690 |
|
3699 | |||
3691 | def __refreshSpectraHeisWindow(self, puObj): |
|
3700 | def __refreshSpectraHeisWindow(self, puObj): | |
3692 |
|
3701 | |||
3693 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3702 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3694 | if opObj == None: |
|
3703 | if opObj == None: | |
3695 | self.specHeisOpIncoherent.clear() |
|
3704 | self.specHeisOpIncoherent.clear() | |
3696 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3705 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3697 | else: |
|
3706 | else: | |
3698 | for parmObj in opObj.getParameterObjList(): |
|
3707 | for parmObj in opObj.getParameterObjList(): | |
3699 | if parmObj.name == 'timeInterval': |
|
3708 | if parmObj.name == 'timeInterval': | |
3700 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3709 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3701 | value = float(value) |
|
3710 | value = float(value) | |
3702 | self.specHeisOpIncoherent.setText(str(value)) |
|
3711 | self.specHeisOpIncoherent.setText(str(value)) | |
3703 | self.specHeisOpIncoherent.setEnabled(True) |
|
3712 | self.specHeisOpIncoherent.setEnabled(True) | |
3704 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3713 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3705 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3714 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3706 |
|
3715 | |||
3707 | # SpectraHeis Graph |
|
3716 | # SpectraHeis Graph | |
3708 |
|
3717 | |||
3709 | self.specHeisGgraphXminXmax.clear() |
|
3718 | self.specHeisGgraphXminXmax.clear() | |
3710 | self.specHeisGgraphYminYmax.clear() |
|
3719 | self.specHeisGgraphYminYmax.clear() | |
3711 |
|
3720 | |||
3712 | self.specHeisGgraphChannelList.clear() |
|
3721 | self.specHeisGgraphChannelList.clear() | |
3713 | self.specHeisGgraphTminTmax.clear() |
|
3722 | self.specHeisGgraphTminTmax.clear() | |
3714 | self.specHeisGgraphTimeRange.clear() |
|
3723 | self.specHeisGgraphTimeRange.clear() | |
3715 | self.specHeisGgraphftpratio.clear() |
|
3724 | self.specHeisGgraphftpratio.clear() | |
3716 |
|
3725 | |||
3717 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3726 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3718 | if opObj == None: |
|
3727 | if opObj == None: | |
3719 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3728 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3720 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3729 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3721 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3730 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3722 | else: |
|
3731 | else: | |
3723 | operationSpectraHeisScope = "Enable" |
|
3732 | operationSpectraHeisScope = "Enable" | |
3724 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3733 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3725 |
|
3734 | |||
3726 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3735 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3727 | if parmObj == None: |
|
3736 | if parmObj == None: | |
3728 | self.specHeisGgraphChannelList.clear() |
|
3737 | self.specHeisGgraphChannelList.clear() | |
3729 | else: |
|
3738 | else: | |
3730 | value = opObj.getParameterValue(parameterName='channelList') |
|
3739 | value = opObj.getParameterValue(parameterName='channelList') | |
3731 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3740 | channelListSpectraHeisScope = str(value)[1:-1] | |
3732 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3741 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3733 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3742 | self.specHeisGgraphChannelList.setEnabled(True) | |
3734 |
|
3743 | |||
3735 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3744 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3736 | if parmObj == None: |
|
3745 | if parmObj == None: | |
3737 | self.specHeisGgraphXminXmax.clear() |
|
3746 | self.specHeisGgraphXminXmax.clear() | |
3738 | else: |
|
3747 | else: | |
3739 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3748 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3740 | value1 = str(value1) |
|
3749 | value1 = str(value1) | |
3741 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3750 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3742 | value2 = str(value2) |
|
3751 | value2 = str(value2) | |
3743 | value = value1 + "," + value2 |
|
3752 | value = value1 + "," + value2 | |
3744 | self.specHeisGgraphXminXmax.setText(value) |
|
3753 | self.specHeisGgraphXminXmax.setText(value) | |
3745 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3754 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3746 |
|
3755 | |||
3747 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3756 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3748 | if parmObj == None: |
|
3757 | if parmObj == None: | |
3749 | self.specHeisGgraphYminYmax.clear() |
|
3758 | self.specHeisGgraphYminYmax.clear() | |
3750 | else: |
|
3759 | else: | |
3751 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3760 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3752 | value1 = str(value1) |
|
3761 | value1 = str(value1) | |
3753 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3762 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3754 | value2 = str(value2) |
|
3763 | value2 = str(value2) | |
3755 | value = value1 + "," + value2 |
|
3764 | value = value1 + "," + value2 | |
3756 | self.specHeisGgraphYminYmax.setText(value) |
|
3765 | self.specHeisGgraphYminYmax.setText(value) | |
3757 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3766 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3758 |
|
3767 | |||
3759 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3768 | parmObj = opObj.getParameterObj(parameterName="save") | |
3760 | if parmObj == None: |
|
3769 | if parmObj == None: | |
3761 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3770 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3762 | else: |
|
3771 | else: | |
3763 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3772 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3764 |
|
3773 | |||
3765 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3774 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3766 | if parmObj == None: |
|
3775 | if parmObj == None: | |
3767 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3776 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3768 | else: |
|
3777 | else: | |
3769 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3778 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3770 |
|
3779 | |||
3771 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3780 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3772 | if parmObj: |
|
3781 | if parmObj: | |
3773 | value = parmObj.getValue() |
|
3782 | value = parmObj.getValue() | |
3774 | self.specHeisGraphPath.setText(value) |
|
3783 | self.specHeisGraphPath.setText(value) | |
3775 |
|
3784 | |||
3776 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3785 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3777 | if parmObj: |
|
3786 | if parmObj: | |
3778 | value = parmObj.getValue() |
|
3787 | value = parmObj.getValue() | |
3779 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3788 | self.specHeisGgraphftpratio.setText(str(value)) | |
3780 |
|
3789 | |||
3781 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3790 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3782 |
|
3791 | |||
3783 | if opObj == None: |
|
3792 | if opObj == None: | |
3784 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3793 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3785 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3794 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3786 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3795 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3787 | else: |
|
3796 | else: | |
3788 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3797 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3789 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3798 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3790 | if parmObj == None: |
|
3799 | if parmObj == None: | |
3791 | self.specHeisGgraphChannelList.clear() |
|
3800 | self.specHeisGgraphChannelList.clear() | |
3792 | else: |
|
3801 | else: | |
3793 | value = opObj.getParameterValue(parameterName='channelList') |
|
3802 | value = opObj.getParameterValue(parameterName='channelList') | |
3794 | channelListRTIPlot = str(value)[1:-1] |
|
3803 | channelListRTIPlot = str(value)[1:-1] | |
3795 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3804 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3796 | self.specGgraphChannelList.setEnabled(True) |
|
3805 | self.specGgraphChannelList.setEnabled(True) | |
3797 |
|
3806 | |||
3798 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3807 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3799 | if parmObj == None: |
|
3808 | if parmObj == None: | |
3800 | self.specHeisGgraphTminTmax.clear() |
|
3809 | self.specHeisGgraphTminTmax.clear() | |
3801 | else: |
|
3810 | else: | |
3802 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3811 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3803 | value1 = str(value1) |
|
3812 | value1 = str(value1) | |
3804 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3813 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3805 | value2 = str(value2) |
|
3814 | value2 = str(value2) | |
3806 | value = value1 + "," + value2 |
|
3815 | value = value1 + "," + value2 | |
3807 | self.specHeisGgraphTminTmax.setText(value) |
|
3816 | self.specHeisGgraphTminTmax.setText(value) | |
3808 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3817 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3809 |
|
3818 | |||
3810 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3819 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3811 | if parmObj == None: |
|
3820 | if parmObj == None: | |
3812 | self.specGgraphTimeRange.clear() |
|
3821 | self.specGgraphTimeRange.clear() | |
3813 | else: |
|
3822 | else: | |
3814 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3823 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3815 | value1 = str(value1) |
|
3824 | value1 = str(value1) | |
3816 | self.specHeisGgraphTimeRange.setText(value1) |
|
3825 | self.specHeisGgraphTimeRange.setText(value1) | |
3817 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3826 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3818 |
|
3827 | |||
3819 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3828 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3820 | if parmObj == None: |
|
3829 | if parmObj == None: | |
3821 | self.specHeisGgraphYminYmax.clear() |
|
3830 | self.specHeisGgraphYminYmax.clear() | |
3822 | else: |
|
3831 | else: | |
3823 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3832 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3824 | value1 = str(value1) |
|
3833 | value1 = str(value1) | |
3825 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3834 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3826 | value2 = str(value2) |
|
3835 | value2 = str(value2) | |
3827 | value = value1 + "," + value2 |
|
3836 | value = value1 + "," + value2 | |
3828 | self.specHeisGgraphYminYmax.setText(value) |
|
3837 | self.specHeisGgraphYminYmax.setText(value) | |
3829 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3838 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3830 |
|
3839 | |||
3831 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3840 | parmObj = opObj.getParameterObj(parameterName="save") | |
3832 | if parmObj == None: |
|
3841 | if parmObj == None: | |
3833 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3842 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3834 | else: |
|
3843 | else: | |
3835 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3844 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3836 |
|
3845 | |||
3837 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3846 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3838 | if parmObj == None: |
|
3847 | if parmObj == None: | |
3839 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3848 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3840 | else: |
|
3849 | else: | |
3841 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3850 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3842 |
|
3851 | |||
3843 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3852 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3844 | if parmObj: |
|
3853 | if parmObj: | |
3845 | value = parmObj.getValue() |
|
3854 | value = parmObj.getValue() | |
3846 | self.specHeisGraphPath.setText(value) |
|
3855 | self.specHeisGraphPath.setText(value) | |
3847 |
|
3856 | |||
3848 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3857 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3849 | if parmObj: |
|
3858 | if parmObj: | |
3850 | value = parmObj.getValue() |
|
3859 | value = parmObj.getValue() | |
3851 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3860 | self.specHeisGgraphftpratio.setText(str(value)) | |
3852 |
|
3861 | |||
3853 | # outputSpectraHeisWrite |
|
3862 | # outputSpectraHeisWrite | |
3854 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3863 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3855 | if opObj == None: |
|
3864 | if opObj == None: | |
3856 | self.specHeisOutputPath.clear() |
|
3865 | self.specHeisOutputPath.clear() | |
3857 | self.specHeisOutputblocksperfile.clear() |
|
3866 | self.specHeisOutputblocksperfile.clear() | |
3858 | self.specHeisOutputMetada.clear() |
|
3867 | self.specHeisOutputMetada.clear() | |
3859 | else: |
|
3868 | else: | |
3860 | value = opObj.getParameterObj(parameterName='path') |
|
3869 | value = opObj.getParameterObj(parameterName='path') | |
3861 | if value == None: |
|
3870 | if value == None: | |
3862 | self.specHeisOutputPath.clear() |
|
3871 | self.specHeisOutputPath.clear() | |
3863 | else: |
|
3872 | else: | |
3864 | value = opObj.getParameterValue(parameterName='path') |
|
3873 | value = opObj.getParameterValue(parameterName='path') | |
3865 | path = str(value) |
|
3874 | path = str(value) | |
3866 | self.specHeisOutputPath.setText(path) |
|
3875 | self.specHeisOutputPath.setText(path) | |
3867 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3876 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3868 | if value == None: |
|
3877 | if value == None: | |
3869 | self.specHeisOutputblocksperfile.clear() |
|
3878 | self.specHeisOutputblocksperfile.clear() | |
3870 | else: |
|
3879 | else: | |
3871 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3880 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3872 | blocksperfile = str(value) |
|
3881 | blocksperfile = str(value) | |
3873 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3882 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3874 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3883 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3875 | if value == None: |
|
3884 | if value == None: | |
3876 | self.specHeisOutputMetada.clear() |
|
3885 | self.specHeisOutputMetada.clear() | |
3877 | else: |
|
3886 | else: | |
3878 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3887 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3879 | metada = str(value) |
|
3888 | metada = str(value) | |
3880 | self.specHeisOutputMetada.setText(metada) |
|
3889 | self.specHeisOutputMetada.setText(metada) | |
3881 |
|
3890 | |||
3882 | return |
|
3891 | return | |
3883 |
|
3892 | |||
3884 | def __refreshCorrelationWindow(self, puObj): |
|
3893 | def __refreshCorrelationWindow(self, puObj): | |
3885 | pass |
|
3894 | pass | |
3886 |
|
3895 | |||
3887 | def refreshPUWindow(self, puObj): |
|
3896 | def refreshPUWindow(self, puObj): | |
3888 |
|
3897 | |||
3889 | if puObj.datatype == 'Voltage': |
|
3898 | if puObj.datatype == 'Voltage': | |
3890 | self.__refreshVoltageWindow(puObj) |
|
3899 | self.__refreshVoltageWindow(puObj) | |
3891 |
|
3900 | |||
3892 | if puObj.datatype == 'Spectra': |
|
3901 | if puObj.datatype == 'Spectra': | |
3893 | self.__refreshSpectraWindow(puObj) |
|
3902 | self.__refreshSpectraWindow(puObj) | |
3894 |
|
3903 | |||
3895 | if puObj.datatype == 'SpectraHeis': |
|
3904 | if puObj.datatype == 'SpectraHeis': | |
3896 | self.__refreshSpectraHeisWindow(puObj) |
|
3905 | self.__refreshSpectraHeisWindow(puObj) | |
3897 |
|
3906 | |||
3898 | def refreshProjectProperties(self, projectObjView): |
|
3907 | def refreshProjectProperties(self, projectObjView): | |
3899 |
|
3908 | |||
3900 | propertyBuffObj = PropertyBuffer() |
|
3909 | propertyBuffObj = PropertyBuffer() | |
3901 | name = projectObjView.name |
|
3910 | name = projectObjView.name | |
3902 |
|
3911 | |||
3903 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3912 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3904 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3913 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3905 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3914 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3906 |
|
3915 | |||
3907 | readUnitObj = projectObjView.getReadUnitObj() |
|
3916 | readUnitObj = projectObjView.getReadUnitObj() | |
3908 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3917 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3909 |
|
3918 | |||
3910 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3919 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3911 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3920 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3912 |
|
3921 | |||
3913 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3922 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3914 |
|
3923 | |||
3915 | self.treeProjectProperties.setModel(propertiesModel) |
|
3924 | self.treeProjectProperties.setModel(propertiesModel) | |
3916 | self.treeProjectProperties.expandAll() |
|
3925 | self.treeProjectProperties.expandAll() | |
3917 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3926 | self.treeProjectProperties.resizeColumnToContents(0) | |
3918 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3927 | self.treeProjectProperties.resizeColumnToContents(1) | |
3919 |
|
3928 | |||
3920 | def refreshPUProperties(self, puObjView): |
|
3929 | def refreshPUProperties(self, puObjView): | |
3921 |
|
3930 | |||
3922 | ############ FTP CONFIG ################################ |
|
3931 | ############ FTP CONFIG ################################ | |
3923 | #Deleting FTP Conf. This processing unit have not got any |
|
3932 | #Deleting FTP Conf. This processing unit have not got any | |
3924 | #FTP configuration by default |
|
3933 | #FTP configuration by default | |
3925 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
3934 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
3926 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
3935 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
3927 | ######################################################## |
|
3936 | ######################################################## | |
3928 |
|
3937 | |||
3929 | propertyBuffObj = PropertyBuffer() |
|
3938 | propertyBuffObj = PropertyBuffer() | |
3930 |
|
3939 | |||
3931 | for thisOp in puObjView.getOperationObjList(): |
|
3940 | for thisOp in puObjView.getOperationObjList(): | |
3932 |
|
3941 | |||
3933 | operationName = thisOp.name |
|
3942 | operationName = thisOp.name | |
3934 |
|
3943 | |||
3935 | if operationName == 'run': |
|
3944 | if operationName == 'run': | |
3936 | operationName = 'Properties' |
|
3945 | operationName = 'Properties' | |
3937 |
|
3946 | |||
3938 | else: |
|
3947 | else: | |
3939 | if not thisOp.getParameterObjList(): |
|
3948 | if not thisOp.getParameterObjList(): | |
3940 | propertyBuffObj.append(operationName, '--', '--') |
|
3949 | propertyBuffObj.append(operationName, '--', '--') | |
3941 | continue |
|
3950 | continue | |
3942 |
|
3951 | |||
3943 | for thisParmObj in thisOp.getParameterObjList(): |
|
3952 | for thisParmObj in thisOp.getParameterObjList(): | |
3944 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3953 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3945 |
|
3954 | |||
3946 | ############ FTP CONFIG ################################ |
|
3955 | ############ FTP CONFIG ################################ | |
3947 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
3956 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
3948 | value = thisParmObj.getValue() |
|
3957 | value = thisParmObj.getValue() | |
3949 | self.temporalFTP.ftp_wei = value |
|
3958 | self.temporalFTP.ftp_wei = value | |
3950 |
|
3959 | |||
3951 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
3960 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
3952 | value = thisParmObj.getValue() |
|
3961 | value = thisParmObj.getValue() | |
3953 | self.temporalFTP.exp_code = value |
|
3962 | self.temporalFTP.exp_code = value | |
3954 |
|
3963 | |||
3955 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
3964 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
3956 | value = thisParmObj.getValue() |
|
3965 | value = thisParmObj.getValue() | |
3957 | self.temporalFTP.sub_exp_code = value |
|
3966 | self.temporalFTP.sub_exp_code = value | |
3958 |
|
3967 | |||
3959 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
3968 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
3960 | value = thisParmObj.getValue() |
|
3969 | value = thisParmObj.getValue() | |
3961 | self.temporalFTP.plot_pos = value |
|
3970 | self.temporalFTP.plot_pos = value | |
3962 |
|
3971 | |||
3963 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
3972 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
3964 | figpathObj = thisOp.getParameterObj('figpath') |
|
3973 | figpathObj = thisOp.getParameterObj('figpath') | |
3965 | if figpathObj: |
|
3974 | if figpathObj: | |
3966 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
3975 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
3967 |
|
3976 | |||
3968 | ######################################################## |
|
3977 | ######################################################## | |
3969 |
|
3978 | |||
3970 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3979 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3971 |
|
3980 | |||
3972 | self.treeProjectProperties.setModel(propertiesModel) |
|
3981 | self.treeProjectProperties.setModel(propertiesModel) | |
3973 | self.treeProjectProperties.expandAll() |
|
3982 | self.treeProjectProperties.expandAll() | |
3974 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3983 | self.treeProjectProperties.resizeColumnToContents(0) | |
3975 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3984 | self.treeProjectProperties.resizeColumnToContents(1) | |
3976 |
|
3985 | |||
3977 | def refreshGraphicsId(self): |
|
3986 | def refreshGraphicsId(self): | |
3978 |
|
3987 | |||
3979 | projectObj = self.getSelectedProjectObj() |
|
3988 | projectObj = self.getSelectedProjectObj() | |
3980 |
|
3989 | |||
|
3990 | if not projectObj: | |||
|
3991 | return | |||
|
3992 | ||||
3981 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
3993 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
3982 |
|
3994 | |||
3983 | for opObj in puObj.getOperationObjList(): |
|
3995 | for opObj in puObj.getOperationObjList(): | |
3984 |
|
3996 | |||
3985 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
3997 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
3986 | continue |
|
3998 | continue | |
3987 |
|
3999 | |||
3988 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4000 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
3989 |
|
4001 | |||
3990 | def on_click(self, index): |
|
4002 | def on_click(self, index): | |
3991 |
|
4003 | |||
3992 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4004 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
3993 |
|
4005 | |||
3994 | projectObjView = self.getSelectedProjectObj() |
|
4006 | projectObjView = self.getSelectedProjectObj() | |
3995 |
|
4007 | |||
3996 | if not projectObjView: |
|
4008 | if not projectObjView: | |
3997 | return |
|
4009 | return | |
3998 |
|
4010 | |||
3999 | self.create = False |
|
4011 | self.create = False | |
4000 | selectedObjView = self.getSelectedItemObj() |
|
4012 | selectedObjView = self.getSelectedItemObj() | |
4001 |
|
4013 | |||
4002 | #A project has been selected |
|
4014 | #A project has been selected | |
4003 | if projectObjView == selectedObjView: |
|
4015 | if projectObjView == selectedObjView: | |
4004 |
|
4016 | |||
4005 | self.refreshProjectWindow(projectObjView) |
|
4017 | self.refreshProjectWindow(projectObjView) | |
4006 | self.refreshProjectProperties(projectObjView) |
|
4018 | self.refreshProjectProperties(projectObjView) | |
4007 |
|
4019 | |||
4008 | self.tabProject.setEnabled(True) |
|
4020 | self.tabProject.setEnabled(True) | |
4009 | self.tabVoltage.setEnabled(False) |
|
4021 | self.tabVoltage.setEnabled(False) | |
4010 | self.tabSpectra.setEnabled(False) |
|
4022 | self.tabSpectra.setEnabled(False) | |
4011 | self.tabCorrelation.setEnabled(False) |
|
4023 | self.tabCorrelation.setEnabled(False) | |
4012 | self.tabSpectraHeis.setEnabled(False) |
|
4024 | self.tabSpectraHeis.setEnabled(False) | |
4013 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4025 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4014 |
|
4026 | |||
4015 | return |
|
4027 | return | |
4016 |
|
4028 | |||
4017 | #A processing unit has been selected |
|
4029 | #A processing unit has been selected | |
4018 | voltEnable = False |
|
4030 | voltEnable = False | |
4019 | specEnable = False |
|
4031 | specEnable = False | |
4020 | corrEnable = False |
|
4032 | corrEnable = False | |
4021 | specHeisEnable = False |
|
4033 | specHeisEnable = False | |
4022 | tabSelected = self.tabProject |
|
4034 | tabSelected = self.tabProject | |
4023 |
|
4035 | |||
4024 | puObj = selectedObjView |
|
4036 | puObj = selectedObjView | |
4025 |
|
4037 | |||
4026 | self.refreshPUWindow(puObj) |
|
4038 | self.refreshPUWindow(puObj) | |
4027 | self.refreshPUProperties(puObj) |
|
4039 | self.refreshPUProperties(puObj) | |
4028 | self.showtabPUCreated(puObj.datatype) |
|
4040 | self.showtabPUCreated(puObj.datatype) | |
4029 |
|
4041 | |||
4030 | def on_right_click(self, pos): |
|
4042 | def on_right_click(self, pos): | |
4031 |
|
4043 | |||
4032 | self.menu = QtGui.QMenu() |
|
4044 | self.menu = QtGui.QMenu() | |
4033 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4045 | quitAction0 = self.menu.addAction("Create a New Project") | |
4034 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4046 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4035 | quitAction2 = self.menu.addAction("Delete Item") |
|
4047 | quitAction2 = self.menu.addAction("Delete Item") | |
4036 | quitAction3 = self.menu.addAction("Quit") |
|
4048 | quitAction3 = self.menu.addAction("Quit") | |
4037 |
|
4049 | |||
4038 | if len(self.__itemTreeDict) == 0: |
|
4050 | if len(self.__itemTreeDict) == 0: | |
4039 | quitAction2.setEnabled(False) |
|
4051 | quitAction2.setEnabled(False) | |
4040 | else: |
|
4052 | else: | |
4041 | quitAction2.setEnabled(True) |
|
4053 | quitAction2.setEnabled(True) | |
4042 |
|
4054 | |||
4043 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4055 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4044 |
|
4056 | |||
4045 | if action == quitAction0: |
|
4057 | if action == quitAction0: | |
4046 | self. setInputsProject_View() |
|
4058 | self. setInputsProject_View() | |
4047 | self.create = True |
|
4059 | self.create = True | |
4048 |
|
4060 | |||
4049 | if action == quitAction1: |
|
4061 | if action == quitAction1: | |
4050 | if len(self.__projectObjDict) == 0: |
|
4062 | if len(self.__projectObjDict) == 0: | |
4051 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4063 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4052 | self.console.clear() |
|
4064 | self.console.clear() | |
4053 | self.console.append(outputstr) |
|
4065 | self.console.append(outputstr) | |
4054 | return 0 |
|
4066 | return 0 | |
4055 | else: |
|
4067 | else: | |
4056 | self.addPUWindow() |
|
4068 | self.addPUWindow() | |
4057 | self.console.clear() |
|
4069 | self.console.clear() | |
4058 | self.console.append("Please, Choose the type of Processing Unit") |
|
4070 | self.console.append("Please, Choose the type of Processing Unit") | |
4059 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4071 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4060 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4072 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4061 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4073 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4062 |
|
4074 | |||
4063 | if action == quitAction2: |
|
4075 | if action == quitAction2: | |
4064 | index = self.selectedItemTree |
|
4076 | index = self.selectedItemTree | |
4065 | try: |
|
4077 | try: | |
4066 | index.parent() |
|
4078 | index.parent() | |
4067 | except: |
|
4079 | except: | |
4068 | self.console.append('Please first select a Project or Processing Unit') |
|
4080 | self.console.append('Please first select a Project or Processing Unit') | |
4069 | return 0 |
|
4081 | return 0 | |
4070 | # print index.parent(),index |
|
4082 | # print index.parent(),index | |
4071 | if index.parent() == None: |
|
4083 | if index.parent() == None: | |
4072 | self.projectExplorerModel.removeRow(index.row()) |
|
4084 | self.projectExplorerModel.removeRow(index.row()) | |
4073 | else: |
|
4085 | else: | |
4074 | index.parent().removeRow(index.row()) |
|
4086 | index.parent().removeRow(index.row()) | |
4075 | self.removeItemTreeFromProject() |
|
4087 | self.removeItemTreeFromProject() | |
4076 | self.console.clear() |
|
4088 | self.console.clear() | |
4077 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4089 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4078 | # print i.row() |
|
4090 | # print i.row() | |
4079 |
|
4091 | |||
4080 | if action == quitAction3: |
|
4092 | if action == quitAction3: | |
4081 | self.close() |
|
4093 | self.close() | |
4082 | return 0 |
|
4094 | return 0 | |
4083 |
|
4095 | |||
4084 | def createProjectView(self, id): |
|
4096 | def createProjectView(self, id): | |
4085 |
|
4097 | |||
4086 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4098 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4087 | id = str(id) |
|
4099 | id = str(id) | |
4088 | projectParms = self.__getParmsFromProjectWindow() |
|
4100 | projectParms = self.__getParmsFromProjectWindow() | |
4089 |
|
4101 | |||
4090 | if not projectParms.isValid(): |
|
4102 | if not projectParms.isValid(): | |
4091 | return None |
|
4103 | return None | |
4092 |
|
4104 | |||
4093 | projectObjView = Project() |
|
4105 | projectObjView = Project() | |
4094 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4106 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4095 |
|
4107 | |||
4096 | self.__projectObjDict[id] = projectObjView |
|
4108 | self.__projectObjDict[id] = projectObjView | |
4097 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4109 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4098 |
|
4110 | |||
4099 | self.create = False |
|
4111 | self.create = False | |
4100 |
|
4112 | |||
4101 | return projectObjView |
|
4113 | return projectObjView | |
4102 |
|
4114 | |||
4103 | def updateProjectView(self): |
|
4115 | def updateProjectView(self): | |
4104 |
|
4116 | |||
4105 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4117 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4106 |
|
4118 | |||
4107 | projectParms = self.__getParmsFromProjectWindow() |
|
4119 | projectParms = self.__getParmsFromProjectWindow() | |
4108 |
|
4120 | |||
4109 | if not projectParms.isValid(): |
|
4121 | if not projectParms.isValid(): | |
4110 | return None |
|
4122 | return None | |
4111 |
|
4123 | |||
4112 | projectObjView = self.getSelectedProjectObj() |
|
4124 | projectObjView = self.getSelectedProjectObj() | |
|
4125 | ||||
|
4126 | if not projectObjView: | |||
|
4127 | self.console.append("Please select a project before update it") | |||
|
4128 | return None | |||
|
4129 | ||||
4113 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4130 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4114 |
|
|
4131 | ||
4115 | return projectObjView |
|
4132 | return projectObjView | |
4116 |
|
4133 | |||
4117 | def createReadUnitView(self, projectObjView): |
|
4134 | def createReadUnitView(self, projectObjView): | |
4118 |
|
4135 | |||
4119 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4136 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4120 |
|
4137 | |||
4121 | projectParms = self.__getParmsFromProjectWindow() |
|
4138 | projectParms = self.__getParmsFromProjectWindow() | |
4122 |
|
4139 | |||
4123 | if not projectParms.isValid(): |
|
4140 | if not projectParms.isValid(): | |
4124 | return None |
|
4141 | return None | |
4125 |
|
4142 | |||
4126 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4143 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4127 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4144 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
4128 | path=projectParms.dpath, |
|
4145 | path=projectParms.dpath, | |
4129 | startDate=projectParms.startDate, |
|
4146 | startDate=projectParms.startDate, | |
4130 | endDate=projectParms.endDate, |
|
4147 | endDate=projectParms.endDate, | |
4131 | startTime=projectParms.startTime, |
|
4148 | startTime=projectParms.startTime, | |
4132 | endTime=projectParms.endTime, |
|
4149 | endTime=projectParms.endTime, | |
4133 | online=projectParms.online, |
|
4150 | online=projectParms.online, | |
4134 | walk=projectParms.walk |
|
4151 | walk=projectParms.walk | |
4135 | ) |
|
4152 | ) | |
4136 |
|
4153 | |||
4137 | if projectParms.set: |
|
4154 | if projectParms.set: | |
4138 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4155 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4139 |
|
4156 | |||
4140 | if projectParms.delay: |
|
4157 | if projectParms.delay: | |
4141 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4158 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4142 |
|
4159 | |||
4143 | if projectParms.expLabel: |
|
4160 | if projectParms.expLabel: | |
4144 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4161 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4145 |
|
4162 | |||
4146 | if projectParms.datatype == "USRP": |
|
4163 | if projectParms.datatype == "USRP": | |
4147 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4164 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
4148 | path=projectParms.dpath, |
|
4165 | path=projectParms.dpath, | |
4149 | startDate=projectParms.startDate, |
|
4166 | startDate=projectParms.startDate, | |
4150 | endDate=projectParms.endDate, |
|
4167 | endDate=projectParms.endDate, | |
4151 | startTime=projectParms.startTime, |
|
4168 | startTime=projectParms.startTime, | |
4152 | endTime=projectParms.endTime, |
|
4169 | endTime=projectParms.endTime, | |
4153 | online=projectParms.online, |
|
4170 | online=projectParms.online, | |
4154 | ippKm=projectParms.ippKm |
|
4171 | ippKm=projectParms.ippKm | |
4155 | ) |
|
4172 | ) | |
4156 |
|
4173 | |||
4157 | if projectParms.delay: |
|
4174 | if projectParms.delay: | |
4158 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4175 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4159 |
|
4176 | |||
4160 | return readUnitConfObj |
|
4177 | return readUnitConfObj | |
4161 |
|
4178 | |||
4162 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4179 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4163 |
|
4180 | |||
4164 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
4181 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() | |
4165 |
|
4182 | |||
4166 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
4183 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) | |
4167 |
|
4184 | |||
4168 | projectParms = self.__getParmsFromProjectWindow() |
|
4185 | projectParms = self.__getParmsFromProjectWindow() | |
4169 |
|
4186 | |||
4170 | if not projectParms.isValid(): |
|
4187 | if not projectParms.isValid(): | |
4171 | return None |
|
4188 | return None | |
4172 |
|
4189 | |||
4173 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: |
|
4190 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: | |
4174 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4191 | readUnitConfObj.update(datatype=projectParms.datatype, | |
4175 | path=projectParms.dpath, |
|
4192 | path=projectParms.dpath, | |
4176 | startDate=projectParms.startDate, |
|
4193 | startDate=projectParms.startDate, | |
4177 | endDate=projectParms.endDate, |
|
4194 | endDate=projectParms.endDate, | |
4178 | startTime=projectParms.startTime, |
|
4195 | startTime=projectParms.startTime, | |
4179 | endTime=projectParms.endTime, |
|
4196 | endTime=projectParms.endTime, | |
4180 | online=projectParms.online, |
|
4197 | online=projectParms.online, | |
4181 | walk=projectParms.walk |
|
4198 | walk=projectParms.walk | |
4182 | ) |
|
4199 | ) | |
4183 | if projectParms.set: |
|
4200 | if projectParms.set: | |
4184 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4201 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4185 |
|
4202 | |||
4186 | if projectParms.delay: |
|
4203 | if projectParms.delay: | |
4187 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4204 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4188 |
|
4205 | |||
4189 | if projectParms.expLabel: |
|
4206 | if projectParms.expLabel: | |
4190 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4207 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4191 |
|
4208 | |||
4192 | if projectParms.datatype == "USRP": |
|
4209 | if projectParms.datatype == "USRP": | |
4193 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4210 | readUnitConfObj.update(datatype=projectParms.datatype, | |
4194 | path=projectParms.dpath, |
|
4211 | path=projectParms.dpath, | |
4195 | startDate=projectParms.startDate, |
|
4212 | startDate=projectParms.startDate, | |
4196 | endDate=projectParms.endDate, |
|
4213 | endDate=projectParms.endDate, | |
4197 | startTime=projectParms.startTime, |
|
4214 | startTime=projectParms.startTime, | |
4198 | endTime=projectParms.endTime, |
|
4215 | endTime=projectParms.endTime, | |
4199 | online=projectParms.online, |
|
4216 | online=projectParms.online, | |
4200 | ippKm=projectParms.ippKm |
|
4217 | ippKm=projectParms.ippKm | |
4201 | ) |
|
4218 | ) | |
4202 |
|
4219 | |||
4203 | if projectParms.delay: |
|
4220 | if projectParms.delay: | |
4204 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4221 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4205 |
|
4222 | |||
4206 | return readUnitConfObj |
|
4223 | return readUnitConfObj | |
4207 |
|
4224 | |||
4208 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4225 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4209 |
|
4226 | |||
4210 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4227 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4211 |
|
4228 | |||
4212 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4229 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4213 |
|
4230 | |||
4214 | return procUnitConfObj |
|
4231 | return procUnitConfObj | |
4215 |
|
4232 | |||
4216 | def updateProcUnitView(self, id): |
|
4233 | def updateProcUnitView(self, id): | |
4217 |
|
4234 | |||
4218 | procUnitConfObj = projectObjView.getProcUnitObj(id) |
|
4235 | procUnitConfObj = projectObjView.getProcUnitObj(id) | |
4219 | procUnitConfObj.removeOperations() |
|
4236 | procUnitConfObj.removeOperations() | |
4220 |
|
4237 | |||
4221 | return procUnitConfObj |
|
4238 | return procUnitConfObj | |
4222 |
|
4239 | |||
4223 | def addPUWindow(self): |
|
4240 | def addPUWindow(self): | |
4224 |
|
4241 | |||
4225 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4242 | self.configUPWindowObj = UnitProcessWindow(self) | |
4226 | fatherObj = self.getSelectedItemObj() |
|
4243 | fatherObj = self.getSelectedItemObj() | |
4227 | try: |
|
4244 | try: | |
4228 | fatherObj.getElementName() |
|
4245 | fatherObj.getElementName() | |
4229 | except: |
|
4246 | except: | |
4230 | self.console.append("First left click on Project or Processing Unit") |
|
4247 | self.console.append("First left click on Project or Processing Unit") | |
4231 | return 0 |
|
4248 | return 0 | |
4232 |
|
4249 | |||
4233 | if fatherObj.getElementName() == 'Project': |
|
4250 | if fatherObj.getElementName() == 'Project': | |
4234 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4251 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4235 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4252 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4236 |
|
4253 | |||
4237 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4254 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4238 | self.configUPWindowObj.loadTotalList() |
|
4255 | self.configUPWindowObj.loadTotalList() | |
4239 | self.configUPWindowObj.show() |
|
4256 | self.configUPWindowObj.show() | |
4240 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4257 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4241 |
|
4258 | |||
4242 | def createPUWindow(self): |
|
4259 | def createPUWindow(self): | |
4243 |
|
4260 | |||
4244 | if not self.configUPWindowObj.create: |
|
4261 | if not self.configUPWindowObj.create: | |
4245 | return |
|
4262 | return | |
4246 |
|
4263 | |||
4247 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4264 | fatherObj = self.configUPWindowObj.getFromWindow | |
4248 | datatype = self.configUPWindowObj.typeofUP |
|
4265 | datatype = self.configUPWindowObj.typeofUP | |
4249 |
|
4266 | |||
4250 | if fatherObj.getElementName() == 'Project': |
|
4267 | if fatherObj.getElementName() == 'Project': | |
4251 | inputId = fatherObj.getReadUnitId() |
|
4268 | inputId = fatherObj.getReadUnitId() | |
4252 | projectObjView = fatherObj |
|
4269 | projectObjView = fatherObj | |
4253 | else: |
|
4270 | else: | |
4254 | inputId = fatherObj.getId() |
|
4271 | inputId = fatherObj.getId() | |
4255 | projectObjView = self.getSelectedProjectObj() |
|
4272 | projectObjView = self.getSelectedProjectObj() | |
4256 |
|
4273 | |||
|
4274 | if not projectObjView: | |||
|
4275 | return | |||
|
4276 | ||||
4257 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4277 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4258 |
|
4278 | |||
4259 | self.addPU2ProjectExplorer(puObj) |
|
4279 | self.addPU2ProjectExplorer(puObj) | |
4260 |
|
4280 | |||
4261 | self.showtabPUCreated(datatype) |
|
4281 | self.showtabPUCreated(datatype) | |
4262 |
|
4282 | |||
4263 | self.clearPUWindow(datatype) |
|
4283 | self.clearPUWindow(datatype) | |
4264 |
|
4284 | |||
4265 | self.showPUinitView() |
|
4285 | self.showPUinitView() | |
4266 |
|
4286 | |||
4267 | def addFTPConf2Operation(self, puObj, opObj): |
|
4287 | def addFTPConf2Operation(self, puObj, opObj): | |
4268 |
|
4288 | |||
4269 | if not self.temporalFTP.create: |
|
4289 | if not self.temporalFTP.create: | |
4270 | self.temporalFTP.setwithoutconfiguration() |
|
4290 | self.temporalFTP.setwithoutconfiguration() | |
4271 |
|
4291 | |||
4272 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4292 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4273 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4293 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4274 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4294 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4275 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4295 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4276 |
|
4296 | |||
4277 | if self.temporalFTP.ftp_wei: |
|
4297 | if self.temporalFTP.ftp_wei: | |
4278 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4298 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4279 | if self.temporalFTP.exp_code: |
|
4299 | if self.temporalFTP.exp_code: | |
4280 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4300 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4281 | if self.temporalFTP.sub_exp_code: |
|
4301 | if self.temporalFTP.sub_exp_code: | |
4282 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4302 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4283 | if self.temporalFTP.plot_pos: |
|
4303 | if self.temporalFTP.plot_pos: | |
4284 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4304 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4285 |
|
4305 | |||
4286 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4306 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4287 | # |
|
4307 | # | |
4288 | # puId = None |
|
4308 | # puId = None | |
4289 | # puObj = None |
|
4309 | # puObj = None | |
4290 | # |
|
4310 | # | |
4291 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4311 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4292 | # |
|
4312 | # | |
4293 | # if not thisPuObj.name == "SendToServer": |
|
4313 | # if not thisPuObj.name == "SendToServer": | |
4294 | # continue |
|
4314 | # continue | |
4295 | # |
|
4315 | # | |
4296 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4316 | # opObj = thisPuObj.getOperationObj(name='run') | |
4297 | # |
|
4317 | # | |
4298 | # parmObj = opObj.getParameterObj('localfolder') |
|
4318 | # parmObj = opObj.getParameterObj('localfolder') | |
4299 | # |
|
4319 | # | |
4300 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4320 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4301 | # if not parmObj: |
|
4321 | # if not parmObj: | |
4302 | # projectObj.removeProcUnit(thisPuId) |
|
4322 | # projectObj.removeProcUnit(thisPuId) | |
4303 | # continue |
|
4323 | # continue | |
4304 | # |
|
4324 | # | |
4305 | # thisLocalfolder = parmObj.getValue() |
|
4325 | # thisLocalfolder = parmObj.getValue() | |
4306 | # |
|
4326 | # | |
4307 | # if localfolder != thisLocalfolder: |
|
4327 | # if localfolder != thisLocalfolder: | |
4308 | # continue |
|
4328 | # continue | |
4309 | # |
|
4329 | # | |
4310 | # puId = thisPuId |
|
4330 | # puId = thisPuId | |
4311 | # puObj = thisPuObj |
|
4331 | # puObj = thisPuObj | |
4312 | # break |
|
4332 | # break | |
4313 | # |
|
4333 | # | |
4314 | # return puObj |
|
4334 | # return puObj | |
4315 |
|
4335 | |||
4316 | def createFTPProcUnitView(self): |
|
4336 | def createFTPProcUnitView(self): | |
4317 |
|
4337 | |||
4318 | if not self.temporalFTP.create: |
|
4338 | if not self.temporalFTP.create: | |
4319 | self.temporalFTP.setwithoutconfiguration() |
|
4339 | self.temporalFTP.setwithoutconfiguration() | |
4320 |
|
4340 | |||
4321 | projectObj = self.getSelectedProjectObj() |
|
4341 | projectObj = self.getSelectedProjectObj() | |
4322 |
|
4342 | |||
|
4343 | if not projectObj: | |||
|
4344 | return | |||
|
4345 | ||||
4323 | self.removeAllFTPProcUnitView(projectObj) |
|
4346 | self.removeAllFTPProcUnitView(projectObj) | |
4324 |
|
4347 | |||
4325 | if not self.__puLocalFolder2FTP: |
|
4348 | if not self.__puLocalFolder2FTP: | |
4326 | return |
|
4349 | return | |
4327 |
|
4350 | |||
4328 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4351 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4329 |
|
4352 | |||
4330 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4353 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4331 |
|
4354 | |||
4332 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4355 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4333 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4356 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4334 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4357 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4335 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4358 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4336 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4359 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4337 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4360 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4338 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4361 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4339 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4362 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4340 |
|
4363 | |||
4341 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4364 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4342 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4365 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4343 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4366 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4344 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4367 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4345 |
|
4368 | |||
4346 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4369 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4347 |
|
4370 | |||
4348 | def removeAllFTPProcUnitView(self, projectObj): |
|
4371 | def removeAllFTPProcUnitView(self, projectObj): | |
4349 |
|
4372 | |||
4350 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4373 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4351 |
|
4374 | |||
4352 | if not thisPuObj.name == "SendToServer": |
|
4375 | if not thisPuObj.name == "SendToServer": | |
4353 | continue |
|
4376 | continue | |
4354 |
|
4377 | |||
4355 | projectObj.removeProcUnit(thisPuId) |
|
4378 | projectObj.removeProcUnit(thisPuId) | |
4356 |
|
4379 | |||
4357 | if thisPuId not in self.__puObjDict.keys(): |
|
4380 | if thisPuId not in self.__puObjDict.keys(): | |
4358 | continue |
|
4381 | continue | |
4359 |
|
4382 | |||
4360 | self.__puObjDict.pop(thisPuId) |
|
4383 | self.__puObjDict.pop(thisPuId) | |
4361 |
|
4384 | |||
4362 | def showPUinitView(self): |
|
4385 | def showPUinitView(self): | |
4363 |
|
4386 | |||
4364 | self.propertiesModel = TreeModel() |
|
4387 | self.propertiesModel = TreeModel() | |
4365 | self.propertiesModel.initPUVoltageView() |
|
4388 | self.propertiesModel.initPUVoltageView() | |
4366 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4389 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4367 | self.treeProjectProperties.expandAll() |
|
4390 | self.treeProjectProperties.expandAll() | |
4368 | self.treeProjectProperties.allColumnsShowFocus() |
|
4391 | self.treeProjectProperties.allColumnsShowFocus() | |
4369 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4392 | self.treeProjectProperties.resizeColumnToContents(1) | |
4370 |
|
4393 | |||
4371 | def saveFTPFromOpObj(self, operationObj): |
|
4394 | def saveFTPFromOpObj(self, operationObj): | |
4372 |
|
4395 | |||
4373 | if operationObj.name != "SendByFTP": |
|
4396 | if operationObj.name != "SendByFTP": | |
4374 | return |
|
4397 | return | |
4375 |
|
4398 | |||
4376 | server = operationObj.getParameterValue("server") |
|
4399 | server = operationObj.getParameterValue("server") | |
4377 | username = operationObj.getParameterValue("username") |
|
4400 | username = operationObj.getParameterValue("username") | |
4378 | password = operationObj.getParameterValue("password") |
|
4401 | password = operationObj.getParameterValue("password") | |
4379 | localfolder = operationObj.getParameterValue("localfolder") |
|
4402 | localfolder = operationObj.getParameterValue("localfolder") | |
4380 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4403 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4381 | ext = operationObj.getParameterValue("ext") |
|
4404 | ext = operationObj.getParameterValue("ext") | |
4382 | period = operationObj.getParameterValue("period") |
|
4405 | period = operationObj.getParameterValue("period") | |
4383 |
|
4406 | |||
4384 | self.temporalFTP.save(server=server, |
|
4407 | self.temporalFTP.save(server=server, | |
4385 | remotefolder=remotefolder, |
|
4408 | remotefolder=remotefolder, | |
4386 | username=username, |
|
4409 | username=username, | |
4387 | password=password, |
|
4410 | password=password, | |
4388 | localfolder=localfolder, |
|
4411 | localfolder=localfolder, | |
4389 | extension=ext) |
|
4412 | extension=ext) | |
4390 |
|
4413 | |||
4391 | return |
|
4414 | return | |
4392 |
|
4415 | |||
4393 | def saveFTPFromProcUnitObj(self, puObj): |
|
4416 | def saveFTPFromProcUnitObj(self, puObj): | |
4394 |
|
4417 | |||
4395 | opObj = puObj.getOperationObj(name="run") |
|
4418 | opObj = puObj.getOperationObj(name="run") | |
4396 |
|
4419 | |||
4397 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4420 | parmObj = opObj.getParameterObj(parameterName="server") | |
4398 | if parmObj == None: |
|
4421 | if parmObj == None: | |
4399 | server = 'jro-app.igp.gob.pe' |
|
4422 | server = 'jro-app.igp.gob.pe' | |
4400 | else: |
|
4423 | else: | |
4401 | server = parmObj.getValue() |
|
4424 | server = parmObj.getValue() | |
4402 |
|
4425 | |||
4403 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4426 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4404 | if parmObj == None: |
|
4427 | if parmObj == None: | |
4405 | remotefolder = '/home/wmaster/graficos' |
|
4428 | remotefolder = '/home/wmaster/graficos' | |
4406 | else: |
|
4429 | else: | |
4407 | remotefolder = parmObj.getValue() |
|
4430 | remotefolder = parmObj.getValue() | |
4408 |
|
4431 | |||
4409 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4432 | parmObj = opObj.getParameterObj(parameterName="username") | |
4410 | if parmObj == None: |
|
4433 | if parmObj == None: | |
4411 | username = 'wmaster' |
|
4434 | username = 'wmaster' | |
4412 | else: |
|
4435 | else: | |
4413 | username = parmObj.getValue() |
|
4436 | username = parmObj.getValue() | |
4414 |
|
4437 | |||
4415 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4438 | parmObj = opObj.getParameterObj(parameterName="password") | |
4416 | if parmObj == None: |
|
4439 | if parmObj == None: | |
4417 | password = 'mst2010vhf' |
|
4440 | password = 'mst2010vhf' | |
4418 | else: |
|
4441 | else: | |
4419 | password = parmObj.getValue() |
|
4442 | password = parmObj.getValue() | |
4420 |
|
4443 | |||
4421 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4444 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4422 | if parmObj == None: |
|
4445 | if parmObj == None: | |
4423 | ftp_wei = 0 |
|
4446 | ftp_wei = 0 | |
4424 | else: |
|
4447 | else: | |
4425 | ftp_wei = parmObj.getValue() |
|
4448 | ftp_wei = parmObj.getValue() | |
4426 |
|
4449 | |||
4427 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4450 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4428 | if parmObj == None: |
|
4451 | if parmObj == None: | |
4429 | exp_code = 0 |
|
4452 | exp_code = 0 | |
4430 | else: |
|
4453 | else: | |
4431 | exp_code = parmObj.getValue() |
|
4454 | exp_code = parmObj.getValue() | |
4432 |
|
4455 | |||
4433 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4456 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4434 | if parmObj == None: |
|
4457 | if parmObj == None: | |
4435 | sub_exp_code = 0 |
|
4458 | sub_exp_code = 0 | |
4436 | else: |
|
4459 | else: | |
4437 | sub_exp_code = parmObj.getValue() |
|
4460 | sub_exp_code = parmObj.getValue() | |
4438 |
|
4461 | |||
4439 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4462 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4440 | if parmObj == None: |
|
4463 | if parmObj == None: | |
4441 | plot_pos = 0 |
|
4464 | plot_pos = 0 | |
4442 | else: |
|
4465 | else: | |
4443 | plot_pos = parmObj.getValue() |
|
4466 | plot_pos = parmObj.getValue() | |
4444 |
|
4467 | |||
4445 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4468 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4446 | if parmObj == None: |
|
4469 | if parmObj == None: | |
4447 | localfolder = None |
|
4470 | localfolder = None | |
4448 | else: |
|
4471 | else: | |
4449 | localfolder = parmObj.getValue() |
|
4472 | localfolder = parmObj.getValue() | |
4450 |
|
4473 | |||
4451 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4474 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4452 | if parmObj == None: |
|
4475 | if parmObj == None: | |
4453 | extension = '.png' |
|
4476 | extension = '.png' | |
4454 | else: |
|
4477 | else: | |
4455 | extension = parmObj.getValue() |
|
4478 | extension = parmObj.getValue() | |
4456 |
|
4479 | |||
4457 | self.temporalFTP.save(server=server, |
|
4480 | self.temporalFTP.save(server=server, | |
4458 | remotefolder=remotefolder, |
|
4481 | remotefolder=remotefolder, | |
4459 | username=username, |
|
4482 | username=username, | |
4460 | password=password, |
|
4483 | password=password, | |
4461 | ftp_wei=ftp_wei, |
|
4484 | ftp_wei=ftp_wei, | |
4462 | exp_code=exp_code, |
|
4485 | exp_code=exp_code, | |
4463 | sub_exp_code=sub_exp_code, |
|
4486 | sub_exp_code=sub_exp_code, | |
4464 | plot_pos=plot_pos, |
|
4487 | plot_pos=plot_pos, | |
4465 | localfolder=localfolder, |
|
4488 | localfolder=localfolder, | |
4466 | extension=extension) |
|
4489 | extension=extension) | |
4467 |
|
4490 | |||
4468 | def addProject2ProjectExplorer(self, id, name): |
|
4491 | def addProject2ProjectExplorer(self, id, name): | |
4469 |
|
4492 | |||
4470 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4493 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4471 |
|
4494 | |||
4472 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4495 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4473 | parentItem.appendRow(itemTree) |
|
4496 | parentItem.appendRow(itemTree) | |
4474 |
|
4497 | |||
4475 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4498 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4476 |
|
4499 | |||
4477 | self.selectedItemTree = itemTree |
|
4500 | self.selectedItemTree = itemTree | |
4478 |
|
4501 | |||
4479 | self.__itemTreeDict[id] = itemTree |
|
4502 | self.__itemTreeDict[id] = itemTree | |
4480 |
|
4503 | |||
4481 | def addPU2ProjectExplorer(self, puObj): |
|
4504 | def addPU2ProjectExplorer(self, puObj): | |
4482 |
|
4505 | |||
4483 | id, name = puObj.id, puObj.datatype |
|
4506 | id, name = puObj.id, puObj.datatype | |
4484 |
|
4507 | |||
4485 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4508 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4486 |
|
4509 | |||
4487 | parentItem = self.selectedItemTree |
|
4510 | parentItem = self.selectedItemTree | |
4488 | parentItem.appendRow(itemTree) |
|
4511 | parentItem.appendRow(itemTree) | |
4489 | self.projectExplorerTree.expandAll() |
|
4512 | self.projectExplorerTree.expandAll() | |
4490 |
|
4513 | |||
4491 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4514 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4492 |
|
4515 | |||
4493 | self.selectedItemTree = itemTree |
|
4516 | self.selectedItemTree = itemTree | |
4494 |
|
4517 | |||
4495 | self.__itemTreeDict[id] = itemTree |
|
4518 | self.__itemTreeDict[id] = itemTree | |
4496 |
|
4519 | |||
4497 | def addPU2PELoadXML(self, puObj): |
|
4520 | def addPU2PELoadXML(self, puObj): | |
4498 |
|
4521 | |||
4499 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4522 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4500 |
|
4523 | |||
4501 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4524 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4502 |
|
4525 | |||
4503 | if self.__itemTreeDict.has_key(inputId): |
|
4526 | if self.__itemTreeDict.has_key(inputId): | |
4504 | parentItem = self.__itemTreeDict[inputId] |
|
4527 | parentItem = self.__itemTreeDict[inputId] | |
4505 | else: |
|
4528 | else: | |
4506 | #If parent is a Reader object |
|
4529 | #If parent is a Reader object | |
4507 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4530 | parentItem = self.__itemTreeDict[id[:-1]] | |
4508 |
|
4531 | |||
4509 | parentItem.appendRow(itemTree) |
|
4532 | parentItem.appendRow(itemTree) | |
4510 | self.projectExplorerTree.expandAll() |
|
4533 | self.projectExplorerTree.expandAll() | |
4511 | parentItem = itemTree |
|
4534 | parentItem = itemTree | |
4512 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4535 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4513 |
|
4536 | |||
4514 | self.__itemTreeDict[id] = itemTree |
|
4537 | self.__itemTreeDict[id] = itemTree | |
4515 | self.selectedItemTree = itemTree |
|
4538 | self.selectedItemTree = itemTree | |
4516 |
|
4539 | |||
4517 | def getSelectedProjectObj(self): |
|
4540 | def getSelectedProjectObj(self): | |
4518 | """ |
|
4541 | """ | |
4519 | Return the current project object selected. If a processing unit is |
|
4542 | Return the current project object selected. If a processing unit is | |
4520 | actually selected this function returns associated project. |
|
4543 | actually selected this function returns associated project. | |
4521 |
|
4544 | |||
4522 | None if any project or processing unit is selected |
|
4545 | None if any project or processing unit is selected | |
4523 | """ |
|
4546 | """ | |
4524 | for key in self.__itemTreeDict.keys(): |
|
4547 | for key in self.__itemTreeDict.keys(): | |
4525 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4548 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4526 | continue |
|
4549 | continue | |
4527 |
|
4550 | |||
4528 | if self.__projectObjDict.has_key(key): |
|
4551 | if self.__projectObjDict.has_key(key): | |
4529 | projectObj = self.__projectObjDict[key] |
|
4552 | projectObj = self.__projectObjDict[key] | |
4530 | return projectObj |
|
4553 | return projectObj | |
4531 |
|
4554 | |||
4532 | puObj = self.__puObjDict[key] |
|
4555 | puObj = self.__puObjDict[key] | |
4533 |
|
4556 | |||
4534 | if puObj.parentId == None: |
|
4557 | if puObj.parentId == None: | |
4535 | projectId = puObj.getId()[0] |
|
4558 | projectId = puObj.getId()[0] | |
4536 | else: |
|
4559 | else: | |
4537 | projectId = puObj.parentId |
|
4560 | projectId = puObj.parentId | |
4538 |
|
4561 | |||
4539 | projectObj = self.__projectObjDict[projectId] |
|
4562 | projectObj = self.__projectObjDict[projectId] | |
4540 | return projectObj |
|
4563 | return projectObj | |
4541 |
|
4564 | |||
4542 | return None |
|
4565 | return None | |
4543 |
|
4566 | |||
4544 | def getSelectedItemObj(self): |
|
4567 | def getSelectedItemObj(self): | |
4545 | """ |
|
4568 | """ | |
4546 | Return the current project or processing unit object selected |
|
4569 | Return the current project or processing unit object selected | |
4547 |
|
4570 | |||
4548 | None if any project or processing unit is selected |
|
4571 | None if any project or processing unit is selected | |
4549 | """ |
|
4572 | """ | |
4550 | for key in self.__itemTreeDict.keys(): |
|
4573 | for key in self.__itemTreeDict.keys(): | |
4551 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4574 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4552 | continue |
|
4575 | continue | |
4553 |
|
4576 | |||
4554 | if self.__projectObjDict.has_key(key) == True: |
|
4577 | if self.__projectObjDict.has_key(key) == True: | |
4555 | fatherObj = self.__projectObjDict[key] |
|
4578 | fatherObj = self.__projectObjDict[key] | |
4556 | else: |
|
4579 | else: | |
4557 | fatherObj = self.__puObjDict[key] |
|
4580 | fatherObj = self.__puObjDict[key] | |
4558 |
|
4581 | |||
4559 | return fatherObj |
|
4582 | return fatherObj | |
4560 |
|
4583 | |||
4561 | return None |
|
4584 | return None | |
4562 |
|
4585 | |||
4563 | def _WarningWindow(self, text, information): |
|
4586 | def _WarningWindow(self, text, information): | |
4564 |
|
4587 | |||
4565 | msgBox = QtGui.QMessageBox() |
|
4588 | msgBox = QtGui.QMessageBox() | |
4566 | msgBox.setText(text) |
|
4589 | msgBox.setText(text) | |
4567 | msgBox.setInformativeText(information) |
|
4590 | msgBox.setInformativeText(information) | |
4568 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4591 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4569 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4592 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4570 | ret = msgBox.exec_() |
|
4593 | ret = msgBox.exec_() | |
4571 |
|
4594 | |||
4572 | answer = False |
|
4595 | answer = False | |
4573 |
|
4596 | |||
4574 | if ret == QtGui.QMessageBox.Ok: |
|
4597 | if ret == QtGui.QMessageBox.Ok: | |
4575 | answer = True |
|
4598 | answer = True | |
4576 |
|
4599 | |||
4577 | return answer |
|
4600 | return answer | |
4578 |
|
4601 | |||
4579 | def __getNewProjectId(self): |
|
4602 | def __getNewProjectId(self): | |
4580 |
|
4603 | |||
4581 | loadProject = False |
|
4604 | loadProject = False | |
4582 |
|
4605 | |||
4583 | for thisId in range(1,10): |
|
4606 | for thisId in range(1,10): | |
4584 | newId = str(thisId) |
|
4607 | newId = str(thisId) | |
4585 | if newId in self.__projectObjDict.keys(): |
|
4608 | if newId in self.__projectObjDict.keys(): | |
4586 | continue |
|
4609 | continue | |
4587 |
|
4610 | |||
4588 | loadProject = True |
|
4611 | loadProject = True | |
4589 | projectId = newId |
|
4612 | projectId = newId | |
4590 | break |
|
4613 | break | |
4591 |
|
4614 | |||
4592 | if not loadProject: |
|
4615 | if not loadProject: | |
4593 | self.console.clear() |
|
4616 | self.console.clear() | |
4594 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4617 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4595 | return None |
|
4618 | return None | |
4596 |
|
4619 | |||
4597 | return projectId |
|
4620 | return projectId | |
4598 |
|
4621 | |||
4599 | def openProject(self): |
|
4622 | def openProject(self): | |
4600 |
|
4623 | |||
4601 | self.actionStart.setEnabled(False) |
|
4624 | self.actionStart.setEnabled(False) | |
4602 | self.actionStarToolbar.setEnabled(False) |
|
4625 | self.actionStarToolbar.setEnabled(False) | |
4603 |
|
4626 | |||
4604 | self.create = False |
|
4627 | self.create = False | |
4605 | self.frame_2.setEnabled(True) |
|
4628 | self.frame_2.setEnabled(True) | |
4606 |
|
4629 | |||
4607 | # print self.dir |
|
4630 | # print self.dir | |
4608 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
4631 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
4609 |
|
4632 | |||
4610 | projectObjLoad = Project() |
|
4633 | projectObjLoad = Project() | |
4611 |
|
4634 | |||
4612 | try: |
|
4635 | try: | |
4613 | projectObjLoad.readXml(filename) |
|
4636 | projectObjLoad.readXml(filename) | |
4614 | except: |
|
4637 | except: | |
4615 | self.console.clear() |
|
4638 | self.console.clear() | |
4616 | self.console.append("The selected xml file could not be loaded ...") |
|
4639 | self.console.append("The selected xml file could not be loaded ...") | |
4617 | return 0 |
|
4640 | return 0 | |
4618 |
|
4641 | |||
4619 | self.refreshProjectWindow(projectObjLoad) |
|
4642 | self.refreshProjectWindow(projectObjLoad) | |
4620 | self.refreshProjectProperties(projectObjLoad) |
|
4643 | self.refreshProjectProperties(projectObjLoad) | |
4621 |
|
4644 | |||
4622 | projectId = projectObjLoad.id |
|
4645 | projectId = projectObjLoad.id | |
4623 |
|
4646 | |||
4624 | if projectId in self.__projectObjDict.keys(): |
|
4647 | if projectId in self.__projectObjDict.keys(): | |
4625 |
|
4648 | |||
4626 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4649 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4627 | # "Do you want to load the file anyway?") |
|
4650 | # "Do you want to load the file anyway?") | |
4628 | # if not answer: |
|
4651 | # if not answer: | |
4629 | # return |
|
4652 | # return | |
4630 |
|
4653 | |||
4631 | projectId = self.__getNewProjectId() |
|
4654 | projectId = self.__getNewProjectId() | |
4632 |
|
4655 | |||
4633 | if not projectId: |
|
4656 | if not projectId: | |
4634 | return |
|
4657 | return | |
4635 |
|
4658 | |||
4636 | projectObjLoad.updateId(projectId) |
|
4659 | projectObjLoad.updateId(projectId) | |
4637 |
|
4660 | |||
4638 | self.__projectObjDict[projectId] = projectObjLoad |
|
4661 | self.__projectObjDict[projectId] = projectObjLoad | |
4639 |
|
4662 | |||
4640 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4663 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4641 |
|
4664 | |||
4642 | self.tabWidgetProject.setEnabled(True) |
|
4665 | self.tabWidgetProject.setEnabled(True) | |
4643 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4666 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4644 | # Disable tabProject after finish the creation |
|
4667 | # Disable tabProject after finish the creation | |
4645 | self.tabProject.setEnabled(True) |
|
4668 | self.tabProject.setEnabled(True) | |
4646 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4669 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4647 |
|
4670 | |||
4648 | for puId, puObj in puObjorderList.items(): |
|
4671 | for puId, puObj in puObjorderList.items(): | |
4649 |
|
4672 | |||
4650 | self.__puObjDict[puId] = puObj |
|
4673 | self.__puObjDict[puId] = puObj | |
4651 |
|
4674 | |||
4652 | if puObj.name == "SendToServer": |
|
4675 | if puObj.name == "SendToServer": | |
4653 | self.saveFTPFromProcUnitObj(puObj) |
|
4676 | self.saveFTPFromProcUnitObj(puObj) | |
4654 |
|
4677 | |||
4655 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4678 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4656 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4679 | operationObj = puObj.getOperationObj("SendByFTP") | |
4657 |
|
4680 | |||
4658 | if operationObj: |
|
4681 | if operationObj: | |
4659 | self.saveFTPFromOpObj(operationObj) |
|
4682 | self.saveFTPFromOpObj(operationObj) | |
4660 | ############################################################ |
|
4683 | ############################################################ | |
4661 |
|
4684 | |||
4662 | if puObj.inputId == '0': |
|
4685 | if puObj.inputId == '0': | |
4663 | continue |
|
4686 | continue | |
4664 |
|
4687 | |||
4665 | self.addPU2PELoadXML(puObj) |
|
4688 | self.addPU2PELoadXML(puObj) | |
4666 |
|
4689 | |||
4667 | self.refreshPUWindow(puObj) |
|
4690 | self.refreshPUWindow(puObj) | |
4668 | self.refreshPUProperties(puObj) |
|
4691 | self.refreshPUProperties(puObj) | |
4669 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4692 | self.showtabPUCreated(datatype=puObj.datatype) | |
4670 |
|
4693 | |||
4671 | self.console.clear() |
|
4694 | self.console.clear() | |
4672 | self.console.append("The selected xml file has been loaded successfully") |
|
4695 | self.console.append("The selected xml file has been loaded successfully") | |
4673 |
|
4696 | |||
4674 | self.actionStart.setEnabled(True) |
|
4697 | self.actionStart.setEnabled(True) | |
4675 | self.actionStarToolbar.setEnabled(True) |
|
4698 | self.actionStarToolbar.setEnabled(True) | |
4676 |
|
4699 | |||
4677 | def create_updating_timer(self): |
|
4700 | def create_updating_timer(self): | |
4678 | self.comm_data_timer = QtCore.QTimer(self) |
|
4701 | self.comm_data_timer = QtCore.QTimer(self) | |
4679 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4702 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4680 | self.comm_data_timer.start(1000) |
|
4703 | self.comm_data_timer.start(1000) | |
4681 |
|
4704 | |||
4682 | def on_comm_updating_timer(self): |
|
4705 | def on_comm_updating_timer(self): | |
4683 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4706 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4684 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4707 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4685 | if not self.__enable: |
|
4708 | if not self.__enable: | |
4686 | return |
|
4709 | return | |
4687 |
|
4710 | |||
4688 | if self.controllerThread.isFinished(): |
|
4711 | if self.controllerThread.isFinished(): | |
4689 | self.stopProject() |
|
4712 | self.stopProject() | |
4690 |
|
4713 | |||
4691 | # def jobStartedFromThread(self, success): |
|
4714 | # def jobStartedFromThread(self, success): | |
4692 | # |
|
4715 | # | |
4693 | # self.console.clear() |
|
4716 | # self.console.clear() | |
4694 | # self.console.append("Job started") |
|
4717 | # self.console.append("Job started") | |
4695 | # |
|
4718 | # | |
4696 | # def jobFinishedFromThread(self, success): |
|
4719 | # def jobFinishedFromThread(self, success): | |
4697 | # |
|
4720 | # | |
4698 | # self.stopProject() |
|
4721 | # self.stopProject() | |
4699 |
|
4722 | |||
4700 | def playProject(self, ext=".xml", save=1): |
|
4723 | def playProject(self, ext=".xml", save=1): | |
4701 |
|
4724 | |||
4702 | projectObj = self.getSelectedProjectObj() |
|
4725 | projectObj = self.getSelectedProjectObj() | |
4703 |
|
4726 | |||
4704 | if not projectObj: |
|
4727 | if not projectObj: | |
4705 |
|
|
4728 | self.console.append("Please select a project before pressing PLAY button") | |
4706 | return |
|
4729 | return | |
4707 |
|
4730 | |||
4708 | if save: |
|
4731 | if save: | |
4709 | filename = self.saveProject() |
|
4732 | filename = self.saveProject() | |
4710 | if filename == None: |
|
4733 | if filename == None: | |
4711 | self.console.append("Process did not initialize.") |
|
4734 | self.console.append("Process did not initialize.") | |
4712 | return |
|
4735 | return | |
4713 | else: |
|
4736 | else: | |
4714 | filename = TEMPORAL_FILE |
|
4737 | filename = TEMPORAL_FILE | |
4715 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4738 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4716 |
|
4739 | |||
4717 | self.actionStart.setEnabled(False) |
|
4740 | self.actionStart.setEnabled(False) | |
4718 | self.actionPause.setEnabled(True) |
|
4741 | self.actionPause.setEnabled(True) | |
4719 | self.actionStop.setEnabled(True) |
|
4742 | self.actionStop.setEnabled(True) | |
4720 |
|
4743 | |||
4721 | self.actionStarToolbar.setEnabled(False) |
|
4744 | self.actionStarToolbar.setEnabled(False) | |
4722 | self.actionPauseToolbar.setEnabled(True) |
|
4745 | self.actionPauseToolbar.setEnabled(True) | |
4723 | self.actionStopToolbar.setEnabled(True) |
|
4746 | self.actionStopToolbar.setEnabled(True) | |
4724 |
|
4747 | |||
4725 | self.console.append("Please Wait...") |
|
4748 | self.console.append("Please Wait...") | |
4726 |
|
4749 | |||
4727 | self.controllerThread = ControllerThread(filename) |
|
4750 | self.controllerThread = ControllerThread(filename) | |
4728 |
|
4751 | |||
4729 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) |
|
4752 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) | |
4730 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) |
|
4753 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) | |
4731 | self.console.clear() |
|
4754 | self.console.clear() | |
4732 | self.controllerThread.start() |
|
4755 | self.controllerThread.start() | |
4733 | sleep(0.5) |
|
4756 | sleep(0.5) | |
4734 | self.__enable = True |
|
4757 | self.__enable = True | |
4735 |
|
4758 | |||
4736 | def stopProject(self): |
|
4759 | def stopProject(self): | |
4737 |
|
4760 | |||
4738 | self.__enable = False |
|
4761 | self.__enable = False | |
4739 |
|
4762 | |||
4740 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) |
|
4763 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
4741 | self.controllerThread.stop() |
|
4764 | self.controllerThread.stop() | |
4742 |
|
4765 | |||
4743 | while self.controllerThread.isRunning(): |
|
4766 | while self.controllerThread.isRunning(): | |
4744 | sleep(0.5) |
|
4767 | sleep(0.5) | |
4745 |
|
4768 | |||
4746 | self.actionStart.setEnabled(True) |
|
4769 | self.actionStart.setEnabled(True) | |
4747 | self.actionPause.setEnabled(False) |
|
4770 | self.actionPause.setEnabled(False) | |
4748 | self.actionStop.setEnabled(False) |
|
4771 | self.actionStop.setEnabled(False) | |
4749 |
|
4772 | |||
4750 | self.actionStarToolbar.setEnabled(True) |
|
4773 | self.actionStarToolbar.setEnabled(True) | |
4751 | self.actionPauseToolbar.setEnabled(False) |
|
4774 | self.actionPauseToolbar.setEnabled(False) | |
4752 | self.actionStopToolbar.setEnabled(False) |
|
4775 | self.actionStopToolbar.setEnabled(False) | |
4753 |
|
4776 | |||
4754 | self.restorePauseIcon() |
|
4777 | self.restorePauseIcon() | |
4755 |
|
4778 | |||
4756 | def pauseProject(self): |
|
4779 | def pauseProject(self): | |
4757 |
|
4780 | |||
4758 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4781 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4759 | self.controllerThread.pause() |
|
4782 | self.controllerThread.pause() | |
4760 |
|
4783 | |||
4761 | self.actionStart.setEnabled(False) |
|
4784 | self.actionStart.setEnabled(False) | |
4762 | self.actionPause.setEnabled(True) |
|
4785 | self.actionPause.setEnabled(True) | |
4763 | self.actionStop.setEnabled(True) |
|
4786 | self.actionStop.setEnabled(True) | |
4764 |
|
4787 | |||
4765 | self.actionStarToolbar.setEnabled(False) |
|
4788 | self.actionStarToolbar.setEnabled(False) | |
4766 | self.actionPauseToolbar.setEnabled(True) |
|
4789 | self.actionPauseToolbar.setEnabled(True) | |
4767 | self.actionStopToolbar.setEnabled(True) |
|
4790 | self.actionStopToolbar.setEnabled(True) | |
4768 |
|
4791 | |||
4769 | def saveProject(self, filename=None): |
|
4792 | def saveProject(self, filename=None): | |
4770 |
|
4793 | |||
4771 | self.actionStart.setEnabled(False) |
|
4794 | self.actionStart.setEnabled(False) | |
4772 | self.actionStarToolbar.setEnabled(False) |
|
4795 | self.actionStarToolbar.setEnabled(False) | |
4773 |
|
4796 | |||
4774 |
projectObj = self.getSelectedProjectObj() |
|
4797 | projectObj = self.getSelectedProjectObj() | |
|
4798 | ||||
|
4799 | if not projectObj: | |||
|
4800 | self.console.append("Please select a project before save it") | |||
|
4801 | return | |||
|
4802 | ||||
4775 | self.refreshGraphicsId() |
|
4803 | self.refreshGraphicsId() | |
4776 |
|
4804 | |||
4777 | sts = True |
|
4805 | sts = True | |
4778 | selectedItemObj = self.getSelectedItemObj() |
|
4806 | selectedItemObj = self.getSelectedItemObj() | |
4779 |
|
4807 | |||
4780 | #A Processing Unit has been selected |
|
4808 | #A Processing Unit has been selected | |
4781 | if projectObj == selectedItemObj: |
|
4809 | if projectObj == selectedItemObj: | |
4782 | if not self.on_proOk_clicked(): |
|
4810 | if not self.on_proOk_clicked(): | |
4783 | return None |
|
4811 | return None | |
4784 |
|
4812 | |||
4785 | #A Processing Unit has been selected |
|
4813 | #A Processing Unit has been selected | |
4786 | if projectObj != selectedItemObj: |
|
4814 | if projectObj != selectedItemObj: | |
4787 | puObj = selectedItemObj |
|
4815 | puObj = selectedItemObj | |
4788 |
|
4816 | |||
4789 | if puObj.name == 'VoltageProc': |
|
4817 | if puObj.name == 'VoltageProc': | |
4790 | sts = self.on_volOpOk_clicked() |
|
4818 | sts = self.on_volOpOk_clicked() | |
4791 | if puObj.name == 'SpectraProc': |
|
4819 | if puObj.name == 'SpectraProc': | |
4792 | sts = self.on_specOpOk_clicked() |
|
4820 | sts = self.on_specOpOk_clicked() | |
4793 | if puObj.name == 'SpectraHeisProc': |
|
4821 | if puObj.name == 'SpectraHeisProc': | |
4794 | sts = self.on_specHeisOpOk_clicked() |
|
4822 | sts = self.on_specHeisOpOk_clicked() | |
4795 |
|
4823 | |||
4796 | if not sts: |
|
4824 | if not sts: | |
4797 | return None |
|
4825 | return None | |
4798 |
|
4826 | |||
4799 | self.createFTPProcUnitView() |
|
4827 | self.createFTPProcUnitView() | |
4800 |
|
4828 | |||
4801 | if not filename: |
|
4829 | if not filename: | |
4802 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4830 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4803 |
|
4831 | |||
4804 | projectObj.writeXml(filename) |
|
4832 | projectObj.writeXml(filename) | |
4805 | self.console.append("\nPress Play button to start data processing ...") |
|
4833 | self.console.clear() | |
|
4834 | self.console.append("Project saved") | |||
|
4835 | self.console.append("Press Play button to start data processing ...") | |||
4806 |
|
4836 | |||
4807 | self.actionStart.setEnabled(True) |
|
4837 | self.actionStart.setEnabled(True) | |
4808 | self.actionStarToolbar.setEnabled(True) |
|
4838 | self.actionStarToolbar.setEnabled(True) | |
4809 |
|
4839 | |||
4810 | return filename |
|
4840 | return filename | |
4811 |
|
4841 | |||
4812 | def removeItemTreeFromProject(self): |
|
4842 | def removeItemTreeFromProject(self): | |
4813 | """ |
|
4843 | """ | |
4814 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4844 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4815 | """ |
|
4845 | """ | |
4816 | for key in self.__itemTreeDict.keys(): |
|
4846 | for key in self.__itemTreeDict.keys(): | |
4817 |
|
4847 | |||
4818 | #Check again because an item can delete multiple items (childs) |
|
4848 | #Check again because an item can delete multiple items (childs) | |
4819 | if key not in self.__itemTreeDict.keys(): |
|
4849 | if key not in self.__itemTreeDict.keys(): | |
4820 | continue |
|
4850 | continue | |
4821 |
|
4851 | |||
4822 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4852 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4823 | continue |
|
4853 | continue | |
4824 |
|
4854 | |||
4825 | if self.__projectObjDict.has_key(key) == True: |
|
4855 | if self.__projectObjDict.has_key(key) == True: | |
4826 |
|
4856 | |||
4827 | del self.__projectObjDict[key] |
|
4857 | del self.__projectObjDict[key] | |
4828 | del self.__itemTreeDict[key] |
|
4858 | del self.__itemTreeDict[key] | |
4829 |
|
4859 | |||
4830 | else: |
|
4860 | else: | |
4831 | puObj = self.__puObjDict[key] |
|
4861 | puObj = self.__puObjDict[key] | |
4832 | idProjectParent = puObj.parentId |
|
4862 | idProjectParent = puObj.parentId | |
4833 | projectObj = self.__projectObjDict[idProjectParent] |
|
4863 | projectObj = self.__projectObjDict[idProjectParent] | |
4834 |
|
4864 | |||
4835 | del self.__puObjDict[key] |
|
4865 | del self.__puObjDict[key] | |
4836 | del self.__itemTreeDict[key] |
|
4866 | del self.__itemTreeDict[key] | |
4837 | del projectObj.procUnitConfObjDict[key] |
|
4867 | del projectObj.procUnitConfObjDict[key] | |
4838 |
|
4868 | |||
4839 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4869 | for key in projectObj.procUnitConfObjDict.keys(): | |
4840 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4870 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4841 | continue |
|
4871 | continue | |
4842 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4872 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4843 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4873 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4844 | del projectObj.procUnitConfObjDict[key] |
|
4874 | del projectObj.procUnitConfObjDict[key] | |
4845 | # print projectObj.procUnitConfObjDict |
|
4875 | # print projectObj.procUnitConfObjDict | |
4846 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4876 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4847 |
|
4877 | |||
4848 | def setInputsProject_View(self): |
|
4878 | def setInputsProject_View(self): | |
4849 |
|
4879 | |||
4850 | self.tabWidgetProject.setEnabled(True) |
|
4880 | self.tabWidgetProject.setEnabled(True) | |
4851 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4881 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4852 | self.tabProject.setEnabled(True) |
|
4882 | self.tabProject.setEnabled(True) | |
4853 | self.frame_2.setEnabled(False) |
|
4883 | self.frame_2.setEnabled(False) | |
4854 | self.proName.clear() |
|
4884 | self.proName.clear() | |
4855 | self.proName.setFocus() |
|
4885 | self.proName.setFocus() | |
4856 | self.proName.setSelection(0, 0) |
|
4886 | self.proName.setSelection(0, 0) | |
4857 | self.proName.setCursorPosition(0) |
|
4887 | self.proName.setCursorPosition(0) | |
4858 | self.proDataType.setText('.r') |
|
4888 | self.proDataType.setText('.r') | |
4859 | self.proDataPath.clear() |
|
4889 | self.proDataPath.clear() | |
4860 | self.proComDataType.clear() |
|
4890 | self.proComDataType.clear() | |
4861 | self.proComDataType.addItem("Voltage") |
|
4891 | self.proComDataType.addItem("Voltage") | |
4862 | self.proComDataType.addItem("Spectra") |
|
4892 | self.proComDataType.addItem("Spectra") | |
4863 | self.proComDataType.addItem("Fits") |
|
4893 | self.proComDataType.addItem("Fits") | |
4864 | self.proComDataType.addItem("USRP") |
|
4894 | self.proComDataType.addItem("USRP") | |
4865 |
|
4895 | |||
4866 | self.proComStartDate.clear() |
|
4896 | self.proComStartDate.clear() | |
4867 | self.proComEndDate.clear() |
|
4897 | self.proComEndDate.clear() | |
4868 |
|
4898 | |||
4869 | startTime = "00:00:00" |
|
4899 | startTime = "00:00:00" | |
4870 | endTime = "23:59:59" |
|
4900 | endTime = "23:59:59" | |
4871 | starlist = startTime.split(":") |
|
4901 | starlist = startTime.split(":") | |
4872 | endlist = endTime.split(":") |
|
4902 | endlist = endTime.split(":") | |
4873 | self.proDelay.setText("60") |
|
4903 | self.proDelay.setText("60") | |
4874 | self.proSet.setText("") |
|
4904 | self.proSet.setText("") | |
4875 |
|
4905 | |||
4876 | self.labelSet.show() |
|
4906 | self.labelSet.show() | |
4877 | self.proSet.show() |
|
4907 | self.proSet.show() | |
4878 |
|
4908 | |||
4879 | self.labelIPPKm.hide() |
|
4909 | self.labelIPPKm.hide() | |
4880 | self.proIPPKm.hide() |
|
4910 | self.proIPPKm.hide() | |
4881 |
|
4911 | |||
4882 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4912 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4883 | self.proStartTime.setTime(self.time) |
|
4913 | self.proStartTime.setTime(self.time) | |
4884 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4914 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4885 | self.proEndTime.setTime(self.time) |
|
4915 | self.proEndTime.setTime(self.time) | |
4886 | self.proDescription.clear() |
|
4916 | self.proDescription.clear() | |
4887 | self.proOk.setEnabled(False) |
|
4917 | self.proOk.setEnabled(False) | |
4888 | # self.console.append("Please, Write a name Project") |
|
4918 | # self.console.append("Please, Write a name Project") | |
4889 | # self.console.append("Introduce Project Parameters")DC |
|
4919 | # self.console.append("Introduce Project Parameters")DC | |
4890 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4920 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4891 |
|
4921 | |||
4892 | def clearPUWindow(self, datatype): |
|
4922 | def clearPUWindow(self, datatype): | |
4893 |
|
4923 | |||
4894 | projectObjView = self.getSelectedProjectObj() |
|
4924 | projectObjView = self.getSelectedProjectObj() | |
4895 |
|
4925 | |||
4896 | if not projectObjView: |
|
4926 | if not projectObjView: | |
4897 | return |
|
4927 | return | |
4898 |
|
4928 | |||
4899 | puObj = self.getSelectedItemObj() |
|
4929 | puObj = self.getSelectedItemObj() | |
4900 | inputId = puObj.getInputId() |
|
4930 | inputId = puObj.getInputId() | |
4901 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4931 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4902 |
|
4932 | |||
4903 | if datatype == 'Voltage': |
|
4933 | if datatype == 'Voltage': | |
4904 | self.volOpComChannels.setEnabled(False) |
|
4934 | self.volOpComChannels.setEnabled(False) | |
4905 | self.volOpComHeights.setEnabled(False) |
|
4935 | self.volOpComHeights.setEnabled(False) | |
4906 | self.volOpFilter.setEnabled(False) |
|
4936 | self.volOpFilter.setEnabled(False) | |
4907 | self.volOpComProfile.setEnabled(False) |
|
4937 | self.volOpComProfile.setEnabled(False) | |
4908 | self.volOpComCode.setEnabled(False) |
|
4938 | self.volOpComCode.setEnabled(False) | |
4909 | self.volOpCohInt.setEnabled(False) |
|
4939 | self.volOpCohInt.setEnabled(False) | |
4910 | self.volOpChannel.setEnabled(False) |
|
4940 | self.volOpChannel.setEnabled(False) | |
4911 | self.volOpHeights.setEnabled(False) |
|
4941 | self.volOpHeights.setEnabled(False) | |
4912 | self.volOpProfile.setEnabled(False) |
|
4942 | self.volOpProfile.setEnabled(False) | |
4913 | self.volOpRadarfrequency.setEnabled(False) |
|
4943 | self.volOpRadarfrequency.setEnabled(False) | |
4914 | self.volOpCebChannels.setCheckState(0) |
|
4944 | self.volOpCebChannels.setCheckState(0) | |
4915 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4945 | self.volOpCebRadarfrequency.setCheckState(0) | |
4916 | self.volOpCebHeights.setCheckState(0) |
|
4946 | self.volOpCebHeights.setCheckState(0) | |
4917 | self.volOpCebFilter.setCheckState(0) |
|
4947 | self.volOpCebFilter.setCheckState(0) | |
4918 | self.volOpCebProfile.setCheckState(0) |
|
4948 | self.volOpCebProfile.setCheckState(0) | |
4919 | self.volOpCebDecodification.setCheckState(0) |
|
4949 | self.volOpCebDecodification.setCheckState(0) | |
4920 | self.volOpCebCohInt.setCheckState(0) |
|
4950 | self.volOpCebCohInt.setCheckState(0) | |
4921 |
|
4951 | |||
4922 | self.volOpChannel.clear() |
|
4952 | self.volOpChannel.clear() | |
4923 | self.volOpHeights.clear() |
|
4953 | self.volOpHeights.clear() | |
4924 | self.volOpProfile.clear() |
|
4954 | self.volOpProfile.clear() | |
4925 | self.volOpFilter.clear() |
|
4955 | self.volOpFilter.clear() | |
4926 | self.volOpCohInt.clear() |
|
4956 | self.volOpCohInt.clear() | |
4927 | self.volOpRadarfrequency.clear() |
|
4957 | self.volOpRadarfrequency.clear() | |
4928 |
|
4958 | |||
4929 | if datatype == 'Spectra': |
|
4959 | if datatype == 'Spectra': | |
4930 |
|
4960 | |||
4931 | if inputPUObj.datatype == 'Spectra': |
|
4961 | if inputPUObj.datatype == 'Spectra': | |
4932 | self.specOpnFFTpoints.setEnabled(False) |
|
4962 | self.specOpnFFTpoints.setEnabled(False) | |
4933 | self.specOpProfiles.setEnabled(False) |
|
4963 | self.specOpProfiles.setEnabled(False) | |
4934 | self.specOpippFactor.setEnabled(False) |
|
4964 | self.specOpippFactor.setEnabled(False) | |
4935 | else: |
|
4965 | else: | |
4936 | self.specOpnFFTpoints.setEnabled(True) |
|
4966 | self.specOpnFFTpoints.setEnabled(True) | |
4937 | self.specOpProfiles.setEnabled(True) |
|
4967 | self.specOpProfiles.setEnabled(True) | |
4938 | self.specOpippFactor.setEnabled(True) |
|
4968 | self.specOpippFactor.setEnabled(True) | |
4939 |
|
4969 | |||
4940 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4970 | self.specOpCebCrossSpectra.setCheckState(0) | |
4941 | self.specOpCebChannel.setCheckState(0) |
|
4971 | self.specOpCebChannel.setCheckState(0) | |
4942 | self.specOpCebHeights.setCheckState(0) |
|
4972 | self.specOpCebHeights.setCheckState(0) | |
4943 | self.specOpCebIncoherent.setCheckState(0) |
|
4973 | self.specOpCebIncoherent.setCheckState(0) | |
4944 | self.specOpCebRemoveDC.setCheckState(0) |
|
4974 | self.specOpCebRemoveDC.setCheckState(0) | |
4945 | self.specOpCebRemoveInt.setCheckState(0) |
|
4975 | self.specOpCebRemoveInt.setCheckState(0) | |
4946 | self.specOpCebgetNoise.setCheckState(0) |
|
4976 | self.specOpCebgetNoise.setCheckState(0) | |
4947 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4977 | self.specOpCebRadarfrequency.setCheckState(0) | |
4948 |
|
4978 | |||
4949 | self.specOpRadarfrequency.setEnabled(False) |
|
4979 | self.specOpRadarfrequency.setEnabled(False) | |
4950 | self.specOppairsList.setEnabled(False) |
|
4980 | self.specOppairsList.setEnabled(False) | |
4951 | self.specOpChannel.setEnabled(False) |
|
4981 | self.specOpChannel.setEnabled(False) | |
4952 | self.specOpHeights.setEnabled(False) |
|
4982 | self.specOpHeights.setEnabled(False) | |
4953 | self.specOpIncoherent.setEnabled(False) |
|
4983 | self.specOpIncoherent.setEnabled(False) | |
4954 | self.specOpgetNoise.setEnabled(False) |
|
4984 | self.specOpgetNoise.setEnabled(False) | |
4955 |
|
4985 | |||
4956 | self.specOpRadarfrequency.clear() |
|
4986 | self.specOpRadarfrequency.clear() | |
4957 | self.specOpnFFTpoints.clear() |
|
4987 | self.specOpnFFTpoints.clear() | |
4958 | self.specOpProfiles.clear() |
|
4988 | self.specOpProfiles.clear() | |
4959 | self.specOpippFactor.clear |
|
4989 | self.specOpippFactor.clear | |
4960 | self.specOppairsList.clear() |
|
4990 | self.specOppairsList.clear() | |
4961 | self.specOpChannel.clear() |
|
4991 | self.specOpChannel.clear() | |
4962 | self.specOpHeights.clear() |
|
4992 | self.specOpHeights.clear() | |
4963 | self.specOpIncoherent.clear() |
|
4993 | self.specOpIncoherent.clear() | |
4964 | self.specOpgetNoise.clear() |
|
4994 | self.specOpgetNoise.clear() | |
4965 |
|
4995 | |||
4966 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4996 | self.specGraphCebSpectraplot.setCheckState(0) | |
4967 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4997 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4968 | self.specGraphCebRTIplot.setCheckState(0) |
|
4998 | self.specGraphCebRTIplot.setCheckState(0) | |
4969 | self.specGraphCebRTInoise.setCheckState(0) |
|
4999 | self.specGraphCebRTInoise.setCheckState(0) | |
4970 | self.specGraphCebCoherencmap.setCheckState(0) |
|
5000 | self.specGraphCebCoherencmap.setCheckState(0) | |
4971 | self.specGraphPowerprofile.setCheckState(0) |
|
5001 | self.specGraphPowerprofile.setCheckState(0) | |
4972 |
|
5002 | |||
4973 | self.specGraphSaveSpectra.setCheckState(0) |
|
5003 | self.specGraphSaveSpectra.setCheckState(0) | |
4974 | self.specGraphSaveCross.setCheckState(0) |
|
5004 | self.specGraphSaveCross.setCheckState(0) | |
4975 | self.specGraphSaveRTIplot.setCheckState(0) |
|
5005 | self.specGraphSaveRTIplot.setCheckState(0) | |
4976 | self.specGraphSaveRTInoise.setCheckState(0) |
|
5006 | self.specGraphSaveRTInoise.setCheckState(0) | |
4977 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
5007 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4978 | self.specGraphSavePowerprofile.setCheckState(0) |
|
5008 | self.specGraphSavePowerprofile.setCheckState(0) | |
4979 |
|
5009 | |||
4980 | self.specGraphftpRTIplot.setCheckState(0) |
|
5010 | self.specGraphftpRTIplot.setCheckState(0) | |
4981 | self.specGraphftpRTInoise.setCheckState(0) |
|
5011 | self.specGraphftpRTInoise.setCheckState(0) | |
4982 | self.specGraphftpCoherencemap.setCheckState(0) |
|
5012 | self.specGraphftpCoherencemap.setCheckState(0) | |
4983 |
|
5013 | |||
4984 | self.specGraphPath.clear() |
|
5014 | self.specGraphPath.clear() | |
4985 | self.specGraphPrefix.clear() |
|
5015 | self.specGraphPrefix.clear() | |
4986 |
|
5016 | |||
4987 | self.specGgraphftpratio.clear() |
|
5017 | self.specGgraphftpratio.clear() | |
4988 |
|
5018 | |||
4989 | self.specGgraphChannelList.clear() |
|
5019 | self.specGgraphChannelList.clear() | |
4990 | self.specGgraphFreq.clear() |
|
5020 | self.specGgraphFreq.clear() | |
4991 | self.specGgraphHeight.clear() |
|
5021 | self.specGgraphHeight.clear() | |
4992 | self.specGgraphDbsrange.clear() |
|
5022 | self.specGgraphDbsrange.clear() | |
4993 | self.specGgraphmagnitud.clear() |
|
5023 | self.specGgraphmagnitud.clear() | |
4994 | self.specGgraphTminTmax.clear() |
|
5024 | self.specGgraphTminTmax.clear() | |
4995 | self.specGgraphTimeRange.clear() |
|
5025 | self.specGgraphTimeRange.clear() | |
4996 |
|
5026 | |||
4997 | if datatype == 'SpectraHeis': |
|
5027 | if datatype == 'SpectraHeis': | |
4998 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5028 | self.specHeisOpCebIncoherent.setCheckState(0) | |
4999 | self.specHeisOpIncoherent.setEnabled(False) |
|
5029 | self.specHeisOpIncoherent.setEnabled(False) | |
5000 | self.specHeisOpIncoherent.clear() |
|
5030 | self.specHeisOpIncoherent.clear() | |
5001 |
|
5031 | |||
5002 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5032 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5003 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5033 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5004 |
|
5034 | |||
5005 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5035 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5006 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5036 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5007 |
|
5037 | |||
5008 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5038 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5009 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5039 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5010 |
|
5040 | |||
5011 | self.specHeisGraphPath.clear() |
|
5041 | self.specHeisGraphPath.clear() | |
5012 | self.specHeisGraphPrefix.clear() |
|
5042 | self.specHeisGraphPrefix.clear() | |
5013 | self.specHeisGgraphChannelList.clear() |
|
5043 | self.specHeisGgraphChannelList.clear() | |
5014 | self.specHeisGgraphXminXmax.clear() |
|
5044 | self.specHeisGgraphXminXmax.clear() | |
5015 | self.specHeisGgraphYminYmax.clear() |
|
5045 | self.specHeisGgraphYminYmax.clear() | |
5016 | self.specHeisGgraphTminTmax.clear() |
|
5046 | self.specHeisGgraphTminTmax.clear() | |
5017 | self.specHeisGgraphTimeRange.clear() |
|
5047 | self.specHeisGgraphTimeRange.clear() | |
5018 | self.specHeisGgraphftpratio.clear() |
|
5048 | self.specHeisGgraphftpratio.clear() | |
5019 |
|
5049 | |||
5020 | def showtabPUCreated(self, datatype): |
|
5050 | def showtabPUCreated(self, datatype): | |
5021 |
|
5051 | |||
5022 | if datatype == "Voltage": |
|
5052 | if datatype == "Voltage": | |
5023 | self.tabVoltage.setEnabled(True) |
|
5053 | self.tabVoltage.setEnabled(True) | |
5024 | self.tabProject.setEnabled(False) |
|
5054 | self.tabProject.setEnabled(False) | |
5025 | self.tabSpectra.setEnabled(False) |
|
5055 | self.tabSpectra.setEnabled(False) | |
5026 | self.tabCorrelation.setEnabled(False) |
|
5056 | self.tabCorrelation.setEnabled(False) | |
5027 | self.tabSpectraHeis.setEnabled(False) |
|
5057 | self.tabSpectraHeis.setEnabled(False) | |
5028 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5058 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5029 |
|
5059 | |||
5030 | if datatype == "Spectra": |
|
5060 | if datatype == "Spectra": | |
5031 | self.tabVoltage.setEnabled(False) |
|
5061 | self.tabVoltage.setEnabled(False) | |
5032 | self.tabProject.setEnabled(False) |
|
5062 | self.tabProject.setEnabled(False) | |
5033 | self.tabSpectra.setEnabled(True) |
|
5063 | self.tabSpectra.setEnabled(True) | |
5034 | self.tabCorrelation.setEnabled(False) |
|
5064 | self.tabCorrelation.setEnabled(False) | |
5035 | self.tabSpectraHeis.setEnabled(False) |
|
5065 | self.tabSpectraHeis.setEnabled(False) | |
5036 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5066 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5037 |
|
5067 | |||
5038 | if datatype == "SpectraHeis": |
|
5068 | if datatype == "SpectraHeis": | |
5039 | self.tabVoltage.setEnabled(False) |
|
5069 | self.tabVoltage.setEnabled(False) | |
5040 | self.tabProject.setEnabled(False) |
|
5070 | self.tabProject.setEnabled(False) | |
5041 | self.tabSpectra.setEnabled(False) |
|
5071 | self.tabSpectra.setEnabled(False) | |
5042 | self.tabCorrelation.setEnabled(False) |
|
5072 | self.tabCorrelation.setEnabled(False) | |
5043 | self.tabSpectraHeis.setEnabled(True) |
|
5073 | self.tabSpectraHeis.setEnabled(True) | |
5044 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5074 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5045 |
|
5075 | |||
5046 | def checkInputsProject(self): |
|
5076 | def checkInputsProject(self): | |
5047 | """ |
|
5077 | """ | |
5048 | Check Inputs Project: |
|
5078 | Check Inputs Project: | |
5049 | - project_name |
|
5079 | - project_name | |
5050 | - datatype |
|
5080 | - datatype | |
5051 | - ext |
|
5081 | - ext | |
5052 | - data_path |
|
5082 | - data_path | |
5053 | - readmode |
|
5083 | - readmode | |
5054 | - delay |
|
5084 | - delay | |
5055 | - set |
|
5085 | - set | |
5056 | - walk |
|
5086 | - walk | |
5057 | """ |
|
5087 | """ | |
5058 | parms_ok = True |
|
5088 | parms_ok = True | |
5059 | project_name = str(self.proName.text()) |
|
5089 | project_name = str(self.proName.text()) | |
5060 | if project_name == '' or project_name == None: |
|
5090 | if project_name == '' or project_name == None: | |
5061 | outputstr = "Enter the Project Name" |
|
5091 | outputstr = "Enter the Project Name" | |
5062 | self.console.append(outputstr) |
|
5092 | self.console.append(outputstr) | |
5063 | parms_ok = False |
|
5093 | parms_ok = False | |
5064 | project_name = None |
|
5094 | project_name = None | |
5065 |
|
5095 | |||
5066 | datatype = str(self.proComDataType.currentText()) |
|
5096 | datatype = str(self.proComDataType.currentText()) | |
5067 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5097 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5068 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5098 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5069 | self.console.append(outputstr) |
|
5099 | self.console.append(outputstr) | |
5070 | parms_ok = False |
|
5100 | parms_ok = False | |
5071 | datatype = None |
|
5101 | datatype = None | |
5072 |
|
5102 | |||
5073 | ext = str(self.proDataType.text()) |
|
5103 | ext = str(self.proDataType.text()) | |
5074 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5104 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5075 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5105 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5076 | self.console.append(outputstr) |
|
5106 | self.console.append(outputstr) | |
5077 | parms_ok = False |
|
5107 | parms_ok = False | |
5078 | ext = None |
|
5108 | ext = None | |
5079 |
|
5109 | |||
5080 | data_path = str(self.proDataPath.text()) |
|
5110 | data_path = str(self.proDataPath.text()) | |
5081 |
|
5111 | |||
5082 | if data_path == '': |
|
5112 | if data_path == '': | |
5083 | outputstr = 'Datapath is empty' |
|
5113 | outputstr = 'Datapath is empty' | |
5084 | self.console.append(outputstr) |
|
5114 | self.console.append(outputstr) | |
5085 | parms_ok = False |
|
5115 | parms_ok = False | |
5086 | data_path = None |
|
5116 | data_path = None | |
5087 |
|
5117 | |||
5088 | if data_path != None: |
|
5118 | if data_path != None: | |
5089 | if not os.path.isdir(data_path): |
|
5119 | if not os.path.isdir(data_path): | |
5090 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5120 | outputstr = 'Datapath:%s does not exists' % data_path | |
5091 | self.console.append(outputstr) |
|
5121 | self.console.append(outputstr) | |
5092 | parms_ok = False |
|
5122 | parms_ok = False | |
5093 | data_path = None |
|
5123 | data_path = None | |
5094 |
|
5124 | |||
5095 | read_mode = str(self.proComReadMode.currentText()) |
|
5125 | read_mode = str(self.proComReadMode.currentText()) | |
5096 | if not(read_mode in ['Online', 'Offline']): |
|
5126 | if not(read_mode in ['Online', 'Offline']): | |
5097 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5127 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5098 | self.console.append(outputstr) |
|
5128 | self.console.append(outputstr) | |
5099 | parms_ok = False |
|
5129 | parms_ok = False | |
5100 | read_mode = None |
|
5130 | read_mode = None | |
5101 |
|
5131 | |||
5102 | delay = None |
|
5132 | delay = None | |
5103 | if read_mode == "Online": |
|
5133 | if read_mode == "Online": | |
5104 | parms_ok = False |
|
5134 | parms_ok = False | |
5105 | try: |
|
5135 | try: | |
5106 | delay = int(str(self.proDelay.text())) |
|
5136 | delay = int(str(self.proDelay.text())) | |
5107 | parms_ok = True |
|
5137 | parms_ok = True | |
5108 | except: |
|
5138 | except: | |
5109 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5139 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5110 | self.console.append(outputstr) |
|
5140 | self.console.append(outputstr) | |
5111 |
|
5141 | |||
5112 | try: |
|
5142 | try: | |
5113 | set = int(str(self.proSet.text())) |
|
5143 | set = int(str(self.proSet.text())) | |
5114 | except: |
|
5144 | except: | |
5115 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5145 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5116 | # self.console.append(outputstr) |
|
5146 | # self.console.append(outputstr) | |
5117 | # parms_ok = False |
|
5147 | # parms_ok = False | |
5118 | set = None |
|
5148 | set = None | |
5119 |
|
5149 | |||
5120 | walk = int(self.proComWalk.currentIndex()) |
|
5150 | walk = int(self.proComWalk.currentIndex()) | |
5121 | expLabel = str(self.proExpLabel.text()) |
|
5151 | expLabel = str(self.proExpLabel.text()) | |
5122 |
|
5152 | |||
5123 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5153 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5124 |
|
5154 | |||
5125 | def checkInputsPUSave(self, datatype): |
|
5155 | def checkInputsPUSave(self, datatype): | |
5126 | """ |
|
5156 | """ | |
5127 | Check Inputs Spectra Save: |
|
5157 | Check Inputs Spectra Save: | |
5128 | - path |
|
5158 | - path | |
5129 | - blocks Per File |
|
5159 | - blocks Per File | |
5130 | - sufix |
|
5160 | - sufix | |
5131 | - dataformat |
|
5161 | - dataformat | |
5132 | """ |
|
5162 | """ | |
5133 | parms_ok = True |
|
5163 | parms_ok = True | |
5134 |
|
5164 | |||
5135 | if datatype == "Voltage": |
|
5165 | if datatype == "Voltage": | |
5136 | output_path = str(self.volOutputPath.text()) |
|
5166 | output_path = str(self.volOutputPath.text()) | |
5137 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5167 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5138 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5168 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5139 |
|
5169 | |||
5140 | if datatype == "Spectra": |
|
5170 | if datatype == "Spectra": | |
5141 | output_path = str(self.specOutputPath.text()) |
|
5171 | output_path = str(self.specOutputPath.text()) | |
5142 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5172 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5143 | profilesperblock = 0 |
|
5173 | profilesperblock = 0 | |
5144 |
|
5174 | |||
5145 | if datatype == "SpectraHeis": |
|
5175 | if datatype == "SpectraHeis": | |
5146 | output_path = str(self.specHeisOutputPath.text()) |
|
5176 | output_path = str(self.specHeisOutputPath.text()) | |
5147 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5177 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5148 | metada = str(self.specHeisOutputMetada.text()) |
|
5178 | metada = str(self.specHeisOutputMetada.text()) | |
5149 |
|
5179 | |||
5150 | if output_path == '': |
|
5180 | if output_path == '': | |
5151 | outputstr = 'Outputpath is empty' |
|
5181 | outputstr = 'Outputpath is empty' | |
5152 | self.console.append(outputstr) |
|
5182 | self.console.append(outputstr) | |
5153 | parms_ok = False |
|
5183 | parms_ok = False | |
5154 | data_path = None |
|
5184 | data_path = None | |
5155 |
|
5185 | |||
5156 | if output_path != None: |
|
5186 | if output_path != None: | |
5157 | if not os.path.exists(output_path): |
|
5187 | if not os.path.exists(output_path): | |
5158 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5188 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5159 | self.console.append(outputstr) |
|
5189 | self.console.append(outputstr) | |
5160 | parms_ok = False |
|
5190 | parms_ok = False | |
5161 | output_path = None |
|
5191 | output_path = None | |
5162 |
|
5192 | |||
5163 |
|
5193 | |||
5164 | try: |
|
5194 | try: | |
5165 | profilesperblock = int(profilesperblock) |
|
5195 | profilesperblock = int(profilesperblock) | |
5166 | except: |
|
5196 | except: | |
5167 | if datatype == "Voltage": |
|
5197 | if datatype == "Voltage": | |
5168 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5198 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5169 | self.console.append(outputstr) |
|
5199 | self.console.append(outputstr) | |
5170 | parms_ok = False |
|
5200 | parms_ok = False | |
5171 | profilesperblock = None |
|
5201 | profilesperblock = None | |
5172 |
|
5202 | |||
5173 | try: |
|
5203 | try: | |
5174 | blocksperfile = int(blocksperfile) |
|
5204 | blocksperfile = int(blocksperfile) | |
5175 | except: |
|
5205 | except: | |
5176 | if datatype == "Voltage": |
|
5206 | if datatype == "Voltage": | |
5177 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5207 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5178 | elif datatype == "Spectra": |
|
5208 | elif datatype == "Spectra": | |
5179 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5209 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5180 | elif datatype == "SpectraHeis": |
|
5210 | elif datatype == "SpectraHeis": | |
5181 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5211 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5182 |
|
5212 | |||
5183 | self.console.append(outputstr) |
|
5213 | self.console.append(outputstr) | |
5184 | parms_ok = False |
|
5214 | parms_ok = False | |
5185 | blocksperfile = None |
|
5215 | blocksperfile = None | |
5186 |
|
5216 | |||
5187 | if datatype == "SpectraHeis": |
|
5217 | if datatype == "SpectraHeis": | |
5188 | if metada == '': |
|
5218 | if metada == '': | |
5189 | outputstr = 'Choose metada file' |
|
5219 | outputstr = 'Choose metada file' | |
5190 | self.console.append(outputstr) |
|
5220 | self.console.append(outputstr) | |
5191 | parms_ok = False |
|
5221 | parms_ok = False | |
5192 | if metada != None: |
|
5222 | if metada != None: | |
5193 | if not os.path.isfile(metada): |
|
5223 | if not os.path.isfile(metada): | |
5194 | outputstr = 'Metadata:%s does not exists' % metada |
|
5224 | outputstr = 'Metadata:%s does not exists' % metada | |
5195 | self.console.append(outputstr) |
|
5225 | self.console.append(outputstr) | |
5196 | parms_ok = False |
|
5226 | parms_ok = False | |
5197 | output_path = None |
|
5227 | output_path = None | |
5198 |
|
5228 | |||
5199 | if datatype == "Voltage": |
|
5229 | if datatype == "Voltage": | |
5200 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5230 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5201 |
|
5231 | |||
5202 |
|
5232 | |||
5203 | if datatype == "Spectra": |
|
5233 | if datatype == "Spectra": | |
5204 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5234 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5205 |
|
5235 | |||
5206 |
|
5236 | |||
5207 | if datatype == "SpectraHeis": |
|
5237 | if datatype == "SpectraHeis": | |
5208 | return parms_ok, output_path, blocksperfile, metada |
|
5238 | return parms_ok, output_path, blocksperfile, metada | |
5209 |
|
5239 | |||
5210 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5240 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5211 |
|
5241 | |||
5212 | dateList = [] |
|
5242 | dateList = [] | |
5213 | fileList = [] |
|
5243 | fileList = [] | |
5214 |
|
5244 | |||
5215 | if ext == ".r": |
|
5245 | if ext == ".r": | |
5216 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5246 | from schainpy.model.io.jroIO_base import JRODataReader | |
5217 |
|
5247 | |||
5218 | readerObj = JRODataReader() |
|
5248 | readerObj = JRODataReader() | |
5219 | dateList = readerObj.findDatafiles(path=data_path, |
|
5249 | dateList = readerObj.findDatafiles(path=data_path, | |
5220 | expLabel=expLabel, |
|
5250 | expLabel=expLabel, | |
5221 | ext=ext, |
|
5251 | ext=ext, | |
5222 | walk=walk) |
|
5252 | walk=walk) | |
5223 |
|
5253 | |||
5224 | if ext == ".pdata": |
|
5254 | if ext == ".pdata": | |
5225 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5255 | from schainpy.model.io.jroIO_base import JRODataReader | |
5226 |
|
5256 | |||
5227 | readerObj = JRODataReader() |
|
5257 | readerObj = JRODataReader() | |
5228 | dateList = readerObj.findDatafiles(path=data_path, |
|
5258 | dateList = readerObj.findDatafiles(path=data_path, | |
5229 | expLabel=expLabel, |
|
5259 | expLabel=expLabel, | |
5230 | ext=ext, |
|
5260 | ext=ext, | |
5231 | walk=walk) |
|
5261 | walk=walk) | |
5232 |
|
5262 | |||
5233 | if ext == ".fits": |
|
5263 | if ext == ".fits": | |
5234 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5264 | from schainpy.model.io.jroIO_base import JRODataReader | |
5235 |
|
5265 | |||
5236 | readerObj = JRODataReader() |
|
5266 | readerObj = JRODataReader() | |
5237 | dateList = readerObj.findDatafiles(path=data_path, |
|
5267 | dateList = readerObj.findDatafiles(path=data_path, | |
5238 | expLabel=expLabel, |
|
5268 | expLabel=expLabel, | |
5239 | ext=ext, |
|
5269 | ext=ext, | |
5240 | walk=walk) |
|
5270 | walk=walk) | |
5241 |
|
5271 | |||
5242 | if ext == ".hdf5": |
|
5272 | if ext == ".hdf5": | |
5243 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5273 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5244 |
|
5274 | |||
5245 | readerObj = USRPReader() |
|
5275 | readerObj = USRPReader() | |
5246 | dateList = readerObj.findDatafiles(path=data_path) |
|
5276 | dateList = readerObj.findDatafiles(path=data_path) | |
5247 |
|
5277 | |||
5248 | return dateList |
|
5278 | return dateList | |
5249 |
|
5279 | |||
5250 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5280 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5251 | """ |
|
5281 | """ | |
5252 | Method to loads day |
|
5282 | Method to loads day | |
5253 | """ |
|
5283 | """ | |
5254 | self.proOk.setEnabled(False) |
|
5284 | self.proOk.setEnabled(False) | |
5255 | self.proComStartDate.clear() |
|
5285 | self.proComStartDate.clear() | |
5256 | self.proComEndDate.clear() |
|
5286 | self.proComEndDate.clear() | |
5257 |
|
5287 | |||
5258 | self.dateList = [] |
|
5288 | self.dateList = [] | |
5259 |
|
5289 | |||
5260 | if not os.path.isdir(data_path): |
|
5290 | if not os.path.isdir(data_path): | |
5261 | return |
|
5291 | return | |
5262 |
|
5292 | |||
5263 | self.dataPath = data_path |
|
5293 | self.dataPath = data_path | |
5264 |
|
5294 | |||
5265 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5295 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5266 |
|
5296 | |||
5267 | if not dateList: |
|
5297 | if not dateList: | |
5268 | # self.console.clear() |
|
5298 | # self.console.clear() | |
5269 | outputstr = "The path %s has no files with extension *%s" % (data_path, ext) |
|
5299 | if walk: | |
|
5300 | if expLabel: | |||
|
5301 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |||
|
5302 | else: | |||
|
5303 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |||
|
5304 | else: | |||
|
5305 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |||
|
5306 | ||||
5270 | self.console.append(outputstr) |
|
5307 | self.console.append(outputstr) | |
5271 | return |
|
5308 | return | |
5272 |
|
5309 | |||
5273 | dateStrList = [] |
|
5310 | dateStrList = [] | |
5274 | for thisDate in dateList: |
|
5311 | for thisDate in dateList: | |
5275 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5312 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5276 |
|
5313 | |||
5277 | self.proComStartDate.addItem(dateStr) |
|
5314 | self.proComStartDate.addItem(dateStr) | |
5278 | self.proComEndDate.addItem(dateStr) |
|
5315 | self.proComEndDate.addItem(dateStr) | |
5279 | dateStrList.append(dateStr) |
|
5316 | dateStrList.append(dateStr) | |
5280 |
|
5317 | |||
5281 | self.proComStartDate.setCurrentIndex(0) |
|
5318 | self.proComStartDate.setCurrentIndex(0) | |
5282 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5319 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5283 |
|
5320 | |||
5284 | self.dateList = dateStrList |
|
5321 | self.dateList = dateStrList | |
5285 | self.proOk.setEnabled(True) |
|
5322 | self.proOk.setEnabled(True) | |
5286 |
|
5323 | |||
5287 | self.console.clear() |
|
5324 | self.console.clear() | |
5288 | self.console.append("Successful load") |
|
5325 | self.console.append("Successful load") | |
5289 |
|
5326 | |||
5290 | return self.dateList |
|
5327 | return self.dateList | |
5291 |
|
5328 | |||
5292 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5329 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5293 |
|
5330 | |||
5294 | if pathWorkSpace == None: |
|
5331 | if pathWorkSpace == None: | |
5295 | home = os.path.expanduser("~") |
|
5332 | home = os.path.expanduser("~") | |
5296 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5333 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5297 |
|
5334 | |||
5298 | self.pathWorkSpace = pathWorkSpace |
|
5335 | self.pathWorkSpace = pathWorkSpace | |
5299 |
|
5336 | |||
5300 | """ |
|
5337 | """ | |
5301 | Comandos Usados en Console |
|
5338 | Comandos Usados en Console | |
5302 | """ |
|
5339 | """ | |
5303 | def __del__(self): |
|
5340 | def __del__(self): | |
5304 | sys.stdout = sys.__stdout__ |
|
5341 | sys.stdout = sys.__stdout__ | |
5305 | sys.stderr = sys.__stderr__ |
|
5342 | sys.stderr = sys.__stderr__ | |
5306 |
|
5343 | |||
5307 | def normalOutputWritten(self, text): |
|
5344 | def normalOutputWritten(self, text): | |
5308 | color_black = QtGui.QColor(0,0,0) |
|
5345 | color_black = QtGui.QColor(0,0,0) | |
5309 | self.console.setTextColor(color_black) |
|
5346 | self.console.setTextColor(color_black) | |
5310 | self.console.append(text) |
|
5347 | self.console.append(text) | |
5311 |
|
5348 | |||
5312 | def errorOutputWritten(self, text): |
|
5349 | def errorOutputWritten(self, text): | |
5313 | color_red = QtGui.QColor(255,0,0) |
|
5350 | color_red = QtGui.QColor(255,0,0) | |
5314 | color_black = QtGui.QColor(0,0,0) |
|
5351 | color_black = QtGui.QColor(0,0,0) | |
5315 |
|
5352 | |||
5316 | self.console.setTextColor(color_red) |
|
5353 | self.console.setTextColor(color_red) | |
5317 | self.console.append(text) |
|
5354 | self.console.append(text) | |
5318 | self.console.setTextColor(color_black) |
|
5355 | self.console.setTextColor(color_black) | |
5319 |
|
5356 | |||
5320 | def setGUIStatus(self): |
|
5357 | def setGUIStatus(self): | |
5321 |
|
5358 | |||
5322 | self.setWindowTitle("ROJ-Signal Chain") |
|
5359 | self.setWindowTitle("ROJ-Signal Chain") | |
5323 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) |
|
5360 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"adn.jpg") )) | |
5324 |
|
5361 | |||
5325 | self.tabWidgetProject.setEnabled(False) |
|
5362 | self.tabWidgetProject.setEnabled(False) | |
5326 | self.tabVoltage.setEnabled(False) |
|
5363 | self.tabVoltage.setEnabled(False) | |
5327 | self.tabSpectra.setEnabled(False) |
|
5364 | self.tabSpectra.setEnabled(False) | |
5328 | self.tabCorrelation.setEnabled(False) |
|
5365 | self.tabCorrelation.setEnabled(False) | |
5329 | self.frame_2.setEnabled(False) |
|
5366 | self.frame_2.setEnabled(False) | |
5330 |
|
5367 | |||
5331 | self.actionCreate.setShortcut('Ctrl+N') |
|
5368 | self.actionCreate.setShortcut('Ctrl+N') | |
5332 | self.actionOpen.setShortcut('Ctrl+O') |
|
5369 | self.actionOpen.setShortcut('Ctrl+O') | |
5333 | self.actionSave.setShortcut('Ctrl+S') |
|
5370 | self.actionSave.setShortcut('Ctrl+S') | |
5334 | self.actionClose.setShortcut('Ctrl+X') |
|
5371 | self.actionClose.setShortcut('Ctrl+X') | |
5335 |
|
5372 | |||
5336 | self.actionStart.setShortcut('Ctrl+1') |
|
5373 | self.actionStart.setShortcut('Ctrl+1') | |
5337 | self.actionPause.setShortcut('Ctrl+2') |
|
5374 | self.actionPause.setShortcut('Ctrl+2') | |
5338 | self.actionStop.setShortcut('Ctrl+3') |
|
5375 | self.actionStop.setShortcut('Ctrl+3') | |
5339 |
|
5376 | |||
5340 | self.actionFTP.setShortcut('Ctrl+F') |
|
5377 | self.actionFTP.setShortcut('Ctrl+F') | |
5341 |
|
5378 | |||
5342 | self.actionStart.setEnabled(False) |
|
5379 | self.actionStart.setEnabled(False) | |
5343 | self.actionPause.setEnabled(False) |
|
5380 | self.actionPause.setEnabled(False) | |
5344 | self.actionStop.setEnabled(False) |
|
5381 | self.actionStop.setEnabled(False) | |
5345 |
|
5382 | |||
5346 | self.actionStarToolbar.setEnabled(False) |
|
5383 | self.actionStarToolbar.setEnabled(False) | |
5347 | self.actionPauseToolbar.setEnabled(False) |
|
5384 | self.actionPauseToolbar.setEnabled(False) | |
5348 | self.actionStopToolbar.setEnabled(False) |
|
5385 | self.actionStopToolbar.setEnabled(False) | |
5349 |
|
5386 | |||
5350 | self.proName.clear() |
|
5387 | self.proName.clear() | |
5351 | self.proDataPath.setText('') |
|
5388 | self.proDataPath.setText('') | |
5352 | self.console.setReadOnly(True) |
|
5389 | self.console.setReadOnly(True) | |
5353 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5390 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5354 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5391 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5355 | self.proDataType.setEnabled(False) |
|
5392 | self.proDataType.setEnabled(False) | |
5356 | self.time = QtCore.QTime() |
|
5393 | self.time = QtCore.QTime() | |
5357 | self.hour = 0 |
|
5394 | self.hour = 0 | |
5358 | self.min = 0 |
|
5395 | self.min = 0 | |
5359 | self.sec = 0 |
|
5396 | self.sec = 0 | |
5360 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5397 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5361 | startTime = "00:00:00" |
|
5398 | startTime = "00:00:00" | |
5362 | endTime = "23:59:59" |
|
5399 | endTime = "23:59:59" | |
5363 | starlist = startTime.split(":") |
|
5400 | starlist = startTime.split(":") | |
5364 | endlist = endTime.split(":") |
|
5401 | endlist = endTime.split(":") | |
5365 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5402 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5366 | self.proStartTime.setTime(self.time) |
|
5403 | self.proStartTime.setTime(self.time) | |
5367 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5404 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5368 | self.proEndTime.setTime(self.time) |
|
5405 | self.proEndTime.setTime(self.time) | |
5369 | self.proOk.setEnabled(False) |
|
5406 | self.proOk.setEnabled(False) | |
5370 | # set model Project Explorer |
|
5407 | # set model Project Explorer | |
5371 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5408 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5372 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5409 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5373 | layout = QtGui.QVBoxLayout() |
|
5410 | layout = QtGui.QVBoxLayout() | |
5374 | layout.addWidget(self.projectExplorerTree) |
|
5411 | layout.addWidget(self.projectExplorerTree) | |
5375 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5412 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5376 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5413 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5377 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5414 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5378 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5415 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5379 | self.projectExplorerTree.expandAll() |
|
5416 | self.projectExplorerTree.expandAll() | |
5380 | # set model Project Properties |
|
5417 | # set model Project Properties | |
5381 |
|
5418 | |||
5382 | self.propertiesModel = TreeModel() |
|
5419 | self.propertiesModel = TreeModel() | |
5383 | self.propertiesModel.initProjectView() |
|
5420 | self.propertiesModel.initProjectView() | |
5384 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5421 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5385 | self.treeProjectProperties.expandAll() |
|
5422 | self.treeProjectProperties.expandAll() | |
5386 | self.treeProjectProperties.allColumnsShowFocus() |
|
5423 | self.treeProjectProperties.allColumnsShowFocus() | |
5387 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5424 | self.treeProjectProperties.resizeColumnToContents(1) | |
5388 |
|
5425 | |||
5389 | # set Project |
|
5426 | # set Project | |
5390 | self.proExpLabel.setEnabled(True) |
|
5427 | self.proExpLabel.setEnabled(True) | |
5391 | self.proDelay.setEnabled(False) |
|
5428 | self.proDelay.setEnabled(False) | |
5392 | self.proSet.setEnabled(True) |
|
5429 | self.proSet.setEnabled(True) | |
5393 | self.proDataType.setReadOnly(True) |
|
5430 | self.proDataType.setReadOnly(True) | |
5394 |
|
5431 | |||
5395 | # set Operation Voltage |
|
5432 | # set Operation Voltage | |
5396 | self.volOpComChannels.setEnabled(False) |
|
5433 | self.volOpComChannels.setEnabled(False) | |
5397 | self.volOpComHeights.setEnabled(False) |
|
5434 | self.volOpComHeights.setEnabled(False) | |
5398 | self.volOpFilter.setEnabled(False) |
|
5435 | self.volOpFilter.setEnabled(False) | |
5399 | self.volOpComProfile.setEnabled(False) |
|
5436 | self.volOpComProfile.setEnabled(False) | |
5400 | self.volOpComCode.setEnabled(False) |
|
5437 | self.volOpComCode.setEnabled(False) | |
5401 | self.volOpFlip.setEnabled(False) |
|
5438 | self.volOpFlip.setEnabled(False) | |
5402 | self.volOpCohInt.setEnabled(False) |
|
5439 | self.volOpCohInt.setEnabled(False) | |
5403 | self.volOpRadarfrequency.setEnabled(False) |
|
5440 | self.volOpRadarfrequency.setEnabled(False) | |
5404 |
|
5441 | |||
5405 | self.volOpChannel.setEnabled(False) |
|
5442 | self.volOpChannel.setEnabled(False) | |
5406 | self.volOpHeights.setEnabled(False) |
|
5443 | self.volOpHeights.setEnabled(False) | |
5407 | self.volOpProfile.setEnabled(False) |
|
5444 | self.volOpProfile.setEnabled(False) | |
5408 | self.volOpComMode.setEnabled(False) |
|
5445 | self.volOpComMode.setEnabled(False) | |
5409 |
|
5446 | |||
5410 | self.volGraphPath.setEnabled(False) |
|
5447 | self.volGraphPath.setEnabled(False) | |
5411 | self.volGraphPrefix.setEnabled(False) |
|
5448 | self.volGraphPrefix.setEnabled(False) | |
5412 | self.volGraphToolPath.setEnabled(False) |
|
5449 | self.volGraphToolPath.setEnabled(False) | |
5413 |
|
5450 | |||
5414 | # set Graph Voltage |
|
5451 | # set Graph Voltage | |
5415 | self.volGraphChannelList.setEnabled(False) |
|
5452 | self.volGraphChannelList.setEnabled(False) | |
5416 | self.volGraphfreqrange.setEnabled(False) |
|
5453 | self.volGraphfreqrange.setEnabled(False) | |
5417 | self.volGraphHeightrange.setEnabled(False) |
|
5454 | self.volGraphHeightrange.setEnabled(False) | |
5418 |
|
5455 | |||
5419 | # set Operation Spectra |
|
5456 | # set Operation Spectra | |
5420 | self.specOpnFFTpoints.setEnabled(False) |
|
5457 | self.specOpnFFTpoints.setEnabled(False) | |
5421 | self.specOpProfiles.setEnabled(False) |
|
5458 | self.specOpProfiles.setEnabled(False) | |
5422 | self.specOpippFactor.setEnabled(False) |
|
5459 | self.specOpippFactor.setEnabled(False) | |
5423 | self.specOppairsList.setEnabled(False) |
|
5460 | self.specOppairsList.setEnabled(False) | |
5424 | self.specOpComChannel.setEnabled(False) |
|
5461 | self.specOpComChannel.setEnabled(False) | |
5425 | self.specOpComHeights.setEnabled(False) |
|
5462 | self.specOpComHeights.setEnabled(False) | |
5426 | self.specOpIncoherent.setEnabled(False) |
|
5463 | self.specOpIncoherent.setEnabled(False) | |
5427 | self.specOpgetNoise.setEnabled(False) |
|
5464 | self.specOpgetNoise.setEnabled(False) | |
5428 | self.specOpRadarfrequency.setEnabled(False) |
|
5465 | self.specOpRadarfrequency.setEnabled(False) | |
5429 |
|
5466 | |||
5430 |
|
5467 | |||
5431 | self.specOpChannel.setEnabled(False) |
|
5468 | self.specOpChannel.setEnabled(False) | |
5432 | self.specOpHeights.setEnabled(False) |
|
5469 | self.specOpHeights.setEnabled(False) | |
5433 | # set Graph Spectra |
|
5470 | # set Graph Spectra | |
5434 | self.specGgraphChannelList.setEnabled(False) |
|
5471 | self.specGgraphChannelList.setEnabled(False) | |
5435 | self.specGgraphFreq.setEnabled(False) |
|
5472 | self.specGgraphFreq.setEnabled(False) | |
5436 | self.specGgraphHeight.setEnabled(False) |
|
5473 | self.specGgraphHeight.setEnabled(False) | |
5437 | self.specGgraphDbsrange.setEnabled(False) |
|
5474 | self.specGgraphDbsrange.setEnabled(False) | |
5438 | self.specGgraphmagnitud.setEnabled(False) |
|
5475 | self.specGgraphmagnitud.setEnabled(False) | |
5439 | self.specGgraphTminTmax.setEnabled(False) |
|
5476 | self.specGgraphTminTmax.setEnabled(False) | |
5440 | self.specGgraphTimeRange.setEnabled(False) |
|
5477 | self.specGgraphTimeRange.setEnabled(False) | |
5441 | self.specGraphPath.setEnabled(False) |
|
5478 | self.specGraphPath.setEnabled(False) | |
5442 | self.specGraphToolPath.setEnabled(False) |
|
5479 | self.specGraphToolPath.setEnabled(False) | |
5443 | self.specGraphPrefix.setEnabled(False) |
|
5480 | self.specGraphPrefix.setEnabled(False) | |
5444 |
|
5481 | |||
5445 | self.specGgraphftpratio.setEnabled(False) |
|
5482 | self.specGgraphftpratio.setEnabled(False) | |
5446 | # set Operation SpectraHeis |
|
5483 | # set Operation SpectraHeis | |
5447 | self.specHeisOpIncoherent.setEnabled(False) |
|
5484 | self.specHeisOpIncoherent.setEnabled(False) | |
5448 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5485 | self.specHeisOpCobIncInt.setEnabled(False) | |
5449 | # set Graph SpectraHeis |
|
5486 | # set Graph SpectraHeis | |
5450 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5487 | self.specHeisGgraphChannelList.setEnabled(False) | |
5451 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5488 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5452 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5489 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5453 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5490 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5454 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5491 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5455 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5492 | self.specHeisGgraphftpratio.setEnabled(False) | |
5456 | self.specHeisGraphPath.setEnabled(False) |
|
5493 | self.specHeisGraphPath.setEnabled(False) | |
5457 | self.specHeisGraphPrefix.setEnabled(False) |
|
5494 | self.specHeisGraphPrefix.setEnabled(False) | |
5458 | self.specHeisGraphToolPath.setEnabled(False) |
|
5495 | self.specHeisGraphToolPath.setEnabled(False) | |
5459 |
|
5496 | |||
5460 |
|
5497 | |||
5461 | # tool tip gui |
|
5498 | # tool tip gui | |
5462 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5499 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5463 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5500 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5464 | # tool tip gui project |
|
5501 | # tool tip gui project | |
5465 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') |
|
5502 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') | |
5466 | self.proComWalk.setCurrentIndex(0) |
|
5503 | self.proComWalk.setCurrentIndex(0) | |
5467 | # tool tip gui volOp |
|
5504 | # tool tip gui volOp | |
5468 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5505 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5469 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5506 | self.volOpHeights.setToolTip('Example: 90,180') | |
5470 | self.volOpFilter.setToolTip('Example: 2') |
|
5507 | self.volOpFilter.setToolTip('Example: 2') | |
5471 | self.volOpProfile.setToolTip('Example:0,127') |
|
5508 | self.volOpProfile.setToolTip('Example:0,127') | |
5472 | self.volOpCohInt.setToolTip('Example: 128') |
|
5509 | self.volOpCohInt.setToolTip('Example: 128') | |
5473 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5510 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5474 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5511 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5475 | # tool tip gui volGraph |
|
5512 | # tool tip gui volGraph | |
5476 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5513 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5477 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5514 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5478 | # tool tip gui specOp |
|
5515 | # tool tip gui specOp | |
5479 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5516 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5480 | self.specOpProfiles.setToolTip('Example: 128') |
|
5517 | self.specOpProfiles.setToolTip('Example: 128') | |
5481 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5518 | self.specOpippFactor.setToolTip('Example:1.0') | |
5482 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5519 | self.specOpIncoherent.setToolTip('Example: 10') | |
5483 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5520 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5484 |
|
5521 | |||
5485 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5522 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5486 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5523 | self.specOpHeights.setToolTip('Example: 90,180') | |
5487 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5524 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5488 | # tool tip gui specGraph |
|
5525 | # tool tip gui specGraph | |
5489 |
|
5526 | |||
5490 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5527 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5491 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5528 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5492 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5529 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5493 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5530 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5494 |
|
5531 | |||
5495 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5532 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5496 |
|
5533 | |||
5497 | self.labelSet.show() |
|
5534 | self.labelSet.show() | |
5498 | self.proSet.show() |
|
5535 | self.proSet.show() | |
5499 |
|
5536 | |||
5500 | self.labelIPPKm.hide() |
|
5537 | self.labelIPPKm.hide() | |
5501 | self.proIPPKm.hide() |
|
5538 | self.proIPPKm.hide() | |
5502 |
|
5539 | |||
5503 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5540 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5504 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5541 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5505 |
|
5542 | |||
5506 |
|
5543 | |||
5507 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5544 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5508 | """ |
|
5545 | """ | |
5509 | Class documentation goes here. |
|
5546 | Class documentation goes here. | |
5510 | """ |
|
5547 | """ | |
5511 | closed = pyqtSignal() |
|
5548 | closed = pyqtSignal() | |
5512 | create = False |
|
5549 | create = False | |
5513 |
|
5550 | |||
5514 | def __init__(self, parent=None): |
|
5551 | def __init__(self, parent=None): | |
5515 | """ |
|
5552 | """ | |
5516 | Constructor |
|
5553 | Constructor | |
5517 | """ |
|
5554 | """ | |
5518 | QMainWindow.__init__(self, parent) |
|
5555 | QMainWindow.__init__(self, parent) | |
5519 | self.setupUi(self) |
|
5556 | self.setupUi(self) | |
5520 | self.getFromWindow = None |
|
5557 | self.getFromWindow = None | |
5521 | self.getfromWindowList = [] |
|
5558 | self.getfromWindowList = [] | |
5522 | self.dataTypeProject = None |
|
5559 | self.dataTypeProject = None | |
5523 |
|
5560 | |||
5524 | self.listUP = None |
|
5561 | self.listUP = None | |
5525 |
|
5562 | |||
5526 | @pyqtSignature("") |
|
5563 | @pyqtSignature("") | |
5527 | def on_unitPokbut_clicked(self): |
|
5564 | def on_unitPokbut_clicked(self): | |
5528 | """ |
|
5565 | """ | |
5529 | Slot documentation goes here. |
|
5566 | Slot documentation goes here. | |
5530 | """ |
|
5567 | """ | |
5531 | self.create = True |
|
5568 | self.create = True | |
5532 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5569 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5533 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5570 | # self.nameofUP= str(self.nameUptxt.text()) | |
5534 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5571 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5535 | self.close() |
|
5572 | self.close() | |
5536 |
|
5573 | |||
5537 |
|
5574 | |||
5538 | @pyqtSignature("") |
|
5575 | @pyqtSignature("") | |
5539 | def on_unitPcancelbut_clicked(self): |
|
5576 | def on_unitPcancelbut_clicked(self): | |
5540 | """ |
|
5577 | """ | |
5541 | Slot documentation goes here. |
|
5578 | Slot documentation goes here. | |
5542 | """ |
|
5579 | """ | |
5543 | self.create = False |
|
5580 | self.create = False | |
5544 | self.close() |
|
5581 | self.close() | |
5545 |
|
5582 | |||
5546 | def loadTotalList(self): |
|
5583 | def loadTotalList(self): | |
5547 | self.comboInputBox.clear() |
|
5584 | self.comboInputBox.clear() | |
5548 | for i in self.getfromWindowList: |
|
5585 | for i in self.getfromWindowList: | |
5549 |
|
5586 | |||
5550 | name = i.getElementName() |
|
5587 | name = i.getElementName() | |
5551 | if name == 'Project': |
|
5588 | if name == 'Project': | |
5552 | id = i.id |
|
5589 | id = i.id | |
5553 | name = i.name |
|
5590 | name = i.name | |
5554 | if self.dataTypeProject == 'Voltage': |
|
5591 | if self.dataTypeProject == 'Voltage': | |
5555 | self.comboTypeBox.clear() |
|
5592 | self.comboTypeBox.clear() | |
5556 | self.comboTypeBox.addItem("Voltage") |
|
5593 | self.comboTypeBox.addItem("Voltage") | |
5557 |
|
5594 | |||
5558 | if self.dataTypeProject == 'Spectra': |
|
5595 | if self.dataTypeProject == 'Spectra': | |
5559 | self.comboTypeBox.clear() |
|
5596 | self.comboTypeBox.clear() | |
5560 | self.comboTypeBox.addItem("Spectra") |
|
5597 | self.comboTypeBox.addItem("Spectra") | |
5561 | self.comboTypeBox.addItem("Correlation") |
|
5598 | self.comboTypeBox.addItem("Correlation") | |
5562 | if self.dataTypeProject == 'Fits': |
|
5599 | if self.dataTypeProject == 'Fits': | |
5563 | self.comboTypeBox.clear() |
|
5600 | self.comboTypeBox.clear() | |
5564 | self.comboTypeBox.addItem("SpectraHeis") |
|
5601 | self.comboTypeBox.addItem("SpectraHeis") | |
5565 |
|
5602 | |||
5566 |
|
5603 | |||
5567 | if name == 'ProcUnit': |
|
5604 | if name == 'ProcUnit': | |
5568 | id = int(i.id) - 1 |
|
5605 | id = int(i.id) - 1 | |
5569 | name = i.datatype |
|
5606 | name = i.datatype | |
5570 | if name == 'Voltage': |
|
5607 | if name == 'Voltage': | |
5571 | self.comboTypeBox.clear() |
|
5608 | self.comboTypeBox.clear() | |
5572 | self.comboTypeBox.addItem("Spectra") |
|
5609 | self.comboTypeBox.addItem("Spectra") | |
5573 | self.comboTypeBox.addItem("SpectraHeis") |
|
5610 | self.comboTypeBox.addItem("SpectraHeis") | |
5574 | self.comboTypeBox.addItem("Correlation") |
|
5611 | self.comboTypeBox.addItem("Correlation") | |
5575 | if name == 'Spectra': |
|
5612 | if name == 'Spectra': | |
5576 | self.comboTypeBox.clear() |
|
5613 | self.comboTypeBox.clear() | |
5577 | self.comboTypeBox.addItem("Spectra") |
|
5614 | self.comboTypeBox.addItem("Spectra") | |
5578 | self.comboTypeBox.addItem("SpectraHeis") |
|
5615 | self.comboTypeBox.addItem("SpectraHeis") | |
5579 | self.comboTypeBox.addItem("Correlation") |
|
5616 | self.comboTypeBox.addItem("Correlation") | |
5580 | if name == 'SpectraHeis': |
|
5617 | if name == 'SpectraHeis': | |
5581 | self.comboTypeBox.clear() |
|
5618 | self.comboTypeBox.clear() | |
5582 | self.comboTypeBox.addItem("SpectraHeis") |
|
5619 | self.comboTypeBox.addItem("SpectraHeis") | |
5583 |
|
5620 | |||
5584 | self.comboInputBox.addItem(str(name)) |
|
5621 | self.comboInputBox.addItem(str(name)) | |
5585 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5622 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5586 |
|
5623 | |||
5587 | def closeEvent(self, event): |
|
5624 | def closeEvent(self, event): | |
5588 | self.closed.emit() |
|
5625 | self.closed.emit() | |
5589 | event.accept() |
|
5626 | event.accept() | |
5590 |
|
5627 | |||
5591 | class Ftp(QMainWindow, Ui_Ftp): |
|
5628 | class Ftp(QMainWindow, Ui_Ftp): | |
5592 | """ |
|
5629 | """ | |
5593 | Class documentation goes here. |
|
5630 | Class documentation goes here. | |
5594 | """ |
|
5631 | """ | |
5595 | create = False |
|
5632 | create = False | |
5596 | closed = pyqtSignal() |
|
5633 | closed = pyqtSignal() | |
5597 | server = None |
|
5634 | server = None | |
5598 | remotefolder = None |
|
5635 | remotefolder = None | |
5599 | username = None |
|
5636 | username = None | |
5600 | password = None |
|
5637 | password = None | |
5601 | ftp_wei = None |
|
5638 | ftp_wei = None | |
5602 | exp_code = None |
|
5639 | exp_code = None | |
5603 | sub_exp_code = None |
|
5640 | sub_exp_code = None | |
5604 | plot_pos = None |
|
5641 | plot_pos = None | |
5605 |
|
5642 | |||
5606 | def __init__(self, parent=None): |
|
5643 | def __init__(self, parent=None): | |
5607 | """ |
|
5644 | """ | |
5608 | Constructor |
|
5645 | Constructor | |
5609 | """ |
|
5646 | """ | |
5610 | QMainWindow.__init__(self, parent) |
|
5647 | QMainWindow.__init__(self, parent) | |
5611 | self.setupUi(self) |
|
5648 | self.setupUi(self) | |
5612 | self.setGUIStatus() |
|
5649 | self.setGUIStatus() | |
5613 |
|
5650 | |||
5614 | def setGUIStatus(self): |
|
5651 | def setGUIStatus(self): | |
5615 | self.setWindowTitle("ROJ-Signal Chain") |
|
5652 | self.setWindowTitle("ROJ-Signal Chain") | |
5616 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5653 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5617 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5654 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5618 | self.usernameFTP.setToolTip('Example: myusername') |
|
5655 | self.usernameFTP.setToolTip('Example: myusername') | |
5619 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5656 | self.passwordFTP.setToolTip('Example: mypass ') | |
5620 | self.weightFTP.setToolTip('Example: 0') |
|
5657 | self.weightFTP.setToolTip('Example: 0') | |
5621 | self.expcodeFTP.setToolTip('Example: 0') |
|
5658 | self.expcodeFTP.setToolTip('Example: 0') | |
5622 | self.subexpFTP.setToolTip('Example: 0') |
|
5659 | self.subexpFTP.setToolTip('Example: 0') | |
5623 | self.plotposFTP.setToolTip('Example: 0') |
|
5660 | self.plotposFTP.setToolTip('Example: 0') | |
5624 |
|
5661 | |||
5625 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5662 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5626 | self.serverFTP.setText(str(server)) |
|
5663 | self.serverFTP.setText(str(server)) | |
5627 | self.folderFTP.setText(str(remotefolder)) |
|
5664 | self.folderFTP.setText(str(remotefolder)) | |
5628 | self.usernameFTP.setText(str(username)) |
|
5665 | self.usernameFTP.setText(str(username)) | |
5629 | self.passwordFTP.setText(str(password)) |
|
5666 | self.passwordFTP.setText(str(password)) | |
5630 | self.weightFTP.setText(str(ftp_wei)) |
|
5667 | self.weightFTP.setText(str(ftp_wei)) | |
5631 | self.expcodeFTP.setText(str(exp_code)) |
|
5668 | self.expcodeFTP.setText(str(exp_code)) | |
5632 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5669 | self.subexpFTP.setText(str(sub_exp_code)) | |
5633 | self.plotposFTP.setText(str(plot_pos)) |
|
5670 | self.plotposFTP.setText(str(plot_pos)) | |
5634 |
|
5671 | |||
5635 | def getParmsFromFtpWindow(self): |
|
5672 | def getParmsFromFtpWindow(self): | |
5636 | """ |
|
5673 | """ | |
5637 | Return Inputs Project: |
|
5674 | Return Inputs Project: | |
5638 | - server |
|
5675 | - server | |
5639 | - remotefolder |
|
5676 | - remotefolder | |
5640 | - username |
|
5677 | - username | |
5641 | - password |
|
5678 | - password | |
5642 | - ftp_wei |
|
5679 | - ftp_wei | |
5643 | - exp_code |
|
5680 | - exp_code | |
5644 | - sub_exp_code |
|
5681 | - sub_exp_code | |
5645 | - plot_pos |
|
5682 | - plot_pos | |
5646 | """ |
|
5683 | """ | |
5647 | name_server_ftp = str(self.serverFTP.text()) |
|
5684 | name_server_ftp = str(self.serverFTP.text()) | |
5648 | if not name_server_ftp: |
|
5685 | if not name_server_ftp: | |
5649 | self.console.clear() |
|
5686 | self.console.clear() | |
5650 | self.console.append("Please Write a FTP Server") |
|
5687 | self.console.append("Please Write a FTP Server") | |
5651 | return 0 |
|
5688 | return 0 | |
5652 |
|
5689 | |||
5653 | folder_server_ftp = str(self.folderFTP.text()) |
|
5690 | folder_server_ftp = str(self.folderFTP.text()) | |
5654 | if not folder_server_ftp: |
|
5691 | if not folder_server_ftp: | |
5655 | self.console.clear() |
|
5692 | self.console.clear() | |
5656 | self.console.append("Please Write a Folder") |
|
5693 | self.console.append("Please Write a Folder") | |
5657 | return 0 |
|
5694 | return 0 | |
5658 |
|
5695 | |||
5659 | username_ftp = str(self.usernameFTP.text()) |
|
5696 | username_ftp = str(self.usernameFTP.text()) | |
5660 | if not username_ftp: |
|
5697 | if not username_ftp: | |
5661 | self.console.clear() |
|
5698 | self.console.clear() | |
5662 | self.console.append("Please Write a User Name") |
|
5699 | self.console.append("Please Write a User Name") | |
5663 | return 0 |
|
5700 | return 0 | |
5664 |
|
5701 | |||
5665 | password_ftp = str(self.passwordFTP.text()) |
|
5702 | password_ftp = str(self.passwordFTP.text()) | |
5666 | if not password_ftp: |
|
5703 | if not password_ftp: | |
5667 | self.console.clear() |
|
5704 | self.console.clear() | |
5668 | self.console.append("Please Write a passwordFTP") |
|
5705 | self.console.append("Please Write a passwordFTP") | |
5669 | return 0 |
|
5706 | return 0 | |
5670 |
|
5707 | |||
5671 | ftp_wei = str(self.weightFTP.text()) |
|
5708 | ftp_wei = str(self.weightFTP.text()) | |
5672 | if not ftp_wei == "": |
|
5709 | if not ftp_wei == "": | |
5673 | try: |
|
5710 | try: | |
5674 | ftp_wei = int(self.weightFTP.text()) |
|
5711 | ftp_wei = int(self.weightFTP.text()) | |
5675 | except: |
|
5712 | except: | |
5676 | self.console.clear() |
|
5713 | self.console.clear() | |
5677 | self.console.append("Please Write a ftp_wei number") |
|
5714 | self.console.append("Please Write a ftp_wei number") | |
5678 | return 0 |
|
5715 | return 0 | |
5679 |
|
5716 | |||
5680 | exp_code = str(self.expcodeFTP.text()) |
|
5717 | exp_code = str(self.expcodeFTP.text()) | |
5681 | if not exp_code == "": |
|
5718 | if not exp_code == "": | |
5682 | try: |
|
5719 | try: | |
5683 | exp_code = int(self.expcodeFTP.text()) |
|
5720 | exp_code = int(self.expcodeFTP.text()) | |
5684 | except: |
|
5721 | except: | |
5685 | self.console.clear() |
|
5722 | self.console.clear() | |
5686 | self.console.append("Please Write a exp_code number") |
|
5723 | self.console.append("Please Write a exp_code number") | |
5687 | return 0 |
|
5724 | return 0 | |
5688 |
|
5725 | |||
5689 |
|
5726 | |||
5690 | sub_exp_code = str(self.subexpFTP.text()) |
|
5727 | sub_exp_code = str(self.subexpFTP.text()) | |
5691 | if not sub_exp_code == "": |
|
5728 | if not sub_exp_code == "": | |
5692 | try: |
|
5729 | try: | |
5693 | sub_exp_code = int(self.subexpFTP.text()) |
|
5730 | sub_exp_code = int(self.subexpFTP.text()) | |
5694 | except: |
|
5731 | except: | |
5695 | self.console.clear() |
|
5732 | self.console.clear() | |
5696 | self.console.append("Please Write a sub_exp_code number") |
|
5733 | self.console.append("Please Write a sub_exp_code number") | |
5697 | return 0 |
|
5734 | return 0 | |
5698 |
|
5735 | |||
5699 | plot_pos = str(self.plotposFTP.text()) |
|
5736 | plot_pos = str(self.plotposFTP.text()) | |
5700 | if not plot_pos == "": |
|
5737 | if not plot_pos == "": | |
5701 | try: |
|
5738 | try: | |
5702 | plot_pos = int(self.plotposFTP.text()) |
|
5739 | plot_pos = int(self.plotposFTP.text()) | |
5703 | except: |
|
5740 | except: | |
5704 | self.console.clear() |
|
5741 | self.console.clear() | |
5705 | self.console.append("Please Write a plot_pos number") |
|
5742 | self.console.append("Please Write a plot_pos number") | |
5706 | return 0 |
|
5743 | return 0 | |
5707 |
|
5744 | |||
5708 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5745 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5709 |
|
5746 | |||
5710 | @pyqtSignature("") |
|
5747 | @pyqtSignature("") | |
5711 | def on_ftpOkButton_clicked(self): |
|
5748 | def on_ftpOkButton_clicked(self): | |
5712 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5749 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5713 | self.create = True |
|
5750 | self.create = True | |
5714 | self.close() |
|
5751 | self.close() | |
5715 |
|
5752 | |||
5716 | @pyqtSignature("") |
|
5753 | @pyqtSignature("") | |
5717 | def on_ftpCancelButton_clicked(self): |
|
5754 | def on_ftpCancelButton_clicked(self): | |
5718 | self.create = False |
|
5755 | self.create = False | |
5719 | self.close() |
|
5756 | self.close() | |
5720 |
|
5757 | |||
5721 | def closeEvent(self, event): |
|
5758 | def closeEvent(self, event): | |
5722 | self.closed.emit() |
|
5759 | self.closed.emit() | |
5723 | event.accept() |
|
5760 | event.accept() | |
5724 |
|
5761 | |||
5725 | class ftpBuffer(): |
|
5762 | class ftpBuffer(): | |
5726 |
|
5763 | |||
5727 | server = None |
|
5764 | server = None | |
5728 | remotefolder = None |
|
5765 | remotefolder = None | |
5729 | username = None |
|
5766 | username = None | |
5730 | password = None |
|
5767 | password = None | |
5731 | ftp_wei = None |
|
5768 | ftp_wei = None | |
5732 | exp_code = None |
|
5769 | exp_code = None | |
5733 | sub_exp_code = None |
|
5770 | sub_exp_code = None | |
5734 | plot_pos = None |
|
5771 | plot_pos = None | |
5735 | create = False |
|
5772 | create = False | |
5736 | withoutconfig = False |
|
5773 | withoutconfig = False | |
5737 | createforView = False |
|
5774 | createforView = False | |
5738 | localfolder = None |
|
5775 | localfolder = None | |
5739 | extension = None |
|
5776 | extension = None | |
5740 | period = None |
|
5777 | period = None | |
5741 | protocol = None |
|
5778 | protocol = None | |
5742 |
|
5779 | |||
5743 | def __init__(self): |
|
5780 | def __init__(self): | |
5744 |
|
5781 | |||
5745 | self.create = False |
|
5782 | self.create = False | |
5746 | self.server = None |
|
5783 | self.server = None | |
5747 | self.remotefolder = None |
|
5784 | self.remotefolder = None | |
5748 | self.username = None |
|
5785 | self.username = None | |
5749 | self.password = None |
|
5786 | self.password = None | |
5750 | self.ftp_wei = None |
|
5787 | self.ftp_wei = None | |
5751 | self.exp_code = None |
|
5788 | self.exp_code = None | |
5752 | self.sub_exp_code = None |
|
5789 | self.sub_exp_code = None | |
5753 | self.plot_pos = None |
|
5790 | self.plot_pos = None | |
5754 | # self.create = False |
|
5791 | # self.create = False | |
5755 | self.localfolder = None |
|
5792 | self.localfolder = None | |
5756 | self.extension = None |
|
5793 | self.extension = None | |
5757 | self.period = None |
|
5794 | self.period = None | |
5758 | self.protocol = None |
|
5795 | self.protocol = None | |
5759 |
|
5796 | |||
5760 | def setwithoutconfiguration(self): |
|
5797 | def setwithoutconfiguration(self): | |
5761 |
|
5798 | |||
5762 | self.create = False |
|
5799 | self.create = False | |
5763 | self.server = "jro-app.igp.gob.pe" |
|
5800 | self.server = "jro-app.igp.gob.pe" | |
5764 | self.remotefolder = "/home/wmaster/graficos" |
|
5801 | self.remotefolder = "/home/wmaster/graficos" | |
5765 | self.username = "wmaster" |
|
5802 | self.username = "wmaster" | |
5766 | self.password = "mst2010vhf" |
|
5803 | self.password = "mst2010vhf" | |
5767 | self.withoutconfig = True |
|
5804 | self.withoutconfig = True | |
5768 | self.localfolder = './' |
|
5805 | self.localfolder = './' | |
5769 | self.extension = '.png' |
|
5806 | self.extension = '.png' | |
5770 | self.period = 60 |
|
5807 | self.period = 60 | |
5771 | self.protocol = 'ftp' |
|
5808 | self.protocol = 'ftp' | |
5772 | self.createforView = True |
|
5809 | self.createforView = True | |
5773 |
|
5810 | |||
5774 | if not self.ftp_wei: |
|
5811 | if not self.ftp_wei: | |
5775 | self.ftp_wei = 0 |
|
5812 | self.ftp_wei = 0 | |
5776 |
|
5813 | |||
5777 | if not self.exp_code: |
|
5814 | if not self.exp_code: | |
5778 | self.exp_code = 0 |
|
5815 | self.exp_code = 0 | |
5779 |
|
5816 | |||
5780 | if not self.sub_exp_code: |
|
5817 | if not self.sub_exp_code: | |
5781 | self.sub_exp_code = 0 |
|
5818 | self.sub_exp_code = 0 | |
5782 |
|
5819 | |||
5783 | if not self.plot_pos: |
|
5820 | if not self.plot_pos: | |
5784 | self.plot_pos = 0 |
|
5821 | self.plot_pos = 0 | |
5785 |
|
5822 | |||
5786 | 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'): |
|
5823 | 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'): | |
5787 |
|
5824 | |||
5788 | self.server = server |
|
5825 | self.server = server | |
5789 | self.remotefolder = remotefolder |
|
5826 | self.remotefolder = remotefolder | |
5790 | self.username = username |
|
5827 | self.username = username | |
5791 | self.password = password |
|
5828 | self.password = password | |
5792 | self.ftp_wei = ftp_wei |
|
5829 | self.ftp_wei = ftp_wei | |
5793 | self.exp_code = exp_code |
|
5830 | self.exp_code = exp_code | |
5794 | self.sub_exp_code = sub_exp_code |
|
5831 | self.sub_exp_code = sub_exp_code | |
5795 | self.plot_pos = plot_pos |
|
5832 | self.plot_pos = plot_pos | |
5796 | self.create = True |
|
5833 | self.create = True | |
5797 | self.withoutconfig = False |
|
5834 | self.withoutconfig = False | |
5798 | self.createforView = True |
|
5835 | self.createforView = True | |
5799 | self.localfolder = localfolder |
|
5836 | self.localfolder = localfolder | |
5800 | self.extension = extension |
|
5837 | self.extension = extension | |
5801 | self.period = period |
|
5838 | self.period = period | |
5802 | self.protocol = protocol |
|
5839 | self.protocol = protocol | |
5803 |
|
5840 | |||
5804 | def recover(self): |
|
5841 | def recover(self): | |
5805 |
|
5842 | |||
5806 | 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 |
|
5843 | 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 | |
5807 |
|
5844 | |||
5808 | class ShowMeConsole(QtCore.QObject): |
|
5845 | class ShowMeConsole(QtCore.QObject): | |
5809 | textWritten = QtCore.pyqtSignal(str) |
|
5846 | ||
5810 | def write (self, text): |
|
5847 | textWritten = QtCore.pyqtSignal(str) | |
5811 | self.textWritten.emit(str(text)) |
|
5848 | ||
|
5849 | def write(self, text): | |||
|
5850 | ||||
|
5851 | if text[-1] == "\n": | |||
|
5852 | text = text[:-1] | |||
|
5853 | ||||
|
5854 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now