The requested changes are too big and content was truncated. Show full diff
@@ -1,1034 +1,1051 | |||||
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 | #import datetime |
|
9 | #import datetime | |
10 | from model import * |
|
10 | from model import * | |
11 |
|
11 | |||
12 | import ast |
|
12 | import ast | |
13 |
|
13 | |||
14 | def prettify(elem): |
|
14 | def prettify(elem): | |
15 | """Return a pretty-printed XML string for the Element. |
|
15 | """Return a pretty-printed XML string for the Element. | |
16 | """ |
|
16 | """ | |
17 | rough_string = ET.tostring(elem, 'utf-8') |
|
17 | rough_string = ET.tostring(elem, 'utf-8') | |
18 | reparsed = minidom.parseString(rough_string) |
|
18 | reparsed = minidom.parseString(rough_string) | |
19 | return reparsed.toprettyxml(indent=" ") |
|
19 | return reparsed.toprettyxml(indent=" ") | |
20 |
|
20 | |||
21 | class ParameterConf(): |
|
21 | class ParameterConf(): | |
22 |
|
22 | |||
23 | id = None |
|
23 | id = None | |
24 | name = None |
|
24 | name = None | |
25 | value = None |
|
25 | value = None | |
26 | format = None |
|
26 | format = None | |
27 |
|
27 | |||
28 | __formated_value = None |
|
28 | __formated_value = None | |
29 |
|
29 | |||
30 | ELEMENTNAME = 'Parameter' |
|
30 | ELEMENTNAME = 'Parameter' | |
31 |
|
31 | |||
32 | def __init__(self): |
|
32 | def __init__(self): | |
33 |
|
33 | |||
34 | self.format = 'str' |
|
34 | self.format = 'str' | |
35 |
|
35 | |||
36 | def getElementName(self): |
|
36 | def getElementName(self): | |
37 |
|
37 | |||
38 | return self.ELEMENTNAME |
|
38 | return self.ELEMENTNAME | |
39 |
|
39 | |||
40 | def getValue(self): |
|
40 | def getValue(self): | |
41 |
|
41 | |||
42 | if self.__formated_value != None: |
|
42 | if self.__formated_value != None: | |
43 |
|
43 | |||
44 | return self.__formated_value |
|
44 | return self.__formated_value | |
45 |
|
45 | |||
46 | value = self.value |
|
46 | value = self.value | |
47 |
|
47 | |||
48 | if self.format == 'bool': |
|
48 | if self.format == 'bool': | |
49 | value = int(value) |
|
49 | value = int(value) | |
50 |
|
50 | |||
51 | if self.format == 'list': |
|
51 | if self.format == 'list': | |
52 | strList = value.split(',') |
|
52 | strList = value.split(',') | |
53 |
|
53 | |||
54 | self.__formated_value = strList |
|
54 | self.__formated_value = strList | |
55 |
|
55 | |||
56 | return self.__formated_value |
|
56 | return self.__formated_value | |
57 |
|
57 | |||
58 | if self.format == 'intlist': |
|
58 | if self.format == 'intlist': | |
59 | """ |
|
59 | """ | |
60 | Example: |
|
60 | Example: | |
61 | value = (0,1,2) |
|
61 | value = (0,1,2) | |
62 | """ |
|
62 | """ | |
|
63 | value = value.replace('(', '') | |||
|
64 | value = value.replace(')', '') | |||
|
65 | ||||
|
66 | value = value.replace('[', '') | |||
|
67 | value = value.replace(']', '') | |||
|
68 | ||||
63 | strList = value.split(',') |
|
69 | strList = value.split(',') | |
64 | intList = [int(x) for x in strList] |
|
70 | intList = [int(x) for x in strList] | |
65 |
|
71 | |||
66 | self.__formated_value = intList |
|
72 | self.__formated_value = intList | |
67 |
|
73 | |||
68 | return self.__formated_value |
|
74 | return self.__formated_value | |
69 |
|
75 | |||
70 | if self.format == 'floatlist': |
|
76 | if self.format == 'floatlist': | |
71 | """ |
|
77 | """ | |
72 | Example: |
|
78 | Example: | |
73 | value = (0.5, 1.4, 2.7) |
|
79 | value = (0.5, 1.4, 2.7) | |
74 | """ |
|
80 | """ | |
|
81 | ||||
|
82 | value = value.replace('(', '') | |||
|
83 | value = value.replace(')', '') | |||
|
84 | ||||
|
85 | value = value.replace('[', '') | |||
|
86 | value = value.replace(']', '') | |||
|
87 | ||||
75 | strList = value.split(',') |
|
88 | strList = value.split(',') | |
76 | floatList = [float(x) for x in strList] |
|
89 | floatList = [float(x) for x in strList] | |
77 |
|
90 | |||
78 | self.__formated_value = floatList |
|
91 | self.__formated_value = floatList | |
79 |
|
92 | |||
80 | return self.__formated_value |
|
93 | return self.__formated_value | |
81 |
|
94 | |||
82 | if self.format == 'date': |
|
95 | if self.format == 'date': | |
83 | strList = value.split('/') |
|
96 | strList = value.split('/') | |
84 | intList = [int(x) for x in strList] |
|
97 | intList = [int(x) for x in strList] | |
85 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
98 | date = datetime.date(intList[0], intList[1], intList[2]) | |
86 |
|
99 | |||
87 | self.__formated_value = date |
|
100 | self.__formated_value = date | |
88 |
|
101 | |||
89 | return self.__formated_value |
|
102 | return self.__formated_value | |
90 |
|
103 | |||
91 | if self.format == 'time': |
|
104 | if self.format == 'time': | |
92 | strList = value.split(':') |
|
105 | strList = value.split(':') | |
93 | intList = [int(x) for x in strList] |
|
106 | intList = [int(x) for x in strList] | |
94 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
107 | time = datetime.time(intList[0], intList[1], intList[2]) | |
95 |
|
108 | |||
96 | self.__formated_value = time |
|
109 | self.__formated_value = time | |
97 |
|
110 | |||
98 | return self.__formated_value |
|
111 | return self.__formated_value | |
99 |
|
112 | |||
100 | if self.format == 'pairslist': |
|
113 | if self.format == 'pairslist': | |
101 | """ |
|
114 | """ | |
102 | Example: |
|
115 | Example: | |
103 | value = (0,1),(1,2) |
|
116 | value = (0,1),(1,2) | |
104 | """ |
|
117 | """ | |
105 |
|
118 | |||
106 | value = value.replace('(', '') |
|
119 | value = value.replace('(', '') | |
107 | value = value.replace(')', '') |
|
120 | value = value.replace(')', '') | |
108 |
|
121 | |||
|
122 | value = value.replace('[', '') | |||
|
123 | value = value.replace(']', '') | |||
|
124 | ||||
109 | strList = value.split(',') |
|
125 | strList = value.split(',') | |
110 | intList = [int(item) for item in strList] |
|
126 | intList = [int(item) for item in strList] | |
111 | pairList = [] |
|
127 | pairList = [] | |
112 | for i in range(len(intList)/2): |
|
128 | for i in range(len(intList)/2): | |
113 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
129 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
114 |
|
130 | |||
115 | self.__formated_value = pairList |
|
131 | self.__formated_value = pairList | |
116 |
|
132 | |||
117 | return self.__formated_value |
|
133 | return self.__formated_value | |
118 |
|
134 | |||
119 | if self.format == 'multilist': |
|
135 | if self.format == 'multilist': | |
120 | """ |
|
136 | """ | |
121 | Example: |
|
137 | Example: | |
122 | value = (0,1,2),(3,4,5) |
|
138 | value = (0,1,2),(3,4,5) | |
123 | """ |
|
139 | """ | |
124 | multiList = ast.literal_eval(value) |
|
140 | multiList = ast.literal_eval(value) | |
125 |
|
141 | |||
126 | self.__formated_value = multiList |
|
142 | self.__formated_value = multiList | |
127 |
|
143 | |||
128 | return self.__formated_value |
|
144 | return self.__formated_value | |
129 |
|
145 | |||
130 | format_func = eval(self.format) |
|
146 | format_func = eval(self.format) | |
131 |
|
147 | |||
132 | self.__formated_value = format_func(value) |
|
148 | self.__formated_value = format_func(value) | |
133 |
|
149 | |||
134 | return self.__formated_value |
|
150 | return self.__formated_value | |
135 |
|
151 | |||
136 | def setup(self, id, name, value, format='str'): |
|
152 | def setup(self, id, name, value, format='str'): | |
137 |
|
153 | |||
138 | self.id = id |
|
154 | self.id = id | |
139 | self.name = name |
|
155 | self.name = name | |
140 | self.value = str(value) |
|
156 | self.value = str(value) | |
141 | self.format = str.lower(format) |
|
157 | self.format = str.lower(format) | |
142 |
|
158 | |||
143 | def update(self, name, value, format='str'): |
|
159 | def update(self, name, value, format='str'): | |
144 |
|
160 | |||
145 | self.name = name |
|
161 | self.name = name | |
146 | self.value = str(value) |
|
162 | self.value = str(value) | |
147 | self.format = format |
|
163 | self.format = format | |
148 |
|
164 | |||
149 | def makeXml(self, opElement): |
|
165 | def makeXml(self, opElement): | |
150 |
|
166 | |||
151 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
167 | parmElement = SubElement(opElement, self.ELEMENTNAME) | |
152 | parmElement.set('id', str(self.id)) |
|
168 | parmElement.set('id', str(self.id)) | |
153 | parmElement.set('name', self.name) |
|
169 | parmElement.set('name', self.name) | |
154 | parmElement.set('value', self.value) |
|
170 | parmElement.set('value', self.value) | |
155 | parmElement.set('format', self.format) |
|
171 | parmElement.set('format', self.format) | |
156 |
|
172 | |||
157 | def readXml(self, parmElement): |
|
173 | def readXml(self, parmElement): | |
158 |
|
174 | |||
159 | self.id = parmElement.get('id') |
|
175 | self.id = parmElement.get('id') | |
160 | self.name = parmElement.get('name') |
|
176 | self.name = parmElement.get('name') | |
161 | self.value = parmElement.get('value') |
|
177 | self.value = parmElement.get('value') | |
162 | self.format = str.lower(parmElement.get('format')) |
|
178 | self.format = str.lower(parmElement.get('format')) | |
163 |
|
179 | |||
164 | #Compatible with old signal chain version |
|
180 | #Compatible with old signal chain version | |
165 | if self.format == 'int' and self.name == 'idfigure': |
|
181 | if self.format == 'int' and self.name == 'idfigure': | |
166 | self.name = 'id' |
|
182 | self.name = 'id' | |
167 |
|
183 | |||
168 | def printattr(self): |
|
184 | def printattr(self): | |
169 |
|
185 | |||
170 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
186 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) | |
171 |
|
187 | |||
172 | class OperationConf(): |
|
188 | class OperationConf(): | |
173 |
|
189 | |||
174 | id = None |
|
190 | id = None | |
175 | name = None |
|
191 | name = None | |
176 | priority = None |
|
192 | priority = None | |
177 | type = None |
|
193 | type = None | |
178 |
|
194 | |||
179 | parmConfObjList = [] |
|
195 | parmConfObjList = [] | |
180 |
|
196 | |||
181 | ELEMENTNAME = 'Operation' |
|
197 | ELEMENTNAME = 'Operation' | |
182 |
|
198 | |||
183 | def __init__(self): |
|
199 | def __init__(self): | |
184 |
|
200 | |||
185 | self.id = 0 |
|
201 | self.id = 0 | |
186 | self.name = None |
|
202 | self.name = None | |
187 | self.priority = None |
|
203 | self.priority = None | |
188 | self.type = 'self' |
|
204 | self.type = 'self' | |
189 |
|
205 | |||
190 |
|
206 | |||
191 | def __getNewId(self): |
|
207 | def __getNewId(self): | |
192 |
|
208 | |||
193 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
209 | return int(self.id)*10 + len(self.parmConfObjList) + 1 | |
194 |
|
210 | |||
195 | def getElementName(self): |
|
211 | def getElementName(self): | |
196 |
|
212 | |||
197 | return self.ELEMENTNAME |
|
213 | return self.ELEMENTNAME | |
198 |
|
214 | |||
199 | def getParameterObjList(self): |
|
215 | def getParameterObjList(self): | |
200 |
|
216 | |||
201 | return self.parmConfObjList |
|
217 | return self.parmConfObjList | |
202 |
|
218 | |||
203 | def getParameterObj(self, parameterName): |
|
219 | def getParameterObj(self, parameterName): | |
204 |
|
220 | |||
205 | for parmConfObj in self.parmConfObjList: |
|
221 | for parmConfObj in self.parmConfObjList: | |
206 |
|
222 | |||
207 | if parmConfObj.name != parameterName: |
|
223 | if parmConfObj.name != parameterName: | |
208 | continue |
|
224 | continue | |
209 |
|
225 | |||
210 | return parmConfObj |
|
226 | return parmConfObj | |
211 |
|
227 | |||
212 | return None |
|
228 | return None | |
213 |
|
229 | |||
214 | def getParameterObjfromValue(self,parameterValue): |
|
230 | def getParameterObjfromValue(self,parameterValue): | |
215 | for parmConfObj in self.parmConfObjList: |
|
231 | for parmConfObj in self.parmConfObjList: | |
216 |
|
232 | |||
217 | if parmConfObj.getValue() != parameterValue: |
|
233 | if parmConfObj.getValue() != parameterValue: | |
218 | continue |
|
234 | continue | |
219 |
|
235 | |||
220 | return parmConfObj.getValue() |
|
236 | return parmConfObj.getValue() | |
221 |
|
237 | |||
222 | return None |
|
238 | return None | |
223 |
|
239 | |||
224 | def getParameterValue(self, parameterName): |
|
240 | def getParameterValue(self, parameterName): | |
225 |
|
241 | |||
226 | parameterObj = self.getParameterObj(parameterName) |
|
242 | parameterObj = self.getParameterObj(parameterName) | |
227 | value = parameterObj.getValue() |
|
243 | value = parameterObj.getValue() | |
228 |
|
244 | |||
229 | return value |
|
245 | return value | |
230 |
|
246 | |||
231 | def setup(self, id, name, priority, type): |
|
247 | def setup(self, id, name, priority, type): | |
232 |
|
248 | |||
233 | self.id = id |
|
249 | self.id = id | |
234 | self.name = name |
|
250 | self.name = name | |
235 | self.type = type |
|
251 | self.type = type | |
236 | self.priority = priority |
|
252 | self.priority = priority | |
237 |
|
253 | |||
238 | self.parmConfObjList = [] |
|
254 | self.parmConfObjList = [] | |
239 |
|
255 | |||
240 | def removeParameters(self): |
|
256 | def removeParameters(self): | |
241 |
|
257 | |||
242 | for obj in self.parmConfObjList: |
|
258 | for obj in self.parmConfObjList: | |
243 | del obj |
|
259 | del obj | |
244 |
|
260 | |||
245 | self.parmConfObjList = [] |
|
261 | self.parmConfObjList = [] | |
246 |
|
262 | |||
247 | def addParameter(self, name, value, format='str'): |
|
263 | def addParameter(self, name, value, format='str'): | |
248 |
|
264 | |||
249 | id = self.__getNewId() |
|
265 | id = self.__getNewId() | |
250 |
|
266 | |||
251 | parmConfObj = ParameterConf() |
|
267 | parmConfObj = ParameterConf() | |
252 | parmConfObj.setup(id, name, value, format) |
|
268 | parmConfObj.setup(id, name, value, format) | |
253 |
|
269 | |||
254 | self.parmConfObjList.append(parmConfObj) |
|
270 | self.parmConfObjList.append(parmConfObj) | |
255 |
|
271 | |||
256 | return parmConfObj |
|
272 | return parmConfObj | |
257 |
|
273 | |||
258 | def changeParameter(self, name, value, format='str'): |
|
274 | def changeParameter(self, name, value, format='str'): | |
259 |
|
275 | |||
260 | parmConfObj = self.getParameterObj(name) |
|
276 | parmConfObj = self.getParameterObj(name) | |
261 | parmConfObj.update(name, value, format) |
|
277 | parmConfObj.update(name, value, format) | |
262 |
|
278 | |||
263 | return parmConfObj |
|
279 | return parmConfObj | |
264 |
|
280 | |||
265 | def makeXml(self, upElement): |
|
281 | def makeXml(self, upElement): | |
266 |
|
282 | |||
267 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
283 | opElement = SubElement(upElement, self.ELEMENTNAME) | |
268 | opElement.set('id', str(self.id)) |
|
284 | opElement.set('id', str(self.id)) | |
269 | opElement.set('name', self.name) |
|
285 | opElement.set('name', self.name) | |
270 | opElement.set('type', self.type) |
|
286 | opElement.set('type', self.type) | |
271 | opElement.set('priority', str(self.priority)) |
|
287 | opElement.set('priority', str(self.priority)) | |
272 |
|
288 | |||
273 | for parmConfObj in self.parmConfObjList: |
|
289 | for parmConfObj in self.parmConfObjList: | |
274 | parmConfObj.makeXml(opElement) |
|
290 | parmConfObj.makeXml(opElement) | |
275 |
|
291 | |||
276 | def readXml(self, opElement): |
|
292 | def readXml(self, opElement): | |
277 |
|
293 | |||
278 | self.id = opElement.get('id') |
|
294 | self.id = opElement.get('id') | |
279 | self.name = opElement.get('name') |
|
295 | self.name = opElement.get('name') | |
280 | self.type = opElement.get('type') |
|
296 | self.type = opElement.get('type') | |
281 | self.priority = opElement.get('priority') |
|
297 | self.priority = opElement.get('priority') | |
282 |
|
298 | |||
283 | #Compatible with old signal chain version |
|
299 | #Compatible with old signal chain version | |
284 | #Use of 'run' method instead 'init' |
|
300 | #Use of 'run' method instead 'init' | |
285 | if self.type == 'self' and self.name == 'init': |
|
301 | if self.type == 'self' and self.name == 'init': | |
286 | self.name = 'run' |
|
302 | self.name = 'run' | |
287 |
|
303 | |||
288 | self.parmConfObjList = [] |
|
304 | self.parmConfObjList = [] | |
289 |
|
305 | |||
290 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
306 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) | |
291 |
|
307 | |||
292 | for parmElement in parmElementList: |
|
308 | for parmElement in parmElementList: | |
293 | parmConfObj = ParameterConf() |
|
309 | parmConfObj = ParameterConf() | |
294 | parmConfObj.readXml(parmElement) |
|
310 | parmConfObj.readXml(parmElement) | |
295 |
|
311 | |||
296 | #Compatible with old signal chain version |
|
312 | #Compatible with old signal chain version | |
297 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
313 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER | |
298 | if self.type != 'self' and self.name == 'Plot': |
|
314 | if self.type != 'self' and self.name == 'Plot': | |
299 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
315 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': | |
300 | self.name = parmConfObj.value |
|
316 | self.name = parmConfObj.value | |
301 | continue |
|
317 | continue | |
302 |
|
318 | |||
303 | self.parmConfObjList.append(parmConfObj) |
|
319 | self.parmConfObjList.append(parmConfObj) | |
304 |
|
320 | |||
305 | def printattr(self): |
|
321 | def printattr(self): | |
306 |
|
322 | |||
307 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
323 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, | |
308 | self.id, |
|
324 | self.id, | |
309 | self.name, |
|
325 | self.name, | |
310 | self.type, |
|
326 | self.type, | |
311 | self.priority) |
|
327 | self.priority) | |
312 |
|
328 | |||
313 | for parmConfObj in self.parmConfObjList: |
|
329 | for parmConfObj in self.parmConfObjList: | |
314 | parmConfObj.printattr() |
|
330 | parmConfObj.printattr() | |
315 |
|
331 | |||
316 | def createObject(self): |
|
332 | def createObject(self): | |
317 |
|
333 | |||
318 | if self.type == 'self': |
|
334 | if self.type == 'self': | |
319 | raise ValueError, "This operation type cannot be created" |
|
335 | raise ValueError, "This operation type cannot be created" | |
320 |
|
336 | |||
321 | if self.type == 'external' or self.type == 'other': |
|
337 | if self.type == 'external' or self.type == 'other': | |
322 | className = eval(self.name) |
|
338 | className = eval(self.name) | |
323 | opObj = className() |
|
339 | opObj = className() | |
324 |
|
340 | |||
325 | return opObj |
|
341 | return opObj | |
326 |
|
342 | |||
327 | class ProcUnitConf(): |
|
343 | class ProcUnitConf(): | |
328 |
|
344 | |||
329 | id = None |
|
345 | id = None | |
330 | name = None |
|
346 | name = None | |
331 | datatype = None |
|
347 | datatype = None | |
332 | inputId = None |
|
348 | inputId = None | |
333 | parentId = None |
|
349 | parentId = None | |
334 |
|
350 | |||
335 | opConfObjList = [] |
|
351 | opConfObjList = [] | |
336 |
|
352 | |||
337 | procUnitObj = None |
|
353 | procUnitObj = None | |
338 | opObjList = [] |
|
354 | opObjList = [] | |
339 |
|
355 | |||
340 | ELEMENTNAME = 'ProcUnit' |
|
356 | ELEMENTNAME = 'ProcUnit' | |
341 |
|
357 | |||
342 | def __init__(self): |
|
358 | def __init__(self): | |
343 |
|
359 | |||
344 | self.id = None |
|
360 | self.id = None | |
345 | self.datatype = None |
|
361 | self.datatype = None | |
346 | self.name = None |
|
362 | self.name = None | |
347 | self.inputId = None |
|
363 | self.inputId = None | |
348 |
|
364 | |||
349 | self.opConfObjList = [] |
|
365 | self.opConfObjList = [] | |
350 |
|
366 | |||
351 | self.procUnitObj = None |
|
367 | self.procUnitObj = None | |
352 | self.opObjDict = {} |
|
368 | self.opObjDict = {} | |
353 |
|
369 | |||
354 | def __getPriority(self): |
|
370 | def __getPriority(self): | |
355 |
|
371 | |||
356 | return len(self.opConfObjList)+1 |
|
372 | return len(self.opConfObjList)+1 | |
357 |
|
373 | |||
358 | def __getNewId(self): |
|
374 | def __getNewId(self): | |
359 |
|
375 | |||
360 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
376 | return int(self.id)*10 + len(self.opConfObjList) + 1 | |
361 |
|
377 | |||
362 | def getElementName(self): |
|
378 | def getElementName(self): | |
363 |
|
379 | |||
364 | return self.ELEMENTNAME |
|
380 | return self.ELEMENTNAME | |
365 |
|
381 | |||
366 | def getId(self): |
|
382 | def getId(self): | |
367 |
|
383 | |||
368 | return str(self.id) |
|
384 | return str(self.id) | |
369 |
|
385 | |||
370 | def getInputId(self): |
|
386 | def getInputId(self): | |
371 |
|
387 | |||
372 | return str(self.inputId) |
|
388 | return str(self.inputId) | |
373 |
|
389 | |||
374 | def getOperationObjList(self): |
|
390 | def getOperationObjList(self): | |
375 |
|
391 | |||
376 | return self.opConfObjList |
|
392 | return self.opConfObjList | |
377 |
|
393 | |||
378 | def getOperationObj(self, name=None): |
|
394 | def getOperationObj(self, name=None): | |
379 |
|
395 | |||
380 | for opConfObj in self.opConfObjList: |
|
396 | for opConfObj in self.opConfObjList: | |
381 |
|
397 | |||
382 | if opConfObj.name != name: |
|
398 | if opConfObj.name != name: | |
383 | continue |
|
399 | continue | |
384 |
|
400 | |||
385 | return opConfObj |
|
401 | return opConfObj | |
386 |
|
402 | |||
387 | return None |
|
403 | return None | |
388 |
|
404 | |||
389 | def getOpObjfromParamValue(self,value=None): |
|
405 | def getOpObjfromParamValue(self,value=None): | |
390 |
|
406 | |||
391 | for opConfObj in self.opConfObjList: |
|
407 | for opConfObj in self.opConfObjList: | |
392 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
408 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: | |
393 | continue |
|
409 | continue | |
394 | return opConfObj |
|
410 | return opConfObj | |
395 | return None |
|
411 | return None | |
396 |
|
412 | |||
397 | def getProcUnitObj(self): |
|
413 | def getProcUnitObj(self): | |
398 |
|
414 | |||
399 | return self.procUnitObj |
|
415 | return self.procUnitObj | |
400 |
|
416 | |||
401 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
417 | def setup(self, id, name, datatype, inputId, parentId=None): | |
402 |
|
418 | |||
403 | self.id = id |
|
419 | self.id = id | |
404 | self.name = name |
|
420 | self.name = name | |
405 | self.datatype = datatype |
|
421 | self.datatype = datatype | |
406 | self.inputId = inputId |
|
422 | self.inputId = inputId | |
407 | self.parentId = parentId |
|
423 | self.parentId = parentId | |
408 |
|
424 | |||
409 | self.opConfObjList = [] |
|
425 | self.opConfObjList = [] | |
410 |
|
426 | |||
411 | self.addOperation(name='run', optype='self') |
|
427 | self.addOperation(name='run', optype='self') | |
412 |
|
428 | |||
413 | def removeOperations(self): |
|
429 | def removeOperations(self): | |
414 |
|
430 | |||
415 | for obj in self.opConfObjList: |
|
431 | for obj in self.opConfObjList: | |
416 | del obj |
|
432 | del obj | |
417 |
|
433 | |||
418 | self.opConfObjList = [] |
|
434 | self.opConfObjList = [] | |
419 | self.addOperation(name='run') |
|
435 | self.addOperation(name='run') | |
420 |
|
436 | |||
421 | def addParameter(self, **kwargs): |
|
437 | def addParameter(self, **kwargs): | |
422 | ''' |
|
438 | ''' | |
423 | Add parameters to "run" operation |
|
439 | Add parameters to "run" operation | |
424 | ''' |
|
440 | ''' | |
425 | opObj = self.opConfObjList[0] |
|
441 | opObj = self.opConfObjList[0] | |
426 |
|
442 | |||
427 | opObj.addParameter(**kwargs) |
|
443 | opObj.addParameter(**kwargs) | |
428 |
|
444 | |||
429 | return opObj |
|
445 | return opObj | |
430 |
|
446 | |||
431 | def addOperation(self, name, optype='self'): |
|
447 | def addOperation(self, name, optype='self'): | |
432 |
|
448 | |||
433 | id = self.__getNewId() |
|
449 | id = self.__getNewId() | |
434 | priority = self.__getPriority() |
|
450 | priority = self.__getPriority() | |
435 |
|
451 | |||
436 | opConfObj = OperationConf() |
|
452 | opConfObj = OperationConf() | |
437 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
453 | opConfObj.setup(id, name=name, priority=priority, type=optype) | |
438 |
|
454 | |||
439 | self.opConfObjList.append(opConfObj) |
|
455 | self.opConfObjList.append(opConfObj) | |
440 |
|
456 | |||
441 | return opConfObj |
|
457 | return opConfObj | |
442 |
|
458 | |||
443 | def makeXml(self, procUnitElement): |
|
459 | def makeXml(self, procUnitElement): | |
444 |
|
460 | |||
445 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
461 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) | |
446 | upElement.set('id', str(self.id)) |
|
462 | upElement.set('id', str(self.id)) | |
447 | upElement.set('name', self.name) |
|
463 | upElement.set('name', self.name) | |
448 | upElement.set('datatype', self.datatype) |
|
464 | upElement.set('datatype', self.datatype) | |
449 | upElement.set('inputId', str(self.inputId)) |
|
465 | upElement.set('inputId', str(self.inputId)) | |
450 |
|
466 | |||
451 | for opConfObj in self.opConfObjList: |
|
467 | for opConfObj in self.opConfObjList: | |
452 | opConfObj.makeXml(upElement) |
|
468 | opConfObj.makeXml(upElement) | |
453 |
|
469 | |||
454 | def readXml(self, upElement): |
|
470 | def readXml(self, upElement): | |
455 |
|
471 | |||
456 | self.id = upElement.get('id') |
|
472 | self.id = upElement.get('id') | |
457 | self.name = upElement.get('name') |
|
473 | self.name = upElement.get('name') | |
458 | self.datatype = upElement.get('datatype') |
|
474 | self.datatype = upElement.get('datatype') | |
459 | self.inputId = upElement.get('inputId') |
|
475 | self.inputId = upElement.get('inputId') | |
460 |
|
476 | |||
461 | self.opConfObjList = [] |
|
477 | self.opConfObjList = [] | |
462 |
|
478 | |||
463 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
479 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
464 |
|
480 | |||
465 | for opElement in opElementList: |
|
481 | for opElement in opElementList: | |
466 | opConfObj = OperationConf() |
|
482 | opConfObj = OperationConf() | |
467 | opConfObj.readXml(opElement) |
|
483 | opConfObj.readXml(opElement) | |
468 | self.opConfObjList.append(opConfObj) |
|
484 | self.opConfObjList.append(opConfObj) | |
469 |
|
485 | |||
470 | def printattr(self): |
|
486 | def printattr(self): | |
471 |
|
487 | |||
472 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
488 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, | |
473 | self.id, |
|
489 | self.id, | |
474 | self.name, |
|
490 | self.name, | |
475 | self.datatype, |
|
491 | self.datatype, | |
476 | self.inputId) |
|
492 | self.inputId) | |
477 |
|
493 | |||
478 | for opConfObj in self.opConfObjList: |
|
494 | for opConfObj in self.opConfObjList: | |
479 | opConfObj.printattr() |
|
495 | opConfObj.printattr() | |
480 |
|
496 | |||
481 | def createObjects(self): |
|
497 | def createObjects(self): | |
482 |
|
498 | |||
483 | className = eval(self.name) |
|
499 | className = eval(self.name) | |
484 | procUnitObj = className() |
|
500 | procUnitObj = className() | |
485 |
|
501 | |||
486 | for opConfObj in self.opConfObjList: |
|
502 | for opConfObj in self.opConfObjList: | |
487 |
|
503 | |||
488 | if opConfObj.type == 'self': |
|
504 | if opConfObj.type == 'self': | |
489 | continue |
|
505 | continue | |
490 |
|
506 | |||
491 | opObj = opConfObj.createObject() |
|
507 | opObj = opConfObj.createObject() | |
492 |
|
508 | |||
493 | self.opObjDict[opConfObj.id] = opObj |
|
509 | self.opObjDict[opConfObj.id] = opObj | |
494 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
510 | procUnitObj.addOperation(opObj, opConfObj.id) | |
495 |
|
511 | |||
496 | self.procUnitObj = procUnitObj |
|
512 | self.procUnitObj = procUnitObj | |
497 |
|
513 | |||
498 | return procUnitObj |
|
514 | return procUnitObj | |
499 |
|
515 | |||
500 | def run(self): |
|
516 | def run(self): | |
501 |
|
517 | |||
502 | finalSts = False |
|
518 | finalSts = False | |
503 |
|
519 | |||
504 | for opConfObj in self.opConfObjList: |
|
520 | for opConfObj in self.opConfObjList: | |
505 |
|
521 | |||
506 | kwargs = {} |
|
522 | kwargs = {} | |
507 | for parmConfObj in opConfObj.getParameterObjList(): |
|
523 | for parmConfObj in opConfObj.getParameterObjList(): | |
508 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
524 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': | |
509 | continue |
|
525 | continue | |
510 |
|
526 | |||
511 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
527 | kwargs[parmConfObj.name] = parmConfObj.getValue() | |
512 |
|
528 | |||
513 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
529 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) | |
514 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
530 | sts = self.procUnitObj.call(opType = opConfObj.type, | |
515 | opName = opConfObj.name, |
|
531 | opName = opConfObj.name, | |
516 | opId = opConfObj.id, |
|
532 | opId = opConfObj.id, | |
517 | **kwargs) |
|
533 | **kwargs) | |
518 | finalSts = finalSts or sts |
|
534 | finalSts = finalSts or sts | |
519 |
|
535 | |||
520 | return finalSts |
|
536 | return finalSts | |
521 |
|
537 | |||
522 | def close(self): |
|
538 | def close(self): | |
523 |
|
539 | |||
524 | for opConfObj in self.opConfObjList: |
|
540 | for opConfObj in self.opConfObjList: | |
525 | if opConfObj.type == 'self': |
|
541 | if opConfObj.type == 'self': | |
526 | continue |
|
542 | continue | |
527 |
|
543 | |||
528 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
544 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) | |
529 | opObj.close() |
|
545 | opObj.close() | |
530 |
|
546 | |||
531 | self.procUnitObj.close() |
|
547 | self.procUnitObj.close() | |
532 |
|
548 | |||
533 | return |
|
549 | return | |
534 |
|
550 | |||
535 | class ReadUnitConf(ProcUnitConf): |
|
551 | class ReadUnitConf(ProcUnitConf): | |
536 |
|
552 | |||
537 | path = None |
|
553 | path = None | |
538 | startDate = None |
|
554 | startDate = None | |
539 | endDate = None |
|
555 | endDate = None | |
540 | startTime = None |
|
556 | startTime = None | |
541 | endTime = None |
|
557 | endTime = None | |
542 |
|
558 | |||
543 | ELEMENTNAME = 'ReadUnit' |
|
559 | ELEMENTNAME = 'ReadUnit' | |
544 |
|
560 | |||
545 | def __init__(self): |
|
561 | def __init__(self): | |
546 |
|
562 | |||
547 | self.id = None |
|
563 | self.id = None | |
548 | self.datatype = None |
|
564 | self.datatype = None | |
549 | self.name = None |
|
565 | self.name = None | |
550 | self.inputId = 0 |
|
566 | self.inputId = 0 | |
551 |
|
567 | |||
552 | self.opConfObjList = [] |
|
568 | self.opConfObjList = [] | |
553 | self.opObjList = [] |
|
569 | self.opObjList = [] | |
554 |
|
570 | |||
555 | def getElementName(self): |
|
571 | def getElementName(self): | |
556 |
|
572 | |||
557 | return self.ELEMENTNAME |
|
573 | return self.ELEMENTNAME | |
558 |
|
574 | |||
559 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
575 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): | |
560 |
|
576 | |||
561 | self.id = id |
|
577 | self.id = id | |
562 | self.name = name |
|
578 | self.name = name | |
563 | self.datatype = datatype |
|
579 | self.datatype = datatype | |
564 |
|
580 | |||
565 | self.path = path |
|
581 | self.path = path | |
566 | self.startDate = startDate |
|
582 | self.startDate = startDate | |
567 | self.endDate = endDate |
|
583 | self.endDate = endDate | |
568 | self.startTime = startTime |
|
584 | self.startTime = startTime | |
569 | self.endTime = endTime |
|
585 | self.endTime = endTime | |
570 |
|
586 | |||
571 | self.addRunOperation(**kwargs) |
|
587 | self.addRunOperation(**kwargs) | |
572 |
|
588 | |||
573 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, **kwargs): |
|
589 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, **kwargs): | |
574 |
|
590 | |||
575 | self.datatype = datatype |
|
591 | self.datatype = datatype | |
576 | self.path = path |
|
592 | self.path = path | |
577 | self.startDate = startDate |
|
593 | self.startDate = startDate | |
578 | self.endDate = endDate |
|
594 | self.endDate = endDate | |
579 | self.startTime = startTime |
|
595 | self.startTime = startTime | |
580 | self.endTime = endTime |
|
596 | self.endTime = endTime | |
581 |
|
597 | |||
582 | self.updateRunOperation(**kwargs) |
|
598 | self.updateRunOperation(**kwargs) | |
583 |
|
599 | |||
584 | def addRunOperation(self, **kwargs): |
|
600 | def addRunOperation(self, **kwargs): | |
585 |
|
601 | |||
586 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
602 | opObj = self.addOperation(name = 'run', optype = 'self') | |
587 |
|
603 | |||
588 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
604 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
589 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
605 | opObj.addParameter(name='path' , value=self.path, format='str') | |
590 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
606 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
591 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
607 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
592 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
608 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
593 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
609 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
594 |
|
610 | |||
595 | for key, value in kwargs.items(): |
|
611 | for key, value in kwargs.items(): | |
596 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
612 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
597 |
|
613 | |||
598 | return opObj |
|
614 | return opObj | |
599 |
|
615 | |||
600 | def updateRunOperation(self, **kwargs): |
|
616 | def updateRunOperation(self, **kwargs): | |
601 |
|
617 | |||
602 | opObj = self.getOperationObj(name = 'run') |
|
618 | opObj = self.getOperationObj(name = 'run') | |
603 | opObj.removeParameters() |
|
619 | opObj.removeParameters() | |
604 |
|
620 | |||
605 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
621 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
606 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
622 | opObj.addParameter(name='path' , value=self.path, format='str') | |
607 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
623 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
608 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
624 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
609 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
625 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
610 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
626 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
611 |
|
627 | |||
612 | for key, value in kwargs.items(): |
|
628 | for key, value in kwargs.items(): | |
613 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
629 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
614 |
|
630 | |||
615 | return opObj |
|
631 | return opObj | |
616 |
|
632 | |||
617 | class Project(): |
|
633 | class Project(): | |
618 |
|
634 | |||
619 | id = None |
|
635 | id = None | |
620 | name = None |
|
636 | name = None | |
621 | description = None |
|
637 | description = None | |
622 | # readUnitConfObjList = None |
|
638 | # readUnitConfObjList = None | |
623 | procUnitConfObjDict = None |
|
639 | procUnitConfObjDict = None | |
624 |
|
640 | |||
625 | ELEMENTNAME = 'Project' |
|
641 | ELEMENTNAME = 'Project' | |
626 |
|
642 | |||
627 | def __init__(self, control=None, dataq=None): |
|
643 | def __init__(self, control=None, dataq=None): | |
628 |
|
644 | |||
629 | self.id = None |
|
645 | self.id = None | |
630 | self.name = None |
|
646 | self.name = None | |
631 | self.description = None |
|
647 | self.description = None | |
632 |
|
648 | |||
633 | self.procUnitConfObjDict = {} |
|
649 | self.procUnitConfObjDict = {} | |
634 |
|
650 | |||
635 | #global data_q |
|
651 | #global data_q | |
636 | #data_q = dataq |
|
652 | #data_q = dataq | |
637 |
|
653 | |||
638 | if control==None: |
|
654 | if control==None: | |
639 | control = {} |
|
655 | control = {} | |
640 | control['stop'] = False |
|
656 | control['stop'] = False | |
641 | control['pause'] = False |
|
657 | control['pause'] = False | |
642 |
|
658 | |||
643 | self.control = control |
|
659 | self.control = control | |
644 |
|
660 | |||
645 | def __getNewId(self): |
|
661 | def __getNewId(self): | |
646 |
|
662 | |||
647 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
663 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 | |
648 |
|
664 | |||
649 | return str(id) |
|
665 | return str(id) | |
650 |
|
666 | |||
651 | def getElementName(self): |
|
667 | def getElementName(self): | |
652 |
|
668 | |||
653 | return self.ELEMENTNAME |
|
669 | return self.ELEMENTNAME | |
654 |
|
670 | |||
655 | def getId(self): |
|
671 | def getId(self): | |
656 |
|
672 | |||
657 | return self.id |
|
673 | return self.id | |
658 |
|
674 | |||
659 | def setup(self, id, name, description): |
|
675 | def setup(self, id, name, description): | |
660 |
|
676 | |||
661 | self.id = id |
|
677 | self.id = id | |
662 | self.name = name |
|
678 | self.name = name | |
663 | self.description = description |
|
679 | self.description = description | |
664 |
|
680 | |||
665 | def update(self, name, description): |
|
681 | def update(self, name, description): | |
666 |
|
682 | |||
667 | self.name = name |
|
683 | self.name = name | |
668 | self.description = description |
|
684 | self.description = description | |
669 |
|
685 | |||
670 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
686 | def addReadUnit(self, datatype=None, name=None, **kwargs): | |
671 |
|
687 | |||
672 | #Compatible with old signal chain version |
|
688 | #Compatible with old signal chain version | |
673 | if datatype==None and name==None: |
|
689 | if datatype==None and name==None: | |
674 | raise ValueError, "datatype or name should be defined" |
|
690 | raise ValueError, "datatype or name should be defined" | |
675 |
|
691 | |||
676 | if name==None: |
|
692 | if name==None: | |
677 | if 'Reader' in datatype: |
|
693 | if 'Reader' in datatype: | |
678 | name = datatype |
|
694 | name = datatype | |
679 | else: |
|
695 | else: | |
680 | name = '%sReader' %(datatype) |
|
696 | name = '%sReader' %(datatype) | |
681 |
|
697 | |||
682 | if datatype==None: |
|
698 | if datatype==None: | |
683 | datatype = name.replace('Reader','') |
|
699 | datatype = name.replace('Reader','') | |
684 |
|
700 | |||
685 | id = self.__getNewId() |
|
701 | id = self.__getNewId() | |
686 |
|
702 | |||
687 | readUnitConfObj = ReadUnitConf() |
|
703 | readUnitConfObj = ReadUnitConf() | |
688 | readUnitConfObj.setup(id, name, datatype, parentId=self.id, **kwargs) |
|
704 | readUnitConfObj.setup(id, name, datatype, parentId=self.id, **kwargs) | |
689 |
|
705 | |||
690 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
706 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
691 |
|
707 | |||
692 | return readUnitConfObj |
|
708 | return readUnitConfObj | |
693 |
|
709 | |||
694 | def addProcUnit(self, inputId=0, datatype=None, name=None): |
|
710 | def addProcUnit(self, inputId=0, datatype=None, name=None): | |
695 |
|
711 | |||
696 | #Compatible with old signal chain version |
|
712 | #Compatible with old signal chain version | |
697 | if datatype==None and name==None: |
|
713 | if datatype==None and name==None: | |
698 | raise ValueError, "datatype or name should be defined" |
|
714 | raise ValueError, "datatype or name should be defined" | |
699 |
|
715 | |||
700 | if name==None: |
|
716 | if name==None: | |
701 | if 'Proc' in datatype: |
|
717 | if 'Proc' in datatype: | |
702 | name = datatype |
|
718 | name = datatype | |
703 | else: |
|
719 | else: | |
704 | name = '%sProc' %(datatype) |
|
720 | name = '%sProc' %(datatype) | |
705 |
|
721 | |||
706 | if datatype==None: |
|
722 | if datatype==None: | |
707 | datatype = name.replace('Proc','') |
|
723 | datatype = name.replace('Proc','') | |
708 |
|
724 | |||
709 | id = self.__getNewId() |
|
725 | id = self.__getNewId() | |
710 |
|
726 | |||
711 | procUnitConfObj = ProcUnitConf() |
|
727 | procUnitConfObj = ProcUnitConf() | |
712 | procUnitConfObj.setup(id, name, datatype, inputId, parentId=self.id) |
|
728 | procUnitConfObj.setup(id, name, datatype, inputId, parentId=self.id) | |
713 |
|
729 | |||
714 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
730 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
715 |
|
731 | |||
716 | return procUnitConfObj |
|
732 | return procUnitConfObj | |
717 |
|
733 | |||
718 | def getReadUnitId(self): |
|
734 | def getReadUnitId(self): | |
719 |
|
735 | |||
720 | readUnitConfObj = self.getReadUnitObj() |
|
736 | readUnitConfObj = self.getReadUnitObj() | |
721 |
|
737 | |||
722 | return readUnitConfObj.id |
|
738 | return readUnitConfObj.id | |
723 |
|
739 | |||
724 | def getReadUnitObj(self): |
|
740 | def getReadUnitObj(self): | |
725 |
|
741 | |||
726 | for obj in self.procUnitConfObjDict.values(): |
|
742 | for obj in self.procUnitConfObjDict.values(): | |
727 | if obj.getElementName() == "ReadUnit": |
|
743 | if obj.getElementName() == "ReadUnit": | |
728 | return obj |
|
744 | return obj | |
729 |
|
745 | |||
730 | return None |
|
746 | return None | |
731 |
|
747 | |||
732 | def getProcUnitObj(self, id): |
|
748 | def getProcUnitObj(self, id): | |
733 |
|
749 | |||
734 | return self.procUnitConfObjDict[id] |
|
750 | return self.procUnitConfObjDict[id] | |
735 |
|
751 | |||
736 | def getProcUnitObjByName(self, name): |
|
752 | def getProcUnitObjByName(self, name): | |
737 |
|
753 | |||
738 | for obj in self.procUnitConfObjDict.values(): |
|
754 | for obj in self.procUnitConfObjDict.values(): | |
739 | if obj.name == name: |
|
755 | if obj.name == name: | |
740 | return obj |
|
756 | return obj | |
741 |
|
757 | |||
742 | return None |
|
758 | return None | |
743 |
|
759 | |||
744 | def makeXml(self): |
|
760 | def makeXml(self): | |
745 |
|
761 | |||
746 | projectElement = Element('Project') |
|
762 | projectElement = Element('Project') | |
747 | projectElement.set('id', str(self.id)) |
|
763 | projectElement.set('id', str(self.id)) | |
748 | projectElement.set('name', self.name) |
|
764 | projectElement.set('name', self.name) | |
749 | projectElement.set('description', self.description) |
|
765 | projectElement.set('description', self.description) | |
750 |
|
766 | |||
751 | # for readUnitConfObj in self.readUnitConfObjList: |
|
767 | # for readUnitConfObj in self.readUnitConfObjList: | |
752 | # readUnitConfObj.makeXml(projectElement) |
|
768 | # readUnitConfObj.makeXml(projectElement) | |
753 |
|
769 | |||
754 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
770 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
755 | procUnitConfObj.makeXml(projectElement) |
|
771 | procUnitConfObj.makeXml(projectElement) | |
756 |
|
772 | |||
757 | self.projectElement = projectElement |
|
773 | self.projectElement = projectElement | |
758 |
|
774 | |||
759 | def writeXml(self, filename): |
|
775 | def writeXml(self, filename): | |
760 |
|
776 | |||
761 | self.makeXml() |
|
777 | self.makeXml() | |
762 |
|
778 | |||
763 | #print prettify(self.projectElement) |
|
779 | #print prettify(self.projectElement) | |
764 |
|
780 | |||
765 | ElementTree(self.projectElement).write(filename, method='xml') |
|
781 | ElementTree(self.projectElement).write(filename, method='xml') | |
766 |
|
782 | |||
767 | def readXml(self, filename): |
|
783 | def readXml(self, filename): | |
768 |
|
784 | |||
769 | #tree = ET.parse(filename) |
|
785 | #tree = ET.parse(filename) | |
770 | self.projectElement = None |
|
786 | self.projectElement = None | |
771 | # self.readUnitConfObjList = [] |
|
787 | # self.readUnitConfObjList = [] | |
772 | self.procUnitConfObjDict = {} |
|
788 | self.procUnitConfObjDict = {} | |
773 |
|
789 | |||
774 | self.projectElement = ElementTree().parse(filename) |
|
790 | self.projectElement = ElementTree().parse(filename) | |
775 |
|
791 | |||
776 | self.project = self.projectElement.tag |
|
792 | self.project = self.projectElement.tag | |
777 |
|
793 | |||
778 | self.id = self.projectElement.get('id') |
|
794 | self.id = self.projectElement.get('id') | |
779 | self.name = self.projectElement.get('name') |
|
795 | self.name = self.projectElement.get('name') | |
780 | self.description = self.projectElement.get('description') |
|
796 | self.description = self.projectElement.get('description') | |
781 |
|
797 | |||
782 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
798 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) | |
783 |
|
799 | |||
784 | for readUnitElement in readUnitElementList: |
|
800 | for readUnitElement in readUnitElementList: | |
785 | readUnitConfObj = ReadUnitConf() |
|
801 | readUnitConfObj = ReadUnitConf() | |
786 | readUnitConfObj.readXml(readUnitElement) |
|
802 | readUnitConfObj.readXml(readUnitElement) | |
787 |
|
803 | |||
788 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
804 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
789 |
|
805 | |||
790 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
806 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) | |
791 |
|
807 | |||
792 | for procUnitElement in procUnitElementList: |
|
808 | for procUnitElement in procUnitElementList: | |
793 | procUnitConfObj = ProcUnitConf() |
|
809 | procUnitConfObj = ProcUnitConf() | |
794 | procUnitConfObj.readXml(procUnitElement) |
|
810 | procUnitConfObj.readXml(procUnitElement) | |
795 |
|
811 | |||
796 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
812 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
797 |
|
813 | |||
798 | def printattr(self): |
|
814 | def printattr(self): | |
799 |
|
815 | |||
800 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
816 | print "Project[%s]: name = %s, description = %s" %(self.id, | |
801 | self.name, |
|
817 | self.name, | |
802 | self.description) |
|
818 | self.description) | |
803 |
|
819 | |||
804 | # for readUnitConfObj in self.readUnitConfObjList: |
|
820 | # for readUnitConfObj in self.readUnitConfObjList: | |
805 | # readUnitConfObj.printattr() |
|
821 | # readUnitConfObj.printattr() | |
806 |
|
822 | |||
807 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
823 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
808 | procUnitConfObj.printattr() |
|
824 | procUnitConfObj.printattr() | |
809 |
|
825 | |||
810 | def createObjects(self): |
|
826 | def createObjects(self): | |
811 |
|
827 | |||
812 | # for readUnitConfObj in self.readUnitConfObjList: |
|
828 | # for readUnitConfObj in self.readUnitConfObjList: | |
813 | # readUnitConfObj.createObjects() |
|
829 | # readUnitConfObj.createObjects() | |
814 |
|
830 | |||
815 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
831 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
816 | procUnitConfObj.createObjects() |
|
832 | procUnitConfObj.createObjects() | |
817 |
|
833 | |||
818 | def __connect(self, objIN, thisObj): |
|
834 | def __connect(self, objIN, thisObj): | |
819 |
|
835 | |||
820 | thisObj.setInput(objIN.getOutputObj()) |
|
836 | thisObj.setInput(objIN.getOutputObj()) | |
821 |
|
837 | |||
822 | def connectObjects(self): |
|
838 | def connectObjects(self): | |
823 |
|
839 | |||
824 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
840 | for thisPUConfObj in self.procUnitConfObjDict.values(): | |
825 |
|
841 | |||
826 | inputId = thisPUConfObj.getInputId() |
|
842 | inputId = thisPUConfObj.getInputId() | |
827 |
|
843 | |||
828 | if int(inputId) == 0: |
|
844 | if int(inputId) == 0: | |
829 | continue |
|
845 | continue | |
830 |
|
846 | |||
831 | #Get input object |
|
847 | #Get input object | |
832 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
848 | puConfINObj = self.procUnitConfObjDict[inputId] | |
833 | puObjIN = puConfINObj.getProcUnitObj() |
|
849 | puObjIN = puConfINObj.getProcUnitObj() | |
834 |
|
850 | |||
835 | #Get current object |
|
851 | #Get current object | |
836 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
852 | thisPUObj = thisPUConfObj.getProcUnitObj() | |
837 |
|
853 | |||
838 | self.__connect(puObjIN, thisPUObj) |
|
854 | self.__connect(puObjIN, thisPUObj) | |
839 |
|
855 | |||
840 | def run(self): |
|
856 | def run(self): | |
841 |
|
857 | |||
842 | # for readUnitConfObj in self.readUnitConfObjList: |
|
858 | # for readUnitConfObj in self.readUnitConfObjList: | |
843 | # readUnitConfObj.run() |
|
859 | # readUnitConfObj.run() | |
844 |
|
860 | |||
845 | print "*"*40 |
|
861 | print "*"*40 | |
846 | print " Starting SIGNAL CHAIN PROCESSING " |
|
862 | print " Starting SIGNAL CHAIN PROCESSING " | |
847 | print "*"*40 |
|
863 | print "*"*40 | |
848 |
|
864 | |||
849 |
|
865 | |||
850 | keyList = self.procUnitConfObjDict.keys() |
|
866 | keyList = self.procUnitConfObjDict.keys() | |
851 | keyList.sort() |
|
867 | keyList.sort() | |
852 |
|
868 | |||
853 | while(True): |
|
869 | while(True): | |
854 |
|
870 | |||
855 | finalSts = False |
|
871 | finalSts = False | |
856 |
|
872 | |||
857 | for procKey in keyList: |
|
873 | for procKey in keyList: | |
858 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
874 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) | |
859 |
|
875 | |||
860 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
876 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
861 | sts = procUnitConfObj.run() |
|
877 | sts = procUnitConfObj.run() | |
862 | finalSts = finalSts or sts |
|
878 | finalSts = finalSts or sts | |
863 |
|
879 | |||
864 | #If every process unit finished so end process |
|
880 | #If every process unit finished so end process | |
865 | if not(finalSts): |
|
881 | if not(finalSts): | |
866 | print "Every process unit have finished" |
|
882 | print "Every process unit have finished" | |
867 | break |
|
883 | break | |
868 |
|
884 | |||
869 | if self.control['pause']: |
|
885 | if self.control['pause']: | |
870 |
print "P |
|
886 | print "Process suspended" | |
871 |
|
887 | |||
872 | while True: |
|
888 | while True: | |
873 | time.sleep(0.1) |
|
889 | time.sleep(0.1) | |
874 |
|
890 | |||
875 | if not self.control['pause']: |
|
891 | if not self.control['pause']: | |
876 | break |
|
892 | break | |
877 |
|
893 | |||
878 | if self.control['stop']: |
|
894 | if self.control['stop']: | |
879 | break |
|
895 | break | |
|
896 | print "Process reinitialized" | |||
880 |
|
897 | |||
881 | if self.control['stop']: |
|
898 | if self.control['stop']: | |
882 | print "Stopping process" |
|
899 | print "Stopping process" | |
883 | break |
|
900 | break | |
884 |
|
901 | |||
885 | #Closing every process |
|
902 | #Closing every process | |
886 | for procKey in keyList: |
|
903 | for procKey in keyList: | |
887 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
904 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
888 | procUnitConfObj.close() |
|
905 | procUnitConfObj.close() | |
889 |
|
906 | |||
890 | print "Process stopped" |
|
907 | print "Process stopped" | |
891 |
|
908 | |||
892 | def start(self, filename): |
|
909 | def start(self, filename): | |
893 |
|
910 | |||
894 | self.writeXml(filename) |
|
911 | self.writeXml(filename) | |
895 | self.readXml(filename) |
|
912 | self.readXml(filename) | |
896 |
|
913 | |||
897 | self.createObjects() |
|
914 | self.createObjects() | |
898 | self.connectObjects() |
|
915 | self.connectObjects() | |
899 | self.run() |
|
916 | self.run() | |
900 |
|
917 | |||
901 | if __name__ == '__main__': |
|
918 | if __name__ == '__main__': | |
902 |
|
919 | |||
903 | desc = "Segundo Test" |
|
920 | desc = "Segundo Test" | |
904 | filename = "schain.xml" |
|
921 | filename = "schain.xml" | |
905 |
|
922 | |||
906 | controllerObj = Project() |
|
923 | controllerObj = Project() | |
907 |
|
924 | |||
908 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
925 | controllerObj.setup(id = '191', name='test01', description=desc) | |
909 |
|
926 | |||
910 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
927 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
911 | path='data/rawdata/', |
|
928 | path='data/rawdata/', | |
912 | startDate='2011/01/01', |
|
929 | startDate='2011/01/01', | |
913 | endDate='2012/12/31', |
|
930 | endDate='2012/12/31', | |
914 | startTime='00:00:00', |
|
931 | startTime='00:00:00', | |
915 | endTime='23:59:59', |
|
932 | endTime='23:59:59', | |
916 | online=1, |
|
933 | online=1, | |
917 | walk=1) |
|
934 | walk=1) | |
918 |
|
935 | |||
919 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') |
|
936 | # opObj00 = readUnitConfObj.addOperation(name='printInfo') | |
920 |
|
937 | |||
921 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
938 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
922 |
|
939 | |||
923 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
940 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') | |
924 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
941 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') | |
925 |
|
942 | |||
926 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
943 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') | |
927 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
944 | opObj10.addParameter(name='minHei', value='90', format='float') | |
928 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
945 | opObj10.addParameter(name='maxHei', value='180', format='float') | |
929 |
|
946 | |||
930 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
947 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |
931 | opObj12.addParameter(name='n', value='10', format='int') |
|
948 | opObj12.addParameter(name='n', value='10', format='int') | |
932 |
|
949 | |||
933 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
950 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
934 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
951 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') | |
935 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
952 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') | |
936 |
|
953 | |||
937 |
|
954 | |||
938 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
955 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
939 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
956 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
940 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
957 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
941 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
958 | opObj11.addParameter(name='zmin', value='40', format='int') | |
942 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
959 | opObj11.addParameter(name='zmax', value='90', format='int') | |
943 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
960 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
944 |
|
961 | |||
945 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') |
|
962 | # opObj11 = procUnitConfObj1.addOperation(name='CrossSpectraPlot', optype='external') | |
946 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
963 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
947 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') |
|
964 | # opObj11.addParameter(name='wintitle', value='CrossSpectraPlot', format='str') | |
948 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
965 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
949 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
966 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
950 |
|
967 | |||
951 |
|
968 | |||
952 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) |
|
969 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Voltage', inputId=procUnitConfObj0.getId()) | |
953 | # |
|
970 | # | |
954 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') |
|
971 | # opObj12 = procUnitConfObj2.addOperation(name='CohInt', optype='external') | |
955 | # opObj12.addParameter(name='n', value='2', format='int') |
|
972 | # opObj12.addParameter(name='n', value='2', format='int') | |
956 | # opObj12.addParameter(name='overlapping', value='1', format='int') |
|
973 | # opObj12.addParameter(name='overlapping', value='1', format='int') | |
957 | # |
|
974 | # | |
958 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) |
|
975 | # procUnitConfObj3 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj2.getId()) | |
959 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') |
|
976 | # procUnitConfObj3.addParameter(name='nFFTPoints', value='32', format='int') | |
960 | # |
|
977 | # | |
961 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') |
|
978 | # opObj11 = procUnitConfObj3.addOperation(name='SpectraPlot', optype='external') | |
962 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
979 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
963 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') |
|
980 | # opObj11.addParameter(name='wintitle', value='SpectraPlot1', format='str') | |
964 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
981 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
965 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
982 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
966 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
983 | # opObj11.addParameter(name='showprofile', value='1', format='int') | |
967 |
|
984 | |||
968 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') |
|
985 | # opObj11 = procUnitConfObj1.addOperation(name='RTIPlot', optype='external') | |
969 | # opObj11.addParameter(name='idfigure', value='10', format='int') |
|
986 | # opObj11.addParameter(name='idfigure', value='10', format='int') | |
970 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') |
|
987 | # opObj11.addParameter(name='wintitle', value='RTI', format='str') | |
971 | ## opObj11.addParameter(name='xmin', value='21', format='float') |
|
988 | ## opObj11.addParameter(name='xmin', value='21', format='float') | |
972 | ## opObj11.addParameter(name='xmax', value='22', format='float') |
|
989 | ## opObj11.addParameter(name='xmax', value='22', format='float') | |
973 | # opObj11.addParameter(name='zmin', value='40', format='int') |
|
990 | # opObj11.addParameter(name='zmin', value='40', format='int') | |
974 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
991 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
975 | # opObj11.addParameter(name='showprofile', value='1', format='int') |
|
992 | # opObj11.addParameter(name='showprofile', value='1', format='int') | |
976 | # opObj11.addParameter(name='timerange', value=str(60), format='int') |
|
993 | # opObj11.addParameter(name='timerange', value=str(60), format='int') | |
977 |
|
994 | |||
978 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
995 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') | |
979 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') |
|
996 | # opObj10.addParameter(name='channelList', value='0,2,4,6', format='intlist') | |
980 | # |
|
997 | # | |
981 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
998 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') | |
982 | # opObj12.addParameter(name='n', value='2', format='int') |
|
999 | # opObj12.addParameter(name='n', value='2', format='int') | |
983 | # |
|
1000 | # | |
984 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1001 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
985 | # opObj11.addParameter(name='idfigure', value='2', format='int') |
|
1002 | # opObj11.addParameter(name='idfigure', value='2', format='int') | |
986 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
1003 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') | |
987 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1004 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
988 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1005 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
989 | # |
|
1006 | # | |
990 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') |
|
1007 | # opObj10 = procUnitConfObj1.addOperation(name='selectChannels') | |
991 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') |
|
1008 | # opObj10.addParameter(name='channelList', value='2,6', format='intlist') | |
992 | # |
|
1009 | # | |
993 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') |
|
1010 | # opObj12 = procUnitConfObj1.addOperation(name='IncohInt', optype='external') | |
994 | # opObj12.addParameter(name='n', value='2', format='int') |
|
1011 | # opObj12.addParameter(name='n', value='2', format='int') | |
995 | # |
|
1012 | # | |
996 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1013 | # opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
997 | # opObj11.addParameter(name='idfigure', value='3', format='int') |
|
1014 | # opObj11.addParameter(name='idfigure', value='3', format='int') | |
998 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') |
|
1015 | # opObj11.addParameter(name='wintitle', value='SpectraPlot10', format='str') | |
999 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1016 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
1000 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1017 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1001 |
|
1018 | |||
1002 |
|
1019 | |||
1003 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') |
|
1020 | # opObj12 = procUnitConfObj1.addOperation(name='decoder') | |
1004 | # opObj12.addParameter(name='ncode', value='2', format='int') |
|
1021 | # opObj12.addParameter(name='ncode', value='2', format='int') | |
1005 | # opObj12.addParameter(name='nbauds', value='8', format='int') |
|
1022 | # opObj12.addParameter(name='nbauds', value='8', format='int') | |
1006 | # opObj12.addParameter(name='code0', value='001110011', format='int') |
|
1023 | # opObj12.addParameter(name='code0', value='001110011', format='int') | |
1007 | # opObj12.addParameter(name='code1', value='001110011', format='int') |
|
1024 | # opObj12.addParameter(name='code1', value='001110011', format='int') | |
1008 |
|
1025 | |||
1009 |
|
1026 | |||
1010 |
|
1027 | |||
1011 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) |
|
1028 | # procUnitConfObj2 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj1.getId()) | |
1012 | # |
|
1029 | # | |
1013 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') |
|
1030 | # opObj21 = procUnitConfObj2.addOperation(name='IncohInt', optype='external') | |
1014 | # opObj21.addParameter(name='n', value='2', format='int') |
|
1031 | # opObj21.addParameter(name='n', value='2', format='int') | |
1015 | # |
|
1032 | # | |
1016 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') |
|
1033 | # opObj11 = procUnitConfObj2.addOperation(name='SpectraPlot', optype='external') | |
1017 | # opObj11.addParameter(name='idfigure', value='4', format='int') |
|
1034 | # opObj11.addParameter(name='idfigure', value='4', format='int') | |
1018 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') |
|
1035 | # opObj11.addParameter(name='wintitle', value='SpectraPlot OBJ 2', format='str') | |
1019 | # opObj11.addParameter(name='zmin', value='70', format='int') |
|
1036 | # opObj11.addParameter(name='zmin', value='70', format='int') | |
1020 | # opObj11.addParameter(name='zmax', value='90', format='int') |
|
1037 | # opObj11.addParameter(name='zmax', value='90', format='int') | |
1021 |
|
1038 | |||
1022 | print "Escribiendo el archivo XML" |
|
1039 | print "Escribiendo el archivo XML" | |
1023 |
|
1040 | |||
1024 | controllerObj.writeXml(filename) |
|
1041 | controllerObj.writeXml(filename) | |
1025 |
|
1042 | |||
1026 | print "Leyendo el archivo XML" |
|
1043 | print "Leyendo el archivo XML" | |
1027 | controllerObj.readXml(filename) |
|
1044 | controllerObj.readXml(filename) | |
1028 | #controllerObj.printattr() |
|
1045 | #controllerObj.printattr() | |
1029 |
|
1046 | |||
1030 | controllerObj.createObjects() |
|
1047 | controllerObj.createObjects() | |
1031 | controllerObj.connectObjects() |
|
1048 | controllerObj.connectObjects() | |
1032 | controllerObj.run() |
|
1049 | controllerObj.run() | |
1033 |
|
1050 | |||
1034 | No newline at end of file |
|
1051 |
1 | NO CONTENT: modified file |
|
NO CONTENT: modified file | ||
The requested commit or file is too big and content was truncated. Show full diff |
@@ -1,100 +1,100 | |||||
1 | import threading |
|
1 | import threading | |
2 | import Queue |
|
2 | import Queue | |
3 | import pickle |
|
3 | from time import sleep | |
4 | import numpy, os, sys |
|
|||
5 |
|
4 | |||
6 | from schainpy.controller import Project |
|
5 | from schainpy.controller import Project | |
7 | from command import * |
|
6 | from command import * | |
8 |
|
7 | |||
9 | class ControllerThread(threading.Thread): |
|
8 | class ControllerThread(threading.Thread): | |
10 | def __init__(self, filename, data_q=None): |
|
9 | def __init__(self, filename, data_q=None): | |
11 | super(ControllerThread, self).__init__() |
|
10 | super(ControllerThread, self).__init__() | |
12 | self.filename = filename |
|
11 | self.filename = filename | |
13 | self.data_q = data_q |
|
12 | self.data_q = data_q | |
14 | self.control = {'stop':False,'pause':False} |
|
13 | self.control = {'stop':False,'pause':False} | |
15 |
|
14 | |||
16 | def stop(self): |
|
15 | def stop(self): | |
17 | self.control['stop'] = True |
|
16 | self.control['stop'] = True | |
18 |
|
17 | |||
19 | def pause(self): |
|
18 | def pause(self): | |
20 | self.control['pause'] = not(self.control['pause']) |
|
19 | self.control['pause'] = not(self.control['pause']) | |
21 |
|
20 | |||
22 | def run(self): |
|
21 | def run(self): | |
23 | self.control['stop'] = False |
|
22 | self.control['stop'] = False | |
24 | self.control['pause'] = False |
|
23 | self.control['pause'] = False | |
25 | self.controllerObj = Project(self.control, self.data_q) |
|
24 | self.controllerObj = Project(self.control, self.data_q) | |
26 | self.controllerObj.readXml(self.filename) |
|
25 | self.controllerObj.readXml(self.filename) | |
27 | self.controllerObj.createObjects() |
|
26 | self.controllerObj.createObjects() | |
28 | self.controllerObj.connectObjects() |
|
27 | self.controllerObj.connectObjects() | |
29 | self.controllerObj.run() |
|
28 | self.controllerObj.run() | |
30 |
|
29 | |||
31 | class CommCtrlProcessThread(threading.Thread): |
|
30 | class CommCtrlProcessThread(threading.Thread): | |
32 | """ Implements the threading.Thread interface (start, join, etc.) and |
|
31 | """ Implements the threading.Thread interface (start, join, etc.) and | |
33 | can be controlled via the cmd_q Queue attribute. Replies are placed in |
|
32 | can be controlled via the cmd_q Queue attribute. Replies are placed in | |
34 | the reply_q Queue attribute. |
|
33 | the reply_q Queue attribute. | |
35 | """ |
|
34 | """ | |
36 | def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()): |
|
35 | def __init__(self, cmd_q=Queue.Queue(), reply_q=Queue.Queue()): | |
37 | super(CommCtrlProcessThread, self).__init__() |
|
36 | super(CommCtrlProcessThread, self).__init__() | |
38 | self.cmd_q = cmd_q |
|
37 | self.cmd_q = cmd_q | |
39 | # self.reply_q = reply_q |
|
38 | # self.reply_q = reply_q | |
40 |
|
39 | |||
41 | # self.print_q = Queue.Queue() |
|
40 | # self.print_q = Queue.Queue() | |
42 | # self.data_q = Queue.Queue() |
|
41 | # self.data_q = Queue.Queue() | |
43 |
|
42 | |||
44 |
|
43 | |||
45 | self.alive = threading.Event() |
|
44 | self.alive = threading.Event() | |
46 | self.setDaemon(True) |
|
45 | self.setDaemon(True) | |
47 | self.alive.set() |
|
46 | self.alive.set() | |
48 | self.socket = None |
|
47 | self.socket = None | |
49 |
|
48 | |||
50 | self.socketIO = None |
|
49 | self.socketIO = None | |
51 | self.mySocket = None |
|
50 | self.mySocket = None | |
52 |
|
51 | |||
53 |
|
52 | |||
54 | self.handlers = { |
|
53 | self.handlers = { | |
55 | ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD, |
|
54 | ProcessCommand.PROCESS: self._handle_ioPROCESSTHREAD, | |
56 | ProcessCommand.MESSAGE: self._handle_ioMESSAGE, |
|
55 | ProcessCommand.MESSAGE: self._handle_ioMESSAGE, | |
57 | ProcessCommand.DATA: self._handle_ioDATA, |
|
56 | ProcessCommand.DATA: self._handle_ioDATA, | |
58 | ProcessCommand.STOP: self._handle_ioSTOP, |
|
57 | ProcessCommand.STOP: self._handle_ioSTOP, | |
59 | ProcessCommand.PAUSE: self._handle_ioPAUSE |
|
58 | ProcessCommand.PAUSE: self._handle_ioPAUSE | |
60 | } |
|
59 | } | |
61 |
|
60 | |||
62 | def run(self): |
|
61 | def run(self): | |
63 |
|
62 | |||
64 | while self.alive.isSet(): |
|
63 | while self.alive.isSet(): | |
65 | try: |
|
64 | try: | |
66 | cmd = self.cmd_q.get(True, 0.1) |
|
65 | cmd = self.cmd_q.get(True, 0.1) | |
67 | self.handlers[cmd.type](cmd) |
|
66 | self.handlers[cmd.type](cmd) | |
68 | except Queue.Empty as e: |
|
67 | except Queue.Empty as e: | |
|
68 | sleep(0.1) | |||
69 | continue |
|
69 | continue | |
70 |
|
70 | |||
71 |
|
71 | |||
72 | def _handle_ioPROCESSTHREAD(self, cmd): |
|
72 | def _handle_ioPROCESSTHREAD(self, cmd): | |
73 | filename = cmd.data |
|
73 | filename = cmd.data | |
74 | self.controllerObj = ControllerThread(filename=filename) |
|
74 | self.controllerObj = ControllerThread(filename=filename) | |
75 | self.controllerObj.start() |
|
75 | self.controllerObj.start() | |
76 |
|
76 | |||
77 | def _handle_ioPAUSE(self, cmd): |
|
77 | def _handle_ioPAUSE(self, cmd): | |
78 | self.controllerObj.pause() |
|
78 | self.controllerObj.pause() | |
79 |
|
79 | |||
80 | def _handle_ioSTOP(self, cmd): |
|
80 | def _handle_ioSTOP(self, cmd): | |
81 | self.controllerObj.stop() |
|
81 | self.controllerObj.stop() | |
82 |
|
82 | |||
83 | def _handle_ioDATA(self, cmd): |
|
83 | def _handle_ioDATA(self, cmd): | |
84 | self.reply_q.put(self._success_reply_data(data=cmd.data)) |
|
84 | self.reply_q.put(self._success_reply_data(data=cmd.data)) | |
85 |
|
85 | |||
86 | def _handle_ioMESSAGE(self, cmd): |
|
86 | def _handle_ioMESSAGE(self, cmd): | |
87 | self.reply_q.put(self._success_reply_message(data=cmd.data)) |
|
87 | self.reply_q.put(self._success_reply_message(data=cmd.data)) | |
88 |
|
88 | |||
89 | def _success_reply_data(self, data=None): |
|
89 | def _success_reply_data(self, data=None): | |
90 | return ClientReply(ClientReply.DATA, data) |
|
90 | return ClientReply(ClientReply.DATA, data) | |
91 |
|
91 | |||
92 | def _success_reply_message(self, data=None): |
|
92 | def _success_reply_message(self, data=None): | |
93 | return ClientReply(ClientReply.MESSAGE, data) |
|
93 | return ClientReply(ClientReply.MESSAGE, data) | |
94 |
|
94 | |||
95 | def join(self, timeout=None): |
|
95 | def join(self, timeout=None): | |
96 | self.alive.clear() |
|
96 | self.alive.clear() | |
97 | threading.Thread.join(self, timeout) |
|
97 | threading.Thread.join(self, timeout) | |
98 |
|
98 | |||
99 |
|
99 | |||
100 | No newline at end of file |
|
100 |
This diff has been collapsed as it changes many lines, (1286 lines changed) Show them Hide them | |||||
@@ -1,1537 +1,311 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 |
|
2 | |||
3 | # Form implementation generated from reading ui file '/home/alex/ui/MainWindow_21_02_13_v49.ui' |
|
3 | # Form implementation generated from reading ui file '/home/alex/ui/MainWindow_21_02_13_v49.ui' | |
4 | # |
|
4 | # | |
5 | # Created: Mon Mar 24 13:28:36 2014 |
|
5 | # Created: Mon Mar 24 13:28:36 2014 | |
6 | # by: PyQt4 UI code generator 4.10 |
|
6 | # by: PyQt4 UI code generator 4.10 | |
7 | # |
|
7 | # | |
8 | # WARNING! All changes made in this file will be lost! |
|
8 | # WARNING! All changes made in this file will be lost! | |
9 |
|
9 | |||
10 | from PyQt4 import QtCore, QtGui |
|
10 | from PyQt4 import QtCore, QtGui | |
11 | from windows import * |
|
11 | from windows import * | |
12 |
|
12 | |||
13 | try: |
|
13 | try: | |
14 | _fromUtf8 = QtCore.QString.fromUtf8 |
|
14 | _fromUtf8 = QtCore.QString.fromUtf8 | |
15 | except AttributeError: |
|
15 | except AttributeError: | |
16 | def _fromUtf8(s): |
|
16 | def _fromUtf8(s): | |
17 | return s |
|
17 | return s | |
18 |
|
18 | |||
19 | try: |
|
19 | try: | |
20 | _encoding = QtGui.QApplication.UnicodeUTF8 |
|
20 | _encoding = QtGui.QApplication.UnicodeUTF8 | |
21 | def _translate(context, text, disambig): |
|
21 | def _translate(context, text, disambig): | |
22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) |
|
22 | return QtGui.QApplication.translate(context, text, disambig, _encoding) | |
23 | except AttributeError: |
|
23 | except AttributeError: | |
24 | def _translate(context, text, disambig): |
|
24 | def _translate(context, text, disambig): | |
25 | return QtGui.QApplication.translate(context, text, disambig) |
|
25 | return QtGui.QApplication.translate(context, text, disambig) | |
26 |
|
26 | |||
27 | import os |
|
27 | import os | |
28 | from schainpy.gui.figures import tools |
|
28 | from schainpy.gui.figures import tools | |
29 |
|
29 | |||
30 | FIGURES_PATH = tools.get_path() |
|
30 | FIGURES_PATH = tools.get_path() | |
31 |
|
31 | |||
32 |
class Ui_ |
|
32 | class Ui_EnvWindow(object): | |
33 |
|
33 | paused = False | ||
34 | def setupUi(self, MainWindow): |
|
|||
35 |
|
||||
36 | MainWindow.setObjectName(_fromUtf8("MainWindow")) |
|
|||
37 | MainWindow.resize(1203, 711) |
|
|||
38 |
|
||||
39 | self.centralWidget = QtGui.QWidget(MainWindow) |
|
|||
40 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) |
|
|||
41 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) |
|
|||
42 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) |
|
|||
43 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) |
|
|||
44 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) |
|
|||
45 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) |
|
|||
46 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) |
|
|||
47 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) |
|
|||
48 | self.splitter = QtGui.QSplitter(self.splitter_2) |
|
|||
49 | self.splitter.setOrientation(QtCore.Qt.Vertical) |
|
|||
50 | self.splitter.setObjectName(_fromUtf8("splitter")) |
|
|||
51 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) |
|
|||
52 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) |
|
|||
53 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
|
|||
54 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) |
|
|||
55 |
|
||||
56 |
|
||||
57 | self.tabProject = QtGui.QWidget() |
|
|||
58 | self.tabProject.setObjectName(_fromUtf8("tabProject")) |
|
|||
59 | self.gridLayout_15 = QtGui.QGridLayout(self.tabProject) |
|
|||
60 | self.gridLayout_15.setObjectName(_fromUtf8("gridLayout_15")) |
|
|||
61 | self.frame = QtGui.QFrame(self.tabProject) |
|
|||
62 | self.frame.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
63 | self.frame.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
64 | self.frame.setObjectName(_fromUtf8("frame")) |
|
|||
65 | self.gridLayout_2 = QtGui.QGridLayout(self.frame) |
|
|||
66 | self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2")) |
|
|||
67 |
|
||||
68 | self.label = QtGui.QLabel(self.frame) |
|
|||
69 | self.label.setObjectName(_fromUtf8("label")) |
|
|||
70 | self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) |
|
|||
71 | self.proName = QtGui.QLineEdit(self.frame) |
|
|||
72 | self.proName.setObjectName(_fromUtf8("proName")) |
|
|||
73 | self.gridLayout_2.addWidget(self.proName, 0, 1, 1, 8) |
|
|||
74 | self.label_11 = QtGui.QLabel(self.frame) |
|
|||
75 | self.label_11.setObjectName(_fromUtf8("label_11")) |
|
|||
76 | self.gridLayout_2.addWidget(self.label_11, 1, 0, 1, 1) |
|
|||
77 | self.proComDataType = QtGui.QComboBox(self.frame) |
|
|||
78 | self.proComDataType.setObjectName(_fromUtf8("proComDataType")) |
|
|||
79 | self.proComDataType.addItem(_fromUtf8("")) |
|
|||
80 | self.proComDataType.addItem(_fromUtf8("")) |
|
|||
81 | self.proComDataType.addItem(_fromUtf8("")) |
|
|||
82 | self.gridLayout_2.addWidget(self.proComDataType, 1, 1, 1, 5) |
|
|||
83 | self.proDataType = QtGui.QLineEdit(self.frame) |
|
|||
84 | self.proDataType.setObjectName(_fromUtf8("proDataType")) |
|
|||
85 | self.gridLayout_2.addWidget(self.proDataType, 1, 6, 1, 3) |
|
|||
86 | self.label_15 = QtGui.QLabel(self.frame) |
|
|||
87 | self.label_15.setObjectName(_fromUtf8("label_15")) |
|
|||
88 | self.gridLayout_2.addWidget(self.label_15, 2, 0, 1, 1) |
|
|||
89 | self.proToolPath = QtGui.QToolButton(self.frame) |
|
|||
90 | self.proToolPath.setObjectName(_fromUtf8("proToolPath")) |
|
|||
91 | self.gridLayout_2.addWidget(self.proToolPath, 2, 1, 1, 1) |
|
|||
92 | self.proDataPath = QtGui.QLineEdit(self.frame) |
|
|||
93 | self.proDataPath.setObjectName(_fromUtf8("proDataPath")) |
|
|||
94 | self.gridLayout_2.addWidget(self.proDataPath, 2, 2, 1, 7) |
|
|||
95 | self.label_23 = QtGui.QLabel(self.frame) |
|
|||
96 | self.label_23.setObjectName(_fromUtf8("label_23")) |
|
|||
97 | self.gridLayout_2.addWidget(self.label_23, 3, 0, 1, 1) |
|
|||
98 | self.proComReadMode = QtGui.QComboBox(self.frame) |
|
|||
99 | self.proComReadMode.setObjectName(_fromUtf8("proComReadMode")) |
|
|||
100 | self.proComReadMode.addItem(_fromUtf8("")) |
|
|||
101 | self.proComReadMode.addItem(_fromUtf8("")) |
|
|||
102 | self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 2) |
|
|||
103 | self.label_33 = QtGui.QLabel(self.frame) |
|
|||
104 | self.label_33.setObjectName(_fromUtf8("label_33")) |
|
|||
105 | self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 2) |
|
|||
106 | self.proDelay = QtGui.QLineEdit(self.frame) |
|
|||
107 | self.proDelay.setObjectName(_fromUtf8("proDelay")) |
|
|||
108 | self.gridLayout_2.addWidget(self.proDelay, 3, 8, 1, 1) |
|
|||
109 | self.label_32 = QtGui.QLabel(self.frame) |
|
|||
110 | self.label_32.setObjectName(_fromUtf8("label_32")) |
|
|||
111 | self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1) |
|
|||
112 | self.proComWalk = QtGui.QComboBox(self.frame) |
|
|||
113 | self.proComWalk.setObjectName(_fromUtf8("proComWalk")) |
|
|||
114 | self.proComWalk.addItem(_fromUtf8("")) |
|
|||
115 | self.proComWalk.addItem(_fromUtf8("")) |
|
|||
116 | self.gridLayout_2.addWidget(self.proComWalk, 4, 1, 1, 8) |
|
|||
117 | self.proLoadButton = QtGui.QPushButton(self.frame) |
|
|||
118 | self.proLoadButton.setObjectName(_fromUtf8("proLoadButton")) |
|
|||
119 | self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9) |
|
|||
120 | self.label_10 = QtGui.QLabel(self.frame) |
|
|||
121 | self.label_10.setObjectName(_fromUtf8("label_10")) |
|
|||
122 | self.gridLayout_2.addWidget(self.label_10, 3, 3, 1, 1) |
|
|||
123 | self.proSet = QtGui.QLineEdit(self.frame) |
|
|||
124 | self.proSet.setObjectName(_fromUtf8("proSet")) |
|
|||
125 | self.gridLayout_2.addWidget(self.proSet, 3, 4, 1, 1) |
|
|||
126 | self.gridLayout_15.addWidget(self.frame, 0, 0, 1, 1) |
|
|||
127 | self.frame_2 = QtGui.QFrame(self.tabProject) |
|
|||
128 | self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
129 | self.frame_2.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
130 | self.frame_2.setObjectName(_fromUtf8("frame_2")) |
|
|||
131 | self.gridLayout_10 = QtGui.QGridLayout(self.frame_2) |
|
|||
132 | self.gridLayout_10.setObjectName(_fromUtf8("gridLayout_10")) |
|
|||
133 | self.label_27 = QtGui.QLabel(self.frame_2) |
|
|||
134 | self.label_27.setObjectName(_fromUtf8("label_27")) |
|
|||
135 | self.gridLayout_10.addWidget(self.label_27, 0, 0, 1, 1) |
|
|||
136 | self.proComStartDate = QtGui.QComboBox(self.frame_2) |
|
|||
137 | self.proComStartDate.setObjectName(_fromUtf8("proComStartDate")) |
|
|||
138 | self.gridLayout_10.addWidget(self.proComStartDate, 0, 1, 1, 1) |
|
|||
139 | self.label_28 = QtGui.QLabel(self.frame_2) |
|
|||
140 | self.label_28.setObjectName(_fromUtf8("label_28")) |
|
|||
141 | self.gridLayout_10.addWidget(self.label_28, 1, 0, 1, 1) |
|
|||
142 | self.proComEndDate = QtGui.QComboBox(self.frame_2) |
|
|||
143 | self.proComEndDate.setObjectName(_fromUtf8("proComEndDate")) |
|
|||
144 | self.gridLayout_10.addWidget(self.proComEndDate, 1, 1, 1, 1) |
|
|||
145 | self.label_2 = QtGui.QLabel(self.frame_2) |
|
|||
146 | self.label_2.setObjectName(_fromUtf8("label_2")) |
|
|||
147 | self.gridLayout_10.addWidget(self.label_2, 2, 0, 1, 1) |
|
|||
148 | self.proStartTime = QtGui.QTimeEdit(self.frame_2) |
|
|||
149 | self.proStartTime.setObjectName(_fromUtf8("proStartTime")) |
|
|||
150 | self.gridLayout_10.addWidget(self.proStartTime, 2, 1, 1, 1) |
|
|||
151 | self.label_3 = QtGui.QLabel(self.frame_2) |
|
|||
152 | self.label_3.setObjectName(_fromUtf8("label_3")) |
|
|||
153 | self.gridLayout_10.addWidget(self.label_3, 3, 0, 1, 1) |
|
|||
154 | self.proEndTime = QtGui.QTimeEdit(self.frame_2) |
|
|||
155 | self.proEndTime.setObjectName(_fromUtf8("proEndTime")) |
|
|||
156 | self.gridLayout_10.addWidget(self.proEndTime, 3, 1, 1, 1) |
|
|||
157 | self.label_30 = QtGui.QLabel(self.frame_2) |
|
|||
158 | self.label_30.setObjectName(_fromUtf8("label_30")) |
|
|||
159 | self.gridLayout_10.addWidget(self.label_30, 4, 0, 1, 1) |
|
|||
160 | self.proDescription = QtGui.QTextEdit(self.frame_2) |
|
|||
161 | self.proDescription.setObjectName(_fromUtf8("proDescription")) |
|
|||
162 | self.gridLayout_10.addWidget(self.proDescription, 4, 1, 1, 1) |
|
|||
163 | self.gridLayout_15.addWidget(self.frame_2, 1, 0, 1, 1) |
|
|||
164 | self.frame_3 = QtGui.QFrame(self.tabProject) |
|
|||
165 | self.frame_3.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
166 | self.frame_3.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
167 | self.frame_3.setObjectName(_fromUtf8("frame_3")) |
|
|||
168 | self.gridLayout_14 = QtGui.QGridLayout(self.frame_3) |
|
|||
169 | self.gridLayout_14.setObjectName(_fromUtf8("gridLayout_14")) |
|
|||
170 | self.proOk = QtGui.QPushButton(self.frame_3) |
|
|||
171 | self.proOk.setObjectName(_fromUtf8("proOk")) |
|
|||
172 | self.gridLayout_14.addWidget(self.proOk, 0, 0, 1, 1) |
|
|||
173 | self.proClear = QtGui.QPushButton(self.frame_3) |
|
|||
174 | self.proClear.setObjectName(_fromUtf8("proClear")) |
|
|||
175 | self.gridLayout_14.addWidget(self.proClear, 0, 1, 1, 1) |
|
|||
176 | self.gridLayout_15.addWidget(self.frame_3, 2, 0, 1, 1) |
|
|||
177 | self.tabWidgetProject.addTab(self.tabProject, _fromUtf8("")) |
|
|||
178 | self.tabVoltage = QtGui.QWidget() |
|
|||
179 | self.tabVoltage.setObjectName(_fromUtf8("tabVoltage")) |
|
|||
180 | self.gridLayout_3 = QtGui.QGridLayout(self.tabVoltage) |
|
|||
181 | self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3")) |
|
|||
182 | self.frame_4 = QtGui.QFrame(self.tabVoltage) |
|
|||
183 | self.frame_4.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
184 | self.frame_4.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
185 | self.frame_4.setObjectName(_fromUtf8("frame_4")) |
|
|||
186 | self.gridLayout_17 = QtGui.QGridLayout(self.frame_4) |
|
|||
187 | self.gridLayout_17.setObjectName(_fromUtf8("gridLayout_17")) |
|
|||
188 | self.volOpOk = QtGui.QPushButton(self.frame_4) |
|
|||
189 | self.volOpOk.setObjectName(_fromUtf8("volOpOk")) |
|
|||
190 | self.gridLayout_17.addWidget(self.volOpOk, 0, 0, 1, 1) |
|
|||
191 | self.volGraphClear = QtGui.QPushButton(self.frame_4) |
|
|||
192 | self.volGraphClear.setObjectName(_fromUtf8("volGraphClear")) |
|
|||
193 | self.gridLayout_17.addWidget(self.volGraphClear, 0, 1, 1, 1) |
|
|||
194 | self.gridLayout_3.addWidget(self.frame_4, 1, 1, 1, 1) |
|
|||
195 | self.tabWidgetVoltage = QtGui.QTabWidget(self.tabVoltage) |
|
|||
196 | self.tabWidgetVoltage.setObjectName(_fromUtf8("tabWidgetVoltage")) |
|
|||
197 | self.tabopVoltage = QtGui.QWidget() |
|
|||
198 | self.tabopVoltage.setObjectName(_fromUtf8("tabopVoltage")) |
|
|||
199 | self.gridLayout = QtGui.QGridLayout(self.tabopVoltage) |
|
|||
200 | self.gridLayout.setObjectName(_fromUtf8("gridLayout")) |
|
|||
201 | self.volOpHeights = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
202 | self.volOpHeights.setObjectName(_fromUtf8("volOpHeights")) |
|
|||
203 | self.gridLayout.addWidget(self.volOpHeights, 4, 4, 1, 1) |
|
|||
204 | self.volOpComHeights = QtGui.QComboBox(self.tabopVoltage) |
|
|||
205 | self.volOpComHeights.setObjectName(_fromUtf8("volOpComHeights")) |
|
|||
206 | self.volOpComHeights.addItem(_fromUtf8("")) |
|
|||
207 | self.volOpComHeights.addItem(_fromUtf8("")) |
|
|||
208 | self.gridLayout.addWidget(self.volOpComHeights, 4, 0, 1, 3) |
|
|||
209 | self.volOpComChannels = QtGui.QComboBox(self.tabopVoltage) |
|
|||
210 | self.volOpComChannels.setObjectName(_fromUtf8("volOpComChannels")) |
|
|||
211 | self.volOpComChannels.addItem(_fromUtf8("")) |
|
|||
212 | self.volOpComChannels.addItem(_fromUtf8("")) |
|
|||
213 | self.gridLayout.addWidget(self.volOpComChannels, 2, 0, 1, 3) |
|
|||
214 | self.volOpCebProfile = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
215 | self.volOpCebProfile.setObjectName(_fromUtf8("volOpCebProfile")) |
|
|||
216 | self.gridLayout.addWidget(self.volOpCebProfile, 6, 0, 1, 3) |
|
|||
217 | self.volOpComProfile = QtGui.QComboBox(self.tabopVoltage) |
|
|||
218 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) |
|
|||
219 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
|||
220 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
|||
221 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) |
|
|||
222 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
223 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) |
|
|||
224 | self.gridLayout.addWidget(self.volOpCebDecodification, 8, 0, 1, 3) |
|
|||
225 | self.volOpCebCohInt = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
226 | self.volOpCebCohInt.setObjectName(_fromUtf8("volOpCebCohInt")) |
|
|||
227 | self.gridLayout.addWidget(self.volOpCebCohInt, 11, 0, 1, 3) |
|
|||
228 | self.volOpProfile = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
229 | self.volOpProfile.setObjectName(_fromUtf8("volOpProfile")) |
|
|||
230 | self.gridLayout.addWidget(self.volOpProfile, 7, 4, 1, 1) |
|
|||
231 | self.volOpFilter = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
232 | self.volOpFilter.setObjectName(_fromUtf8("volOpFilter")) |
|
|||
233 | self.gridLayout.addWidget(self.volOpFilter, 5, 4, 1, 1) |
|
|||
234 | spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
235 | self.gridLayout.addItem(spacerItem, 6, 4, 1, 1) |
|
|||
236 | spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
237 | self.gridLayout.addItem(spacerItem1, 8, 4, 1, 1) |
|
|||
238 | spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
239 | self.gridLayout.addItem(spacerItem2, 3, 4, 1, 1) |
|
|||
240 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
241 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) |
|
|||
242 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) |
|
|||
243 | self.label_4 = QtGui.QLabel(self.tabopVoltage) |
|
|||
244 | self.label_4.setObjectName(_fromUtf8("label_4")) |
|
|||
245 | self.gridLayout.addWidget(self.label_4, 9, 2, 1, 1) |
|
|||
246 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
247 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) |
|
|||
248 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) |
|
|||
249 | self.volOpCebHeights = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
250 | self.volOpCebHeights.setObjectName(_fromUtf8("volOpCebHeights")) |
|
|||
251 | self.gridLayout.addWidget(self.volOpCebHeights, 3, 0, 1, 3) |
|
|||
252 | self.volOpCebFilter = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
253 | self.volOpCebFilter.setObjectName(_fromUtf8("volOpCebFilter")) |
|
|||
254 | self.gridLayout.addWidget(self.volOpCebFilter, 5, 0, 1, 3) |
|
|||
255 | self.volOpRadarfrequency = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
256 | self.volOpRadarfrequency.setObjectName(_fromUtf8("volOpRadarfrequency")) |
|
|||
257 | self.gridLayout.addWidget(self.volOpRadarfrequency, 0, 4, 1, 1) |
|
|||
258 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) |
|
|||
259 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) |
|
|||
260 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) |
|
|||
261 | self.label_5 = QtGui.QLabel(self.tabopVoltage) |
|
|||
262 | self.label_5.setObjectName(_fromUtf8("label_5")) |
|
|||
263 | self.gridLayout.addWidget(self.label_5, 10, 2, 1, 1) |
|
|||
264 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
265 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) |
|
|||
266 | self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage) |
|
|||
267 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) |
|
|||
268 | self.gridLayout.addWidget(self.volOpCohInt, 11, 4, 1, 1) |
|
|||
269 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) |
|
|||
270 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) |
|
|||
271 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
272 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
273 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
274 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
275 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
276 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
277 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
278 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
279 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
280 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
281 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
282 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
283 | self.volOpComCode.addItem(_fromUtf8("")) |
|
|||
284 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) |
|
|||
285 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) |
|
|||
286 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) |
|
|||
287 | self.volOpComMode.addItem(_fromUtf8("")) |
|
|||
288 | self.volOpComMode.addItem(_fromUtf8("")) |
|
|||
289 | self.gridLayout.addWidget(self.volOpComMode, 10, 4, 1, 1) |
|
|||
290 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) |
|
|||
291 | self.tabgraphVoltage = QtGui.QWidget() |
|
|||
292 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) |
|
|||
293 | self.gridLayout_6 = QtGui.QGridLayout(self.tabgraphVoltage) |
|
|||
294 | self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) |
|
|||
295 | spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
296 | self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) |
|
|||
297 | self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) |
|
|||
298 | self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) |
|
|||
299 | self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) |
|
|||
300 | self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) |
|
|||
301 | self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) |
|
|||
302 | self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) |
|
|||
303 | self.volGraphToolPath = QtGui.QToolButton(self.tabgraphVoltage) |
|
|||
304 | self.volGraphToolPath.setObjectName(_fromUtf8("volGraphToolPath")) |
|
|||
305 | self.gridLayout_6.addWidget(self.volGraphToolPath, 1, 5, 1, 2) |
|
|||
306 | self.volGraphPath = QtGui.QLineEdit(self.tabgraphVoltage) |
|
|||
307 | self.volGraphPath.setObjectName(_fromUtf8("volGraphPath")) |
|
|||
308 | self.gridLayout_6.addWidget(self.volGraphPath, 1, 1, 1, 4) |
|
|||
309 | self.label_14 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
310 | self.label_14.setObjectName(_fromUtf8("label_14")) |
|
|||
311 | self.gridLayout_6.addWidget(self.label_14, 6, 0, 1, 1) |
|
|||
312 | spacerItem5 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
313 | self.gridLayout_6.addItem(spacerItem5, 3, 3, 1, 1) |
|
|||
314 | self.label_8 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
315 | self.label_8.setObjectName(_fromUtf8("label_8")) |
|
|||
316 | self.gridLayout_6.addWidget(self.label_8, 8, 0, 1, 1) |
|
|||
317 | self.label_49 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
318 | self.label_49.setObjectName(_fromUtf8("label_49")) |
|
|||
319 | self.gridLayout_6.addWidget(self.label_49, 4, 3, 1, 1) |
|
|||
320 | self.label_51 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
321 | self.label_51.setObjectName(_fromUtf8("label_51")) |
|
|||
322 | self.gridLayout_6.addWidget(self.label_51, 9, 0, 1, 1) |
|
|||
323 | self.volGraphCebshow = QtGui.QCheckBox(self.tabgraphVoltage) |
|
|||
324 | self.volGraphCebshow.setText(_fromUtf8("")) |
|
|||
325 | self.volGraphCebshow.setObjectName(_fromUtf8("volGraphCebshow")) |
|
|||
326 | self.gridLayout_6.addWidget(self.volGraphCebshow, 6, 3, 1, 1) |
|
|||
327 | self.label_12 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
328 | self.label_12.setObjectName(_fromUtf8("label_12")) |
|
|||
329 | self.gridLayout_6.addWidget(self.label_12, 1, 0, 1, 1) |
|
|||
330 | self.label_13 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
331 | self.label_13.setObjectName(_fromUtf8("label_13")) |
|
|||
332 | self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) |
|
|||
333 | self.label_52 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
334 | self.label_52.setObjectName(_fromUtf8("label_52")) |
|
|||
335 | self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) |
|
|||
336 | spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
337 | self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) |
|
|||
338 | spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
339 | self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) |
|
|||
340 | self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) |
|
|||
341 | self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) |
|
|||
342 | self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) |
|
|||
343 | self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) |
|
|||
344 | self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) |
|
|||
345 | self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) |
|
|||
346 | self.label_50 = QtGui.QLabel(self.tabgraphVoltage) |
|
|||
347 | self.label_50.setObjectName(_fromUtf8("label_50")) |
|
|||
348 | self.gridLayout_6.addWidget(self.label_50, 4, 4, 1, 1) |
|
|||
349 | self.volGraphCebSave = QtGui.QCheckBox(self.tabgraphVoltage) |
|
|||
350 | self.volGraphCebSave.setText(_fromUtf8("")) |
|
|||
351 | self.volGraphCebSave.setObjectName(_fromUtf8("volGraphCebSave")) |
|
|||
352 | self.gridLayout_6.addWidget(self.volGraphCebSave, 6, 4, 1, 1) |
|
|||
353 | self.tabWidgetVoltage.addTab(self.tabgraphVoltage, _fromUtf8("")) |
|
|||
354 | self.taboutputVoltage = QtGui.QWidget() |
|
|||
355 | self.taboutputVoltage.setObjectName(_fromUtf8("taboutputVoltage")) |
|
|||
356 | self.gridLayout_12 = QtGui.QGridLayout(self.taboutputVoltage) |
|
|||
357 | self.gridLayout_12.setObjectName(_fromUtf8("gridLayout_12")) |
|
|||
358 | self.label_36 = QtGui.QLabel(self.taboutputVoltage) |
|
|||
359 | self.label_36.setObjectName(_fromUtf8("label_36")) |
|
|||
360 | self.gridLayout_12.addWidget(self.label_36, 0, 0, 1, 1) |
|
|||
361 | self.label_37 = QtGui.QLabel(self.taboutputVoltage) |
|
|||
362 | self.label_37.setObjectName(_fromUtf8("label_37")) |
|
|||
363 | self.gridLayout_12.addWidget(self.label_37, 1, 0, 1, 1) |
|
|||
364 | self.volOutputPath = QtGui.QLineEdit(self.taboutputVoltage) |
|
|||
365 | self.volOutputPath.setObjectName(_fromUtf8("volOutputPath")) |
|
|||
366 | self.gridLayout_12.addWidget(self.volOutputPath, 1, 2, 1, 1) |
|
|||
367 | self.volOutputToolPath = QtGui.QToolButton(self.taboutputVoltage) |
|
|||
368 | self.volOutputToolPath.setObjectName(_fromUtf8("volOutputToolPath")) |
|
|||
369 | self.gridLayout_12.addWidget(self.volOutputToolPath, 1, 3, 1, 1) |
|
|||
370 | self.volOutputComData = QtGui.QComboBox(self.taboutputVoltage) |
|
|||
371 | self.volOutputComData.setObjectName(_fromUtf8("volOutputComData")) |
|
|||
372 | self.volOutputComData.addItem(_fromUtf8("")) |
|
|||
373 | self.gridLayout_12.addWidget(self.volOutputComData, 0, 2, 1, 2) |
|
|||
374 | spacerItem8 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
375 | self.gridLayout_12.addItem(spacerItem8, 5, 2, 1, 1) |
|
|||
376 | self.volOutputblocksperfile = QtGui.QLineEdit(self.taboutputVoltage) |
|
|||
377 | self.volOutputblocksperfile.setObjectName(_fromUtf8("volOutputblocksperfile")) |
|
|||
378 | self.gridLayout_12.addWidget(self.volOutputblocksperfile, 3, 2, 1, 1) |
|
|||
379 | self.label_7 = QtGui.QLabel(self.taboutputVoltage) |
|
|||
380 | self.label_7.setObjectName(_fromUtf8("label_7")) |
|
|||
381 | self.gridLayout_12.addWidget(self.label_7, 3, 0, 1, 1) |
|
|||
382 | self.label_35 = QtGui.QLabel(self.taboutputVoltage) |
|
|||
383 | self.label_35.setObjectName(_fromUtf8("label_35")) |
|
|||
384 | self.gridLayout_12.addWidget(self.label_35, 4, 0, 1, 1) |
|
|||
385 | self.volOutputprofilesperblock = QtGui.QLineEdit(self.taboutputVoltage) |
|
|||
386 | self.volOutputprofilesperblock.setObjectName(_fromUtf8("volOutputprofilesperblock")) |
|
|||
387 | self.gridLayout_12.addWidget(self.volOutputprofilesperblock, 4, 2, 1, 1) |
|
|||
388 | self.tabWidgetVoltage.addTab(self.taboutputVoltage, _fromUtf8("")) |
|
|||
389 | self.gridLayout_3.addWidget(self.tabWidgetVoltage, 0, 1, 1, 1) |
|
|||
390 | self.tabWidgetProject.addTab(self.tabVoltage, _fromUtf8("")) |
|
|||
391 | self.tabSpectra = QtGui.QWidget() |
|
|||
392 | self.tabSpectra.setObjectName(_fromUtf8("tabSpectra")) |
|
|||
393 | self.gridLayout_7 = QtGui.QGridLayout(self.tabSpectra) |
|
|||
394 | self.gridLayout_7.setObjectName(_fromUtf8("gridLayout_7")) |
|
|||
395 | self.frame_5 = QtGui.QFrame(self.tabSpectra) |
|
|||
396 | self.frame_5.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
397 | self.frame_5.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
398 | self.frame_5.setObjectName(_fromUtf8("frame_5")) |
|
|||
399 | self.gridLayout_18 = QtGui.QGridLayout(self.frame_5) |
|
|||
400 | self.gridLayout_18.setObjectName(_fromUtf8("gridLayout_18")) |
|
|||
401 | self.specOpOk = QtGui.QPushButton(self.frame_5) |
|
|||
402 | self.specOpOk.setObjectName(_fromUtf8("specOpOk")) |
|
|||
403 | self.gridLayout_18.addWidget(self.specOpOk, 0, 0, 1, 1) |
|
|||
404 | self.specGraphClear = QtGui.QPushButton(self.frame_5) |
|
|||
405 | self.specGraphClear.setObjectName(_fromUtf8("specGraphClear")) |
|
|||
406 | self.gridLayout_18.addWidget(self.specGraphClear, 0, 1, 1, 1) |
|
|||
407 | self.gridLayout_7.addWidget(self.frame_5, 1, 1, 1, 1) |
|
|||
408 | self.tabWidgetSpectra = QtGui.QTabWidget(self.tabSpectra) |
|
|||
409 | self.tabWidgetSpectra.setObjectName(_fromUtf8("tabWidgetSpectra")) |
|
|||
410 | self.tabopSpectra = QtGui.QWidget() |
|
|||
411 | self.tabopSpectra.setObjectName(_fromUtf8("tabopSpectra")) |
|
|||
412 | self.gridLayout_5 = QtGui.QGridLayout(self.tabopSpectra) |
|
|||
413 | self.gridLayout_5.setObjectName(_fromUtf8("gridLayout_5")) |
|
|||
414 | self.specOpCebCrossSpectra = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
415 | self.specOpCebCrossSpectra.setObjectName(_fromUtf8("specOpCebCrossSpectra")) |
|
|||
416 | self.gridLayout_5.addWidget(self.specOpCebCrossSpectra, 4, 0, 1, 2) |
|
|||
417 | self.specOpComChannel = QtGui.QComboBox(self.tabopSpectra) |
|
|||
418 | self.specOpComChannel.setObjectName(_fromUtf8("specOpComChannel")) |
|
|||
419 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
|||
420 | self.specOpComChannel.addItem(_fromUtf8("")) |
|
|||
421 | self.gridLayout_5.addWidget(self.specOpComChannel, 8, 0, 1, 2) |
|
|||
422 | self.specOpChannel = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
423 | self.specOpChannel.setObjectName(_fromUtf8("specOpChannel")) |
|
|||
424 | self.gridLayout_5.addWidget(self.specOpChannel, 8, 3, 1, 2) |
|
|||
425 | self.specOpComHeights = QtGui.QComboBox(self.tabopSpectra) |
|
|||
426 | self.specOpComHeights.setObjectName(_fromUtf8("specOpComHeights")) |
|
|||
427 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
|||
428 | self.specOpComHeights.addItem(_fromUtf8("")) |
|
|||
429 | self.gridLayout_5.addWidget(self.specOpComHeights, 11, 0, 1, 2) |
|
|||
430 | self.specOpHeights = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
431 | self.specOpHeights.setObjectName(_fromUtf8("specOpHeights")) |
|
|||
432 | self.gridLayout_5.addWidget(self.specOpHeights, 11, 3, 1, 2) |
|
|||
433 | self.specOpIncoherent = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
434 | self.specOpIncoherent.setObjectName(_fromUtf8("specOpIncoherent")) |
|
|||
435 | self.gridLayout_5.addWidget(self.specOpIncoherent, 13, 3, 1, 2) |
|
|||
436 | self.specOpCebRemoveDC = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
437 | self.specOpCebRemoveDC.setObjectName(_fromUtf8("specOpCebRemoveDC")) |
|
|||
438 | self.gridLayout_5.addWidget(self.specOpCebRemoveDC, 14, 0, 1, 2) |
|
|||
439 | self.specOpCebHeights = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
440 | self.specOpCebHeights.setObjectName(_fromUtf8("specOpCebHeights")) |
|
|||
441 | self.gridLayout_5.addWidget(self.specOpCebHeights, 9, 0, 1, 1) |
|
|||
442 | self.specOpCebChannel = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
443 | self.specOpCebChannel.setObjectName(_fromUtf8("specOpCebChannel")) |
|
|||
444 | self.gridLayout_5.addWidget(self.specOpCebChannel, 7, 0, 1, 1) |
|
|||
445 | self.specOppairsList = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
446 | self.specOppairsList.setObjectName(_fromUtf8("specOppairsList")) |
|
|||
447 | self.gridLayout_5.addWidget(self.specOppairsList, 6, 3, 1, 2) |
|
|||
448 | self.specOpnFFTpoints = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
449 | self.specOpnFFTpoints.setObjectName(_fromUtf8("specOpnFFTpoints")) |
|
|||
450 | self.gridLayout_5.addWidget(self.specOpnFFTpoints, 2, 3, 1, 2) |
|
|||
451 | self.label_31 = QtGui.QLabel(self.tabopSpectra) |
|
|||
452 | self.label_31.setObjectName(_fromUtf8("label_31")) |
|
|||
453 | self.gridLayout_5.addWidget(self.label_31, 6, 0, 1, 2) |
|
|||
454 | self.label_26 = QtGui.QLabel(self.tabopSpectra) |
|
|||
455 | self.label_26.setObjectName(_fromUtf8("label_26")) |
|
|||
456 | self.gridLayout_5.addWidget(self.label_26, 2, 0, 1, 2) |
|
|||
457 | self.specOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
458 | self.specOpCebIncoherent.setObjectName(_fromUtf8("specOpCebIncoherent")) |
|
|||
459 | self.gridLayout_5.addWidget(self.specOpCebIncoherent, 12, 0, 1, 1) |
|
|||
460 | self.specOpCobIncInt = QtGui.QComboBox(self.tabopSpectra) |
|
|||
461 | self.specOpCobIncInt.setObjectName(_fromUtf8("specOpCobIncInt")) |
|
|||
462 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
|||
463 | self.specOpCobIncInt.addItem(_fromUtf8("")) |
|
|||
464 | self.gridLayout_5.addWidget(self.specOpCobIncInt, 13, 0, 1, 2) |
|
|||
465 | spacerItem9 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
466 | self.gridLayout_5.addItem(spacerItem9, 12, 3, 1, 1) |
|
|||
467 | self.specOpCebRadarfrequency = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
468 | self.specOpCebRadarfrequency.setObjectName(_fromUtf8("specOpCebRadarfrequency")) |
|
|||
469 | self.gridLayout_5.addWidget(self.specOpCebRadarfrequency, 0, 0, 1, 2) |
|
|||
470 | spacerItem10 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
471 | self.gridLayout_5.addItem(spacerItem10, 9, 3, 1, 1) |
|
|||
472 | spacerItem11 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
473 | self.gridLayout_5.addItem(spacerItem11, 7, 3, 1, 1) |
|
|||
474 | self.specOpRadarfrequency = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
475 | self.specOpRadarfrequency.setObjectName(_fromUtf8("specOpRadarfrequency")) |
|
|||
476 | self.gridLayout_5.addWidget(self.specOpRadarfrequency, 0, 3, 1, 2) |
|
|||
477 | spacerItem12 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
478 | self.gridLayout_5.addItem(spacerItem12, 4, 3, 1, 1) |
|
|||
479 | self.label_21 = QtGui.QLabel(self.tabopSpectra) |
|
|||
480 | self.label_21.setObjectName(_fromUtf8("label_21")) |
|
|||
481 | self.gridLayout_5.addWidget(self.label_21, 1, 0, 1, 1) |
|
|||
482 | self.specOpProfiles = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
483 | self.specOpProfiles.setObjectName(_fromUtf8("specOpProfiles")) |
|
|||
484 | self.gridLayout_5.addWidget(self.specOpProfiles, 1, 3, 1, 2) |
|
|||
485 | self.specOpCebRemoveInt = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
486 | self.specOpCebRemoveInt.setObjectName(_fromUtf8("specOpCebRemoveInt")) |
|
|||
487 | self.gridLayout_5.addWidget(self.specOpCebRemoveInt, 15, 0, 1, 1) |
|
|||
488 | spacerItem13 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
489 | self.gridLayout_5.addItem(spacerItem13, 15, 3, 1, 1) |
|
|||
490 | self.label_70 = QtGui.QLabel(self.tabopSpectra) |
|
|||
491 | self.label_70.setObjectName(_fromUtf8("label_70")) |
|
|||
492 | self.gridLayout_5.addWidget(self.label_70, 3, 0, 1, 1) |
|
|||
493 | self.specOpCebgetNoise = QtGui.QCheckBox(self.tabopSpectra) |
|
|||
494 | self.specOpCebgetNoise.setObjectName(_fromUtf8("specOpCebgetNoise")) |
|
|||
495 | self.gridLayout_5.addWidget(self.specOpCebgetNoise, 16, 0, 1, 1) |
|
|||
496 | self.specOpippFactor = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
497 | self.specOpippFactor.setObjectName(_fromUtf8("specOpippFactor")) |
|
|||
498 | self.gridLayout_5.addWidget(self.specOpippFactor, 3, 3, 1, 2) |
|
|||
499 | self.specOpComRemoveDC = QtGui.QComboBox(self.tabopSpectra) |
|
|||
500 | self.specOpComRemoveDC.setObjectName(_fromUtf8("specOpComRemoveDC")) |
|
|||
501 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
|||
502 | self.specOpComRemoveDC.addItem(_fromUtf8("")) |
|
|||
503 | self.gridLayout_5.addWidget(self.specOpComRemoveDC, 14, 3, 1, 2) |
|
|||
504 | self.specOpgetNoise = QtGui.QLineEdit(self.tabopSpectra) |
|
|||
505 | self.specOpgetNoise.setObjectName(_fromUtf8("specOpgetNoise")) |
|
|||
506 | self.gridLayout_5.addWidget(self.specOpgetNoise, 16, 3, 1, 2) |
|
|||
507 | self.tabWidgetSpectra.addTab(self.tabopSpectra, _fromUtf8("")) |
|
|||
508 | self.tabgraphSpectra = QtGui.QWidget() |
|
|||
509 | self.tabgraphSpectra.setObjectName(_fromUtf8("tabgraphSpectra")) |
|
|||
510 | self.gridLayout_9 = QtGui.QGridLayout(self.tabgraphSpectra) |
|
|||
511 | self.gridLayout_9.setObjectName(_fromUtf8("gridLayout_9")) |
|
|||
512 | self.label_44 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
513 | self.label_44.setObjectName(_fromUtf8("label_44")) |
|
|||
514 | self.gridLayout_9.addWidget(self.label_44, 10, 0, 1, 1) |
|
|||
515 | spacerItem14 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
516 | self.gridLayout_9.addItem(spacerItem14, 14, 2, 1, 1) |
|
|||
517 | self.label_20 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
518 | self.label_20.setObjectName(_fromUtf8("label_20")) |
|
|||
519 | self.gridLayout_9.addWidget(self.label_20, 21, 0, 1, 1) |
|
|||
520 | self.specGraphSaveRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
521 | self.specGraphSaveRTInoise.setText(_fromUtf8("")) |
|
|||
522 | self.specGraphSaveRTInoise.setObjectName(_fromUtf8("specGraphSaveRTInoise")) |
|
|||
523 | self.gridLayout_9.addWidget(self.specGraphSaveRTInoise, 13, 4, 1, 1) |
|
|||
524 | self.specGgraphmagnitud = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
525 | self.specGgraphmagnitud.setObjectName(_fromUtf8("specGgraphmagnitud")) |
|
|||
526 | self.gridLayout_9.addWidget(self.specGgraphmagnitud, 20, 1, 1, 7) |
|
|||
527 | self.specGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
528 | self.specGraphSaveSpectra.setText(_fromUtf8("")) |
|
|||
529 | self.specGraphSaveSpectra.setObjectName(_fromUtf8("specGraphSaveSpectra")) |
|
|||
530 | self.gridLayout_9.addWidget(self.specGraphSaveSpectra, 6, 4, 1, 1) |
|
|||
531 | self.specGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
532 | self.specGgraphChannelList.setObjectName(_fromUtf8("specGgraphChannelList")) |
|
|||
533 | self.gridLayout_9.addWidget(self.specGgraphChannelList, 15, 1, 1, 7) |
|
|||
534 | self.label_25 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
535 | self.label_25.setObjectName(_fromUtf8("label_25")) |
|
|||
536 | self.gridLayout_9.addWidget(self.label_25, 2, 0, 1, 1) |
|
|||
537 | self.specGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
538 | self.specGgraphTminTmax.setObjectName(_fromUtf8("specGgraphTminTmax")) |
|
|||
539 | self.gridLayout_9.addWidget(self.specGgraphTminTmax, 21, 1, 1, 7) |
|
|||
540 | spacerItem15 = QtGui.QSpacerItem(28, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
541 | self.gridLayout_9.addItem(spacerItem15, 27, 6, 1, 2) |
|
|||
542 | spacerItem16 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
543 | self.gridLayout_9.addItem(spacerItem16, 3, 5, 1, 1) |
|
|||
544 | self.label_42 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
545 | self.label_42.setObjectName(_fromUtf8("label_42")) |
|
|||
546 | self.gridLayout_9.addWidget(self.label_42, 9, 0, 1, 1) |
|
|||
547 | self.label_16 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
548 | self.label_16.setObjectName(_fromUtf8("label_16")) |
|
|||
549 | self.gridLayout_9.addWidget(self.label_16, 18, 0, 1, 1) |
|
|||
550 | self.label_17 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
551 | self.label_17.setObjectName(_fromUtf8("label_17")) |
|
|||
552 | self.gridLayout_9.addWidget(self.label_17, 19, 0, 1, 1) |
|
|||
553 | self.label_18 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
554 | self.label_18.setObjectName(_fromUtf8("label_18")) |
|
|||
555 | self.gridLayout_9.addWidget(self.label_18, 20, 0, 1, 1) |
|
|||
556 | self.specGgraphFreq = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
557 | self.specGgraphFreq.setObjectName(_fromUtf8("specGgraphFreq")) |
|
|||
558 | self.gridLayout_9.addWidget(self.specGgraphFreq, 16, 1, 1, 7) |
|
|||
559 | self.specGgraphHeight = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
560 | self.specGgraphHeight.setObjectName(_fromUtf8("specGgraphHeight")) |
|
|||
561 | self.gridLayout_9.addWidget(self.specGgraphHeight, 18, 1, 1, 7) |
|
|||
562 | spacerItem17 = QtGui.QSpacerItem(49, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
563 | self.gridLayout_9.addItem(spacerItem17, 27, 0, 1, 1) |
|
|||
564 | self.label_24 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
565 | self.label_24.setObjectName(_fromUtf8("label_24")) |
|
|||
566 | self.gridLayout_9.addWidget(self.label_24, 0, 0, 1, 1) |
|
|||
567 | self.specGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
568 | self.specGraphPrefix.setObjectName(_fromUtf8("specGraphPrefix")) |
|
|||
569 | self.gridLayout_9.addWidget(self.specGraphPrefix, 2, 1, 1, 7) |
|
|||
570 | self.specGgraphDbsrange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
571 | self.specGgraphDbsrange.setObjectName(_fromUtf8("specGgraphDbsrange")) |
|
|||
572 | self.gridLayout_9.addWidget(self.specGgraphDbsrange, 19, 1, 1, 7) |
|
|||
573 | self.label_46 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
574 | self.label_46.setObjectName(_fromUtf8("label_46")) |
|
|||
575 | self.gridLayout_9.addWidget(self.label_46, 11, 0, 1, 1) |
|
|||
576 | self.label_22 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
577 | self.label_22.setObjectName(_fromUtf8("label_22")) |
|
|||
578 | self.gridLayout_9.addWidget(self.label_22, 16, 0, 1, 1) |
|
|||
579 | self.specGraphPath = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
580 | self.specGraphPath.setObjectName(_fromUtf8("specGraphPath")) |
|
|||
581 | self.gridLayout_9.addWidget(self.specGraphPath, 0, 1, 1, 6) |
|
|||
582 | self.label_41 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
583 | self.label_41.setObjectName(_fromUtf8("label_41")) |
|
|||
584 | self.gridLayout_9.addWidget(self.label_41, 8, 0, 1, 1) |
|
|||
585 | self.specGraphToolPath = QtGui.QToolButton(self.tabgraphSpectra) |
|
|||
586 | self.specGraphToolPath.setObjectName(_fromUtf8("specGraphToolPath")) |
|
|||
587 | self.gridLayout_9.addWidget(self.specGraphToolPath, 0, 7, 1, 1) |
|
|||
588 | self.label_6 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
589 | self.label_6.setObjectName(_fromUtf8("label_6")) |
|
|||
590 | self.gridLayout_9.addWidget(self.label_6, 15, 0, 1, 1) |
|
|||
591 | self.label_40 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
592 | self.label_40.setObjectName(_fromUtf8("label_40")) |
|
|||
593 | self.gridLayout_9.addWidget(self.label_40, 6, 0, 1, 1) |
|
|||
594 | self.specGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
595 | self.specGraphCebSpectraplot.setText(_fromUtf8("")) |
|
|||
596 | self.specGraphCebSpectraplot.setObjectName(_fromUtf8("specGraphCebSpectraplot")) |
|
|||
597 | self.gridLayout_9.addWidget(self.specGraphCebSpectraplot, 6, 2, 1, 1) |
|
|||
598 | self.specGraphCebCrossSpectraplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
599 | self.specGraphCebCrossSpectraplot.setText(_fromUtf8("")) |
|
|||
600 | self.specGraphCebCrossSpectraplot.setObjectName(_fromUtf8("specGraphCebCrossSpectraplot")) |
|
|||
601 | self.gridLayout_9.addWidget(self.specGraphCebCrossSpectraplot, 8, 2, 1, 1) |
|
|||
602 | self.specGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
603 | self.specGraphCebRTIplot.setText(_fromUtf8("")) |
|
|||
604 | self.specGraphCebRTIplot.setObjectName(_fromUtf8("specGraphCebRTIplot")) |
|
|||
605 | self.gridLayout_9.addWidget(self.specGraphCebRTIplot, 9, 2, 1, 1) |
|
|||
606 | self.specGraphCebCoherencmap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
607 | self.specGraphCebCoherencmap.setText(_fromUtf8("")) |
|
|||
608 | self.specGraphCebCoherencmap.setObjectName(_fromUtf8("specGraphCebCoherencmap")) |
|
|||
609 | self.gridLayout_9.addWidget(self.specGraphCebCoherencmap, 10, 2, 1, 1) |
|
|||
610 | self.specGraphPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
611 | self.specGraphPowerprofile.setText(_fromUtf8("")) |
|
|||
612 | self.specGraphPowerprofile.setObjectName(_fromUtf8("specGraphPowerprofile")) |
|
|||
613 | self.gridLayout_9.addWidget(self.specGraphPowerprofile, 11, 2, 1, 1) |
|
|||
614 | self.specGraphSaveCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
615 | self.specGraphSaveCross.setText(_fromUtf8("")) |
|
|||
616 | self.specGraphSaveCross.setObjectName(_fromUtf8("specGraphSaveCross")) |
|
|||
617 | self.gridLayout_9.addWidget(self.specGraphSaveCross, 8, 4, 1, 1) |
|
|||
618 | self.specGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
619 | self.specGraphftpSpectra.setText(_fromUtf8("")) |
|
|||
620 | self.specGraphftpSpectra.setObjectName(_fromUtf8("specGraphftpSpectra")) |
|
|||
621 | self.gridLayout_9.addWidget(self.specGraphftpSpectra, 6, 6, 1, 1) |
|
|||
622 | spacerItem18 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
623 | self.gridLayout_9.addItem(spacerItem18, 4, 3, 1, 1) |
|
|||
624 | self.specGraphSavePowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
625 | self.specGraphSavePowerprofile.setText(_fromUtf8("")) |
|
|||
626 | self.specGraphSavePowerprofile.setObjectName(_fromUtf8("specGraphSavePowerprofile")) |
|
|||
627 | self.gridLayout_9.addWidget(self.specGraphSavePowerprofile, 11, 4, 1, 1) |
|
|||
628 | self.specGraphSaveCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
629 | self.specGraphSaveCoherencemap.setText(_fromUtf8("")) |
|
|||
630 | self.specGraphSaveCoherencemap.setObjectName(_fromUtf8("specGraphSaveCoherencemap")) |
|
|||
631 | self.gridLayout_9.addWidget(self.specGraphSaveCoherencemap, 10, 4, 1, 1) |
|
|||
632 | spacerItem19 = QtGui.QSpacerItem(39, 15, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
633 | self.gridLayout_9.addItem(spacerItem19, 27, 4, 1, 1) |
|
|||
634 | self.specGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
635 | self.specGgraphftpratio.setObjectName(_fromUtf8("specGgraphftpratio")) |
|
|||
636 | self.gridLayout_9.addWidget(self.specGgraphftpratio, 23, 1, 1, 7) |
|
|||
637 | self.label_43 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
638 | self.label_43.setObjectName(_fromUtf8("label_43")) |
|
|||
639 | self.gridLayout_9.addWidget(self.label_43, 3, 2, 2, 1) |
|
|||
640 | self.specGraphftpCross = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
641 | self.specGraphftpCross.setText(_fromUtf8("")) |
|
|||
642 | self.specGraphftpCross.setObjectName(_fromUtf8("specGraphftpCross")) |
|
|||
643 | self.gridLayout_9.addWidget(self.specGraphftpCross, 8, 6, 1, 1) |
|
|||
644 | self.label_29 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
645 | self.label_29.setObjectName(_fromUtf8("label_29")) |
|
|||
646 | self.gridLayout_9.addWidget(self.label_29, 23, 0, 1, 1) |
|
|||
647 | self.label_47 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
648 | self.label_47.setObjectName(_fromUtf8("label_47")) |
|
|||
649 | self.gridLayout_9.addWidget(self.label_47, 3, 4, 2, 1) |
|
|||
650 | self.specGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
651 | self.specGraphftpRTIplot.setText(_fromUtf8("")) |
|
|||
652 | self.specGraphftpRTIplot.setObjectName(_fromUtf8("specGraphftpRTIplot")) |
|
|||
653 | self.gridLayout_9.addWidget(self.specGraphftpRTIplot, 9, 6, 1, 1) |
|
|||
654 | self.specGraphftpCoherencemap = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
655 | self.specGraphftpCoherencemap.setText(_fromUtf8("")) |
|
|||
656 | self.specGraphftpCoherencemap.setObjectName(_fromUtf8("specGraphftpCoherencemap")) |
|
|||
657 | self.gridLayout_9.addWidget(self.specGraphftpCoherencemap, 10, 6, 1, 1) |
|
|||
658 | self.specGraphftpPowerprofile = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
659 | self.specGraphftpPowerprofile.setText(_fromUtf8("")) |
|
|||
660 | self.specGraphftpPowerprofile.setObjectName(_fromUtf8("specGraphftpPowerprofile")) |
|
|||
661 | self.gridLayout_9.addWidget(self.specGraphftpPowerprofile, 11, 6, 1, 1) |
|
|||
662 | self.label_19 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
663 | self.label_19.setObjectName(_fromUtf8("label_19")) |
|
|||
664 | self.gridLayout_9.addWidget(self.label_19, 3, 6, 2, 2) |
|
|||
665 | self.specGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
666 | self.specGraphSaveRTIplot.setText(_fromUtf8("")) |
|
|||
667 | self.specGraphSaveRTIplot.setObjectName(_fromUtf8("specGraphSaveRTIplot")) |
|
|||
668 | self.gridLayout_9.addWidget(self.specGraphSaveRTIplot, 9, 4, 1, 1) |
|
|||
669 | self.label_45 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
670 | self.label_45.setObjectName(_fromUtf8("label_45")) |
|
|||
671 | self.gridLayout_9.addWidget(self.label_45, 13, 0, 1, 1) |
|
|||
672 | self.specGraphftpRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
673 | self.specGraphftpRTInoise.setText(_fromUtf8("")) |
|
|||
674 | self.specGraphftpRTInoise.setObjectName(_fromUtf8("specGraphftpRTInoise")) |
|
|||
675 | self.gridLayout_9.addWidget(self.specGraphftpRTInoise, 13, 6, 1, 1) |
|
|||
676 | self.specGraphCebRTInoise = QtGui.QCheckBox(self.tabgraphSpectra) |
|
|||
677 | self.specGraphCebRTInoise.setText(_fromUtf8("")) |
|
|||
678 | self.specGraphCebRTInoise.setObjectName(_fromUtf8("specGraphCebRTInoise")) |
|
|||
679 | self.gridLayout_9.addWidget(self.specGraphCebRTInoise, 13, 2, 1, 1) |
|
|||
680 | self.label_48 = QtGui.QLabel(self.tabgraphSpectra) |
|
|||
681 | self.label_48.setObjectName(_fromUtf8("label_48")) |
|
|||
682 | self.gridLayout_9.addWidget(self.label_48, 22, 0, 1, 1) |
|
|||
683 | self.specGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectra) |
|
|||
684 | self.specGgraphTimeRange.setObjectName(_fromUtf8("specGgraphTimeRange")) |
|
|||
685 | self.gridLayout_9.addWidget(self.specGgraphTimeRange, 22, 1, 1, 7) |
|
|||
686 | self.tabWidgetSpectra.addTab(self.tabgraphSpectra, _fromUtf8("")) |
|
|||
687 | self.taboutputSpectra = QtGui.QWidget() |
|
|||
688 | self.taboutputSpectra.setObjectName(_fromUtf8("taboutputSpectra")) |
|
|||
689 | self.gridLayout_11 = QtGui.QGridLayout(self.taboutputSpectra) |
|
|||
690 | self.gridLayout_11.setObjectName(_fromUtf8("gridLayout_11")) |
|
|||
691 | self.label_39 = QtGui.QLabel(self.taboutputSpectra) |
|
|||
692 | self.label_39.setObjectName(_fromUtf8("label_39")) |
|
|||
693 | self.gridLayout_11.addWidget(self.label_39, 0, 0, 1, 1) |
|
|||
694 | self.specOutputComData = QtGui.QComboBox(self.taboutputSpectra) |
|
|||
695 | self.specOutputComData.setObjectName(_fromUtf8("specOutputComData")) |
|
|||
696 | self.specOutputComData.addItem(_fromUtf8("")) |
|
|||
697 | self.gridLayout_11.addWidget(self.specOutputComData, 0, 2, 1, 2) |
|
|||
698 | self.label_34 = QtGui.QLabel(self.taboutputSpectra) |
|
|||
699 | self.label_34.setObjectName(_fromUtf8("label_34")) |
|
|||
700 | self.gridLayout_11.addWidget(self.label_34, 1, 0, 1, 1) |
|
|||
701 | self.specOutputPath = QtGui.QLineEdit(self.taboutputSpectra) |
|
|||
702 | self.specOutputPath.setObjectName(_fromUtf8("specOutputPath")) |
|
|||
703 | self.gridLayout_11.addWidget(self.specOutputPath, 1, 2, 1, 1) |
|
|||
704 | spacerItem20 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
705 | self.gridLayout_11.addItem(spacerItem20, 4, 2, 1, 1) |
|
|||
706 | self.specOutputToolPath = QtGui.QToolButton(self.taboutputSpectra) |
|
|||
707 | self.specOutputToolPath.setObjectName(_fromUtf8("specOutputToolPath")) |
|
|||
708 | self.gridLayout_11.addWidget(self.specOutputToolPath, 1, 3, 1, 1) |
|
|||
709 | self.specOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectra) |
|
|||
710 | self.specOutputblocksperfile.setObjectName(_fromUtf8("specOutputblocksperfile")) |
|
|||
711 | self.gridLayout_11.addWidget(self.specOutputblocksperfile, 2, 2, 1, 1) |
|
|||
712 | self.label_9 = QtGui.QLabel(self.taboutputSpectra) |
|
|||
713 | self.label_9.setObjectName(_fromUtf8("label_9")) |
|
|||
714 | self.gridLayout_11.addWidget(self.label_9, 2, 0, 1, 2) |
|
|||
715 | self.label_38 = QtGui.QLabel(self.taboutputSpectra) |
|
|||
716 | self.label_38.setObjectName(_fromUtf8("label_38")) |
|
|||
717 | self.gridLayout_11.addWidget(self.label_38, 3, 0, 1, 1) |
|
|||
718 | self.specOutputprofileperblock = QtGui.QLineEdit(self.taboutputSpectra) |
|
|||
719 | self.specOutputprofileperblock.setObjectName(_fromUtf8("specOutputprofileperblock")) |
|
|||
720 | self.gridLayout_11.addWidget(self.specOutputprofileperblock, 3, 2, 1, 1) |
|
|||
721 | self.tabWidgetSpectra.addTab(self.taboutputSpectra, _fromUtf8("")) |
|
|||
722 | self.gridLayout_7.addWidget(self.tabWidgetSpectra, 0, 1, 1, 1) |
|
|||
723 | self.tabWidgetProject.addTab(self.tabSpectra, _fromUtf8("")) |
|
|||
724 | self.tabSpectraHeis = QtGui.QWidget() |
|
|||
725 | self.tabSpectraHeis.setObjectName(_fromUtf8("tabSpectraHeis")) |
|
|||
726 | self.gridLayout_23 = QtGui.QGridLayout(self.tabSpectraHeis) |
|
|||
727 | self.gridLayout_23.setObjectName(_fromUtf8("gridLayout_23")) |
|
|||
728 | self.frame_6 = QtGui.QFrame(self.tabSpectraHeis) |
|
|||
729 | self.frame_6.setFrameShape(QtGui.QFrame.StyledPanel) |
|
|||
730 | self.frame_6.setFrameShadow(QtGui.QFrame.Raised) |
|
|||
731 | self.frame_6.setObjectName(_fromUtf8("frame_6")) |
|
|||
732 | self.gridLayout_22 = QtGui.QGridLayout(self.frame_6) |
|
|||
733 | self.gridLayout_22.setObjectName(_fromUtf8("gridLayout_22")) |
|
|||
734 | self.specHeisGraphClear = QtGui.QPushButton(self.frame_6) |
|
|||
735 | self.specHeisGraphClear.setObjectName(_fromUtf8("specHeisGraphClear")) |
|
|||
736 | self.gridLayout_22.addWidget(self.specHeisGraphClear, 0, 1, 1, 1) |
|
|||
737 | self.specHeisOpOk = QtGui.QPushButton(self.frame_6) |
|
|||
738 | self.specHeisOpOk.setObjectName(_fromUtf8("specHeisOpOk")) |
|
|||
739 | self.gridLayout_22.addWidget(self.specHeisOpOk, 0, 0, 1, 1) |
|
|||
740 | self.gridLayout_23.addWidget(self.frame_6, 1, 0, 1, 1) |
|
|||
741 | self.tabWidgetSpectraHeis = QtGui.QTabWidget(self.tabSpectraHeis) |
|
|||
742 | self.tabWidgetSpectraHeis.setObjectName(_fromUtf8("tabWidgetSpectraHeis")) |
|
|||
743 | self.tabopSpectraHeis = QtGui.QWidget() |
|
|||
744 | self.tabopSpectraHeis.setObjectName(_fromUtf8("tabopSpectraHeis")) |
|
|||
745 | self.gridLayout_21 = QtGui.QGridLayout(self.tabopSpectraHeis) |
|
|||
746 | self.gridLayout_21.setObjectName(_fromUtf8("gridLayout_21")) |
|
|||
747 | spacerItem21 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
748 | self.gridLayout_21.addItem(spacerItem21, 0, 1, 1, 1) |
|
|||
749 | self.specHeisOpCobIncInt = QtGui.QComboBox(self.tabopSpectraHeis) |
|
|||
750 | self.specHeisOpCobIncInt.setObjectName(_fromUtf8("specHeisOpCobIncInt")) |
|
|||
751 | self.specHeisOpCobIncInt.addItem(_fromUtf8("")) |
|
|||
752 | self.gridLayout_21.addWidget(self.specHeisOpCobIncInt, 1, 0, 1, 1) |
|
|||
753 | self.specHeisOpCebIncoherent = QtGui.QCheckBox(self.tabopSpectraHeis) |
|
|||
754 | self.specHeisOpCebIncoherent.setObjectName(_fromUtf8("specHeisOpCebIncoherent")) |
|
|||
755 | self.gridLayout_21.addWidget(self.specHeisOpCebIncoherent, 0, 0, 1, 1) |
|
|||
756 | self.specHeisOpIncoherent = QtGui.QLineEdit(self.tabopSpectraHeis) |
|
|||
757 | self.specHeisOpIncoherent.setObjectName(_fromUtf8("specHeisOpIncoherent")) |
|
|||
758 | self.gridLayout_21.addWidget(self.specHeisOpIncoherent, 1, 1, 1, 1) |
|
|||
759 | spacerItem22 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
760 | self.gridLayout_21.addItem(spacerItem22, 2, 0, 1, 1) |
|
|||
761 | self.tabWidgetSpectraHeis.addTab(self.tabopSpectraHeis, _fromUtf8("")) |
|
|||
762 | self.tabgraphSpectraHeis = QtGui.QWidget() |
|
|||
763 | self.tabgraphSpectraHeis.setObjectName(_fromUtf8("tabgraphSpectraHeis")) |
|
|||
764 | self.gridLayout_20 = QtGui.QGridLayout(self.tabgraphSpectraHeis) |
|
|||
765 | self.gridLayout_20.setObjectName(_fromUtf8("gridLayout_20")) |
|
|||
766 | self.label_54 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
767 | self.label_54.setObjectName(_fromUtf8("label_54")) |
|
|||
768 | self.gridLayout_20.addWidget(self.label_54, 1, 0, 1, 1) |
|
|||
769 | self.specHeisGraphToolPath = QtGui.QToolButton(self.tabgraphSpectraHeis) |
|
|||
770 | self.specHeisGraphToolPath.setObjectName(_fromUtf8("specHeisGraphToolPath")) |
|
|||
771 | self.gridLayout_20.addWidget(self.specHeisGraphToolPath, 0, 6, 1, 1) |
|
|||
772 | self.specHeisGraphCebRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
773 | self.specHeisGraphCebRTIplot.setText(_fromUtf8("")) |
|
|||
774 | self.specHeisGraphCebRTIplot.setObjectName(_fromUtf8("specHeisGraphCebRTIplot")) |
|
|||
775 | self.gridLayout_20.addWidget(self.specHeisGraphCebRTIplot, 4, 2, 1, 1) |
|
|||
776 | self.label_62 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
777 | self.label_62.setObjectName(_fromUtf8("label_62")) |
|
|||
778 | self.gridLayout_20.addWidget(self.label_62, 7, 0, 1, 1) |
|
|||
779 | self.label_63 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
780 | self.label_63.setObjectName(_fromUtf8("label_63")) |
|
|||
781 | self.gridLayout_20.addWidget(self.label_63, 8, 0, 1, 1) |
|
|||
782 | self.label_64 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
783 | self.label_64.setObjectName(_fromUtf8("label_64")) |
|
|||
784 | self.gridLayout_20.addWidget(self.label_64, 9, 0, 1, 1) |
|
|||
785 | self.label_65 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
786 | self.label_65.setObjectName(_fromUtf8("label_65")) |
|
|||
787 | self.gridLayout_20.addWidget(self.label_65, 10, 0, 1, 1) |
|
|||
788 | spacerItem23 = QtGui.QSpacerItem(134, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
789 | self.gridLayout_20.addItem(spacerItem23, 11, 0, 1, 2) |
|
|||
790 | self.specHeisGgraphftpratio = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
791 | self.specHeisGgraphftpratio.setObjectName(_fromUtf8("specHeisGgraphftpratio")) |
|
|||
792 | self.gridLayout_20.addWidget(self.specHeisGgraphftpratio, 10, 1, 1, 6) |
|
|||
793 | self.specHeisGraphftpRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
794 | self.specHeisGraphftpRTIplot.setText(_fromUtf8("")) |
|
|||
795 | self.specHeisGraphftpRTIplot.setObjectName(_fromUtf8("specHeisGraphftpRTIplot")) |
|
|||
796 | self.gridLayout_20.addWidget(self.specHeisGraphftpRTIplot, 4, 6, 1, 1) |
|
|||
797 | self.specHeisGgraphTminTmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
798 | self.specHeisGgraphTminTmax.setObjectName(_fromUtf8("specHeisGgraphTminTmax")) |
|
|||
799 | self.gridLayout_20.addWidget(self.specHeisGgraphTminTmax, 8, 1, 1, 6) |
|
|||
800 | self.label_60 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
801 | self.label_60.setObjectName(_fromUtf8("label_60")) |
|
|||
802 | self.gridLayout_20.addWidget(self.label_60, 5, 0, 1, 1) |
|
|||
803 | self.label_61 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
804 | self.label_61.setObjectName(_fromUtf8("label_61")) |
|
|||
805 | self.gridLayout_20.addWidget(self.label_61, 6, 0, 1, 1) |
|
|||
806 | self.specHeisGraphPrefix = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
807 | self.specHeisGraphPrefix.setObjectName(_fromUtf8("specHeisGraphPrefix")) |
|
|||
808 | self.gridLayout_20.addWidget(self.specHeisGraphPrefix, 1, 1, 1, 6) |
|
|||
809 | self.label_56 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
810 | self.label_56.setObjectName(_fromUtf8("label_56")) |
|
|||
811 | self.gridLayout_20.addWidget(self.label_56, 2, 4, 1, 1) |
|
|||
812 | self.label_57 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
813 | self.label_57.setObjectName(_fromUtf8("label_57")) |
|
|||
814 | self.gridLayout_20.addWidget(self.label_57, 2, 6, 1, 1) |
|
|||
815 | self.label_58 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
816 | self.label_58.setObjectName(_fromUtf8("label_58")) |
|
|||
817 | self.gridLayout_20.addWidget(self.label_58, 3, 0, 1, 1) |
|
|||
818 | self.specHeisGraphCebSpectraplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
819 | self.specHeisGraphCebSpectraplot.setText(_fromUtf8("")) |
|
|||
820 | self.specHeisGraphCebSpectraplot.setObjectName(_fromUtf8("specHeisGraphCebSpectraplot")) |
|
|||
821 | self.gridLayout_20.addWidget(self.specHeisGraphCebSpectraplot, 3, 2, 1, 1) |
|
|||
822 | self.specHeisGgraphYminYmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
823 | self.specHeisGgraphYminYmax.setObjectName(_fromUtf8("specHeisGgraphYminYmax")) |
|
|||
824 | self.gridLayout_20.addWidget(self.specHeisGgraphYminYmax, 7, 1, 1, 6) |
|
|||
825 | self.label_53 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
826 | self.label_53.setObjectName(_fromUtf8("label_53")) |
|
|||
827 | self.gridLayout_20.addWidget(self.label_53, 0, 0, 1, 1) |
|
|||
828 | self.label_55 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
829 | self.label_55.setObjectName(_fromUtf8("label_55")) |
|
|||
830 | self.gridLayout_20.addWidget(self.label_55, 2, 2, 1, 1) |
|
|||
831 | self.specHeisGraphSaveRTIplot = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
832 | self.specHeisGraphSaveRTIplot.setText(_fromUtf8("")) |
|
|||
833 | self.specHeisGraphSaveRTIplot.setObjectName(_fromUtf8("specHeisGraphSaveRTIplot")) |
|
|||
834 | self.gridLayout_20.addWidget(self.specHeisGraphSaveRTIplot, 4, 4, 1, 1) |
|
|||
835 | spacerItem24 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
836 | self.gridLayout_20.addItem(spacerItem24, 2, 3, 1, 1) |
|
|||
837 | self.specHeisGgraphXminXmax = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
838 | self.specHeisGgraphXminXmax.setObjectName(_fromUtf8("specHeisGgraphXminXmax")) |
|
|||
839 | self.gridLayout_20.addWidget(self.specHeisGgraphXminXmax, 6, 1, 1, 6) |
|
|||
840 | self.specHeisGgraphChannelList = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
841 | self.specHeisGgraphChannelList.setObjectName(_fromUtf8("specHeisGgraphChannelList")) |
|
|||
842 | self.gridLayout_20.addWidget(self.specHeisGgraphChannelList, 5, 1, 1, 6) |
|
|||
843 | self.specHeisGgraphTimeRange = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
844 | self.specHeisGgraphTimeRange.setObjectName(_fromUtf8("specHeisGgraphTimeRange")) |
|
|||
845 | self.gridLayout_20.addWidget(self.specHeisGgraphTimeRange, 9, 1, 1, 6) |
|
|||
846 | spacerItem25 = QtGui.QSpacerItem(106, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
847 | self.gridLayout_20.addItem(spacerItem25, 11, 3, 1, 3) |
|
|||
848 | self.specHeisGraphSaveSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
849 | self.specHeisGraphSaveSpectra.setText(_fromUtf8("")) |
|
|||
850 | self.specHeisGraphSaveSpectra.setObjectName(_fromUtf8("specHeisGraphSaveSpectra")) |
|
|||
851 | self.gridLayout_20.addWidget(self.specHeisGraphSaveSpectra, 3, 4, 1, 1) |
|
|||
852 | self.specHeisGraphftpSpectra = QtGui.QCheckBox(self.tabgraphSpectraHeis) |
|
|||
853 | self.specHeisGraphftpSpectra.setText(_fromUtf8("")) |
|
|||
854 | self.specHeisGraphftpSpectra.setObjectName(_fromUtf8("specHeisGraphftpSpectra")) |
|
|||
855 | self.gridLayout_20.addWidget(self.specHeisGraphftpSpectra, 3, 6, 1, 1) |
|
|||
856 | self.label_59 = QtGui.QLabel(self.tabgraphSpectraHeis) |
|
|||
857 | self.label_59.setObjectName(_fromUtf8("label_59")) |
|
|||
858 | self.gridLayout_20.addWidget(self.label_59, 4, 0, 1, 1) |
|
|||
859 | spacerItem26 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
|||
860 | self.gridLayout_20.addItem(spacerItem26, 2, 5, 1, 1) |
|
|||
861 | self.specHeisGraphPath = QtGui.QLineEdit(self.tabgraphSpectraHeis) |
|
|||
862 | self.specHeisGraphPath.setObjectName(_fromUtf8("specHeisGraphPath")) |
|
|||
863 | self.gridLayout_20.addWidget(self.specHeisGraphPath, 0, 1, 1, 5) |
|
|||
864 | self.tabWidgetSpectraHeis.addTab(self.tabgraphSpectraHeis, _fromUtf8("")) |
|
|||
865 | self.taboutputSpectraHeis = QtGui.QWidget() |
|
|||
866 | self.taboutputSpectraHeis.setObjectName(_fromUtf8("taboutputSpectraHeis")) |
|
|||
867 | self.gridLayout_19 = QtGui.QGridLayout(self.taboutputSpectraHeis) |
|
|||
868 | self.gridLayout_19.setObjectName(_fromUtf8("gridLayout_19")) |
|
|||
869 | self.label_67 = QtGui.QLabel(self.taboutputSpectraHeis) |
|
|||
870 | self.label_67.setObjectName(_fromUtf8("label_67")) |
|
|||
871 | self.gridLayout_19.addWidget(self.label_67, 1, 0, 1, 1) |
|
|||
872 | self.label_68 = QtGui.QLabel(self.taboutputSpectraHeis) |
|
|||
873 | self.label_68.setObjectName(_fromUtf8("label_68")) |
|
|||
874 | self.gridLayout_19.addWidget(self.label_68, 2, 0, 1, 2) |
|
|||
875 | self.label_66 = QtGui.QLabel(self.taboutputSpectraHeis) |
|
|||
876 | self.label_66.setObjectName(_fromUtf8("label_66")) |
|
|||
877 | self.gridLayout_19.addWidget(self.label_66, 0, 0, 1, 1) |
|
|||
878 | spacerItem27 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) |
|
|||
879 | self.gridLayout_19.addItem(spacerItem27, 4, 0, 1, 1) |
|
|||
880 | self.specHeisOutputToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) |
|
|||
881 | self.specHeisOutputToolPath.setObjectName(_fromUtf8("specHeisOutputToolPath")) |
|
|||
882 | self.gridLayout_19.addWidget(self.specHeisOutputToolPath, 1, 4, 1, 1) |
|
|||
883 | self.specHeisOutputPath = QtGui.QLineEdit(self.taboutputSpectraHeis) |
|
|||
884 | self.specHeisOutputPath.setObjectName(_fromUtf8("specHeisOutputPath")) |
|
|||
885 | self.gridLayout_19.addWidget(self.specHeisOutputPath, 1, 3, 1, 1) |
|
|||
886 | self.specHeisOutputComdata = QtGui.QComboBox(self.taboutputSpectraHeis) |
|
|||
887 | self.specHeisOutputComdata.setObjectName(_fromUtf8("specHeisOutputComdata")) |
|
|||
888 | self.specHeisOutputComdata.addItem(_fromUtf8("")) |
|
|||
889 | self.gridLayout_19.addWidget(self.specHeisOutputComdata, 0, 3, 1, 2) |
|
|||
890 | self.label_69 = QtGui.QLabel(self.taboutputSpectraHeis) |
|
|||
891 | self.label_69.setObjectName(_fromUtf8("label_69")) |
|
|||
892 | self.gridLayout_19.addWidget(self.label_69, 3, 0, 1, 2) |
|
|||
893 | self.specHeisOutputblocksperfile = QtGui.QLineEdit(self.taboutputSpectraHeis) |
|
|||
894 | self.specHeisOutputblocksperfile.setObjectName(_fromUtf8("specHeisOutputblocksperfile")) |
|
|||
895 | self.gridLayout_19.addWidget(self.specHeisOutputblocksperfile, 2, 3, 1, 1) |
|
|||
896 | self.specHeisOutputMetada = QtGui.QLineEdit(self.taboutputSpectraHeis) |
|
|||
897 | self.specHeisOutputMetada.setObjectName(_fromUtf8("specHeisOutputMetada")) |
|
|||
898 | self.gridLayout_19.addWidget(self.specHeisOutputMetada, 3, 3, 1, 1) |
|
|||
899 | self.specHeisOutputMetadaToolPath = QtGui.QToolButton(self.taboutputSpectraHeis) |
|
|||
900 | self.specHeisOutputMetadaToolPath.setObjectName(_fromUtf8("specHeisOutputMetadaToolPath")) |
|
|||
901 | self.gridLayout_19.addWidget(self.specHeisOutputMetadaToolPath, 3, 4, 1, 1) |
|
|||
902 | self.tabWidgetSpectraHeis.addTab(self.taboutputSpectraHeis, _fromUtf8("")) |
|
|||
903 | self.gridLayout_23.addWidget(self.tabWidgetSpectraHeis, 0, 0, 1, 1) |
|
|||
904 | self.tabWidgetProject.addTab(self.tabSpectraHeis, _fromUtf8("")) |
|
|||
905 | self.tabCorrelation = QtGui.QWidget() |
|
|||
906 | self.tabCorrelation.setObjectName(_fromUtf8("tabCorrelation")) |
|
|||
907 | self.gridLayout_13 = QtGui.QGridLayout(self.tabCorrelation) |
|
|||
908 | self.gridLayout_13.setObjectName(_fromUtf8("gridLayout_13")) |
|
|||
909 | self.tabWidget_2 = QtGui.QTabWidget(self.tabCorrelation) |
|
|||
910 | self.tabWidget_2.setObjectName(_fromUtf8("tabWidget_2")) |
|
|||
911 | self.tabopCorrelation = QtGui.QWidget() |
|
|||
912 | self.tabopCorrelation.setObjectName(_fromUtf8("tabopCorrelation")) |
|
|||
913 | self.tabWidget_2.addTab(self.tabopCorrelation, _fromUtf8("")) |
|
|||
914 | self.tabopCorrelation1 = QtGui.QWidget() |
|
|||
915 | self.tabopCorrelation1.setObjectName(_fromUtf8("tabopCorrelation1")) |
|
|||
916 | self.tabWidget_2.addTab(self.tabopCorrelation1, _fromUtf8("")) |
|
|||
917 | self.gridLayout_13.addWidget(self.tabWidget_2, 0, 0, 1, 1) |
|
|||
918 | self.tabWidgetProject.addTab(self.tabCorrelation, _fromUtf8("")) |
|
|||
919 |
|
||||
920 |
|
||||
921 | self.tabConsole = QtGui.QTabWidget(self.splitter) |
|
|||
922 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) |
|
|||
923 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) |
|
|||
924 | self.tab_5 = QtGui.QWidget() |
|
|||
925 | self.tab_5.setObjectName(_fromUtf8("tab_5")) |
|
|||
926 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) |
|
|||
927 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) |
|
|||
928 | self.console = QtGui.QTextEdit(self.tab_5) |
|
|||
929 | self.console.setObjectName(_fromUtf8("console")) |
|
|||
930 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) |
|
|||
931 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) |
|
|||
932 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) |
|
|||
933 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) |
|
|||
934 | self.tabProjectProperty = QtGui.QWidget() |
|
|||
935 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) |
|
|||
936 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) |
|
|||
937 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) |
|
|||
938 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) |
|
|||
939 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) |
|
|||
940 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) |
|
|||
941 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) |
|
|||
942 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) |
|
|||
943 | MainWindow.setCentralWidget(self.centralWidget) |
|
|||
944 | self.toolBar = QtGui.QToolBar(MainWindow) |
|
|||
945 | self.toolBar.setObjectName(_fromUtf8("toolBar")) |
|
|||
946 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
|||
947 | self.menuBar = QtGui.QMenuBar(MainWindow) |
|
|||
948 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) |
|
|||
949 | self.menuBar.setObjectName(_fromUtf8("menuBar")) |
|
|||
950 | self.menuProject = QtGui.QMenu(self.menuBar) |
|
|||
951 | self.menuProject.setObjectName(_fromUtf8("menuProject")) |
|
|||
952 | self.menuRun = QtGui.QMenu(self.menuBar) |
|
|||
953 | self.menuRun.setObjectName(_fromUtf8("menuRun")) |
|
|||
954 | self.menuOptions = QtGui.QMenu(self.menuBar) |
|
|||
955 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) |
|
|||
956 | self.menuHelp = QtGui.QMenu(self.menuBar) |
|
|||
957 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) |
|
|||
958 | MainWindow.setMenuBar(self.menuBar) |
|
|||
959 | self.actionOpen = QtGui.QAction(MainWindow) |
|
|||
960 |
|
||||
961 | iconOpen = QtGui.QIcon() |
|
|||
962 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
963 |
|
||||
964 | iconCreate = QtGui.QIcon() |
|
|||
965 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
966 |
|
||||
967 | iconSave = QtGui.QIcon() |
|
|||
968 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
969 |
|
||||
970 | iconStart = QtGui.QIcon() |
|
|||
971 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
972 |
|
|
34 | ||
973 | iconStop = QtGui.QIcon() |
|
35 | def restorePauseIcon(self): | |
974 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
975 |
|
36 | |||
976 | iconPause = QtGui.QIcon() |
|
37 | iconPause = QtGui.QIcon() | |
977 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
38 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
978 |
|
||||
979 | iconAddPU = QtGui.QIcon() |
|
|||
980 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
981 |
|
||||
982 | self.actionOpen.setIcon(iconOpen) |
|
|||
983 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) |
|
|||
984 | self.actionCreate = QtGui.QAction(MainWindow) |
|
|||
985 | self.actionCreate.setIcon(iconCreate) |
|
|||
986 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) |
|
|||
987 | self.actionSave = QtGui.QAction(MainWindow) |
|
|||
988 | self.actionSave.setIcon(iconSave) |
|
|||
989 | self.actionSave.setObjectName(_fromUtf8("actionSave")) |
|
|||
990 | self.actionClose = QtGui.QAction(MainWindow) |
|
|||
991 | self.actionClose.setObjectName(_fromUtf8("actionClose")) |
|
|||
992 | self.actionStart = QtGui.QAction(MainWindow) |
|
|||
993 | self.actionStart.setIcon(iconStart) |
|
|||
994 | self.actionStart.setObjectName(_fromUtf8("actionStart")) |
|
|||
995 | self.actionPause = QtGui.QAction(MainWindow) |
|
|||
996 | self.actionPause.setIcon(iconPause) |
|
|||
997 | self.actionPause.setObjectName(_fromUtf8("actionPause")) |
|
|||
998 | self.actionStop = QtGui.QAction(MainWindow) |
|
|||
999 | self.actionStop.setIcon(iconStop) |
|
|||
1000 | self.actionStop.setObjectName(_fromUtf8("actionStop")) |
|
|||
1001 | self.actionAbout = QtGui.QAction(MainWindow) |
|
|||
1002 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) |
|
|||
1003 | self.actionOpenToolbar = QtGui.QAction(MainWindow) |
|
|||
1004 | self.actionOpenToolbar.setIcon(iconOpen) |
|
|||
1005 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) |
|
|||
1006 | self.actionCreateToolbar = QtGui.QAction(MainWindow) |
|
|||
1007 | self.actionCreateToolbar.setIcon(iconCreate) |
|
|||
1008 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) |
|
|||
1009 | self.actionSaveToolbar = QtGui.QAction(MainWindow) |
|
|||
1010 | self.actionSaveToolbar.setIcon(iconSave) |
|
|||
1011 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) |
|
|||
1012 | self.actionStarToolbar = QtGui.QAction(MainWindow) |
|
|||
1013 | self.actionStarToolbar.setIcon(iconStart) |
|
|||
1014 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) |
|
|||
1015 | self.actionStopToolbar = QtGui.QAction(MainWindow) |
|
|||
1016 | self.actionStopToolbar.setIcon(iconStop) |
|
|||
1017 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) |
|
|||
1018 | self.actionPauseToolbar = QtGui.QAction(MainWindow) |
|
|||
1019 | self.actionPause.setIcon(iconPause) |
|
|||
1020 | self.actionPauseToolbar.setIcon(iconPause) |
|
39 | self.actionPauseToolbar.setIcon(iconPause) | |
1021 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) |
|
|||
1022 | self.actionAddPU = QtGui.QAction(MainWindow) |
|
|||
1023 | self.actionAddPU.setIcon(iconAddPU) |
|
|||
1024 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) |
|
|||
1025 | self.actionFTP = QtGui.QAction(MainWindow) |
|
|||
1026 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) |
|
|||
1027 | self.toolBar.addAction(self.actionOpenToolbar) |
|
|||
1028 | self.toolBar.addSeparator() |
|
|||
1029 | self.toolBar.addAction(self.actionCreateToolbar) |
|
|||
1030 | self.toolBar.addSeparator() |
|
|||
1031 | self.toolBar.addAction(self.actionAddPU) |
|
|||
1032 | self.toolBar.addSeparator() |
|
|||
1033 | self.toolBar.addAction(self.actionSaveToolbar) |
|
|||
1034 | self.toolBar.addSeparator() |
|
|||
1035 | self.toolBar.addAction(self.actionStarToolbar) |
|
|||
1036 | self.toolBar.addSeparator() |
|
|||
1037 | self.toolBar.addAction(self.actionPauseToolbar) |
|
|||
1038 | self.toolBar.addSeparator() |
|
|||
1039 | self.toolBar.addAction(self.actionStopToolbar) |
|
|||
1040 | self.toolBar.addSeparator() |
|
|||
1041 | self.a=1 |
|
|||
1042 | self.actionPauseToolbar.triggered.connect(self.changeIcon) |
|
|||
1043 |
|
40 | |||
|
41 | self.paused = False | |||
1044 |
|
42 | |||
1045 | self.menuProject.addAction(self.actionOpen) |
|
43 | def changePauseIcon(self): | |
1046 | self.menuProject.addAction(self.actionCreate) |
|
|||
1047 | self.menuProject.addAction(self.actionSave) |
|
|||
1048 | self.menuProject.addAction(self.actionClose) |
|
|||
1049 | self.menuRun.addAction(self.actionStart) |
|
|||
1050 | self.menuRun.addAction(self.actionPause) |
|
|||
1051 | self.menuRun.addAction(self.actionStop) |
|
|||
1052 | self.menuOptions.addAction(self.actionFTP) |
|
|||
1053 | self.menuHelp.addAction(self.actionAbout) |
|
|||
1054 | self.menuBar.addAction(self.menuProject.menuAction()) |
|
|||
1055 | self.menuBar.addAction(self.menuRun.menuAction()) |
|
|||
1056 | self.menuBar.addAction(self.menuOptions.menuAction()) |
|
|||
1057 | self.menuBar.addAction(self.menuHelp.menuAction()) |
|
|||
1058 |
|
44 | |||
1059 | self.retranslateUi(MainWindow) |
|
45 | if self.paused == False: | |
1060 | self.tabWidgetProject.setCurrentIndex(0) |
|
|||
1061 | self.tabWidgetVoltage.setCurrentIndex(0) |
|
|||
1062 | self.tabWidgetSpectra.setCurrentIndex(0) |
|
|||
1063 | self.tabWidgetSpectraHeis.setCurrentIndex(0) |
|
|||
1064 | self.tabWidget_2.setCurrentIndex(0) |
|
|||
1065 | self.tabConsole.setCurrentIndex(0) |
|
|||
1066 | self.tabWidget.setCurrentIndex(0) |
|
|||
1067 | QtCore.QMetaObject.connectSlotsByName(MainWindow) |
|
|||
1068 |
|
||||
1069 | def changeIcon(self): |
|
|||
1070 |
|
||||
1071 | if self.a==1: |
|
|||
1072 | iconPauseRed = QtGui.QIcon() |
|
46 | iconPauseRed = QtGui.QIcon() | |
1073 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
47 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1074 | self.actionPauseToolbar.setIcon(iconPauseRed) |
|
48 | self.actionPauseToolbar.setIcon(iconPauseRed) | |
1075 |
self. |
|
49 | self.paused = True | |
1076 | return 0 |
|
50 | return 0 | |
1077 | if self.a==2: |
|
|||
1078 | iconPause = QtGui.QIcon() |
|
|||
1079 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
1080 | self.actionPauseToolbar.setIcon(iconPause) |
|
|||
1081 | self.a-=1 |
|
|||
1082 | return 0 |
|
|||
1083 |
|
||||
1084 | def retranslateUi(self, MainWindow): |
|
|||
1085 |
|
||||
1086 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) |
|
|||
1087 | self.label.setText(_translate("MainWindow", "Project Name :", None)) |
|
|||
1088 | self.label_11.setText(_translate("MainWindow", "DataType :", None)) |
|
|||
1089 | self.proComDataType.setItemText(0, _translate("MainWindow", "Voltage", None)) |
|
|||
1090 | self.proComDataType.setItemText(1, _translate("MainWindow", "Spectra", None)) |
|
|||
1091 | self.proComDataType.setItemText(2, _translate("MainWindow", "Fits", None)) |
|
|||
1092 | self.label_15.setText(_translate("MainWindow", "DataPath :", None)) |
|
|||
1093 | self.proToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1094 | self.label_23.setText(_translate("MainWindow", "Read Mode:", None)) |
|
|||
1095 | self.proComReadMode.setItemText(0, _translate("MainWindow", "Offline", None)) |
|
|||
1096 | self.proComReadMode.setItemText(1, _translate("MainWindow", "Online", None)) |
|
|||
1097 | self.label_33.setText(_translate("MainWindow", "Delay:", None)) |
|
|||
1098 | self.label_32.setText(_translate("MainWindow", "Walk :", None)) |
|
|||
1099 | self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None)) |
|
|||
1100 | self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None)) |
|
|||
1101 | self.proLoadButton.setText(_translate("MainWindow", "Load", None)) |
|
|||
1102 | self.label_10.setText(_translate("MainWindow", "Set:", None)) |
|
|||
1103 | self.label_27.setText(_translate("MainWindow", "Star Date:", None)) |
|
|||
1104 | self.label_28.setText(_translate("MainWindow", "End Date:", None)) |
|
|||
1105 | self.label_2.setText(_translate("MainWindow", "Start Time:", None)) |
|
|||
1106 | self.label_3.setText(_translate("MainWindow", "End Time:", None)) |
|
|||
1107 | self.label_30.setText(_translate("MainWindow", "Description:", None)) |
|
|||
1108 | self.proOk.setText(_translate("MainWindow", "Ok", None)) |
|
|||
1109 | self.proClear.setText(_translate("MainWindow", "Clear", None)) |
|
|||
1110 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabProject), _translate("MainWindow", "Project", None)) |
|
|||
1111 | self.volOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
|||
1112 | self.volGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
|||
1113 | self.volOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) |
|
|||
1114 | self.volOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) |
|
|||
1115 | self.volOpComChannels.setItemText(0, _translate("MainWindow", "Value", None)) |
|
|||
1116 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) |
|
|||
1117 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) |
|
|||
1118 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) |
|
|||
1119 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range List", None)) |
|
|||
1120 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) |
|
|||
1121 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) |
|
|||
1122 | self.label_4.setText(_translate("MainWindow", "Code:", None)) |
|
|||
1123 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) |
|
|||
1124 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) |
|
|||
1125 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) |
|
|||
1126 | self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) |
|
|||
1127 | self.label_5.setText(_translate("MainWindow", "Mode:", None)) |
|
|||
1128 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Barker 3", None)) |
|
|||
1129 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 4", None)) |
|
|||
1130 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 5", None)) |
|
|||
1131 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 7", None)) |
|
|||
1132 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 11", None)) |
|
|||
1133 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 13", None)) |
|
|||
1134 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 3 + Comp.", None)) |
|
|||
1135 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 4 + Comp.", None)) |
|
|||
1136 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 5 + Comp.", None)) |
|
|||
1137 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 7 + Comp.", None)) |
|
|||
1138 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 11+ Comp.", None)) |
|
|||
1139 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 13+ Comp.", None)) |
|
|||
1140 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Default", None)) |
|
|||
1141 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) |
|
|||
1142 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Freq 1", None)) |
|
|||
1143 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) |
|
|||
1144 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1145 | self.label_14.setText(_translate("MainWindow", "Scope", None)) |
|
|||
1146 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) |
|
|||
1147 | self.label_49.setText(_translate("MainWindow", "Show", None)) |
|
|||
1148 | self.label_51.setText(_translate("MainWindow", "Freq/Vel", None)) |
|
|||
1149 | self.label_12.setText(_translate("MainWindow", "Path :", None)) |
|
|||
1150 | self.label_13.setText(_translate("MainWindow", "Prefix:", None)) |
|
|||
1151 | self.label_52.setText(_translate("MainWindow", "Height range", None)) |
|
|||
1152 | self.label_50.setText(_translate("MainWindow", "Save", None)) |
|
|||
1153 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) |
|
|||
1154 | self.label_36.setText(_translate("MainWindow", "Type:", None)) |
|
|||
1155 | self.label_37.setText(_translate("MainWindow", "Path:", None)) |
|
|||
1156 | self.volOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1157 | self.volOutputComData.setItemText(0, _translate("MainWindow", ".rawdata", None)) |
|
|||
1158 | self.label_7.setText(_translate("MainWindow", "Blocks per File : ", None)) |
|
|||
1159 | self.label_35.setText(_translate("MainWindow", "Profiles per Block: ", None)) |
|
|||
1160 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.taboutputVoltage), _translate("MainWindow", "Output", None)) |
|
|||
1161 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabVoltage), _translate("MainWindow", "Voltage", None)) |
|
|||
1162 | self.specOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
|||
1163 | self.specGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
|||
1164 | self.specOpCebCrossSpectra.setText(_translate("MainWindow", "Select Cross Spectra", None)) |
|
|||
1165 | self.specOpComChannel.setItemText(0, _translate("MainWindow", "Value", None)) |
|
|||
1166 | self.specOpComChannel.setItemText(1, _translate("MainWindow", "Index", None)) |
|
|||
1167 | self.specOpComHeights.setItemText(0, _translate("MainWindow", "Value", None)) |
|
|||
1168 | self.specOpComHeights.setItemText(1, _translate("MainWindow", "Index", None)) |
|
|||
1169 | self.specOpCebRemoveDC.setText(_translate("MainWindow", "Remove DC", None)) |
|
|||
1170 | self.specOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) |
|
|||
1171 | self.specOpCebChannel.setText(_translate("MainWindow", "Select Channel", None)) |
|
|||
1172 | self.label_31.setText(_translate("MainWindow", "x-y pairs", None)) |
|
|||
1173 | self.label_26.setText(_translate("MainWindow", "nFFTPoints", None)) |
|
|||
1174 | self.specOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Integration", None)) |
|
|||
1175 | self.specOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) |
|
|||
1176 | self.specOpCobIncInt.setItemText(1, _translate("MainWindow", "Profiles", None)) |
|
|||
1177 | self.specOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) |
|
|||
1178 | self.label_21.setText(_translate("MainWindow", "Profiles", None)) |
|
|||
1179 | self.specOpCebRemoveInt.setText(_translate("MainWindow", "Remove Interference", None)) |
|
|||
1180 | self.label_70.setText(_translate("MainWindow", "IppFactor", None)) |
|
|||
1181 | self.specOpCebgetNoise.setText(_translate("MainWindow", "Get Noise", None)) |
|
|||
1182 | self.specOpComRemoveDC.setItemText(0, _translate("MainWindow", "Mode 1", None)) |
|
|||
1183 | self.specOpComRemoveDC.setItemText(1, _translate("MainWindow", "Mode 2", None)) |
|
|||
1184 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabopSpectra), _translate("MainWindow", "Operation", None)) |
|
|||
1185 | self.label_44.setText(_translate("MainWindow", "Coherence Map", None)) |
|
|||
1186 | self.label_20.setText(_translate("MainWindow", "Tmin, Tmax:", None)) |
|
|||
1187 | self.label_25.setText(_translate("MainWindow", "Prefix", None)) |
|
|||
1188 | self.label_42.setText(_translate("MainWindow", "RTI Plot", None)) |
|
|||
1189 | self.label_16.setText(_translate("MainWindow", "Height range", None)) |
|
|||
1190 | self.label_17.setText(_translate("MainWindow", "dB range", None)) |
|
|||
1191 | self.label_18.setText(_translate("MainWindow", "Magnitud ", None)) |
|
|||
1192 | self.label_24.setText(_translate("MainWindow", "Path", None)) |
|
|||
1193 | self.label_46.setText(_translate("MainWindow", "Power Profile", None)) |
|
|||
1194 | self.label_22.setText(_translate("MainWindow", "Freq/Vel:", None)) |
|
|||
1195 | self.label_41.setText(_translate("MainWindow", "Cross Spectra Plot", None)) |
|
|||
1196 | self.specGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1197 | self.label_6.setText(_translate("MainWindow", "Channel List:", None)) |
|
|||
1198 | self.label_40.setText(_translate("MainWindow", "Spectra Plot", None)) |
|
|||
1199 | self.label_43.setText(_translate("MainWindow", "Show", None)) |
|
|||
1200 | self.label_29.setText(_translate("MainWindow", "Wr Period:", None)) |
|
|||
1201 | self.label_47.setText(_translate("MainWindow", "Save", None)) |
|
|||
1202 | self.label_19.setText(_translate("MainWindow", "ftp", None)) |
|
|||
1203 | self.label_45.setText(_translate("MainWindow", "Noise", None)) |
|
|||
1204 | self.label_48.setText(_translate("MainWindow", "Time Range:", None)) |
|
|||
1205 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.tabgraphSpectra), _translate("MainWindow", "Graphics", None)) |
|
|||
1206 | self.label_39.setText(_translate("MainWindow", "Type:", None)) |
|
|||
1207 | self.specOutputComData.setItemText(0, _translate("MainWindow", ".pdata", None)) |
|
|||
1208 | self.label_34.setText(_translate("MainWindow", "Path:", None)) |
|
|||
1209 | self.specOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1210 | self.label_9.setText(_translate("MainWindow", "Blocks per File: ", None)) |
|
|||
1211 | self.label_38.setText(_translate("MainWindow", "Profile per Block: ", None)) |
|
|||
1212 | self.tabWidgetSpectra.setTabText(self.tabWidgetSpectra.indexOf(self.taboutputSpectra), _translate("MainWindow", "Output", None)) |
|
|||
1213 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectra), _translate("MainWindow", "Spectra", None)) |
|
|||
1214 | self.specHeisGraphClear.setText(_translate("MainWindow", "Clear", None)) |
|
|||
1215 | self.specHeisOpOk.setText(_translate("MainWindow", "Ok", None)) |
|
|||
1216 | self.specHeisOpCobIncInt.setItemText(0, _translate("MainWindow", "Time Interval", None)) |
|
|||
1217 | self.specHeisOpCebIncoherent.setText(_translate("MainWindow", "Incoherent Intergration", None)) |
|
|||
1218 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabopSpectraHeis), _translate("MainWindow", "Operation", None)) |
|
|||
1219 | self.label_54.setText(_translate("MainWindow", "Prefix", None)) |
|
|||
1220 | self.specHeisGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1221 | self.label_62.setText(_translate("MainWindow", "ymin - ymax", None)) |
|
|||
1222 | self.label_63.setText(_translate("MainWindow", "Tmin - Tmax:", None)) |
|
|||
1223 | self.label_64.setText(_translate("MainWindow", "Time Range:", None)) |
|
|||
1224 | self.label_65.setText(_translate("MainWindow", "Wr Period", None)) |
|
|||
1225 | self.label_60.setText(_translate("MainWindow", "Channel List:", None)) |
|
|||
1226 | self.label_61.setText(_translate("MainWindow", "xmin - xmax", None)) |
|
|||
1227 | self.label_56.setText(_translate("MainWindow", "Save", None)) |
|
|||
1228 | self.label_57.setText(_translate("MainWindow", "ftp", None)) |
|
|||
1229 | self.label_58.setText(_translate("MainWindow", "Spectra Plot", None)) |
|
|||
1230 | self.label_53.setText(_translate("MainWindow", "Path", None)) |
|
|||
1231 | self.label_55.setText(_translate("MainWindow", "Show", None)) |
|
|||
1232 | self.label_59.setText(_translate("MainWindow", "RTI PLot", None)) |
|
|||
1233 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.tabgraphSpectraHeis), _translate("MainWindow", "Graphics", None)) |
|
|||
1234 | self.label_67.setText(_translate("MainWindow", "Path:", None)) |
|
|||
1235 | self.label_68.setText(_translate("MainWindow", "Blocks per File:", None)) |
|
|||
1236 | self.label_66.setText(_translate("MainWindow", "Type:", None)) |
|
|||
1237 | self.specHeisOutputToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1238 | self.specHeisOutputComdata.setItemText(0, _translate("MainWindow", ".fits", None)) |
|
|||
1239 | self.label_69.setText(_translate("MainWindow", "Metada", None)) |
|
|||
1240 | self.specHeisOutputMetadaToolPath.setText(_translate("MainWindow", "...", None)) |
|
|||
1241 | self.tabWidgetSpectraHeis.setTabText(self.tabWidgetSpectraHeis.indexOf(self.taboutputSpectraHeis), _translate("MainWindow", "Output", None)) |
|
|||
1242 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabSpectraHeis), _translate("MainWindow", "SpectraHeis", None)) |
|
|||
1243 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation), _translate("MainWindow", "Operation", None)) |
|
|||
1244 | self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tabopCorrelation1), _translate("MainWindow", "Graphics", None)) |
|
|||
1245 | self.tabWidgetProject.setTabText(self.tabWidgetProject.indexOf(self.tabCorrelation), _translate("MainWindow", "Correlation", None)) |
|
|||
1246 |
|
||||
1247 |
|
||||
1248 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) |
|
|||
1249 |
|
51 | |||
1250 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) |
|
52 | if self.paused: | |
1251 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) |
|
|||
1252 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) |
|
|||
1253 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) |
|
|||
1254 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) |
|
|||
1255 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) |
|
|||
1256 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) |
|
|||
1257 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) |
|
|||
1258 | self.actionSave.setText(_translate("MainWindow", "Save", None)) |
|
|||
1259 | self.actionClose.setText(_translate("MainWindow", "Close", None)) |
|
|||
1260 | self.actionStart.setText(_translate("MainWindow", "Start", None)) |
|
|||
1261 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) |
|
|||
1262 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) |
|
|||
1263 | self.actionAbout.setText(_translate("MainWindow", "About", None)) |
|
|||
1264 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) |
|
|||
1265 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open Project", None)) |
|
|||
1266 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) |
|
|||
1267 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create αΉroject", None)) |
|
|||
1268 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) |
|
|||
1269 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save Project", None)) |
|
|||
1270 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) |
|
|||
1271 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) |
|
|||
1272 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) |
|
|||
1273 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) |
|
|||
1274 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) |
|
|||
1275 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) |
|
|||
1276 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) |
|
|||
1277 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) |
|
|||
1278 |
|
||||
1279 |
|
||||
1280 | class Ui_EnvWindow(object): |
|
|||
1281 |
|
||||
1282 | def changeIcon(self): |
|
|||
1283 |
|
||||
1284 | if self.a==1: |
|
|||
1285 | iconPauseRed = QtGui.QIcon() |
|
|||
1286 | iconPauseRed.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pausered.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
|||
1287 | self.actionPauseToolbar.setIcon(iconPauseRed) |
|
|||
1288 | self.a+=1 |
|
|||
1289 | return 0 |
|
|||
1290 | if self.a==2: |
|
|||
1291 | iconPause = QtGui.QIcon() |
|
53 | iconPause = QtGui.QIcon() | |
1292 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
54 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1293 | self.actionPauseToolbar.setIcon(iconPause) |
|
55 | self.actionPauseToolbar.setIcon(iconPause) | |
1294 |
self. |
|
56 | self.paused = False | |
1295 | return 0 |
|
57 | return 0 | |
1296 |
|
58 | |||
1297 | def setupUi(self, MainWindow): |
|
59 | def setupUi(self, MainWindow): | |
1298 |
|
60 | |||
1299 | MainWindow.setObjectName(_fromUtf8("MainWindow")) |
|
61 | MainWindow.setObjectName(_fromUtf8("MainWindow")) | |
1300 | MainWindow.resize(1203, 711) |
|
62 | MainWindow.resize(1203, 711) | |
1301 |
|
63 | |||
1302 | self.centralWidget = QtGui.QWidget(MainWindow) |
|
64 | self.centralWidget = QtGui.QWidget(MainWindow) | |
1303 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) |
|
65 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) | |
1304 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) |
|
66 | self.gridLayout_16 = QtGui.QGridLayout(self.centralWidget) | |
1305 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) |
|
67 | self.gridLayout_16.setObjectName(_fromUtf8("gridLayout_16")) | |
1306 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) |
|
68 | self.splitter_2 = QtGui.QSplitter(self.centralWidget) | |
1307 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) |
|
69 | self.splitter_2.setOrientation(QtCore.Qt.Horizontal) | |
1308 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) |
|
70 | self.splitter_2.setObjectName(_fromUtf8("splitter_2")) | |
1309 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) |
|
71 | self.projectExplorerTree = QtGui.QTreeView(self.splitter_2) | |
1310 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) |
|
72 | self.projectExplorerTree.setObjectName(_fromUtf8("projectExplorerTree")) | |
1311 | self.splitter = QtGui.QSplitter(self.splitter_2) |
|
73 | self.splitter = QtGui.QSplitter(self.splitter_2) | |
1312 | self.splitter.setOrientation(QtCore.Qt.Vertical) |
|
74 | self.splitter.setOrientation(QtCore.Qt.Vertical) | |
1313 | self.splitter.setObjectName(_fromUtf8("splitter")) |
|
75 | self.splitter.setObjectName(_fromUtf8("splitter")) | |
1314 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) |
|
76 | self.tabWidgetProject = QtGui.QTabWidget(self.splitter) | |
1315 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) |
|
77 | self.tabWidgetProject.setMinimumSize(QtCore.QSize(0, 278)) | |
1316 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) |
|
78 | self.tabWidgetProject.setMaximumSize(QtCore.QSize(16777215, 16777215)) | |
1317 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) |
|
79 | self.tabWidgetProject.setObjectName(_fromUtf8("tabWidgetProject")) | |
1318 |
|
80 | |||
1319 | self.tabConsole = QtGui.QTabWidget(self.splitter) |
|
81 | self.tabConsole = QtGui.QTabWidget(self.splitter) | |
1320 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) |
|
82 | self.tabConsole.setMinimumSize(QtCore.QSize(0, 0)) | |
1321 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) |
|
83 | self.tabConsole.setObjectName(_fromUtf8("tabConsole")) | |
1322 | self.tab_5 = QtGui.QWidget() |
|
84 | self.tab_5 = QtGui.QWidget() | |
1323 | self.tab_5.setObjectName(_fromUtf8("tab_5")) |
|
85 | self.tab_5.setObjectName(_fromUtf8("tab_5")) | |
1324 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) |
|
86 | self.gridLayout_4 = QtGui.QGridLayout(self.tab_5) | |
1325 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) |
|
87 | self.gridLayout_4.setObjectName(_fromUtf8("gridLayout_4")) | |
1326 | self.console = QtGui.QTextEdit(self.tab_5) |
|
88 | self.console = QtGui.QTextEdit(self.tab_5) | |
1327 | self.console.setObjectName(_fromUtf8("console")) |
|
89 | self.console.setObjectName(_fromUtf8("console")) | |
1328 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) |
|
90 | self.gridLayout_4.addWidget(self.console, 0, 0, 1, 1) | |
1329 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) |
|
91 | self.tabConsole.addTab(self.tab_5, _fromUtf8("")) | |
1330 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) |
|
92 | self.tabWidget = QtGui.QTabWidget(self.splitter_2) | |
1331 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) |
|
93 | self.tabWidget.setObjectName(_fromUtf8("tabWidget")) | |
1332 | self.tabProjectProperty = QtGui.QWidget() |
|
94 | self.tabProjectProperty = QtGui.QWidget() | |
1333 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) |
|
95 | self.tabProjectProperty.setObjectName(_fromUtf8("tabProjectProperty")) | |
1334 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) |
|
96 | self.gridLayout_8 = QtGui.QGridLayout(self.tabProjectProperty) | |
1335 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) |
|
97 | self.gridLayout_8.setObjectName(_fromUtf8("gridLayout_8")) | |
1336 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) |
|
98 | self.treeProjectProperties = QtGui.QTreeView(self.tabProjectProperty) | |
1337 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) |
|
99 | self.treeProjectProperties.setObjectName(_fromUtf8("treeProjectProperties")) | |
1338 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) |
|
100 | self.gridLayout_8.addWidget(self.treeProjectProperties, 0, 0, 1, 1) | |
1339 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) |
|
101 | self.tabWidget.addTab(self.tabProjectProperty, _fromUtf8("")) | |
1340 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) |
|
102 | self.gridLayout_16.addWidget(self.splitter_2, 1, 0, 1, 1) | |
1341 |
|
103 | |||
1342 | MainWindow.setCentralWidget(self.centralWidget) |
|
104 | MainWindow.setCentralWidget(self.centralWidget) | |
1343 | self.toolBar = QtGui.QToolBar(MainWindow) |
|
105 | self.toolBar = QtGui.QToolBar(MainWindow) | |
1344 | self.toolBar.setObjectName(_fromUtf8("toolBar")) |
|
106 | self.toolBar.setObjectName(_fromUtf8("toolBar")) | |
1345 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) |
|
107 | MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar) | |
1346 |
|
108 | |||
1347 | self.menuBar = QtGui.QMenuBar(MainWindow) |
|
109 | self.menuBar = QtGui.QMenuBar(MainWindow) | |
1348 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) |
|
110 | self.menuBar.setGeometry(QtCore.QRect(0, 0, 1065, 25)) | |
1349 | self.menuBar.setObjectName(_fromUtf8("menuBar")) |
|
111 | self.menuBar.setObjectName(_fromUtf8("menuBar")) | |
1350 | self.menuProject = QtGui.QMenu(self.menuBar) |
|
112 | self.menuProject = QtGui.QMenu(self.menuBar) | |
1351 | self.menuProject.setObjectName(_fromUtf8("menuProject")) |
|
113 | self.menuProject.setObjectName(_fromUtf8("menuProject")) | |
1352 | self.menuRun = QtGui.QMenu(self.menuBar) |
|
114 | self.menuRun = QtGui.QMenu(self.menuBar) | |
1353 | self.menuRun.setObjectName(_fromUtf8("menuRun")) |
|
115 | self.menuRun.setObjectName(_fromUtf8("menuRun")) | |
1354 | self.menuOptions = QtGui.QMenu(self.menuBar) |
|
116 | self.menuOptions = QtGui.QMenu(self.menuBar) | |
1355 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) |
|
117 | self.menuOptions.setObjectName(_fromUtf8("menuOptions")) | |
1356 | self.menuHelp = QtGui.QMenu(self.menuBar) |
|
118 | self.menuHelp = QtGui.QMenu(self.menuBar) | |
1357 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) |
|
119 | self.menuHelp.setObjectName(_fromUtf8("menuHelp")) | |
1358 | MainWindow.setMenuBar(self.menuBar) |
|
120 | MainWindow.setMenuBar(self.menuBar) | |
1359 |
|
121 | |||
1360 | iconOpen = QtGui.QIcon() |
|
122 | iconOpen = QtGui.QIcon() | |
1361 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
123 | iconOpen.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"open.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1362 | iconCreate = QtGui.QIcon() |
|
124 | iconCreate = QtGui.QIcon() | |
1363 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
125 | iconCreate.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"project.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1364 | iconSave = QtGui.QIcon() |
|
126 | iconSave = QtGui.QIcon() | |
1365 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
127 | iconSave.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"saveicon.jpeg") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1366 | iconStart = QtGui.QIcon() |
|
128 | iconStart = QtGui.QIcon() | |
1367 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
129 | iconStart.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"startServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1368 | iconStop = QtGui.QIcon() |
|
130 | iconStop = QtGui.QIcon() | |
1369 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
131 | iconStop.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"stopServer.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1370 | iconPause = QtGui.QIcon() |
|
132 | iconPause = QtGui.QIcon() | |
1371 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
133 | iconPause.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"pause.png") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1372 | iconAddPU = QtGui.QIcon() |
|
134 | iconAddPU = QtGui.QIcon() | |
1373 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) |
|
135 | iconAddPU.addPixmap(QtGui.QPixmap(_fromUtf8( os.path.join(FIGURES_PATH,"add_PU.gif") )), QtGui.QIcon.Normal, QtGui.QIcon.Off) | |
1374 |
|
136 | |||
1375 | self.actionOpen = QtGui.QAction(MainWindow) |
|
137 | self.actionOpen = QtGui.QAction(MainWindow) | |
1376 | self.actionOpen.setIcon(iconOpen) |
|
138 | self.actionOpen.setIcon(iconOpen) | |
1377 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) |
|
139 | self.actionOpen.setObjectName(_fromUtf8("actionOpen")) | |
1378 | self.actionCreate = QtGui.QAction(MainWindow) |
|
140 | self.actionCreate = QtGui.QAction(MainWindow) | |
1379 | self.actionCreate.setIcon(iconCreate) |
|
141 | self.actionCreate.setIcon(iconCreate) | |
1380 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) |
|
142 | self.actionCreate.setObjectName(_fromUtf8("actionCreate")) | |
1381 | self.actionSave = QtGui.QAction(MainWindow) |
|
143 | self.actionSave = QtGui.QAction(MainWindow) | |
1382 | self.actionSave.setIcon(iconSave) |
|
144 | self.actionSave.setIcon(iconSave) | |
1383 | self.actionSave.setObjectName(_fromUtf8("actionSave")) |
|
145 | self.actionSave.setObjectName(_fromUtf8("actionSave")) | |
1384 | self.actionClose = QtGui.QAction(MainWindow) |
|
146 | self.actionClose = QtGui.QAction(MainWindow) | |
1385 | self.actionClose.setObjectName(_fromUtf8("actionClose")) |
|
147 | self.actionClose.setObjectName(_fromUtf8("actionClose")) | |
1386 | self.actionStart = QtGui.QAction(MainWindow) |
|
148 | self.actionStart = QtGui.QAction(MainWindow) | |
1387 | self.actionStart.setIcon(iconStart) |
|
149 | self.actionStart.setIcon(iconStart) | |
1388 | self.actionStart.setObjectName(_fromUtf8("actionStart")) |
|
150 | self.actionStart.setObjectName(_fromUtf8("actionStart")) | |
1389 | self.actionPause = QtGui.QAction(MainWindow) |
|
151 | self.actionPause = QtGui.QAction(MainWindow) | |
1390 | self.actionPause.setIcon(iconPause) |
|
152 | self.actionPause.setIcon(iconPause) | |
1391 | self.actionPause.setObjectName(_fromUtf8("actionPause")) |
|
153 | self.actionPause.setObjectName(_fromUtf8("actionPause")) | |
1392 | self.actionStop = QtGui.QAction(MainWindow) |
|
154 | self.actionStop = QtGui.QAction(MainWindow) | |
1393 | self.actionStop.setIcon(iconStop) |
|
155 | self.actionStop.setIcon(iconStop) | |
1394 | self.actionStop.setObjectName(_fromUtf8("actionStop")) |
|
156 | self.actionStop.setObjectName(_fromUtf8("actionStop")) | |
1395 | self.actionAbout = QtGui.QAction(MainWindow) |
|
157 | self.actionAbout = QtGui.QAction(MainWindow) | |
1396 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) |
|
158 | self.actionAbout.setObjectName(_fromUtf8("actionAbout")) | |
1397 | self.actionOpenToolbar = QtGui.QAction(MainWindow) |
|
159 | self.actionOpenToolbar = QtGui.QAction(MainWindow) | |
1398 | self.actionOpenToolbar.setIcon(iconOpen) |
|
160 | self.actionOpenToolbar.setIcon(iconOpen) | |
1399 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) |
|
161 | self.actionOpenToolbar.setObjectName(_fromUtf8("actionOpenToolbar")) | |
1400 | self.actionCreateToolbar = QtGui.QAction(MainWindow) |
|
162 | self.actionCreateToolbar = QtGui.QAction(MainWindow) | |
1401 | self.actionCreateToolbar.setIcon(iconCreate) |
|
163 | self.actionCreateToolbar.setIcon(iconCreate) | |
1402 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) |
|
164 | self.actionCreateToolbar.setObjectName(_fromUtf8("actionCreateToolbar")) | |
1403 | self.actionSaveToolbar = QtGui.QAction(MainWindow) |
|
165 | self.actionSaveToolbar = QtGui.QAction(MainWindow) | |
1404 | self.actionSaveToolbar.setIcon(iconSave) |
|
166 | self.actionSaveToolbar.setIcon(iconSave) | |
1405 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) |
|
167 | self.actionSaveToolbar.setObjectName(_fromUtf8("actionSaveToolbar")) | |
1406 | self.actionStarToolbar = QtGui.QAction(MainWindow) |
|
168 | self.actionStarToolbar = QtGui.QAction(MainWindow) | |
1407 | self.actionStarToolbar.setIcon(iconStart) |
|
169 | self.actionStarToolbar.setIcon(iconStart) | |
1408 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) |
|
170 | self.actionStarToolbar.setObjectName(_fromUtf8("actionStarToolbar")) | |
1409 | self.actionStopToolbar = QtGui.QAction(MainWindow) |
|
171 | self.actionStopToolbar = QtGui.QAction(MainWindow) | |
1410 | self.actionStopToolbar.setIcon(iconStop) |
|
172 | self.actionStopToolbar.setIcon(iconStop) | |
1411 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) |
|
173 | self.actionStopToolbar.setObjectName(_fromUtf8("actionStopToolbar")) | |
1412 | self.actionPauseToolbar = QtGui.QAction(MainWindow) |
|
174 | self.actionPauseToolbar = QtGui.QAction(MainWindow) | |
1413 | self.actionPause.setIcon(iconPause) |
|
175 | self.actionPause.setIcon(iconPause) | |
1414 | self.actionPauseToolbar.setIcon(iconPause) |
|
176 | self.actionPauseToolbar.setIcon(iconPause) | |
1415 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) |
|
177 | self.actionPauseToolbar.setObjectName(_fromUtf8("actionPauseToolbar")) | |
1416 | self.actionAddPU = QtGui.QAction(MainWindow) |
|
178 | self.actionAddPU = QtGui.QAction(MainWindow) | |
1417 | self.actionAddPU.setIcon(iconAddPU) |
|
179 | self.actionAddPU.setIcon(iconAddPU) | |
1418 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) |
|
180 | self.actionAddPU.setObjectName(_fromUtf8("actionAddPU")) | |
1419 | self.actionFTP = QtGui.QAction(MainWindow) |
|
181 | self.actionFTP = QtGui.QAction(MainWindow) | |
1420 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) |
|
182 | self.actionFTP.setObjectName(_fromUtf8("actionFTP")) | |
1421 | self.toolBar.addAction(self.actionOpenToolbar) |
|
183 | self.toolBar.addAction(self.actionOpenToolbar) | |
1422 | self.toolBar.addSeparator() |
|
184 | self.toolBar.addSeparator() | |
1423 | self.toolBar.addAction(self.actionCreateToolbar) |
|
185 | self.toolBar.addAction(self.actionCreateToolbar) | |
1424 | self.toolBar.addSeparator() |
|
186 | self.toolBar.addSeparator() | |
1425 | self.toolBar.addAction(self.actionAddPU) |
|
187 | self.toolBar.addAction(self.actionAddPU) | |
1426 | self.toolBar.addSeparator() |
|
188 | self.toolBar.addSeparator() | |
1427 | self.toolBar.addAction(self.actionSaveToolbar) |
|
189 | self.toolBar.addAction(self.actionSaveToolbar) | |
1428 | self.toolBar.addSeparator() |
|
190 | self.toolBar.addSeparator() | |
1429 | self.toolBar.addAction(self.actionStarToolbar) |
|
191 | self.toolBar.addAction(self.actionStarToolbar) | |
1430 | self.toolBar.addSeparator() |
|
192 | self.toolBar.addSeparator() | |
1431 | self.toolBar.addAction(self.actionPauseToolbar) |
|
193 | self.toolBar.addAction(self.actionPauseToolbar) | |
1432 | self.toolBar.addSeparator() |
|
194 | self.toolBar.addSeparator() | |
1433 | self.toolBar.addAction(self.actionStopToolbar) |
|
195 | self.toolBar.addAction(self.actionStopToolbar) | |
1434 | self.toolBar.addSeparator() |
|
196 | self.toolBar.addSeparator() | |
1435 |
|
|
197 | ||
1436 | self.actionPauseToolbar.triggered.connect(self.changeIcon) |
|
198 | self.paused=False | |
|
199 | self.actionPause.triggered.connect(self.changePauseIcon) | |||
|
200 | self.actionPauseToolbar.triggered.connect(self.changePauseIcon) | |||
1437 |
|
201 | |||
1438 | self.menuProject.addAction(self.actionOpen) |
|
202 | self.menuProject.addAction(self.actionOpen) | |
1439 | self.menuProject.addAction(self.actionCreate) |
|
203 | self.menuProject.addAction(self.actionCreate) | |
1440 | self.menuProject.addAction(self.actionSave) |
|
204 | self.menuProject.addAction(self.actionSave) | |
1441 | self.menuProject.addAction(self.actionClose) |
|
205 | self.menuProject.addAction(self.actionClose) | |
1442 | self.menuRun.addAction(self.actionStart) |
|
206 | self.menuRun.addAction(self.actionStart) | |
1443 | self.menuRun.addAction(self.actionPause) |
|
207 | self.menuRun.addAction(self.actionPause) | |
1444 | self.menuRun.addAction(self.actionStop) |
|
208 | self.menuRun.addAction(self.actionStop) | |
1445 | self.menuOptions.addAction(self.actionFTP) |
|
209 | self.menuOptions.addAction(self.actionFTP) | |
1446 | self.menuHelp.addAction(self.actionAbout) |
|
210 | self.menuHelp.addAction(self.actionAbout) | |
1447 | self.menuBar.addAction(self.menuProject.menuAction()) |
|
211 | self.menuBar.addAction(self.menuProject.menuAction()) | |
1448 | self.menuBar.addAction(self.menuRun.menuAction()) |
|
212 | self.menuBar.addAction(self.menuRun.menuAction()) | |
1449 | self.menuBar.addAction(self.menuOptions.menuAction()) |
|
213 | self.menuBar.addAction(self.menuOptions.menuAction()) | |
1450 | self.menuBar.addAction(self.menuHelp.menuAction()) |
|
214 | self.menuBar.addAction(self.menuHelp.menuAction()) | |
1451 |
|
215 | |||
1452 | self.tabConsole.setCurrentIndex(0) |
|
216 | self.tabConsole.setCurrentIndex(0) | |
1453 | self.tabWidget.setCurrentIndex(0) |
|
217 | self.tabWidget.setCurrentIndex(0) | |
1454 |
|
218 | |||
1455 | def retranslateUi(self, MainWindow): |
|
219 | def retranslateUi(self, MainWindow): | |
1456 |
|
220 | |||
1457 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) |
|
221 | MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None)) | |
1458 |
|
222 | |||
1459 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) |
|
223 | self.tabConsole.setTabText(self.tabConsole.indexOf(self.tab_5), _translate("MainWindow", "Console", None)) | |
1460 |
|
224 | |||
1461 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) |
|
225 | self.tabWidget.setTabText(self.tabWidget.indexOf(self.tabProjectProperty), _translate("MainWindow", "Project Property", None)) | |
1462 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) |
|
226 | self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar", None)) | |
1463 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) |
|
227 | self.menuProject.setTitle(_translate("MainWindow", "Project", None)) | |
1464 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) |
|
228 | self.menuRun.setTitle(_translate("MainWindow", "Run", None)) | |
1465 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) |
|
229 | self.menuOptions.setTitle(_translate("MainWindow", "Options", None)) | |
1466 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) |
|
230 | self.menuHelp.setTitle(_translate("MainWindow", "Help", None)) | |
1467 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) |
|
231 | self.actionOpen.setText(_translate("MainWindow", "Open", None)) | |
1468 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) |
|
232 | self.actionCreate.setText(_translate("MainWindow", "Create", None)) | |
1469 | self.actionSave.setText(_translate("MainWindow", "Save", None)) |
|
233 | self.actionSave.setText(_translate("MainWindow", "Save", None)) | |
1470 | self.actionClose.setText(_translate("MainWindow", "Close", None)) |
|
234 | self.actionClose.setText(_translate("MainWindow", "Close", None)) | |
1471 | self.actionStart.setText(_translate("MainWindow", "Start", None)) |
|
235 | self.actionStart.setText(_translate("MainWindow", "Start", None)) | |
1472 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) |
|
236 | self.actionPause.setText(_translate("MainWindow", "Pause", None)) | |
1473 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) |
|
237 | self.actionStop.setText(_translate("MainWindow", "Stop", None)) | |
1474 | self.actionAbout.setText(_translate("MainWindow", "About", None)) |
|
238 | self.actionAbout.setText(_translate("MainWindow", "About", None)) | |
1475 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) |
|
239 | self.actionOpenToolbar.setText(_translate("MainWindow", "openToolbar", None)) | |
1476 |
self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open |
|
240 | self.actionOpenToolbar.setToolTip(_translate("MainWindow", "Open a project", None)) | |
1477 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) |
|
241 | self.actionCreateToolbar.setText(_translate("MainWindow", "createToolbar", None)) | |
1478 |
self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create |
|
242 | self.actionCreateToolbar.setToolTip(_translate("MainWindow", "Create a new project", None)) | |
1479 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) |
|
243 | self.actionSaveToolbar.setText(_translate("MainWindow", "saveToolbar", None)) | |
1480 |
self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save |
|
244 | self.actionSaveToolbar.setToolTip(_translate("MainWindow", "Save a project", None)) | |
1481 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) |
|
245 | self.actionStarToolbar.setText(_translate("MainWindow", "starToolbar", None)) | |
1482 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start ", None)) |
|
246 | self.actionStarToolbar.setToolTip(_translate("MainWindow", "Start process", None)) | |
1483 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) |
|
247 | self.actionStopToolbar.setText(_translate("MainWindow", "stopToolbar", None)) | |
1484 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop", None)) |
|
248 | self.actionStopToolbar.setToolTip(_translate("MainWindow", "Stop process", None)) | |
1485 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) |
|
249 | self.actionPauseToolbar.setText(_translate("MainWindow", "pauseToolbar", None)) | |
1486 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause", None)) |
|
250 | self.actionPauseToolbar.setToolTip(_translate("MainWindow", "Pause process", None)) | |
1487 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) |
|
251 | self.actionAddPU.setText(_translate("MainWindow", "Add Processing Unit", None)) | |
1488 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) |
|
252 | self.actionFTP.setText(_translate("MainWindow", "FTP", None)) | |
1489 |
|
|
253 | ||
|
254 | def closeEvent(self, event): | |||
|
255 | ||||
|
256 | reply = QtGui.QMessageBox.question(self, 'Message', | |||
|
257 | "Are you sure to quit?", QtGui.QMessageBox.Yes | | |||
|
258 | QtGui.QMessageBox.No, QtGui.QMessageBox.No) | |||
|
259 | if reply == QtGui.QMessageBox.Yes: | |||
|
260 | event.accept() | |||
|
261 | else: | |||
|
262 | event.ignore() | |||
|
263 | ||||
1490 | class Ui_BasicWindow(Ui_EnvWindow, Ui_ProjectTab, Ui_VoltageTab, Ui_SpectraTab, Ui_SpectraHeisTab, Ui_CorrelationTab): |
|
264 | class Ui_BasicWindow(Ui_EnvWindow, Ui_ProjectTab, Ui_VoltageTab, Ui_SpectraTab, Ui_SpectraHeisTab, Ui_CorrelationTab): | |
1491 |
|
265 | |||
1492 | def setupUi(self, MainWindow): |
|
266 | def setupUi(self, MainWindow): | |
1493 |
|
267 | |||
1494 | Ui_EnvWindow.setupUi(self, MainWindow) |
|
268 | Ui_EnvWindow.setupUi(self, MainWindow) | |
1495 |
|
269 | |||
1496 | Ui_ProjectTab.setupUi(self) |
|
270 | Ui_ProjectTab.setupUi(self) | |
1497 | Ui_VoltageTab.setupUi(self) |
|
271 | Ui_VoltageTab.setupUi(self) | |
1498 | Ui_SpectraTab.setupUi(self) |
|
272 | Ui_SpectraTab.setupUi(self) | |
1499 | Ui_SpectraHeisTab.setupUi(self) |
|
273 | Ui_SpectraHeisTab.setupUi(self) | |
1500 | Ui_CorrelationTab.setupUi(self) |
|
274 | Ui_CorrelationTab.setupUi(self) | |
1501 |
|
275 | |||
1502 | self.retranslateUi(MainWindow) |
|
276 | self.retranslateUi(MainWindow) | |
1503 |
|
277 | |||
1504 | QtCore.QMetaObject.connectSlotsByName(MainWindow) |
|
278 | QtCore.QMetaObject.connectSlotsByName(MainWindow) | |
1505 |
|
279 | |||
1506 | def retranslateUi(self, MainWindow): |
|
280 | def retranslateUi(self, MainWindow): | |
1507 |
|
281 | |||
1508 | Ui_EnvWindow.retranslateUi(self, MainWindow) |
|
282 | Ui_EnvWindow.retranslateUi(self, MainWindow) | |
1509 |
|
283 | |||
1510 | Ui_ProjectTab.retranslateUi(self) |
|
284 | Ui_ProjectTab.retranslateUi(self) | |
1511 | Ui_VoltageTab.retranslateUi(self) |
|
285 | Ui_VoltageTab.retranslateUi(self) | |
1512 | Ui_SpectraTab.retranslateUi(self) |
|
286 | Ui_SpectraTab.retranslateUi(self) | |
1513 | Ui_SpectraHeisTab.retranslateUi(self) |
|
287 | Ui_SpectraHeisTab.retranslateUi(self) | |
1514 | Ui_CorrelationTab.retranslateUi(self) |
|
288 | Ui_CorrelationTab.retranslateUi(self) | |
1515 |
|
289 | |||
1516 |
|
290 | |||
1517 |
class Ui_AdvancedWindow(Ui_ |
|
291 | class Ui_AdvancedWindow(Ui_EnvWindow): | |
1518 |
|
292 | |||
1519 | def setupUi(self, AdvancedWindow): |
|
293 | def setupUi(self, AdvancedWindow): | |
1520 |
|
294 | |||
1521 | Ui_MainWindow.setupUi(self, AdvancedWindow) |
|
295 | Ui_MainWindow.setupUi(self, AdvancedWindow) | |
1522 |
|
296 | |||
1523 | def retranslateUi(self, AdvancedWindow): |
|
297 | def retranslateUi(self, AdvancedWindow): | |
1524 |
|
298 | |||
1525 | Ui_MainWindow.retranslateUi(self, AdvancedWindow) |
|
299 | Ui_MainWindow.retranslateUi(self, AdvancedWindow) | |
1526 |
|
300 | |||
1527 |
|
301 | |||
1528 |
|
302 | |||
1529 | if __name__ == "__main__": |
|
303 | if __name__ == "__main__": | |
1530 | import sys |
|
304 | import sys | |
1531 | app = QtGui.QApplication(sys.argv) |
|
305 | app = QtGui.QApplication(sys.argv) | |
1532 | MainWindow = QtGui.QMainWindow() |
|
306 | MainWindow = QtGui.QMainWindow() | |
1533 | ui = Ui_BasicWindow() |
|
307 | ui = Ui_BasicWindow() | |
1534 | ui.setupUi(MainWindow) |
|
308 | ui.setupUi(MainWindow) | |
1535 | MainWindow.show() |
|
309 | MainWindow.show() | |
1536 | sys.exit(app.exec_()) |
|
310 | sys.exit(app.exec_()) | |
1537 |
|
311 |
@@ -1,936 +1,938 | |||||
1 | import numpy |
|
1 | import numpy | |
2 | import math |
|
2 | import math | |
3 |
|
3 | |||
4 | from jroproc_base import ProcessingUnit, Operation |
|
4 | from jroproc_base import ProcessingUnit, Operation | |
5 | from schainpy.model.data.jrodata import Spectra |
|
5 | from schainpy.model.data.jrodata import Spectra | |
6 | from schainpy.model.data.jrodata import hildebrand_sekhon |
|
6 | from schainpy.model.data.jrodata import hildebrand_sekhon | |
7 |
|
7 | |||
8 | class SpectraProc(ProcessingUnit): |
|
8 | class SpectraProc(ProcessingUnit): | |
9 |
|
9 | |||
10 | def __init__(self): |
|
10 | def __init__(self): | |
11 |
|
11 | |||
12 | ProcessingUnit.__init__(self) |
|
12 | ProcessingUnit.__init__(self) | |
13 |
|
13 | |||
14 | self.buffer = None |
|
14 | self.buffer = None | |
15 | self.firstdatatime = None |
|
15 | self.firstdatatime = None | |
16 | self.profIndex = 0 |
|
16 | self.profIndex = 0 | |
17 | self.dataOut = Spectra() |
|
17 | self.dataOut = Spectra() | |
18 | self.id_min = None |
|
18 | self.id_min = None | |
19 | self.id_max = None |
|
19 | self.id_max = None | |
20 |
|
20 | |||
21 | def __updateObjFromInput(self): |
|
21 | def __updateObjFromInput(self): | |
22 |
|
22 | |||
23 | self.dataOut.timeZone = self.dataIn.timeZone |
|
23 | self.dataOut.timeZone = self.dataIn.timeZone | |
24 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
24 | self.dataOut.dstFlag = self.dataIn.dstFlag | |
25 | self.dataOut.errorCount = self.dataIn.errorCount |
|
25 | self.dataOut.errorCount = self.dataIn.errorCount | |
26 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
26 | self.dataOut.useLocalTime = self.dataIn.useLocalTime | |
27 |
|
27 | |||
28 | self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy() |
|
28 | self.dataOut.radarControllerHeaderObj = self.dataIn.radarControllerHeaderObj.copy() | |
29 | self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy() |
|
29 | self.dataOut.systemHeaderObj = self.dataIn.systemHeaderObj.copy() | |
30 | self.dataOut.channelList = self.dataIn.channelList |
|
30 | self.dataOut.channelList = self.dataIn.channelList | |
31 | self.dataOut.heightList = self.dataIn.heightList |
|
31 | self.dataOut.heightList = self.dataIn.heightList | |
32 | self.dataOut.dtype = numpy.dtype([('real','<f4'),('imag','<f4')]) |
|
32 | self.dataOut.dtype = numpy.dtype([('real','<f4'),('imag','<f4')]) | |
33 | # self.dataOut.nHeights = self.dataIn.nHeights |
|
33 | # self.dataOut.nHeights = self.dataIn.nHeights | |
34 | # self.dataOut.nChannels = self.dataIn.nChannels |
|
34 | # self.dataOut.nChannels = self.dataIn.nChannels | |
35 | self.dataOut.nBaud = self.dataIn.nBaud |
|
35 | self.dataOut.nBaud = self.dataIn.nBaud | |
36 | self.dataOut.nCode = self.dataIn.nCode |
|
36 | self.dataOut.nCode = self.dataIn.nCode | |
37 | self.dataOut.code = self.dataIn.code |
|
37 | self.dataOut.code = self.dataIn.code | |
38 | self.dataOut.nProfiles = self.dataOut.nFFTPoints |
|
38 | self.dataOut.nProfiles = self.dataOut.nFFTPoints | |
39 | # self.dataOut.channelIndexList = self.dataIn.channelIndexList |
|
39 | # self.dataOut.channelIndexList = self.dataIn.channelIndexList | |
40 | self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock |
|
40 | self.dataOut.flagDiscontinuousBlock = self.dataIn.flagDiscontinuousBlock | |
41 | self.dataOut.utctime = self.firstdatatime |
|
41 | self.dataOut.utctime = self.firstdatatime | |
42 | self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada |
|
42 | self.dataOut.flagDecodeData = self.dataIn.flagDecodeData #asumo q la data esta decodificada | |
43 | self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip |
|
43 | self.dataOut.flagDeflipData = self.dataIn.flagDeflipData #asumo q la data esta sin flip | |
44 | # self.dataOut.flagShiftFFT = self.dataIn.flagShiftFFT |
|
44 | # self.dataOut.flagShiftFFT = self.dataIn.flagShiftFFT | |
45 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
45 | self.dataOut.nCohInt = self.dataIn.nCohInt | |
46 | self.dataOut.nIncohInt = 1 |
|
46 | self.dataOut.nIncohInt = 1 | |
47 | # self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
47 | # self.dataOut.ippSeconds = self.dataIn.ippSeconds | |
48 | self.dataOut.windowOfFilter = self.dataIn.windowOfFilter |
|
48 | self.dataOut.windowOfFilter = self.dataIn.windowOfFilter | |
49 |
|
49 | |||
50 | # self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt |
|
50 | # self.dataOut.timeInterval = self.dataIn.timeInterval*self.dataOut.nFFTPoints*self.dataOut.nIncohInt | |
51 | self.dataOut.frequency = self.dataIn.frequency |
|
51 | self.dataOut.frequency = self.dataIn.frequency | |
52 | self.dataOut.realtime = self.dataIn.realtime |
|
52 | self.dataOut.realtime = self.dataIn.realtime | |
53 |
|
53 | |||
54 | self.dataOut.azimuth = self.dataIn.azimuth |
|
54 | self.dataOut.azimuth = self.dataIn.azimuth | |
55 | self.dataOut.zenith = self.dataIn.zenith |
|
55 | self.dataOut.zenith = self.dataIn.zenith | |
56 |
|
56 | |||
57 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
57 | self.dataOut.beam.codeList = self.dataIn.beam.codeList | |
58 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
58 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList | |
59 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
59 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList | |
60 |
|
60 | |||
61 | def __getFft(self): |
|
61 | def __getFft(self): | |
62 | """ |
|
62 | """ | |
63 | Convierte valores de Voltaje a Spectra |
|
63 | Convierte valores de Voltaje a Spectra | |
64 |
|
64 | |||
65 | Affected: |
|
65 | Affected: | |
66 | self.dataOut.data_spc |
|
66 | self.dataOut.data_spc | |
67 | self.dataOut.data_cspc |
|
67 | self.dataOut.data_cspc | |
68 | self.dataOut.data_dc |
|
68 | self.dataOut.data_dc | |
69 | self.dataOut.heightList |
|
69 | self.dataOut.heightList | |
70 | self.profIndex |
|
70 | self.profIndex | |
71 | self.buffer |
|
71 | self.buffer | |
72 | self.dataOut.flagNoData |
|
72 | self.dataOut.flagNoData | |
73 | """ |
|
73 | """ | |
74 | fft_volt = numpy.fft.fft(self.buffer,n=self.dataOut.nFFTPoints,axis=1) |
|
74 | fft_volt = numpy.fft.fft(self.buffer,n=self.dataOut.nFFTPoints,axis=1) | |
75 | fft_volt = fft_volt.astype(numpy.dtype('complex')) |
|
75 | fft_volt = fft_volt.astype(numpy.dtype('complex')) | |
76 | dc = fft_volt[:,0,:] |
|
76 | dc = fft_volt[:,0,:] | |
77 |
|
77 | |||
78 | #calculo de self-spectra |
|
78 | #calculo de self-spectra | |
79 | fft_volt = numpy.fft.fftshift(fft_volt,axes=(1,)) |
|
79 | fft_volt = numpy.fft.fftshift(fft_volt,axes=(1,)) | |
80 | spc = fft_volt * numpy.conjugate(fft_volt) |
|
80 | spc = fft_volt * numpy.conjugate(fft_volt) | |
81 | spc = spc.real |
|
81 | spc = spc.real | |
82 |
|
82 | |||
83 | blocksize = 0 |
|
83 | blocksize = 0 | |
84 | blocksize += dc.size |
|
84 | blocksize += dc.size | |
85 | blocksize += spc.size |
|
85 | blocksize += spc.size | |
86 |
|
86 | |||
87 | cspc = None |
|
87 | cspc = None | |
88 | pairIndex = 0 |
|
88 | pairIndex = 0 | |
89 | if self.dataOut.pairsList != None: |
|
89 | if self.dataOut.pairsList != None: | |
90 | #calculo de cross-spectra |
|
90 | #calculo de cross-spectra | |
91 | cspc = numpy.zeros((self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex') |
|
91 | cspc = numpy.zeros((self.dataOut.nPairs, self.dataOut.nFFTPoints, self.dataOut.nHeights), dtype='complex') | |
92 | for pair in self.dataOut.pairsList: |
|
92 | for pair in self.dataOut.pairsList: | |
93 | cspc[pairIndex,:,:] = fft_volt[pair[0],:,:] * numpy.conjugate(fft_volt[pair[1],:,:]) |
|
93 | cspc[pairIndex,:,:] = fft_volt[pair[0],:,:] * numpy.conjugate(fft_volt[pair[1],:,:]) | |
94 | pairIndex += 1 |
|
94 | pairIndex += 1 | |
95 | blocksize += cspc.size |
|
95 | blocksize += cspc.size | |
96 |
|
96 | |||
97 | self.dataOut.data_spc = spc |
|
97 | self.dataOut.data_spc = spc | |
98 | self.dataOut.data_cspc = cspc |
|
98 | self.dataOut.data_cspc = cspc | |
99 | self.dataOut.data_dc = dc |
|
99 | self.dataOut.data_dc = dc | |
100 | self.dataOut.blockSize = blocksize |
|
100 | self.dataOut.blockSize = blocksize | |
101 | self.dataOut.flagShiftFFT = False |
|
101 | self.dataOut.flagShiftFFT = False | |
102 |
|
102 | |||
103 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None): |
|
103 | def run(self, nProfiles=None, nFFTPoints=None, pairsList=[], ippFactor=None): | |
104 |
|
104 | |||
105 | self.dataOut.flagNoData = True |
|
105 | self.dataOut.flagNoData = True | |
106 |
|
106 | |||
107 | if self.dataIn.type == "Spectra": |
|
107 | if self.dataIn.type == "Spectra": | |
108 | self.dataOut.copy(self.dataIn) |
|
108 | self.dataOut.copy(self.dataIn) | |
109 | return True |
|
109 | return True | |
110 |
|
110 | |||
111 | if self.dataIn.type == "Voltage": |
|
111 | if self.dataIn.type == "Voltage": | |
112 |
|
112 | |||
113 | if nFFTPoints == None: |
|
113 | if nFFTPoints == None: | |
114 | raise ValueError, "This SpectraProc.run() need nFFTPoints input variable" |
|
114 | raise ValueError, "This SpectraProc.run() need nFFTPoints input variable" | |
115 |
|
115 | |||
116 | if nProfiles == None: |
|
116 | if nProfiles == None: | |
117 | nProfiles = nFFTPoints |
|
117 | nProfiles = nFFTPoints | |
118 | # raise ValueError, "This SpectraProc.run() need nProfiles input variable" |
|
118 | # raise ValueError, "This SpectraProc.run() need nProfiles input variable" | |
119 |
|
119 | |||
120 |
|
120 | |||
121 | if ippFactor == None: |
|
121 | if ippFactor == None: | |
122 | ippFactor = 1 |
|
122 | ippFactor = 1 | |
123 | self.dataOut.ippFactor = ippFactor |
|
123 | self.dataOut.ippFactor = ippFactor | |
124 |
|
124 | |||
125 | self.dataOut.nFFTPoints = nFFTPoints |
|
125 | self.dataOut.nFFTPoints = nFFTPoints | |
126 | self.dataOut.pairsList = pairsList |
|
126 | self.dataOut.pairsList = pairsList | |
127 |
|
127 | |||
128 | if self.buffer == None: |
|
128 | if self.buffer == None: | |
129 | self.buffer = numpy.zeros((self.dataIn.nChannels, |
|
129 | self.buffer = numpy.zeros((self.dataIn.nChannels, | |
130 | nProfiles, |
|
130 | nProfiles, | |
131 | self.dataIn.nHeights), |
|
131 | self.dataIn.nHeights), | |
132 | dtype='complex') |
|
132 | dtype='complex') | |
133 | self.id_min = 0 |
|
133 | self.id_min = 0 | |
134 | self.id_max = self.dataIn.data.shape[1] |
|
134 | self.id_max = self.dataIn.data.shape[1] | |
135 |
|
135 | |||
136 | if len(self.dataIn.data.shape) == 2: |
|
136 | if len(self.dataIn.data.shape) == 2: | |
137 | self.buffer[:,self.profIndex,:] = self.dataIn.data.copy() |
|
137 | self.buffer[:,self.profIndex,:] = self.dataIn.data.copy() | |
138 | self.profIndex += 1 |
|
138 | self.profIndex += 1 | |
139 | else: |
|
139 | else: | |
140 | if self.dataIn.data.shape[1] == nProfiles: |
|
140 | if self.dataIn.data.shape[1] == nProfiles: | |
141 | self.buffer = self.dataIn.data.copy() |
|
141 | self.buffer = self.dataIn.data.copy() | |
142 | self.profIndex = nProfiles |
|
142 | self.profIndex = nProfiles | |
143 | elif self.dataIn.data.shape[1] < nProfiles: |
|
143 | elif self.dataIn.data.shape[1] < nProfiles: | |
144 | self.buffer[:,self.id_min:self.id_max,:] = self.dataIn.data |
|
144 | self.buffer[:,self.id_min:self.id_max,:] = self.dataIn.data | |
145 | self.profIndex += self.dataIn.data.shape[1] |
|
145 | self.profIndex += self.dataIn.data.shape[1] | |
146 | self.id_min += self.dataIn.data.shape[1] |
|
146 | self.id_min += self.dataIn.data.shape[1] | |
147 | self.id_max += self.dataIn.data.shape[1] |
|
147 | self.id_max += self.dataIn.data.shape[1] | |
148 | else: |
|
148 | else: | |
149 | raise ValueError, "The type object %s has %d profiles, it should be equal to %d profiles"%(self.dataIn.type,self.dataIn.data.shape[1],nProfiles) |
|
149 | raise ValueError, "The type object %s has %d profiles, it should be equal to %d profiles"%(self.dataIn.type,self.dataIn.data.shape[1],nProfiles) | |
150 | self.dataOut.flagNoData = True |
|
150 | self.dataOut.flagNoData = True | |
151 | return 0 |
|
151 | return 0 | |
152 |
|
152 | |||
153 |
|
153 | |||
154 | if self.firstdatatime == None: |
|
154 | if self.firstdatatime == None: | |
155 | self.firstdatatime = self.dataIn.utctime |
|
155 | self.firstdatatime = self.dataIn.utctime | |
156 |
|
156 | |||
157 | if self.profIndex == nProfiles: |
|
157 | if self.profIndex == nProfiles: | |
158 | self.__updateObjFromInput() |
|
158 | self.__updateObjFromInput() | |
159 | self.__getFft() |
|
159 | self.__getFft() | |
160 |
|
160 | |||
161 | self.dataOut.flagNoData = False |
|
161 | self.dataOut.flagNoData = False | |
162 |
|
162 | |||
163 | self.buffer = None |
|
163 | self.buffer = None | |
164 | self.firstdatatime = None |
|
164 | self.firstdatatime = None | |
165 | self.profIndex = 0 |
|
165 | self.profIndex = 0 | |
166 |
|
166 | |||
167 | return True |
|
167 | return True | |
168 |
|
168 | |||
169 | raise ValueError, "The type object %s is not valid"%(self.dataIn.type) |
|
169 | raise ValueError, "The type object %s is not valid"%(self.dataIn.type) | |
170 |
|
170 | |||
171 | def selectChannels(self, channelList): |
|
171 | def selectChannels(self, channelList): | |
172 |
|
172 | |||
173 | channelIndexList = [] |
|
173 | channelIndexList = [] | |
174 |
|
174 | |||
175 | for channel in channelList: |
|
175 | for channel in channelList: | |
|
176 | if channel not in self.dataOut.channelList: | |||
|
177 | continue | |||
176 | index = self.dataOut.channelList.index(channel) |
|
178 | index = self.dataOut.channelList.index(channel) | |
177 | channelIndexList.append(index) |
|
179 | channelIndexList.append(index) | |
178 |
|
180 | |||
179 | self.selectChannelsByIndex(channelIndexList) |
|
181 | self.selectChannelsByIndex(channelIndexList) | |
180 |
|
182 | |||
181 | def selectChannelsByIndex(self, channelIndexList): |
|
183 | def selectChannelsByIndex(self, channelIndexList): | |
182 | """ |
|
184 | """ | |
183 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
185 | Selecciona un bloque de datos en base a canales segun el channelIndexList | |
184 |
|
186 | |||
185 | Input: |
|
187 | Input: | |
186 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
188 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] | |
187 |
|
189 | |||
188 | Affected: |
|
190 | Affected: | |
189 | self.dataOut.data_spc |
|
191 | self.dataOut.data_spc | |
190 | self.dataOut.channelIndexList |
|
192 | self.dataOut.channelIndexList | |
191 | self.dataOut.nChannels |
|
193 | self.dataOut.nChannels | |
192 |
|
194 | |||
193 | Return: |
|
195 | Return: | |
194 | None |
|
196 | None | |
195 | """ |
|
197 | """ | |
196 |
|
198 | |||
197 | for channelIndex in channelIndexList: |
|
199 | for channelIndex in channelIndexList: | |
198 | if channelIndex not in self.dataOut.channelIndexList: |
|
200 | if channelIndex not in self.dataOut.channelIndexList: | |
199 | print channelIndexList |
|
201 | print channelIndexList | |
200 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
202 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex | |
201 |
|
203 | |||
202 | # nChannels = len(channelIndexList) |
|
204 | # nChannels = len(channelIndexList) | |
203 |
|
205 | |||
204 | data_spc = self.dataOut.data_spc[channelIndexList,:] |
|
206 | data_spc = self.dataOut.data_spc[channelIndexList,:] | |
205 |
|
207 | |||
206 | self.dataOut.data_spc = data_spc |
|
208 | self.dataOut.data_spc = data_spc | |
207 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
209 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] | |
208 | # self.dataOut.nChannels = nChannels |
|
210 | # self.dataOut.nChannels = nChannels | |
209 |
|
211 | |||
210 | return 1 |
|
212 | return 1 | |
211 |
|
213 | |||
212 | def selectHeights(self, minHei, maxHei): |
|
214 | def selectHeights(self, minHei, maxHei): | |
213 | """ |
|
215 | """ | |
214 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
216 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango | |
215 | minHei <= height <= maxHei |
|
217 | minHei <= height <= maxHei | |
216 |
|
218 | |||
217 | Input: |
|
219 | Input: | |
218 | minHei : valor minimo de altura a considerar |
|
220 | minHei : valor minimo de altura a considerar | |
219 | maxHei : valor maximo de altura a considerar |
|
221 | maxHei : valor maximo de altura a considerar | |
220 |
|
222 | |||
221 | Affected: |
|
223 | Affected: | |
222 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
224 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex | |
223 |
|
225 | |||
224 | Return: |
|
226 | Return: | |
225 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
227 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 | |
226 | """ |
|
228 | """ | |
227 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
229 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): | |
228 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
230 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) | |
229 |
|
231 | |||
230 | if (maxHei > self.dataOut.heightList[-1]): |
|
232 | if (maxHei > self.dataOut.heightList[-1]): | |
231 | maxHei = self.dataOut.heightList[-1] |
|
233 | maxHei = self.dataOut.heightList[-1] | |
232 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
234 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) | |
233 |
|
235 | |||
234 | minIndex = 0 |
|
236 | minIndex = 0 | |
235 | maxIndex = 0 |
|
237 | maxIndex = 0 | |
236 | heights = self.dataOut.heightList |
|
238 | heights = self.dataOut.heightList | |
237 |
|
239 | |||
238 | inda = numpy.where(heights >= minHei) |
|
240 | inda = numpy.where(heights >= minHei) | |
239 | indb = numpy.where(heights <= maxHei) |
|
241 | indb = numpy.where(heights <= maxHei) | |
240 |
|
242 | |||
241 | try: |
|
243 | try: | |
242 | minIndex = inda[0][0] |
|
244 | minIndex = inda[0][0] | |
243 | except: |
|
245 | except: | |
244 | minIndex = 0 |
|
246 | minIndex = 0 | |
245 |
|
247 | |||
246 | try: |
|
248 | try: | |
247 | maxIndex = indb[0][-1] |
|
249 | maxIndex = indb[0][-1] | |
248 | except: |
|
250 | except: | |
249 | maxIndex = len(heights) |
|
251 | maxIndex = len(heights) | |
250 |
|
252 | |||
251 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
253 | self.selectHeightsByIndex(minIndex, maxIndex) | |
252 |
|
254 | |||
253 | return 1 |
|
255 | return 1 | |
254 |
|
256 | |||
255 | def getBeaconSignal(self, tauindex = 0, channelindex = 0, hei_ref=None): |
|
257 | def getBeaconSignal(self, tauindex = 0, channelindex = 0, hei_ref=None): | |
256 | newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) |
|
258 | newheis = numpy.where(self.dataOut.heightList>self.dataOut.radarControllerHeaderObj.Taus[tauindex]) | |
257 |
|
259 | |||
258 | if hei_ref != None: |
|
260 | if hei_ref != None: | |
259 | newheis = numpy.where(self.dataOut.heightList>hei_ref) |
|
261 | newheis = numpy.where(self.dataOut.heightList>hei_ref) | |
260 |
|
262 | |||
261 | minIndex = min(newheis[0]) |
|
263 | minIndex = min(newheis[0]) | |
262 | maxIndex = max(newheis[0]) |
|
264 | maxIndex = max(newheis[0]) | |
263 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
265 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] | |
264 | heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
266 | heightList = self.dataOut.heightList[minIndex:maxIndex+1] | |
265 |
|
267 | |||
266 | # determina indices |
|
268 | # determina indices | |
267 | nheis = int(self.dataOut.radarControllerHeaderObj.txB/(self.dataOut.heightList[1]-self.dataOut.heightList[0])) |
|
269 | nheis = int(self.dataOut.radarControllerHeaderObj.txB/(self.dataOut.heightList[1]-self.dataOut.heightList[0])) | |
268 | avg_dB = 10*numpy.log10(numpy.sum(data_spc[channelindex,:,:],axis=0)) |
|
270 | avg_dB = 10*numpy.log10(numpy.sum(data_spc[channelindex,:,:],axis=0)) | |
269 | beacon_dB = numpy.sort(avg_dB)[-nheis:] |
|
271 | beacon_dB = numpy.sort(avg_dB)[-nheis:] | |
270 | beacon_heiIndexList = [] |
|
272 | beacon_heiIndexList = [] | |
271 | for val in avg_dB.tolist(): |
|
273 | for val in avg_dB.tolist(): | |
272 | if val >= beacon_dB[0]: |
|
274 | if val >= beacon_dB[0]: | |
273 | beacon_heiIndexList.append(avg_dB.tolist().index(val)) |
|
275 | beacon_heiIndexList.append(avg_dB.tolist().index(val)) | |
274 |
|
276 | |||
275 | #data_spc = data_spc[:,:,beacon_heiIndexList] |
|
277 | #data_spc = data_spc[:,:,beacon_heiIndexList] | |
276 | data_cspc = None |
|
278 | data_cspc = None | |
277 | if self.dataOut.data_cspc != None: |
|
279 | if self.dataOut.data_cspc != None: | |
278 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
280 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] | |
279 | #data_cspc = data_cspc[:,:,beacon_heiIndexList] |
|
281 | #data_cspc = data_cspc[:,:,beacon_heiIndexList] | |
280 |
|
282 | |||
281 | data_dc = None |
|
283 | data_dc = None | |
282 | if self.dataOut.data_dc != None: |
|
284 | if self.dataOut.data_dc != None: | |
283 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
285 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] | |
284 | #data_dc = data_dc[:,beacon_heiIndexList] |
|
286 | #data_dc = data_dc[:,beacon_heiIndexList] | |
285 |
|
287 | |||
286 | self.dataOut.data_spc = data_spc |
|
288 | self.dataOut.data_spc = data_spc | |
287 | self.dataOut.data_cspc = data_cspc |
|
289 | self.dataOut.data_cspc = data_cspc | |
288 | self.dataOut.data_dc = data_dc |
|
290 | self.dataOut.data_dc = data_dc | |
289 | self.dataOut.heightList = heightList |
|
291 | self.dataOut.heightList = heightList | |
290 | self.dataOut.beacon_heiIndexList = beacon_heiIndexList |
|
292 | self.dataOut.beacon_heiIndexList = beacon_heiIndexList | |
291 |
|
293 | |||
292 | return 1 |
|
294 | return 1 | |
293 |
|
295 | |||
294 |
|
296 | |||
295 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
297 | def selectHeightsByIndex(self, minIndex, maxIndex): | |
296 | """ |
|
298 | """ | |
297 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
299 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango | |
298 | minIndex <= index <= maxIndex |
|
300 | minIndex <= index <= maxIndex | |
299 |
|
301 | |||
300 | Input: |
|
302 | Input: | |
301 | minIndex : valor de indice minimo de altura a considerar |
|
303 | minIndex : valor de indice minimo de altura a considerar | |
302 | maxIndex : valor de indice maximo de altura a considerar |
|
304 | maxIndex : valor de indice maximo de altura a considerar | |
303 |
|
305 | |||
304 | Affected: |
|
306 | Affected: | |
305 | self.dataOut.data_spc |
|
307 | self.dataOut.data_spc | |
306 | self.dataOut.data_cspc |
|
308 | self.dataOut.data_cspc | |
307 | self.dataOut.data_dc |
|
309 | self.dataOut.data_dc | |
308 | self.dataOut.heightList |
|
310 | self.dataOut.heightList | |
309 |
|
311 | |||
310 | Return: |
|
312 | Return: | |
311 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
313 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 | |
312 | """ |
|
314 | """ | |
313 |
|
315 | |||
314 | if (minIndex < 0) or (minIndex > maxIndex): |
|
316 | if (minIndex < 0) or (minIndex > maxIndex): | |
315 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
317 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
316 |
|
318 | |||
317 | if (maxIndex >= self.dataOut.nHeights): |
|
319 | if (maxIndex >= self.dataOut.nHeights): | |
318 | maxIndex = self.dataOut.nHeights-1 |
|
320 | maxIndex = self.dataOut.nHeights-1 | |
319 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
321 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
320 |
|
322 | |||
321 | # nHeights = maxIndex - minIndex + 1 |
|
323 | # nHeights = maxIndex - minIndex + 1 | |
322 |
|
324 | |||
323 | #Spectra |
|
325 | #Spectra | |
324 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] |
|
326 | data_spc = self.dataOut.data_spc[:,:,minIndex:maxIndex+1] | |
325 |
|
327 | |||
326 | data_cspc = None |
|
328 | data_cspc = None | |
327 | if self.dataOut.data_cspc != None: |
|
329 | if self.dataOut.data_cspc != None: | |
328 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] |
|
330 | data_cspc = self.dataOut.data_cspc[:,:,minIndex:maxIndex+1] | |
329 |
|
331 | |||
330 | data_dc = None |
|
332 | data_dc = None | |
331 | if self.dataOut.data_dc != None: |
|
333 | if self.dataOut.data_dc != None: | |
332 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] |
|
334 | data_dc = self.dataOut.data_dc[:,minIndex:maxIndex+1] | |
333 |
|
335 | |||
334 | self.dataOut.data_spc = data_spc |
|
336 | self.dataOut.data_spc = data_spc | |
335 | self.dataOut.data_cspc = data_cspc |
|
337 | self.dataOut.data_cspc = data_cspc | |
336 | self.dataOut.data_dc = data_dc |
|
338 | self.dataOut.data_dc = data_dc | |
337 |
|
339 | |||
338 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex+1] |
|
340 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex+1] | |
339 |
|
341 | |||
340 | return 1 |
|
342 | return 1 | |
341 |
|
343 | |||
342 | def removeDC(self, mode = 2): |
|
344 | def removeDC(self, mode = 2): | |
343 | jspectra = self.dataOut.data_spc |
|
345 | jspectra = self.dataOut.data_spc | |
344 | jcspectra = self.dataOut.data_cspc |
|
346 | jcspectra = self.dataOut.data_cspc | |
345 |
|
347 | |||
346 |
|
348 | |||
347 | num_chan = jspectra.shape[0] |
|
349 | num_chan = jspectra.shape[0] | |
348 | num_hei = jspectra.shape[2] |
|
350 | num_hei = jspectra.shape[2] | |
349 |
|
351 | |||
350 | if jcspectra != None: |
|
352 | if jcspectra != None: | |
351 | jcspectraExist = True |
|
353 | jcspectraExist = True | |
352 | num_pairs = jcspectra.shape[0] |
|
354 | num_pairs = jcspectra.shape[0] | |
353 | else: jcspectraExist = False |
|
355 | else: jcspectraExist = False | |
354 |
|
356 | |||
355 | freq_dc = jspectra.shape[1]/2 |
|
357 | freq_dc = jspectra.shape[1]/2 | |
356 | ind_vel = numpy.array([-2,-1,1,2]) + freq_dc |
|
358 | ind_vel = numpy.array([-2,-1,1,2]) + freq_dc | |
357 |
|
359 | |||
358 | if ind_vel[0]<0: |
|
360 | if ind_vel[0]<0: | |
359 | ind_vel[range(0,1)] = ind_vel[range(0,1)] + self.num_prof |
|
361 | ind_vel[range(0,1)] = ind_vel[range(0,1)] + self.num_prof | |
360 |
|
362 | |||
361 | if mode == 1: |
|
363 | if mode == 1: | |
362 | jspectra[:,freq_dc,:] = (jspectra[:,ind_vel[1],:] + jspectra[:,ind_vel[2],:])/2 #CORRECCION |
|
364 | jspectra[:,freq_dc,:] = (jspectra[:,ind_vel[1],:] + jspectra[:,ind_vel[2],:])/2 #CORRECCION | |
363 |
|
365 | |||
364 | if jcspectraExist: |
|
366 | if jcspectraExist: | |
365 | jcspectra[:,freq_dc,:] = (jcspectra[:,ind_vel[1],:] + jcspectra[:,ind_vel[2],:])/2 |
|
367 | jcspectra[:,freq_dc,:] = (jcspectra[:,ind_vel[1],:] + jcspectra[:,ind_vel[2],:])/2 | |
366 |
|
368 | |||
367 | if mode == 2: |
|
369 | if mode == 2: | |
368 |
|
370 | |||
369 | vel = numpy.array([-2,-1,1,2]) |
|
371 | vel = numpy.array([-2,-1,1,2]) | |
370 | xx = numpy.zeros([4,4]) |
|
372 | xx = numpy.zeros([4,4]) | |
371 |
|
373 | |||
372 | for fil in range(4): |
|
374 | for fil in range(4): | |
373 | xx[fil,:] = vel[fil]**numpy.asarray(range(4)) |
|
375 | xx[fil,:] = vel[fil]**numpy.asarray(range(4)) | |
374 |
|
376 | |||
375 | xx_inv = numpy.linalg.inv(xx) |
|
377 | xx_inv = numpy.linalg.inv(xx) | |
376 | xx_aux = xx_inv[0,:] |
|
378 | xx_aux = xx_inv[0,:] | |
377 |
|
379 | |||
378 | for ich in range(num_chan): |
|
380 | for ich in range(num_chan): | |
379 | yy = jspectra[ich,ind_vel,:] |
|
381 | yy = jspectra[ich,ind_vel,:] | |
380 | jspectra[ich,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
382 | jspectra[ich,freq_dc,:] = numpy.dot(xx_aux,yy) | |
381 |
|
383 | |||
382 | junkid = jspectra[ich,freq_dc,:]<=0 |
|
384 | junkid = jspectra[ich,freq_dc,:]<=0 | |
383 | cjunkid = sum(junkid) |
|
385 | cjunkid = sum(junkid) | |
384 |
|
386 | |||
385 | if cjunkid.any(): |
|
387 | if cjunkid.any(): | |
386 | jspectra[ich,freq_dc,junkid.nonzero()] = (jspectra[ich,ind_vel[1],junkid] + jspectra[ich,ind_vel[2],junkid])/2 |
|
388 | jspectra[ich,freq_dc,junkid.nonzero()] = (jspectra[ich,ind_vel[1],junkid] + jspectra[ich,ind_vel[2],junkid])/2 | |
387 |
|
389 | |||
388 | if jcspectraExist: |
|
390 | if jcspectraExist: | |
389 | for ip in range(num_pairs): |
|
391 | for ip in range(num_pairs): | |
390 | yy = jcspectra[ip,ind_vel,:] |
|
392 | yy = jcspectra[ip,ind_vel,:] | |
391 | jcspectra[ip,freq_dc,:] = numpy.dot(xx_aux,yy) |
|
393 | jcspectra[ip,freq_dc,:] = numpy.dot(xx_aux,yy) | |
392 |
|
394 | |||
393 |
|
395 | |||
394 | self.dataOut.data_spc = jspectra |
|
396 | self.dataOut.data_spc = jspectra | |
395 | self.dataOut.data_cspc = jcspectra |
|
397 | self.dataOut.data_cspc = jcspectra | |
396 |
|
398 | |||
397 | return 1 |
|
399 | return 1 | |
398 |
|
400 | |||
399 | def removeInterference(self, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None): |
|
401 | def removeInterference(self, interf = 2,hei_interf = None, nhei_interf = None, offhei_interf = None): | |
400 |
|
402 | |||
401 | jspectra = self.dataOut.data_spc |
|
403 | jspectra = self.dataOut.data_spc | |
402 | jcspectra = self.dataOut.data_cspc |
|
404 | jcspectra = self.dataOut.data_cspc | |
403 | jnoise = self.dataOut.getNoise() |
|
405 | jnoise = self.dataOut.getNoise() | |
404 | num_incoh = self.dataOut.nIncohInt |
|
406 | num_incoh = self.dataOut.nIncohInt | |
405 |
|
407 | |||
406 | num_channel = jspectra.shape[0] |
|
408 | num_channel = jspectra.shape[0] | |
407 | num_prof = jspectra.shape[1] |
|
409 | num_prof = jspectra.shape[1] | |
408 | num_hei = jspectra.shape[2] |
|
410 | num_hei = jspectra.shape[2] | |
409 |
|
411 | |||
410 | #hei_interf |
|
412 | #hei_interf | |
411 | if hei_interf == None: |
|
413 | if hei_interf == None: | |
412 | count_hei = num_hei/2 #Como es entero no importa |
|
414 | count_hei = num_hei/2 #Como es entero no importa | |
413 | hei_interf = numpy.asmatrix(range(count_hei)) + num_hei - count_hei |
|
415 | hei_interf = numpy.asmatrix(range(count_hei)) + num_hei - count_hei | |
414 | hei_interf = numpy.asarray(hei_interf)[0] |
|
416 | hei_interf = numpy.asarray(hei_interf)[0] | |
415 | #nhei_interf |
|
417 | #nhei_interf | |
416 | if (nhei_interf == None): |
|
418 | if (nhei_interf == None): | |
417 | nhei_interf = 5 |
|
419 | nhei_interf = 5 | |
418 | if (nhei_interf < 1): |
|
420 | if (nhei_interf < 1): | |
419 | nhei_interf = 1 |
|
421 | nhei_interf = 1 | |
420 | if (nhei_interf > count_hei): |
|
422 | if (nhei_interf > count_hei): | |
421 | nhei_interf = count_hei |
|
423 | nhei_interf = count_hei | |
422 | if (offhei_interf == None): |
|
424 | if (offhei_interf == None): | |
423 | offhei_interf = 0 |
|
425 | offhei_interf = 0 | |
424 |
|
426 | |||
425 | ind_hei = range(num_hei) |
|
427 | ind_hei = range(num_hei) | |
426 | # mask_prof = numpy.asarray(range(num_prof - 2)) + 1 |
|
428 | # mask_prof = numpy.asarray(range(num_prof - 2)) + 1 | |
427 | # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1 |
|
429 | # mask_prof[range(num_prof/2 - 1,len(mask_prof))] += 1 | |
428 | mask_prof = numpy.asarray(range(num_prof)) |
|
430 | mask_prof = numpy.asarray(range(num_prof)) | |
429 | num_mask_prof = mask_prof.size |
|
431 | num_mask_prof = mask_prof.size | |
430 | comp_mask_prof = [0, num_prof/2] |
|
432 | comp_mask_prof = [0, num_prof/2] | |
431 |
|
433 | |||
432 |
|
434 | |||
433 | #noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal |
|
435 | #noise_exist: Determina si la variable jnoise ha sido definida y contiene la informacion del ruido de cada canal | |
434 | if (jnoise.size < num_channel or numpy.isnan(jnoise).any()): |
|
436 | if (jnoise.size < num_channel or numpy.isnan(jnoise).any()): | |
435 | jnoise = numpy.nan |
|
437 | jnoise = numpy.nan | |
436 | noise_exist = jnoise[0] < numpy.Inf |
|
438 | noise_exist = jnoise[0] < numpy.Inf | |
437 |
|
439 | |||
438 | #Subrutina de Remocion de la Interferencia |
|
440 | #Subrutina de Remocion de la Interferencia | |
439 | for ich in range(num_channel): |
|
441 | for ich in range(num_channel): | |
440 | #Se ordena los espectros segun su potencia (menor a mayor) |
|
442 | #Se ordena los espectros segun su potencia (menor a mayor) | |
441 | power = jspectra[ich,mask_prof,:] |
|
443 | power = jspectra[ich,mask_prof,:] | |
442 | power = power[:,hei_interf] |
|
444 | power = power[:,hei_interf] | |
443 | power = power.sum(axis = 0) |
|
445 | power = power.sum(axis = 0) | |
444 | psort = power.ravel().argsort() |
|
446 | psort = power.ravel().argsort() | |
445 |
|
447 | |||
446 | #Se estima la interferencia promedio en los Espectros de Potencia empleando |
|
448 | #Se estima la interferencia promedio en los Espectros de Potencia empleando | |
447 | junkspc_interf = jspectra[ich,:,hei_interf[psort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
449 | junkspc_interf = jspectra[ich,:,hei_interf[psort[range(offhei_interf, nhei_interf + offhei_interf)]]] | |
448 |
|
450 | |||
449 | if noise_exist: |
|
451 | if noise_exist: | |
450 | # tmp_noise = jnoise[ich] / num_prof |
|
452 | # tmp_noise = jnoise[ich] / num_prof | |
451 | tmp_noise = jnoise[ich] |
|
453 | tmp_noise = jnoise[ich] | |
452 | junkspc_interf = junkspc_interf - tmp_noise |
|
454 | junkspc_interf = junkspc_interf - tmp_noise | |
453 | #junkspc_interf[:,comp_mask_prof] = 0 |
|
455 | #junkspc_interf[:,comp_mask_prof] = 0 | |
454 |
|
456 | |||
455 | jspc_interf = junkspc_interf.sum(axis = 0) / nhei_interf |
|
457 | jspc_interf = junkspc_interf.sum(axis = 0) / nhei_interf | |
456 | jspc_interf = jspc_interf.transpose() |
|
458 | jspc_interf = jspc_interf.transpose() | |
457 | #Calculando el espectro de interferencia promedio |
|
459 | #Calculando el espectro de interferencia promedio | |
458 | noiseid = numpy.where(jspc_interf <= tmp_noise/ math.sqrt(num_incoh)) |
|
460 | noiseid = numpy.where(jspc_interf <= tmp_noise/ math.sqrt(num_incoh)) | |
459 | noiseid = noiseid[0] |
|
461 | noiseid = noiseid[0] | |
460 | cnoiseid = noiseid.size |
|
462 | cnoiseid = noiseid.size | |
461 | interfid = numpy.where(jspc_interf > tmp_noise/ math.sqrt(num_incoh)) |
|
463 | interfid = numpy.where(jspc_interf > tmp_noise/ math.sqrt(num_incoh)) | |
462 | interfid = interfid[0] |
|
464 | interfid = interfid[0] | |
463 | cinterfid = interfid.size |
|
465 | cinterfid = interfid.size | |
464 |
|
466 | |||
465 | if (cnoiseid > 0): jspc_interf[noiseid] = 0 |
|
467 | if (cnoiseid > 0): jspc_interf[noiseid] = 0 | |
466 |
|
468 | |||
467 | #Expandiendo los perfiles a limpiar |
|
469 | #Expandiendo los perfiles a limpiar | |
468 | if (cinterfid > 0): |
|
470 | if (cinterfid > 0): | |
469 | new_interfid = (numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof)%num_prof |
|
471 | new_interfid = (numpy.r_[interfid - 1, interfid, interfid + 1] + num_prof)%num_prof | |
470 | new_interfid = numpy.asarray(new_interfid) |
|
472 | new_interfid = numpy.asarray(new_interfid) | |
471 | new_interfid = {x for x in new_interfid} |
|
473 | new_interfid = {x for x in new_interfid} | |
472 | new_interfid = numpy.array(list(new_interfid)) |
|
474 | new_interfid = numpy.array(list(new_interfid)) | |
473 | new_cinterfid = new_interfid.size |
|
475 | new_cinterfid = new_interfid.size | |
474 | else: new_cinterfid = 0 |
|
476 | else: new_cinterfid = 0 | |
475 |
|
477 | |||
476 | for ip in range(new_cinterfid): |
|
478 | for ip in range(new_cinterfid): | |
477 | ind = junkspc_interf[:,new_interfid[ip]].ravel().argsort() |
|
479 | ind = junkspc_interf[:,new_interfid[ip]].ravel().argsort() | |
478 | jspc_interf[new_interfid[ip]] = junkspc_interf[ind[nhei_interf/2],new_interfid[ip]] |
|
480 | jspc_interf[new_interfid[ip]] = junkspc_interf[ind[nhei_interf/2],new_interfid[ip]] | |
479 |
|
481 | |||
480 |
|
482 | |||
481 | jspectra[ich,:,ind_hei] = jspectra[ich,:,ind_hei] - jspc_interf #Corregir indices |
|
483 | jspectra[ich,:,ind_hei] = jspectra[ich,:,ind_hei] - jspc_interf #Corregir indices | |
482 |
|
484 | |||
483 | #Removiendo la interferencia del punto de mayor interferencia |
|
485 | #Removiendo la interferencia del punto de mayor interferencia | |
484 | ListAux = jspc_interf[mask_prof].tolist() |
|
486 | ListAux = jspc_interf[mask_prof].tolist() | |
485 | maxid = ListAux.index(max(ListAux)) |
|
487 | maxid = ListAux.index(max(ListAux)) | |
486 |
|
488 | |||
487 |
|
489 | |||
488 | if cinterfid > 0: |
|
490 | if cinterfid > 0: | |
489 | for ip in range(cinterfid*(interf == 2) - 1): |
|
491 | for ip in range(cinterfid*(interf == 2) - 1): | |
490 | ind = (jspectra[ich,interfid[ip],:] < tmp_noise*(1 + 1/math.sqrt(num_incoh))).nonzero() |
|
492 | ind = (jspectra[ich,interfid[ip],:] < tmp_noise*(1 + 1/math.sqrt(num_incoh))).nonzero() | |
491 | cind = len(ind) |
|
493 | cind = len(ind) | |
492 |
|
494 | |||
493 | if (cind > 0): |
|
495 | if (cind > 0): | |
494 | jspectra[ich,interfid[ip],ind] = tmp_noise*(1 + (numpy.random.uniform(cind) - 0.5)/math.sqrt(num_incoh)) |
|
496 | jspectra[ich,interfid[ip],ind] = tmp_noise*(1 + (numpy.random.uniform(cind) - 0.5)/math.sqrt(num_incoh)) | |
495 |
|
497 | |||
496 | ind = numpy.array([-2,-1,1,2]) |
|
498 | ind = numpy.array([-2,-1,1,2]) | |
497 | xx = numpy.zeros([4,4]) |
|
499 | xx = numpy.zeros([4,4]) | |
498 |
|
500 | |||
499 | for id1 in range(4): |
|
501 | for id1 in range(4): | |
500 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
502 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) | |
501 |
|
503 | |||
502 | xx_inv = numpy.linalg.inv(xx) |
|
504 | xx_inv = numpy.linalg.inv(xx) | |
503 | xx = xx_inv[:,0] |
|
505 | xx = xx_inv[:,0] | |
504 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
506 | ind = (ind + maxid + num_mask_prof)%num_mask_prof | |
505 | yy = jspectra[ich,mask_prof[ind],:] |
|
507 | yy = jspectra[ich,mask_prof[ind],:] | |
506 | jspectra[ich,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
508 | jspectra[ich,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) | |
507 |
|
509 | |||
508 |
|
510 | |||
509 | indAux = (jspectra[ich,:,:] < tmp_noise*(1-1/math.sqrt(num_incoh))).nonzero() |
|
511 | indAux = (jspectra[ich,:,:] < tmp_noise*(1-1/math.sqrt(num_incoh))).nonzero() | |
510 | jspectra[ich,indAux[0],indAux[1]] = tmp_noise * (1 - 1/math.sqrt(num_incoh)) |
|
512 | jspectra[ich,indAux[0],indAux[1]] = tmp_noise * (1 - 1/math.sqrt(num_incoh)) | |
511 |
|
513 | |||
512 | #Remocion de Interferencia en el Cross Spectra |
|
514 | #Remocion de Interferencia en el Cross Spectra | |
513 | if jcspectra == None: return jspectra, jcspectra |
|
515 | if jcspectra == None: return jspectra, jcspectra | |
514 | num_pairs = jcspectra.size/(num_prof*num_hei) |
|
516 | num_pairs = jcspectra.size/(num_prof*num_hei) | |
515 | jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei) |
|
517 | jcspectra = jcspectra.reshape(num_pairs, num_prof, num_hei) | |
516 |
|
518 | |||
517 | for ip in range(num_pairs): |
|
519 | for ip in range(num_pairs): | |
518 |
|
520 | |||
519 | #------------------------------------------- |
|
521 | #------------------------------------------- | |
520 |
|
522 | |||
521 | cspower = numpy.abs(jcspectra[ip,mask_prof,:]) |
|
523 | cspower = numpy.abs(jcspectra[ip,mask_prof,:]) | |
522 | cspower = cspower[:,hei_interf] |
|
524 | cspower = cspower[:,hei_interf] | |
523 | cspower = cspower.sum(axis = 0) |
|
525 | cspower = cspower.sum(axis = 0) | |
524 |
|
526 | |||
525 | cspsort = cspower.ravel().argsort() |
|
527 | cspsort = cspower.ravel().argsort() | |
526 | junkcspc_interf = jcspectra[ip,:,hei_interf[cspsort[range(offhei_interf, nhei_interf + offhei_interf)]]] |
|
528 | junkcspc_interf = jcspectra[ip,:,hei_interf[cspsort[range(offhei_interf, nhei_interf + offhei_interf)]]] | |
527 | junkcspc_interf = junkcspc_interf.transpose() |
|
529 | junkcspc_interf = junkcspc_interf.transpose() | |
528 | jcspc_interf = junkcspc_interf.sum(axis = 1)/nhei_interf |
|
530 | jcspc_interf = junkcspc_interf.sum(axis = 1)/nhei_interf | |
529 |
|
531 | |||
530 | ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort() |
|
532 | ind = numpy.abs(jcspc_interf[mask_prof]).ravel().argsort() | |
531 |
|
533 | |||
532 | median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
534 | median_real = numpy.median(numpy.real(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) | |
533 | median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) |
|
535 | median_imag = numpy.median(numpy.imag(junkcspc_interf[mask_prof[ind[range(3*num_prof/4)]],:])) | |
534 | junkcspc_interf[comp_mask_prof,:] = numpy.complex(median_real, median_imag) |
|
536 | junkcspc_interf[comp_mask_prof,:] = numpy.complex(median_real, median_imag) | |
535 |
|
537 | |||
536 | for iprof in range(num_prof): |
|
538 | for iprof in range(num_prof): | |
537 | ind = numpy.abs(junkcspc_interf[iprof,:]).ravel().argsort() |
|
539 | ind = numpy.abs(junkcspc_interf[iprof,:]).ravel().argsort() | |
538 | jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf/2]] |
|
540 | jcspc_interf[iprof] = junkcspc_interf[iprof, ind[nhei_interf/2]] | |
539 |
|
541 | |||
540 | #Removiendo la Interferencia |
|
542 | #Removiendo la Interferencia | |
541 | jcspectra[ip,:,ind_hei] = jcspectra[ip,:,ind_hei] - jcspc_interf |
|
543 | jcspectra[ip,:,ind_hei] = jcspectra[ip,:,ind_hei] - jcspc_interf | |
542 |
|
544 | |||
543 | ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist() |
|
545 | ListAux = numpy.abs(jcspc_interf[mask_prof]).tolist() | |
544 | maxid = ListAux.index(max(ListAux)) |
|
546 | maxid = ListAux.index(max(ListAux)) | |
545 |
|
547 | |||
546 | ind = numpy.array([-2,-1,1,2]) |
|
548 | ind = numpy.array([-2,-1,1,2]) | |
547 | xx = numpy.zeros([4,4]) |
|
549 | xx = numpy.zeros([4,4]) | |
548 |
|
550 | |||
549 | for id1 in range(4): |
|
551 | for id1 in range(4): | |
550 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) |
|
552 | xx[:,id1] = ind[id1]**numpy.asarray(range(4)) | |
551 |
|
553 | |||
552 | xx_inv = numpy.linalg.inv(xx) |
|
554 | xx_inv = numpy.linalg.inv(xx) | |
553 | xx = xx_inv[:,0] |
|
555 | xx = xx_inv[:,0] | |
554 |
|
556 | |||
555 | ind = (ind + maxid + num_mask_prof)%num_mask_prof |
|
557 | ind = (ind + maxid + num_mask_prof)%num_mask_prof | |
556 | yy = jcspectra[ip,mask_prof[ind],:] |
|
558 | yy = jcspectra[ip,mask_prof[ind],:] | |
557 | jcspectra[ip,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) |
|
559 | jcspectra[ip,mask_prof[maxid],:] = numpy.dot(yy.transpose(),xx) | |
558 |
|
560 | |||
559 | #Guardar Resultados |
|
561 | #Guardar Resultados | |
560 | self.dataOut.data_spc = jspectra |
|
562 | self.dataOut.data_spc = jspectra | |
561 | self.dataOut.data_cspc = jcspectra |
|
563 | self.dataOut.data_cspc = jcspectra | |
562 |
|
564 | |||
563 | return 1 |
|
565 | return 1 | |
564 |
|
566 | |||
565 | def setRadarFrequency(self, frequency=None): |
|
567 | def setRadarFrequency(self, frequency=None): | |
566 | if frequency != None: |
|
568 | if frequency != None: | |
567 | self.dataOut.frequency = frequency |
|
569 | self.dataOut.frequency = frequency | |
568 |
|
570 | |||
569 | return 1 |
|
571 | return 1 | |
570 |
|
572 | |||
571 | def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None): |
|
573 | def getNoise(self, minHei=None, maxHei=None, minVel=None, maxVel=None): | |
572 | #validacion de rango |
|
574 | #validacion de rango | |
573 | if minHei == None: |
|
575 | if minHei == None: | |
574 | minHei = self.dataOut.heightList[0] |
|
576 | minHei = self.dataOut.heightList[0] | |
575 |
|
577 | |||
576 | if maxHei == None: |
|
578 | if maxHei == None: | |
577 | maxHei = self.dataOut.heightList[-1] |
|
579 | maxHei = self.dataOut.heightList[-1] | |
578 |
|
580 | |||
579 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
581 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): | |
580 | print 'minHei: %.2f is out of the heights range'%(minHei) |
|
582 | print 'minHei: %.2f is out of the heights range'%(minHei) | |
581 | print 'minHei is setting to %.2f'%(self.dataOut.heightList[0]) |
|
583 | print 'minHei is setting to %.2f'%(self.dataOut.heightList[0]) | |
582 | minHei = self.dataOut.heightList[0] |
|
584 | minHei = self.dataOut.heightList[0] | |
583 |
|
585 | |||
584 | if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei): |
|
586 | if (maxHei > self.dataOut.heightList[-1]) or (maxHei < minHei): | |
585 | print 'maxHei: %.2f is out of the heights range'%(maxHei) |
|
587 | print 'maxHei: %.2f is out of the heights range'%(maxHei) | |
586 | print 'maxHei is setting to %.2f'%(self.dataOut.heightList[-1]) |
|
588 | print 'maxHei is setting to %.2f'%(self.dataOut.heightList[-1]) | |
587 | maxHei = self.dataOut.heightList[-1] |
|
589 | maxHei = self.dataOut.heightList[-1] | |
588 |
|
590 | |||
589 | # validacion de velocidades |
|
591 | # validacion de velocidades | |
590 | velrange = self.dataOut.getVelRange(1) |
|
592 | velrange = self.dataOut.getVelRange(1) | |
591 |
|
593 | |||
592 | if minVel == None: |
|
594 | if minVel == None: | |
593 | minVel = velrange[0] |
|
595 | minVel = velrange[0] | |
594 |
|
596 | |||
595 | if maxVel == None: |
|
597 | if maxVel == None: | |
596 | maxVel = velrange[-1] |
|
598 | maxVel = velrange[-1] | |
597 |
|
599 | |||
598 | if (minVel < velrange[0]) or (minVel > maxVel): |
|
600 | if (minVel < velrange[0]) or (minVel > maxVel): | |
599 | print 'minVel: %.2f is out of the velocity range'%(minVel) |
|
601 | print 'minVel: %.2f is out of the velocity range'%(minVel) | |
600 | print 'minVel is setting to %.2f'%(velrange[0]) |
|
602 | print 'minVel is setting to %.2f'%(velrange[0]) | |
601 | minVel = velrange[0] |
|
603 | minVel = velrange[0] | |
602 |
|
604 | |||
603 | if (maxVel > velrange[-1]) or (maxVel < minVel): |
|
605 | if (maxVel > velrange[-1]) or (maxVel < minVel): | |
604 | print 'maxVel: %.2f is out of the velocity range'%(maxVel) |
|
606 | print 'maxVel: %.2f is out of the velocity range'%(maxVel) | |
605 | print 'maxVel is setting to %.2f'%(velrange[-1]) |
|
607 | print 'maxVel is setting to %.2f'%(velrange[-1]) | |
606 | maxVel = velrange[-1] |
|
608 | maxVel = velrange[-1] | |
607 |
|
609 | |||
608 | # seleccion de indices para rango |
|
610 | # seleccion de indices para rango | |
609 | minIndex = 0 |
|
611 | minIndex = 0 | |
610 | maxIndex = 0 |
|
612 | maxIndex = 0 | |
611 | heights = self.dataOut.heightList |
|
613 | heights = self.dataOut.heightList | |
612 |
|
614 | |||
613 | inda = numpy.where(heights >= minHei) |
|
615 | inda = numpy.where(heights >= minHei) | |
614 | indb = numpy.where(heights <= maxHei) |
|
616 | indb = numpy.where(heights <= maxHei) | |
615 |
|
617 | |||
616 | try: |
|
618 | try: | |
617 | minIndex = inda[0][0] |
|
619 | minIndex = inda[0][0] | |
618 | except: |
|
620 | except: | |
619 | minIndex = 0 |
|
621 | minIndex = 0 | |
620 |
|
622 | |||
621 | try: |
|
623 | try: | |
622 | maxIndex = indb[0][-1] |
|
624 | maxIndex = indb[0][-1] | |
623 | except: |
|
625 | except: | |
624 | maxIndex = len(heights) |
|
626 | maxIndex = len(heights) | |
625 |
|
627 | |||
626 | if (minIndex < 0) or (minIndex > maxIndex): |
|
628 | if (minIndex < 0) or (minIndex > maxIndex): | |
627 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
629 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
628 |
|
630 | |||
629 | if (maxIndex >= self.dataOut.nHeights): |
|
631 | if (maxIndex >= self.dataOut.nHeights): | |
630 | maxIndex = self.dataOut.nHeights-1 |
|
632 | maxIndex = self.dataOut.nHeights-1 | |
631 |
|
633 | |||
632 | # seleccion de indices para velocidades |
|
634 | # seleccion de indices para velocidades | |
633 | indminvel = numpy.where(velrange >= minVel) |
|
635 | indminvel = numpy.where(velrange >= minVel) | |
634 | indmaxvel = numpy.where(velrange <= maxVel) |
|
636 | indmaxvel = numpy.where(velrange <= maxVel) | |
635 | try: |
|
637 | try: | |
636 | minIndexVel = indminvel[0][0] |
|
638 | minIndexVel = indminvel[0][0] | |
637 | except: |
|
639 | except: | |
638 | minIndexVel = 0 |
|
640 | minIndexVel = 0 | |
639 |
|
641 | |||
640 | try: |
|
642 | try: | |
641 | maxIndexVel = indmaxvel[0][-1] |
|
643 | maxIndexVel = indmaxvel[0][-1] | |
642 | except: |
|
644 | except: | |
643 | maxIndexVel = len(velrange) |
|
645 | maxIndexVel = len(velrange) | |
644 |
|
646 | |||
645 | #seleccion del espectro |
|
647 | #seleccion del espectro | |
646 | data_spc = self.dataOut.data_spc[:,minIndexVel:maxIndexVel+1,minIndex:maxIndex+1] |
|
648 | data_spc = self.dataOut.data_spc[:,minIndexVel:maxIndexVel+1,minIndex:maxIndex+1] | |
647 | #estimacion de ruido |
|
649 | #estimacion de ruido | |
648 | noise = numpy.zeros(self.dataOut.nChannels) |
|
650 | noise = numpy.zeros(self.dataOut.nChannels) | |
649 |
|
651 | |||
650 | for channel in range(self.dataOut.nChannels): |
|
652 | for channel in range(self.dataOut.nChannels): | |
651 | daux = data_spc[channel,:,:] |
|
653 | daux = data_spc[channel,:,:] | |
652 | noise[channel] = hildebrand_sekhon(daux, self.dataOut.nIncohInt) |
|
654 | noise[channel] = hildebrand_sekhon(daux, self.dataOut.nIncohInt) | |
653 |
|
655 | |||
654 | self.dataOut.noise_estimation = noise.copy() |
|
656 | self.dataOut.noise_estimation = noise.copy() | |
655 |
|
657 | |||
656 | return 1 |
|
658 | return 1 | |
657 |
|
659 | |||
658 | class IncohInt(Operation): |
|
660 | class IncohInt(Operation): | |
659 |
|
661 | |||
660 |
|
662 | |||
661 | __profIndex = 0 |
|
663 | __profIndex = 0 | |
662 | __withOverapping = False |
|
664 | __withOverapping = False | |
663 |
|
665 | |||
664 | __byTime = False |
|
666 | __byTime = False | |
665 | __initime = None |
|
667 | __initime = None | |
666 | __lastdatatime = None |
|
668 | __lastdatatime = None | |
667 | __integrationtime = None |
|
669 | __integrationtime = None | |
668 |
|
670 | |||
669 | __buffer_spc = None |
|
671 | __buffer_spc = None | |
670 | __buffer_cspc = None |
|
672 | __buffer_cspc = None | |
671 | __buffer_dc = None |
|
673 | __buffer_dc = None | |
672 |
|
674 | |||
673 | __dataReady = False |
|
675 | __dataReady = False | |
674 |
|
676 | |||
675 | __timeInterval = None |
|
677 | __timeInterval = None | |
676 |
|
678 | |||
677 | n = None |
|
679 | n = None | |
678 |
|
680 | |||
679 |
|
681 | |||
680 |
|
682 | |||
681 | def __init__(self): |
|
683 | def __init__(self): | |
682 |
|
684 | |||
683 | Operation.__init__(self) |
|
685 | Operation.__init__(self) | |
684 | # self.isConfig = False |
|
686 | # self.isConfig = False | |
685 |
|
687 | |||
686 | def setup(self, n=None, timeInterval=None, overlapping=False): |
|
688 | def setup(self, n=None, timeInterval=None, overlapping=False): | |
687 | """ |
|
689 | """ | |
688 | Set the parameters of the integration class. |
|
690 | Set the parameters of the integration class. | |
689 |
|
691 | |||
690 | Inputs: |
|
692 | Inputs: | |
691 |
|
693 | |||
692 | n : Number of coherent integrations |
|
694 | n : Number of coherent integrations | |
693 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
695 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work | |
694 | overlapping : |
|
696 | overlapping : | |
695 |
|
697 | |||
696 | """ |
|
698 | """ | |
697 |
|
699 | |||
698 | self.__initime = None |
|
700 | self.__initime = None | |
699 | self.__lastdatatime = 0 |
|
701 | self.__lastdatatime = 0 | |
700 | self.__buffer_spc = None |
|
702 | self.__buffer_spc = None | |
701 | self.__buffer_cspc = None |
|
703 | self.__buffer_cspc = None | |
702 | self.__buffer_dc = None |
|
704 | self.__buffer_dc = None | |
703 | self.__dataReady = False |
|
705 | self.__dataReady = False | |
704 |
|
706 | |||
705 |
|
707 | |||
706 | if n == None and timeInterval == None: |
|
708 | if n == None and timeInterval == None: | |
707 | raise ValueError, "n or timeInterval should be specified ..." |
|
709 | raise ValueError, "n or timeInterval should be specified ..." | |
708 |
|
710 | |||
709 | if n != None: |
|
711 | if n != None: | |
710 | self.n = n |
|
712 | self.n = n | |
711 | self.__byTime = False |
|
713 | self.__byTime = False | |
712 | else: |
|
714 | else: | |
713 | self.__integrationtime = timeInterval #if (type(timeInterval)!=integer) -> change this line |
|
715 | self.__integrationtime = timeInterval #if (type(timeInterval)!=integer) -> change this line | |
714 | self.n = 9999 |
|
716 | self.n = 9999 | |
715 | self.__byTime = True |
|
717 | self.__byTime = True | |
716 |
|
718 | |||
717 | if overlapping: |
|
719 | if overlapping: | |
718 | self.__withOverapping = True |
|
720 | self.__withOverapping = True | |
719 | else: |
|
721 | else: | |
720 | self.__withOverapping = False |
|
722 | self.__withOverapping = False | |
721 | self.__buffer_spc = 0 |
|
723 | self.__buffer_spc = 0 | |
722 | self.__buffer_cspc = 0 |
|
724 | self.__buffer_cspc = 0 | |
723 | self.__buffer_dc = 0 |
|
725 | self.__buffer_dc = 0 | |
724 |
|
726 | |||
725 | self.__profIndex = 0 |
|
727 | self.__profIndex = 0 | |
726 |
|
728 | |||
727 | def putData(self, data_spc, data_cspc, data_dc): |
|
729 | def putData(self, data_spc, data_cspc, data_dc): | |
728 |
|
730 | |||
729 | """ |
|
731 | """ | |
730 | Add a profile to the __buffer_spc and increase in one the __profileIndex |
|
732 | Add a profile to the __buffer_spc and increase in one the __profileIndex | |
731 |
|
733 | |||
732 | """ |
|
734 | """ | |
733 |
|
735 | |||
734 | if not self.__withOverapping: |
|
736 | if not self.__withOverapping: | |
735 | self.__buffer_spc += data_spc |
|
737 | self.__buffer_spc += data_spc | |
736 |
|
738 | |||
737 | if data_cspc == None: |
|
739 | if data_cspc == None: | |
738 | self.__buffer_cspc = None |
|
740 | self.__buffer_cspc = None | |
739 | else: |
|
741 | else: | |
740 | self.__buffer_cspc += data_cspc |
|
742 | self.__buffer_cspc += data_cspc | |
741 |
|
743 | |||
742 | if data_dc == None: |
|
744 | if data_dc == None: | |
743 | self.__buffer_dc = None |
|
745 | self.__buffer_dc = None | |
744 | else: |
|
746 | else: | |
745 | self.__buffer_dc += data_dc |
|
747 | self.__buffer_dc += data_dc | |
746 |
|
748 | |||
747 | self.__profIndex += 1 |
|
749 | self.__profIndex += 1 | |
748 | return |
|
750 | return | |
749 |
|
751 | |||
750 | #Overlapping data |
|
752 | #Overlapping data | |
751 | nChannels, nFFTPoints, nHeis = data_spc.shape |
|
753 | nChannels, nFFTPoints, nHeis = data_spc.shape | |
752 | data_spc = numpy.reshape(data_spc, (1, nChannels, nFFTPoints, nHeis)) |
|
754 | data_spc = numpy.reshape(data_spc, (1, nChannels, nFFTPoints, nHeis)) | |
753 | if data_cspc != None: |
|
755 | if data_cspc != None: | |
754 | data_cspc = numpy.reshape(data_cspc, (1, -1, nFFTPoints, nHeis)) |
|
756 | data_cspc = numpy.reshape(data_cspc, (1, -1, nFFTPoints, nHeis)) | |
755 | if data_dc != None: |
|
757 | if data_dc != None: | |
756 | data_dc = numpy.reshape(data_dc, (1, -1, nHeis)) |
|
758 | data_dc = numpy.reshape(data_dc, (1, -1, nHeis)) | |
757 |
|
759 | |||
758 | #If the buffer is empty then it takes the data value |
|
760 | #If the buffer is empty then it takes the data value | |
759 | if self.__buffer_spc == None: |
|
761 | if self.__buffer_spc == None: | |
760 | self.__buffer_spc = data_spc |
|
762 | self.__buffer_spc = data_spc | |
761 |
|
763 | |||
762 | if data_cspc == None: |
|
764 | if data_cspc == None: | |
763 | self.__buffer_cspc = None |
|
765 | self.__buffer_cspc = None | |
764 | else: |
|
766 | else: | |
765 | self.__buffer_cspc += data_cspc |
|
767 | self.__buffer_cspc += data_cspc | |
766 |
|
768 | |||
767 | if data_dc == None: |
|
769 | if data_dc == None: | |
768 | self.__buffer_dc = None |
|
770 | self.__buffer_dc = None | |
769 | else: |
|
771 | else: | |
770 | self.__buffer_dc += data_dc |
|
772 | self.__buffer_dc += data_dc | |
771 |
|
773 | |||
772 | self.__profIndex += 1 |
|
774 | self.__profIndex += 1 | |
773 | return |
|
775 | return | |
774 |
|
776 | |||
775 | #If the buffer length is lower than n then stakcing the data value |
|
777 | #If the buffer length is lower than n then stakcing the data value | |
776 | if self.__profIndex < self.n: |
|
778 | if self.__profIndex < self.n: | |
777 | self.__buffer_spc = numpy.vstack((self.__buffer_spc, data_spc)) |
|
779 | self.__buffer_spc = numpy.vstack((self.__buffer_spc, data_spc)) | |
778 |
|
780 | |||
779 | if data_cspc != None: |
|
781 | if data_cspc != None: | |
780 | self.__buffer_cspc = numpy.vstack((self.__buffer_cspc, data_cspc)) |
|
782 | self.__buffer_cspc = numpy.vstack((self.__buffer_cspc, data_cspc)) | |
781 |
|
783 | |||
782 | if data_dc != None: |
|
784 | if data_dc != None: | |
783 | self.__buffer_dc = numpy.vstack((self.__buffer_dc, data_dc)) |
|
785 | self.__buffer_dc = numpy.vstack((self.__buffer_dc, data_dc)) | |
784 |
|
786 | |||
785 | self.__profIndex += 1 |
|
787 | self.__profIndex += 1 | |
786 | return |
|
788 | return | |
787 |
|
789 | |||
788 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
790 | #If the buffer length is equal to n then replacing the last buffer value with the data value | |
789 | self.__buffer_spc = numpy.roll(self.__buffer_spc, -1, axis=0) |
|
791 | self.__buffer_spc = numpy.roll(self.__buffer_spc, -1, axis=0) | |
790 | self.__buffer_spc[self.n-1] = data_spc |
|
792 | self.__buffer_spc[self.n-1] = data_spc | |
791 |
|
793 | |||
792 | if data_cspc != None: |
|
794 | if data_cspc != None: | |
793 | self.__buffer_cspc = numpy.roll(self.__buffer_cspc, -1, axis=0) |
|
795 | self.__buffer_cspc = numpy.roll(self.__buffer_cspc, -1, axis=0) | |
794 | self.__buffer_cspc[self.n-1] = data_cspc |
|
796 | self.__buffer_cspc[self.n-1] = data_cspc | |
795 |
|
797 | |||
796 | if data_dc != None: |
|
798 | if data_dc != None: | |
797 | self.__buffer_dc = numpy.roll(self.__buffer_dc, -1, axis=0) |
|
799 | self.__buffer_dc = numpy.roll(self.__buffer_dc, -1, axis=0) | |
798 | self.__buffer_dc[self.n-1] = data_dc |
|
800 | self.__buffer_dc[self.n-1] = data_dc | |
799 |
|
801 | |||
800 | self.__profIndex = self.n |
|
802 | self.__profIndex = self.n | |
801 | return |
|
803 | return | |
802 |
|
804 | |||
803 |
|
805 | |||
804 | def pushData(self): |
|
806 | def pushData(self): | |
805 | """ |
|
807 | """ | |
806 | Return the sum of the last profiles and the profiles used in the sum. |
|
808 | Return the sum of the last profiles and the profiles used in the sum. | |
807 |
|
809 | |||
808 | Affected: |
|
810 | Affected: | |
809 |
|
811 | |||
810 | self.__profileIndex |
|
812 | self.__profileIndex | |
811 |
|
813 | |||
812 | """ |
|
814 | """ | |
813 | data_spc = None |
|
815 | data_spc = None | |
814 | data_cspc = None |
|
816 | data_cspc = None | |
815 | data_dc = None |
|
817 | data_dc = None | |
816 |
|
818 | |||
817 | if not self.__withOverapping: |
|
819 | if not self.__withOverapping: | |
818 | data_spc = self.__buffer_spc |
|
820 | data_spc = self.__buffer_spc | |
819 | data_cspc = self.__buffer_cspc |
|
821 | data_cspc = self.__buffer_cspc | |
820 | data_dc = self.__buffer_dc |
|
822 | data_dc = self.__buffer_dc | |
821 |
|
823 | |||
822 | n = self.__profIndex |
|
824 | n = self.__profIndex | |
823 |
|
825 | |||
824 | self.__buffer_spc = 0 |
|
826 | self.__buffer_spc = 0 | |
825 | self.__buffer_cspc = 0 |
|
827 | self.__buffer_cspc = 0 | |
826 | self.__buffer_dc = 0 |
|
828 | self.__buffer_dc = 0 | |
827 | self.__profIndex = 0 |
|
829 | self.__profIndex = 0 | |
828 |
|
830 | |||
829 | return data_spc, data_cspc, data_dc, n |
|
831 | return data_spc, data_cspc, data_dc, n | |
830 |
|
832 | |||
831 | #Integration with Overlapping |
|
833 | #Integration with Overlapping | |
832 | data_spc = numpy.sum(self.__buffer_spc, axis=0) |
|
834 | data_spc = numpy.sum(self.__buffer_spc, axis=0) | |
833 |
|
835 | |||
834 | if self.__buffer_cspc != None: |
|
836 | if self.__buffer_cspc != None: | |
835 | data_cspc = numpy.sum(self.__buffer_cspc, axis=0) |
|
837 | data_cspc = numpy.sum(self.__buffer_cspc, axis=0) | |
836 |
|
838 | |||
837 | if self.__buffer_dc != None: |
|
839 | if self.__buffer_dc != None: | |
838 | data_dc = numpy.sum(self.__buffer_dc, axis=0) |
|
840 | data_dc = numpy.sum(self.__buffer_dc, axis=0) | |
839 |
|
841 | |||
840 | n = self.__profIndex |
|
842 | n = self.__profIndex | |
841 |
|
843 | |||
842 | return data_spc, data_cspc, data_dc, n |
|
844 | return data_spc, data_cspc, data_dc, n | |
843 |
|
845 | |||
844 | def byProfiles(self, *args): |
|
846 | def byProfiles(self, *args): | |
845 |
|
847 | |||
846 | self.__dataReady = False |
|
848 | self.__dataReady = False | |
847 | avgdata_spc = None |
|
849 | avgdata_spc = None | |
848 | avgdata_cspc = None |
|
850 | avgdata_cspc = None | |
849 | avgdata_dc = None |
|
851 | avgdata_dc = None | |
850 | # n = None |
|
852 | # n = None | |
851 |
|
853 | |||
852 | self.putData(*args) |
|
854 | self.putData(*args) | |
853 |
|
855 | |||
854 | if self.__profIndex == self.n: |
|
856 | if self.__profIndex == self.n: | |
855 |
|
857 | |||
856 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
858 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() | |
857 | self.__dataReady = True |
|
859 | self.__dataReady = True | |
858 |
|
860 | |||
859 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
861 | return avgdata_spc, avgdata_cspc, avgdata_dc | |
860 |
|
862 | |||
861 | def byTime(self, datatime, *args): |
|
863 | def byTime(self, datatime, *args): | |
862 |
|
864 | |||
863 | self.__dataReady = False |
|
865 | self.__dataReady = False | |
864 | avgdata_spc = None |
|
866 | avgdata_spc = None | |
865 | avgdata_cspc = None |
|
867 | avgdata_cspc = None | |
866 | avgdata_dc = None |
|
868 | avgdata_dc = None | |
867 | n = None |
|
869 | n = None | |
868 |
|
870 | |||
869 | self.putData(*args) |
|
871 | self.putData(*args) | |
870 |
|
872 | |||
871 | if (datatime - self.__initime) >= self.__integrationtime: |
|
873 | if (datatime - self.__initime) >= self.__integrationtime: | |
872 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() |
|
874 | avgdata_spc, avgdata_cspc, avgdata_dc, n = self.pushData() | |
873 | self.n = n |
|
875 | self.n = n | |
874 | self.__dataReady = True |
|
876 | self.__dataReady = True | |
875 |
|
877 | |||
876 | return avgdata_spc, avgdata_cspc, avgdata_dc |
|
878 | return avgdata_spc, avgdata_cspc, avgdata_dc | |
877 |
|
879 | |||
878 | def integrate(self, datatime, *args): |
|
880 | def integrate(self, datatime, *args): | |
879 |
|
881 | |||
880 | if self.__initime == None: |
|
882 | if self.__initime == None: | |
881 | self.__initime = datatime |
|
883 | self.__initime = datatime | |
882 |
|
884 | |||
883 | if self.__byTime: |
|
885 | if self.__byTime: | |
884 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(datatime, *args) |
|
886 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byTime(datatime, *args) | |
885 | else: |
|
887 | else: | |
886 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args) |
|
888 | avgdata_spc, avgdata_cspc, avgdata_dc = self.byProfiles(*args) | |
887 |
|
889 | |||
888 | self.__lastdatatime = datatime |
|
890 | self.__lastdatatime = datatime | |
889 |
|
891 | |||
890 | if avgdata_spc == None: |
|
892 | if avgdata_spc == None: | |
891 | return None, None, None, None |
|
893 | return None, None, None, None | |
892 |
|
894 | |||
893 | avgdatatime = self.__initime |
|
895 | avgdatatime = self.__initime | |
894 | try: |
|
896 | try: | |
895 | self.__timeInterval = (self.__lastdatatime - self.__initime)/(self.n - 1) |
|
897 | self.__timeInterval = (self.__lastdatatime - self.__initime)/(self.n - 1) | |
896 | except: |
|
898 | except: | |
897 | self.__timeInterval = self.__lastdatatime - self.__initime |
|
899 | self.__timeInterval = self.__lastdatatime - self.__initime | |
898 |
|
900 | |||
899 | deltatime = datatime -self.__lastdatatime |
|
901 | deltatime = datatime -self.__lastdatatime | |
900 |
|
902 | |||
901 | if not self.__withOverapping: |
|
903 | if not self.__withOverapping: | |
902 | self.__initime = datatime |
|
904 | self.__initime = datatime | |
903 | else: |
|
905 | else: | |
904 | self.__initime += deltatime |
|
906 | self.__initime += deltatime | |
905 |
|
907 | |||
906 | return avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc |
|
908 | return avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc | |
907 |
|
909 | |||
908 | def run(self, dataOut, n=None, timeInterval=None, overlapping=False): |
|
910 | def run(self, dataOut, n=None, timeInterval=None, overlapping=False): | |
909 |
|
911 | |||
910 | if n==1: |
|
912 | if n==1: | |
911 | dataOut.flagNoData = False |
|
913 | dataOut.flagNoData = False | |
912 | return |
|
914 | return | |
913 |
|
915 | |||
914 | if not self.isConfig: |
|
916 | if not self.isConfig: | |
915 | self.setup(n, timeInterval, overlapping) |
|
917 | self.setup(n, timeInterval, overlapping) | |
916 | self.isConfig = True |
|
918 | self.isConfig = True | |
917 |
|
919 | |||
918 | avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime, |
|
920 | avgdatatime, avgdata_spc, avgdata_cspc, avgdata_dc = self.integrate(dataOut.utctime, | |
919 | dataOut.data_spc, |
|
921 | dataOut.data_spc, | |
920 | dataOut.data_cspc, |
|
922 | dataOut.data_cspc, | |
921 | dataOut.data_dc) |
|
923 | dataOut.data_dc) | |
922 |
|
924 | |||
923 | # dataOut.timeInterval *= n |
|
925 | # dataOut.timeInterval *= n | |
924 | dataOut.flagNoData = True |
|
926 | dataOut.flagNoData = True | |
925 |
|
927 | |||
926 | if self.__dataReady: |
|
928 | if self.__dataReady: | |
927 |
|
929 | |||
928 | dataOut.data_spc = avgdata_spc |
|
930 | dataOut.data_spc = avgdata_spc | |
929 | dataOut.data_cspc = avgdata_cspc |
|
931 | dataOut.data_cspc = avgdata_cspc | |
930 | dataOut.data_dc = avgdata_dc |
|
932 | dataOut.data_dc = avgdata_dc | |
931 |
|
933 | |||
932 | dataOut.nIncohInt *= self.n |
|
934 | dataOut.nIncohInt *= self.n | |
933 | dataOut.utctime = avgdatatime |
|
935 | dataOut.utctime = avgdatatime | |
934 | #dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt * dataOut.nIncohInt * dataOut.nFFTPoints |
|
936 | #dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt * dataOut.nIncohInt * dataOut.nFFTPoints | |
935 | # dataOut.timeInterval = self.__timeInterval*self.n |
|
937 | # dataOut.timeInterval = self.__timeInterval*self.n | |
936 | dataOut.flagNoData = False |
|
938 | dataOut.flagNoData = False |
@@ -1,1034 +1,1043 | |||||
1 | import numpy |
|
1 | import numpy | |
2 |
|
2 | |||
3 | from jroproc_base import ProcessingUnit, Operation |
|
3 | from jroproc_base import ProcessingUnit, Operation | |
4 | from schainpy.model.data.jrodata import Voltage |
|
4 | from schainpy.model.data.jrodata import Voltage | |
5 |
|
5 | |||
6 | class VoltageProc(ProcessingUnit): |
|
6 | class VoltageProc(ProcessingUnit): | |
7 |
|
7 | |||
8 |
|
8 | |||
9 | def __init__(self): |
|
9 | def __init__(self): | |
10 |
|
10 | |||
11 | ProcessingUnit.__init__(self) |
|
11 | ProcessingUnit.__init__(self) | |
12 |
|
12 | |||
13 | # self.objectDict = {} |
|
13 | # self.objectDict = {} | |
14 | self.dataOut = Voltage() |
|
14 | self.dataOut = Voltage() | |
15 | self.flip = 1 |
|
15 | self.flip = 1 | |
16 |
|
16 | |||
17 | def run(self): |
|
17 | def run(self): | |
18 | if self.dataIn.type == 'AMISR': |
|
18 | if self.dataIn.type == 'AMISR': | |
19 | self.__updateObjFromAmisrInput() |
|
19 | self.__updateObjFromAmisrInput() | |
20 |
|
20 | |||
21 | if self.dataIn.type == 'Voltage': |
|
21 | if self.dataIn.type == 'Voltage': | |
22 | self.dataOut.copy(self.dataIn) |
|
22 | self.dataOut.copy(self.dataIn) | |
23 |
|
23 | |||
24 | # self.dataOut.copy(self.dataIn) |
|
24 | # self.dataOut.copy(self.dataIn) | |
25 |
|
25 | |||
26 | def __updateObjFromAmisrInput(self): |
|
26 | def __updateObjFromAmisrInput(self): | |
27 |
|
27 | |||
28 | self.dataOut.timeZone = self.dataIn.timeZone |
|
28 | self.dataOut.timeZone = self.dataIn.timeZone | |
29 | self.dataOut.dstFlag = self.dataIn.dstFlag |
|
29 | self.dataOut.dstFlag = self.dataIn.dstFlag | |
30 | self.dataOut.errorCount = self.dataIn.errorCount |
|
30 | self.dataOut.errorCount = self.dataIn.errorCount | |
31 | self.dataOut.useLocalTime = self.dataIn.useLocalTime |
|
31 | self.dataOut.useLocalTime = self.dataIn.useLocalTime | |
32 |
|
32 | |||
33 | self.dataOut.flagNoData = self.dataIn.flagNoData |
|
33 | self.dataOut.flagNoData = self.dataIn.flagNoData | |
34 | self.dataOut.data = self.dataIn.data |
|
34 | self.dataOut.data = self.dataIn.data | |
35 | self.dataOut.utctime = self.dataIn.utctime |
|
35 | self.dataOut.utctime = self.dataIn.utctime | |
36 | self.dataOut.channelList = self.dataIn.channelList |
|
36 | self.dataOut.channelList = self.dataIn.channelList | |
37 | self.dataOut.timeInterval = self.dataIn.timeInterval |
|
37 | self.dataOut.timeInterval = self.dataIn.timeInterval | |
38 | self.dataOut.heightList = self.dataIn.heightList |
|
38 | self.dataOut.heightList = self.dataIn.heightList | |
39 | self.dataOut.nProfiles = self.dataIn.nProfiles |
|
39 | self.dataOut.nProfiles = self.dataIn.nProfiles | |
40 |
|
40 | |||
41 | self.dataOut.nCohInt = self.dataIn.nCohInt |
|
41 | self.dataOut.nCohInt = self.dataIn.nCohInt | |
42 | self.dataOut.ippSeconds = self.dataIn.ippSeconds |
|
42 | self.dataOut.ippSeconds = self.dataIn.ippSeconds | |
43 | self.dataOut.frequency = self.dataIn.frequency |
|
43 | self.dataOut.frequency = self.dataIn.frequency | |
44 |
|
44 | |||
45 | self.dataOut.azimuth = self.dataIn.azimuth |
|
45 | self.dataOut.azimuth = self.dataIn.azimuth | |
46 | self.dataOut.zenith = self.dataIn.zenith |
|
46 | self.dataOut.zenith = self.dataIn.zenith | |
47 |
|
47 | |||
48 | self.dataOut.beam.codeList = self.dataIn.beam.codeList |
|
48 | self.dataOut.beam.codeList = self.dataIn.beam.codeList | |
49 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList |
|
49 | self.dataOut.beam.azimuthList = self.dataIn.beam.azimuthList | |
50 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList |
|
50 | self.dataOut.beam.zenithList = self.dataIn.beam.zenithList | |
51 | # |
|
51 | # | |
52 | # pass# |
|
52 | # pass# | |
53 | # |
|
53 | # | |
54 | # def init(self): |
|
54 | # def init(self): | |
55 | # |
|
55 | # | |
56 | # |
|
56 | # | |
57 | # if self.dataIn.type == 'AMISR': |
|
57 | # if self.dataIn.type == 'AMISR': | |
58 | # self.__updateObjFromAmisrInput() |
|
58 | # self.__updateObjFromAmisrInput() | |
59 | # |
|
59 | # | |
60 | # if self.dataIn.type == 'Voltage': |
|
60 | # if self.dataIn.type == 'Voltage': | |
61 | # self.dataOut.copy(self.dataIn) |
|
61 | # self.dataOut.copy(self.dataIn) | |
62 | # # No necesita copiar en cada init() los atributos de dataIn |
|
62 | # # No necesita copiar en cada init() los atributos de dataIn | |
63 | # # la copia deberia hacerse por cada nuevo bloque de datos |
|
63 | # # la copia deberia hacerse por cada nuevo bloque de datos | |
64 |
|
64 | |||
65 | def selectChannels(self, channelList): |
|
65 | def selectChannels(self, channelList): | |
66 |
|
66 | |||
67 | channelIndexList = [] |
|
67 | channelIndexList = [] | |
68 |
|
68 | |||
69 | for channel in channelList: |
|
69 | for channel in channelList: | |
|
70 | if channel not in self.dataOut.channelList: | |||
|
71 | continue | |||
|
72 | ||||
70 | index = self.dataOut.channelList.index(channel) |
|
73 | index = self.dataOut.channelList.index(channel) | |
71 | channelIndexList.append(index) |
|
74 | channelIndexList.append(index) | |
72 |
|
75 | |||
73 | self.selectChannelsByIndex(channelIndexList) |
|
76 | self.selectChannelsByIndex(channelIndexList) | |
74 |
|
77 | |||
75 | def selectChannelsByIndex(self, channelIndexList): |
|
78 | def selectChannelsByIndex(self, channelIndexList): | |
76 | """ |
|
79 | """ | |
77 | Selecciona un bloque de datos en base a canales segun el channelIndexList |
|
80 | Selecciona un bloque de datos en base a canales segun el channelIndexList | |
78 |
|
81 | |||
79 | Input: |
|
82 | Input: | |
80 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] |
|
83 | channelIndexList : lista sencilla de canales a seleccionar por ej. [2,3,7] | |
81 |
|
84 | |||
82 | Affected: |
|
85 | Affected: | |
83 | self.dataOut.data |
|
86 | self.dataOut.data | |
84 | self.dataOut.channelIndexList |
|
87 | self.dataOut.channelIndexList | |
85 | self.dataOut.nChannels |
|
88 | self.dataOut.nChannels | |
86 | self.dataOut.m_ProcessingHeader.totalSpectra |
|
89 | self.dataOut.m_ProcessingHeader.totalSpectra | |
87 | self.dataOut.systemHeaderObj.numChannels |
|
90 | self.dataOut.systemHeaderObj.numChannels | |
88 | self.dataOut.m_ProcessingHeader.blockSize |
|
91 | self.dataOut.m_ProcessingHeader.blockSize | |
89 |
|
92 | |||
90 | Return: |
|
93 | Return: | |
91 | None |
|
94 | None | |
92 | """ |
|
95 | """ | |
93 |
|
96 | |||
94 | for channelIndex in channelIndexList: |
|
97 | for channelIndex in channelIndexList: | |
95 | if channelIndex not in self.dataOut.channelIndexList: |
|
98 | if channelIndex not in self.dataOut.channelIndexList: | |
96 | print channelIndexList |
|
99 | print channelIndexList | |
97 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex |
|
100 | raise ValueError, "The value %d in channelIndexList is not valid" %channelIndex | |
98 |
|
101 | |||
99 | # nChannels = len(channelIndexList) |
|
102 | # nChannels = len(channelIndexList) | |
100 | if self.dataOut.flagDataAsBlock: |
|
103 | if self.dataOut.flagDataAsBlock: | |
101 | """ |
|
104 | """ | |
102 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
105 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] | |
103 | """ |
|
106 | """ | |
104 | data = self.dataOut.data[channelIndexList,:,:] |
|
107 | data = self.dataOut.data[channelIndexList,:,:] | |
105 | else: |
|
108 | else: | |
106 | data = self.dataOut.data[channelIndexList,:] |
|
109 | data = self.dataOut.data[channelIndexList,:] | |
107 |
|
110 | |||
108 | self.dataOut.data = data |
|
111 | self.dataOut.data = data | |
109 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] |
|
112 | self.dataOut.channelList = [self.dataOut.channelList[i] for i in channelIndexList] | |
110 | # self.dataOut.nChannels = nChannels |
|
113 | # self.dataOut.nChannels = nChannels | |
111 |
|
114 | |||
112 | return 1 |
|
115 | return 1 | |
113 |
|
116 | |||
114 | def selectHeights(self, minHei=None, maxHei=None): |
|
117 | def selectHeights(self, minHei=None, maxHei=None): | |
115 | """ |
|
118 | """ | |
116 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango |
|
119 | Selecciona un bloque de datos en base a un grupo de valores de alturas segun el rango | |
117 | minHei <= height <= maxHei |
|
120 | minHei <= height <= maxHei | |
118 |
|
121 | |||
119 | Input: |
|
122 | Input: | |
120 | minHei : valor minimo de altura a considerar |
|
123 | minHei : valor minimo de altura a considerar | |
121 | maxHei : valor maximo de altura a considerar |
|
124 | maxHei : valor maximo de altura a considerar | |
122 |
|
125 | |||
123 | Affected: |
|
126 | Affected: | |
124 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex |
|
127 | Indirectamente son cambiados varios valores a travez del metodo selectHeightsByIndex | |
125 |
|
128 | |||
126 | Return: |
|
129 | Return: | |
127 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
130 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 | |
128 | """ |
|
131 | """ | |
129 |
|
132 | |||
130 | if minHei == None: |
|
133 | if minHei == None: | |
131 | minHei = self.dataOut.heightList[0] |
|
134 | minHei = self.dataOut.heightList[0] | |
132 |
|
135 | |||
133 | if maxHei == None: |
|
136 | if maxHei == None: | |
134 | maxHei = self.dataOut.heightList[-1] |
|
137 | maxHei = self.dataOut.heightList[-1] | |
135 |
|
138 | |||
136 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): |
|
139 | if (minHei < self.dataOut.heightList[0]) or (minHei > maxHei): | |
137 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
140 | raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) | |
138 |
|
141 | |||
139 |
|
142 | |||
140 | if (maxHei > self.dataOut.heightList[-1]): |
|
143 | if (maxHei > self.dataOut.heightList[-1]): | |
141 | maxHei = self.dataOut.heightList[-1] |
|
144 | maxHei = self.dataOut.heightList[-1] | |
142 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) |
|
145 | # raise ValueError, "some value in (%d,%d) is not valid" % (minHei, maxHei) | |
143 |
|
146 | |||
144 | minIndex = 0 |
|
147 | minIndex = 0 | |
145 | maxIndex = 0 |
|
148 | maxIndex = 0 | |
146 | heights = self.dataOut.heightList |
|
149 | heights = self.dataOut.heightList | |
147 |
|
150 | |||
148 | inda = numpy.where(heights >= minHei) |
|
151 | inda = numpy.where(heights >= minHei) | |
149 | indb = numpy.where(heights <= maxHei) |
|
152 | indb = numpy.where(heights <= maxHei) | |
150 |
|
153 | |||
151 | try: |
|
154 | try: | |
152 | minIndex = inda[0][0] |
|
155 | minIndex = inda[0][0] | |
153 | except: |
|
156 | except: | |
154 | minIndex = 0 |
|
157 | minIndex = 0 | |
155 |
|
158 | |||
156 | try: |
|
159 | try: | |
157 | maxIndex = indb[0][-1] |
|
160 | maxIndex = indb[0][-1] | |
158 | except: |
|
161 | except: | |
159 | maxIndex = len(heights) |
|
162 | maxIndex = len(heights) | |
160 |
|
163 | |||
161 | self.selectHeightsByIndex(minIndex, maxIndex) |
|
164 | self.selectHeightsByIndex(minIndex, maxIndex) | |
162 |
|
165 | |||
163 | return 1 |
|
166 | return 1 | |
164 |
|
167 | |||
165 |
|
168 | |||
166 | def selectHeightsByIndex(self, minIndex, maxIndex): |
|
169 | def selectHeightsByIndex(self, minIndex, maxIndex): | |
167 | """ |
|
170 | """ | |
168 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango |
|
171 | Selecciona un bloque de datos en base a un grupo indices de alturas segun el rango | |
169 | minIndex <= index <= maxIndex |
|
172 | minIndex <= index <= maxIndex | |
170 |
|
173 | |||
171 | Input: |
|
174 | Input: | |
172 | minIndex : valor de indice minimo de altura a considerar |
|
175 | minIndex : valor de indice minimo de altura a considerar | |
173 | maxIndex : valor de indice maximo de altura a considerar |
|
176 | maxIndex : valor de indice maximo de altura a considerar | |
174 |
|
177 | |||
175 | Affected: |
|
178 | Affected: | |
176 | self.dataOut.data |
|
179 | self.dataOut.data | |
177 | self.dataOut.heightList |
|
180 | self.dataOut.heightList | |
178 |
|
181 | |||
179 | Return: |
|
182 | Return: | |
180 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 |
|
183 | 1 si el metodo se ejecuto con exito caso contrario devuelve 0 | |
181 | """ |
|
184 | """ | |
182 |
|
185 | |||
183 | if (minIndex < 0) or (minIndex > maxIndex): |
|
186 | if (minIndex < 0) or (minIndex > maxIndex): | |
184 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
187 | raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
185 |
|
188 | |||
186 | if (maxIndex >= self.dataOut.nHeights): |
|
189 | if (maxIndex >= self.dataOut.nHeights): | |
187 | maxIndex = self.dataOut.nHeights |
|
190 | maxIndex = self.dataOut.nHeights | |
188 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) |
|
191 | # raise ValueError, "some value in (%d,%d) is not valid" % (minIndex, maxIndex) | |
189 |
|
192 | |||
190 | # nHeights = maxIndex - minIndex + 1 |
|
193 | # nHeights = maxIndex - minIndex + 1 | |
191 |
|
194 | |||
192 | #voltage |
|
195 | #voltage | |
193 | if self.dataOut.flagDataAsBlock: |
|
196 | if self.dataOut.flagDataAsBlock: | |
194 | """ |
|
197 | """ | |
195 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
198 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] | |
196 | """ |
|
199 | """ | |
197 | data = self.dataOut.data[:,minIndex:maxIndex,:] |
|
200 | data = self.dataOut.data[:,minIndex:maxIndex,:] | |
198 | else: |
|
201 | else: | |
199 | data = self.dataOut.data[:,minIndex:maxIndex] |
|
202 | data = self.dataOut.data[:,minIndex:maxIndex] | |
200 |
|
203 | |||
201 | # firstHeight = self.dataOut.heightList[minIndex] |
|
204 | # firstHeight = self.dataOut.heightList[minIndex] | |
202 |
|
205 | |||
203 | self.dataOut.data = data |
|
206 | self.dataOut.data = data | |
204 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex] |
|
207 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex] | |
205 |
|
208 | |||
206 | return 1 |
|
209 | return 1 | |
207 |
|
210 | |||
208 |
|
211 | |||
209 | def filterByHeights(self, window): |
|
212 | def filterByHeights(self, window): | |
210 |
|
213 | |||
211 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
214 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] | |
212 |
|
215 | |||
213 | if window == None: |
|
216 | if window == None: | |
214 | window = (self.dataOut.radarControllerHeaderObj.txA/self.dataOut.radarControllerHeaderObj.nBaud) / deltaHeight |
|
217 | window = (self.dataOut.radarControllerHeaderObj.txA/self.dataOut.radarControllerHeaderObj.nBaud) / deltaHeight | |
215 |
|
218 | |||
216 | newdelta = deltaHeight * window |
|
219 | newdelta = deltaHeight * window | |
217 | r = self.dataOut.nHeights % window |
|
220 | r = self.dataOut.nHeights % window | |
218 |
|
221 | |||
219 | if self.dataOut.flagDataAsBlock: |
|
222 | if self.dataOut.flagDataAsBlock: | |
220 | """ |
|
223 | """ | |
221 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
224 | Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis] | |
222 | """ |
|
225 | """ | |
223 | buffer = self.dataOut.data[:, :, 0:self.dataOut.nHeights-r] |
|
226 | buffer = self.dataOut.data[:, :, 0:self.dataOut.nHeights-r] | |
224 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nProfiles,self.dataOut.nHeights/window,window) |
|
227 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nProfiles,self.dataOut.nHeights/window,window) | |
225 | buffer = numpy.sum(buffer,3) |
|
228 | buffer = numpy.sum(buffer,3) | |
226 |
|
229 | |||
227 | else: |
|
230 | else: | |
228 | buffer = self.dataOut.data[:,0:self.dataOut.nHeights-r] |
|
231 | buffer = self.dataOut.data[:,0:self.dataOut.nHeights-r] | |
229 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nHeights/window,window) |
|
232 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nHeights/window,window) | |
230 | buffer = numpy.sum(buffer,2) |
|
233 | buffer = numpy.sum(buffer,2) | |
231 |
|
234 | |||
232 | self.dataOut.data = buffer.copy() |
|
235 | self.dataOut.data = buffer.copy() | |
233 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*(self.dataOut.nHeights-r)/window,newdelta) |
|
236 | self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*(self.dataOut.nHeights-r)/window,newdelta) | |
234 | self.dataOut.windowOfFilter = window |
|
237 | self.dataOut.windowOfFilter = window | |
235 |
|
238 | |||
236 | def setH0(self, h0, deltaHeight = None): |
|
239 | def setH0(self, h0, deltaHeight = None): | |
237 |
|
240 | |||
238 | if not deltaHeight: |
|
241 | if not deltaHeight: | |
239 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] |
|
242 | deltaHeight = self.dataOut.heightList[1] - self.dataOut.heightList[0] | |
240 |
|
243 | |||
241 | nHeights = self.dataOut.nHeights |
|
244 | nHeights = self.dataOut.nHeights | |
242 |
|
245 | |||
243 | newHeiRange = h0 + numpy.arange(nHeights)*deltaHeight |
|
246 | newHeiRange = h0 + numpy.arange(nHeights)*deltaHeight | |
244 |
|
247 | |||
245 | self.dataOut.heightList = newHeiRange |
|
248 | self.dataOut.heightList = newHeiRange | |
246 |
|
249 | |||
247 | def deFlip(self, channelList = []): |
|
250 | def deFlip(self, channelList = []): | |
248 |
|
251 | |||
249 | data = self.dataOut.data.copy() |
|
252 | data = self.dataOut.data.copy() | |
250 |
|
253 | |||
251 | if self.dataOut.flagDataAsBlock: |
|
254 | if self.dataOut.flagDataAsBlock: | |
252 | flip = self.flip |
|
255 | flip = self.flip | |
253 | profileList = range(self.dataOut.nProfiles) |
|
256 | profileList = range(self.dataOut.nProfiles) | |
254 |
|
257 | |||
255 | if channelList == []: |
|
258 | if channelList == []: | |
256 | for thisProfile in profileList: |
|
259 | for thisProfile in profileList: | |
257 | data[:,thisProfile,:] = data[:,thisProfile,:]*flip |
|
260 | data[:,thisProfile,:] = data[:,thisProfile,:]*flip | |
258 | flip *= -1.0 |
|
261 | flip *= -1.0 | |
259 | else: |
|
262 | else: | |
260 | for thisChannel in channelList: |
|
263 | for thisChannel in channelList: | |
|
264 | if thisChannel not in self.dataOut.channelList: | |||
|
265 | continue | |||
|
266 | ||||
261 | for thisProfile in profileList: |
|
267 | for thisProfile in profileList: | |
262 | data[thisChannel,thisProfile,:] = data[thisChannel,thisProfile,:]*flip |
|
268 | data[thisChannel,thisProfile,:] = data[thisChannel,thisProfile,:]*flip | |
263 | flip *= -1.0 |
|
269 | flip *= -1.0 | |
264 |
|
270 | |||
265 | self.flip = flip |
|
271 | self.flip = flip | |
266 |
|
272 | |||
267 | else: |
|
273 | else: | |
268 | if channelList == []: |
|
274 | if channelList == []: | |
269 | data[:,:] = data[:,:]*self.flip |
|
275 | data[:,:] = data[:,:]*self.flip | |
270 | else: |
|
276 | else: | |
271 | for thisChannel in channelList: |
|
277 | for thisChannel in channelList: | |
|
278 | if thisChannel not in self.dataOut.channelList: | |||
|
279 | continue | |||
|
280 | ||||
272 | data[thisChannel,:] = data[thisChannel,:]*self.flip |
|
281 | data[thisChannel,:] = data[thisChannel,:]*self.flip | |
273 |
|
282 | |||
274 | self.flip *= -1. |
|
283 | self.flip *= -1. | |
275 |
|
284 | |||
276 | self.dataOut.data = data |
|
285 | self.dataOut.data = data | |
277 |
|
286 | |||
278 | def setRadarFrequency(self, frequency=None): |
|
287 | def setRadarFrequency(self, frequency=None): | |
279 |
|
288 | |||
280 | if frequency != None: |
|
289 | if frequency != None: | |
281 | self.dataOut.frequency = frequency |
|
290 | self.dataOut.frequency = frequency | |
282 |
|
291 | |||
283 | return 1 |
|
292 | return 1 | |
284 |
|
293 | |||
285 | class CohInt(Operation): |
|
294 | class CohInt(Operation): | |
286 |
|
295 | |||
287 | isConfig = False |
|
296 | isConfig = False | |
288 |
|
297 | |||
289 | __profIndex = 0 |
|
298 | __profIndex = 0 | |
290 | __withOverapping = False |
|
299 | __withOverapping = False | |
291 |
|
300 | |||
292 | __byTime = False |
|
301 | __byTime = False | |
293 | __initime = None |
|
302 | __initime = None | |
294 | __lastdatatime = None |
|
303 | __lastdatatime = None | |
295 | __integrationtime = None |
|
304 | __integrationtime = None | |
296 |
|
305 | |||
297 | __buffer = None |
|
306 | __buffer = None | |
298 |
|
307 | |||
299 | __dataReady = False |
|
308 | __dataReady = False | |
300 |
|
309 | |||
301 | n = None |
|
310 | n = None | |
302 |
|
311 | |||
303 |
|
312 | |||
304 | def __init__(self): |
|
313 | def __init__(self): | |
305 |
|
314 | |||
306 | Operation.__init__(self) |
|
315 | Operation.__init__(self) | |
307 |
|
316 | |||
308 | # self.isConfig = False |
|
317 | # self.isConfig = False | |
309 |
|
318 | |||
310 | def setup(self, n=None, timeInterval=None, overlapping=False, byblock=False): |
|
319 | def setup(self, n=None, timeInterval=None, overlapping=False, byblock=False): | |
311 | """ |
|
320 | """ | |
312 | Set the parameters of the integration class. |
|
321 | Set the parameters of the integration class. | |
313 |
|
322 | |||
314 | Inputs: |
|
323 | Inputs: | |
315 |
|
324 | |||
316 | n : Number of coherent integrations |
|
325 | n : Number of coherent integrations | |
317 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work |
|
326 | timeInterval : Time of integration. If the parameter "n" is selected this one does not work | |
318 | overlapping : |
|
327 | overlapping : | |
319 |
|
328 | |||
320 | """ |
|
329 | """ | |
321 |
|
330 | |||
322 | self.__initime = None |
|
331 | self.__initime = None | |
323 | self.__lastdatatime = 0 |
|
332 | self.__lastdatatime = 0 | |
324 | self.__buffer = None |
|
333 | self.__buffer = None | |
325 | self.__dataReady = False |
|
334 | self.__dataReady = False | |
326 | self.byblock = byblock |
|
335 | self.byblock = byblock | |
327 |
|
336 | |||
328 | if n == None and timeInterval == None: |
|
337 | if n == None and timeInterval == None: | |
329 | raise ValueError, "n or timeInterval should be specified ..." |
|
338 | raise ValueError, "n or timeInterval should be specified ..." | |
330 |
|
339 | |||
331 | if n != None: |
|
340 | if n != None: | |
332 | self.n = n |
|
341 | self.n = n | |
333 | self.__byTime = False |
|
342 | self.__byTime = False | |
334 | else: |
|
343 | else: | |
335 | self.__integrationtime = timeInterval #* 60. #if (type(timeInterval)!=integer) -> change this line |
|
344 | self.__integrationtime = timeInterval #* 60. #if (type(timeInterval)!=integer) -> change this line | |
336 | self.n = 9999 |
|
345 | self.n = 9999 | |
337 | self.__byTime = True |
|
346 | self.__byTime = True | |
338 |
|
347 | |||
339 | if overlapping: |
|
348 | if overlapping: | |
340 | self.__withOverapping = True |
|
349 | self.__withOverapping = True | |
341 | self.__buffer = None |
|
350 | self.__buffer = None | |
342 | else: |
|
351 | else: | |
343 | self.__withOverapping = False |
|
352 | self.__withOverapping = False | |
344 | self.__buffer = 0 |
|
353 | self.__buffer = 0 | |
345 |
|
354 | |||
346 | self.__profIndex = 0 |
|
355 | self.__profIndex = 0 | |
347 |
|
356 | |||
348 | def putData(self, data): |
|
357 | def putData(self, data): | |
349 |
|
358 | |||
350 | """ |
|
359 | """ | |
351 | Add a profile to the __buffer and increase in one the __profileIndex |
|
360 | Add a profile to the __buffer and increase in one the __profileIndex | |
352 |
|
361 | |||
353 | """ |
|
362 | """ | |
354 |
|
363 | |||
355 | if not self.__withOverapping: |
|
364 | if not self.__withOverapping: | |
356 | self.__buffer += data.copy() |
|
365 | self.__buffer += data.copy() | |
357 | self.__profIndex += 1 |
|
366 | self.__profIndex += 1 | |
358 | return |
|
367 | return | |
359 |
|
368 | |||
360 | #Overlapping data |
|
369 | #Overlapping data | |
361 | nChannels, nHeis = data.shape |
|
370 | nChannels, nHeis = data.shape | |
362 | data = numpy.reshape(data, (1, nChannels, nHeis)) |
|
371 | data = numpy.reshape(data, (1, nChannels, nHeis)) | |
363 |
|
372 | |||
364 | #If the buffer is empty then it takes the data value |
|
373 | #If the buffer is empty then it takes the data value | |
365 | if self.__buffer == None: |
|
374 | if self.__buffer == None: | |
366 | self.__buffer = data |
|
375 | self.__buffer = data | |
367 | self.__profIndex += 1 |
|
376 | self.__profIndex += 1 | |
368 | return |
|
377 | return | |
369 |
|
378 | |||
370 | #If the buffer length is lower than n then stakcing the data value |
|
379 | #If the buffer length is lower than n then stakcing the data value | |
371 | if self.__profIndex < self.n: |
|
380 | if self.__profIndex < self.n: | |
372 | self.__buffer = numpy.vstack((self.__buffer, data)) |
|
381 | self.__buffer = numpy.vstack((self.__buffer, data)) | |
373 | self.__profIndex += 1 |
|
382 | self.__profIndex += 1 | |
374 | return |
|
383 | return | |
375 |
|
384 | |||
376 | #If the buffer length is equal to n then replacing the last buffer value with the data value |
|
385 | #If the buffer length is equal to n then replacing the last buffer value with the data value | |
377 | self.__buffer = numpy.roll(self.__buffer, -1, axis=0) |
|
386 | self.__buffer = numpy.roll(self.__buffer, -1, axis=0) | |
378 | self.__buffer[self.n-1] = data |
|
387 | self.__buffer[self.n-1] = data | |
379 | self.__profIndex = self.n |
|
388 | self.__profIndex = self.n | |
380 | return |
|
389 | return | |
381 |
|
390 | |||
382 |
|
391 | |||
383 | def pushData(self): |
|
392 | def pushData(self): | |
384 | """ |
|
393 | """ | |
385 | Return the sum of the last profiles and the profiles used in the sum. |
|
394 | Return the sum of the last profiles and the profiles used in the sum. | |
386 |
|
395 | |||
387 | Affected: |
|
396 | Affected: | |
388 |
|
397 | |||
389 | self.__profileIndex |
|
398 | self.__profileIndex | |
390 |
|
399 | |||
391 | """ |
|
400 | """ | |
392 |
|
401 | |||
393 | if not self.__withOverapping: |
|
402 | if not self.__withOverapping: | |
394 | data = self.__buffer |
|
403 | data = self.__buffer | |
395 | n = self.__profIndex |
|
404 | n = self.__profIndex | |
396 |
|
405 | |||
397 | self.__buffer = 0 |
|
406 | self.__buffer = 0 | |
398 | self.__profIndex = 0 |
|
407 | self.__profIndex = 0 | |
399 |
|
408 | |||
400 | return data, n |
|
409 | return data, n | |
401 |
|
410 | |||
402 | #Integration with Overlapping |
|
411 | #Integration with Overlapping | |
403 | data = numpy.sum(self.__buffer, axis=0) |
|
412 | data = numpy.sum(self.__buffer, axis=0) | |
404 | n = self.__profIndex |
|
413 | n = self.__profIndex | |
405 |
|
414 | |||
406 | return data, n |
|
415 | return data, n | |
407 |
|
416 | |||
408 | def byProfiles(self, data): |
|
417 | def byProfiles(self, data): | |
409 |
|
418 | |||
410 | self.__dataReady = False |
|
419 | self.__dataReady = False | |
411 | avgdata = None |
|
420 | avgdata = None | |
412 | # n = None |
|
421 | # n = None | |
413 |
|
422 | |||
414 | self.putData(data) |
|
423 | self.putData(data) | |
415 |
|
424 | |||
416 | if self.__profIndex == self.n: |
|
425 | if self.__profIndex == self.n: | |
417 |
|
426 | |||
418 | avgdata, n = self.pushData() |
|
427 | avgdata, n = self.pushData() | |
419 | self.__dataReady = True |
|
428 | self.__dataReady = True | |
420 |
|
429 | |||
421 | return avgdata |
|
430 | return avgdata | |
422 |
|
431 | |||
423 | def byTime(self, data, datatime): |
|
432 | def byTime(self, data, datatime): | |
424 |
|
433 | |||
425 | self.__dataReady = False |
|
434 | self.__dataReady = False | |
426 | avgdata = None |
|
435 | avgdata = None | |
427 | n = None |
|
436 | n = None | |
428 |
|
437 | |||
429 | self.putData(data) |
|
438 | self.putData(data) | |
430 |
|
439 | |||
431 | if (datatime - self.__initime) >= self.__integrationtime: |
|
440 | if (datatime - self.__initime) >= self.__integrationtime: | |
432 | avgdata, n = self.pushData() |
|
441 | avgdata, n = self.pushData() | |
433 | self.n = n |
|
442 | self.n = n | |
434 | self.__dataReady = True |
|
443 | self.__dataReady = True | |
435 |
|
444 | |||
436 | return avgdata |
|
445 | return avgdata | |
437 |
|
446 | |||
438 | def integrate(self, data, datatime=None): |
|
447 | def integrate(self, data, datatime=None): | |
439 |
|
448 | |||
440 | if self.__initime == None: |
|
449 | if self.__initime == None: | |
441 | self.__initime = datatime |
|
450 | self.__initime = datatime | |
442 |
|
451 | |||
443 | if self.__byTime: |
|
452 | if self.__byTime: | |
444 | avgdata = self.byTime(data, datatime) |
|
453 | avgdata = self.byTime(data, datatime) | |
445 | else: |
|
454 | else: | |
446 | avgdata = self.byProfiles(data) |
|
455 | avgdata = self.byProfiles(data) | |
447 |
|
456 | |||
448 |
|
457 | |||
449 | self.__lastdatatime = datatime |
|
458 | self.__lastdatatime = datatime | |
450 |
|
459 | |||
451 | if avgdata == None: |
|
460 | if avgdata == None: | |
452 | return None, None |
|
461 | return None, None | |
453 |
|
462 | |||
454 | avgdatatime = self.__initime |
|
463 | avgdatatime = self.__initime | |
455 |
|
464 | |||
456 | deltatime = datatime -self.__lastdatatime |
|
465 | deltatime = datatime -self.__lastdatatime | |
457 |
|
466 | |||
458 | if not self.__withOverapping: |
|
467 | if not self.__withOverapping: | |
459 | self.__initime = datatime |
|
468 | self.__initime = datatime | |
460 | else: |
|
469 | else: | |
461 | self.__initime += deltatime |
|
470 | self.__initime += deltatime | |
462 |
|
471 | |||
463 | return avgdata, avgdatatime |
|
472 | return avgdata, avgdatatime | |
464 |
|
473 | |||
465 | def integrateByBlock(self, dataOut): |
|
474 | def integrateByBlock(self, dataOut): | |
466 |
|
475 | |||
467 | times = int(dataOut.data.shape[1]/self.n) |
|
476 | times = int(dataOut.data.shape[1]/self.n) | |
468 | avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=numpy.complex) |
|
477 | avgdata = numpy.zeros((dataOut.nChannels, times, dataOut.nHeights), dtype=numpy.complex) | |
469 |
|
478 | |||
470 | id_min = 0 |
|
479 | id_min = 0 | |
471 | id_max = self.n |
|
480 | id_max = self.n | |
472 |
|
481 | |||
473 | for i in range(times): |
|
482 | for i in range(times): | |
474 | junk = dataOut.data[:,id_min:id_max,:] |
|
483 | junk = dataOut.data[:,id_min:id_max,:] | |
475 | avgdata[:,i,:] = junk.sum(axis=1) |
|
484 | avgdata[:,i,:] = junk.sum(axis=1) | |
476 | id_min += self.n |
|
485 | id_min += self.n | |
477 | id_max += self.n |
|
486 | id_max += self.n | |
478 |
|
487 | |||
479 | timeInterval = dataOut.ippSeconds*self.n |
|
488 | timeInterval = dataOut.ippSeconds*self.n | |
480 | avgdatatime = (times - 1) * timeInterval + dataOut.utctime |
|
489 | avgdatatime = (times - 1) * timeInterval + dataOut.utctime | |
481 | self.__dataReady = True |
|
490 | self.__dataReady = True | |
482 | return avgdata, avgdatatime |
|
491 | return avgdata, avgdatatime | |
483 |
|
492 | |||
484 | def run(self, dataOut, **kwargs): |
|
493 | def run(self, dataOut, **kwargs): | |
485 |
|
494 | |||
486 | if not self.isConfig: |
|
495 | if not self.isConfig: | |
487 | self.setup(**kwargs) |
|
496 | self.setup(**kwargs) | |
488 | self.isConfig = True |
|
497 | self.isConfig = True | |
489 |
|
498 | |||
490 | if dataOut.flagDataAsBlock: |
|
499 | if dataOut.flagDataAsBlock: | |
491 | """ |
|
500 | """ | |
492 | Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis] |
|
501 | Si la data es leida por bloques, dimension = [nChannels, nProfiles, nHeis] | |
493 | """ |
|
502 | """ | |
494 | avgdata, avgdatatime = self.integrateByBlock(dataOut) |
|
503 | avgdata, avgdatatime = self.integrateByBlock(dataOut) | |
495 | else: |
|
504 | else: | |
496 | avgdata, avgdatatime = self.integrate(dataOut.data, dataOut.utctime) |
|
505 | avgdata, avgdatatime = self.integrate(dataOut.data, dataOut.utctime) | |
497 |
|
506 | |||
498 | # dataOut.timeInterval *= n |
|
507 | # dataOut.timeInterval *= n | |
499 | dataOut.flagNoData = True |
|
508 | dataOut.flagNoData = True | |
500 |
|
509 | |||
501 | if self.__dataReady: |
|
510 | if self.__dataReady: | |
502 | dataOut.data = avgdata |
|
511 | dataOut.data = avgdata | |
503 | dataOut.nCohInt *= self.n |
|
512 | dataOut.nCohInt *= self.n | |
504 | dataOut.utctime = avgdatatime |
|
513 | dataOut.utctime = avgdatatime | |
505 | # dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt |
|
514 | # dataOut.timeInterval = dataOut.ippSeconds * dataOut.nCohInt | |
506 | dataOut.flagNoData = False |
|
515 | dataOut.flagNoData = False | |
507 |
|
516 | |||
508 | class Decoder(Operation): |
|
517 | class Decoder(Operation): | |
509 |
|
518 | |||
510 | isConfig = False |
|
519 | isConfig = False | |
511 | __profIndex = 0 |
|
520 | __profIndex = 0 | |
512 |
|
521 | |||
513 | code = None |
|
522 | code = None | |
514 |
|
523 | |||
515 | nCode = None |
|
524 | nCode = None | |
516 | nBaud = None |
|
525 | nBaud = None | |
517 |
|
526 | |||
518 |
|
527 | |||
519 | def __init__(self): |
|
528 | def __init__(self): | |
520 |
|
529 | |||
521 | Operation.__init__(self) |
|
530 | Operation.__init__(self) | |
522 |
|
531 | |||
523 | self.times = None |
|
532 | self.times = None | |
524 | self.osamp = None |
|
533 | self.osamp = None | |
525 | # self.__setValues = False |
|
534 | # self.__setValues = False | |
526 | self.isConfig = False |
|
535 | self.isConfig = False | |
527 |
|
536 | |||
528 | def setup(self, code, osamp, dataOut): |
|
537 | def setup(self, code, osamp, dataOut): | |
529 |
|
538 | |||
530 | self.__profIndex = 0 |
|
539 | self.__profIndex = 0 | |
531 |
|
540 | |||
532 | self.code = code |
|
541 | self.code = code | |
533 |
|
542 | |||
534 | self.nCode = len(code) |
|
543 | self.nCode = len(code) | |
535 | self.nBaud = len(code[0]) |
|
544 | self.nBaud = len(code[0]) | |
536 |
|
545 | |||
537 | if (osamp != None) and (osamp >1): |
|
546 | if (osamp != None) and (osamp >1): | |
538 | self.osamp = osamp |
|
547 | self.osamp = osamp | |
539 | self.code = numpy.repeat(code, repeats=self.osamp, axis=1) |
|
548 | self.code = numpy.repeat(code, repeats=self.osamp, axis=1) | |
540 | self.nBaud = self.nBaud*self.osamp |
|
549 | self.nBaud = self.nBaud*self.osamp | |
541 |
|
550 | |||
542 | self.__nChannels = dataOut.nChannels |
|
551 | self.__nChannels = dataOut.nChannels | |
543 | self.__nProfiles = dataOut.nProfiles |
|
552 | self.__nProfiles = dataOut.nProfiles | |
544 | self.__nHeis = dataOut.nHeights |
|
553 | self.__nHeis = dataOut.nHeights | |
545 |
|
554 | |||
546 | if dataOut.flagDataAsBlock: |
|
555 | if dataOut.flagDataAsBlock: | |
547 |
|
556 | |||
548 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
557 | self.ndatadec = self.__nHeis #- self.nBaud + 1 | |
549 |
|
558 | |||
550 | self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) |
|
559 | self.datadecTime = numpy.zeros((self.__nChannels, self.__nProfiles, self.ndatadec), dtype=numpy.complex) | |
551 |
|
560 | |||
552 | else: |
|
561 | else: | |
553 |
|
562 | |||
554 | __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) |
|
563 | __codeBuffer = numpy.zeros((self.nCode, self.__nHeis), dtype=numpy.complex) | |
555 |
|
564 | |||
556 | __codeBuffer[:,0:self.nBaud] = self.code |
|
565 | __codeBuffer[:,0:self.nBaud] = self.code | |
557 |
|
566 | |||
558 | self.fft_code = numpy.conj(numpy.fft.fft(__codeBuffer, axis=1)) |
|
567 | self.fft_code = numpy.conj(numpy.fft.fft(__codeBuffer, axis=1)) | |
559 |
|
568 | |||
560 | self.ndatadec = self.__nHeis #- self.nBaud + 1 |
|
569 | self.ndatadec = self.__nHeis #- self.nBaud + 1 | |
561 |
|
570 | |||
562 | self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) |
|
571 | self.datadecTime = numpy.zeros((self.__nChannels, self.ndatadec), dtype=numpy.complex) | |
563 |
|
572 | |||
564 | def convolutionInFreq(self, data): |
|
573 | def convolutionInFreq(self, data): | |
565 |
|
574 | |||
566 | fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
575 | fft_code = self.fft_code[self.__profIndex].reshape(1,-1) | |
567 |
|
576 | |||
568 | fft_data = numpy.fft.fft(data, axis=1) |
|
577 | fft_data = numpy.fft.fft(data, axis=1) | |
569 |
|
578 | |||
570 | conv = fft_data*fft_code |
|
579 | conv = fft_data*fft_code | |
571 |
|
580 | |||
572 | data = numpy.fft.ifft(conv,axis=1) |
|
581 | data = numpy.fft.ifft(conv,axis=1) | |
573 |
|
582 | |||
574 | datadec = data#[:,:] |
|
583 | datadec = data#[:,:] | |
575 |
|
584 | |||
576 | return datadec |
|
585 | return datadec | |
577 |
|
586 | |||
578 | def convolutionInFreqOpt(self, data): |
|
587 | def convolutionInFreqOpt(self, data): | |
579 |
|
588 | |||
580 | raise NotImplementedError |
|
589 | raise NotImplementedError | |
581 |
|
590 | |||
582 | # fft_code = self.fft_code[self.__profIndex].reshape(1,-1) |
|
591 | # fft_code = self.fft_code[self.__profIndex].reshape(1,-1) | |
583 | # |
|
592 | # | |
584 | # data = cfunctions.decoder(fft_code, data) |
|
593 | # data = cfunctions.decoder(fft_code, data) | |
585 | # |
|
594 | # | |
586 | # datadec = data#[:,:] |
|
595 | # datadec = data#[:,:] | |
587 | # |
|
596 | # | |
588 | # return datadec |
|
597 | # return datadec | |
589 |
|
598 | |||
590 | def convolutionInTime(self, data): |
|
599 | def convolutionInTime(self, data): | |
591 |
|
600 | |||
592 | code = self.code[self.__profIndex] |
|
601 | code = self.code[self.__profIndex] | |
593 |
|
602 | |||
594 | for i in range(self.__nChannels): |
|
603 | for i in range(self.__nChannels): | |
595 | self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='same') |
|
604 | self.datadecTime[i,:] = numpy.correlate(data[i,:], code, mode='same') | |
596 |
|
605 | |||
597 | return self.datadecTime |
|
606 | return self.datadecTime | |
598 |
|
607 | |||
599 | def convolutionByBlockInTime(self, data): |
|
608 | def convolutionByBlockInTime(self, data): | |
600 |
|
609 | |||
601 | repetitions = self.__nProfiles / self.nCode |
|
610 | repetitions = self.__nProfiles / self.nCode | |
602 |
|
611 | |||
603 | junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize)) |
|
612 | junk = numpy.lib.stride_tricks.as_strided(self.code, (repetitions, self.code.size), (0, self.code.itemsize)) | |
604 | junk = junk.flatten() |
|
613 | junk = junk.flatten() | |
605 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) |
|
614 | code_block = numpy.reshape(junk, (self.nCode*repetitions, self.nBaud)) | |
606 |
|
615 | |||
607 | for i in range(self.__nChannels): |
|
616 | for i in range(self.__nChannels): | |
608 | for j in range(self.__nProfiles): |
|
617 | for j in range(self.__nProfiles): | |
609 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='same') |
|
618 | self.datadecTime[i,j,:] = numpy.correlate(data[i,j,:], code_block[j,:], mode='same') | |
610 |
|
619 | |||
611 | return self.datadecTime |
|
620 | return self.datadecTime | |
612 |
|
621 | |||
613 | def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, times=None, osamp=None): |
|
622 | def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, times=None, osamp=None): | |
614 |
|
623 | |||
615 | if not self.isConfig: |
|
624 | if not self.isConfig: | |
616 |
|
625 | |||
617 | if code == None: |
|
626 | if code == None: | |
618 | code = dataOut.code |
|
627 | code = dataOut.code | |
619 | else: |
|
628 | else: | |
620 | code = numpy.array(code).reshape(nCode,nBaud) |
|
629 | code = numpy.array(code).reshape(nCode,nBaud) | |
621 |
|
630 | |||
622 | self.setup(code, osamp, dataOut) |
|
631 | self.setup(code, osamp, dataOut) | |
623 |
|
632 | |||
624 | self.isConfig = True |
|
633 | self.isConfig = True | |
625 |
|
634 | |||
626 | if dataOut.flagDataAsBlock: |
|
635 | if dataOut.flagDataAsBlock: | |
627 | """ |
|
636 | """ | |
628 | Decoding when data have been read as block, |
|
637 | Decoding when data have been read as block, | |
629 | """ |
|
638 | """ | |
630 | datadec = self.convolutionByBlockInTime(dataOut.data) |
|
639 | datadec = self.convolutionByBlockInTime(dataOut.data) | |
631 |
|
640 | |||
632 | else: |
|
641 | else: | |
633 | """ |
|
642 | """ | |
634 | Decoding when data have been read profile by profile |
|
643 | Decoding when data have been read profile by profile | |
635 | """ |
|
644 | """ | |
636 | if mode == 0: |
|
645 | if mode == 0: | |
637 | datadec = self.convolutionInTime(dataOut.data) |
|
646 | datadec = self.convolutionInTime(dataOut.data) | |
638 |
|
647 | |||
639 | if mode == 1: |
|
648 | if mode == 1: | |
640 | datadec = self.convolutionInFreq(dataOut.data) |
|
649 | datadec = self.convolutionInFreq(dataOut.data) | |
641 |
|
650 | |||
642 | if mode == 2: |
|
651 | if mode == 2: | |
643 | datadec = self.convolutionInFreqOpt(dataOut.data) |
|
652 | datadec = self.convolutionInFreqOpt(dataOut.data) | |
644 |
|
653 | |||
645 | dataOut.code = self.code |
|
654 | dataOut.code = self.code | |
646 | dataOut.nCode = self.nCode |
|
655 | dataOut.nCode = self.nCode | |
647 | dataOut.nBaud = self.nBaud |
|
656 | dataOut.nBaud = self.nBaud | |
648 | dataOut.radarControllerHeaderObj.code = self.code |
|
657 | dataOut.radarControllerHeaderObj.code = self.code | |
649 | dataOut.radarControllerHeaderObj.nCode = self.nCode |
|
658 | dataOut.radarControllerHeaderObj.nCode = self.nCode | |
650 | dataOut.radarControllerHeaderObj.nBaud = self.nBaud |
|
659 | dataOut.radarControllerHeaderObj.nBaud = self.nBaud | |
651 |
|
660 | |||
652 | dataOut.data = datadec |
|
661 | dataOut.data = datadec | |
653 |
|
662 | |||
654 | dataOut.heightList = dataOut.heightList[0:self.ndatadec] |
|
663 | dataOut.heightList = dataOut.heightList[0:self.ndatadec] | |
655 |
|
664 | |||
656 | dataOut.flagDecodeData = True #asumo q la data esta decodificada |
|
665 | dataOut.flagDecodeData = True #asumo q la data esta decodificada | |
657 |
|
666 | |||
658 | if self.__profIndex == self.nCode-1: |
|
667 | if self.__profIndex == self.nCode-1: | |
659 | self.__profIndex = 0 |
|
668 | self.__profIndex = 0 | |
660 | return 1 |
|
669 | return 1 | |
661 |
|
670 | |||
662 | self.__profIndex += 1 |
|
671 | self.__profIndex += 1 | |
663 |
|
672 | |||
664 | return 1 |
|
673 | return 1 | |
665 | # dataOut.flagDeflipData = True #asumo q la data no esta sin flip |
|
674 | # dataOut.flagDeflipData = True #asumo q la data no esta sin flip | |
666 |
|
675 | |||
667 |
|
676 | |||
668 | class ProfileConcat(Operation): |
|
677 | class ProfileConcat(Operation): | |
669 |
|
678 | |||
670 | isConfig = False |
|
679 | isConfig = False | |
671 | buffer = None |
|
680 | buffer = None | |
672 |
|
681 | |||
673 | def __init__(self): |
|
682 | def __init__(self): | |
674 |
|
683 | |||
675 | Operation.__init__(self) |
|
684 | Operation.__init__(self) | |
676 | self.profileIndex = 0 |
|
685 | self.profileIndex = 0 | |
677 |
|
686 | |||
678 | def reset(self): |
|
687 | def reset(self): | |
679 | self.buffer = numpy.zeros_like(self.buffer) |
|
688 | self.buffer = numpy.zeros_like(self.buffer) | |
680 | self.start_index = 0 |
|
689 | self.start_index = 0 | |
681 | self.times = 1 |
|
690 | self.times = 1 | |
682 |
|
691 | |||
683 | def setup(self, data, m, n=1): |
|
692 | def setup(self, data, m, n=1): | |
684 | self.buffer = numpy.zeros((data.shape[0],data.shape[1]*m),dtype=type(data[0,0])) |
|
693 | self.buffer = numpy.zeros((data.shape[0],data.shape[1]*m),dtype=type(data[0,0])) | |
685 | self.nHeights = data.nHeights |
|
694 | self.nHeights = data.nHeights | |
686 | self.start_index = 0 |
|
695 | self.start_index = 0 | |
687 | self.times = 1 |
|
696 | self.times = 1 | |
688 |
|
697 | |||
689 | def concat(self, data): |
|
698 | def concat(self, data): | |
690 |
|
699 | |||
691 | self.buffer[:,self.start_index:self.profiles*self.times] = data.copy() |
|
700 | self.buffer[:,self.start_index:self.profiles*self.times] = data.copy() | |
692 | self.start_index = self.start_index + self.nHeights |
|
701 | self.start_index = self.start_index + self.nHeights | |
693 |
|
702 | |||
694 | def run(self, dataOut, m): |
|
703 | def run(self, dataOut, m): | |
695 |
|
704 | |||
696 | dataOut.flagNoData = True |
|
705 | dataOut.flagNoData = True | |
697 |
|
706 | |||
698 | if not self.isConfig: |
|
707 | if not self.isConfig: | |
699 | self.setup(dataOut.data, m, 1) |
|
708 | self.setup(dataOut.data, m, 1) | |
700 | self.isConfig = True |
|
709 | self.isConfig = True | |
701 |
|
710 | |||
702 | if dataOut.flagDataAsBlock: |
|
711 | if dataOut.flagDataAsBlock: | |
703 |
|
712 | |||
704 | raise ValueError, "ProfileConcat can only be used when voltage have been read profile by profile, getBlock = False" |
|
713 | raise ValueError, "ProfileConcat can only be used when voltage have been read profile by profile, getBlock = False" | |
705 |
|
714 | |||
706 | else: |
|
715 | else: | |
707 | self.concat(dataOut.data) |
|
716 | self.concat(dataOut.data) | |
708 | self.times += 1 |
|
717 | self.times += 1 | |
709 | if self.times > m: |
|
718 | if self.times > m: | |
710 | dataOut.data = self.buffer |
|
719 | dataOut.data = self.buffer | |
711 | self.reset() |
|
720 | self.reset() | |
712 | dataOut.flagNoData = False |
|
721 | dataOut.flagNoData = False | |
713 | # se deben actualizar mas propiedades del header y del objeto dataOut, por ejemplo, las alturas |
|
722 | # se deben actualizar mas propiedades del header y del objeto dataOut, por ejemplo, las alturas | |
714 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
723 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] | |
715 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * m |
|
724 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * m | |
716 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
725 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) | |
717 | dataOut.ippSeconds *= m |
|
726 | dataOut.ippSeconds *= m | |
718 |
|
727 | |||
719 | class ProfileSelector(Operation): |
|
728 | class ProfileSelector(Operation): | |
720 |
|
729 | |||
721 | profileIndex = None |
|
730 | profileIndex = None | |
722 | # Tamanho total de los perfiles |
|
731 | # Tamanho total de los perfiles | |
723 | nProfiles = None |
|
732 | nProfiles = None | |
724 |
|
733 | |||
725 | def __init__(self): |
|
734 | def __init__(self): | |
726 |
|
735 | |||
727 | Operation.__init__(self) |
|
736 | Operation.__init__(self) | |
728 | self.profileIndex = 0 |
|
737 | self.profileIndex = 0 | |
729 |
|
738 | |||
730 | def incIndex(self): |
|
739 | def incIndex(self): | |
731 |
|
740 | |||
732 | self.profileIndex += 1 |
|
741 | self.profileIndex += 1 | |
733 |
|
742 | |||
734 | if self.profileIndex >= self.nProfiles: |
|
743 | if self.profileIndex >= self.nProfiles: | |
735 | self.profileIndex = 0 |
|
744 | self.profileIndex = 0 | |
736 |
|
745 | |||
737 | def isThisProfileInRange(self, profileIndex, minIndex, maxIndex): |
|
746 | def isThisProfileInRange(self, profileIndex, minIndex, maxIndex): | |
738 |
|
747 | |||
739 | if profileIndex < minIndex: |
|
748 | if profileIndex < minIndex: | |
740 | return False |
|
749 | return False | |
741 |
|
750 | |||
742 | if profileIndex > maxIndex: |
|
751 | if profileIndex > maxIndex: | |
743 | return False |
|
752 | return False | |
744 |
|
753 | |||
745 | return True |
|
754 | return True | |
746 |
|
755 | |||
747 | def isThisProfileInList(self, profileIndex, profileList): |
|
756 | def isThisProfileInList(self, profileIndex, profileList): | |
748 |
|
757 | |||
749 | if profileIndex not in profileList: |
|
758 | if profileIndex not in profileList: | |
750 | return False |
|
759 | return False | |
751 |
|
760 | |||
752 | return True |
|
761 | return True | |
753 |
|
762 | |||
754 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None): |
|
763 | def run(self, dataOut, profileList=None, profileRangeList=None, beam=None, byblock=False, rangeList = None): | |
755 |
|
764 | |||
756 | """ |
|
765 | """ | |
757 | ProfileSelector: |
|
766 | ProfileSelector: | |
758 |
|
767 | |||
759 | Inputs: |
|
768 | Inputs: | |
760 | profileList : Index of profiles selected. Example: profileList = (0,1,2,7,8) |
|
769 | profileList : Index of profiles selected. Example: profileList = (0,1,2,7,8) | |
761 |
|
770 | |||
762 | profileRangeList : Minimum and maximum profile indexes. Example: profileRangeList = (4, 30) |
|
771 | profileRangeList : Minimum and maximum profile indexes. Example: profileRangeList = (4, 30) | |
763 |
|
772 | |||
764 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) |
|
773 | rangeList : List of profile ranges. Example: rangeList = ((4, 30), (32, 64), (128, 256)) | |
765 |
|
774 | |||
766 | """ |
|
775 | """ | |
767 |
|
776 | |||
768 | dataOut.flagNoData = True |
|
777 | dataOut.flagNoData = True | |
769 | self.nProfiles = dataOut.nProfiles |
|
778 | self.nProfiles = dataOut.nProfiles | |
770 |
|
779 | |||
771 | if dataOut.flagDataAsBlock: |
|
780 | if dataOut.flagDataAsBlock: | |
772 | """ |
|
781 | """ | |
773 | data dimension = [nChannels, nProfiles, nHeis] |
|
782 | data dimension = [nChannels, nProfiles, nHeis] | |
774 | """ |
|
783 | """ | |
775 | if profileList != None: |
|
784 | if profileList != None: | |
776 | dataOut.data = dataOut.data[:,profileList,:] |
|
785 | dataOut.data = dataOut.data[:,profileList,:] | |
777 | dataOut.nProfiles = len(profileList) |
|
786 | dataOut.nProfiles = len(profileList) | |
778 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
787 | dataOut.profileIndex = dataOut.nProfiles - 1 | |
779 | else: |
|
788 | else: | |
780 | minIndex = profileRangeList[0] |
|
789 | minIndex = profileRangeList[0] | |
781 | maxIndex = profileRangeList[1] |
|
790 | maxIndex = profileRangeList[1] | |
782 |
|
791 | |||
783 | dataOut.data = dataOut.data[:,minIndex:maxIndex+1,:] |
|
792 | dataOut.data = dataOut.data[:,minIndex:maxIndex+1,:] | |
784 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
793 | dataOut.nProfiles = maxIndex - minIndex + 1 | |
785 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
794 | dataOut.profileIndex = dataOut.nProfiles - 1 | |
786 |
|
795 | |||
787 | dataOut.flagNoData = False |
|
796 | dataOut.flagNoData = False | |
788 |
|
797 | |||
789 | return True |
|
798 | return True | |
790 |
|
799 | |||
791 | else: |
|
800 | else: | |
792 | """ |
|
801 | """ | |
793 | data dimension = [nChannels, nHeis] |
|
802 | data dimension = [nChannels, nHeis] | |
794 |
|
803 | |||
795 | """ |
|
804 | """ | |
796 | if profileList != None: |
|
805 | if profileList != None: | |
797 |
|
806 | |||
798 | dataOut.nProfiles = len(profileList) |
|
807 | dataOut.nProfiles = len(profileList) | |
799 |
|
808 | |||
800 | if self.isThisProfileInList(dataOut.profileIndex, profileList): |
|
809 | if self.isThisProfileInList(dataOut.profileIndex, profileList): | |
801 | dataOut.flagNoData = False |
|
810 | dataOut.flagNoData = False | |
802 | dataOut.profileIndex = self.profileIndex |
|
811 | dataOut.profileIndex = self.profileIndex | |
803 |
|
812 | |||
804 | self.incIndex() |
|
813 | self.incIndex() | |
805 | return True |
|
814 | return True | |
806 |
|
815 | |||
807 |
|
816 | |||
808 | if profileRangeList != None: |
|
817 | if profileRangeList != None: | |
809 |
|
818 | |||
810 | minIndex = profileRangeList[0] |
|
819 | minIndex = profileRangeList[0] | |
811 | maxIndex = profileRangeList[1] |
|
820 | maxIndex = profileRangeList[1] | |
812 |
|
821 | |||
813 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
822 | dataOut.nProfiles = maxIndex - minIndex + 1 | |
814 |
|
823 | |||
815 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
824 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): | |
816 | dataOut.flagNoData = False |
|
825 | dataOut.flagNoData = False | |
817 | dataOut.profileIndex = self.profileIndex |
|
826 | dataOut.profileIndex = self.profileIndex | |
818 |
|
827 | |||
819 | self.incIndex() |
|
828 | self.incIndex() | |
820 | return True |
|
829 | return True | |
821 |
|
830 | |||
822 | if rangeList != None: |
|
831 | if rangeList != None: | |
823 |
|
832 | |||
824 | nProfiles = 0 |
|
833 | nProfiles = 0 | |
825 |
|
834 | |||
826 | for thisRange in rangeList: |
|
835 | for thisRange in rangeList: | |
827 | minIndex = thisRange[0] |
|
836 | minIndex = thisRange[0] | |
828 | maxIndex = thisRange[1] |
|
837 | maxIndex = thisRange[1] | |
829 |
|
838 | |||
830 | nProfiles += maxIndex - minIndex + 1 |
|
839 | nProfiles += maxIndex - minIndex + 1 | |
831 |
|
840 | |||
832 | dataOut.nProfiles = nProfiles |
|
841 | dataOut.nProfiles = nProfiles | |
833 |
|
842 | |||
834 | for thisRange in rangeList: |
|
843 | for thisRange in rangeList: | |
835 |
|
844 | |||
836 | minIndex = thisRange[0] |
|
845 | minIndex = thisRange[0] | |
837 | maxIndex = thisRange[1] |
|
846 | maxIndex = thisRange[1] | |
838 |
|
847 | |||
839 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): |
|
848 | if self.isThisProfileInRange(dataOut.profileIndex, minIndex, maxIndex): | |
840 |
|
849 | |||
841 | # print "profileIndex = ", dataOut.profileIndex |
|
850 | # print "profileIndex = ", dataOut.profileIndex | |
842 |
|
851 | |||
843 | dataOut.flagNoData = False |
|
852 | dataOut.flagNoData = False | |
844 | dataOut.profileIndex = self.profileIndex |
|
853 | dataOut.profileIndex = self.profileIndex | |
845 |
|
854 | |||
846 | self.incIndex() |
|
855 | self.incIndex() | |
847 | break |
|
856 | break | |
848 | return True |
|
857 | return True | |
849 |
|
858 | |||
850 |
|
859 | |||
851 | if beam != None: #beam is only for AMISR data |
|
860 | if beam != None: #beam is only for AMISR data | |
852 | if self.isThisProfileInList(dataOut.profileIndex, dataOut.beamRangeDict[beam]): |
|
861 | if self.isThisProfileInList(dataOut.profileIndex, dataOut.beamRangeDict[beam]): | |
853 | dataOut.flagNoData = False |
|
862 | dataOut.flagNoData = False | |
854 | dataOut.profileIndex = self.profileIndex |
|
863 | dataOut.profileIndex = self.profileIndex | |
855 |
|
864 | |||
856 | self.incIndex() |
|
865 | self.incIndex() | |
857 | return 1 |
|
866 | return 1 | |
858 |
|
867 | |||
859 | raise ValueError, "ProfileSelector needs profileList or profileRangeList" |
|
868 | raise ValueError, "ProfileSelector needs profileList or profileRangeList" | |
860 |
|
869 | |||
861 | return 0 |
|
870 | return 0 | |
862 |
|
871 | |||
863 |
|
872 | |||
864 |
|
873 | |||
865 | class Reshaper(Operation): |
|
874 | class Reshaper(Operation): | |
866 |
|
875 | |||
867 | def __init__(self): |
|
876 | def __init__(self): | |
868 |
|
877 | |||
869 | Operation.__init__(self) |
|
878 | Operation.__init__(self) | |
870 | self.updateNewHeights = True |
|
879 | self.updateNewHeights = True | |
871 |
|
880 | |||
872 | def run(self, dataOut, shape): |
|
881 | def run(self, dataOut, shape): | |
873 |
|
882 | |||
874 | if not dataOut.flagDataAsBlock: |
|
883 | if not dataOut.flagDataAsBlock: | |
875 | raise ValueError, "Reshaper can only be used when voltage have been read as Block, getBlock = True" |
|
884 | raise ValueError, "Reshaper can only be used when voltage have been read as Block, getBlock = True" | |
876 |
|
885 | |||
877 | if len(shape) != 3: |
|
886 | if len(shape) != 3: | |
878 | raise ValueError, "shape len should be equal to 3, (nChannels, nProfiles, nHeis)" |
|
887 | raise ValueError, "shape len should be equal to 3, (nChannels, nProfiles, nHeis)" | |
879 |
|
888 | |||
880 | shape_tuple = tuple(shape) |
|
889 | shape_tuple = tuple(shape) | |
881 | dataOut.data = numpy.reshape(dataOut.data, shape_tuple) |
|
890 | dataOut.data = numpy.reshape(dataOut.data, shape_tuple) | |
882 | dataOut.flagNoData = False |
|
891 | dataOut.flagNoData = False | |
883 |
|
892 | |||
884 | if self.updateNewHeights: |
|
893 | if self.updateNewHeights: | |
885 |
|
894 | |||
886 | old_nheights = dataOut.nHeights |
|
895 | old_nheights = dataOut.nHeights | |
887 | new_nheights = dataOut.data.shape[2] |
|
896 | new_nheights = dataOut.data.shape[2] | |
888 | factor = 1.0*new_nheights / old_nheights |
|
897 | factor = 1.0*new_nheights / old_nheights | |
889 |
|
898 | |||
890 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
899 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] | |
891 |
|
900 | |||
892 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor |
|
901 | xf = dataOut.heightList[0] + dataOut.nHeights * deltaHeight * factor | |
893 |
|
902 | |||
894 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) |
|
903 | dataOut.heightList = numpy.arange(dataOut.heightList[0], xf, deltaHeight) | |
895 |
|
904 | |||
896 | dataOut.nProfiles = dataOut.data.shape[1] |
|
905 | dataOut.nProfiles = dataOut.data.shape[1] | |
897 |
|
906 | |||
898 | dataOut.ippSeconds *= factor |
|
907 | dataOut.ippSeconds *= factor | |
899 |
|
908 | |||
900 | import collections |
|
909 | import collections | |
901 | from scipy.stats import mode |
|
910 | from scipy.stats import mode | |
902 |
|
911 | |||
903 | class Synchronize(Operation): |
|
912 | class Synchronize(Operation): | |
904 |
|
913 | |||
905 | isConfig = False |
|
914 | isConfig = False | |
906 | __profIndex = 0 |
|
915 | __profIndex = 0 | |
907 |
|
916 | |||
908 | def __init__(self): |
|
917 | def __init__(self): | |
909 |
|
918 | |||
910 | Operation.__init__(self) |
|
919 | Operation.__init__(self) | |
911 | # self.isConfig = False |
|
920 | # self.isConfig = False | |
912 | self.__powBuffer = None |
|
921 | self.__powBuffer = None | |
913 | self.__startIndex = 0 |
|
922 | self.__startIndex = 0 | |
914 | self.__pulseFound = False |
|
923 | self.__pulseFound = False | |
915 |
|
924 | |||
916 | def __findTxPulse(self, dataOut, channel=0, pulse_with = None): |
|
925 | def __findTxPulse(self, dataOut, channel=0, pulse_with = None): | |
917 |
|
926 | |||
918 | #Read data |
|
927 | #Read data | |
919 |
|
928 | |||
920 | powerdB = dataOut.getPower(channel = channel) |
|
929 | powerdB = dataOut.getPower(channel = channel) | |
921 | noisedB = dataOut.getNoise(channel = channel)[0] |
|
930 | noisedB = dataOut.getNoise(channel = channel)[0] | |
922 |
|
931 | |||
923 | self.__powBuffer.extend(powerdB.flatten()) |
|
932 | self.__powBuffer.extend(powerdB.flatten()) | |
924 |
|
933 | |||
925 | dataArray = numpy.array(self.__powBuffer) |
|
934 | dataArray = numpy.array(self.__powBuffer) | |
926 |
|
935 | |||
927 | filteredPower = numpy.correlate(dataArray, dataArray[0:self.__nSamples], "same") |
|
936 | filteredPower = numpy.correlate(dataArray, dataArray[0:self.__nSamples], "same") | |
928 |
|
937 | |||
929 | maxValue = numpy.nanmax(filteredPower) |
|
938 | maxValue = numpy.nanmax(filteredPower) | |
930 |
|
939 | |||
931 | if maxValue < noisedB + 10: |
|
940 | if maxValue < noisedB + 10: | |
932 | #No se encuentra ningun pulso de transmision |
|
941 | #No se encuentra ningun pulso de transmision | |
933 | return None |
|
942 | return None | |
934 |
|
943 | |||
935 | maxValuesIndex = numpy.where(filteredPower > maxValue - 0.1*abs(maxValue))[0] |
|
944 | maxValuesIndex = numpy.where(filteredPower > maxValue - 0.1*abs(maxValue))[0] | |
936 |
|
945 | |||
937 | if len(maxValuesIndex) < 2: |
|
946 | if len(maxValuesIndex) < 2: | |
938 | #Solo se encontro un solo pulso de transmision de un baudio, esperando por el siguiente TX |
|
947 | #Solo se encontro un solo pulso de transmision de un baudio, esperando por el siguiente TX | |
939 | return None |
|
948 | return None | |
940 |
|
949 | |||
941 | phasedMaxValuesIndex = maxValuesIndex - self.__nSamples |
|
950 | phasedMaxValuesIndex = maxValuesIndex - self.__nSamples | |
942 |
|
951 | |||
943 | #Seleccionar solo valores con un espaciamiento de nSamples |
|
952 | #Seleccionar solo valores con un espaciamiento de nSamples | |
944 | pulseIndex = numpy.intersect1d(maxValuesIndex, phasedMaxValuesIndex) |
|
953 | pulseIndex = numpy.intersect1d(maxValuesIndex, phasedMaxValuesIndex) | |
945 |
|
954 | |||
946 | if len(pulseIndex) < 2: |
|
955 | if len(pulseIndex) < 2: | |
947 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
956 | #Solo se encontro un pulso de transmision con ancho mayor a 1 | |
948 | return None |
|
957 | return None | |
949 |
|
958 | |||
950 | spacing = pulseIndex[1:] - pulseIndex[:-1] |
|
959 | spacing = pulseIndex[1:] - pulseIndex[:-1] | |
951 |
|
960 | |||
952 | #remover senales que se distancien menos de 10 unidades o muestras |
|
961 | #remover senales que se distancien menos de 10 unidades o muestras | |
953 | #(No deberian existir IPP menor a 10 unidades) |
|
962 | #(No deberian existir IPP menor a 10 unidades) | |
954 |
|
963 | |||
955 | realIndex = numpy.where(spacing > 10 )[0] |
|
964 | realIndex = numpy.where(spacing > 10 )[0] | |
956 |
|
965 | |||
957 | if len(realIndex) < 2: |
|
966 | if len(realIndex) < 2: | |
958 | #Solo se encontro un pulso de transmision con ancho mayor a 1 |
|
967 | #Solo se encontro un pulso de transmision con ancho mayor a 1 | |
959 | return None |
|
968 | return None | |
960 |
|
969 | |||
961 | #Eliminar pulsos anchos (deja solo la diferencia entre IPPs) |
|
970 | #Eliminar pulsos anchos (deja solo la diferencia entre IPPs) | |
962 | realPulseIndex = pulseIndex[realIndex] |
|
971 | realPulseIndex = pulseIndex[realIndex] | |
963 |
|
972 | |||
964 | period = mode(realPulseIndex[1:] - realPulseIndex[:-1])[0][0] |
|
973 | period = mode(realPulseIndex[1:] - realPulseIndex[:-1])[0][0] | |
965 |
|
974 | |||
966 | print "IPP = %d samples" %period |
|
975 | print "IPP = %d samples" %period | |
967 |
|
976 | |||
968 | self.__newNSamples = dataOut.nHeights #int(period) |
|
977 | self.__newNSamples = dataOut.nHeights #int(period) | |
969 | self.__startIndex = int(realPulseIndex[0]) |
|
978 | self.__startIndex = int(realPulseIndex[0]) | |
970 |
|
979 | |||
971 | return 1 |
|
980 | return 1 | |
972 |
|
981 | |||
973 |
|
982 | |||
974 | def setup(self, nSamples, nChannels, buffer_size = 4): |
|
983 | def setup(self, nSamples, nChannels, buffer_size = 4): | |
975 |
|
984 | |||
976 | self.__powBuffer = collections.deque(numpy.zeros( buffer_size*nSamples,dtype=numpy.float), |
|
985 | self.__powBuffer = collections.deque(numpy.zeros( buffer_size*nSamples,dtype=numpy.float), | |
977 | maxlen = buffer_size*nSamples) |
|
986 | maxlen = buffer_size*nSamples) | |
978 |
|
987 | |||
979 | bufferList = [] |
|
988 | bufferList = [] | |
980 |
|
989 | |||
981 | for i in range(nChannels): |
|
990 | for i in range(nChannels): | |
982 | bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, |
|
991 | bufferByChannel = collections.deque(numpy.zeros( buffer_size*nSamples, dtype=numpy.complex) + numpy.NAN, | |
983 | maxlen = buffer_size*nSamples) |
|
992 | maxlen = buffer_size*nSamples) | |
984 |
|
993 | |||
985 | bufferList.append(bufferByChannel) |
|
994 | bufferList.append(bufferByChannel) | |
986 |
|
995 | |||
987 | self.__nSamples = nSamples |
|
996 | self.__nSamples = nSamples | |
988 | self.__nChannels = nChannels |
|
997 | self.__nChannels = nChannels | |
989 | self.__bufferList = bufferList |
|
998 | self.__bufferList = bufferList | |
990 |
|
999 | |||
991 | def run(self, dataOut, channel = 0): |
|
1000 | def run(self, dataOut, channel = 0): | |
992 |
|
1001 | |||
993 | if not self.isConfig: |
|
1002 | if not self.isConfig: | |
994 | nSamples = dataOut.nHeights |
|
1003 | nSamples = dataOut.nHeights | |
995 | nChannels = dataOut.nChannels |
|
1004 | nChannels = dataOut.nChannels | |
996 | self.setup(nSamples, nChannels) |
|
1005 | self.setup(nSamples, nChannels) | |
997 | self.isConfig = True |
|
1006 | self.isConfig = True | |
998 |
|
1007 | |||
999 | #Append new data to internal buffer |
|
1008 | #Append new data to internal buffer | |
1000 | for thisChannel in range(self.__nChannels): |
|
1009 | for thisChannel in range(self.__nChannels): | |
1001 | bufferByChannel = self.__bufferList[thisChannel] |
|
1010 | bufferByChannel = self.__bufferList[thisChannel] | |
1002 | bufferByChannel.extend(dataOut.data[thisChannel]) |
|
1011 | bufferByChannel.extend(dataOut.data[thisChannel]) | |
1003 |
|
1012 | |||
1004 | if self.__pulseFound: |
|
1013 | if self.__pulseFound: | |
1005 | self.__startIndex -= self.__nSamples |
|
1014 | self.__startIndex -= self.__nSamples | |
1006 |
|
1015 | |||
1007 | #Finding Tx Pulse |
|
1016 | #Finding Tx Pulse | |
1008 | if not self.__pulseFound: |
|
1017 | if not self.__pulseFound: | |
1009 | indexFound = self.__findTxPulse(dataOut, channel) |
|
1018 | indexFound = self.__findTxPulse(dataOut, channel) | |
1010 |
|
1019 | |||
1011 | if indexFound == None: |
|
1020 | if indexFound == None: | |
1012 | dataOut.flagNoData = True |
|
1021 | dataOut.flagNoData = True | |
1013 | return |
|
1022 | return | |
1014 |
|
1023 | |||
1015 | self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) |
|
1024 | self.__arrayBuffer = numpy.zeros((self.__nChannels, self.__newNSamples), dtype = numpy.complex) | |
1016 | self.__pulseFound = True |
|
1025 | self.__pulseFound = True | |
1017 | self.__startIndex = indexFound |
|
1026 | self.__startIndex = indexFound | |
1018 |
|
1027 | |||
1019 | #If pulse was found ... |
|
1028 | #If pulse was found ... | |
1020 | for thisChannel in range(self.__nChannels): |
|
1029 | for thisChannel in range(self.__nChannels): | |
1021 | bufferByChannel = self.__bufferList[thisChannel] |
|
1030 | bufferByChannel = self.__bufferList[thisChannel] | |
1022 | #print self.__startIndex |
|
1031 | #print self.__startIndex | |
1023 | x = numpy.array(bufferByChannel) |
|
1032 | x = numpy.array(bufferByChannel) | |
1024 | self.__arrayBuffer[thisChannel] = x[self.__startIndex:self.__startIndex+self.__newNSamples] |
|
1033 | self.__arrayBuffer[thisChannel] = x[self.__startIndex:self.__startIndex+self.__newNSamples] | |
1025 |
|
1034 | |||
1026 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] |
|
1035 | deltaHeight = dataOut.heightList[1] - dataOut.heightList[0] | |
1027 | dataOut.heightList = numpy.arange(self.__newNSamples)*deltaHeight |
|
1036 | dataOut.heightList = numpy.arange(self.__newNSamples)*deltaHeight | |
1028 | # dataOut.ippSeconds = (self.__newNSamples / deltaHeight)/1e6 |
|
1037 | # dataOut.ippSeconds = (self.__newNSamples / deltaHeight)/1e6 | |
1029 |
|
1038 | |||
1030 | dataOut.data = self.__arrayBuffer |
|
1039 | dataOut.data = self.__arrayBuffer | |
1031 |
|
1040 | |||
1032 | self.__startIndex += self.__newNSamples |
|
1041 | self.__startIndex += self.__newNSamples | |
1033 |
|
1042 | |||
1034 | return No newline at end of file |
|
1043 | return |
General Comments 0
You need to be logged in to leave comments.
Login now