@@ -1,1145 +1,1150 | |||||
1 | ''' |
|
1 | ''' | |
2 | Created on September , 2012 |
|
2 | Created on September , 2012 | |
3 | @author: |
|
3 | @author: | |
4 | ''' |
|
4 | ''' | |
5 | from xml.etree.ElementTree import ElementTree, Element, SubElement, tostring |
|
5 | from xml.etree.ElementTree import ElementTree, Element, SubElement, tostring | |
6 | from xml.dom import minidom |
|
6 | from xml.dom import minidom | |
7 |
|
7 | |||
8 | from model import * |
|
8 | from model import * | |
9 | from time import sleep |
|
9 | from time import sleep | |
10 |
|
10 | |||
11 | import sys |
|
11 | import sys | |
12 | import ast |
|
12 | import ast | |
13 | import traceback |
|
13 | import traceback | |
14 |
|
14 | |||
15 | SCHAIN_MAIL = "miguel.urco@jro.igp.gob.pe" |
|
15 | SCHAIN_MAIL = "miguel.urco@jro.igp.gob.pe" | |
16 | EMAIL_SERVER = "jro.igp.gob.pe" |
|
16 | EMAIL_SERVER = "jro.igp.gob.pe" | |
17 |
|
17 | |||
18 | def prettify(elem): |
|
18 | def prettify(elem): | |
19 | """Return a pretty-printed XML string for the Element. |
|
19 | """Return a pretty-printed XML string for the Element. | |
20 | """ |
|
20 | """ | |
21 | rough_string = tostring(elem, 'utf-8') |
|
21 | rough_string = tostring(elem, 'utf-8') | |
22 | reparsed = minidom.parseString(rough_string) |
|
22 | reparsed = minidom.parseString(rough_string) | |
23 | return reparsed.toprettyxml(indent=" ") |
|
23 | return reparsed.toprettyxml(indent=" ") | |
24 |
|
24 | |||
25 | class ParameterConf(): |
|
25 | class ParameterConf(): | |
26 |
|
26 | |||
27 | id = None |
|
27 | id = None | |
28 | name = None |
|
28 | name = None | |
29 | value = None |
|
29 | value = None | |
30 | format = None |
|
30 | format = None | |
31 |
|
31 | |||
32 | __formated_value = None |
|
32 | __formated_value = None | |
33 |
|
33 | |||
34 | ELEMENTNAME = 'Parameter' |
|
34 | ELEMENTNAME = 'Parameter' | |
35 |
|
35 | |||
36 | def __init__(self): |
|
36 | def __init__(self): | |
37 |
|
37 | |||
38 | self.format = 'str' |
|
38 | self.format = 'str' | |
39 |
|
39 | |||
40 | def getElementName(self): |
|
40 | def getElementName(self): | |
41 |
|
41 | |||
42 | return self.ELEMENTNAME |
|
42 | return self.ELEMENTNAME | |
43 |
|
43 | |||
44 | def getValue(self): |
|
44 | def getValue(self): | |
45 |
|
45 | |||
46 | value = self.value |
|
46 | value = self.value | |
47 | format = self.format |
|
47 | format = self.format | |
48 |
|
48 | |||
49 | if self.__formated_value != None: |
|
49 | if self.__formated_value != None: | |
50 |
|
50 | |||
51 | return self.__formated_value |
|
51 | return self.__formated_value | |
52 |
|
52 | |||
53 | if format == 'str': |
|
53 | if format == 'str': | |
54 | self.__formated_value = str(value) |
|
54 | self.__formated_value = str(value) | |
55 | return self.__formated_value |
|
55 | return self.__formated_value | |
56 |
|
56 | |||
57 | if value == '': |
|
57 | if value == '': | |
58 | raise ValueError, "%s: This parameter value is empty" %self.name |
|
58 | raise ValueError, "%s: This parameter value is empty" %self.name | |
59 |
|
59 | |||
60 | if format == 'list': |
|
60 | if format == 'list': | |
61 | strList = value.split(',') |
|
61 | strList = value.split(',') | |
62 |
|
62 | |||
63 | self.__formated_value = strList |
|
63 | self.__formated_value = strList | |
64 |
|
64 | |||
65 | return self.__formated_value |
|
65 | return self.__formated_value | |
66 |
|
66 | |||
67 | if format == 'intlist': |
|
67 | if format == 'intlist': | |
68 | """ |
|
68 | """ | |
69 | Example: |
|
69 | Example: | |
70 | value = (0,1,2) |
|
70 | value = (0,1,2) | |
71 | """ |
|
71 | """ | |
72 | value = value.replace('(', '') |
|
72 | value = value.replace('(', '') | |
73 | value = value.replace(')', '') |
|
73 | value = value.replace(')', '') | |
74 |
|
74 | |||
75 | value = value.replace('[', '') |
|
75 | value = value.replace('[', '') | |
76 | value = value.replace(']', '') |
|
76 | value = value.replace(']', '') | |
77 |
|
77 | |||
78 | strList = value.split(',') |
|
78 | strList = value.split(',') | |
79 | intList = [int(float(x)) for x in strList] |
|
79 | intList = [int(float(x)) for x in strList] | |
80 |
|
80 | |||
81 | self.__formated_value = intList |
|
81 | self.__formated_value = intList | |
82 |
|
82 | |||
83 | return self.__formated_value |
|
83 | return self.__formated_value | |
84 |
|
84 | |||
85 | if format == 'floatlist': |
|
85 | if format == 'floatlist': | |
86 | """ |
|
86 | """ | |
87 | Example: |
|
87 | Example: | |
88 | value = (0.5, 1.4, 2.7) |
|
88 | value = (0.5, 1.4, 2.7) | |
89 | """ |
|
89 | """ | |
90 |
|
90 | |||
91 | value = value.replace('(', '') |
|
91 | value = value.replace('(', '') | |
92 | value = value.replace(')', '') |
|
92 | value = value.replace(')', '') | |
93 |
|
93 | |||
94 | value = value.replace('[', '') |
|
94 | value = value.replace('[', '') | |
95 | value = value.replace(']', '') |
|
95 | value = value.replace(']', '') | |
96 |
|
96 | |||
97 | strList = value.split(',') |
|
97 | strList = value.split(',') | |
98 | floatList = [float(x) for x in strList] |
|
98 | floatList = [float(x) for x in strList] | |
99 |
|
99 | |||
100 | self.__formated_value = floatList |
|
100 | self.__formated_value = floatList | |
101 |
|
101 | |||
102 | return self.__formated_value |
|
102 | return self.__formated_value | |
103 |
|
103 | |||
104 | if format == 'date': |
|
104 | if format == 'date': | |
105 | strList = value.split('/') |
|
105 | strList = value.split('/') | |
106 | intList = [int(x) for x in strList] |
|
106 | intList = [int(x) for x in strList] | |
107 | date = datetime.date(intList[0], intList[1], intList[2]) |
|
107 | date = datetime.date(intList[0], intList[1], intList[2]) | |
108 |
|
108 | |||
109 | self.__formated_value = date |
|
109 | self.__formated_value = date | |
110 |
|
110 | |||
111 | return self.__formated_value |
|
111 | return self.__formated_value | |
112 |
|
112 | |||
113 | if format == 'time': |
|
113 | if format == 'time': | |
114 | strList = value.split(':') |
|
114 | strList = value.split(':') | |
115 | intList = [int(x) for x in strList] |
|
115 | intList = [int(x) for x in strList] | |
116 | time = datetime.time(intList[0], intList[1], intList[2]) |
|
116 | time = datetime.time(intList[0], intList[1], intList[2]) | |
117 |
|
117 | |||
118 | self.__formated_value = time |
|
118 | self.__formated_value = time | |
119 |
|
119 | |||
120 | return self.__formated_value |
|
120 | return self.__formated_value | |
121 |
|
121 | |||
122 | if format == 'pairslist': |
|
122 | if format == 'pairslist': | |
123 | """ |
|
123 | """ | |
124 | Example: |
|
124 | Example: | |
125 | value = (0,1),(1,2) |
|
125 | value = (0,1),(1,2) | |
126 | """ |
|
126 | """ | |
127 |
|
127 | |||
128 | value = value.replace('(', '') |
|
128 | value = value.replace('(', '') | |
129 | value = value.replace(')', '') |
|
129 | value = value.replace(')', '') | |
130 |
|
130 | |||
131 | value = value.replace('[', '') |
|
131 | value = value.replace('[', '') | |
132 | value = value.replace(']', '') |
|
132 | value = value.replace(']', '') | |
133 |
|
133 | |||
134 | strList = value.split(',') |
|
134 | strList = value.split(',') | |
135 | intList = [int(item) for item in strList] |
|
135 | intList = [int(item) for item in strList] | |
136 | pairList = [] |
|
136 | pairList = [] | |
137 | for i in range(len(intList)/2): |
|
137 | for i in range(len(intList)/2): | |
138 | pairList.append((intList[i*2], intList[i*2 + 1])) |
|
138 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
139 |
|
139 | |||
140 | self.__formated_value = pairList |
|
140 | self.__formated_value = pairList | |
141 |
|
141 | |||
142 | return self.__formated_value |
|
142 | return self.__formated_value | |
143 |
|
143 | |||
144 | if format == 'multilist': |
|
144 | if format == 'multilist': | |
145 | """ |
|
145 | """ | |
146 | Example: |
|
146 | Example: | |
147 | value = (0,1,2),(3,4,5) |
|
147 | value = (0,1,2),(3,4,5) | |
148 | """ |
|
148 | """ | |
149 | multiList = ast.literal_eval(value) |
|
149 | multiList = ast.literal_eval(value) | |
150 |
|
150 | |||
151 | if type(multiList[0]) == int: |
|
151 | if type(multiList[0]) == int: | |
152 | multiList = ast.literal_eval("(" + value + ")") |
|
152 | multiList = ast.literal_eval("(" + value + ")") | |
153 |
|
153 | |||
154 | self.__formated_value = multiList |
|
154 | self.__formated_value = multiList | |
155 |
|
155 | |||
156 | return self.__formated_value |
|
156 | return self.__formated_value | |
157 |
|
157 | |||
158 | if format == 'bool': |
|
158 | if format == 'bool': | |
159 | value = int(value) |
|
159 | value = int(value) | |
160 |
|
160 | |||
161 | if format == 'int': |
|
161 | if format == 'int': | |
162 | value = float(value) |
|
162 | value = float(value) | |
163 |
|
163 | |||
164 | format_func = eval(format) |
|
164 | format_func = eval(format) | |
165 |
|
165 | |||
166 | self.__formated_value = format_func(value) |
|
166 | self.__formated_value = format_func(value) | |
167 |
|
167 | |||
168 | return self.__formated_value |
|
168 | return self.__formated_value | |
169 |
|
169 | |||
170 | def updateId(self, new_id): |
|
170 | def updateId(self, new_id): | |
171 |
|
171 | |||
172 | self.id = str(new_id) |
|
172 | self.id = str(new_id) | |
173 |
|
173 | |||
174 | def setup(self, id, name, value, format='str'): |
|
174 | def setup(self, id, name, value, format='str'): | |
175 |
|
175 | |||
176 | self.id = str(id) |
|
176 | self.id = str(id) | |
177 | self.name = name |
|
177 | self.name = name | |
178 | self.value = str(value) |
|
178 | self.value = str(value) | |
179 | self.format = str.lower(format) |
|
179 | self.format = str.lower(format) | |
180 |
|
180 | |||
181 | try: |
|
181 | try: | |
182 | self.getValue() |
|
182 | self.getValue() | |
183 | except: |
|
183 | except: | |
184 | return 0 |
|
184 | return 0 | |
185 |
|
185 | |||
186 | return 1 |
|
186 | return 1 | |
187 |
|
187 | |||
188 | def update(self, name, value, format='str'): |
|
188 | def update(self, name, value, format='str'): | |
189 |
|
189 | |||
190 | self.name = name |
|
190 | self.name = name | |
191 | self.value = str(value) |
|
191 | self.value = str(value) | |
192 | self.format = format |
|
192 | self.format = format | |
193 |
|
193 | |||
194 | def makeXml(self, opElement): |
|
194 | def makeXml(self, opElement): | |
195 |
|
195 | |||
196 | parmElement = SubElement(opElement, self.ELEMENTNAME) |
|
196 | parmElement = SubElement(opElement, self.ELEMENTNAME) | |
197 | parmElement.set('id', str(self.id)) |
|
197 | parmElement.set('id', str(self.id)) | |
198 | parmElement.set('name', self.name) |
|
198 | parmElement.set('name', self.name) | |
199 | parmElement.set('value', self.value) |
|
199 | parmElement.set('value', self.value) | |
200 | parmElement.set('format', self.format) |
|
200 | parmElement.set('format', self.format) | |
201 |
|
201 | |||
202 | def readXml(self, parmElement): |
|
202 | def readXml(self, parmElement): | |
203 |
|
203 | |||
204 | self.id = parmElement.get('id') |
|
204 | self.id = parmElement.get('id') | |
205 | self.name = parmElement.get('name') |
|
205 | self.name = parmElement.get('name') | |
206 | self.value = parmElement.get('value') |
|
206 | self.value = parmElement.get('value') | |
207 | self.format = str.lower(parmElement.get('format')) |
|
207 | self.format = str.lower(parmElement.get('format')) | |
208 |
|
208 | |||
209 | #Compatible with old signal chain version |
|
209 | #Compatible with old signal chain version | |
210 | if self.format == 'int' and self.name == 'idfigure': |
|
210 | if self.format == 'int' and self.name == 'idfigure': | |
211 | self.name = 'id' |
|
211 | self.name = 'id' | |
212 |
|
212 | |||
213 | def printattr(self): |
|
213 | def printattr(self): | |
214 |
|
214 | |||
215 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) |
|
215 | print "Parameter[%s]: name = %s, value = %s, format = %s" %(self.id, self.name, self.value, self.format) | |
216 |
|
216 | |||
217 | class OperationConf(): |
|
217 | class OperationConf(): | |
218 |
|
218 | |||
219 | id = None |
|
219 | id = None | |
220 | name = None |
|
220 | name = None | |
221 | priority = None |
|
221 | priority = None | |
222 | type = None |
|
222 | type = None | |
223 |
|
223 | |||
224 | parmConfObjList = [] |
|
224 | parmConfObjList = [] | |
225 |
|
225 | |||
226 | ELEMENTNAME = 'Operation' |
|
226 | ELEMENTNAME = 'Operation' | |
227 |
|
227 | |||
228 | def __init__(self): |
|
228 | def __init__(self): | |
229 |
|
229 | |||
230 | self.id = '0' |
|
230 | self.id = '0' | |
231 | self.name = None |
|
231 | self.name = None | |
232 | self.priority = None |
|
232 | self.priority = None | |
233 | self.type = 'self' |
|
233 | self.type = 'self' | |
234 |
|
234 | |||
235 |
|
235 | |||
236 | def __getNewId(self): |
|
236 | def __getNewId(self): | |
237 |
|
237 | |||
238 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
238 | return int(self.id)*10 + len(self.parmConfObjList) + 1 | |
239 |
|
239 | |||
240 | def updateId(self, new_id): |
|
240 | def updateId(self, new_id): | |
241 |
|
241 | |||
242 | self.id = str(new_id) |
|
242 | self.id = str(new_id) | |
243 |
|
243 | |||
244 | n = 1 |
|
244 | n = 1 | |
245 | for parmObj in self.parmConfObjList: |
|
245 | for parmObj in self.parmConfObjList: | |
246 |
|
246 | |||
247 | idParm = str(int(new_id)*10 + n) |
|
247 | idParm = str(int(new_id)*10 + n) | |
248 | parmObj.updateId(idParm) |
|
248 | parmObj.updateId(idParm) | |
249 |
|
249 | |||
250 | n += 1 |
|
250 | n += 1 | |
251 |
|
251 | |||
252 | def getElementName(self): |
|
252 | def getElementName(self): | |
253 |
|
253 | |||
254 | return self.ELEMENTNAME |
|
254 | return self.ELEMENTNAME | |
255 |
|
255 | |||
256 | def getParameterObjList(self): |
|
256 | def getParameterObjList(self): | |
257 |
|
257 | |||
258 | return self.parmConfObjList |
|
258 | return self.parmConfObjList | |
259 |
|
259 | |||
260 | def getParameterObj(self, parameterName): |
|
260 | def getParameterObj(self, parameterName): | |
261 |
|
261 | |||
262 | for parmConfObj in self.parmConfObjList: |
|
262 | for parmConfObj in self.parmConfObjList: | |
263 |
|
263 | |||
264 | if parmConfObj.name != parameterName: |
|
264 | if parmConfObj.name != parameterName: | |
265 | continue |
|
265 | continue | |
266 |
|
266 | |||
267 | return parmConfObj |
|
267 | return parmConfObj | |
268 |
|
268 | |||
269 | return None |
|
269 | return None | |
270 |
|
270 | |||
271 | def getParameterObjfromValue(self, parameterValue): |
|
271 | def getParameterObjfromValue(self, parameterValue): | |
272 |
|
272 | |||
273 | for parmConfObj in self.parmConfObjList: |
|
273 | for parmConfObj in self.parmConfObjList: | |
274 |
|
274 | |||
275 | if parmConfObj.getValue() != parameterValue: |
|
275 | if parmConfObj.getValue() != parameterValue: | |
276 | continue |
|
276 | continue | |
277 |
|
277 | |||
278 | return parmConfObj.getValue() |
|
278 | return parmConfObj.getValue() | |
279 |
|
279 | |||
280 | return None |
|
280 | return None | |
281 |
|
281 | |||
282 | def getParameterValue(self, parameterName): |
|
282 | def getParameterValue(self, parameterName): | |
283 |
|
283 | |||
284 | parameterObj = self.getParameterObj(parameterName) |
|
284 | parameterObj = self.getParameterObj(parameterName) | |
285 |
|
285 | |||
286 | # if not parameterObj: |
|
286 | # if not parameterObj: | |
287 | # return None |
|
287 | # return None | |
288 |
|
288 | |||
289 | value = parameterObj.getValue() |
|
289 | value = parameterObj.getValue() | |
290 |
|
290 | |||
291 | return value |
|
291 | return value | |
292 |
|
292 | |||
293 | def setup(self, id, name, priority, type): |
|
293 | def setup(self, id, name, priority, type): | |
294 |
|
294 | |||
295 | self.id = str(id) |
|
295 | self.id = str(id) | |
296 | self.name = name |
|
296 | self.name = name | |
297 | self.type = type |
|
297 | self.type = type | |
298 | self.priority = priority |
|
298 | self.priority = priority | |
299 |
|
299 | |||
300 | self.parmConfObjList = [] |
|
300 | self.parmConfObjList = [] | |
301 |
|
301 | |||
302 | def removeParameters(self): |
|
302 | def removeParameters(self): | |
303 |
|
303 | |||
304 | for obj in self.parmConfObjList: |
|
304 | for obj in self.parmConfObjList: | |
305 | del obj |
|
305 | del obj | |
306 |
|
306 | |||
307 | self.parmConfObjList = [] |
|
307 | self.parmConfObjList = [] | |
308 |
|
308 | |||
309 | def addParameter(self, name, value, format='str'): |
|
309 | def addParameter(self, name, value, format='str'): | |
310 |
|
310 | |||
311 | id = self.__getNewId() |
|
311 | id = self.__getNewId() | |
312 |
|
312 | |||
313 | parmConfObj = ParameterConf() |
|
313 | parmConfObj = ParameterConf() | |
314 | if not parmConfObj.setup(id, name, value, format): |
|
314 | if not parmConfObj.setup(id, name, value, format): | |
315 | return None |
|
315 | return None | |
316 |
|
316 | |||
317 | self.parmConfObjList.append(parmConfObj) |
|
317 | self.parmConfObjList.append(parmConfObj) | |
318 |
|
318 | |||
319 | return parmConfObj |
|
319 | return parmConfObj | |
320 |
|
320 | |||
321 | def changeParameter(self, name, value, format='str'): |
|
321 | def changeParameter(self, name, value, format='str'): | |
322 |
|
322 | |||
323 | parmConfObj = self.getParameterObj(name) |
|
323 | parmConfObj = self.getParameterObj(name) | |
324 | parmConfObj.update(name, value, format) |
|
324 | parmConfObj.update(name, value, format) | |
325 |
|
325 | |||
326 | return parmConfObj |
|
326 | return parmConfObj | |
327 |
|
327 | |||
328 | def makeXml(self, upElement): |
|
328 | def makeXml(self, upElement): | |
329 |
|
329 | |||
330 | opElement = SubElement(upElement, self.ELEMENTNAME) |
|
330 | opElement = SubElement(upElement, self.ELEMENTNAME) | |
331 | opElement.set('id', str(self.id)) |
|
331 | opElement.set('id', str(self.id)) | |
332 | opElement.set('name', self.name) |
|
332 | opElement.set('name', self.name) | |
333 | opElement.set('type', self.type) |
|
333 | opElement.set('type', self.type) | |
334 | opElement.set('priority', str(self.priority)) |
|
334 | opElement.set('priority', str(self.priority)) | |
335 |
|
335 | |||
336 | for parmConfObj in self.parmConfObjList: |
|
336 | for parmConfObj in self.parmConfObjList: | |
337 | parmConfObj.makeXml(opElement) |
|
337 | parmConfObj.makeXml(opElement) | |
338 |
|
338 | |||
339 | def readXml(self, opElement): |
|
339 | def readXml(self, opElement): | |
340 |
|
340 | |||
341 | self.id = opElement.get('id') |
|
341 | self.id = opElement.get('id') | |
342 | self.name = opElement.get('name') |
|
342 | self.name = opElement.get('name') | |
343 | self.type = opElement.get('type') |
|
343 | self.type = opElement.get('type') | |
344 | self.priority = opElement.get('priority') |
|
344 | self.priority = opElement.get('priority') | |
345 |
|
345 | |||
346 | #Compatible with old signal chain version |
|
346 | #Compatible with old signal chain version | |
347 | #Use of 'run' method instead 'init' |
|
347 | #Use of 'run' method instead 'init' | |
348 | if self.type == 'self' and self.name == 'init': |
|
348 | if self.type == 'self' and self.name == 'init': | |
349 | self.name = 'run' |
|
349 | self.name = 'run' | |
350 |
|
350 | |||
351 | self.parmConfObjList = [] |
|
351 | self.parmConfObjList = [] | |
352 |
|
352 | |||
353 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) |
|
353 | parmElementList = opElement.getiterator(ParameterConf().getElementName()) | |
354 |
|
354 | |||
355 | for parmElement in parmElementList: |
|
355 | for parmElement in parmElementList: | |
356 | parmConfObj = ParameterConf() |
|
356 | parmConfObj = ParameterConf() | |
357 | parmConfObj.readXml(parmElement) |
|
357 | parmConfObj.readXml(parmElement) | |
358 |
|
358 | |||
359 | #Compatible with old signal chain version |
|
359 | #Compatible with old signal chain version | |
360 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER |
|
360 | #If an 'plot' OPERATION is found, changes name operation by the value of its type PARAMETER | |
361 | if self.type != 'self' and self.name == 'Plot': |
|
361 | if self.type != 'self' and self.name == 'Plot': | |
362 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': |
|
362 | if parmConfObj.format == 'str' and parmConfObj.name == 'type': | |
363 | self.name = parmConfObj.value |
|
363 | self.name = parmConfObj.value | |
364 | continue |
|
364 | continue | |
365 |
|
365 | |||
366 | self.parmConfObjList.append(parmConfObj) |
|
366 | self.parmConfObjList.append(parmConfObj) | |
367 |
|
367 | |||
368 | def printattr(self): |
|
368 | def printattr(self): | |
369 |
|
369 | |||
370 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, |
|
370 | print "%s[%s]: name = %s, type = %s, priority = %s" %(self.ELEMENTNAME, | |
371 | self.id, |
|
371 | self.id, | |
372 | self.name, |
|
372 | self.name, | |
373 | self.type, |
|
373 | self.type, | |
374 | self.priority) |
|
374 | self.priority) | |
375 |
|
375 | |||
376 | for parmConfObj in self.parmConfObjList: |
|
376 | for parmConfObj in self.parmConfObjList: | |
377 | parmConfObj.printattr() |
|
377 | parmConfObj.printattr() | |
378 |
|
378 | |||
379 | def createObject(self): |
|
379 | def createObject(self): | |
380 |
|
380 | |||
381 | if self.type == 'self': |
|
381 | if self.type == 'self': | |
382 | raise ValueError, "This operation type cannot be created" |
|
382 | raise ValueError, "This operation type cannot be created" | |
383 |
|
383 | |||
384 | if self.type == 'external' or self.type == 'other': |
|
384 | if self.type == 'external' or self.type == 'other': | |
385 | className = eval(self.name) |
|
385 | className = eval(self.name) | |
386 | opObj = className() |
|
386 | opObj = className() | |
387 |
|
387 | |||
388 | return opObj |
|
388 | return opObj | |
389 |
|
389 | |||
390 | class ProcUnitConf(): |
|
390 | class ProcUnitConf(): | |
391 |
|
391 | |||
392 | id = None |
|
392 | id = None | |
393 | name = None |
|
393 | name = None | |
394 | datatype = None |
|
394 | datatype = None | |
395 | inputId = None |
|
395 | inputId = None | |
396 | parentId = None |
|
396 | parentId = None | |
397 |
|
397 | |||
398 | opConfObjList = [] |
|
398 | opConfObjList = [] | |
399 |
|
399 | |||
400 | procUnitObj = None |
|
400 | procUnitObj = None | |
401 | opObjList = [] |
|
401 | opObjList = [] | |
402 |
|
402 | |||
403 | ELEMENTNAME = 'ProcUnit' |
|
403 | ELEMENTNAME = 'ProcUnit' | |
404 |
|
404 | |||
405 | def __init__(self): |
|
405 | def __init__(self): | |
406 |
|
406 | |||
407 | self.id = None |
|
407 | self.id = None | |
408 | self.datatype = None |
|
408 | self.datatype = None | |
409 | self.name = None |
|
409 | self.name = None | |
410 | self.inputId = None |
|
410 | self.inputId = None | |
411 |
|
411 | |||
412 | self.opConfObjList = [] |
|
412 | self.opConfObjList = [] | |
413 |
|
413 | |||
414 | self.procUnitObj = None |
|
414 | self.procUnitObj = None | |
415 | self.opObjDict = {} |
|
415 | self.opObjDict = {} | |
416 |
|
416 | |||
417 | def __getPriority(self): |
|
417 | def __getPriority(self): | |
418 |
|
418 | |||
419 | return len(self.opConfObjList)+1 |
|
419 | return len(self.opConfObjList)+1 | |
420 |
|
420 | |||
421 | def __getNewId(self): |
|
421 | def __getNewId(self): | |
422 |
|
422 | |||
423 | return int(self.id)*10 + len(self.opConfObjList) + 1 |
|
423 | return int(self.id)*10 + len(self.opConfObjList) + 1 | |
424 |
|
424 | |||
425 | def getElementName(self): |
|
425 | def getElementName(self): | |
426 |
|
426 | |||
427 | return self.ELEMENTNAME |
|
427 | return self.ELEMENTNAME | |
428 |
|
428 | |||
429 | def getId(self): |
|
429 | def getId(self): | |
430 |
|
430 | |||
431 | return self.id |
|
431 | return self.id | |
432 |
|
432 | |||
433 | def updateId(self, new_id, parentId=parentId): |
|
433 | def updateId(self, new_id, parentId=parentId): | |
434 |
|
434 | |||
435 |
|
435 | |||
436 | new_id = int(parentId)*10 + (int(self.id) % 10) |
|
436 | new_id = int(parentId)*10 + (int(self.id) % 10) | |
437 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) |
|
437 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) | |
438 |
|
438 | |||
439 | #If this proc unit has not inputs |
|
439 | #If this proc unit has not inputs | |
440 | if self.inputId == '0': |
|
440 | if self.inputId == '0': | |
441 | new_inputId = 0 |
|
441 | new_inputId = 0 | |
442 |
|
442 | |||
443 | n = 1 |
|
443 | n = 1 | |
444 | for opConfObj in self.opConfObjList: |
|
444 | for opConfObj in self.opConfObjList: | |
445 |
|
445 | |||
446 | idOp = str(int(new_id)*10 + n) |
|
446 | idOp = str(int(new_id)*10 + n) | |
447 | opConfObj.updateId(idOp) |
|
447 | opConfObj.updateId(idOp) | |
448 |
|
448 | |||
449 | n += 1 |
|
449 | n += 1 | |
450 |
|
450 | |||
451 | self.parentId = str(parentId) |
|
451 | self.parentId = str(parentId) | |
452 | self.id = str(new_id) |
|
452 | self.id = str(new_id) | |
453 | self.inputId = str(new_inputId) |
|
453 | self.inputId = str(new_inputId) | |
454 |
|
454 | |||
455 |
|
455 | |||
456 | def getInputId(self): |
|
456 | def getInputId(self): | |
457 |
|
457 | |||
458 | return self.inputId |
|
458 | return self.inputId | |
459 |
|
459 | |||
460 | def getOperationObjList(self): |
|
460 | def getOperationObjList(self): | |
461 |
|
461 | |||
462 | return self.opConfObjList |
|
462 | return self.opConfObjList | |
463 |
|
463 | |||
464 | def getOperationObj(self, name=None): |
|
464 | def getOperationObj(self, name=None): | |
465 |
|
465 | |||
466 | for opConfObj in self.opConfObjList: |
|
466 | for opConfObj in self.opConfObjList: | |
467 |
|
467 | |||
468 | if opConfObj.name != name: |
|
468 | if opConfObj.name != name: | |
469 | continue |
|
469 | continue | |
470 |
|
470 | |||
471 | return opConfObj |
|
471 | return opConfObj | |
472 |
|
472 | |||
473 | return None |
|
473 | return None | |
474 |
|
474 | |||
475 | def getOpObjfromParamValue(self, value=None): |
|
475 | def getOpObjfromParamValue(self, value=None): | |
476 |
|
476 | |||
477 | for opConfObj in self.opConfObjList: |
|
477 | for opConfObj in self.opConfObjList: | |
478 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: |
|
478 | if opConfObj.getParameterObjfromValue(parameterValue=value) != value: | |
479 | continue |
|
479 | continue | |
480 | return opConfObj |
|
480 | return opConfObj | |
481 | return None |
|
481 | return None | |
482 |
|
482 | |||
483 | def getProcUnitObj(self): |
|
483 | def getProcUnitObj(self): | |
484 |
|
484 | |||
485 | return self.procUnitObj |
|
485 | return self.procUnitObj | |
486 |
|
486 | |||
487 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
487 | def setup(self, id, name, datatype, inputId, parentId=None): | |
488 |
|
488 | |||
489 | #Compatible with old signal chain version |
|
489 | #Compatible with old signal chain version | |
490 | if datatype==None and name==None: |
|
490 | if datatype==None and name==None: | |
491 | raise ValueError, "datatype or name should be defined" |
|
491 | raise ValueError, "datatype or name should be defined" | |
492 |
|
492 | |||
493 | if name==None: |
|
493 | if name==None: | |
494 | if 'Proc' in datatype: |
|
494 | if 'Proc' in datatype: | |
495 | name = datatype |
|
495 | name = datatype | |
496 | else: |
|
496 | else: | |
497 | name = '%sProc' %(datatype) |
|
497 | name = '%sProc' %(datatype) | |
498 |
|
498 | |||
499 | if datatype==None: |
|
499 | if datatype==None: | |
500 | datatype = name.replace('Proc','') |
|
500 | datatype = name.replace('Proc','') | |
501 |
|
501 | |||
502 | self.id = str(id) |
|
502 | self.id = str(id) | |
503 | self.name = name |
|
503 | self.name = name | |
504 | self.datatype = datatype |
|
504 | self.datatype = datatype | |
505 | self.inputId = inputId |
|
505 | self.inputId = inputId | |
506 | self.parentId = parentId |
|
506 | self.parentId = parentId | |
507 |
|
507 | |||
508 | self.opConfObjList = [] |
|
508 | self.opConfObjList = [] | |
509 |
|
509 | |||
510 | self.addOperation(name='run', optype='self') |
|
510 | self.addOperation(name='run', optype='self') | |
511 |
|
511 | |||
512 | def removeOperations(self): |
|
512 | def removeOperations(self): | |
513 |
|
513 | |||
514 | for obj in self.opConfObjList: |
|
514 | for obj in self.opConfObjList: | |
515 | del obj |
|
515 | del obj | |
516 |
|
516 | |||
517 | self.opConfObjList = [] |
|
517 | self.opConfObjList = [] | |
518 | self.addOperation(name='run') |
|
518 | self.addOperation(name='run') | |
519 |
|
519 | |||
520 | def addParameter(self, **kwargs): |
|
520 | def addParameter(self, **kwargs): | |
521 | ''' |
|
521 | ''' | |
522 | Add parameters to "run" operation |
|
522 | Add parameters to "run" operation | |
523 | ''' |
|
523 | ''' | |
524 | opObj = self.opConfObjList[0] |
|
524 | opObj = self.opConfObjList[0] | |
525 |
|
525 | |||
526 | opObj.addParameter(**kwargs) |
|
526 | opObj.addParameter(**kwargs) | |
527 |
|
527 | |||
528 | return opObj |
|
528 | return opObj | |
529 |
|
529 | |||
530 | def addOperation(self, name, optype='self'): |
|
530 | def addOperation(self, name, optype='self'): | |
531 |
|
531 | |||
532 | id = self.__getNewId() |
|
532 | id = self.__getNewId() | |
533 | priority = self.__getPriority() |
|
533 | priority = self.__getPriority() | |
534 |
|
534 | |||
535 | opConfObj = OperationConf() |
|
535 | opConfObj = OperationConf() | |
536 | opConfObj.setup(id, name=name, priority=priority, type=optype) |
|
536 | opConfObj.setup(id, name=name, priority=priority, type=optype) | |
537 |
|
537 | |||
538 | self.opConfObjList.append(opConfObj) |
|
538 | self.opConfObjList.append(opConfObj) | |
539 |
|
539 | |||
540 | return opConfObj |
|
540 | return opConfObj | |
541 |
|
541 | |||
542 | def makeXml(self, procUnitElement): |
|
542 | def makeXml(self, procUnitElement): | |
543 |
|
543 | |||
544 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) |
|
544 | upElement = SubElement(procUnitElement, self.ELEMENTNAME) | |
545 | upElement.set('id', str(self.id)) |
|
545 | upElement.set('id', str(self.id)) | |
546 | upElement.set('name', self.name) |
|
546 | upElement.set('name', self.name) | |
547 | upElement.set('datatype', self.datatype) |
|
547 | upElement.set('datatype', self.datatype) | |
548 | upElement.set('inputId', str(self.inputId)) |
|
548 | upElement.set('inputId', str(self.inputId)) | |
549 |
|
549 | |||
550 | for opConfObj in self.opConfObjList: |
|
550 | for opConfObj in self.opConfObjList: | |
551 | opConfObj.makeXml(upElement) |
|
551 | opConfObj.makeXml(upElement) | |
552 |
|
552 | |||
553 | def readXml(self, upElement): |
|
553 | def readXml(self, upElement): | |
554 |
|
554 | |||
555 | self.id = upElement.get('id') |
|
555 | self.id = upElement.get('id') | |
556 | self.name = upElement.get('name') |
|
556 | self.name = upElement.get('name') | |
557 | self.datatype = upElement.get('datatype') |
|
557 | self.datatype = upElement.get('datatype') | |
558 | self.inputId = upElement.get('inputId') |
|
558 | self.inputId = upElement.get('inputId') | |
559 |
|
559 | |||
560 | if self.ELEMENTNAME == "ReadUnit": |
|
560 | if self.ELEMENTNAME == "ReadUnit": | |
561 | self.datatype = self.datatype.replace("Reader", "") |
|
561 | self.datatype = self.datatype.replace("Reader", "") | |
562 |
|
562 | |||
563 | if self.ELEMENTNAME == "ProcUnit": |
|
563 | if self.ELEMENTNAME == "ProcUnit": | |
564 | self.datatype = self.datatype.replace("Proc", "") |
|
564 | self.datatype = self.datatype.replace("Proc", "") | |
565 |
|
565 | |||
566 | if self.inputId == 'None': |
|
566 | if self.inputId == 'None': | |
567 | self.inputId = '0' |
|
567 | self.inputId = '0' | |
568 |
|
568 | |||
569 | self.opConfObjList = [] |
|
569 | self.opConfObjList = [] | |
570 |
|
570 | |||
571 | opElementList = upElement.getiterator(OperationConf().getElementName()) |
|
571 | opElementList = upElement.getiterator(OperationConf().getElementName()) | |
572 |
|
572 | |||
573 | for opElement in opElementList: |
|
573 | for opElement in opElementList: | |
574 | opConfObj = OperationConf() |
|
574 | opConfObj = OperationConf() | |
575 | opConfObj.readXml(opElement) |
|
575 | opConfObj.readXml(opElement) | |
576 | self.opConfObjList.append(opConfObj) |
|
576 | self.opConfObjList.append(opConfObj) | |
577 |
|
577 | |||
578 | def printattr(self): |
|
578 | def printattr(self): | |
579 |
|
579 | |||
580 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, |
|
580 | print "%s[%s]: name = %s, datatype = %s, inputId = %s" %(self.ELEMENTNAME, | |
581 | self.id, |
|
581 | self.id, | |
582 | self.name, |
|
582 | self.name, | |
583 | self.datatype, |
|
583 | self.datatype, | |
584 | self.inputId) |
|
584 | self.inputId) | |
585 |
|
585 | |||
586 | for opConfObj in self.opConfObjList: |
|
586 | for opConfObj in self.opConfObjList: | |
587 | opConfObj.printattr() |
|
587 | opConfObj.printattr() | |
588 |
|
588 | |||
589 | def createObjects(self): |
|
589 | def createObjects(self): | |
590 |
|
590 | |||
591 | className = eval(self.name) |
|
591 | className = eval(self.name) | |
592 | procUnitObj = className() |
|
592 | procUnitObj = className() | |
593 |
|
593 | |||
594 | for opConfObj in self.opConfObjList: |
|
594 | for opConfObj in self.opConfObjList: | |
595 |
|
595 | |||
596 | if opConfObj.type == 'self': |
|
596 | if opConfObj.type == 'self': | |
597 | continue |
|
597 | continue | |
598 |
|
598 | |||
599 | opObj = opConfObj.createObject() |
|
599 | opObj = opConfObj.createObject() | |
600 |
|
600 | |||
601 | self.opObjDict[opConfObj.id] = opObj |
|
601 | self.opObjDict[opConfObj.id] = opObj | |
602 | procUnitObj.addOperation(opObj, opConfObj.id) |
|
602 | procUnitObj.addOperation(opObj, opConfObj.id) | |
603 |
|
603 | |||
604 | self.procUnitObj = procUnitObj |
|
604 | self.procUnitObj = procUnitObj | |
605 |
|
605 | |||
606 | return procUnitObj |
|
606 | return procUnitObj | |
607 |
|
607 | |||
608 | def run(self): |
|
608 | def run(self): | |
609 |
|
609 | |||
610 | is_ok = False |
|
610 | is_ok = False | |
611 |
|
611 | |||
612 | for opConfObj in self.opConfObjList: |
|
612 | for opConfObj in self.opConfObjList: | |
613 |
|
613 | |||
614 | kwargs = {} |
|
614 | kwargs = {} | |
615 | for parmConfObj in opConfObj.getParameterObjList(): |
|
615 | for parmConfObj in opConfObj.getParameterObjList(): | |
616 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': |
|
616 | if opConfObj.name == 'run' and parmConfObj.name == 'datatype': | |
617 | continue |
|
617 | continue | |
618 |
|
618 | |||
619 | kwargs[parmConfObj.name] = parmConfObj.getValue() |
|
619 | kwargs[parmConfObj.name] = parmConfObj.getValue() | |
620 |
|
620 | |||
621 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) |
|
621 | #print "\tRunning the '%s' operation with %s" %(opConfObj.name, opConfObj.id) | |
622 | sts = self.procUnitObj.call(opType = opConfObj.type, |
|
622 | sts = self.procUnitObj.call(opType = opConfObj.type, | |
623 | opName = opConfObj.name, |
|
623 | opName = opConfObj.name, | |
624 | opId = opConfObj.id, |
|
624 | opId = opConfObj.id, | |
625 | **kwargs) |
|
625 | **kwargs) | |
626 | is_ok = is_ok or sts |
|
626 | is_ok = is_ok or sts | |
627 |
|
627 | |||
628 | return is_ok |
|
628 | return is_ok | |
629 |
|
629 | |||
630 | def close(self): |
|
630 | def close(self): | |
631 |
|
631 | |||
632 | for opConfObj in self.opConfObjList: |
|
632 | for opConfObj in self.opConfObjList: | |
633 | if opConfObj.type == 'self': |
|
633 | if opConfObj.type == 'self': | |
634 | continue |
|
634 | continue | |
635 |
|
635 | |||
636 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) |
|
636 | opObj = self.procUnitObj.getOperationObj(opConfObj.id) | |
637 | opObj.close() |
|
637 | opObj.close() | |
638 |
|
638 | |||
639 | self.procUnitObj.close() |
|
639 | self.procUnitObj.close() | |
640 |
|
640 | |||
641 | return |
|
641 | return | |
642 |
|
642 | |||
643 | class ReadUnitConf(ProcUnitConf): |
|
643 | class ReadUnitConf(ProcUnitConf): | |
644 |
|
644 | |||
645 | path = None |
|
645 | path = None | |
646 | startDate = None |
|
646 | startDate = None | |
647 | endDate = None |
|
647 | endDate = None | |
648 | startTime = None |
|
648 | startTime = None | |
649 | endTime = None |
|
649 | endTime = None | |
650 |
|
650 | |||
651 | ELEMENTNAME = 'ReadUnit' |
|
651 | ELEMENTNAME = 'ReadUnit' | |
652 |
|
652 | |||
653 | def __init__(self): |
|
653 | def __init__(self): | |
654 |
|
654 | |||
655 | self.id = None |
|
655 | self.id = None | |
656 | self.datatype = None |
|
656 | self.datatype = None | |
657 | self.name = None |
|
657 | self.name = None | |
658 | self.inputId = None |
|
658 | self.inputId = None | |
659 |
|
659 | |||
660 | self.parentId = None |
|
660 | self.parentId = None | |
661 |
|
661 | |||
662 | self.opConfObjList = [] |
|
662 | self.opConfObjList = [] | |
663 | self.opObjList = [] |
|
663 | self.opObjList = [] | |
664 |
|
664 | |||
665 | def getElementName(self): |
|
665 | def getElementName(self): | |
666 |
|
666 | |||
667 | return self.ELEMENTNAME |
|
667 | return self.ELEMENTNAME | |
668 |
|
668 | |||
669 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
669 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): | |
670 |
|
670 | |||
671 | #Compatible with old signal chain version |
|
671 | #Compatible with old signal chain version | |
672 | if datatype==None and name==None: |
|
672 | if datatype==None and name==None: | |
673 | raise ValueError, "datatype or name should be defined" |
|
673 | raise ValueError, "datatype or name should be defined" | |
674 |
|
674 | |||
675 | if name==None: |
|
675 | if name==None: | |
676 | if 'Reader' in datatype: |
|
676 | if 'Reader' in datatype: | |
677 | name = datatype |
|
677 | name = datatype | |
678 | else: |
|
678 | else: | |
679 | name = '%sReader' %(datatype) |
|
679 | name = '%sReader' %(datatype) | |
680 |
|
680 | |||
681 | if datatype==None: |
|
681 | if datatype==None: | |
682 | datatype = name.replace('Reader','') |
|
682 | datatype = name.replace('Reader','') | |
683 |
|
683 | |||
684 | self.id = id |
|
684 | self.id = id | |
685 | self.name = name |
|
685 | self.name = name | |
686 | self.datatype = datatype |
|
686 | self.datatype = datatype | |
687 |
|
687 | |||
688 | self.path = path |
|
688 | self.path = path | |
689 | self.startDate = startDate |
|
689 | self.startDate = startDate | |
690 | self.endDate = endDate |
|
690 | self.endDate = endDate | |
691 | self.startTime = startTime |
|
691 | self.startTime = startTime | |
692 | self.endTime = endTime |
|
692 | self.endTime = endTime | |
693 |
|
693 | |||
694 | self.inputId = '0' |
|
694 | self.inputId = '0' | |
695 | self.parentId = parentId |
|
695 | self.parentId = parentId | |
696 |
|
696 | |||
697 | self.addRunOperation(**kwargs) |
|
697 | self.addRunOperation(**kwargs) | |
698 |
|
698 | |||
699 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): |
|
699 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): | |
700 |
|
700 | |||
701 | #Compatible with old signal chain version |
|
701 | #Compatible with old signal chain version | |
702 | if datatype==None and name==None: |
|
702 | if datatype==None and name==None: | |
703 | raise ValueError, "datatype or name should be defined" |
|
703 | raise ValueError, "datatype or name should be defined" | |
704 |
|
704 | |||
705 | if name==None: |
|
705 | if name==None: | |
706 | if 'Reader' in datatype: |
|
706 | if 'Reader' in datatype: | |
707 | name = datatype |
|
707 | name = datatype | |
708 | else: |
|
708 | else: | |
709 | name = '%sReader' %(datatype) |
|
709 | name = '%sReader' %(datatype) | |
710 |
|
710 | |||
711 | if datatype==None: |
|
711 | if datatype==None: | |
712 | datatype = name.replace('Reader','') |
|
712 | datatype = name.replace('Reader','') | |
713 |
|
713 | |||
714 | self.datatype = datatype |
|
714 | self.datatype = datatype | |
715 | self.name = name |
|
715 | self.name = name | |
716 | self.path = path |
|
716 | self.path = path | |
717 | self.startDate = startDate |
|
717 | self.startDate = startDate | |
718 | self.endDate = endDate |
|
718 | self.endDate = endDate | |
719 | self.startTime = startTime |
|
719 | self.startTime = startTime | |
720 | self.endTime = endTime |
|
720 | self.endTime = endTime | |
721 |
|
721 | |||
722 | self.inputId = '0' |
|
722 | self.inputId = '0' | |
723 | self.parentId = parentId |
|
723 | self.parentId = parentId | |
724 |
|
724 | |||
725 | self.updateRunOperation(**kwargs) |
|
725 | self.updateRunOperation(**kwargs) | |
726 |
|
726 | |||
727 | def addRunOperation(self, **kwargs): |
|
727 | def addRunOperation(self, **kwargs): | |
728 |
|
728 | |||
729 | opObj = self.addOperation(name = 'run', optype = 'self') |
|
729 | opObj = self.addOperation(name = 'run', optype = 'self') | |
730 |
|
730 | |||
731 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
731 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
732 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
732 | opObj.addParameter(name='path' , value=self.path, format='str') | |
733 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
733 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
734 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
734 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
735 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
735 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
736 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
736 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
737 |
|
737 | |||
738 | for key, value in kwargs.items(): |
|
738 | for key, value in kwargs.items(): | |
739 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
739 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
740 |
|
740 | |||
741 | return opObj |
|
741 | return opObj | |
742 |
|
742 | |||
743 | def updateRunOperation(self, **kwargs): |
|
743 | def updateRunOperation(self, **kwargs): | |
744 |
|
744 | |||
745 | opObj = self.getOperationObj(name = 'run') |
|
745 | opObj = self.getOperationObj(name = 'run') | |
746 | opObj.removeParameters() |
|
746 | opObj.removeParameters() | |
747 |
|
747 | |||
748 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') |
|
748 | opObj.addParameter(name='datatype' , value=self.datatype, format='str') | |
749 | opObj.addParameter(name='path' , value=self.path, format='str') |
|
749 | opObj.addParameter(name='path' , value=self.path, format='str') | |
750 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') |
|
750 | opObj.addParameter(name='startDate' , value=self.startDate, format='date') | |
751 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') |
|
751 | opObj.addParameter(name='endDate' , value=self.endDate, format='date') | |
752 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') |
|
752 | opObj.addParameter(name='startTime' , value=self.startTime, format='time') | |
753 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') |
|
753 | opObj.addParameter(name='endTime' , value=self.endTime, format='time') | |
754 |
|
754 | |||
755 | for key, value in kwargs.items(): |
|
755 | for key, value in kwargs.items(): | |
756 | opObj.addParameter(name=key, value=value, format=type(value).__name__) |
|
756 | opObj.addParameter(name=key, value=value, format=type(value).__name__) | |
757 |
|
757 | |||
758 | return opObj |
|
758 | return opObj | |
759 |
|
759 | |||
760 | class Project(): |
|
760 | class Project(): | |
761 |
|
761 | |||
762 | id = None |
|
762 | id = None | |
763 | name = None |
|
763 | name = None | |
764 | description = None |
|
764 | description = None | |
765 | # readUnitConfObjList = None |
|
765 | # readUnitConfObjList = None | |
766 | procUnitConfObjDict = None |
|
766 | procUnitConfObjDict = None | |
767 |
|
767 | |||
768 | ELEMENTNAME = 'Project' |
|
768 | ELEMENTNAME = 'Project' | |
769 |
|
769 | |||
770 | def __init__(self): |
|
770 | def __init__(self): | |
771 |
|
771 | |||
772 | self.id = None |
|
772 | self.id = None | |
773 | self.name = None |
|
773 | self.name = None | |
774 | self.description = None |
|
774 | self.description = None | |
775 |
|
775 | |||
776 | self.procUnitConfObjDict = {} |
|
776 | self.procUnitConfObjDict = {} | |
777 |
|
777 | |||
778 | def __getNewId(self): |
|
778 | def __getNewId(self): | |
779 |
|
779 | |||
780 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 |
|
780 | id = int(self.id)*10 + len(self.procUnitConfObjDict) + 1 | |
781 |
|
781 | |||
782 | return str(id) |
|
782 | return str(id) | |
783 |
|
783 | |||
784 | def getElementName(self): |
|
784 | def getElementName(self): | |
785 |
|
785 | |||
786 | return self.ELEMENTNAME |
|
786 | return self.ELEMENTNAME | |
787 |
|
787 | |||
788 | def getId(self): |
|
788 | def getId(self): | |
789 |
|
789 | |||
790 | return self.id |
|
790 | return self.id | |
791 |
|
791 | |||
792 | def updateId(self, new_id): |
|
792 | def updateId(self, new_id): | |
793 |
|
793 | |||
794 | self.id = str(new_id) |
|
794 | self.id = str(new_id) | |
795 |
|
795 | |||
796 | keyList = self.procUnitConfObjDict.keys() |
|
796 | keyList = self.procUnitConfObjDict.keys() | |
797 | keyList.sort() |
|
797 | keyList.sort() | |
798 |
|
798 | |||
799 | n = 1 |
|
799 | n = 1 | |
800 | newProcUnitConfObjDict = {} |
|
800 | newProcUnitConfObjDict = {} | |
801 |
|
801 | |||
802 | for procKey in keyList: |
|
802 | for procKey in keyList: | |
803 |
|
803 | |||
804 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
804 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
805 | idProcUnit = str(int(self.id)*10 + n) |
|
805 | idProcUnit = str(int(self.id)*10 + n) | |
806 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) |
|
806 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) | |
807 |
|
807 | |||
808 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj |
|
808 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj | |
809 | n += 1 |
|
809 | n += 1 | |
810 |
|
810 | |||
811 | self.procUnitConfObjDict = newProcUnitConfObjDict |
|
811 | self.procUnitConfObjDict = newProcUnitConfObjDict | |
812 |
|
812 | |||
813 | def setup(self, id, name, description): |
|
813 | def setup(self, id, name, description): | |
814 |
|
814 | |||
815 | self.id = str(id) |
|
815 | self.id = str(id) | |
816 | self.name = name |
|
816 | self.name = name | |
817 | self.description = description |
|
817 | self.description = description | |
818 |
|
818 | |||
819 | def update(self, name, description): |
|
819 | def update(self, name, description): | |
820 |
|
820 | |||
821 | self.name = name |
|
821 | self.name = name | |
822 | self.description = description |
|
822 | self.description = description | |
823 |
|
823 | |||
824 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
824 | def addReadUnit(self, datatype=None, name=None, **kwargs): | |
825 |
|
825 | |||
826 | idReadUnit = self.__getNewId() |
|
826 | idReadUnit = self.__getNewId() | |
827 |
|
827 | |||
828 | readUnitConfObj = ReadUnitConf() |
|
828 | readUnitConfObj = ReadUnitConf() | |
829 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) |
|
829 | readUnitConfObj.setup(idReadUnit, name, datatype, parentId=self.id, **kwargs) | |
830 |
|
830 | |||
831 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
831 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
832 |
|
832 | |||
833 | return readUnitConfObj |
|
833 | return readUnitConfObj | |
834 |
|
834 | |||
835 | def addProcUnit(self, inputId='0', datatype=None, name=None): |
|
835 | def addProcUnit(self, inputId='0', datatype=None, name=None): | |
836 |
|
836 | |||
837 | idProcUnit = self.__getNewId() |
|
837 | idProcUnit = self.__getNewId() | |
838 |
|
838 | |||
839 | procUnitConfObj = ProcUnitConf() |
|
839 | procUnitConfObj = ProcUnitConf() | |
840 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) |
|
840 | procUnitConfObj.setup(idProcUnit, name, datatype, inputId, parentId=self.id) | |
841 |
|
841 | |||
842 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
842 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
843 |
|
843 | |||
844 | return procUnitConfObj |
|
844 | return procUnitConfObj | |
845 |
|
845 | |||
846 | def removeProcUnit(self, id): |
|
846 | def removeProcUnit(self, id): | |
847 |
|
847 | |||
848 | if id in self.procUnitConfObjDict.keys(): |
|
848 | if id in self.procUnitConfObjDict.keys(): | |
849 | self.procUnitConfObjDict.pop(id) |
|
849 | self.procUnitConfObjDict.pop(id) | |
850 |
|
850 | |||
851 | def getReadUnitId(self): |
|
851 | def getReadUnitId(self): | |
852 |
|
852 | |||
853 | readUnitConfObj = self.getReadUnitObj() |
|
853 | readUnitConfObj = self.getReadUnitObj() | |
854 |
|
854 | |||
855 | return readUnitConfObj.id |
|
855 | return readUnitConfObj.id | |
856 |
|
856 | |||
857 | def getReadUnitObj(self): |
|
857 | def getReadUnitObj(self): | |
858 |
|
858 | |||
859 | for obj in self.procUnitConfObjDict.values(): |
|
859 | for obj in self.procUnitConfObjDict.values(): | |
860 | if obj.getElementName() == "ReadUnit": |
|
860 | if obj.getElementName() == "ReadUnit": | |
861 | return obj |
|
861 | return obj | |
862 |
|
862 | |||
863 | return None |
|
863 | return None | |
864 |
|
864 | |||
865 | def getProcUnitObj(self, id=None, name=None): |
|
865 | def getProcUnitObj(self, id=None, name=None): | |
866 |
|
866 | |||
867 | if id != None: |
|
867 | if id != None: | |
868 | return self.procUnitConfObjDict[id] |
|
868 | return self.procUnitConfObjDict[id] | |
869 |
|
869 | |||
870 | if name != None: |
|
870 | if name != None: | |
871 | return self.getProcUnitObjByName(name) |
|
871 | return self.getProcUnitObjByName(name) | |
872 |
|
872 | |||
873 | return None |
|
873 | return None | |
874 |
|
874 | |||
875 | def getProcUnitObjByName(self, name): |
|
875 | def getProcUnitObjByName(self, name): | |
876 |
|
876 | |||
877 | for obj in self.procUnitConfObjDict.values(): |
|
877 | for obj in self.procUnitConfObjDict.values(): | |
878 | if obj.name == name: |
|
878 | if obj.name == name: | |
879 | return obj |
|
879 | return obj | |
880 |
|
880 | |||
881 | return None |
|
881 | return None | |
882 |
|
882 | |||
883 | def procUnitItems(self): |
|
883 | def procUnitItems(self): | |
884 |
|
884 | |||
885 | return self.procUnitConfObjDict.items() |
|
885 | return self.procUnitConfObjDict.items() | |
886 |
|
886 | |||
887 | def makeXml(self): |
|
887 | def makeXml(self): | |
888 |
|
888 | |||
889 | projectElement = Element('Project') |
|
889 | projectElement = Element('Project') | |
890 | projectElement.set('id', str(self.id)) |
|
890 | projectElement.set('id', str(self.id)) | |
891 | projectElement.set('name', self.name) |
|
891 | projectElement.set('name', self.name) | |
892 | projectElement.set('description', self.description) |
|
892 | projectElement.set('description', self.description) | |
893 |
|
893 | |||
894 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
894 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
895 | procUnitConfObj.makeXml(projectElement) |
|
895 | procUnitConfObj.makeXml(projectElement) | |
896 |
|
896 | |||
897 | self.projectElement = projectElement |
|
897 | self.projectElement = projectElement | |
898 |
|
898 | |||
899 | def writeXml(self, filename): |
|
899 | def writeXml(self, filename): | |
900 |
|
900 | |||
901 | self.makeXml() |
|
901 | self.makeXml() | |
902 |
|
902 | |||
903 | #print prettify(self.projectElement) |
|
903 | #print prettify(self.projectElement) | |
904 |
|
904 | |||
905 | ElementTree(self.projectElement).write(filename, method='xml') |
|
905 | ElementTree(self.projectElement).write(filename, method='xml') | |
906 |
|
906 | |||
907 | def readXml(self, filename): |
|
907 | def readXml(self, filename): | |
908 |
|
908 | |||
909 | self.projectElement = None |
|
909 | self.projectElement = None | |
910 | self.procUnitConfObjDict = {} |
|
910 | self.procUnitConfObjDict = {} | |
911 |
|
911 | |||
912 | self.projectElement = ElementTree().parse(filename) |
|
912 | self.projectElement = ElementTree().parse(filename) | |
913 |
|
913 | |||
914 | self.project = self.projectElement.tag |
|
914 | self.project = self.projectElement.tag | |
915 |
|
915 | |||
916 | self.id = self.projectElement.get('id') |
|
916 | self.id = self.projectElement.get('id') | |
917 | self.name = self.projectElement.get('name') |
|
917 | self.name = self.projectElement.get('name') | |
918 | self.description = self.projectElement.get('description') |
|
918 | self.description = self.projectElement.get('description') | |
919 |
|
919 | |||
920 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) |
|
920 | readUnitElementList = self.projectElement.getiterator(ReadUnitConf().getElementName()) | |
921 |
|
921 | |||
922 | for readUnitElement in readUnitElementList: |
|
922 | for readUnitElement in readUnitElementList: | |
923 | readUnitConfObj = ReadUnitConf() |
|
923 | readUnitConfObj = ReadUnitConf() | |
924 | readUnitConfObj.readXml(readUnitElement) |
|
924 | readUnitConfObj.readXml(readUnitElement) | |
925 |
|
925 | |||
926 | if readUnitConfObj.parentId == None: |
|
926 | if readUnitConfObj.parentId == None: | |
927 | readUnitConfObj.parentId = self.id |
|
927 | readUnitConfObj.parentId = self.id | |
928 |
|
928 | |||
929 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj |
|
929 | self.procUnitConfObjDict[readUnitConfObj.getId()] = readUnitConfObj | |
930 |
|
930 | |||
931 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) |
|
931 | procUnitElementList = self.projectElement.getiterator(ProcUnitConf().getElementName()) | |
932 |
|
932 | |||
933 | for procUnitElement in procUnitElementList: |
|
933 | for procUnitElement in procUnitElementList: | |
934 | procUnitConfObj = ProcUnitConf() |
|
934 | procUnitConfObj = ProcUnitConf() | |
935 | procUnitConfObj.readXml(procUnitElement) |
|
935 | procUnitConfObj.readXml(procUnitElement) | |
936 |
|
936 | |||
937 | if procUnitConfObj.parentId == None: |
|
937 | if procUnitConfObj.parentId == None: | |
938 | procUnitConfObj.parentId = self.id |
|
938 | procUnitConfObj.parentId = self.id | |
939 |
|
939 | |||
940 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
940 | self.procUnitConfObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
941 |
|
941 | |||
942 | def printattr(self): |
|
942 | def printattr(self): | |
943 |
|
943 | |||
944 | print "Project[%s]: name = %s, description = %s" %(self.id, |
|
944 | print "Project[%s]: name = %s, description = %s" %(self.id, | |
945 | self.name, |
|
945 | self.name, | |
946 | self.description) |
|
946 | self.description) | |
947 |
|
947 | |||
948 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
948 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
949 | procUnitConfObj.printattr() |
|
949 | procUnitConfObj.printattr() | |
950 |
|
950 | |||
951 | def createObjects(self): |
|
951 | def createObjects(self): | |
952 |
|
952 | |||
953 | for procUnitConfObj in self.procUnitConfObjDict.values(): |
|
953 | for procUnitConfObj in self.procUnitConfObjDict.values(): | |
954 | procUnitConfObj.createObjects() |
|
954 | procUnitConfObj.createObjects() | |
955 |
|
955 | |||
956 | def __connect(self, objIN, thisObj): |
|
956 | def __connect(self, objIN, thisObj): | |
957 |
|
957 | |||
958 | thisObj.setInput(objIN.getOutputObj()) |
|
958 | thisObj.setInput(objIN.getOutputObj()) | |
959 |
|
959 | |||
960 | def connectObjects(self): |
|
960 | def connectObjects(self): | |
961 |
|
961 | |||
962 | for thisPUConfObj in self.procUnitConfObjDict.values(): |
|
962 | for thisPUConfObj in self.procUnitConfObjDict.values(): | |
963 |
|
963 | |||
964 | inputId = thisPUConfObj.getInputId() |
|
964 | inputId = thisPUConfObj.getInputId() | |
965 |
|
965 | |||
966 | if int(inputId) == 0: |
|
966 | if int(inputId) == 0: | |
967 | continue |
|
967 | continue | |
968 |
|
968 | |||
969 | #Get input object |
|
969 | #Get input object | |
970 | puConfINObj = self.procUnitConfObjDict[inputId] |
|
970 | puConfINObj = self.procUnitConfObjDict[inputId] | |
971 | puObjIN = puConfINObj.getProcUnitObj() |
|
971 | puObjIN = puConfINObj.getProcUnitObj() | |
972 |
|
972 | |||
973 | #Get current object |
|
973 | #Get current object | |
974 | thisPUObj = thisPUConfObj.getProcUnitObj() |
|
974 | thisPUObj = thisPUConfObj.getProcUnitObj() | |
975 |
|
975 | |||
976 | self.__connect(puObjIN, thisPUObj) |
|
976 | self.__connect(puObjIN, thisPUObj) | |
977 |
|
977 | |||
978 | def isPaused(self): |
|
978 | def isPaused(self): | |
979 | return 0 |
|
979 | return 0 | |
980 |
|
980 | |||
981 | def isStopped(self): |
|
981 | def isStopped(self): | |
982 | return 0 |
|
982 | return 0 | |
983 |
|
983 | |||
984 | def runController(self): |
|
984 | def runController(self): | |
985 | """ |
|
985 | """ | |
986 | returns 0 when this process has been stopped, 1 otherwise |
|
986 | returns 0 when this process has been stopped, 1 otherwise | |
987 | """ |
|
987 | """ | |
988 |
|
988 | |||
989 | if self.isPaused(): |
|
989 | if self.isPaused(): | |
990 | print "Process suspended" |
|
990 | print "Process suspended" | |
991 |
|
991 | |||
992 | while True: |
|
992 | while True: | |
993 | sleep(0.1) |
|
993 | sleep(0.1) | |
994 |
|
994 | |||
995 | if not self.isPaused(): |
|
995 | if not self.isPaused(): | |
996 | break |
|
996 | break | |
997 |
|
997 | |||
998 | if self.isStopped(): |
|
998 | if self.isStopped(): | |
999 | break |
|
999 | break | |
1000 |
|
1000 | |||
1001 | print "Process reinitialized" |
|
1001 | print "Process reinitialized" | |
1002 |
|
1002 | |||
1003 | if self.isStopped(): |
|
1003 | if self.isStopped(): | |
1004 | print "Process stopped" |
|
1004 | print "Process stopped" | |
1005 | return 0 |
|
1005 | return 0 | |
1006 |
|
1006 | |||
1007 | return 1 |
|
1007 | return 1 | |
1008 |
|
1008 | |||
1009 | def run(self): |
|
1009 | def run(self): | |
1010 |
|
1010 | |||
1011 |
|
1011 | |||
1012 | print "*"*60 |
|
1012 | print "*"*60 | |
1013 | print " Starting SIGNAL CHAIN PROCESSING " |
|
1013 | print " Starting SIGNAL CHAIN PROCESSING " | |
1014 | print "*"*60 |
|
1014 | print "*"*60 | |
1015 |
|
1015 | |||
1016 |
|
1016 | |||
1017 | keyList = self.procUnitConfObjDict.keys() |
|
1017 | keyList = self.procUnitConfObjDict.keys() | |
1018 | keyList.sort() |
|
1018 | keyList.sort() | |
1019 |
|
1019 | |||
1020 | while(True): |
|
1020 | while(True): | |
1021 |
|
1021 | |||
1022 | is_ok = False |
|
1022 | is_ok = False | |
1023 |
|
1023 | |||
1024 | for procKey in keyList: |
|
1024 | for procKey in keyList: | |
1025 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) |
|
1025 | # print "Running the '%s' process with %s" %(procUnitConfObj.name, procUnitConfObj.id) | |
1026 |
|
1026 | |||
1027 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1027 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1028 |
|
1028 | |||
1029 | message = "" |
|
1029 | message = "" | |
1030 | try: |
|
1030 | try: | |
1031 | sts = procUnitConfObj.run() |
|
1031 | sts = procUnitConfObj.run() | |
1032 | is_ok = is_ok or sts |
|
1032 | is_ok = is_ok or sts | |
1033 | except: |
|
1033 | except: | |
|
1034 | print "***** Error running %s *****" %procUnitConfObj.name | |||
1034 | sleep(1) |
|
1035 | sleep(1) | |
|
1036 | ||||
1035 | err = traceback.format_exception(sys.exc_info()[0], |
|
1037 | err = traceback.format_exception(sys.exc_info()[0], | |
1036 | sys.exc_info()[1], |
|
1038 | sys.exc_info()[1], | |
1037 | sys.exc_info()[2]) |
|
1039 | sys.exc_info()[2]) | |
1038 |
|
1040 | |||
1039 | for thisLine in err: |
|
1041 | for thisLine in err: | |
1040 | message += thisLine |
|
1042 | message += thisLine | |
1041 |
|
1043 | |||
1042 |
|
|
1044 | sys.stderr.write(message) | |
|
1045 | # print "*"*60 | |||
|
1046 | # print message | |||
|
1047 | # print "*"*60 | |||
|
1048 | ||||
1043 | # self.sendReport(message) |
|
1049 | # self.sendReport(message) | |
1044 | sleep(0.1) |
|
1050 | sleep(0.1) | |
1045 | is_ok = False |
|
1051 | is_ok = False | |
1046 |
|
1052 | |||
1047 | break |
|
1053 | break | |
1048 |
|
1054 | |||
1049 | #If every process unit finished so end process |
|
1055 | #If every process unit finished so end process | |
1050 | if not(is_ok): |
|
1056 | if not(is_ok): | |
1051 | print message |
|
|||
1052 | print "Every process unit have finished" |
|
1057 | print "Every process unit have finished" | |
1053 | break |
|
1058 | break | |
1054 |
|
1059 | |||
1055 | if not self.runController(): |
|
1060 | if not self.runController(): | |
1056 | break |
|
1061 | break | |
1057 |
|
1062 | |||
1058 | #Closing every process |
|
1063 | #Closing every process | |
1059 | for procKey in keyList: |
|
1064 | for procKey in keyList: | |
1060 | procUnitConfObj = self.procUnitConfObjDict[procKey] |
|
1065 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
1061 | procUnitConfObj.close() |
|
1066 | procUnitConfObj.close() | |
1062 |
|
1067 | |||
1063 | print "Process finished" |
|
1068 | print "Process finished" | |
1064 |
|
1069 | |||
1065 | def start(self, filename): |
|
1070 | def start(self, filename): | |
1066 |
|
1071 | |||
1067 | self.writeXml(filename) |
|
1072 | self.writeXml(filename) | |
1068 | self.readXml(filename) |
|
1073 | self.readXml(filename) | |
1069 |
|
1074 | |||
1070 | self.createObjects() |
|
1075 | self.createObjects() | |
1071 | self.connectObjects() |
|
1076 | self.connectObjects() | |
1072 | self.run() |
|
1077 | self.run() | |
1073 |
|
1078 | |||
1074 | def sendReport(self, message, subject="Error occurred in Signal Chain", email=SCHAIN_MAIL): |
|
1079 | def sendReport(self, message, subject="Error occurred in Signal Chain", email=SCHAIN_MAIL): | |
1075 |
|
1080 | |||
1076 | import smtplib |
|
1081 | import smtplib | |
1077 |
|
1082 | |||
1078 | print subject |
|
1083 | print subject | |
1079 | print "Sending report to %s ..." %email |
|
1084 | print "Sending report to %s ..." %email | |
1080 |
|
1085 | |||
1081 | message = 'From: (Python Signal Chain API) ' + email + '\n' + \ |
|
1086 | message = 'From: (Python Signal Chain API) ' + email + '\n' + \ | |
1082 | 'To: ' + email + '\n' + \ |
|
1087 | 'To: ' + email + '\n' + \ | |
1083 | 'Subject: ' + str(subject) + '\n' + \ |
|
1088 | 'Subject: ' + str(subject) + '\n' + \ | |
1084 | 'Content-type: text/html\n\n' + message |
|
1089 | 'Content-type: text/html\n\n' + message | |
1085 |
|
1090 | |||
1086 | server = smtplib.SMTP(EMAIL_SERVER) |
|
1091 | server = smtplib.SMTP(EMAIL_SERVER) | |
1087 | server.sendmail(email.split(',')[0], |
|
1092 | server.sendmail(email.split(',')[0], | |
1088 | email.split(','), message) |
|
1093 | email.split(','), message) | |
1089 | server.quit() |
|
1094 | server.quit() | |
1090 |
|
1095 | |||
1091 | if __name__ == '__main__': |
|
1096 | if __name__ == '__main__': | |
1092 |
|
1097 | |||
1093 | desc = "Segundo Test" |
|
1098 | desc = "Segundo Test" | |
1094 | filename = "schain.xml" |
|
1099 | filename = "schain.xml" | |
1095 |
|
1100 | |||
1096 | controllerObj = Project() |
|
1101 | controllerObj = Project() | |
1097 |
|
1102 | |||
1098 | controllerObj.setup(id = '191', name='test01', description=desc) |
|
1103 | controllerObj.setup(id = '191', name='test01', description=desc) | |
1099 |
|
1104 | |||
1100 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', |
|
1105 | readUnitConfObj = controllerObj.addReadUnit(datatype='Voltage', | |
1101 | path='data/rawdata/', |
|
1106 | path='data/rawdata/', | |
1102 | startDate='2011/01/01', |
|
1107 | startDate='2011/01/01', | |
1103 | endDate='2012/12/31', |
|
1108 | endDate='2012/12/31', | |
1104 | startTime='00:00:00', |
|
1109 | startTime='00:00:00', | |
1105 | endTime='23:59:59', |
|
1110 | endTime='23:59:59', | |
1106 | online=1, |
|
1111 | online=1, | |
1107 | walk=1) |
|
1112 | walk=1) | |
1108 |
|
1113 | |||
1109 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) |
|
1114 | procUnitConfObj0 = controllerObj.addProcUnit(datatype='Voltage', inputId=readUnitConfObj.getId()) | |
1110 |
|
1115 | |||
1111 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') |
|
1116 | opObj10 = procUnitConfObj0.addOperation(name='selectChannels') | |
1112 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') |
|
1117 | opObj10.addParameter(name='channelList', value='3,4,5', format='intlist') | |
1113 |
|
1118 | |||
1114 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') |
|
1119 | opObj10 = procUnitConfObj0.addOperation(name='selectHeights') | |
1115 | opObj10.addParameter(name='minHei', value='90', format='float') |
|
1120 | opObj10.addParameter(name='minHei', value='90', format='float') | |
1116 | opObj10.addParameter(name='maxHei', value='180', format='float') |
|
1121 | opObj10.addParameter(name='maxHei', value='180', format='float') | |
1117 |
|
1122 | |||
1118 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') |
|
1123 | opObj12 = procUnitConfObj0.addOperation(name='CohInt', optype='external') | |
1119 | opObj12.addParameter(name='n', value='10', format='int') |
|
1124 | opObj12.addParameter(name='n', value='10', format='int') | |
1120 |
|
1125 | |||
1121 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) |
|
1126 | procUnitConfObj1 = controllerObj.addProcUnit(datatype='Spectra', inputId=procUnitConfObj0.getId()) | |
1122 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') |
|
1127 | procUnitConfObj1.addParameter(name='nFFTPoints', value='32', format='int') | |
1123 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') |
|
1128 | # procUnitConfObj1.addParameter(name='pairList', value='(0,1),(0,2),(1,2)', format='') | |
1124 |
|
1129 | |||
1125 |
|
1130 | |||
1126 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') |
|
1131 | opObj11 = procUnitConfObj1.addOperation(name='SpectraPlot', optype='external') | |
1127 | opObj11.addParameter(name='idfigure', value='1', format='int') |
|
1132 | opObj11.addParameter(name='idfigure', value='1', format='int') | |
1128 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') |
|
1133 | opObj11.addParameter(name='wintitle', value='SpectraPlot0', format='str') | |
1129 | opObj11.addParameter(name='zmin', value='40', format='int') |
|
1134 | opObj11.addParameter(name='zmin', value='40', format='int') | |
1130 | opObj11.addParameter(name='zmax', value='90', format='int') |
|
1135 | opObj11.addParameter(name='zmax', value='90', format='int') | |
1131 | opObj11.addParameter(name='showprofile', value='1', format='int') |
|
1136 | opObj11.addParameter(name='showprofile', value='1', format='int') | |
1132 |
|
1137 | |||
1133 | print "Escribiendo el archivo XML" |
|
1138 | print "Escribiendo el archivo XML" | |
1134 |
|
1139 | |||
1135 | controllerObj.writeXml(filename) |
|
1140 | controllerObj.writeXml(filename) | |
1136 |
|
1141 | |||
1137 | print "Leyendo el archivo XML" |
|
1142 | print "Leyendo el archivo XML" | |
1138 | controllerObj.readXml(filename) |
|
1143 | controllerObj.readXml(filename) | |
1139 | #controllerObj.printattr() |
|
1144 | #controllerObj.printattr() | |
1140 |
|
1145 | |||
1141 | controllerObj.createObjects() |
|
1146 | controllerObj.createObjects() | |
1142 | controllerObj.connectObjects() |
|
1147 | controllerObj.connectObjects() | |
1143 | controllerObj.run() |
|
1148 | controllerObj.run() | |
1144 |
|
1149 | |||
1145 | No newline at end of file |
|
1150 |
@@ -1,5898 +1,5899 | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | """ |
|
2 | """ | |
3 | Module implementing MainWindow. |
|
3 | Module implementing MainWindow. | |
4 | #+++++++++++++GUI V1++++++++++++++# |
|
4 | #+++++++++++++GUI V1++++++++++++++# | |
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± |
|
5 | @author: AlexanderValdezPortocarrero Γ±_Γ± | |
6 | """ |
|
6 | """ | |
7 | import os, sys, time |
|
7 | import os, sys, time | |
8 | import datetime |
|
8 | import datetime | |
9 | import numpy |
|
9 | import numpy | |
10 | import Queue |
|
10 | import Queue | |
11 |
|
11 | |||
12 | from collections import OrderedDict |
|
12 | from collections import OrderedDict | |
13 | from os.path import expanduser |
|
13 | from os.path import expanduser | |
14 | from time import sleep |
|
14 | from time import sleep | |
15 | # from gevent import sleep |
|
15 | # from gevent import sleep | |
16 |
|
16 | |||
17 | import ast |
|
17 | import ast | |
18 |
|
18 | |||
19 | from PyQt4.QtGui import QMainWindow |
|
19 | from PyQt4.QtGui import QMainWindow | |
20 | from PyQt4.QtCore import pyqtSignature |
|
20 | from PyQt4.QtCore import pyqtSignature | |
21 | from PyQt4.QtCore import pyqtSignal |
|
21 | from PyQt4.QtCore import pyqtSignal | |
22 | from PyQt4 import QtCore |
|
22 | from PyQt4 import QtCore | |
23 | from PyQt4 import QtGui |
|
23 | from PyQt4 import QtGui | |
24 | # from PyQt4.QtCore import QThread |
|
24 | # from PyQt4.QtCore import QThread | |
25 | # from PyQt4.QtCore import QObject, SIGNAL |
|
25 | # from PyQt4.QtCore import QObject, SIGNAL | |
26 |
|
26 | |||
27 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
27 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess | |
28 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
28 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp | |
29 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
29 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow | |
30 | from schainpy.controller_api import ControllerThread |
|
30 | from schainpy.controller_api import ControllerThread | |
31 | from schainpy.controller import Project |
|
31 | from schainpy.controller import Project | |
32 |
|
32 | |||
33 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
33 | from propertiesViewModel import TreeModel, PropertyBuffer | |
34 | from parametersModel import ProjectParms |
|
34 | from parametersModel import ProjectParms | |
35 |
|
35 | |||
36 | from schainpy.gui.figures import tools |
|
36 | from schainpy.gui.figures import tools | |
37 |
|
37 | |||
38 | FIGURES_PATH = tools.get_path() |
|
38 | FIGURES_PATH = tools.get_path() | |
39 | TEMPORAL_FILE = ".temp.xml" |
|
39 | TEMPORAL_FILE = ".temp.xml" | |
40 |
|
40 | |||
41 | def isRadarFile(file): |
|
41 | def isRadarFile(file): | |
42 | try: |
|
42 | try: | |
43 | year = int(file[1:5]) |
|
43 | year = int(file[1:5]) | |
44 | doy = int(file[5:8]) |
|
44 | doy = int(file[5:8]) | |
45 | set = int(file[8:11]) |
|
45 | set = int(file[8:11]) | |
46 | except: |
|
46 | except: | |
47 | return 0 |
|
47 | return 0 | |
48 |
|
48 | |||
49 | return 1 |
|
49 | return 1 | |
50 |
|
50 | |||
51 | def isRadarPath(path): |
|
51 | def isRadarPath(path): | |
52 | try: |
|
52 | try: | |
53 | year = int(path[1:5]) |
|
53 | year = int(path[1:5]) | |
54 | doy = int(path[5:8]) |
|
54 | doy = int(path[5:8]) | |
55 | except: |
|
55 | except: | |
56 | return 0 |
|
56 | return 0 | |
57 |
|
57 | |||
58 | return 1 |
|
58 | return 1 | |
59 |
|
59 | |||
60 | def isInt(value): |
|
60 | def isInt(value): | |
61 |
|
61 | |||
62 | try: |
|
62 | try: | |
63 | int(value) |
|
63 | int(value) | |
64 | except: |
|
64 | except: | |
65 | return 0 |
|
65 | return 0 | |
66 |
|
66 | |||
67 | return 1 |
|
67 | return 1 | |
68 |
|
68 | |||
69 | def isFloat(value): |
|
69 | def isFloat(value): | |
70 |
|
70 | |||
71 | try: |
|
71 | try: | |
72 | float(value) |
|
72 | float(value) | |
73 | except: |
|
73 | except: | |
74 | return 0 |
|
74 | return 0 | |
75 |
|
75 | |||
76 | return 1 |
|
76 | return 1 | |
77 |
|
77 | |||
78 | def isList(value): |
|
78 | def isList(value): | |
79 |
|
79 | |||
80 | x = ast.literal_eval(value) |
|
80 | x = ast.literal_eval(value) | |
81 |
|
81 | |||
82 | if type(x) in (tuple, list): |
|
82 | if type(x) in (tuple, list): | |
83 | return 1 |
|
83 | return 1 | |
84 |
|
84 | |||
85 | return 0 |
|
85 | return 0 | |
86 |
|
86 | |||
87 | class BasicWindow(QMainWindow, Ui_BasicWindow): |
|
87 | class BasicWindow(QMainWindow, Ui_BasicWindow): | |
88 | """ |
|
88 | """ | |
89 | """ |
|
89 | """ | |
90 | def __init__(self, parent=None): |
|
90 | def __init__(self, parent=None): | |
91 | """ |
|
91 | """ | |
92 |
|
92 | |||
93 | """ |
|
93 | """ | |
94 | QMainWindow.__init__(self, parent) |
|
94 | QMainWindow.__init__(self, parent) | |
95 | self.setupUi(self) |
|
95 | self.setupUi(self) | |
96 | self.__puObjDict = {} |
|
96 | self.__puObjDict = {} | |
97 | self.__itemTreeDict = {} |
|
97 | self.__itemTreeDict = {} | |
98 | self.readUnitConfObjList = [] |
|
98 | self.readUnitConfObjList = [] | |
99 | self.operObjList = [] |
|
99 | self.operObjList = [] | |
100 | self.projecObjView = None |
|
100 | self.projecObjView = None | |
101 | self.idProject = 0 |
|
101 | self.idProject = 0 | |
102 | # self.idImag = 0 |
|
102 | # self.idImag = 0 | |
103 |
|
103 | |||
104 | self.idImagscope = 0 |
|
104 | self.idImagscope = 0 | |
105 | self.idImagspectra = 0 |
|
105 | self.idImagspectra = 0 | |
106 | self.idImagcross = 0 |
|
106 | self.idImagcross = 0 | |
107 | self.idImagrti = 0 |
|
107 | self.idImagrti = 0 | |
108 | self.idImagcoherence = 0 |
|
108 | self.idImagcoherence = 0 | |
109 | self.idImagpower = 0 |
|
109 | self.idImagpower = 0 | |
110 | self.idImagrtinoise = 0 |
|
110 | self.idImagrtinoise = 0 | |
111 | self.idImagspectraHeis = 0 |
|
111 | self.idImagspectraHeis = 0 | |
112 | self.idImagrtiHeis = 0 |
|
112 | self.idImagrtiHeis = 0 | |
113 |
|
113 | |||
114 | self.dataPath = None |
|
114 | self.dataPath = None | |
115 | self.online = 0 |
|
115 | self.online = 0 | |
116 | self.walk = 0 |
|
116 | self.walk = 0 | |
117 | self.create = False |
|
117 | self.create = False | |
118 | self.selectedItemTree = None |
|
118 | self.selectedItemTree = None | |
119 | self.controllerThread = None |
|
119 | self.controllerThread = None | |
120 | # self.commCtrlPThread = None |
|
120 | # self.commCtrlPThread = None | |
121 | # self.create_figure() |
|
121 | # self.create_figure() | |
122 | self.temporalFTP = ftpBuffer() |
|
122 | self.temporalFTP = ftpBuffer() | |
123 | self.projectProperCaracteristica = [] |
|
123 | self.projectProperCaracteristica = [] | |
124 | self.projectProperPrincipal = [] |
|
124 | self.projectProperPrincipal = [] | |
125 | self.projectProperDescripcion = [] |
|
125 | self.projectProperDescripcion = [] | |
126 | self.volProperCaracteristica = [] |
|
126 | self.volProperCaracteristica = [] | |
127 | self.volProperPrincipal = [] |
|
127 | self.volProperPrincipal = [] | |
128 | self.volProperDescripcion = [] |
|
128 | self.volProperDescripcion = [] | |
129 | self.specProperCaracteristica = [] |
|
129 | self.specProperCaracteristica = [] | |
130 | self.specProperPrincipal = [] |
|
130 | self.specProperPrincipal = [] | |
131 | self.specProperDescripcion = [] |
|
131 | self.specProperDescripcion = [] | |
132 |
|
132 | |||
133 | self.specHeisProperCaracteristica = [] |
|
133 | self.specHeisProperCaracteristica = [] | |
134 | self.specHeisProperPrincipal = [] |
|
134 | self.specHeisProperPrincipal = [] | |
135 | self.specHeisProperDescripcion = [] |
|
135 | self.specHeisProperDescripcion = [] | |
136 |
|
136 | |||
137 | # self.pathWorkSpace = './' |
|
137 | # self.pathWorkSpace = './' | |
138 |
|
138 | |||
139 | self.__projectObjDict = {} |
|
139 | self.__projectObjDict = {} | |
140 | self.__operationObjDict = {} |
|
140 | self.__operationObjDict = {} | |
141 |
|
141 | |||
142 | self.__puLocalFolder2FTP = {} |
|
142 | self.__puLocalFolder2FTP = {} | |
143 | self.threadStarted = False |
|
143 | self.threadStarted = False | |
144 |
|
144 | |||
145 | # self.create_comm() |
|
145 | # self.create_comm() | |
146 | self.create_updating_timer() |
|
146 | self.create_updating_timer() | |
147 | self.setGUIStatus() |
|
147 | self.setGUIStatus() | |
148 |
|
148 | |||
149 | @pyqtSignature("") |
|
149 | @pyqtSignature("") | |
150 | def on_actionOpen_triggered(self): |
|
150 | def on_actionOpen_triggered(self): | |
151 | """ |
|
151 | """ | |
152 | Slot documentation goes here. |
|
152 | Slot documentation goes here. | |
153 | """ |
|
153 | """ | |
154 | self.openProject() |
|
154 | self.openProject() | |
155 |
|
155 | |||
156 | @pyqtSignature("") |
|
156 | @pyqtSignature("") | |
157 | def on_actionCreate_triggered(self): |
|
157 | def on_actionCreate_triggered(self): | |
158 | """ |
|
158 | """ | |
159 | Slot documentation goes here. |
|
159 | Slot documentation goes here. | |
160 | """ |
|
160 | """ | |
161 | self.setInputsProject_View() |
|
161 | self.setInputsProject_View() | |
162 | self.create = True |
|
162 | self.create = True | |
163 |
|
163 | |||
164 | @pyqtSignature("") |
|
164 | @pyqtSignature("") | |
165 | def on_actionSave_triggered(self): |
|
165 | def on_actionSave_triggered(self): | |
166 | """ |
|
166 | """ | |
167 | Slot documentation goes here. |
|
167 | Slot documentation goes here. | |
168 | """ |
|
168 | """ | |
169 | self.saveProject() |
|
169 | self.saveProject() | |
170 |
|
170 | |||
171 | @pyqtSignature("") |
|
171 | @pyqtSignature("") | |
172 | def on_actionClose_triggered(self): |
|
172 | def on_actionClose_triggered(self): | |
173 | """ |
|
173 | """ | |
174 | Slot documentation goes here. |
|
174 | Slot documentation goes here. | |
175 | """ |
|
175 | """ | |
176 | self.close() |
|
176 | self.close() | |
177 |
|
177 | |||
178 | @pyqtSignature("") |
|
178 | @pyqtSignature("") | |
179 | def on_actionStart_triggered(self): |
|
179 | def on_actionStart_triggered(self): | |
180 | """ |
|
180 | """ | |
181 | """ |
|
181 | """ | |
182 | self.playProject() |
|
182 | self.playProject() | |
183 |
|
183 | |||
184 | @pyqtSignature("") |
|
184 | @pyqtSignature("") | |
185 | def on_actionPause_triggered(self): |
|
185 | def on_actionPause_triggered(self): | |
186 | """ |
|
186 | """ | |
187 | """ |
|
187 | """ | |
188 | self.pauseProject() |
|
188 | self.pauseProject() | |
189 |
|
189 | |||
190 | @pyqtSignature("") |
|
190 | @pyqtSignature("") | |
191 | def on_actionStop_triggered(self): |
|
191 | def on_actionStop_triggered(self): | |
192 | """ |
|
192 | """ | |
193 | """ |
|
193 | """ | |
194 | self.stopProject() |
|
194 | self.stopProject() | |
195 |
|
195 | |||
196 | @pyqtSignature("") |
|
196 | @pyqtSignature("") | |
197 | def on_actionAbout_triggered(self): |
|
197 | def on_actionAbout_triggered(self): | |
198 | """ |
|
198 | """ | |
199 | """ |
|
199 | """ | |
200 | self.aboutEvent() |
|
200 | self.aboutEvent() | |
201 |
|
201 | |||
202 | @pyqtSignature("") |
|
202 | @pyqtSignature("") | |
203 | def on_actionFTP_triggered(self): |
|
203 | def on_actionFTP_triggered(self): | |
204 | """ |
|
204 | """ | |
205 | """ |
|
205 | """ | |
206 | self.configFTPWindowObj = Ftp(self) |
|
206 | self.configFTPWindowObj = Ftp(self) | |
207 |
|
207 | |||
208 | if not self.temporalFTP.create: |
|
208 | if not self.temporalFTP.create: | |
209 | self.temporalFTP.setwithoutconfiguration() |
|
209 | self.temporalFTP.setwithoutconfiguration() | |
210 |
|
210 | |||
211 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, |
|
211 | self.configFTPWindowObj.setParmsfromTemporal(self.temporalFTP.server, | |
212 | self.temporalFTP.remotefolder, |
|
212 | self.temporalFTP.remotefolder, | |
213 | self.temporalFTP.username, |
|
213 | self.temporalFTP.username, | |
214 | self.temporalFTP.password, |
|
214 | self.temporalFTP.password, | |
215 | self.temporalFTP.ftp_wei, |
|
215 | self.temporalFTP.ftp_wei, | |
216 | self.temporalFTP.exp_code, |
|
216 | self.temporalFTP.exp_code, | |
217 | self.temporalFTP.sub_exp_code, |
|
217 | self.temporalFTP.sub_exp_code, | |
218 | self.temporalFTP.plot_pos) |
|
218 | self.temporalFTP.plot_pos) | |
219 |
|
219 | |||
220 | self.configFTPWindowObj.show() |
|
220 | self.configFTPWindowObj.show() | |
221 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
221 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) | |
222 |
|
222 | |||
223 | def createFTPConfig(self): |
|
223 | def createFTPConfig(self): | |
224 |
|
224 | |||
225 | if not self.configFTPWindowObj.create: |
|
225 | if not self.configFTPWindowObj.create: | |
226 | self.console.clear() |
|
226 | self.console.clear() | |
227 | self.console.append("There is no FTP configuration") |
|
227 | self.console.append("There is no FTP configuration") | |
228 | return |
|
228 | return | |
229 |
|
229 | |||
230 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
|
230 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") | |
231 |
|
231 | |||
232 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() |
|
232 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.configFTPWindowObj.getParmsFromFtpWindow() | |
233 | self.temporalFTP.save(server=server, |
|
233 | self.temporalFTP.save(server=server, | |
234 | remotefolder=remotefolder, |
|
234 | remotefolder=remotefolder, | |
235 | username=username, |
|
235 | username=username, | |
236 | password=password, |
|
236 | password=password, | |
237 | ftp_wei=ftp_wei, |
|
237 | ftp_wei=ftp_wei, | |
238 | exp_code=exp_code, |
|
238 | exp_code=exp_code, | |
239 | sub_exp_code=sub_exp_code, |
|
239 | sub_exp_code=sub_exp_code, | |
240 | plot_pos=plot_pos) |
|
240 | plot_pos=plot_pos) | |
241 |
|
241 | |||
242 | @pyqtSignature("") |
|
242 | @pyqtSignature("") | |
243 | def on_actionOpenToolbar_triggered(self): |
|
243 | def on_actionOpenToolbar_triggered(self): | |
244 | """ |
|
244 | """ | |
245 | Slot documentation goes here. |
|
245 | Slot documentation goes here. | |
246 | """ |
|
246 | """ | |
247 | self.openProject() |
|
247 | self.openProject() | |
248 |
|
248 | |||
249 | @pyqtSignature("") |
|
249 | @pyqtSignature("") | |
250 | def on_actionCreateToolbar_triggered(self): |
|
250 | def on_actionCreateToolbar_triggered(self): | |
251 | """ |
|
251 | """ | |
252 | Slot documentation goes here. |
|
252 | Slot documentation goes here. | |
253 | """ |
|
253 | """ | |
254 | self.setInputsProject_View() |
|
254 | self.setInputsProject_View() | |
255 | self.create = True |
|
255 | self.create = True | |
256 |
|
256 | |||
257 | @pyqtSignature("") |
|
257 | @pyqtSignature("") | |
258 | def on_actionAddPU_triggered(self): |
|
258 | def on_actionAddPU_triggered(self): | |
|
259 | ||||
259 | if len(self.__projectObjDict) == 0: |
|
260 | if len(self.__projectObjDict) == 0: | |
260 |
outputstr = "First |
|
261 | outputstr = "First create a Project before add any Processing Unit" | |
261 | self.console.clear() |
|
262 | self.console.clear() | |
262 | self.console.append(outputstr) |
|
263 | self.console.append(outputstr) | |
263 |
return |
|
264 | return | |
264 | else: |
|
265 | else: | |
265 | self.addPUWindow() |
|
266 | self.addPUWindow() | |
266 | self.console.clear() |
|
267 | self.console.clear() | |
267 | self.console.append("Please, Choose the type of Processing Unit") |
|
268 | self.console.append("Please, Choose the type of Processing Unit") | |
268 | self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
269 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
269 | self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
270 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
270 | self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
271 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
271 |
|
272 | |||
272 |
|
273 | |||
273 | @pyqtSignature("") |
|
274 | @pyqtSignature("") | |
274 | def on_actionSaveToolbar_triggered(self): |
|
275 | def on_actionSaveToolbar_triggered(self): | |
275 | """ |
|
276 | """ | |
276 | Slot documentation goes here. |
|
277 | Slot documentation goes here. | |
277 | """ |
|
278 | """ | |
278 | self.saveProject() |
|
279 | self.saveProject() | |
279 |
|
280 | |||
280 | @pyqtSignature("") |
|
281 | @pyqtSignature("") | |
281 | def on_actionStarToolbar_triggered(self): |
|
282 | def on_actionStarToolbar_triggered(self): | |
282 | """ |
|
283 | """ | |
283 | Slot documentation goes here. |
|
284 | Slot documentation goes here. | |
284 | """ |
|
285 | """ | |
285 | self.playProject() |
|
286 | self.playProject() | |
286 |
|
287 | |||
287 | @pyqtSignature("") |
|
288 | @pyqtSignature("") | |
288 | def on_actionPauseToolbar_triggered(self): |
|
289 | def on_actionPauseToolbar_triggered(self): | |
289 |
|
290 | |||
290 | self.pauseProject() |
|
291 | self.pauseProject() | |
291 |
|
292 | |||
292 | @pyqtSignature("") |
|
293 | @pyqtSignature("") | |
293 | def on_actionStopToolbar_triggered(self): |
|
294 | def on_actionStopToolbar_triggered(self): | |
294 | """ |
|
295 | """ | |
295 | Slot documentation goes here. |
|
296 | Slot documentation goes here. | |
296 | """ |
|
297 | """ | |
297 | self.stopProject() |
|
298 | self.stopProject() | |
298 |
|
299 | |||
299 | @pyqtSignature("int") |
|
300 | @pyqtSignature("int") | |
300 | def on_proComReadMode_activated(self, index): |
|
301 | def on_proComReadMode_activated(self, index): | |
301 | """ |
|
302 | """ | |
302 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 |
|
303 | SELECCION DEL MODO DE LECTURA ON=1, OFF=0 | |
303 | """ |
|
304 | """ | |
304 | if index == 0: |
|
305 | if index == 0: | |
305 | self.online = 0 |
|
306 | self.online = 0 | |
306 | self.proDelay.setText("0") |
|
307 | self.proDelay.setText("0") | |
307 | self.proSet.setText("") |
|
308 | self.proSet.setText("") | |
308 | self.proSet.setEnabled(False) |
|
309 | self.proSet.setEnabled(False) | |
309 | self.proDelay.setEnabled(False) |
|
310 | self.proDelay.setEnabled(False) | |
310 | elif index == 1: |
|
311 | elif index == 1: | |
311 | self.online = 1 |
|
312 | self.online = 1 | |
312 | self.proSet.setText("") |
|
313 | self.proSet.setText("") | |
313 | self.proDelay.setText("5") |
|
314 | self.proDelay.setText("5") | |
314 | self.proSet.setEnabled(True) |
|
315 | self.proSet.setEnabled(True) | |
315 | self.proDelay.setEnabled(True) |
|
316 | self.proDelay.setEnabled(True) | |
316 |
|
317 | |||
317 | @pyqtSignature("int") |
|
318 | @pyqtSignature("int") | |
318 | def on_proComDataType_activated(self, index): |
|
319 | def on_proComDataType_activated(self, index): | |
319 | """ |
|
320 | """ | |
320 | Voltage or Spectra |
|
321 | Voltage or Spectra | |
321 | """ |
|
322 | """ | |
322 | self.labelSet.show() |
|
323 | self.labelSet.show() | |
323 | self.proSet.show() |
|
324 | self.proSet.show() | |
324 |
|
325 | |||
325 | self.labExpLabel.show() |
|
326 | self.labExpLabel.show() | |
326 | self.proExpLabel.show() |
|
327 | self.proExpLabel.show() | |
327 |
|
328 | |||
328 | self.labelIPPKm.hide() |
|
329 | self.labelIPPKm.hide() | |
329 | self.proIPPKm.hide() |
|
330 | self.proIPPKm.hide() | |
330 |
|
331 | |||
331 | if index == 0: |
|
332 | if index == 0: | |
332 | extension = '.r' |
|
333 | extension = '.r' | |
333 | elif index == 1: |
|
334 | elif index == 1: | |
334 | extension = '.pdata' |
|
335 | extension = '.pdata' | |
335 | elif index == 2: |
|
336 | elif index == 2: | |
336 | extension = '.fits' |
|
337 | extension = '.fits' | |
337 | elif index == 3: |
|
338 | elif index == 3: | |
338 | extension = '.hdf5' |
|
339 | extension = '.hdf5' | |
339 |
|
340 | |||
340 | self.labelIPPKm.show() |
|
341 | self.labelIPPKm.show() | |
341 | self.proIPPKm.show() |
|
342 | self.proIPPKm.show() | |
342 |
|
343 | |||
343 | self.labelSet.hide() |
|
344 | self.labelSet.hide() | |
344 | self.proSet.hide() |
|
345 | self.proSet.hide() | |
345 |
|
346 | |||
346 | self.labExpLabel.hide() |
|
347 | self.labExpLabel.hide() | |
347 | self.proExpLabel.hide() |
|
348 | self.proExpLabel.hide() | |
348 |
|
349 | |||
349 | self.proDataType.setText(extension) |
|
350 | self.proDataType.setText(extension) | |
350 |
|
351 | |||
351 | @pyqtSignature("int") |
|
352 | @pyqtSignature("int") | |
352 | def on_proComWalk_activated(self, index): |
|
353 | def on_proComWalk_activated(self, index): | |
353 | """ |
|
354 | """ | |
354 |
|
355 | |||
355 | """ |
|
356 | """ | |
356 | if index == 0: |
|
357 | if index == 0: | |
357 | self.walk = 0 |
|
358 | self.walk = 0 | |
358 | elif index == 1: |
|
359 | elif index == 1: | |
359 | self.walk = 1 |
|
360 | self.walk = 1 | |
360 |
|
361 | |||
361 | @pyqtSignature("") |
|
362 | @pyqtSignature("") | |
362 | def on_proToolPath_clicked(self): |
|
363 | def on_proToolPath_clicked(self): | |
363 | """ |
|
364 | """ | |
364 | Choose your path |
|
365 | Choose your path | |
365 | """ |
|
366 | """ | |
366 |
|
367 | |||
367 | current_dpath = './' |
|
368 | current_dpath = './' | |
368 | if self.dataPath: |
|
369 | if self.dataPath: | |
369 | current_dpath = self.dataPath |
|
370 | current_dpath = self.dataPath | |
370 |
|
371 | |||
371 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) |
|
372 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
372 |
|
373 | |||
373 | #If it was canceled |
|
374 | #If it was canceled | |
374 | if not datapath: |
|
375 | if not datapath: | |
375 | return |
|
376 | return | |
376 |
|
377 | |||
377 | #If any change was done |
|
378 | #If any change was done | |
378 | if datapath == self.dataPath: |
|
379 | if datapath == self.dataPath: | |
379 | return |
|
380 | return | |
380 |
|
381 | |||
381 | self.proDataPath.setText(datapath) |
|
382 | self.proDataPath.setText(datapath) | |
382 |
|
383 | |||
383 | self._disable_play_button() |
|
384 | self._disable_play_button() | |
384 | self._disable_save_button() |
|
385 | self._disable_save_button() | |
385 | self.proOk.setEnabled(False) |
|
386 | self.proOk.setEnabled(False) | |
386 |
|
387 | |||
387 | self.proComStartDate.clear() |
|
388 | self.proComStartDate.clear() | |
388 | self.proComEndDate.clear() |
|
389 | self.proComEndDate.clear() | |
389 |
|
390 | |||
390 | if not os.path.exists(datapath): |
|
391 | if not os.path.exists(datapath): | |
391 |
|
392 | |||
392 | self.console.clear() |
|
393 | self.console.clear() | |
393 | self.console.append("Write a valid path") |
|
394 | self.console.append("Write a valid path") | |
394 | return |
|
395 | return | |
395 |
|
396 | |||
396 | self.dataPath = datapath |
|
397 | self.dataPath = datapath | |
397 |
|
398 | |||
398 | self.console.clear() |
|
399 | self.console.clear() | |
399 | self.console.append("Select the read mode and press 'load button'") |
|
400 | self.console.append("Select the read mode and press 'load button'") | |
400 |
|
401 | |||
401 |
|
402 | |||
402 | @pyqtSignature("") |
|
403 | @pyqtSignature("") | |
403 | def on_proLoadButton_clicked(self): |
|
404 | def on_proLoadButton_clicked(self): | |
404 |
|
405 | |||
405 | self.console.clear() |
|
406 | self.console.clear() | |
406 |
|
407 | |||
407 | # if not self.getSelectedProjectObj(): |
|
|||
408 | # self.console.append("Please select a project before load files") |
|
|||
409 | # return |
|
|||
410 |
|
||||
411 | parameter_list = self.checkInputsProject() |
|
408 | parameter_list = self.checkInputsProject() | |
412 |
|
409 | |||
413 | # if not parameter_list[0]: |
|
|||
414 | # return |
|
|||
415 |
|
||||
416 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list |
|
410 | parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel = parameter_list | |
417 |
|
411 | |||
418 | if read_mode == "Offline": |
|
412 | if read_mode == "Offline": | |
419 | self.proComStartDate.clear() |
|
413 | self.proComStartDate.clear() | |
420 | self.proComEndDate.clear() |
|
414 | self.proComEndDate.clear() | |
421 | self.proComStartDate.setEnabled(True) |
|
415 | self.proComStartDate.setEnabled(True) | |
422 | self.proComEndDate.setEnabled(True) |
|
416 | self.proComEndDate.setEnabled(True) | |
423 | self.proStartTime.setEnabled(True) |
|
417 | self.proStartTime.setEnabled(True) | |
424 | self.proEndTime.setEnabled(True) |
|
418 | self.proEndTime.setEnabled(True) | |
425 | self.frame_2.setEnabled(True) |
|
419 | self.frame_2.setEnabled(True) | |
426 |
|
420 | |||
427 | if read_mode == "Online": |
|
421 | if read_mode == "Online": | |
428 | self.proComStartDate.addItem("1960/01/30") |
|
422 | self.proComStartDate.addItem("1960/01/30") | |
429 | self.proComEndDate.addItem("2018/12/31") |
|
423 | self.proComEndDate.addItem("2018/12/31") | |
430 | self.proComStartDate.setEnabled(False) |
|
424 | self.proComStartDate.setEnabled(False) | |
431 | self.proComEndDate.setEnabled(False) |
|
425 | self.proComEndDate.setEnabled(False) | |
432 | self.proStartTime.setEnabled(False) |
|
426 | self.proStartTime.setEnabled(False) | |
433 | self.proEndTime.setEnabled(False) |
|
427 | self.proEndTime.setEnabled(False) | |
434 | self.frame_2.setEnabled(True) |
|
428 | self.frame_2.setEnabled(True) | |
435 |
|
429 | |||
436 | self.loadDays(data_path, ext, walk, expLabel) |
|
430 | if self.loadDays(data_path, ext, walk, expLabel) == []: | |
437 |
|
431 | self._disable_save_button() | ||
|
432 | self._disable_play_button() | |||
|
433 | self.proOk.setEnabled(False) | |||
|
434 | else: | |||
|
435 | self._enable_save_button() | |||
|
436 | self._enable_play_button() | |||
|
437 | self.proOk.setEnabled(True) | |||
|
438 | ||||
438 | @pyqtSignature("int") |
|
439 | @pyqtSignature("int") | |
439 | def on_proComStartDate_activated(self, index): |
|
440 | def on_proComStartDate_activated(self, index): | |
440 | """ |
|
441 | """ | |
441 | SELECCION DEL RANGO DE FECHAS -START DATE |
|
442 | SELECCION DEL RANGO DE FECHAS -START DATE | |
442 | """ |
|
443 | """ | |
443 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 |
|
444 | stopIndex = self.proComEndDate.count() - self.proComEndDate.currentIndex() - 1 | |
444 |
|
445 | |||
445 | self.proComEndDate.clear() |
|
446 | self.proComEndDate.clear() | |
446 | for i in self.dateList[index:]: |
|
447 | for i in self.dateList[index:]: | |
447 | self.proComEndDate.addItem(i) |
|
448 | self.proComEndDate.addItem(i) | |
448 |
|
449 | |||
449 | if self.proComEndDate.count() - stopIndex - 1 >= 0: |
|
450 | if self.proComEndDate.count() - stopIndex - 1 >= 0: | |
450 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) |
|
451 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - stopIndex - 1) | |
451 | else: |
|
452 | else: | |
452 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
453 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
453 |
|
454 | |||
454 | @pyqtSignature("int") |
|
455 | @pyqtSignature("int") | |
455 | def on_proComEndDate_activated(self, index): |
|
456 | def on_proComEndDate_activated(self, index): | |
456 | """ |
|
457 | """ | |
457 | SELECCION DEL RANGO DE FECHAS-END DATE |
|
458 | SELECCION DEL RANGO DE FECHAS-END DATE | |
458 | """ |
|
459 | """ | |
459 | pass |
|
460 | pass | |
460 |
|
461 | |||
461 | @pyqtSignature("") |
|
462 | @pyqtSignature("") | |
462 | def on_proOk_clicked(self): |
|
463 | def on_proOk_clicked(self): | |
463 | """ |
|
464 | """ | |
464 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
465 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. | |
465 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
466 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 | |
466 | """ |
|
467 | """ | |
467 |
|
468 | |||
468 | self._disable_play_button() |
|
469 | self._disable_play_button() | |
469 | self._disable_save_button() |
|
470 | self._disable_save_button() | |
470 |
|
471 | |||
471 | self.console.clear() |
|
472 | self.console.clear() | |
472 |
|
473 | |||
473 | if self.create: |
|
474 | if self.create: | |
474 |
|
475 | |||
475 | projectId = self.__getNewProjectId() |
|
476 | projectId = self.__getNewProjectId() | |
476 |
|
477 | |||
477 | if not projectId: |
|
478 | if not projectId: | |
478 | return 0 |
|
479 | return 0 | |
479 |
|
480 | |||
480 | projectObjView = self.createProjectView(projectId) |
|
481 | projectObjView = self.createProjectView(projectId) | |
481 |
|
482 | |||
482 | if not projectObjView: |
|
483 | if not projectObjView: | |
483 | return 0 |
|
484 | return 0 | |
484 |
|
485 | |||
485 | self.create = False |
|
486 | self.create = False | |
486 |
|
487 | |||
487 | readUnitObj = self.createReadUnitView(projectObjView) |
|
488 | readUnitObj = self.createReadUnitView(projectObjView) | |
488 |
|
489 | |||
489 | if not readUnitObj: |
|
490 | if not readUnitObj: | |
490 | return 0 |
|
491 | return 0 | |
491 |
|
492 | |||
492 | else: |
|
493 | else: | |
493 | projectObjView = self.updateProjectView() |
|
494 | projectObjView = self.updateProjectView() | |
494 |
|
495 | |||
495 | if not projectObjView: |
|
496 | if not projectObjView: | |
496 | return 0 |
|
497 | return 0 | |
497 |
|
498 | |||
498 | projectId = projectObjView.getId() |
|
499 | projectId = projectObjView.getId() | |
499 | idReadUnit = projectObjView.getReadUnitId() |
|
500 | idReadUnit = projectObjView.getReadUnitId() | |
500 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
501 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) | |
501 |
|
502 | |||
502 | if not readUnitObj: |
|
503 | if not readUnitObj: | |
503 | return 0 |
|
504 | return 0 | |
504 |
|
505 | |||
505 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
506 | self.__itemTreeDict[projectId].setText(projectObjView.name) | |
506 | # Project Properties |
|
507 | # Project Properties | |
507 | self.refreshProjectProperties(projectObjView) |
|
508 | self.refreshProjectProperties(projectObjView) | |
508 | # Disable tabProject after finish the creation |
|
509 | # Disable tabProject after finish the creation | |
509 |
|
510 | |||
510 | self._enable_play_button() |
|
511 | self._enable_play_button() | |
511 | self._enable_save_button() |
|
512 | self._enable_save_button() | |
512 |
|
513 | |||
513 | self.console.clear() |
|
514 | self.console.clear() | |
514 | self.console.append("The project parameters were validated") |
|
515 | self.console.append("The project parameters were validated") | |
515 |
|
516 | |||
516 | return 1 |
|
517 | return 1 | |
517 |
|
518 | |||
518 | @pyqtSignature("") |
|
519 | @pyqtSignature("") | |
519 | def on_proClear_clicked(self): |
|
520 | def on_proClear_clicked(self): | |
520 |
|
521 | |||
521 | self.console.clear() |
|
522 | self.console.clear() | |
522 |
|
523 | |||
523 | @pyqtSignature("int") |
|
524 | @pyqtSignature("int") | |
524 | def on_volOpCebChannels_stateChanged(self, p0): |
|
525 | def on_volOpCebChannels_stateChanged(self, p0): | |
525 | """ |
|
526 | """ | |
526 | Check Box habilita operaciones de SelecciοΏ½n de Canales |
|
527 | Check Box habilita operaciones de SelecciοΏ½n de Canales | |
527 | """ |
|
528 | """ | |
528 | if p0 == 2: |
|
529 | if p0 == 2: | |
529 | self.volOpComChannels.setEnabled(True) |
|
530 | self.volOpComChannels.setEnabled(True) | |
530 | self.volOpChannel.setEnabled(True) |
|
531 | self.volOpChannel.setEnabled(True) | |
531 |
|
532 | |||
532 | if p0 == 0: |
|
533 | if p0 == 0: | |
533 | self.volOpComChannels.setEnabled(False) |
|
534 | self.volOpComChannels.setEnabled(False) | |
534 | self.volOpChannel.setEnabled(False) |
|
535 | self.volOpChannel.setEnabled(False) | |
535 | self.volOpChannel.clear() |
|
536 | self.volOpChannel.clear() | |
536 |
|
537 | |||
537 | @pyqtSignature("int") |
|
538 | @pyqtSignature("int") | |
538 | def on_volOpCebHeights_stateChanged(self, p0): |
|
539 | def on_volOpCebHeights_stateChanged(self, p0): | |
539 | """ |
|
540 | """ | |
540 | Check Box habilita operaciones de SelecciοΏ½n de Alturas |
|
541 | Check Box habilita operaciones de SelecciοΏ½n de Alturas | |
541 | """ |
|
542 | """ | |
542 | if p0 == 2: |
|
543 | if p0 == 2: | |
543 | self.volOpHeights.setEnabled(True) |
|
544 | self.volOpHeights.setEnabled(True) | |
544 | self.volOpComHeights.setEnabled(True) |
|
545 | self.volOpComHeights.setEnabled(True) | |
545 |
|
546 | |||
546 | if p0 == 0: |
|
547 | if p0 == 0: | |
547 | self.volOpHeights.setEnabled(False) |
|
548 | self.volOpHeights.setEnabled(False) | |
548 | self.volOpHeights.clear() |
|
549 | self.volOpHeights.clear() | |
549 | self.volOpComHeights.setEnabled(False) |
|
550 | self.volOpComHeights.setEnabled(False) | |
550 |
|
551 | |||
551 | @pyqtSignature("int") |
|
552 | @pyqtSignature("int") | |
552 | def on_volOpCebFilter_stateChanged(self, p0): |
|
553 | def on_volOpCebFilter_stateChanged(self, p0): | |
553 | """ |
|
554 | """ | |
554 | Name='Decoder', optype='other' |
|
555 | Name='Decoder', optype='other' | |
555 | """ |
|
556 | """ | |
556 | if p0 == 2: |
|
557 | if p0 == 2: | |
557 | self.volOpFilter.setEnabled(True) |
|
558 | self.volOpFilter.setEnabled(True) | |
558 |
|
559 | |||
559 | if p0 == 0: |
|
560 | if p0 == 0: | |
560 | self.volOpFilter.setEnabled(False) |
|
561 | self.volOpFilter.setEnabled(False) | |
561 | self.volOpFilter.clear() |
|
562 | self.volOpFilter.clear() | |
562 |
|
563 | |||
563 | @pyqtSignature("int") |
|
564 | @pyqtSignature("int") | |
564 | def on_volOpCebProfile_stateChanged(self, p0): |
|
565 | def on_volOpCebProfile_stateChanged(self, p0): | |
565 | """ |
|
566 | """ | |
566 | Check Box habilita ingreso del rango de Perfiles |
|
567 | Check Box habilita ingreso del rango de Perfiles | |
567 | """ |
|
568 | """ | |
568 | if p0 == 2: |
|
569 | if p0 == 2: | |
569 | self.volOpComProfile.setEnabled(True) |
|
570 | self.volOpComProfile.setEnabled(True) | |
570 | self.volOpProfile.setEnabled(True) |
|
571 | self.volOpProfile.setEnabled(True) | |
571 |
|
572 | |||
572 | if p0 == 0: |
|
573 | if p0 == 0: | |
573 | self.volOpComProfile.setEnabled(False) |
|
574 | self.volOpComProfile.setEnabled(False) | |
574 | self.volOpProfile.setEnabled(False) |
|
575 | self.volOpProfile.setEnabled(False) | |
575 | self.volOpProfile.clear() |
|
576 | self.volOpProfile.clear() | |
576 |
|
577 | |||
577 | @pyqtSignature("int") |
|
578 | @pyqtSignature("int") | |
578 | def on_volOpComProfile_activated(self, index): |
|
579 | def on_volOpComProfile_activated(self, index): | |
579 | """ |
|
580 | """ | |
580 | Check Box habilita ingreso del rango de Perfiles |
|
581 | Check Box habilita ingreso del rango de Perfiles | |
581 | """ |
|
582 | """ | |
582 | #Profile List |
|
583 | #Profile List | |
583 | if index == 0: |
|
584 | if index == 0: | |
584 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') |
|
585 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
585 |
|
586 | |||
586 | #Profile Range |
|
587 | #Profile Range | |
587 | if index == 1: |
|
588 | if index == 1: | |
588 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') |
|
589 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
589 |
|
590 | |||
590 | #Profile Range List |
|
591 | #Profile Range List | |
591 | if index == 2: |
|
592 | if index == 2: | |
592 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') |
|
593 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
593 |
|
594 | |||
594 | @pyqtSignature("int") |
|
595 | @pyqtSignature("int") | |
595 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
596 | def on_volOpCebDecodification_stateChanged(self, p0): | |
596 | """ |
|
597 | """ | |
597 | Check Box habilita |
|
598 | Check Box habilita | |
598 | """ |
|
599 | """ | |
599 | if p0 == 2: |
|
600 | if p0 == 2: | |
600 | self.volOpComCode.setEnabled(True) |
|
601 | self.volOpComCode.setEnabled(True) | |
601 | self.volOpComMode.setEnabled(True) |
|
602 | self.volOpComMode.setEnabled(True) | |
602 | if p0 == 0: |
|
603 | if p0 == 0: | |
603 | self.volOpComCode.setEnabled(False) |
|
604 | self.volOpComCode.setEnabled(False) | |
604 | self.volOpComMode.setEnabled(False) |
|
605 | self.volOpComMode.setEnabled(False) | |
605 |
|
606 | |||
606 | @pyqtSignature("int") |
|
607 | @pyqtSignature("int") | |
607 | def on_volOpComCode_activated(self, index): |
|
608 | def on_volOpComCode_activated(self, index): | |
608 | """ |
|
609 | """ | |
609 | Check Box habilita ingreso |
|
610 | Check Box habilita ingreso | |
610 | """ |
|
611 | """ | |
611 | if index == 13: |
|
612 | if index == 13: | |
612 | self.volOpCode.setEnabled(True) |
|
613 | self.volOpCode.setEnabled(True) | |
613 | else: |
|
614 | else: | |
614 | self.volOpCode.setEnabled(False) |
|
615 | self.volOpCode.setEnabled(False) | |
615 |
|
616 | |||
616 | if index == 0: |
|
617 | if index == 0: | |
617 | code = '' |
|
618 | code = '' | |
618 | self.volOpCode.setText(str(code)) |
|
619 | self.volOpCode.setText(str(code)) | |
619 | return |
|
620 | return | |
620 |
|
621 | |||
621 | if index == 1: |
|
622 | if index == 1: | |
622 | code = '(1,1,-1)' |
|
623 | code = '(1,1,-1)' | |
623 | nCode = '1' |
|
624 | nCode = '1' | |
624 | nBaud = '3' |
|
625 | nBaud = '3' | |
625 | if index == 2: |
|
626 | if index == 2: | |
626 | code = '(1,1,-1,1)' |
|
627 | code = '(1,1,-1,1)' | |
627 | nCode = '1' |
|
628 | nCode = '1' | |
628 | nBaud = '4' |
|
629 | nBaud = '4' | |
629 | if index == 3: |
|
630 | if index == 3: | |
630 | code = '(1,1,1,-1,1)' |
|
631 | code = '(1,1,1,-1,1)' | |
631 | nCode = '1' |
|
632 | nCode = '1' | |
632 | nBaud = '5' |
|
633 | nBaud = '5' | |
633 | if index == 4: |
|
634 | if index == 4: | |
634 | code = '(1,1,1,-1,-1,1,-1)' |
|
635 | code = '(1,1,1,-1,-1,1,-1)' | |
635 | nCode = '1' |
|
636 | nCode = '1' | |
636 | nBaud = '7' |
|
637 | nBaud = '7' | |
637 | if index == 5: |
|
638 | if index == 5: | |
638 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' |
|
639 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
639 | nCode = '1' |
|
640 | nCode = '1' | |
640 | nBaud = '11' |
|
641 | nBaud = '11' | |
641 | if index == 6: |
|
642 | if index == 6: | |
642 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' |
|
643 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
643 | nCode = '1' |
|
644 | nCode = '1' | |
644 | nBaud = '13' |
|
645 | nBaud = '13' | |
645 | if index == 7: |
|
646 | if index == 7: | |
646 | code = '(1,1,-1,-1,-1,1)' |
|
647 | code = '(1,1,-1,-1,-1,1)' | |
647 | nCode = '2' |
|
648 | nCode = '2' | |
648 | nBaud = '3' |
|
649 | nBaud = '3' | |
649 | if index == 8: |
|
650 | if index == 8: | |
650 | code = '(1,1,-1,1,-1,-1,1,-1)' |
|
651 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
651 | nCode = '2' |
|
652 | nCode = '2' | |
652 | nBaud = '4' |
|
653 | nBaud = '4' | |
653 | if index == 9: |
|
654 | if index == 9: | |
654 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' |
|
655 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
655 | nCode = '2' |
|
656 | nCode = '2' | |
656 | nBaud = '5' |
|
657 | nBaud = '5' | |
657 | if index == 10: |
|
658 | if index == 10: | |
658 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' |
|
659 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
659 | nCode = '2' |
|
660 | nCode = '2' | |
660 | nBaud = '7' |
|
661 | nBaud = '7' | |
661 | if index == 11: |
|
662 | if index == 11: | |
662 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' |
|
663 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
663 | nCode = '2' |
|
664 | nCode = '2' | |
664 | nBaud = '11' |
|
665 | nBaud = '11' | |
665 | if index == 12: |
|
666 | if index == 12: | |
666 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1)' |
|
667 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1,1,1,-1,-1,1,-1,1,-1)' | |
667 | nCode = '2' |
|
668 | nCode = '2' | |
668 | nBaud = '13' |
|
669 | nBaud = '13' | |
669 |
|
670 | |||
670 | code = ast.literal_eval(code) |
|
671 | code = ast.literal_eval(code) | |
671 | nCode = int(nCode) |
|
672 | nCode = int(nCode) | |
672 | nBaud = int(nBaud) |
|
673 | nBaud = int(nBaud) | |
673 |
|
674 | |||
674 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
675 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
675 |
|
676 | |||
676 | self.volOpCode.setText(str(code)) |
|
677 | self.volOpCode.setText(str(code)) | |
677 |
|
678 | |||
678 | @pyqtSignature("int") |
|
679 | @pyqtSignature("int") | |
679 | def on_volOpCebFlip_stateChanged(self, p0): |
|
680 | def on_volOpCebFlip_stateChanged(self, p0): | |
680 | """ |
|
681 | """ | |
681 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
682 | Check Box habilita ingresode del numero de Integraciones a realizar | |
682 | """ |
|
683 | """ | |
683 | if p0 == 2: |
|
684 | if p0 == 2: | |
684 | self.volOpFlip.setEnabled(True) |
|
685 | self.volOpFlip.setEnabled(True) | |
685 | if p0 == 0: |
|
686 | if p0 == 0: | |
686 | self.volOpFlip.setEnabled(False) |
|
687 | self.volOpFlip.setEnabled(False) | |
687 | self.volOpFlip.clear() |
|
688 | self.volOpFlip.clear() | |
688 |
|
689 | |||
689 | @pyqtSignature("int") |
|
690 | @pyqtSignature("int") | |
690 | def on_volOpCebCohInt_stateChanged(self, p0): |
|
691 | def on_volOpCebCohInt_stateChanged(self, p0): | |
691 | """ |
|
692 | """ | |
692 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
693 | Check Box habilita ingresode del numero de Integraciones a realizar | |
693 | """ |
|
694 | """ | |
694 | if p0 == 2: |
|
695 | if p0 == 2: | |
695 | self.volOpCohInt.setEnabled(True) |
|
696 | self.volOpCohInt.setEnabled(True) | |
696 | if p0 == 0: |
|
697 | if p0 == 0: | |
697 | self.volOpCohInt.setEnabled(False) |
|
698 | self.volOpCohInt.setEnabled(False) | |
698 | self.volOpCohInt.clear() |
|
699 | self.volOpCohInt.clear() | |
699 |
|
700 | |||
700 | @pyqtSignature("int") |
|
701 | @pyqtSignature("int") | |
701 | def on_volOpCebRadarfrequency_stateChanged(self, p0): |
|
702 | def on_volOpCebRadarfrequency_stateChanged(self, p0): | |
702 | """ |
|
703 | """ | |
703 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
704 | Check Box habilita ingresode del numero de Integraciones a realizar | |
704 | """ |
|
705 | """ | |
705 | if p0 == 2: |
|
706 | if p0 == 2: | |
706 | self.volOpRadarfrequency.setEnabled(True) |
|
707 | self.volOpRadarfrequency.setEnabled(True) | |
707 | if p0 == 0: |
|
708 | if p0 == 0: | |
708 | self.volOpRadarfrequency.clear() |
|
709 | self.volOpRadarfrequency.clear() | |
709 | self.volOpRadarfrequency.setEnabled(False) |
|
710 | self.volOpRadarfrequency.setEnabled(False) | |
710 |
|
711 | |||
711 | @pyqtSignature("") |
|
712 | @pyqtSignature("") | |
712 | def on_volOutputToolPath_clicked(self): |
|
713 | def on_volOutputToolPath_clicked(self): | |
713 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
714 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
714 | self.volOutputPath.setText(dirOutPath) |
|
715 | self.volOutputPath.setText(dirOutPath) | |
715 |
|
716 | |||
716 | @pyqtSignature("") |
|
717 | @pyqtSignature("") | |
717 | def on_specOutputToolPath_clicked(self): |
|
718 | def on_specOutputToolPath_clicked(self): | |
718 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
719 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
719 | self.specOutputPath.setText(dirOutPath) |
|
720 | self.specOutputPath.setText(dirOutPath) | |
720 |
|
721 | |||
721 | @pyqtSignature("") |
|
722 | @pyqtSignature("") | |
722 | def on_specHeisOutputToolPath_clicked(self): |
|
723 | def on_specHeisOutputToolPath_clicked(self): | |
723 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
724 | dirOutPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
724 | self.specHeisOutputPath.setText(dirOutPath) |
|
725 | self.specHeisOutputPath.setText(dirOutPath) | |
725 |
|
726 | |||
726 | @pyqtSignature("") |
|
727 | @pyqtSignature("") | |
727 | def on_specHeisOutputMetadaToolPath_clicked(self): |
|
728 | def on_specHeisOutputMetadaToolPath_clicked(self): | |
728 |
|
729 | |||
729 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
730 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) | |
730 | self.specHeisOutputMetada.setText(filename) |
|
731 | self.specHeisOutputMetada.setText(filename) | |
731 |
|
732 | |||
732 | @pyqtSignature("") |
|
733 | @pyqtSignature("") | |
733 | def on_volOpOk_clicked(self): |
|
734 | def on_volOpOk_clicked(self): | |
734 | """ |
|
735 | """ | |
735 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO |
|
736 | BUSCA EN LA LISTA DE OPERACIONES DEL TIPO VOLTAJE Y LES AοΏ½ADE EL PARAMETRO ADECUADO ESPERANDO LA ACEPTACION DEL USUARIO | |
736 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML |
|
737 | PARA AGREGARLO AL ARCHIVO DE CONFIGURACION XML | |
737 | """ |
|
738 | """ | |
738 |
|
739 | |||
739 | checkPath = False |
|
740 | checkPath = False | |
740 |
|
741 | |||
741 | self._disable_play_button() |
|
742 | self._disable_play_button() | |
742 | self._disable_save_button() |
|
743 | self._disable_save_button() | |
743 |
|
744 | |||
744 | self.console.clear() |
|
745 | self.console.clear() | |
745 | self.console.append("Checking input parameters ...") |
|
746 | self.console.append("Checking input parameters ...") | |
746 |
|
747 | |||
747 | puObj = self.getSelectedItemObj() |
|
748 | puObj = self.getSelectedItemObj() | |
748 | puObj.removeOperations() |
|
749 | puObj.removeOperations() | |
749 |
|
750 | |||
750 | if self.volOpCebRadarfrequency.isChecked(): |
|
751 | if self.volOpCebRadarfrequency.isChecked(): | |
751 | value = str(self.volOpRadarfrequency.text()) |
|
752 | value = str(self.volOpRadarfrequency.text()) | |
752 | format = 'float' |
|
753 | format = 'float' | |
753 | name_operation = 'setRadarFrequency' |
|
754 | name_operation = 'setRadarFrequency' | |
754 | name_parameter = 'frequency' |
|
755 | name_parameter = 'frequency' | |
755 | if not value == "": |
|
756 | if not value == "": | |
756 | try: |
|
757 | try: | |
757 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 |
|
758 | radarfreq = float(self.volOpRadarfrequency.text())*1e6 | |
758 | except: |
|
759 | except: | |
759 | self.console.clear() |
|
760 | self.console.clear() | |
760 | self.console.append("Invalid value '%s' for Radar Frequency" %value) |
|
761 | self.console.append("Invalid value '%s' for Radar Frequency" %value) | |
761 | return 0 |
|
762 | return 0 | |
762 |
|
763 | |||
763 | opObj = puObj.addOperation(name=name_operation) |
|
764 | opObj = puObj.addOperation(name=name_operation) | |
764 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): |
|
765 | if not opObj.addParameter(name=name_parameter, value=radarfreq, format=format): | |
765 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
766 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
766 | return 0 |
|
767 | return 0 | |
767 |
|
768 | |||
768 | if self.volOpCebChannels.isChecked(): |
|
769 | if self.volOpCebChannels.isChecked(): | |
769 | value = str(self.volOpChannel.text()) |
|
770 | value = str(self.volOpChannel.text()) | |
770 |
|
771 | |||
771 | if value == "": |
|
772 | if value == "": | |
772 | print "Please fill channel list" |
|
773 | print "Please fill channel list" | |
773 | return 0 |
|
774 | return 0 | |
774 |
|
775 | |||
775 | format = 'intlist' |
|
776 | format = 'intlist' | |
776 | if self.volOpComChannels.currentIndex() == 0: |
|
777 | if self.volOpComChannels.currentIndex() == 0: | |
777 | name_operation = "selectChannels" |
|
778 | name_operation = "selectChannels" | |
778 | name_parameter = 'channelList' |
|
779 | name_parameter = 'channelList' | |
779 | else: |
|
780 | else: | |
780 | name_operation = "selectChannelsByIndex" |
|
781 | name_operation = "selectChannelsByIndex" | |
781 | name_parameter = 'channelIndexList' |
|
782 | name_parameter = 'channelIndexList' | |
782 |
|
783 | |||
783 | opObj = puObj.addOperation(name=name_operation) |
|
784 | opObj = puObj.addOperation(name=name_operation) | |
784 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
785 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
785 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
786 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
786 | return 0 |
|
787 | return 0 | |
787 |
|
788 | |||
788 | if self.volOpCebHeights.isChecked(): |
|
789 | if self.volOpCebHeights.isChecked(): | |
789 | value = str(self.volOpHeights.text()) |
|
790 | value = str(self.volOpHeights.text()) | |
790 |
|
791 | |||
791 | if value == "": |
|
792 | if value == "": | |
792 | print "Please fill height range" |
|
793 | print "Please fill height range" | |
793 | return 0 |
|
794 | return 0 | |
794 |
|
795 | |||
795 | valueList = value.split(',') |
|
796 | valueList = value.split(',') | |
796 |
|
797 | |||
797 | if self.volOpComHeights.currentIndex() == 0: |
|
798 | if self.volOpComHeights.currentIndex() == 0: | |
798 | format = 'float' |
|
799 | format = 'float' | |
799 | name_operation = 'selectHeights' |
|
800 | name_operation = 'selectHeights' | |
800 | name_parameter1 = 'minHei' |
|
801 | name_parameter1 = 'minHei' | |
801 | name_parameter2 = 'maxHei' |
|
802 | name_parameter2 = 'maxHei' | |
802 | else: |
|
803 | else: | |
803 | format = 'int' |
|
804 | format = 'int' | |
804 | name_operation = 'selectHeightsByIndex' |
|
805 | name_operation = 'selectHeightsByIndex' | |
805 | name_parameter1 = 'minIndex' |
|
806 | name_parameter1 = 'minIndex' | |
806 | name_parameter2 = 'maxIndex' |
|
807 | name_parameter2 = 'maxIndex' | |
807 |
|
808 | |||
808 | opObj = puObj.addOperation(name=name_operation) |
|
809 | opObj = puObj.addOperation(name=name_operation) | |
809 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) |
|
810 | opObj.addParameter(name=name_parameter1, value=valueList[0], format=format) | |
810 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) |
|
811 | opObj.addParameter(name=name_parameter2, value=valueList[1], format=format) | |
811 |
|
812 | |||
812 | if self.volOpCebFilter.isChecked(): |
|
813 | if self.volOpCebFilter.isChecked(): | |
813 | value = str(self.volOpFilter.text()) |
|
814 | value = str(self.volOpFilter.text()) | |
814 | if value == "": |
|
815 | if value == "": | |
815 | print "Please fill filter value" |
|
816 | print "Please fill filter value" | |
816 | return 0 |
|
817 | return 0 | |
817 |
|
818 | |||
818 | format = 'int' |
|
819 | format = 'int' | |
819 | name_operation = 'filterByHeights' |
|
820 | name_operation = 'filterByHeights' | |
820 | name_parameter = 'window' |
|
821 | name_parameter = 'window' | |
821 | opObj = puObj.addOperation(name=name_operation) |
|
822 | opObj = puObj.addOperation(name=name_operation) | |
822 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
823 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
823 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
824 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
824 | return 0 |
|
825 | return 0 | |
825 |
|
826 | |||
826 | if self.volOpCebProfile.isChecked(): |
|
827 | if self.volOpCebProfile.isChecked(): | |
827 | value = str(self.volOpProfile.text()) |
|
828 | value = str(self.volOpProfile.text()) | |
828 |
|
829 | |||
829 | if value == "": |
|
830 | if value == "": | |
830 | print "Please fill profile value" |
|
831 | print "Please fill profile value" | |
831 | return 0 |
|
832 | return 0 | |
832 |
|
833 | |||
833 | format = 'intlist' |
|
834 | format = 'intlist' | |
834 | optype = 'other' |
|
835 | optype = 'other' | |
835 | name_operation = 'ProfileSelector' |
|
836 | name_operation = 'ProfileSelector' | |
836 | if self.volOpComProfile.currentIndex() == 0: |
|
837 | if self.volOpComProfile.currentIndex() == 0: | |
837 | name_parameter = 'profileList' |
|
838 | name_parameter = 'profileList' | |
838 | if self.volOpComProfile.currentIndex() == 1: |
|
839 | if self.volOpComProfile.currentIndex() == 1: | |
839 | name_parameter = 'profileRangeList' |
|
840 | name_parameter = 'profileRangeList' | |
840 | if self.volOpComProfile.currentIndex() == 2: |
|
841 | if self.volOpComProfile.currentIndex() == 2: | |
841 | name_parameter = 'rangeList' |
|
842 | name_parameter = 'rangeList' | |
842 |
|
843 | |||
843 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
844 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') | |
844 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
845 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
845 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) |
|
846 | self.console.append("Invalid value '%s' for %s" %(value,name_parameter)) | |
846 | return 0 |
|
847 | return 0 | |
847 |
|
848 | |||
848 | if self.volOpCebDecodification.isChecked(): |
|
849 | if self.volOpCebDecodification.isChecked(): | |
849 | name_operation = 'Decoder' |
|
850 | name_operation = 'Decoder' | |
850 | opObj = puObj.addOperation(name=name_operation, optype='other') |
|
851 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
851 |
|
852 | |||
852 | #User defined |
|
853 | #User defined | |
853 | nBaud = None |
|
854 | nBaud = None | |
854 | nCode = None |
|
855 | nCode = None | |
855 |
|
856 | |||
856 | code = str(self.volOpCode.text()) |
|
857 | code = str(self.volOpCode.text()) | |
857 | try: |
|
858 | try: | |
858 | code_tmp = ast.literal_eval(code) |
|
859 | code_tmp = ast.literal_eval(code) | |
859 | except: |
|
860 | except: | |
860 | code_tmp = [] |
|
861 | code_tmp = [] | |
861 |
|
862 | |||
862 | if len(code_tmp) > 0: |
|
863 | if len(code_tmp) > 0: | |
863 |
|
864 | |||
864 | if type(code_tmp) not in (tuple, list): |
|
865 | if type(code_tmp) not in (tuple, list): | |
865 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
866 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
866 | return 0 |
|
867 | return 0 | |
867 |
|
868 | |||
868 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] |
|
869 | if len(code_tmp) > 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1], [1,1,-1] ] | |
869 | nBaud = len(code_tmp[0]) |
|
870 | nBaud = len(code_tmp[0]) | |
870 | nCode = len(code_tmp) |
|
871 | nCode = len(code_tmp) | |
871 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] |
|
872 | elif len(code_tmp) == 1 and type(code_tmp[0]) in (tuple, list): #[ [1,-1,1] ] | |
872 | nBaud = len(code_tmp[0]) |
|
873 | nBaud = len(code_tmp[0]) | |
873 | nCode = 1 |
|
874 | nCode = 1 | |
874 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) |
|
875 | elif type(code_tmp[0]) in (int, float): #[1,-1,1] or (1,-1,1) | |
875 | nBaud = len(code_tmp) |
|
876 | nBaud = len(code_tmp) | |
876 | nCode = 1 |
|
877 | nCode = 1 | |
877 | else: |
|
878 | else: | |
878 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") |
|
879 | self.console.append("Please write a right value for Code (Exmaple: [1,1,-1], [1,-1,1])") | |
879 | return 0 |
|
880 | return 0 | |
880 |
|
881 | |||
881 | if not nBaud or not nCode: |
|
882 | if not nBaud or not nCode: | |
882 | self.console.append("Please write a right value for Code") |
|
883 | self.console.append("Please write a right value for Code") | |
883 | return 0 |
|
884 | return 0 | |
884 |
|
885 | |||
885 | code = code.replace("(", "") |
|
886 | code = code.replace("(", "") | |
886 | code = code.replace(")", "") |
|
887 | code = code.replace(")", "") | |
887 | code = code.replace("[", "") |
|
888 | code = code.replace("[", "") | |
888 | code = code.replace("]", "") |
|
889 | code = code.replace("]", "") | |
889 |
|
890 | |||
890 | if not opObj.addParameter(name='code', value=code, format='intlist'): |
|
891 | if not opObj.addParameter(name='code', value=code, format='intlist'): | |
891 | self.console.append("Please write a right value for Code") |
|
892 | self.console.append("Please write a right value for Code") | |
892 | return 0 |
|
893 | return 0 | |
893 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): |
|
894 | if not opObj.addParameter(name='nCode', value=nCode, format='int'): | |
894 | self.console.append("Please write a right value for Code") |
|
895 | self.console.append("Please write a right value for Code") | |
895 | return 0 |
|
896 | return 0 | |
896 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): |
|
897 | if not opObj.addParameter(name='nBaud', value=nBaud, format='int'): | |
897 | self.console.append("Please write a right value for Code") |
|
898 | self.console.append("Please write a right value for Code") | |
898 | return 0 |
|
899 | return 0 | |
899 |
|
900 | |||
900 | name_parameter = 'mode' |
|
901 | name_parameter = 'mode' | |
901 | format = 'int' |
|
902 | format = 'int' | |
902 |
|
903 | |||
903 | value = str(self.volOpComMode.currentIndex()) |
|
904 | value = str(self.volOpComMode.currentIndex()) | |
904 |
|
905 | |||
905 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
906 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
906 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
907 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
907 | return 0 |
|
908 | return 0 | |
908 |
|
909 | |||
909 |
|
910 | |||
910 | if self.volOpCebFlip.isChecked(): |
|
911 | if self.volOpCebFlip.isChecked(): | |
911 | name_operation = 'deFlip' |
|
912 | name_operation = 'deFlip' | |
912 | optype = 'self' |
|
913 | optype = 'self' | |
913 |
|
914 | |||
914 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
915 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
915 |
|
916 | |||
916 | name_parameter = 'channelList' |
|
917 | name_parameter = 'channelList' | |
917 | format = 'intlist' |
|
918 | format = 'intlist' | |
918 | value = str(self.volOpFlip.text()) |
|
919 | value = str(self.volOpFlip.text()) | |
919 |
|
920 | |||
920 | if value != "": |
|
921 | if value != "": | |
921 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
922 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
922 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
923 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
923 | return 0 |
|
924 | return 0 | |
924 |
|
925 | |||
925 | if self.volOpCebCohInt.isChecked(): |
|
926 | if self.volOpCebCohInt.isChecked(): | |
926 | name_operation = 'CohInt' |
|
927 | name_operation = 'CohInt' | |
927 | optype = 'other' |
|
928 | optype = 'other' | |
928 | value = str(self.volOpCohInt.text()) |
|
929 | value = str(self.volOpCohInt.text()) | |
929 |
|
930 | |||
930 | if value == "": |
|
931 | if value == "": | |
931 | print "Please fill number of coherent integrations" |
|
932 | print "Please fill number of coherent integrations" | |
932 | return 0 |
|
933 | return 0 | |
933 |
|
934 | |||
934 | name_parameter = 'n' |
|
935 | name_parameter = 'n' | |
935 | format = 'int' |
|
936 | format = 'int' | |
936 |
|
937 | |||
937 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
938 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
938 |
|
939 | |||
939 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
940 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
940 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
941 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
941 | return 0 |
|
942 | return 0 | |
942 |
|
943 | |||
943 | if self.volGraphCebshow.isChecked(): |
|
944 | if self.volGraphCebshow.isChecked(): | |
944 | name_operation = 'Scope' |
|
945 | name_operation = 'Scope' | |
945 | optype = 'other' |
|
946 | optype = 'other' | |
946 | name_parameter = 'type' |
|
947 | name_parameter = 'type' | |
947 | value = 'Scope' |
|
948 | value = 'Scope' | |
948 | if self.idImagscope == 0: |
|
949 | if self.idImagscope == 0: | |
949 | self.idImagscope = 100 |
|
950 | self.idImagscope = 100 | |
950 | else: |
|
951 | else: | |
951 | self.idImagscope = self.idImagscope + 1 |
|
952 | self.idImagscope = self.idImagscope + 1 | |
952 |
|
953 | |||
953 | name_parameter1 = 'id' |
|
954 | name_parameter1 = 'id' | |
954 | value1 = int(self.idImagscope) |
|
955 | value1 = int(self.idImagscope) | |
955 | format1 = 'int' |
|
956 | format1 = 'int' | |
956 | format = 'str' |
|
957 | format = 'str' | |
957 |
|
958 | |||
958 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
959 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
959 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
960 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
960 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) |
|
961 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
961 |
|
962 | |||
962 | channelList = str(self.volGraphChannelList.text()).replace(" ","") |
|
963 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
963 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") |
|
964 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
964 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") |
|
965 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
965 |
|
966 | |||
966 | if channelList: |
|
967 | if channelList: | |
967 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
968 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
968 |
|
969 | |||
969 | if xvalue: |
|
970 | if xvalue: | |
970 | xvalueList = xvalue.split(',') |
|
971 | xvalueList = xvalue.split(',') | |
971 | try: |
|
972 | try: | |
972 | value0 = float(xvalueList[0]) |
|
973 | value0 = float(xvalueList[0]) | |
973 | value1 = float(xvalueList[1]) |
|
974 | value1 = float(xvalueList[1]) | |
974 | except: |
|
975 | except: | |
975 | return 0 |
|
976 | return 0 | |
976 | opObj.addParameter(name='xmin', value=value0, format='float') |
|
977 | opObj.addParameter(name='xmin', value=value0, format='float') | |
977 | opObj.addParameter(name='xmax', value=value1, format='float') |
|
978 | opObj.addParameter(name='xmax', value=value1, format='float') | |
978 |
|
979 | |||
979 |
|
980 | |||
980 | if not yvalue == "": |
|
981 | if not yvalue == "": | |
981 | yvalueList = yvalue.split(",") |
|
982 | yvalueList = yvalue.split(",") | |
982 | try: |
|
983 | try: | |
983 | value0 = int(yvalueList[0]) |
|
984 | value0 = int(yvalueList[0]) | |
984 | value1 = int(yvalueList[1]) |
|
985 | value1 = int(yvalueList[1]) | |
985 | except: |
|
986 | except: | |
986 | return 0 |
|
987 | return 0 | |
987 |
|
988 | |||
988 | opObj.addParameter(name='ymin', value=value0, format='int') |
|
989 | opObj.addParameter(name='ymin', value=value0, format='int') | |
989 | opObj.addParameter(name='ymax', value=value1, format='int') |
|
990 | opObj.addParameter(name='ymax', value=value1, format='int') | |
990 |
|
991 | |||
991 | if self.volGraphCebSave.isChecked(): |
|
992 | if self.volGraphCebSave.isChecked(): | |
992 | checkPath = True |
|
993 | checkPath = True | |
993 | opObj.addParameter(name='save', value='1', format='int') |
|
994 | opObj.addParameter(name='save', value='1', format='int') | |
994 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') |
|
995 | opObj.addParameter(name='figpath', value=str(self.volGraphPath.text()), format='str') | |
995 | value = str(self.volGraphPrefix.text()).replace(" ","") |
|
996 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
996 | if value: |
|
997 | if value: | |
997 | opObj.addParameter(name='figfile', value=value, format='str') |
|
998 | opObj.addParameter(name='figfile', value=value, format='str') | |
998 |
|
999 | |||
999 | localfolder = None |
|
1000 | localfolder = None | |
1000 | if checkPath: |
|
1001 | if checkPath: | |
1001 | localfolder = str(self.volGraphPath.text()) |
|
1002 | localfolder = str(self.volGraphPath.text()) | |
1002 | if localfolder == '': |
|
1003 | if localfolder == '': | |
1003 | self.console.clear() |
|
1004 | self.console.clear() | |
1004 | self.console.append("Graphic path should be defined") |
|
1005 | self.console.append("Graphic path should be defined") | |
1005 | return 0 |
|
1006 | return 0 | |
1006 |
|
1007 | |||
1007 | # if something happend |
|
1008 | # if something happend | |
1008 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') |
|
1009 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Voltage') | |
1009 | if parms_ok: |
|
1010 | if parms_ok: | |
1010 | name_operation = 'VoltageWriter' |
|
1011 | name_operation = 'VoltageWriter' | |
1011 | optype = 'other' |
|
1012 | optype = 'other' | |
1012 | name_parameter1 = 'path' |
|
1013 | name_parameter1 = 'path' | |
1013 | name_parameter2 = 'blocksPerFile' |
|
1014 | name_parameter2 = 'blocksPerFile' | |
1014 | name_parameter3 = 'profilesPerBlock' |
|
1015 | name_parameter3 = 'profilesPerBlock' | |
1015 | value1 = output_path |
|
1016 | value1 = output_path | |
1016 | value2 = blocksperfile |
|
1017 | value2 = blocksperfile | |
1017 | value3 = profilesperblock |
|
1018 | value3 = profilesperblock | |
1018 | format = "int" |
|
1019 | format = "int" | |
1019 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1020 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1020 | opObj.addParameter(name=name_parameter1, value=value1) |
|
1021 | opObj.addParameter(name=name_parameter1, value=value1) | |
1021 | opObj.addParameter(name=name_parameter2, value=value2, format=format) |
|
1022 | opObj.addParameter(name=name_parameter2, value=value2, format=format) | |
1022 | opObj.addParameter(name=name_parameter3, value=value3, format=format) |
|
1023 | opObj.addParameter(name=name_parameter3, value=value3, format=format) | |
1023 |
|
1024 | |||
1024 | self.console.clear() |
|
1025 | self.console.clear() | |
1025 | try: |
|
1026 | try: | |
1026 | self.refreshPUProperties(puObj) |
|
1027 | self.refreshPUProperties(puObj) | |
1027 | except: |
|
1028 | except: | |
1028 | self.console.append("An error reading input parameters was found ...Check them!") |
|
1029 | self.console.append("An error reading input parameters was found ...Check them!") | |
1029 | return 0 |
|
1030 | return 0 | |
1030 |
|
1031 | |||
1031 | self.console.append("Save your project and press Play button to start signal processing") |
|
1032 | self.console.append("Save your project and press Play button to start signal processing") | |
1032 |
|
1033 | |||
1033 | self._enable_play_button() |
|
1034 | self._enable_play_button() | |
1034 | self._enable_save_button() |
|
1035 | self._enable_save_button() | |
1035 |
|
1036 | |||
1036 | return 1 |
|
1037 | return 1 | |
1037 |
|
1038 | |||
1038 | """ |
|
1039 | """ | |
1039 | Voltage Graph |
|
1040 | Voltage Graph | |
1040 | """ |
|
1041 | """ | |
1041 | @pyqtSignature("int") |
|
1042 | @pyqtSignature("int") | |
1042 | def on_volGraphCebSave_stateChanged(self, p0): |
|
1043 | def on_volGraphCebSave_stateChanged(self, p0): | |
1043 | """ |
|
1044 | """ | |
1044 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1045 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1045 | """ |
|
1046 | """ | |
1046 | if p0 == 2: |
|
1047 | if p0 == 2: | |
1047 | self.volGraphPath.setEnabled(True) |
|
1048 | self.volGraphPath.setEnabled(True) | |
1048 | self.volGraphPrefix.setEnabled(True) |
|
1049 | self.volGraphPrefix.setEnabled(True) | |
1049 | self.volGraphToolPath.setEnabled(True) |
|
1050 | self.volGraphToolPath.setEnabled(True) | |
1050 |
|
1051 | |||
1051 | if p0 == 0: |
|
1052 | if p0 == 0: | |
1052 | self.volGraphPath.setEnabled(False) |
|
1053 | self.volGraphPath.setEnabled(False) | |
1053 | self.volGraphPrefix.setEnabled(False) |
|
1054 | self.volGraphPrefix.setEnabled(False) | |
1054 | self.volGraphToolPath.setEnabled(False) |
|
1055 | self.volGraphToolPath.setEnabled(False) | |
1055 |
|
1056 | |||
1056 | @pyqtSignature("") |
|
1057 | @pyqtSignature("") | |
1057 | def on_volGraphToolPath_clicked(self): |
|
1058 | def on_volGraphToolPath_clicked(self): | |
1058 | """ |
|
1059 | """ | |
1059 | Donde se guardan los DATOS |
|
1060 | Donde se guardan los DATOS | |
1060 | """ |
|
1061 | """ | |
1061 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1062 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1062 | self.volGraphPath.setText(save_path) |
|
1063 | self.volGraphPath.setText(save_path) | |
1063 |
|
1064 | |||
1064 | if not os.path.exists(save_path): |
|
1065 | if not os.path.exists(save_path): | |
1065 | self.console.clear() |
|
1066 | self.console.clear() | |
1066 | self.console.append("Set a valid path") |
|
1067 | self.console.append("Set a valid path") | |
1067 | self.volGraphOk.setEnabled(False) |
|
1068 | self.volGraphOk.setEnabled(False) | |
1068 | return |
|
1069 | return | |
1069 |
|
1070 | |||
1070 | @pyqtSignature("int") |
|
1071 | @pyqtSignature("int") | |
1071 | def on_volGraphCebshow_stateChanged(self, p0): |
|
1072 | def on_volGraphCebshow_stateChanged(self, p0): | |
1072 | """ |
|
1073 | """ | |
1073 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1074 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1074 | """ |
|
1075 | """ | |
1075 | if p0 == 0: |
|
1076 | if p0 == 0: | |
1076 |
|
1077 | |||
1077 | self.volGraphChannelList.setEnabled(False) |
|
1078 | self.volGraphChannelList.setEnabled(False) | |
1078 | self.volGraphfreqrange.setEnabled(False) |
|
1079 | self.volGraphfreqrange.setEnabled(False) | |
1079 | self.volGraphHeightrange.setEnabled(False) |
|
1080 | self.volGraphHeightrange.setEnabled(False) | |
1080 | if p0 == 2: |
|
1081 | if p0 == 2: | |
1081 |
|
1082 | |||
1082 | self.volGraphChannelList.setEnabled(True) |
|
1083 | self.volGraphChannelList.setEnabled(True) | |
1083 | self.volGraphfreqrange.setEnabled(True) |
|
1084 | self.volGraphfreqrange.setEnabled(True) | |
1084 | self.volGraphHeightrange.setEnabled(True) |
|
1085 | self.volGraphHeightrange.setEnabled(True) | |
1085 |
|
1086 | |||
1086 | """ |
|
1087 | """ | |
1087 | Spectra operation |
|
1088 | Spectra operation | |
1088 | """ |
|
1089 | """ | |
1089 | @pyqtSignature("int") |
|
1090 | @pyqtSignature("int") | |
1090 | def on_specOpCebRadarfrequency_stateChanged(self, p0): |
|
1091 | def on_specOpCebRadarfrequency_stateChanged(self, p0): | |
1091 | """ |
|
1092 | """ | |
1092 | Check Box habilita ingresode del numero de Integraciones a realizar |
|
1093 | Check Box habilita ingresode del numero de Integraciones a realizar | |
1093 | """ |
|
1094 | """ | |
1094 | if p0 == 2: |
|
1095 | if p0 == 2: | |
1095 | self.specOpRadarfrequency.setEnabled(True) |
|
1096 | self.specOpRadarfrequency.setEnabled(True) | |
1096 | if p0 == 0: |
|
1097 | if p0 == 0: | |
1097 | self.specOpRadarfrequency.clear() |
|
1098 | self.specOpRadarfrequency.clear() | |
1098 | self.specOpRadarfrequency.setEnabled(False) |
|
1099 | self.specOpRadarfrequency.setEnabled(False) | |
1099 |
|
1100 | |||
1100 |
|
1101 | |||
1101 | @pyqtSignature("int") |
|
1102 | @pyqtSignature("int") | |
1102 | def on_specOpCebCrossSpectra_stateChanged(self, p0): |
|
1103 | def on_specOpCebCrossSpectra_stateChanged(self, p0): | |
1103 | """ |
|
1104 | """ | |
1104 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . |
|
1105 | Habilita la opcion de aοΏ½adir el parοΏ½metro CrossSpectra a la Unidad de Procesamiento . | |
1105 | """ |
|
1106 | """ | |
1106 | if p0 == 2: |
|
1107 | if p0 == 2: | |
1107 | # self.specOpnFFTpoints.setEnabled(True) |
|
1108 | # self.specOpnFFTpoints.setEnabled(True) | |
1108 | self.specOppairsList.setEnabled(True) |
|
1109 | self.specOppairsList.setEnabled(True) | |
1109 | if p0 == 0: |
|
1110 | if p0 == 0: | |
1110 | # self.specOpnFFTpoints.setEnabled(False) |
|
1111 | # self.specOpnFFTpoints.setEnabled(False) | |
1111 | self.specOppairsList.setEnabled(False) |
|
1112 | self.specOppairsList.setEnabled(False) | |
1112 |
|
1113 | |||
1113 | @pyqtSignature("int") |
|
1114 | @pyqtSignature("int") | |
1114 | def on_specOpCebChannel_stateChanged(self, p0): |
|
1115 | def on_specOpCebChannel_stateChanged(self, p0): | |
1115 | """ |
|
1116 | """ | |
1116 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . |
|
1117 | Habilita la opcion de aοΏ½adir el parοΏ½metro numero de Canales a la Unidad de Procesamiento . | |
1117 | """ |
|
1118 | """ | |
1118 | if p0 == 2: |
|
1119 | if p0 == 2: | |
1119 | self.specOpChannel.setEnabled(True) |
|
1120 | self.specOpChannel.setEnabled(True) | |
1120 | self.specOpComChannel.setEnabled(True) |
|
1121 | self.specOpComChannel.setEnabled(True) | |
1121 | if p0 == 0: |
|
1122 | if p0 == 0: | |
1122 | self.specOpChannel.setEnabled(False) |
|
1123 | self.specOpChannel.setEnabled(False) | |
1123 | self.specOpComChannel.setEnabled(False) |
|
1124 | self.specOpComChannel.setEnabled(False) | |
1124 |
|
1125 | |||
1125 | @pyqtSignature("int") |
|
1126 | @pyqtSignature("int") | |
1126 | def on_specOpCebHeights_stateChanged(self, p0): |
|
1127 | def on_specOpCebHeights_stateChanged(self, p0): | |
1127 | """ |
|
1128 | """ | |
1128 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . |
|
1129 | Habilita la opcion de aοΏ½adir el parοΏ½metro de alturas a la Unidad de Procesamiento . | |
1129 | """ |
|
1130 | """ | |
1130 | if p0 == 2: |
|
1131 | if p0 == 2: | |
1131 | self.specOpComHeights.setEnabled(True) |
|
1132 | self.specOpComHeights.setEnabled(True) | |
1132 | self.specOpHeights.setEnabled(True) |
|
1133 | self.specOpHeights.setEnabled(True) | |
1133 | if p0 == 0: |
|
1134 | if p0 == 0: | |
1134 | self.specOpComHeights.setEnabled(False) |
|
1135 | self.specOpComHeights.setEnabled(False) | |
1135 | self.specOpHeights.setEnabled(False) |
|
1136 | self.specOpHeights.setEnabled(False) | |
1136 |
|
1137 | |||
1137 |
|
1138 | |||
1138 | @pyqtSignature("int") |
|
1139 | @pyqtSignature("int") | |
1139 | def on_specOpCebIncoherent_stateChanged(self, p0): |
|
1140 | def on_specOpCebIncoherent_stateChanged(self, p0): | |
1140 | """ |
|
1141 | """ | |
1141 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
1142 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
1142 | """ |
|
1143 | """ | |
1143 | if p0 == 2: |
|
1144 | if p0 == 2: | |
1144 | self.specOpIncoherent.setEnabled(True) |
|
1145 | self.specOpIncoherent.setEnabled(True) | |
1145 | if p0 == 0: |
|
1146 | if p0 == 0: | |
1146 | self.specOpIncoherent.setEnabled(False) |
|
1147 | self.specOpIncoherent.setEnabled(False) | |
1147 |
|
1148 | |||
1148 | @pyqtSignature("int") |
|
1149 | @pyqtSignature("int") | |
1149 | def on_specOpCebRemoveDC_stateChanged(self, p0): |
|
1150 | def on_specOpCebRemoveDC_stateChanged(self, p0): | |
1150 | """ |
|
1151 | """ | |
1151 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . |
|
1152 | Habilita la opcion de aοΏ½adir el parοΏ½metro remover DC a la Unidad de Procesamiento . | |
1152 | """ |
|
1153 | """ | |
1153 | if p0 == 2: |
|
1154 | if p0 == 2: | |
1154 | self.specOpComRemoveDC.setEnabled(True) |
|
1155 | self.specOpComRemoveDC.setEnabled(True) | |
1155 | if p0 == 0: |
|
1156 | if p0 == 0: | |
1156 | self.specOpComRemoveDC.setEnabled(False) |
|
1157 | self.specOpComRemoveDC.setEnabled(False) | |
1157 |
|
1158 | |||
1158 | @pyqtSignature("int") |
|
1159 | @pyqtSignature("int") | |
1159 | def on_specOpCebgetNoise_stateChanged(self, p0): |
|
1160 | def on_specOpCebgetNoise_stateChanged(self, p0): | |
1160 | """ |
|
1161 | """ | |
1161 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . |
|
1162 | Habilita la opcion de aοΏ½adir la estimacion de ruido a la Unidad de Procesamiento . | |
1162 | """ |
|
1163 | """ | |
1163 | if p0 == 2: |
|
1164 | if p0 == 2: | |
1164 | self.specOpgetNoise.setEnabled(True) |
|
1165 | self.specOpgetNoise.setEnabled(True) | |
1165 |
|
1166 | |||
1166 | if p0 == 0: |
|
1167 | if p0 == 0: | |
1167 | self.specOpgetNoise.setEnabled(False) |
|
1168 | self.specOpgetNoise.setEnabled(False) | |
1168 |
|
1169 | |||
1169 | @pyqtSignature("") |
|
1170 | @pyqtSignature("") | |
1170 | def on_specOpOk_clicked(self): |
|
1171 | def on_specOpOk_clicked(self): | |
1171 | """ |
|
1172 | """ | |
1172 | AΓADE OPERACION SPECTRA |
|
1173 | AΓADE OPERACION SPECTRA | |
1173 | """ |
|
1174 | """ | |
1174 |
|
1175 | |||
1175 | addFTP = False |
|
1176 | addFTP = False | |
1176 | checkPath = False |
|
1177 | checkPath = False | |
1177 |
|
1178 | |||
1178 | self._disable_play_button() |
|
1179 | self._disable_play_button() | |
1179 | self._disable_save_button() |
|
1180 | self._disable_save_button() | |
1180 |
|
1181 | |||
1181 | self.console.clear() |
|
1182 | self.console.clear() | |
1182 | self.console.append("Checking input parameters ...") |
|
1183 | self.console.append("Checking input parameters ...") | |
1183 |
|
1184 | |||
1184 | projectObj = self.getSelectedProjectObj() |
|
1185 | projectObj = self.getSelectedProjectObj() | |
1185 |
|
1186 | |||
1186 | if not projectObj: |
|
1187 | if not projectObj: | |
1187 | self.console.append("Please select a project before update it") |
|
1188 | self.console.append("Please select a project before update it") | |
1188 | return |
|
1189 | return | |
1189 |
|
1190 | |||
1190 | puObj = self.getSelectedItemObj() |
|
1191 | puObj = self.getSelectedItemObj() | |
1191 |
|
1192 | |||
1192 | puObj.removeOperations() |
|
1193 | puObj.removeOperations() | |
1193 |
|
1194 | |||
1194 | if self.specOpCebRadarfrequency.isChecked(): |
|
1195 | if self.specOpCebRadarfrequency.isChecked(): | |
1195 | value = str(self.specOpRadarfrequency.text()) |
|
1196 | value = str(self.specOpRadarfrequency.text()) | |
1196 | format = 'float' |
|
1197 | format = 'float' | |
1197 | name_operation = 'setRadarFrequency' |
|
1198 | name_operation = 'setRadarFrequency' | |
1198 | name_parameter = 'frequency' |
|
1199 | name_parameter = 'frequency' | |
1199 |
|
1200 | |||
1200 | if not isFloat(value): |
|
1201 | if not isFloat(value): | |
1201 | self.console.clear() |
|
1202 | self.console.clear() | |
1202 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1203 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1203 | return 0 |
|
1204 | return 0 | |
1204 |
|
1205 | |||
1205 | radarfreq = float(value)*1e6 |
|
1206 | radarfreq = float(value)*1e6 | |
1206 | opObj = puObj.addOperation(name=name_operation) |
|
1207 | opObj = puObj.addOperation(name=name_operation) | |
1207 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) |
|
1208 | opObj.addParameter(name=name_parameter, value=radarfreq, format=format) | |
1208 |
|
1209 | |||
1209 | inputId = puObj.getInputId() |
|
1210 | inputId = puObj.getInputId() | |
1210 | inputPuObj = projectObj.getProcUnitObj(inputId) |
|
1211 | inputPuObj = projectObj.getProcUnitObj(inputId) | |
1211 |
|
1212 | |||
1212 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': |
|
1213 | if inputPuObj.datatype == 'Voltage' or inputPuObj.datatype == 'USRP': | |
1213 |
|
1214 | |||
1214 | value = str(self.specOpnFFTpoints.text()) |
|
1215 | value = str(self.specOpnFFTpoints.text()) | |
1215 |
|
1216 | |||
1216 | if not isInt(value): |
|
1217 | if not isInt(value): | |
1217 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) |
|
1218 | self.console.append("Invalid value '%s' for '%s'" %(value, 'nFFTPoints')) | |
1218 | return 0 |
|
1219 | return 0 | |
1219 |
|
1220 | |||
1220 | puObj.addParameter(name='nFFTPoints', value=value, format='int') |
|
1221 | puObj.addParameter(name='nFFTPoints', value=value, format='int') | |
1221 |
|
1222 | |||
1222 | value = str(self.specOpProfiles.text()) |
|
1223 | value = str(self.specOpProfiles.text()) | |
1223 | if not isInt(value): |
|
1224 | if not isInt(value): | |
1224 | self.console.append("Please write a value on Profiles field") |
|
1225 | self.console.append("Please write a value on Profiles field") | |
1225 | else: |
|
1226 | else: | |
1226 | puObj.addParameter(name='nProfiles', value=value, format='int') |
|
1227 | puObj.addParameter(name='nProfiles', value=value, format='int') | |
1227 |
|
1228 | |||
1228 | value = str(self.specOpippFactor.text()) |
|
1229 | value = str(self.specOpippFactor.text()) | |
1229 | if not isInt(value): |
|
1230 | if not isInt(value): | |
1230 | self.console.append("Please write a value on IppFactor field") |
|
1231 | self.console.append("Please write a value on IppFactor field") | |
1231 | else: |
|
1232 | else: | |
1232 | puObj.addParameter(name='ippFactor' , value=value , format='int') |
|
1233 | puObj.addParameter(name='ippFactor' , value=value , format='int') | |
1233 |
|
1234 | |||
1234 | if self.specOpCebCrossSpectra.isChecked(): |
|
1235 | if self.specOpCebCrossSpectra.isChecked(): | |
1235 | name_parameter = 'pairsList' |
|
1236 | name_parameter = 'pairsList' | |
1236 | format = 'pairslist' |
|
1237 | format = 'pairslist' | |
1237 | value = str(self.specOppairsList.text()) |
|
1238 | value = str(self.specOppairsList.text()) | |
1238 |
|
1239 | |||
1239 | if value == "": |
|
1240 | if value == "": | |
1240 | print "Please fill the pairs list field" |
|
1241 | print "Please fill the pairs list field" | |
1241 | return 0 |
|
1242 | return 0 | |
1242 |
|
1243 | |||
1243 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
1244 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
1244 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) |
|
1245 | self.console.append("Invalid value '%s' for '%s'" %(value,name_parameter)) | |
1245 | return 0 |
|
1246 | return 0 | |
1246 |
|
1247 | |||
1247 | if self.specOpCebHeights.isChecked(): |
|
1248 | if self.specOpCebHeights.isChecked(): | |
1248 | value = str(self.specOpHeights.text()) |
|
1249 | value = str(self.specOpHeights.text()) | |
1249 |
|
1250 | |||
1250 | if value == "": |
|
1251 | if value == "": | |
1251 | self.console.append("Empty value for '%s'" %(value, "Height range")) |
|
1252 | self.console.append("Empty value for '%s'" %(value, "Height range")) | |
1252 | return 0 |
|
1253 | return 0 | |
1253 |
|
1254 | |||
1254 | valueList = value.split(',') |
|
1255 | valueList = value.split(',') | |
1255 | format = 'float' |
|
1256 | format = 'float' | |
1256 | value0 = valueList[0] |
|
1257 | value0 = valueList[0] | |
1257 | value1 = valueList[1] |
|
1258 | value1 = valueList[1] | |
1258 |
|
1259 | |||
1259 | if not isFloat(value0) or not isFloat(value1): |
|
1260 | if not isFloat(value0) or not isFloat(value1): | |
1260 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) |
|
1261 | self.console.append("Invalid value '%s' for '%s'" %(value, "Height range")) | |
1261 | return 0 |
|
1262 | return 0 | |
1262 |
|
1263 | |||
1263 | if self.specOpComHeights.currentIndex() == 0: |
|
1264 | if self.specOpComHeights.currentIndex() == 0: | |
1264 | name_operation = 'selectHeights' |
|
1265 | name_operation = 'selectHeights' | |
1265 | name_parameter1 = 'minHei' |
|
1266 | name_parameter1 = 'minHei' | |
1266 | name_parameter2 = 'maxHei' |
|
1267 | name_parameter2 = 'maxHei' | |
1267 | else: |
|
1268 | else: | |
1268 | name_operation = 'selectHeightsByIndex' |
|
1269 | name_operation = 'selectHeightsByIndex' | |
1269 | name_parameter1 = 'minIndex' |
|
1270 | name_parameter1 = 'minIndex' | |
1270 | name_parameter2 = 'maxIndex' |
|
1271 | name_parameter2 = 'maxIndex' | |
1271 |
|
1272 | |||
1272 | opObj = puObj.addOperation(name=name_operation) |
|
1273 | opObj = puObj.addOperation(name=name_operation) | |
1273 | opObj.addParameter(name=name_parameter1, value=value0, format=format) |
|
1274 | opObj.addParameter(name=name_parameter1, value=value0, format=format) | |
1274 | opObj.addParameter(name=name_parameter2, value=value1, format=format) |
|
1275 | opObj.addParameter(name=name_parameter2, value=value1, format=format) | |
1275 |
|
1276 | |||
1276 | if self.specOpCebChannel.isChecked(): |
|
1277 | if self.specOpCebChannel.isChecked(): | |
1277 |
|
1278 | |||
1278 | if self.specOpComChannel.currentIndex() == 0: |
|
1279 | if self.specOpComChannel.currentIndex() == 0: | |
1279 | name_operation = "selectChannels" |
|
1280 | name_operation = "selectChannels" | |
1280 | name_parameter = 'channelList' |
|
1281 | name_parameter = 'channelList' | |
1281 | else: |
|
1282 | else: | |
1282 | name_operation = "selectChannelsByIndex" |
|
1283 | name_operation = "selectChannelsByIndex" | |
1283 | name_parameter = 'channelIndexList' |
|
1284 | name_parameter = 'channelIndexList' | |
1284 |
|
1285 | |||
1285 | format = 'intlist' |
|
1286 | format = 'intlist' | |
1286 | value = str(self.specOpChannel.text()) |
|
1287 | value = str(self.specOpChannel.text()) | |
1287 |
|
1288 | |||
1288 | if value == "": |
|
1289 | if value == "": | |
1289 | print "Please fill channel list" |
|
1290 | print "Please fill channel list" | |
1290 | return 0 |
|
1291 | return 0 | |
1291 |
|
1292 | |||
1292 | if not isList(value): |
|
1293 | if not isList(value): | |
1293 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1294 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1294 | return 0 |
|
1295 | return 0 | |
1295 |
|
1296 | |||
1296 | opObj = puObj.addOperation(name=name_operation) |
|
1297 | opObj = puObj.addOperation(name=name_operation) | |
1297 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1298 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1298 |
|
1299 | |||
1299 | if self.specOpCebIncoherent.isChecked(): |
|
1300 | if self.specOpCebIncoherent.isChecked(): | |
1300 |
|
1301 | |||
1301 | name_operation = 'IncohInt' |
|
1302 | name_operation = 'IncohInt' | |
1302 | optype = 'other' |
|
1303 | optype = 'other' | |
1303 |
|
1304 | |||
1304 | if self.specOpCobIncInt.currentIndex() == 0: |
|
1305 | if self.specOpCobIncInt.currentIndex() == 0: | |
1305 | name_parameter = 'timeInterval' |
|
1306 | name_parameter = 'timeInterval' | |
1306 | format = 'float' |
|
1307 | format = 'float' | |
1307 | else: |
|
1308 | else: | |
1308 | name_parameter = 'n' |
|
1309 | name_parameter = 'n' | |
1309 | format = 'int' |
|
1310 | format = 'int' | |
1310 |
|
1311 | |||
1311 | value = str(self.specOpIncoherent.text()) |
|
1312 | value = str(self.specOpIncoherent.text()) | |
1312 |
|
1313 | |||
1313 | if value == "": |
|
1314 | if value == "": | |
1314 | print "Please fill Incoherent integration value" |
|
1315 | print "Please fill Incoherent integration value" | |
1315 | return 0 |
|
1316 | return 0 | |
1316 |
|
1317 | |||
1317 | if not isFloat(value): |
|
1318 | if not isFloat(value): | |
1318 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
1319 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
1319 | return 0 |
|
1320 | return 0 | |
1320 |
|
1321 | |||
1321 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1322 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
1322 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1323 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1323 |
|
1324 | |||
1324 | if self.specOpCebRemoveDC.isChecked(): |
|
1325 | if self.specOpCebRemoveDC.isChecked(): | |
1325 | name_operation = 'removeDC' |
|
1326 | name_operation = 'removeDC' | |
1326 | name_parameter = 'mode' |
|
1327 | name_parameter = 'mode' | |
1327 | format = 'int' |
|
1328 | format = 'int' | |
1328 | if self.specOpComRemoveDC.currentIndex() == 0: |
|
1329 | if self.specOpComRemoveDC.currentIndex() == 0: | |
1329 | value = 1 |
|
1330 | value = 1 | |
1330 | else: |
|
1331 | else: | |
1331 | value = 2 |
|
1332 | value = 2 | |
1332 | opObj = puObj.addOperation(name=name_operation) |
|
1333 | opObj = puObj.addOperation(name=name_operation) | |
1333 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1334 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
1334 |
|
1335 | |||
1335 | if self.specOpCebRemoveInt.isChecked(): |
|
1336 | if self.specOpCebRemoveInt.isChecked(): | |
1336 | name_operation = 'removeInterference' |
|
1337 | name_operation = 'removeInterference' | |
1337 | opObj = puObj.addOperation(name=name_operation) |
|
1338 | opObj = puObj.addOperation(name=name_operation) | |
1338 |
|
1339 | |||
1339 |
|
1340 | |||
1340 | if self.specOpCebgetNoise.isChecked(): |
|
1341 | if self.specOpCebgetNoise.isChecked(): | |
1341 | value = str(self.specOpgetNoise.text()) |
|
1342 | value = str(self.specOpgetNoise.text()) | |
1342 | valueList = value.split(',') |
|
1343 | valueList = value.split(',') | |
1343 | format = 'float' |
|
1344 | format = 'float' | |
1344 | name_operation = "getNoise" |
|
1345 | name_operation = "getNoise" | |
1345 | opObj = puObj.addOperation(name=name_operation) |
|
1346 | opObj = puObj.addOperation(name=name_operation) | |
1346 |
|
1347 | |||
1347 | if not value == '': |
|
1348 | if not value == '': | |
1348 | valueList = value.split(',') |
|
1349 | valueList = value.split(',') | |
1349 | length = len(valueList) |
|
1350 | length = len(valueList) | |
1350 | if length == 1: |
|
1351 | if length == 1: | |
1351 | try: |
|
1352 | try: | |
1352 | value1 = float(valueList[0]) |
|
1353 | value1 = float(valueList[0]) | |
1353 | except: |
|
1354 | except: | |
1354 | self.console.clear() |
|
1355 | self.console.clear() | |
1355 | self.console.append("Please Write correct parameter Get Noise") |
|
1356 | self.console.append("Please Write correct parameter Get Noise") | |
1356 | return 0 |
|
1357 | return 0 | |
1357 | name1 = 'minHei' |
|
1358 | name1 = 'minHei' | |
1358 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1359 | opObj.addParameter(name=name1, value=value1, format=format) | |
1359 | elif length == 2: |
|
1360 | elif length == 2: | |
1360 | try: |
|
1361 | try: | |
1361 | value1 = float(valueList[0]) |
|
1362 | value1 = float(valueList[0]) | |
1362 | value2 = float(valueList[1]) |
|
1363 | value2 = float(valueList[1]) | |
1363 | except: |
|
1364 | except: | |
1364 | self.console.clear() |
|
1365 | self.console.clear() | |
1365 | self.console.append("Please Write corrects parameter Get Noise") |
|
1366 | self.console.append("Please Write corrects parameter Get Noise") | |
1366 | return 0 |
|
1367 | return 0 | |
1367 | name1 = 'minHei' |
|
1368 | name1 = 'minHei' | |
1368 | name2 = 'maxHei' |
|
1369 | name2 = 'maxHei' | |
1369 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1370 | opObj.addParameter(name=name1, value=value1, format=format) | |
1370 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1371 | opObj.addParameter(name=name2, value=value2, format=format) | |
1371 |
|
1372 | |||
1372 | elif length == 3: |
|
1373 | elif length == 3: | |
1373 | try: |
|
1374 | try: | |
1374 | value1 = float(valueList[0]) |
|
1375 | value1 = float(valueList[0]) | |
1375 | value2 = float(valueList[1]) |
|
1376 | value2 = float(valueList[1]) | |
1376 | value3 = float(valueList[2]) |
|
1377 | value3 = float(valueList[2]) | |
1377 | except: |
|
1378 | except: | |
1378 | self.console.clear() |
|
1379 | self.console.clear() | |
1379 | self.console.append("Please Write corrects parameter Get Noise") |
|
1380 | self.console.append("Please Write corrects parameter Get Noise") | |
1380 | return 0 |
|
1381 | return 0 | |
1381 | name1 = 'minHei' |
|
1382 | name1 = 'minHei' | |
1382 | name2 = 'maxHei' |
|
1383 | name2 = 'maxHei' | |
1383 | name3 = 'minVel' |
|
1384 | name3 = 'minVel' | |
1384 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1385 | opObj.addParameter(name=name1, value=value1, format=format) | |
1385 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1386 | opObj.addParameter(name=name2, value=value2, format=format) | |
1386 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1387 | opObj.addParameter(name=name3, value=value3, format=format) | |
1387 |
|
1388 | |||
1388 | elif length == 4: |
|
1389 | elif length == 4: | |
1389 | try: |
|
1390 | try: | |
1390 | value1 = float(valueList[0]) |
|
1391 | value1 = float(valueList[0]) | |
1391 | value2 = float(valueList[1]) |
|
1392 | value2 = float(valueList[1]) | |
1392 | value3 = float(valueList[2]) |
|
1393 | value3 = float(valueList[2]) | |
1393 | value4 = float(valueList[3]) |
|
1394 | value4 = float(valueList[3]) | |
1394 | except: |
|
1395 | except: | |
1395 | self.console.clear() |
|
1396 | self.console.clear() | |
1396 | self.console.append("Please Write corrects parameter Get Noise") |
|
1397 | self.console.append("Please Write corrects parameter Get Noise") | |
1397 | return 0 |
|
1398 | return 0 | |
1398 | name1 = 'minHei' |
|
1399 | name1 = 'minHei' | |
1399 | name2 = 'maxHei' |
|
1400 | name2 = 'maxHei' | |
1400 | name3 = 'minVel' |
|
1401 | name3 = 'minVel' | |
1401 | name4 = 'maxVel' |
|
1402 | name4 = 'maxVel' | |
1402 | opObj.addParameter(name=name1, value=value1, format=format) |
|
1403 | opObj.addParameter(name=name1, value=value1, format=format) | |
1403 | opObj.addParameter(name=name2, value=value2, format=format) |
|
1404 | opObj.addParameter(name=name2, value=value2, format=format) | |
1404 | opObj.addParameter(name=name3, value=value3, format=format) |
|
1405 | opObj.addParameter(name=name3, value=value3, format=format) | |
1405 | opObj.addParameter(name=name4, value=value4, format=format) |
|
1406 | opObj.addParameter(name=name4, value=value4, format=format) | |
1406 |
|
1407 | |||
1407 | elif length > 4: |
|
1408 | elif length > 4: | |
1408 | self.console.clear() |
|
1409 | self.console.clear() | |
1409 | self.console.append("Get Noise Operation only accepts 4 parameters") |
|
1410 | self.console.append("Get Noise Operation only accepts 4 parameters") | |
1410 | return 0 |
|
1411 | return 0 | |
1411 |
|
1412 | |||
1412 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") |
|
1413 | channelList = str(self.specGgraphChannelList.text()).replace(" ","") | |
1413 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") |
|
1414 | vel_range = str(self.specGgraphFreq.text()).replace(" ","") | |
1414 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") |
|
1415 | hei_range = str(self.specGgraphHeight.text()).replace(" ","") | |
1415 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") |
|
1416 | db_range = str(self.specGgraphDbsrange.text()).replace(" ","") | |
1416 |
|
1417 | |||
1417 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") |
|
1418 | trange = str(self.specGgraphTminTmax.text()).replace(" ","") | |
1418 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") |
|
1419 | magrange = str(self.specGgraphmagnitud.text()).replace(" ","") | |
1419 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") |
|
1420 | phaserange = str(self.specGgraphPhase.text()).replace(" ","") | |
1420 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") |
|
1421 | # timerange = str(self.specGgraphTimeRange.text()).replace(" ","") | |
1421 |
|
1422 | |||
1422 | figpath = str(self.specGraphPath.text()) |
|
1423 | figpath = str(self.specGraphPath.text()) | |
1423 | figfile = str(self.specGraphPrefix.text()).replace(" ","") |
|
1424 | figfile = str(self.specGraphPrefix.text()).replace(" ","") | |
1424 | try: |
|
1425 | try: | |
1425 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) |
|
1426 | wrperiod = int(str(self.specGgraphftpratio.text()).replace(" ","")) | |
1426 | except: |
|
1427 | except: | |
1427 | wrperiod = None |
|
1428 | wrperiod = None | |
1428 |
|
1429 | |||
1429 | #-----Spectra Plot----- |
|
1430 | #-----Spectra Plot----- | |
1430 | if self.specGraphCebSpectraplot.isChecked(): |
|
1431 | if self.specGraphCebSpectraplot.isChecked(): | |
1431 |
|
1432 | |||
1432 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') |
|
1433 | opObj = puObj.addOperation(name='SpectraPlot', optype='other') | |
1433 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1434 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1434 |
|
1435 | |||
1435 | if not channelList == '': |
|
1436 | if not channelList == '': | |
1436 |
|
1437 | |||
1437 | if not isList(channelList): |
|
1438 | if not isList(channelList): | |
1438 | self.console.append("Invalid channelList") |
|
1439 | self.console.append("Invalid channelList") | |
1439 | return 0 |
|
1440 | return 0 | |
1440 |
|
1441 | |||
1441 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1442 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1442 |
|
1443 | |||
1443 | if not vel_range == '': |
|
1444 | if not vel_range == '': | |
1444 | xvalueList = vel_range.split(',') |
|
1445 | xvalueList = vel_range.split(',') | |
1445 | try: |
|
1446 | try: | |
1446 | value1 = float(xvalueList[0]) |
|
1447 | value1 = float(xvalueList[0]) | |
1447 | value2 = float(xvalueList[1]) |
|
1448 | value2 = float(xvalueList[1]) | |
1448 | except: |
|
1449 | except: | |
1449 | self.console.clear() |
|
1450 | self.console.clear() | |
1450 | self.console.append("Invalid velocity/frequency range") |
|
1451 | self.console.append("Invalid velocity/frequency range") | |
1451 | return 0 |
|
1452 | return 0 | |
1452 |
|
1453 | |||
1453 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1454 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1454 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1455 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1455 |
|
1456 | |||
1456 | if not hei_range == '': |
|
1457 | if not hei_range == '': | |
1457 | yvalueList = hei_range.split(",") |
|
1458 | yvalueList = hei_range.split(",") | |
1458 | try: |
|
1459 | try: | |
1459 | value1 = float(yvalueList[0]) |
|
1460 | value1 = float(yvalueList[0]) | |
1460 | value2 = float(yvalueList[1]) |
|
1461 | value2 = float(yvalueList[1]) | |
1461 | except: |
|
1462 | except: | |
1462 | self.console.clear() |
|
1463 | self.console.clear() | |
1463 | self.console.append("Invalid height range") |
|
1464 | self.console.append("Invalid height range") | |
1464 | return 0 |
|
1465 | return 0 | |
1465 |
|
1466 | |||
1466 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1467 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1467 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1468 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1468 |
|
1469 | |||
1469 | if not db_range == '': |
|
1470 | if not db_range == '': | |
1470 | zvalueList = db_range.split(",") |
|
1471 | zvalueList = db_range.split(",") | |
1471 | try: |
|
1472 | try: | |
1472 | value1 = float(zvalueList[0]) |
|
1473 | value1 = float(zvalueList[0]) | |
1473 | value2 = float(zvalueList[1]) |
|
1474 | value2 = float(zvalueList[1]) | |
1474 | except: |
|
1475 | except: | |
1475 | self.console.clear() |
|
1476 | self.console.clear() | |
1476 | self.console.append("Invalid db range") |
|
1477 | self.console.append("Invalid db range") | |
1477 | return 0 |
|
1478 | return 0 | |
1478 |
|
1479 | |||
1479 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1480 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1480 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1481 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1481 |
|
1482 | |||
1482 | if self.specGraphSaveSpectra.isChecked(): |
|
1483 | if self.specGraphSaveSpectra.isChecked(): | |
1483 | checkPath = True |
|
1484 | checkPath = True | |
1484 | opObj.addParameter(name='save', value=1 , format='bool') |
|
1485 | opObj.addParameter(name='save', value=1 , format='bool') | |
1485 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1486 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1486 | if figfile: |
|
1487 | if figfile: | |
1487 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1488 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1488 | if wrperiod: |
|
1489 | if wrperiod: | |
1489 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1490 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1490 |
|
1491 | |||
1491 | if self.specGraphftpSpectra.isChecked(): |
|
1492 | if self.specGraphftpSpectra.isChecked(): | |
1492 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1493 | opObj.addParameter(name='ftp', value='1', format='int') | |
1493 | self.addFTPConf2Operation(puObj, opObj) |
|
1494 | self.addFTPConf2Operation(puObj, opObj) | |
1494 | addFTP = True |
|
1495 | addFTP = True | |
1495 |
|
1496 | |||
1496 | if self.specGraphCebCrossSpectraplot.isChecked(): |
|
1497 | if self.specGraphCebCrossSpectraplot.isChecked(): | |
1497 |
|
1498 | |||
1498 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') |
|
1499 | opObj = puObj.addOperation(name='CrossSpectraPlot', optype='other') | |
1499 | # opObj.addParameter(name='power_cmap', value='jet', format='str') |
|
1500 | # opObj.addParameter(name='power_cmap', value='jet', format='str') | |
1500 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1501 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1501 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1502 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1502 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1503 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1503 |
|
1504 | |||
1504 | if not vel_range == '': |
|
1505 | if not vel_range == '': | |
1505 | xvalueList = vel_range.split(',') |
|
1506 | xvalueList = vel_range.split(',') | |
1506 | try: |
|
1507 | try: | |
1507 | value1 = float(xvalueList[0]) |
|
1508 | value1 = float(xvalueList[0]) | |
1508 | value2 = float(xvalueList[1]) |
|
1509 | value2 = float(xvalueList[1]) | |
1509 | except: |
|
1510 | except: | |
1510 | self.console.clear() |
|
1511 | self.console.clear() | |
1511 | self.console.append("Invalid velocity/frequency range") |
|
1512 | self.console.append("Invalid velocity/frequency range") | |
1512 | return 0 |
|
1513 | return 0 | |
1513 |
|
1514 | |||
1514 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1515 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1515 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1516 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1516 |
|
1517 | |||
1517 | if not hei_range == '': |
|
1518 | if not hei_range == '': | |
1518 | yvalueList = hei_range.split(",") |
|
1519 | yvalueList = hei_range.split(",") | |
1519 | try: |
|
1520 | try: | |
1520 | value1 = float(yvalueList[0]) |
|
1521 | value1 = float(yvalueList[0]) | |
1521 | value2 = float(yvalueList[1]) |
|
1522 | value2 = float(yvalueList[1]) | |
1522 | except: |
|
1523 | except: | |
1523 | self.console.clear() |
|
1524 | self.console.clear() | |
1524 | self.console.append("Invalid height range") |
|
1525 | self.console.append("Invalid height range") | |
1525 | return 0 |
|
1526 | return 0 | |
1526 |
|
1527 | |||
1527 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1528 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1528 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1529 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1529 |
|
1530 | |||
1530 | if not db_range == '': |
|
1531 | if not db_range == '': | |
1531 | zvalueList = db_range.split(",") |
|
1532 | zvalueList = db_range.split(",") | |
1532 | try: |
|
1533 | try: | |
1533 | value1 = float(zvalueList[0]) |
|
1534 | value1 = float(zvalueList[0]) | |
1534 | value2 = float(zvalueList[1]) |
|
1535 | value2 = float(zvalueList[1]) | |
1535 | except: |
|
1536 | except: | |
1536 | self.console.clear() |
|
1537 | self.console.clear() | |
1537 | self.console.append("Invalid db range") |
|
1538 | self.console.append("Invalid db range") | |
1538 | return 0 |
|
1539 | return 0 | |
1539 |
|
1540 | |||
1540 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1541 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1541 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1542 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1542 |
|
1543 | |||
1543 | if not magrange == '': |
|
1544 | if not magrange == '': | |
1544 | zvalueList = magrange.split(",") |
|
1545 | zvalueList = magrange.split(",") | |
1545 | try: |
|
1546 | try: | |
1546 | value1 = float(zvalueList[0]) |
|
1547 | value1 = float(zvalueList[0]) | |
1547 | value2 = float(zvalueList[1]) |
|
1548 | value2 = float(zvalueList[1]) | |
1548 | except: |
|
1549 | except: | |
1549 | self.console.clear() |
|
1550 | self.console.clear() | |
1550 | self.console.append("Invalid magnitude range") |
|
1551 | self.console.append("Invalid magnitude range") | |
1551 | return 0 |
|
1552 | return 0 | |
1552 |
|
1553 | |||
1553 | opObj.addParameter(name='coh_min', value=value1, format='float') |
|
1554 | opObj.addParameter(name='coh_min', value=value1, format='float') | |
1554 | opObj.addParameter(name='coh_max', value=value2, format='float') |
|
1555 | opObj.addParameter(name='coh_max', value=value2, format='float') | |
1555 |
|
1556 | |||
1556 | if not phaserange == '': |
|
1557 | if not phaserange == '': | |
1557 | zvalueList = phaserange.split(",") |
|
1558 | zvalueList = phaserange.split(",") | |
1558 | try: |
|
1559 | try: | |
1559 | value1 = float(zvalueList[0]) |
|
1560 | value1 = float(zvalueList[0]) | |
1560 | value2 = float(zvalueList[1]) |
|
1561 | value2 = float(zvalueList[1]) | |
1561 | except: |
|
1562 | except: | |
1562 | self.console.clear() |
|
1563 | self.console.clear() | |
1563 | self.console.append("Invalid phase range") |
|
1564 | self.console.append("Invalid phase range") | |
1564 | return 0 |
|
1565 | return 0 | |
1565 |
|
1566 | |||
1566 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1567 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1567 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1568 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1568 |
|
1569 | |||
1569 | if self.specGraphSaveCross.isChecked(): |
|
1570 | if self.specGraphSaveCross.isChecked(): | |
1570 | checkPath = True |
|
1571 | checkPath = True | |
1571 | opObj.addParameter(name='save', value='1', format='bool') |
|
1572 | opObj.addParameter(name='save', value='1', format='bool') | |
1572 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1573 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1573 | if figfile: |
|
1574 | if figfile: | |
1574 | opObj.addParameter(name='figfile', value=figfile, format='str') |
|
1575 | opObj.addParameter(name='figfile', value=figfile, format='str') | |
1575 | if wrperiod: |
|
1576 | if wrperiod: | |
1576 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1577 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1577 |
|
1578 | |||
1578 | if self.specGraphftpCross.isChecked(): |
|
1579 | if self.specGraphftpCross.isChecked(): | |
1579 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1580 | opObj.addParameter(name='ftp', value='1', format='int') | |
1580 | self.addFTPConf2Operation(puObj, opObj) |
|
1581 | self.addFTPConf2Operation(puObj, opObj) | |
1581 | addFTP = True |
|
1582 | addFTP = True | |
1582 |
|
1583 | |||
1583 | if self.specGraphCebRTIplot.isChecked(): |
|
1584 | if self.specGraphCebRTIplot.isChecked(): | |
1584 |
|
1585 | |||
1585 | opObj = puObj.addOperation(name='RTIPlot', optype='other') |
|
1586 | opObj = puObj.addOperation(name='RTIPlot', optype='other') | |
1586 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1587 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1587 |
|
1588 | |||
1588 | if not channelList == '': |
|
1589 | if not channelList == '': | |
1589 | if not isList(channelList): |
|
1590 | if not isList(channelList): | |
1590 | self.console.append("Invalid channelList") |
|
1591 | self.console.append("Invalid channelList") | |
1591 | return 0 |
|
1592 | return 0 | |
1592 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1593 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1593 |
|
1594 | |||
1594 | if not trange == '': |
|
1595 | if not trange == '': | |
1595 | xvalueList = trange.split(',') |
|
1596 | xvalueList = trange.split(',') | |
1596 | try: |
|
1597 | try: | |
1597 | value1 = float(xvalueList[0]) |
|
1598 | value1 = float(xvalueList[0]) | |
1598 | value2 = float(xvalueList[1]) |
|
1599 | value2 = float(xvalueList[1]) | |
1599 | except: |
|
1600 | except: | |
1600 | self.console.clear() |
|
1601 | self.console.clear() | |
1601 | self.console.append("Invalid time range") |
|
1602 | self.console.append("Invalid time range") | |
1602 | return 0 |
|
1603 | return 0 | |
1603 |
|
1604 | |||
1604 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1605 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1605 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1606 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1606 |
|
1607 | |||
1607 | # if not timerange == '': |
|
1608 | # if not timerange == '': | |
1608 | # try: |
|
1609 | # try: | |
1609 | # timerange = float(timerange) |
|
1610 | # timerange = float(timerange) | |
1610 | # except: |
|
1611 | # except: | |
1611 | # self.console.clear() |
|
1612 | # self.console.clear() | |
1612 | # self.console.append("Invalid time range") |
|
1613 | # self.console.append("Invalid time range") | |
1613 | # return 0 |
|
1614 | # return 0 | |
1614 | # |
|
1615 | # | |
1615 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1616 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1616 |
|
1617 | |||
1617 | if not hei_range == '': |
|
1618 | if not hei_range == '': | |
1618 | yvalueList = hei_range.split(",") |
|
1619 | yvalueList = hei_range.split(",") | |
1619 | try: |
|
1620 | try: | |
1620 | value1 = float(yvalueList[0]) |
|
1621 | value1 = float(yvalueList[0]) | |
1621 | value2 = float(yvalueList[1]) |
|
1622 | value2 = float(yvalueList[1]) | |
1622 | except: |
|
1623 | except: | |
1623 | self.console.clear() |
|
1624 | self.console.clear() | |
1624 | self.console.append("Invalid height range") |
|
1625 | self.console.append("Invalid height range") | |
1625 | return 0 |
|
1626 | return 0 | |
1626 |
|
1627 | |||
1627 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1628 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1628 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1629 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1629 |
|
1630 | |||
1630 | if not db_range == '': |
|
1631 | if not db_range == '': | |
1631 | zvalueList = db_range.split(",") |
|
1632 | zvalueList = db_range.split(",") | |
1632 | try: |
|
1633 | try: | |
1633 | value1 = float(zvalueList[0]) |
|
1634 | value1 = float(zvalueList[0]) | |
1634 | value2 = float(zvalueList[1]) |
|
1635 | value2 = float(zvalueList[1]) | |
1635 | except: |
|
1636 | except: | |
1636 | self.console.clear() |
|
1637 | self.console.clear() | |
1637 | self.console.append("Invalid db range") |
|
1638 | self.console.append("Invalid db range") | |
1638 | return 0 |
|
1639 | return 0 | |
1639 |
|
1640 | |||
1640 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1641 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1641 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1642 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1642 |
|
1643 | |||
1643 | if self.specGraphSaveRTIplot.isChecked(): |
|
1644 | if self.specGraphSaveRTIplot.isChecked(): | |
1644 | checkPath = True |
|
1645 | checkPath = True | |
1645 | opObj.addParameter(name='save', value='1', format='bool') |
|
1646 | opObj.addParameter(name='save', value='1', format='bool') | |
1646 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1647 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1647 | if figfile: |
|
1648 | if figfile: | |
1648 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1649 | opObj.addParameter(name='figfile', value=value, format='str') | |
1649 | if wrperiod: |
|
1650 | if wrperiod: | |
1650 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1651 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1651 |
|
1652 | |||
1652 | if self.specGraphftpRTIplot.isChecked(): |
|
1653 | if self.specGraphftpRTIplot.isChecked(): | |
1653 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1654 | opObj.addParameter(name='ftp', value='1', format='int') | |
1654 | self.addFTPConf2Operation(puObj, opObj) |
|
1655 | self.addFTPConf2Operation(puObj, opObj) | |
1655 | addFTP = True |
|
1656 | addFTP = True | |
1656 |
|
1657 | |||
1657 | if self.specGraphCebCoherencmap.isChecked(): |
|
1658 | if self.specGraphCebCoherencmap.isChecked(): | |
1658 |
|
1659 | |||
1659 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') |
|
1660 | opObj = puObj.addOperation(name='CoherenceMap', optype='other') | |
1660 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1661 | # opObj.addParameter(name=name_parameter, value=value, format=format) | |
1661 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1662 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') | |
1662 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1663 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') | |
1663 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1664 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1664 |
|
1665 | |||
1665 | # if not timerange == '': |
|
1666 | # if not timerange == '': | |
1666 | # try: |
|
1667 | # try: | |
1667 | # timerange = int(timerange) |
|
1668 | # timerange = int(timerange) | |
1668 | # except: |
|
1669 | # except: | |
1669 | # self.console.clear() |
|
1670 | # self.console.clear() | |
1670 | # self.console.append("Invalid time range") |
|
1671 | # self.console.append("Invalid time range") | |
1671 | # return 0 |
|
1672 | # return 0 | |
1672 | # |
|
1673 | # | |
1673 | # opObj.addParameter(name='timerange', value=timerange, format='int') |
|
1674 | # opObj.addParameter(name='timerange', value=timerange, format='int') | |
1674 |
|
1675 | |||
1675 | if not trange == '': |
|
1676 | if not trange == '': | |
1676 | xvalueList = trange.split(',') |
|
1677 | xvalueList = trange.split(',') | |
1677 | try: |
|
1678 | try: | |
1678 | value1 = float(xvalueList[0]) |
|
1679 | value1 = float(xvalueList[0]) | |
1679 | value2 = float(xvalueList[1]) |
|
1680 | value2 = float(xvalueList[1]) | |
1680 | except: |
|
1681 | except: | |
1681 | self.console.clear() |
|
1682 | self.console.clear() | |
1682 | self.console.append("Invalid time range") |
|
1683 | self.console.append("Invalid time range") | |
1683 | return 0 |
|
1684 | return 0 | |
1684 |
|
1685 | |||
1685 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1686 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1686 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1687 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1687 |
|
1688 | |||
1688 | if not hei_range == '': |
|
1689 | if not hei_range == '': | |
1689 | yvalueList = hei_range.split(",") |
|
1690 | yvalueList = hei_range.split(",") | |
1690 | try: |
|
1691 | try: | |
1691 | value1 = float(yvalueList[0]) |
|
1692 | value1 = float(yvalueList[0]) | |
1692 | value2 = float(yvalueList[1]) |
|
1693 | value2 = float(yvalueList[1]) | |
1693 | except: |
|
1694 | except: | |
1694 | self.console.clear() |
|
1695 | self.console.clear() | |
1695 | self.console.append("Invalid height range") |
|
1696 | self.console.append("Invalid height range") | |
1696 | return 0 |
|
1697 | return 0 | |
1697 |
|
1698 | |||
1698 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1699 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1699 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1700 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1700 |
|
1701 | |||
1701 | if not magrange == '': |
|
1702 | if not magrange == '': | |
1702 | zvalueList = magrange.split(",") |
|
1703 | zvalueList = magrange.split(",") | |
1703 | try: |
|
1704 | try: | |
1704 | value1 = float(zvalueList[0]) |
|
1705 | value1 = float(zvalueList[0]) | |
1705 | value2 = float(zvalueList[1]) |
|
1706 | value2 = float(zvalueList[1]) | |
1706 | except: |
|
1707 | except: | |
1707 | self.console.clear() |
|
1708 | self.console.clear() | |
1708 | self.console.append("Invalid magnitude range") |
|
1709 | self.console.append("Invalid magnitude range") | |
1709 | return 0 |
|
1710 | return 0 | |
1710 |
|
1711 | |||
1711 | opObj.addParameter(name='zmin', value=value1, format='float') |
|
1712 | opObj.addParameter(name='zmin', value=value1, format='float') | |
1712 | opObj.addParameter(name='zmax', value=value2, format='float') |
|
1713 | opObj.addParameter(name='zmax', value=value2, format='float') | |
1713 |
|
1714 | |||
1714 | if not phaserange == '': |
|
1715 | if not phaserange == '': | |
1715 | zvalueList = phaserange.split(",") |
|
1716 | zvalueList = phaserange.split(",") | |
1716 | try: |
|
1717 | try: | |
1717 | value1 = float(zvalueList[0]) |
|
1718 | value1 = float(zvalueList[0]) | |
1718 | value2 = float(zvalueList[1]) |
|
1719 | value2 = float(zvalueList[1]) | |
1719 | except: |
|
1720 | except: | |
1720 | self.console.clear() |
|
1721 | self.console.clear() | |
1721 | self.console.append("Invalid phase range") |
|
1722 | self.console.append("Invalid phase range") | |
1722 | return 0 |
|
1723 | return 0 | |
1723 |
|
1724 | |||
1724 | opObj.addParameter(name='phase_min', value=value1, format='float') |
|
1725 | opObj.addParameter(name='phase_min', value=value1, format='float') | |
1725 | opObj.addParameter(name='phase_max', value=value2, format='float') |
|
1726 | opObj.addParameter(name='phase_max', value=value2, format='float') | |
1726 |
|
1727 | |||
1727 | if self.specGraphSaveCoherencemap.isChecked(): |
|
1728 | if self.specGraphSaveCoherencemap.isChecked(): | |
1728 | checkPath = True |
|
1729 | checkPath = True | |
1729 | opObj.addParameter(name='save', value='1', format='bool') |
|
1730 | opObj.addParameter(name='save', value='1', format='bool') | |
1730 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1731 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1731 | if figfile: |
|
1732 | if figfile: | |
1732 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1733 | opObj.addParameter(name='figfile', value=value, format='str') | |
1733 | if wrperiod: |
|
1734 | if wrperiod: | |
1734 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1735 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1735 |
|
1736 | |||
1736 | if self.specGraphftpCoherencemap.isChecked(): |
|
1737 | if self.specGraphftpCoherencemap.isChecked(): | |
1737 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1738 | opObj.addParameter(name='ftp', value='1', format='int') | |
1738 | self.addFTPConf2Operation(puObj, opObj) |
|
1739 | self.addFTPConf2Operation(puObj, opObj) | |
1739 | addFTP = True |
|
1740 | addFTP = True | |
1740 |
|
1741 | |||
1741 | if self.specGraphPowerprofile.isChecked(): |
|
1742 | if self.specGraphPowerprofile.isChecked(): | |
1742 |
|
1743 | |||
1743 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') |
|
1744 | opObj = puObj.addOperation(name='PowerProfilePlot', optype='other') | |
1744 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1745 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1745 |
|
1746 | |||
1746 | if not channelList == '': |
|
1747 | if not channelList == '': | |
1747 | if not isList(channelList): |
|
1748 | if not isList(channelList): | |
1748 | self.console.append("Invalid channelList") |
|
1749 | self.console.append("Invalid channelList") | |
1749 | return 0 |
|
1750 | return 0 | |
1750 |
|
1751 | |||
1751 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1752 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1752 |
|
1753 | |||
1753 | if not db_range == '': |
|
1754 | if not db_range == '': | |
1754 | xvalueList = db_range.split(',') |
|
1755 | xvalueList = db_range.split(',') | |
1755 | try: |
|
1756 | try: | |
1756 | value1 = float(xvalueList[0]) |
|
1757 | value1 = float(xvalueList[0]) | |
1757 | value2 = float(xvalueList[1]) |
|
1758 | value2 = float(xvalueList[1]) | |
1758 | except: |
|
1759 | except: | |
1759 | self.console.clear() |
|
1760 | self.console.clear() | |
1760 | self.console.append("Invalid db range") |
|
1761 | self.console.append("Invalid db range") | |
1761 | return 0 |
|
1762 | return 0 | |
1762 |
|
1763 | |||
1763 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1764 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1764 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1765 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1765 |
|
1766 | |||
1766 | if not hei_range == '': |
|
1767 | if not hei_range == '': | |
1767 | yvalueList = hei_range.split(",") |
|
1768 | yvalueList = hei_range.split(",") | |
1768 | try: |
|
1769 | try: | |
1769 | value1 = float(yvalueList[0]) |
|
1770 | value1 = float(yvalueList[0]) | |
1770 | value2 = float(yvalueList[1]) |
|
1771 | value2 = float(yvalueList[1]) | |
1771 | except: |
|
1772 | except: | |
1772 | self.console.clear() |
|
1773 | self.console.clear() | |
1773 | self.console.append("Invalid height range") |
|
1774 | self.console.append("Invalid height range") | |
1774 | return 0 |
|
1775 | return 0 | |
1775 |
|
1776 | |||
1776 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1777 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1777 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1778 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1778 |
|
1779 | |||
1779 | if self.specGraphSavePowerprofile.isChecked(): |
|
1780 | if self.specGraphSavePowerprofile.isChecked(): | |
1780 | checkPath = True |
|
1781 | checkPath = True | |
1781 | opObj.addParameter(name='save', value='1', format='bool') |
|
1782 | opObj.addParameter(name='save', value='1', format='bool') | |
1782 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1783 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1783 | if figfile: |
|
1784 | if figfile: | |
1784 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1785 | opObj.addParameter(name='figfile', value=value, format='str') | |
1785 | if wrperiod: |
|
1786 | if wrperiod: | |
1786 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1787 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1787 |
|
1788 | |||
1788 | if self.specGraphftpPowerprofile.isChecked(): |
|
1789 | if self.specGraphftpPowerprofile.isChecked(): | |
1789 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1790 | opObj.addParameter(name='ftp', value='1', format='int') | |
1790 | self.addFTPConf2Operation(puObj, opObj) |
|
1791 | self.addFTPConf2Operation(puObj, opObj) | |
1791 | addFTP = True |
|
1792 | addFTP = True | |
1792 | # rti noise |
|
1793 | # rti noise | |
1793 |
|
1794 | |||
1794 | if self.specGraphCebRTInoise.isChecked(): |
|
1795 | if self.specGraphCebRTInoise.isChecked(): | |
1795 |
|
1796 | |||
1796 | opObj = puObj.addOperation(name='Noise', optype='other') |
|
1797 | opObj = puObj.addOperation(name='Noise', optype='other') | |
1797 | opObj.addParameter(name='id', value=opObj.id, format='int') |
|
1798 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
1798 |
|
1799 | |||
1799 | if not channelList == '': |
|
1800 | if not channelList == '': | |
1800 | if not isList(channelList): |
|
1801 | if not isList(channelList): | |
1801 | self.console.append("Invalid channelList") |
|
1802 | self.console.append("Invalid channelList") | |
1802 | return 0 |
|
1803 | return 0 | |
1803 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
1804 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
1804 |
|
1805 | |||
1805 | # if not timerange == '': |
|
1806 | # if not timerange == '': | |
1806 | # try: |
|
1807 | # try: | |
1807 | # timerange = float(timerange) |
|
1808 | # timerange = float(timerange) | |
1808 | # except: |
|
1809 | # except: | |
1809 | # self.console.clear() |
|
1810 | # self.console.clear() | |
1810 | # self.console.append("Invalid time range") |
|
1811 | # self.console.append("Invalid time range") | |
1811 | # return 0 |
|
1812 | # return 0 | |
1812 | # |
|
1813 | # | |
1813 | # opObj.addParameter(name='timerange', value=timerange, format='float') |
|
1814 | # opObj.addParameter(name='timerange', value=timerange, format='float') | |
1814 |
|
1815 | |||
1815 | if not trange == '': |
|
1816 | if not trange == '': | |
1816 | xvalueList = trange.split(',') |
|
1817 | xvalueList = trange.split(',') | |
1817 | try: |
|
1818 | try: | |
1818 | value1 = float(xvalueList[0]) |
|
1819 | value1 = float(xvalueList[0]) | |
1819 | value2 = float(xvalueList[1]) |
|
1820 | value2 = float(xvalueList[1]) | |
1820 | except: |
|
1821 | except: | |
1821 | self.console.clear() |
|
1822 | self.console.clear() | |
1822 | self.console.append("Invalid time range") |
|
1823 | self.console.append("Invalid time range") | |
1823 | return 0 |
|
1824 | return 0 | |
1824 |
|
1825 | |||
1825 | opObj.addParameter(name='xmin', value=value1, format='float') |
|
1826 | opObj.addParameter(name='xmin', value=value1, format='float') | |
1826 | opObj.addParameter(name='xmax', value=value2, format='float') |
|
1827 | opObj.addParameter(name='xmax', value=value2, format='float') | |
1827 |
|
1828 | |||
1828 | if not db_range == '': |
|
1829 | if not db_range == '': | |
1829 | yvalueList = db_range.split(",") |
|
1830 | yvalueList = db_range.split(",") | |
1830 | try: |
|
1831 | try: | |
1831 | value1 = float(yvalueList[0]) |
|
1832 | value1 = float(yvalueList[0]) | |
1832 | value2 = float(yvalueList[1]) |
|
1833 | value2 = float(yvalueList[1]) | |
1833 | except: |
|
1834 | except: | |
1834 | self.console.clear() |
|
1835 | self.console.clear() | |
1835 | self.console.append("Invalid db range") |
|
1836 | self.console.append("Invalid db range") | |
1836 | return 0 |
|
1837 | return 0 | |
1837 |
|
1838 | |||
1838 | opObj.addParameter(name='ymin', value=value1, format='float') |
|
1839 | opObj.addParameter(name='ymin', value=value1, format='float') | |
1839 | opObj.addParameter(name='ymax', value=value2, format='float') |
|
1840 | opObj.addParameter(name='ymax', value=value2, format='float') | |
1840 |
|
1841 | |||
1841 | if self.specGraphSaveRTInoise.isChecked(): |
|
1842 | if self.specGraphSaveRTInoise.isChecked(): | |
1842 | checkPath = True |
|
1843 | checkPath = True | |
1843 | opObj.addParameter(name='save', value='1', format='bool') |
|
1844 | opObj.addParameter(name='save', value='1', format='bool') | |
1844 | opObj.addParameter(name='figpath', value=figpath, format='str') |
|
1845 | opObj.addParameter(name='figpath', value=figpath, format='str') | |
1845 | if figfile: |
|
1846 | if figfile: | |
1846 | opObj.addParameter(name='figfile', value=value, format='str') |
|
1847 | opObj.addParameter(name='figfile', value=value, format='str') | |
1847 | if wrperiod: |
|
1848 | if wrperiod: | |
1848 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') |
|
1849 | opObj.addParameter(name='wr_period', value=wrperiod,format='int') | |
1849 |
|
1850 | |||
1850 | # test_ftp |
|
1851 | # test_ftp | |
1851 | if self.specGraphftpRTInoise.isChecked(): |
|
1852 | if self.specGraphftpRTInoise.isChecked(): | |
1852 | opObj.addParameter(name='ftp', value='1', format='int') |
|
1853 | opObj.addParameter(name='ftp', value='1', format='int') | |
1853 | self.addFTPConf2Operation(puObj, opObj) |
|
1854 | self.addFTPConf2Operation(puObj, opObj) | |
1854 | addFTP = True |
|
1855 | addFTP = True | |
1855 |
|
1856 | |||
1856 | if checkPath: |
|
1857 | if checkPath: | |
1857 | if not figpath: |
|
1858 | if not figpath: | |
1858 | self.console.clear() |
|
1859 | self.console.clear() | |
1859 | self.console.append("Graphic path should be defined") |
|
1860 | self.console.append("Graphic path should be defined") | |
1860 | return 0 |
|
1861 | return 0 | |
1861 |
|
1862 | |||
1862 | if addFTP and not figpath: |
|
1863 | if addFTP and not figpath: | |
1863 | self.console.clear() |
|
1864 | self.console.clear() | |
1864 | self.console.append("You have to save the plots before sending them to FTP Server") |
|
1865 | self.console.append("You have to save the plots before sending them to FTP Server") | |
1865 | return 0 |
|
1866 | return 0 | |
1866 |
|
1867 | |||
1867 | # if something happend |
|
1868 | # if something happend | |
1868 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') |
|
1869 | parms_ok, output_path, blocksperfile, profilesperblock = self.checkInputsPUSave(datatype='Spectra') | |
1869 | if parms_ok: |
|
1870 | if parms_ok: | |
1870 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') |
|
1871 | opObj = puObj.addOperation(name='SpectraWriter', optype='other') | |
1871 | opObj.addParameter(name='path', value=output_path) |
|
1872 | opObj.addParameter(name='path', value=output_path) | |
1872 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') |
|
1873 | opObj.addParameter(name='blocksPerFile', value=blocksperfile, format='int') | |
1873 |
|
1874 | |||
1874 | self.console.clear() |
|
1875 | self.console.clear() | |
1875 | try: |
|
1876 | try: | |
1876 | self.refreshPUProperties(puObj) |
|
1877 | self.refreshPUProperties(puObj) | |
1877 | except: |
|
1878 | except: | |
1878 | self.console.append("An error reading input parameters was found ... Check them!") |
|
1879 | self.console.append("An error reading input parameters was found ... Check them!") | |
1879 | return 0 |
|
1880 | return 0 | |
1880 |
|
1881 | |||
1881 | self.console.append("Save your project and press Play button to start signal processing") |
|
1882 | self.console.append("Save your project and press Play button to start signal processing") | |
1882 |
|
1883 | |||
1883 | self._enable_play_button() |
|
1884 | self._enable_play_button() | |
1884 | self._enable_save_button() |
|
1885 | self._enable_save_button() | |
1885 |
|
1886 | |||
1886 | return 1 |
|
1887 | return 1 | |
1887 |
|
1888 | |||
1888 | """ |
|
1889 | """ | |
1889 | Spectra Graph |
|
1890 | Spectra Graph | |
1890 | """ |
|
1891 | """ | |
1891 | @pyqtSignature("int") |
|
1892 | @pyqtSignature("int") | |
1892 | def on_specGraphCebSpectraplot_stateChanged(self, p0): |
|
1893 | def on_specGraphCebSpectraplot_stateChanged(self, p0): | |
1893 |
|
1894 | |||
1894 | self.__checkSpecGraphFilters() |
|
1895 | self.__checkSpecGraphFilters() | |
1895 |
|
1896 | |||
1896 |
|
1897 | |||
1897 | @pyqtSignature("int") |
|
1898 | @pyqtSignature("int") | |
1898 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): |
|
1899 | def on_specGraphCebCrossSpectraplot_stateChanged(self, p0): | |
1899 |
|
1900 | |||
1900 | self.__checkSpecGraphFilters() |
|
1901 | self.__checkSpecGraphFilters() | |
1901 |
|
1902 | |||
1902 | @pyqtSignature("int") |
|
1903 | @pyqtSignature("int") | |
1903 | def on_specGraphCebRTIplot_stateChanged(self, p0): |
|
1904 | def on_specGraphCebRTIplot_stateChanged(self, p0): | |
1904 |
|
1905 | |||
1905 | self.__checkSpecGraphFilters() |
|
1906 | self.__checkSpecGraphFilters() | |
1906 |
|
1907 | |||
1907 |
|
1908 | |||
1908 | @pyqtSignature("int") |
|
1909 | @pyqtSignature("int") | |
1909 | def on_specGraphCebRTInoise_stateChanged(self, p0): |
|
1910 | def on_specGraphCebRTInoise_stateChanged(self, p0): | |
1910 |
|
1911 | |||
1911 | self.__checkSpecGraphFilters() |
|
1912 | self.__checkSpecGraphFilters() | |
1912 |
|
1913 | |||
1913 |
|
1914 | |||
1914 | @pyqtSignature("int") |
|
1915 | @pyqtSignature("int") | |
1915 | def on_specGraphCebCoherencmap_stateChanged(self, p0): |
|
1916 | def on_specGraphCebCoherencmap_stateChanged(self, p0): | |
1916 |
|
1917 | |||
1917 | self.__checkSpecGraphFilters() |
|
1918 | self.__checkSpecGraphFilters() | |
1918 |
|
1919 | |||
1919 | @pyqtSignature("int") |
|
1920 | @pyqtSignature("int") | |
1920 | def on_specGraphPowerprofile_stateChanged(self, p0): |
|
1921 | def on_specGraphPowerprofile_stateChanged(self, p0): | |
1921 |
|
1922 | |||
1922 | self.__checkSpecGraphFilters() |
|
1923 | self.__checkSpecGraphFilters() | |
1923 |
|
1924 | |||
1924 | @pyqtSignature("int") |
|
1925 | @pyqtSignature("int") | |
1925 | def on_specGraphPhase_stateChanged(self, p0): |
|
1926 | def on_specGraphPhase_stateChanged(self, p0): | |
1926 |
|
1927 | |||
1927 | self.__checkSpecGraphFilters() |
|
1928 | self.__checkSpecGraphFilters() | |
1928 |
|
1929 | |||
1929 | @pyqtSignature("int") |
|
1930 | @pyqtSignature("int") | |
1930 | def on_specGraphSaveSpectra_stateChanged(self, p0): |
|
1931 | def on_specGraphSaveSpectra_stateChanged(self, p0): | |
1931 | """ |
|
1932 | """ | |
1932 | """ |
|
1933 | """ | |
1933 | self.__checkSpecGraphSaving() |
|
1934 | self.__checkSpecGraphSaving() | |
1934 |
|
1935 | |||
1935 | @pyqtSignature("int") |
|
1936 | @pyqtSignature("int") | |
1936 | def on_specGraphSaveCross_stateChanged(self, p0): |
|
1937 | def on_specGraphSaveCross_stateChanged(self, p0): | |
1937 |
|
1938 | |||
1938 | self.__checkSpecGraphSaving() |
|
1939 | self.__checkSpecGraphSaving() | |
1939 |
|
1940 | |||
1940 | @pyqtSignature("int") |
|
1941 | @pyqtSignature("int") | |
1941 | def on_specGraphSaveRTIplot_stateChanged(self, p0): |
|
1942 | def on_specGraphSaveRTIplot_stateChanged(self, p0): | |
1942 |
|
1943 | |||
1943 | self.__checkSpecGraphSaving() |
|
1944 | self.__checkSpecGraphSaving() | |
1944 |
|
1945 | |||
1945 | @pyqtSignature("int") |
|
1946 | @pyqtSignature("int") | |
1946 | def on_specGraphSaveRTInoise_stateChanged(self, p0): |
|
1947 | def on_specGraphSaveRTInoise_stateChanged(self, p0): | |
1947 |
|
1948 | |||
1948 | self.__checkSpecGraphSaving() |
|
1949 | self.__checkSpecGraphSaving() | |
1949 |
|
1950 | |||
1950 | @pyqtSignature("int") |
|
1951 | @pyqtSignature("int") | |
1951 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): |
|
1952 | def on_specGraphSaveCoherencemap_stateChanged(self, p0): | |
1952 |
|
1953 | |||
1953 | self.__checkSpecGraphSaving() |
|
1954 | self.__checkSpecGraphSaving() | |
1954 |
|
1955 | |||
1955 | @pyqtSignature("int") |
|
1956 | @pyqtSignature("int") | |
1956 | def on_specGraphSavePowerprofile_stateChanged(self, p0): |
|
1957 | def on_specGraphSavePowerprofile_stateChanged(self, p0): | |
1957 |
|
1958 | |||
1958 | self.__checkSpecGraphSaving() |
|
1959 | self.__checkSpecGraphSaving() | |
1959 |
|
1960 | |||
1960 | @pyqtSignature("int") |
|
1961 | @pyqtSignature("int") | |
1961 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1962 | def on_specGraphftpSpectra_stateChanged(self, p0): | |
1962 | """ |
|
1963 | """ | |
1963 | """ |
|
1964 | """ | |
1964 | self.__checkSpecGraphFTP() |
|
1965 | self.__checkSpecGraphFTP() | |
1965 |
|
1966 | |||
1966 |
|
1967 | |||
1967 | @pyqtSignature("int") |
|
1968 | @pyqtSignature("int") | |
1968 | def on_specGraphftpCross_stateChanged(self, p0): |
|
1969 | def on_specGraphftpCross_stateChanged(self, p0): | |
1969 |
|
1970 | |||
1970 | self.__checkSpecGraphFTP() |
|
1971 | self.__checkSpecGraphFTP() | |
1971 |
|
1972 | |||
1972 | @pyqtSignature("int") |
|
1973 | @pyqtSignature("int") | |
1973 | def on_specGraphftpRTIplot_stateChanged(self, p0): |
|
1974 | def on_specGraphftpRTIplot_stateChanged(self, p0): | |
1974 |
|
1975 | |||
1975 | self.__checkSpecGraphFTP() |
|
1976 | self.__checkSpecGraphFTP() | |
1976 |
|
1977 | |||
1977 | @pyqtSignature("int") |
|
1978 | @pyqtSignature("int") | |
1978 | def on_specGraphftpRTInoise_stateChanged(self, p0): |
|
1979 | def on_specGraphftpRTInoise_stateChanged(self, p0): | |
1979 |
|
1980 | |||
1980 | self.__checkSpecGraphFTP() |
|
1981 | self.__checkSpecGraphFTP() | |
1981 |
|
1982 | |||
1982 | @pyqtSignature("int") |
|
1983 | @pyqtSignature("int") | |
1983 | def on_specGraphftpCoherencemap_stateChanged(self, p0): |
|
1984 | def on_specGraphftpCoherencemap_stateChanged(self, p0): | |
1984 |
|
1985 | |||
1985 | self.__checkSpecGraphFTP() |
|
1986 | self.__checkSpecGraphFTP() | |
1986 |
|
1987 | |||
1987 | @pyqtSignature("int") |
|
1988 | @pyqtSignature("int") | |
1988 | def on_specGraphftpPowerprofile_stateChanged(self, p0): |
|
1989 | def on_specGraphftpPowerprofile_stateChanged(self, p0): | |
1989 |
|
1990 | |||
1990 | self.__checkSpecGraphFTP() |
|
1991 | self.__checkSpecGraphFTP() | |
1991 |
|
1992 | |||
1992 | @pyqtSignature("") |
|
1993 | @pyqtSignature("") | |
1993 | def on_specGraphToolPath_clicked(self): |
|
1994 | def on_specGraphToolPath_clicked(self): | |
1994 | """ |
|
1995 | """ | |
1995 | """ |
|
1996 | """ | |
1996 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
1997 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
1997 | self.specGraphPath.setText(save_path) |
|
1998 | self.specGraphPath.setText(save_path) | |
1998 | if not os.path.exists(save_path): |
|
1999 | if not os.path.exists(save_path): | |
1999 | self.console.clear() |
|
2000 | self.console.clear() | |
2000 | self.console.append("Write a valid path") |
|
2001 | self.console.append("Write a valid path") | |
2001 | return |
|
2002 | return | |
2002 |
|
2003 | |||
2003 | @pyqtSignature("") |
|
2004 | @pyqtSignature("") | |
2004 | def on_specGraphClear_clicked(self): |
|
2005 | def on_specGraphClear_clicked(self): | |
2005 | return |
|
2006 | return | |
2006 |
|
2007 | |||
2007 | @pyqtSignature("") |
|
2008 | @pyqtSignature("") | |
2008 | def on_specHeisGraphToolPath_clicked(self): |
|
2009 | def on_specHeisGraphToolPath_clicked(self): | |
2009 | """ |
|
2010 | """ | |
2010 | """ |
|
2011 | """ | |
2011 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) |
|
2012 | save_path = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
2012 | self.specHeisGraphPath.setText(save_path) |
|
2013 | self.specHeisGraphPath.setText(save_path) | |
2013 | if not os.path.exists(save_path): |
|
2014 | if not os.path.exists(save_path): | |
2014 | self.console.clear() |
|
2015 | self.console.clear() | |
2015 | self.console.append("Write a valid path") |
|
2016 | self.console.append("Write a valid path") | |
2016 | return |
|
2017 | return | |
2017 |
|
2018 | |||
2018 | @pyqtSignature("int") |
|
2019 | @pyqtSignature("int") | |
2019 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): |
|
2020 | def on_specHeisOpCebIncoherent_stateChanged(self, p0): | |
2020 | """ |
|
2021 | """ | |
2021 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . |
|
2022 | Habilita la opcion de aοΏ½adir el parοΏ½metro integraciones incoherentes a la Unidad de Procesamiento . | |
2022 | """ |
|
2023 | """ | |
2023 | if p0 == 2: |
|
2024 | if p0 == 2: | |
2024 | self.specHeisOpIncoherent.setEnabled(True) |
|
2025 | self.specHeisOpIncoherent.setEnabled(True) | |
2025 | self.specHeisOpCobIncInt.setEnabled(True) |
|
2026 | self.specHeisOpCobIncInt.setEnabled(True) | |
2026 | if p0 == 0: |
|
2027 | if p0 == 0: | |
2027 | self.specHeisOpIncoherent.setEnabled(False) |
|
2028 | self.specHeisOpIncoherent.setEnabled(False) | |
2028 | self.specHeisOpCobIncInt.setEnabled(False) |
|
2029 | self.specHeisOpCobIncInt.setEnabled(False) | |
2029 |
|
2030 | |||
2030 | @pyqtSignature("") |
|
2031 | @pyqtSignature("") | |
2031 | def on_specHeisOpOk_clicked(self): |
|
2032 | def on_specHeisOpOk_clicked(self): | |
2032 | """ |
|
2033 | """ | |
2033 | AΓADE OPERACION SPECTRAHEIS |
|
2034 | AΓADE OPERACION SPECTRAHEIS | |
2034 | """ |
|
2035 | """ | |
2035 | addFTP = False |
|
2036 | addFTP = False | |
2036 | checkPath = False |
|
2037 | checkPath = False | |
2037 |
|
2038 | |||
2038 | self._disable_play_button() |
|
2039 | self._disable_play_button() | |
2039 | self._disable_save_button() |
|
2040 | self._disable_save_button() | |
2040 |
|
2041 | |||
2041 | self.console.clear() |
|
2042 | self.console.clear() | |
2042 | self.console.append("Checking input parameters ...") |
|
2043 | self.console.append("Checking input parameters ...") | |
2043 |
|
2044 | |||
2044 | puObj = self.getSelectedItemObj() |
|
2045 | puObj = self.getSelectedItemObj() | |
2045 | puObj.removeOperations() |
|
2046 | puObj.removeOperations() | |
2046 |
|
2047 | |||
2047 | if self.specHeisOpCebIncoherent.isChecked(): |
|
2048 | if self.specHeisOpCebIncoherent.isChecked(): | |
2048 | value = str(self.specHeisOpIncoherent.text()) |
|
2049 | value = str(self.specHeisOpIncoherent.text()) | |
2049 | name_operation = 'IncohInt4SpectraHeis' |
|
2050 | name_operation = 'IncohInt4SpectraHeis' | |
2050 | optype = 'other' |
|
2051 | optype = 'other' | |
2051 |
|
2052 | |||
2052 | name_parameter = 'timeInterval' |
|
2053 | name_parameter = 'timeInterval' | |
2053 | format = 'float' |
|
2054 | format = 'float' | |
2054 |
|
2055 | |||
2055 | if self.specOpCobIncInt.currentIndex() == 0: |
|
2056 | if self.specOpCobIncInt.currentIndex() == 0: | |
2056 | name_parameter = 'timeInterval' |
|
2057 | name_parameter = 'timeInterval' | |
2057 | format = 'float' |
|
2058 | format = 'float' | |
2058 |
|
2059 | |||
2059 | if not isFloat(value): |
|
2060 | if not isFloat(value): | |
2060 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2061 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2061 | return 0 |
|
2062 | return 0 | |
2062 |
|
2063 | |||
2063 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2064 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2064 |
|
2065 | |||
2065 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2066 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2066 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2067 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2067 | return 0 |
|
2068 | return 0 | |
2068 |
|
2069 | |||
2069 | channelList = str(self.specHeisGgraphChannelList.text()) |
|
2070 | channelList = str(self.specHeisGgraphChannelList.text()) | |
2070 | freq_range = str(self.specHeisGgraphXminXmax.text()) |
|
2071 | freq_range = str(self.specHeisGgraphXminXmax.text()) | |
2071 | power_range = str(self.specHeisGgraphYminYmax.text()) |
|
2072 | power_range = str(self.specHeisGgraphYminYmax.text()) | |
2072 | time_range = str(self.specHeisGgraphTminTmax.text()) |
|
2073 | time_range = str(self.specHeisGgraphTminTmax.text()) | |
2073 | timerange = str(self.specHeisGgraphTimeRange.text()) |
|
2074 | timerange = str(self.specHeisGgraphTimeRange.text()) | |
2074 |
|
2075 | |||
2075 | # ---- Spectra Plot----- |
|
2076 | # ---- Spectra Plot----- | |
2076 | if self.specHeisGraphCebSpectraplot.isChecked(): |
|
2077 | if self.specHeisGraphCebSpectraplot.isChecked(): | |
2077 |
|
2078 | |||
2078 | name_operation = 'SpectraHeisScope' |
|
2079 | name_operation = 'SpectraHeisScope' | |
2079 | optype = 'other' |
|
2080 | optype = 'other' | |
2080 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2081 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2081 |
|
2082 | |||
2082 | name_parameter = 'id' |
|
2083 | name_parameter = 'id' | |
2083 | format = 'int' |
|
2084 | format = 'int' | |
2084 | value = opObj.id |
|
2085 | value = opObj.id | |
2085 |
|
2086 | |||
2086 | if not opObj.addParameter(name=name_parameter, value=value, format=format): |
|
2087 | if not opObj.addParameter(name=name_parameter, value=value, format=format): | |
2087 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) |
|
2088 | self.console.append("Invalid value '%s' for '%s'" %(value, name_parameter)) | |
2088 | return 0 |
|
2089 | return 0 | |
2089 |
|
2090 | |||
2090 | if not (channelList == ''): |
|
2091 | if not (channelList == ''): | |
2091 | name_parameter = 'channelList' |
|
2092 | name_parameter = 'channelList' | |
2092 | format = 'intlist' |
|
2093 | format = 'intlist' | |
2093 |
|
2094 | |||
2094 | if not isList(channelList): |
|
2095 | if not isList(channelList): | |
2095 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) |
|
2096 | self.console.append("Invalid value '%s' for '%s'" %(channelList, name_parameter)) | |
2096 | return 0 |
|
2097 | return 0 | |
2097 |
|
2098 | |||
2098 | opObj.addParameter(name=name_parameter, value=channelList, format=format) |
|
2099 | opObj.addParameter(name=name_parameter, value=channelList, format=format) | |
2099 |
|
2100 | |||
2100 | if not freq_range == '': |
|
2101 | if not freq_range == '': | |
2101 | xvalueList = freq_range.split(',') |
|
2102 | xvalueList = freq_range.split(',') | |
2102 |
|
2103 | |||
2103 | if len(xvalueList) != 2: |
|
2104 | if len(xvalueList) != 2: | |
2104 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2105 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2105 | return 0 |
|
2106 | return 0 | |
2106 |
|
2107 | |||
2107 | value1 = xvalueList[0] |
|
2108 | value1 = xvalueList[0] | |
2108 | value2 = xvalueList[1] |
|
2109 | value2 = xvalueList[1] | |
2109 |
|
2110 | |||
2110 | if not isFloat(value1) or not isFloat(value2): |
|
2111 | if not isFloat(value1) or not isFloat(value2): | |
2111 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) |
|
2112 | self.console.append("Invalid value '%s' for '%s'" %(freq_range, "xrange")) | |
2112 | return 0 |
|
2113 | return 0 | |
2113 |
|
2114 | |||
2114 | name1 = 'xmin' |
|
2115 | name1 = 'xmin' | |
2115 | name2 = 'xmax' |
|
2116 | name2 = 'xmax' | |
2116 | format = 'float' |
|
2117 | format = 'float' | |
2117 |
|
2118 | |||
2118 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2119 | opObj.addParameter(name=name1, value=value1, format=format) | |
2119 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2120 | opObj.addParameter(name=name2, value=value2, format=format) | |
2120 |
|
2121 | |||
2121 | #------specHeisGgraphYmin-Ymax--- |
|
2122 | #------specHeisGgraphYmin-Ymax--- | |
2122 | if not power_range == '': |
|
2123 | if not power_range == '': | |
2123 | yvalueList = power_range.split(",") |
|
2124 | yvalueList = power_range.split(",") | |
2124 |
|
2125 | |||
2125 | if len(yvalueList) != 2: |
|
2126 | if len(yvalueList) != 2: | |
2126 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) |
|
2127 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "xrange")) | |
2127 | return 0 |
|
2128 | return 0 | |
2128 |
|
2129 | |||
2129 | value1 = yvalueList[0] |
|
2130 | value1 = yvalueList[0] | |
2130 | value2 = yvalueList[1] |
|
2131 | value2 = yvalueList[1] | |
2131 |
|
2132 | |||
2132 | if not isFloat(value1) or not isFloat(value2): |
|
2133 | if not isFloat(value1) or not isFloat(value2): | |
2133 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) |
|
2134 | self.console.append("Invalid value '%s' for '%s'" %(power_range, "yrange")) | |
2134 | return 0 |
|
2135 | return 0 | |
2135 |
|
2136 | |||
2136 | name1 = 'ymin' |
|
2137 | name1 = 'ymin' | |
2137 | name2 = 'ymax' |
|
2138 | name2 = 'ymax' | |
2138 | format = 'float' |
|
2139 | format = 'float' | |
2139 | opObj.addParameter(name=name1, value=value1, format=format) |
|
2140 | opObj.addParameter(name=name1, value=value1, format=format) | |
2140 | opObj.addParameter(name=name2, value=value2, format=format) |
|
2141 | opObj.addParameter(name=name2, value=value2, format=format) | |
2141 |
|
2142 | |||
2142 | if self.specHeisGraphSaveSpectra.isChecked(): |
|
2143 | if self.specHeisGraphSaveSpectra.isChecked(): | |
2143 | checkPath = True |
|
2144 | checkPath = True | |
2144 | name_parameter1 = 'save' |
|
2145 | name_parameter1 = 'save' | |
2145 | name_parameter2 = 'figpath' |
|
2146 | name_parameter2 = 'figpath' | |
2146 | name_parameter3 = 'figfile' |
|
2147 | name_parameter3 = 'figfile' | |
2147 | value1 = '1' |
|
2148 | value1 = '1' | |
2148 | value2 = str(self.specHeisGraphPath.text()) |
|
2149 | value2 = str(self.specHeisGraphPath.text()) | |
2149 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2150 | value3 = str(self.specHeisGraphPrefix.text()) | |
2150 | format1 = 'bool' |
|
2151 | format1 = 'bool' | |
2151 | format2 = 'str' |
|
2152 | format2 = 'str' | |
2152 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) |
|
2153 | opObj.addParameter(name=name_parameter1, value=value1 , format=format1) | |
2153 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2154 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2154 | if not value3 == "": |
|
2155 | if not value3 == "": | |
2155 | try: |
|
2156 | try: | |
2156 | value3 = str(self.specHeisGraphPrefix.text()) |
|
2157 | value3 = str(self.specHeisGraphPrefix.text()) | |
2157 | except: |
|
2158 | except: | |
2158 | self.console.clear() |
|
2159 | self.console.clear() | |
2159 | self.console.append("Please Write prefix") |
|
2160 | self.console.append("Please Write prefix") | |
2160 | return 0 |
|
2161 | return 0 | |
2161 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') |
|
2162 | opObj.addParameter(name='figfile', value=str(self.specHeisGraphPrefix.text()), format='str') | |
2162 |
|
2163 | |||
2163 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) |
|
2164 | # opObj.addParameter(name=name_parameter3, value=value3, format=format2) | |
2164 | # opObj.addParameter(name='wr_period', value='5',format='int') |
|
2165 | # opObj.addParameter(name='wr_period', value='5',format='int') | |
2165 |
|
2166 | |||
2166 | if self.specHeisGraphftpSpectra.isChecked(): |
|
2167 | if self.specHeisGraphftpSpectra.isChecked(): | |
2167 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2168 | opObj.addParameter(name='ftp', value='1', format='int') | |
2168 | self.addFTPConf2Operation(puObj, opObj) |
|
2169 | self.addFTPConf2Operation(puObj, opObj) | |
2169 | addFTP = True |
|
2170 | addFTP = True | |
2170 |
|
2171 | |||
2171 | if self.specHeisGraphCebRTIplot.isChecked(): |
|
2172 | if self.specHeisGraphCebRTIplot.isChecked(): | |
2172 | name_operation = 'RTIfromSpectraHeis' |
|
2173 | name_operation = 'RTIfromSpectraHeis' | |
2173 | optype = 'other' |
|
2174 | optype = 'other' | |
2174 |
|
2175 | |||
2175 | name_parameter = 'id' |
|
2176 | name_parameter = 'id' | |
2176 | format = 'int' |
|
2177 | format = 'int' | |
2177 |
|
2178 | |||
2178 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2179 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2179 | value = opObj.id |
|
2180 | value = opObj.id | |
2180 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
2181 | opObj.addParameter(name=name_parameter, value=value, format=format) | |
2181 |
|
2182 | |||
2182 | if not channelList == '': |
|
2183 | if not channelList == '': | |
2183 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
|
2184 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
2184 |
|
2185 | |||
2185 | if not time_range == '': |
|
2186 | if not time_range == '': | |
2186 | xvalueList = time_range.split(',') |
|
2187 | xvalueList = time_range.split(',') | |
2187 | try: |
|
2188 | try: | |
2188 | value = float(xvalueList[0]) |
|
2189 | value = float(xvalueList[0]) | |
2189 | value = float(xvalueList[1]) |
|
2190 | value = float(xvalueList[1]) | |
2190 | except: |
|
2191 | except: | |
2191 | return 0 |
|
2192 | return 0 | |
2192 | format = 'float' |
|
2193 | format = 'float' | |
2193 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) |
|
2194 | opObj.addParameter(name='xmin', value=xvalueList[0], format=format) | |
2194 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) |
|
2195 | opObj.addParameter(name='xmax', value=xvalueList[1], format=format) | |
2195 |
|
2196 | |||
2196 | if not timerange == '': |
|
2197 | if not timerange == '': | |
2197 | format = 'int' |
|
2198 | format = 'int' | |
2198 | try: |
|
2199 | try: | |
2199 | timerange = int(timerange) |
|
2200 | timerange = int(timerange) | |
2200 | except: |
|
2201 | except: | |
2201 | return 0 |
|
2202 | return 0 | |
2202 | opObj.addParameter(name='timerange', value=timerange, format=format) |
|
2203 | opObj.addParameter(name='timerange', value=timerange, format=format) | |
2203 |
|
2204 | |||
2204 |
|
2205 | |||
2205 | if not power_range == '': |
|
2206 | if not power_range == '': | |
2206 | yvalueList = power_range.split(",") |
|
2207 | yvalueList = power_range.split(",") | |
2207 | try: |
|
2208 | try: | |
2208 | value = float(yvalueList[0]) |
|
2209 | value = float(yvalueList[0]) | |
2209 | value = float(yvalueList[1]) |
|
2210 | value = float(yvalueList[1]) | |
2210 | except: |
|
2211 | except: | |
2211 | return 0 |
|
2212 | return 0 | |
2212 |
|
2213 | |||
2213 | format = 'float' |
|
2214 | format = 'float' | |
2214 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) |
|
2215 | opObj.addParameter(name='ymin', value=yvalueList[0], format=format) | |
2215 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) |
|
2216 | opObj.addParameter(name='ymax', value=yvalueList[1], format=format) | |
2216 |
|
2217 | |||
2217 | if self.specHeisGraphSaveRTIplot.isChecked(): |
|
2218 | if self.specHeisGraphSaveRTIplot.isChecked(): | |
2218 | checkPath = True |
|
2219 | checkPath = True | |
2219 | opObj.addParameter(name='save', value='1', format='bool') |
|
2220 | opObj.addParameter(name='save', value='1', format='bool') | |
2220 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') |
|
2221 | opObj.addParameter(name='figpath', value=str(self.specHeisGraphPath.text()), format='str') | |
2221 | value = str(self.specHeisGraphPrefix.text()) |
|
2222 | value = str(self.specHeisGraphPrefix.text()) | |
2222 | if not value == "": |
|
2223 | if not value == "": | |
2223 | try: |
|
2224 | try: | |
2224 | value = str(self.specHeisGraphPrefix.text()) |
|
2225 | value = str(self.specHeisGraphPrefix.text()) | |
2225 | except: |
|
2226 | except: | |
2226 | self.console.clear() |
|
2227 | self.console.clear() | |
2227 | self.console.append("Please Write prefix") |
|
2228 | self.console.append("Please Write prefix") | |
2228 | return 0 |
|
2229 | return 0 | |
2229 | opObj.addParameter(name='figfile', value=value, format='str') |
|
2230 | opObj.addParameter(name='figfile', value=value, format='str') | |
2230 |
|
2231 | |||
2231 | # test_ftp |
|
2232 | # test_ftp | |
2232 | if self.specHeisGraphftpRTIplot.isChecked(): |
|
2233 | if self.specHeisGraphftpRTIplot.isChecked(): | |
2233 | opObj.addParameter(name='ftp', value='1', format='int') |
|
2234 | opObj.addParameter(name='ftp', value='1', format='int') | |
2234 | self.addFTPConf2Operation(puObj, opObj) |
|
2235 | self.addFTPConf2Operation(puObj, opObj) | |
2235 | addFTP = True |
|
2236 | addFTP = True | |
2236 |
|
2237 | |||
2237 | localfolder = None |
|
2238 | localfolder = None | |
2238 | if checkPath: |
|
2239 | if checkPath: | |
2239 | localfolder = str(self.specHeisGraphPath.text()) |
|
2240 | localfolder = str(self.specHeisGraphPath.text()) | |
2240 | if localfolder == '': |
|
2241 | if localfolder == '': | |
2241 | self.console.clear() |
|
2242 | self.console.clear() | |
2242 | self.console.append("Graphic path should be defined") |
|
2243 | self.console.append("Graphic path should be defined") | |
2243 | return 0 |
|
2244 | return 0 | |
2244 |
|
2245 | |||
2245 | if addFTP and not localfolder: |
|
2246 | if addFTP and not localfolder: | |
2246 | self.console.clear() |
|
2247 | self.console.clear() | |
2247 | self.console.append("You should save plots before send them to FTP Server") |
|
2248 | self.console.append("You should save plots before send them to FTP Server") | |
2248 | return 0 |
|
2249 | return 0 | |
2249 |
|
2250 | |||
2250 | # if something happened |
|
2251 | # if something happened | |
2251 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') |
|
2252 | parms_ok, output_path, blocksperfile, metadata_file = self.checkInputsPUSave(datatype='SpectraHeis') | |
2252 | if parms_ok: |
|
2253 | if parms_ok: | |
2253 | name_operation = 'FitsWriter' |
|
2254 | name_operation = 'FitsWriter' | |
2254 | optype = 'other' |
|
2255 | optype = 'other' | |
2255 | name_parameter1 = 'path' |
|
2256 | name_parameter1 = 'path' | |
2256 | name_parameter2 = 'dataBlocksPerFile' |
|
2257 | name_parameter2 = 'dataBlocksPerFile' | |
2257 | name_parameter3 = 'metadatafile' |
|
2258 | name_parameter3 = 'metadatafile' | |
2258 | value1 = output_path |
|
2259 | value1 = output_path | |
2259 | value2 = blocksperfile |
|
2260 | value2 = blocksperfile | |
2260 | value3 = metadata_file |
|
2261 | value3 = metadata_file | |
2261 | format2 = "int" |
|
2262 | format2 = "int" | |
2262 | format3 = "str" |
|
2263 | format3 = "str" | |
2263 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
2264 | opObj = puObj.addOperation(name=name_operation, optype=optype) | |
2264 |
|
2265 | |||
2265 | opObj.addParameter(name=name_parameter1, value=value1) |
|
2266 | opObj.addParameter(name=name_parameter1, value=value1) | |
2266 |
|
2267 | |||
2267 | if blocksperfile: |
|
2268 | if blocksperfile: | |
2268 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) |
|
2269 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
2269 |
|
2270 | |||
2270 | if metadata_file: |
|
2271 | if metadata_file: | |
2271 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) |
|
2272 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
2272 |
|
2273 | |||
2273 | self.console.clear() |
|
2274 | self.console.clear() | |
2274 | try: |
|
2275 | try: | |
2275 | self.refreshPUProperties(puObj) |
|
2276 | self.refreshPUProperties(puObj) | |
2276 | except: |
|
2277 | except: | |
2277 | self.console.append("An error reading input parameters was found ... Check them!") |
|
2278 | self.console.append("An error reading input parameters was found ... Check them!") | |
2278 | return 0 |
|
2279 | return 0 | |
2279 |
|
2280 | |||
2280 | self.console.append("Save your project and press Play button to start signal processing") |
|
2281 | self.console.append("Save your project and press Play button to start signal processing") | |
2281 |
|
2282 | |||
2282 | self._enable_save_button() |
|
2283 | self._enable_save_button() | |
2283 | self._enable_play_button() |
|
2284 | self._enable_play_button() | |
2284 |
|
2285 | |||
2285 | return 1 |
|
2286 | return 1 | |
2286 | @pyqtSignature("int") |
|
2287 | @pyqtSignature("int") | |
2287 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): |
|
2288 | def on_specHeisGraphCebSpectraplot_stateChanged(self, p0): | |
2288 |
|
2289 | |||
2289 | if p0 == 2: |
|
2290 | if p0 == 2: | |
2290 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2291 | self.specHeisGgraphChannelList.setEnabled(True) | |
2291 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
2292 | self.specHeisGgraphXminXmax.setEnabled(True) | |
2292 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2293 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2293 | if p0 == 0: |
|
2294 | if p0 == 0: | |
2294 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
2295 | self.specHeisGgraphXminXmax.setEnabled(False) | |
2295 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2296 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2296 |
|
2297 | |||
2297 | @pyqtSignature("int") |
|
2298 | @pyqtSignature("int") | |
2298 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): |
|
2299 | def on_specHeisGraphCebRTIplot_stateChanged(self, p0): | |
2299 |
|
2300 | |||
2300 | if p0 == 2: |
|
2301 | if p0 == 2: | |
2301 | self.specHeisGgraphChannelList.setEnabled(True) |
|
2302 | self.specHeisGgraphChannelList.setEnabled(True) | |
2302 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
2303 | self.specHeisGgraphTminTmax.setEnabled(True) | |
2303 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
2304 | self.specHeisGgraphYminYmax.setEnabled(True) | |
2304 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
2305 | self.specHeisGgraphTimeRange.setEnabled(True) | |
2305 |
|
2306 | |||
2306 | if p0 == 0: |
|
2307 | if p0 == 0: | |
2307 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
2308 | self.specHeisGgraphTminTmax.setEnabled(False) | |
2308 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
2309 | self.specHeisGgraphYminYmax.setEnabled(False) | |
2309 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
2310 | self.specHeisGgraphTimeRange.setEnabled(False) | |
2310 |
|
2311 | |||
2311 | @pyqtSignature("int") |
|
2312 | @pyqtSignature("int") | |
2312 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): |
|
2313 | def on_specHeisGraphSaveSpectra_stateChanged(self, p0): | |
2313 | """ |
|
2314 | """ | |
2314 | """ |
|
2315 | """ | |
2315 | if p0 == 2: |
|
2316 | if p0 == 2: | |
2316 | self.specHeisGraphPath.setEnabled(True) |
|
2317 | self.specHeisGraphPath.setEnabled(True) | |
2317 | self.specHeisGraphPrefix.setEnabled(True) |
|
2318 | self.specHeisGraphPrefix.setEnabled(True) | |
2318 | self.specHeisGraphToolPath.setEnabled(True) |
|
2319 | self.specHeisGraphToolPath.setEnabled(True) | |
2319 | if p0 == 0: |
|
2320 | if p0 == 0: | |
2320 | self.specHeisGraphPath.setEnabled(False) |
|
2321 | self.specHeisGraphPath.setEnabled(False) | |
2321 | self.specHeisGraphPrefix.setEnabled(False) |
|
2322 | self.specHeisGraphPrefix.setEnabled(False) | |
2322 | self.specHeisGraphToolPath.setEnabled(False) |
|
2323 | self.specHeisGraphToolPath.setEnabled(False) | |
2323 |
|
2324 | |||
2324 | @pyqtSignature("int") |
|
2325 | @pyqtSignature("int") | |
2325 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): |
|
2326 | def on_specHeisGraphSaveRTIplot_stateChanged(self, p0): | |
2326 | if p0 == 2: |
|
2327 | if p0 == 2: | |
2327 | self.specHeisGraphPath.setEnabled(True) |
|
2328 | self.specHeisGraphPath.setEnabled(True) | |
2328 | self.specHeisGraphPrefix.setEnabled(True) |
|
2329 | self.specHeisGraphPrefix.setEnabled(True) | |
2329 | self.specHeisGraphToolPath.setEnabled(True) |
|
2330 | self.specHeisGraphToolPath.setEnabled(True) | |
2330 |
|
2331 | |||
2331 | @pyqtSignature("int") |
|
2332 | @pyqtSignature("int") | |
2332 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): |
|
2333 | def on_specHeisGraphftpSpectra_stateChanged(self, p0): | |
2333 | """ |
|
2334 | """ | |
2334 | """ |
|
2335 | """ | |
2335 | if p0 == 2: |
|
2336 | if p0 == 2: | |
2336 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2337 | self.specHeisGgraphftpratio.setEnabled(True) | |
2337 |
|
2338 | |||
2338 | if p0 == 0: |
|
2339 | if p0 == 0: | |
2339 | self.specHeisGgraphftpratio.setEnabled(False) |
|
2340 | self.specHeisGgraphftpratio.setEnabled(False) | |
2340 |
|
2341 | |||
2341 | @pyqtSignature("int") |
|
2342 | @pyqtSignature("int") | |
2342 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): |
|
2343 | def on_specHeisGraphftpRTIplot_stateChanged(self, p0): | |
2343 | if p0 == 2: |
|
2344 | if p0 == 2: | |
2344 | self.specHeisGgraphftpratio.setEnabled(True) |
|
2345 | self.specHeisGgraphftpratio.setEnabled(True) | |
2345 |
|
2346 | |||
2346 | @pyqtSignature("") |
|
2347 | @pyqtSignature("") | |
2347 | def on_specHeisGraphClear_clicked(self): |
|
2348 | def on_specHeisGraphClear_clicked(self): | |
2348 | pass |
|
2349 | pass | |
2349 |
|
2350 | |||
2350 | def __checkSpecGraphSaving(self): |
|
2351 | def __checkSpecGraphSaving(self): | |
2351 |
|
2352 | |||
2352 | enable = False |
|
2353 | enable = False | |
2353 |
|
2354 | |||
2354 | if self.specGraphSaveSpectra.checkState(): |
|
2355 | if self.specGraphSaveSpectra.checkState(): | |
2355 | enable = True |
|
2356 | enable = True | |
2356 |
|
2357 | |||
2357 | if self.specGraphSaveCross.checkState(): |
|
2358 | if self.specGraphSaveCross.checkState(): | |
2358 | enable = True |
|
2359 | enable = True | |
2359 |
|
2360 | |||
2360 | if self.specGraphSaveRTIplot.checkState(): |
|
2361 | if self.specGraphSaveRTIplot.checkState(): | |
2361 | enable = True |
|
2362 | enable = True | |
2362 |
|
2363 | |||
2363 | if self.specGraphSaveCoherencemap.checkState(): |
|
2364 | if self.specGraphSaveCoherencemap.checkState(): | |
2364 | enable = True |
|
2365 | enable = True | |
2365 |
|
2366 | |||
2366 | if self.specGraphSavePowerprofile.checkState(): |
|
2367 | if self.specGraphSavePowerprofile.checkState(): | |
2367 | enable = True |
|
2368 | enable = True | |
2368 |
|
2369 | |||
2369 | if self.specGraphSaveRTInoise.checkState(): |
|
2370 | if self.specGraphSaveRTInoise.checkState(): | |
2370 | enable = True |
|
2371 | enable = True | |
2371 |
|
2372 | |||
2372 | self.specGraphPath.setEnabled(enable) |
|
2373 | self.specGraphPath.setEnabled(enable) | |
2373 | self.specGraphPrefix.setEnabled(enable) |
|
2374 | self.specGraphPrefix.setEnabled(enable) | |
2374 | self.specGraphToolPath.setEnabled(enable) |
|
2375 | self.specGraphToolPath.setEnabled(enable) | |
2375 |
|
2376 | |||
2376 | self.specGgraphftpratio.setEnabled(enable) |
|
2377 | self.specGgraphftpratio.setEnabled(enable) | |
2377 |
|
2378 | |||
2378 | def __checkSpecGraphFTP(self): |
|
2379 | def __checkSpecGraphFTP(self): | |
2379 |
|
2380 | |||
2380 | enable = False |
|
2381 | enable = False | |
2381 |
|
2382 | |||
2382 | if self.specGraphftpSpectra.checkState(): |
|
2383 | if self.specGraphftpSpectra.checkState(): | |
2383 | enable = True |
|
2384 | enable = True | |
2384 |
|
2385 | |||
2385 | if self.specGraphftpCross.checkState(): |
|
2386 | if self.specGraphftpCross.checkState(): | |
2386 | enable = True |
|
2387 | enable = True | |
2387 |
|
2388 | |||
2388 | if self.specGraphftpRTIplot.checkState(): |
|
2389 | if self.specGraphftpRTIplot.checkState(): | |
2389 | enable = True |
|
2390 | enable = True | |
2390 |
|
2391 | |||
2391 | if self.specGraphftpCoherencemap.checkState(): |
|
2392 | if self.specGraphftpCoherencemap.checkState(): | |
2392 | enable = True |
|
2393 | enable = True | |
2393 |
|
2394 | |||
2394 | if self.specGraphftpPowerprofile.checkState(): |
|
2395 | if self.specGraphftpPowerprofile.checkState(): | |
2395 | enable = True |
|
2396 | enable = True | |
2396 |
|
2397 | |||
2397 | if self.specGraphftpRTInoise.checkState(): |
|
2398 | if self.specGraphftpRTInoise.checkState(): | |
2398 | enable = True |
|
2399 | enable = True | |
2399 |
|
2400 | |||
2400 | # self.specGgraphftpratio.setEnabled(enable) |
|
2401 | # self.specGgraphftpratio.setEnabled(enable) | |
2401 |
|
2402 | |||
2402 | def __checkSpecGraphFilters(self): |
|
2403 | def __checkSpecGraphFilters(self): | |
2403 |
|
2404 | |||
2404 | freq = False |
|
2405 | freq = False | |
2405 | height = False |
|
2406 | height = False | |
2406 | db = False |
|
2407 | db = False | |
2407 | time = False |
|
2408 | time = False | |
2408 | magnitud = False |
|
2409 | magnitud = False | |
2409 | phase = False |
|
2410 | phase = False | |
2410 | channelList = False |
|
2411 | channelList = False | |
2411 |
|
2412 | |||
2412 | if self.specGraphCebSpectraplot.checkState(): |
|
2413 | if self.specGraphCebSpectraplot.checkState(): | |
2413 | freq = True |
|
2414 | freq = True | |
2414 | height = True |
|
2415 | height = True | |
2415 | db = True |
|
2416 | db = True | |
2416 | channelList = True |
|
2417 | channelList = True | |
2417 |
|
2418 | |||
2418 | if self.specGraphCebCrossSpectraplot.checkState(): |
|
2419 | if self.specGraphCebCrossSpectraplot.checkState(): | |
2419 | freq = True |
|
2420 | freq = True | |
2420 | height = True |
|
2421 | height = True | |
2421 | db = True |
|
2422 | db = True | |
2422 | magnitud = True |
|
2423 | magnitud = True | |
2423 | phase = True |
|
2424 | phase = True | |
2424 |
|
2425 | |||
2425 | if self.specGraphCebRTIplot.checkState(): |
|
2426 | if self.specGraphCebRTIplot.checkState(): | |
2426 | height = True |
|
2427 | height = True | |
2427 | db = True |
|
2428 | db = True | |
2428 | time = True |
|
2429 | time = True | |
2429 | channelList = True |
|
2430 | channelList = True | |
2430 |
|
2431 | |||
2431 | if self.specGraphCebCoherencmap.checkState(): |
|
2432 | if self.specGraphCebCoherencmap.checkState(): | |
2432 | height = True |
|
2433 | height = True | |
2433 | time = True |
|
2434 | time = True | |
2434 | magnitud = True |
|
2435 | magnitud = True | |
2435 | phase = True |
|
2436 | phase = True | |
2436 |
|
2437 | |||
2437 | if self.specGraphPowerprofile.checkState(): |
|
2438 | if self.specGraphPowerprofile.checkState(): | |
2438 | height = True |
|
2439 | height = True | |
2439 | db = True |
|
2440 | db = True | |
2440 | channelList = True |
|
2441 | channelList = True | |
2441 |
|
2442 | |||
2442 | if self.specGraphCebRTInoise.checkState(): |
|
2443 | if self.specGraphCebRTInoise.checkState(): | |
2443 | db = True |
|
2444 | db = True | |
2444 | time = True |
|
2445 | time = True | |
2445 | channelList = True |
|
2446 | channelList = True | |
2446 |
|
2447 | |||
2447 |
|
2448 | |||
2448 | self.specGgraphFreq.setEnabled(freq) |
|
2449 | self.specGgraphFreq.setEnabled(freq) | |
2449 | self.specGgraphHeight.setEnabled(height) |
|
2450 | self.specGgraphHeight.setEnabled(height) | |
2450 | self.specGgraphDbsrange.setEnabled(db) |
|
2451 | self.specGgraphDbsrange.setEnabled(db) | |
2451 | self.specGgraphTminTmax.setEnabled(time) |
|
2452 | self.specGgraphTminTmax.setEnabled(time) | |
2452 |
|
2453 | |||
2453 | self.specGgraphmagnitud.setEnabled(magnitud) |
|
2454 | self.specGgraphmagnitud.setEnabled(magnitud) | |
2454 | self.specGgraphPhase.setEnabled(phase) |
|
2455 | self.specGgraphPhase.setEnabled(phase) | |
2455 | self.specGgraphChannelList.setEnabled(channelList) |
|
2456 | self.specGgraphChannelList.setEnabled(channelList) | |
2456 |
|
2457 | |||
2457 | def __getParmsFromProjectWindow(self): |
|
2458 | def __getParmsFromProjectWindow(self): | |
2458 | """ |
|
2459 | """ | |
2459 | Check Inputs Project: |
|
2460 | Check Inputs Project: | |
2460 | - project_name |
|
2461 | - project_name | |
2461 | - datatype |
|
2462 | - datatype | |
2462 | - ext |
|
2463 | - ext | |
2463 | - data_path |
|
2464 | - data_path | |
2464 | - readmode |
|
2465 | - readmode | |
2465 | - delay |
|
2466 | - delay | |
2466 | - set |
|
2467 | - set | |
2467 | - walk |
|
2468 | - walk | |
2468 | """ |
|
2469 | """ | |
2469 | parms_ok = True |
|
2470 | parms_ok = True | |
2470 |
|
2471 | |||
2471 | project_name = str(self.proName.text()) |
|
2472 | project_name = str(self.proName.text()) | |
2472 |
|
2473 | |||
2473 | if project_name == '' or project_name == None: |
|
2474 | if project_name == '' or project_name == None: | |
2474 | outputstr = "Enter a project Name" |
|
2475 | outputstr = "Enter a project Name" | |
2475 | self.console.append(outputstr) |
|
2476 | self.console.append(outputstr) | |
2476 | parms_ok = False |
|
2477 | parms_ok = False | |
2477 | project_name = None |
|
2478 | project_name = None | |
2478 |
|
2479 | |||
2479 | description = str(self.proDescription.toPlainText()) |
|
2480 | description = str(self.proDescription.toPlainText()) | |
2480 |
|
2481 | |||
2481 | datatype = str(self.proComDataType.currentText()) |
|
2482 | datatype = str(self.proComDataType.currentText()) | |
2482 |
|
2483 | |||
2483 | ext = str(self.proDataType.text()) |
|
2484 | ext = str(self.proDataType.text()) | |
2484 |
|
2485 | |||
2485 | dpath = str(self.proDataPath.text()) |
|
2486 | dpath = str(self.proDataPath.text()) | |
2486 |
|
2487 | |||
2487 | if dpath == '': |
|
2488 | if dpath == '': | |
2488 | outputstr = 'Datapath is empty' |
|
2489 | outputstr = 'Datapath is empty' | |
2489 | self.console.append(outputstr) |
|
2490 | self.console.append(outputstr) | |
2490 | parms_ok = False |
|
2491 | parms_ok = False | |
2491 | dpath = None |
|
2492 | dpath = None | |
2492 |
|
2493 | |||
2493 | if dpath != None: |
|
2494 | if dpath != None: | |
2494 | if not os.path.isdir(dpath): |
|
2495 | if not os.path.isdir(dpath): | |
2495 | outputstr = 'Datapath (%s) does not exist' % dpath |
|
2496 | outputstr = 'Datapath (%s) does not exist' % dpath | |
2496 | self.console.append(outputstr) |
|
2497 | self.console.append(outputstr) | |
2497 | parms_ok = False |
|
2498 | parms_ok = False | |
2498 | dpath = None |
|
2499 | dpath = None | |
2499 |
|
2500 | |||
2500 | online = int(self.proComReadMode.currentIndex()) |
|
2501 | online = int(self.proComReadMode.currentIndex()) | |
2501 |
|
2502 | |||
2502 | delay = None |
|
2503 | delay = None | |
2503 | if online==1: |
|
2504 | if online==1: | |
2504 | try: |
|
2505 | try: | |
2505 | delay = int(str(self.proDelay.text())) |
|
2506 | delay = int(str(self.proDelay.text())) | |
2506 | except: |
|
2507 | except: | |
2507 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) |
|
2508 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
2508 | self.console.append(outputstr) |
|
2509 | self.console.append(outputstr) | |
2509 | parms_ok = False |
|
2510 | parms_ok = False | |
2510 |
|
2511 | |||
2511 |
|
2512 | |||
2512 | set = None |
|
2513 | set = None | |
2513 | value = str(self.proSet.text()) |
|
2514 | value = str(self.proSet.text()) | |
2514 | try: |
|
2515 | try: | |
2515 | set = int(value) |
|
2516 | set = int(value) | |
2516 | except: |
|
2517 | except: | |
2517 | pass |
|
2518 | pass | |
2518 |
|
2519 | |||
2519 | ippKm = None |
|
2520 | ippKm = None | |
2520 |
|
2521 | |||
2521 | value = str(self.proIPPKm.text()) |
|
2522 | value = str(self.proIPPKm.text()) | |
2522 |
|
2523 | |||
2523 | try: |
|
2524 | try: | |
2524 | ippKm = float(value) |
|
2525 | ippKm = float(value) | |
2525 | except: |
|
2526 | except: | |
2526 | if datatype=="USRP": |
|
2527 | if datatype=="USRP": | |
2527 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) |
|
2528 | outputstr = 'IPP value "%s" must be a float number' % str(self.proIPPKm.text()) | |
2528 | self.console.append(outputstr) |
|
2529 | self.console.append(outputstr) | |
2529 | parms_ok = False |
|
2530 | parms_ok = False | |
2530 |
|
2531 | |||
2531 | walk = int(self.proComWalk.currentIndex()) |
|
2532 | walk = int(self.proComWalk.currentIndex()) | |
2532 | expLabel = str(self.proExpLabel.text()) |
|
2533 | expLabel = str(self.proExpLabel.text()) | |
2533 |
|
2534 | |||
2534 | startDate = str(self.proComStartDate.currentText()) |
|
2535 | startDate = str(self.proComStartDate.currentText()) | |
2535 | endDate = str(self.proComEndDate.currentText()) |
|
2536 | endDate = str(self.proComEndDate.currentText()) | |
2536 |
|
2537 | |||
2537 | # startDateList = startDate.split("/") |
|
2538 | # startDateList = startDate.split("/") | |
2538 | # endDateList = endDate.split("/") |
|
2539 | # endDateList = endDate.split("/") | |
2539 | # |
|
2540 | # | |
2540 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) |
|
2541 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
2541 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2542 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) | |
2542 |
|
2543 | |||
2543 | startTime = self.proStartTime.time() |
|
2544 | startTime = self.proStartTime.time() | |
2544 | endTime = self.proEndTime.time() |
|
2545 | endTime = self.proEndTime.time() | |
2545 |
|
2546 | |||
2546 | startTime = str(startTime.toString("H:m:s")) |
|
2547 | startTime = str(startTime.toString("H:m:s")) | |
2547 | endTime = str(endTime.toString("H:m:s")) |
|
2548 | endTime = str(endTime.toString("H:m:s")) | |
2548 |
|
2549 | |||
2549 | projectParms = ProjectParms() |
|
2550 | projectParms = ProjectParms() | |
2550 |
|
2551 | |||
2551 | projectParms.name = project_name |
|
2552 | projectParms.name = project_name | |
2552 | projectParms.description = description |
|
2553 | projectParms.description = description | |
2553 | projectParms.datatype = datatype |
|
2554 | projectParms.datatype = datatype | |
2554 | projectParms.ext = ext |
|
2555 | projectParms.ext = ext | |
2555 | projectParms.dpath = dpath |
|
2556 | projectParms.dpath = dpath | |
2556 | projectParms.online = online |
|
2557 | projectParms.online = online | |
2557 | projectParms.startDate = startDate |
|
2558 | projectParms.startDate = startDate | |
2558 | projectParms.endDate = endDate |
|
2559 | projectParms.endDate = endDate | |
2559 | projectParms.startTime = startTime |
|
2560 | projectParms.startTime = startTime | |
2560 | projectParms.endTime = endTime |
|
2561 | projectParms.endTime = endTime | |
2561 | projectParms.delay = delay |
|
2562 | projectParms.delay = delay | |
2562 | projectParms.walk = walk |
|
2563 | projectParms.walk = walk | |
2563 | projectParms.expLabel = expLabel |
|
2564 | projectParms.expLabel = expLabel | |
2564 | projectParms.set = set |
|
2565 | projectParms.set = set | |
2565 | projectParms.ippKm = ippKm |
|
2566 | projectParms.ippKm = ippKm | |
2566 | projectParms.parmsOk = parms_ok |
|
2567 | projectParms.parmsOk = parms_ok | |
2567 |
|
2568 | |||
2568 | return projectParms |
|
2569 | return projectParms | |
2569 |
|
2570 | |||
2570 |
|
2571 | |||
2571 | def __getParmsFromProjectObj(self, projectObjView): |
|
2572 | def __getParmsFromProjectObj(self, projectObjView): | |
2572 |
|
2573 | |||
2573 | parms_ok = True |
|
2574 | parms_ok = True | |
2574 |
|
2575 | |||
2575 | project_name, description = projectObjView.name, projectObjView.description |
|
2576 | project_name, description = projectObjView.name, projectObjView.description | |
2576 |
|
2577 | |||
2577 | readUnitObj = projectObjView.getReadUnitObj() |
|
2578 | readUnitObj = projectObjView.getReadUnitObj() | |
2578 | datatype = readUnitObj.datatype |
|
2579 | datatype = readUnitObj.datatype | |
2579 |
|
2580 | |||
2580 | operationObj = readUnitObj.getOperationObj(name='run') |
|
2581 | operationObj = readUnitObj.getOperationObj(name='run') | |
2581 |
|
2582 | |||
2582 | dpath = operationObj.getParameterValue(parameterName='path') |
|
2583 | dpath = operationObj.getParameterValue(parameterName='path') | |
2583 | startDate = operationObj.getParameterValue(parameterName='startDate') |
|
2584 | startDate = operationObj.getParameterValue(parameterName='startDate') | |
2584 | endDate = operationObj.getParameterValue(parameterName='endDate') |
|
2585 | endDate = operationObj.getParameterValue(parameterName='endDate') | |
2585 |
|
2586 | |||
2586 | startDate = startDate.strftime("%Y/%m/%d") |
|
2587 | startDate = startDate.strftime("%Y/%m/%d") | |
2587 | endDate = endDate.strftime("%Y/%m/%d") |
|
2588 | endDate = endDate.strftime("%Y/%m/%d") | |
2588 |
|
2589 | |||
2589 | startTime = operationObj.getParameterValue(parameterName='startTime') |
|
2590 | startTime = operationObj.getParameterValue(parameterName='startTime') | |
2590 | endTime = operationObj.getParameterValue(parameterName='endTime') |
|
2591 | endTime = operationObj.getParameterValue(parameterName='endTime') | |
2591 |
|
2592 | |||
2592 | startTime = startTime.strftime("%H:%M:%S") |
|
2593 | startTime = startTime.strftime("%H:%M:%S") | |
2593 | endTime = endTime.strftime("%H:%M:%S") |
|
2594 | endTime = endTime.strftime("%H:%M:%S") | |
2594 |
|
2595 | |||
2595 | online = 0 |
|
2596 | online = 0 | |
2596 | try: |
|
2597 | try: | |
2597 | online = operationObj.getParameterValue(parameterName='online') |
|
2598 | online = operationObj.getParameterValue(parameterName='online') | |
2598 | except: |
|
2599 | except: | |
2599 | pass |
|
2600 | pass | |
2600 |
|
2601 | |||
2601 | delay = '' |
|
2602 | delay = '' | |
2602 | try: |
|
2603 | try: | |
2603 | delay = operationObj.getParameterValue(parameterName='delay') |
|
2604 | delay = operationObj.getParameterValue(parameterName='delay') | |
2604 | except: |
|
2605 | except: | |
2605 | pass |
|
2606 | pass | |
2606 |
|
2607 | |||
2607 | walk = 0 |
|
2608 | walk = 0 | |
2608 | try: |
|
2609 | try: | |
2609 | walk = operationObj.getParameterValue(parameterName='walk') |
|
2610 | walk = operationObj.getParameterValue(parameterName='walk') | |
2610 | except: |
|
2611 | except: | |
2611 | pass |
|
2612 | pass | |
2612 |
|
2613 | |||
2613 | set = '' |
|
2614 | set = '' | |
2614 | try: |
|
2615 | try: | |
2615 | set = operationObj.getParameterValue(parameterName='set') |
|
2616 | set = operationObj.getParameterValue(parameterName='set') | |
2616 | except: |
|
2617 | except: | |
2617 | pass |
|
2618 | pass | |
2618 |
|
2619 | |||
2619 | expLabel = '' |
|
2620 | expLabel = '' | |
2620 | try: |
|
2621 | try: | |
2621 | expLabel = operationObj.getParameterValue(parameterName='expLabel') |
|
2622 | expLabel = operationObj.getParameterValue(parameterName='expLabel') | |
2622 | except: |
|
2623 | except: | |
2623 | pass |
|
2624 | pass | |
2624 |
|
2625 | |||
2625 | ippKm = '' |
|
2626 | ippKm = '' | |
2626 | if datatype.lower() == 'usrp': |
|
2627 | if datatype.lower() == 'usrp': | |
2627 | try: |
|
2628 | try: | |
2628 | ippKm = operationObj.getParameterValue(parameterName='ippKm') |
|
2629 | ippKm = operationObj.getParameterValue(parameterName='ippKm') | |
2629 | except: |
|
2630 | except: | |
2630 | pass |
|
2631 | pass | |
2631 |
|
2632 | |||
2632 | projectParms = ProjectParms() |
|
2633 | projectParms = ProjectParms() | |
2633 |
|
2634 | |||
2634 | projectParms.name = project_name |
|
2635 | projectParms.name = project_name | |
2635 | projectParms.description = description |
|
2636 | projectParms.description = description | |
2636 | projectParms.datatype = datatype |
|
2637 | projectParms.datatype = datatype | |
2637 | projectParms.ext = None |
|
2638 | projectParms.ext = None | |
2638 | projectParms.dpath = dpath |
|
2639 | projectParms.dpath = dpath | |
2639 | projectParms.online = online |
|
2640 | projectParms.online = online | |
2640 | projectParms.startDate = startDate |
|
2641 | projectParms.startDate = startDate | |
2641 | projectParms.endDate = endDate |
|
2642 | projectParms.endDate = endDate | |
2642 | projectParms.startTime = startTime |
|
2643 | projectParms.startTime = startTime | |
2643 | projectParms.endTime = endTime |
|
2644 | projectParms.endTime = endTime | |
2644 | projectParms.delay=delay |
|
2645 | projectParms.delay=delay | |
2645 | projectParms.walk=walk |
|
2646 | projectParms.walk=walk | |
2646 | projectParms.set=set |
|
2647 | projectParms.set=set | |
2647 | projectParms.ippKm=ippKm |
|
2648 | projectParms.ippKm=ippKm | |
2648 | projectParms.expLabel = expLabel |
|
2649 | projectParms.expLabel = expLabel | |
2649 | projectParms.parmsOk=parms_ok |
|
2650 | projectParms.parmsOk=parms_ok | |
2650 |
|
2651 | |||
2651 | return projectParms |
|
2652 | return projectParms | |
2652 |
|
2653 | |||
2653 | def refreshProjectWindow(self, projectObjView): |
|
2654 | def refreshProjectWindow(self, projectObjView): | |
2654 |
|
2655 | |||
2655 | projectParms = self.__getParmsFromProjectObj(projectObjView) |
|
2656 | projectParms = self.__getParmsFromProjectObj(projectObjView) | |
2656 |
|
2657 | |||
2657 | index = projectParms.getDatatypeIndex() |
|
2658 | index = projectParms.getDatatypeIndex() | |
2658 |
|
2659 | |||
2659 | self.proName.setText(projectParms.name) |
|
2660 | self.proName.setText(projectParms.name) | |
2660 | self.proDescription.clear() |
|
2661 | self.proDescription.clear() | |
2661 | self.proDescription.append(projectParms.description) |
|
2662 | self.proDescription.append(projectParms.description) | |
2662 |
|
2663 | |||
2663 | self.on_proComDataType_activated(index=index) |
|
2664 | self.on_proComDataType_activated(index=index) | |
2664 | self.proDataPath.setText(projectParms.dpath) |
|
2665 | self.proDataPath.setText(projectParms.dpath) | |
2665 | self.proComDataType.setCurrentIndex(index) |
|
2666 | self.proComDataType.setCurrentIndex(index) | |
2666 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2667 | self.proComReadMode.setCurrentIndex(projectParms.online) | |
2667 | self.proDelay.setText(str(projectParms.delay)) |
|
2668 | self.proDelay.setText(str(projectParms.delay)) | |
2668 | self.proSet.setText(str(projectParms.set)) |
|
2669 | self.proSet.setText(str(projectParms.set)) | |
2669 | self.proIPPKm.setText(str(projectParms.ippKm)) |
|
2670 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
2670 | self.proComWalk.setCurrentIndex(projectParms.walk) |
|
2671 | self.proComWalk.setCurrentIndex(projectParms.walk) | |
2671 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) |
|
2672 | self.proExpLabel.setText(str(projectParms.expLabel).strip()) | |
2672 |
|
2673 | |||
2673 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2674 | dateList = self.loadDays(data_path = projectParms.dpath, | |
2674 | ext = projectParms.getExt(), |
|
2675 | ext = projectParms.getExt(), | |
2675 | walk = projectParms.walk, |
|
2676 | walk = projectParms.walk, | |
2676 | expLabel = projectParms.expLabel) |
|
2677 | expLabel = projectParms.expLabel) | |
2677 |
|
2678 | |||
2678 | try: |
|
2679 | try: | |
2679 | startDateIndex = dateList.index(projectParms.startDate) |
|
2680 | startDateIndex = dateList.index(projectParms.startDate) | |
2680 | except: |
|
2681 | except: | |
2681 | startDateIndex = 0 |
|
2682 | startDateIndex = 0 | |
2682 |
|
2683 | |||
2683 | try: |
|
2684 | try: | |
2684 | endDateIndex = dateList.index(projectParms.endDate) |
|
2685 | endDateIndex = dateList.index(projectParms.endDate) | |
2685 | except: |
|
2686 | except: | |
2686 | endDateIndex = int(self.proComEndDate.count()-1) |
|
2687 | endDateIndex = int(self.proComEndDate.count()-1) | |
2687 |
|
2688 | |||
2688 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2689 | self.proComStartDate.setCurrentIndex(startDateIndex) | |
2689 | self.proComEndDate.setCurrentIndex(endDateIndex) |
|
2690 | self.proComEndDate.setCurrentIndex(endDateIndex) | |
2690 |
|
2691 | |||
2691 | startlist = projectParms.startTime.split(":") |
|
2692 | startlist = projectParms.startTime.split(":") | |
2692 | endlist = projectParms.endTime.split(":") |
|
2693 | endlist = projectParms.endTime.split(":") | |
2693 |
|
2694 | |||
2694 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2695 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) | |
2695 | self.proStartTime.setTime(self.time) |
|
2696 | self.proStartTime.setTime(self.time) | |
2696 |
|
2697 | |||
2697 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
2698 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
2698 | self.proEndTime.setTime(self.time) |
|
2699 | self.proEndTime.setTime(self.time) | |
2699 |
|
2700 | |||
2700 |
|
2701 | |||
2701 | def __refreshVoltageWindow(self, puObj): |
|
2702 | def __refreshVoltageWindow(self, puObj): | |
2702 |
|
2703 | |||
2703 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
2704 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
2704 | if opObj == None: |
|
2705 | if opObj == None: | |
2705 | self.volOpRadarfrequency.clear() |
|
2706 | self.volOpRadarfrequency.clear() | |
2706 | self.volOpCebRadarfrequency.setCheckState(0) |
|
2707 | self.volOpCebRadarfrequency.setCheckState(0) | |
2707 | else: |
|
2708 | else: | |
2708 | value = opObj.getParameterValue(parameterName='frequency') |
|
2709 | value = opObj.getParameterValue(parameterName='frequency') | |
2709 | value = str(float(value)/1e6) |
|
2710 | value = str(float(value)/1e6) | |
2710 | self.volOpRadarfrequency.setText(value) |
|
2711 | self.volOpRadarfrequency.setText(value) | |
2711 | self.volOpRadarfrequency.setEnabled(True) |
|
2712 | self.volOpRadarfrequency.setEnabled(True) | |
2712 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
2713 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
2713 |
|
2714 | |||
2714 | opObj = puObj.getOperationObj(name="selectChannels") |
|
2715 | opObj = puObj.getOperationObj(name="selectChannels") | |
2715 |
|
2716 | |||
2716 | if opObj == None: |
|
2717 | if opObj == None: | |
2717 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
2718 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
2718 |
|
2719 | |||
2719 | if opObj == None: |
|
2720 | if opObj == None: | |
2720 | self.volOpChannel.clear() |
|
2721 | self.volOpChannel.clear() | |
2721 | self.volOpCebChannels.setCheckState(0) |
|
2722 | self.volOpCebChannels.setCheckState(0) | |
2722 | else: |
|
2723 | else: | |
2723 | channelEnabled = False |
|
2724 | channelEnabled = False | |
2724 | try: |
|
2725 | try: | |
2725 | value = opObj.getParameterValue(parameterName='channelList') |
|
2726 | value = opObj.getParameterValue(parameterName='channelList') | |
2726 | value = str(value)[1:-1] |
|
2727 | value = str(value)[1:-1] | |
2727 | channelEnabled = True |
|
2728 | channelEnabled = True | |
2728 | channelMode = 0 |
|
2729 | channelMode = 0 | |
2729 | except: |
|
2730 | except: | |
2730 | pass |
|
2731 | pass | |
2731 | try: |
|
2732 | try: | |
2732 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
2733 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
2733 | value = str(value)[1:-1] |
|
2734 | value = str(value)[1:-1] | |
2734 | channelEnabled = True |
|
2735 | channelEnabled = True | |
2735 | channelMode = 1 |
|
2736 | channelMode = 1 | |
2736 | except: |
|
2737 | except: | |
2737 | pass |
|
2738 | pass | |
2738 |
|
2739 | |||
2739 | if channelEnabled: |
|
2740 | if channelEnabled: | |
2740 | self.volOpChannel.setText(value) |
|
2741 | self.volOpChannel.setText(value) | |
2741 | self.volOpChannel.setEnabled(True) |
|
2742 | self.volOpChannel.setEnabled(True) | |
2742 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) |
|
2743 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
2743 | self.volOpComChannels.setCurrentIndex(channelMode) |
|
2744 | self.volOpComChannels.setCurrentIndex(channelMode) | |
2744 |
|
2745 | |||
2745 | opObj = puObj.getOperationObj(name="selectHeights") |
|
2746 | opObj = puObj.getOperationObj(name="selectHeights") | |
2746 | if opObj == None: |
|
2747 | if opObj == None: | |
2747 | self.volOpHeights.clear() |
|
2748 | self.volOpHeights.clear() | |
2748 | self.volOpCebHeights.setCheckState(0) |
|
2749 | self.volOpCebHeights.setCheckState(0) | |
2749 | else: |
|
2750 | else: | |
2750 | value1 = str(opObj.getParameterValue(parameterName='minHei')) |
|
2751 | value1 = str(opObj.getParameterValue(parameterName='minHei')) | |
2751 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) |
|
2752 | value2 = str(opObj.getParameterValue(parameterName='maxHei')) | |
2752 | value = value1 + "," + value2 |
|
2753 | value = value1 + "," + value2 | |
2753 | self.volOpHeights.setText(value) |
|
2754 | self.volOpHeights.setText(value) | |
2754 | self.volOpHeights.setEnabled(True) |
|
2755 | self.volOpHeights.setEnabled(True) | |
2755 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
2756 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
2756 |
|
2757 | |||
2757 | opObj = puObj.getOperationObj(name="filterByHeights") |
|
2758 | opObj = puObj.getOperationObj(name="filterByHeights") | |
2758 | if opObj == None: |
|
2759 | if opObj == None: | |
2759 | self.volOpFilter.clear() |
|
2760 | self.volOpFilter.clear() | |
2760 | self.volOpCebFilter.setCheckState(0) |
|
2761 | self.volOpCebFilter.setCheckState(0) | |
2761 | else: |
|
2762 | else: | |
2762 | value = opObj.getParameterValue(parameterName='window') |
|
2763 | value = opObj.getParameterValue(parameterName='window') | |
2763 | value = str(value) |
|
2764 | value = str(value) | |
2764 | self.volOpFilter.setText(value) |
|
2765 | self.volOpFilter.setText(value) | |
2765 | self.volOpFilter.setEnabled(True) |
|
2766 | self.volOpFilter.setEnabled(True) | |
2766 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) |
|
2767 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
2767 |
|
2768 | |||
2768 | opObj = puObj.getOperationObj(name="ProfileSelector") |
|
2769 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
2769 | if opObj == None: |
|
2770 | if opObj == None: | |
2770 | self.volOpProfile.clear() |
|
2771 | self.volOpProfile.clear() | |
2771 | self.volOpCebProfile.setCheckState(0) |
|
2772 | self.volOpCebProfile.setCheckState(0) | |
2772 | else: |
|
2773 | else: | |
2773 | for parmObj in opObj.getParameterObjList(): |
|
2774 | for parmObj in opObj.getParameterObjList(): | |
2774 |
|
2775 | |||
2775 | if parmObj.name == "profileList": |
|
2776 | if parmObj.name == "profileList": | |
2776 | value = parmObj.getValue() |
|
2777 | value = parmObj.getValue() | |
2777 | value = str(value)[1:-1] |
|
2778 | value = str(value)[1:-1] | |
2778 | self.volOpProfile.setText(value) |
|
2779 | self.volOpProfile.setText(value) | |
2779 | self.volOpProfile.setEnabled(True) |
|
2780 | self.volOpProfile.setEnabled(True) | |
2780 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2781 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2781 | self.volOpComProfile.setCurrentIndex(0) |
|
2782 | self.volOpComProfile.setCurrentIndex(0) | |
2782 |
|
2783 | |||
2783 | if parmObj.name == "profileRangeList": |
|
2784 | if parmObj.name == "profileRangeList": | |
2784 | value = parmObj.getValue() |
|
2785 | value = parmObj.getValue() | |
2785 | value = str(value)[1:-1] |
|
2786 | value = str(value)[1:-1] | |
2786 | self.volOpProfile.setText(value) |
|
2787 | self.volOpProfile.setText(value) | |
2787 | self.volOpProfile.setEnabled(True) |
|
2788 | self.volOpProfile.setEnabled(True) | |
2788 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2789 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2789 | self.volOpComProfile.setCurrentIndex(1) |
|
2790 | self.volOpComProfile.setCurrentIndex(1) | |
2790 |
|
2791 | |||
2791 | if parmObj.name == "rangeList": |
|
2792 | if parmObj.name == "rangeList": | |
2792 | value = parmObj.getValue() |
|
2793 | value = parmObj.getValue() | |
2793 | value = str(value)[1:-1] |
|
2794 | value = str(value)[1:-1] | |
2794 | self.volOpProfile.setText(value) |
|
2795 | self.volOpProfile.setText(value) | |
2795 | self.volOpProfile.setEnabled(True) |
|
2796 | self.volOpProfile.setEnabled(True) | |
2796 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) |
|
2797 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
2797 | self.volOpComProfile.setCurrentIndex(2) |
|
2798 | self.volOpComProfile.setCurrentIndex(2) | |
2798 |
|
2799 | |||
2799 | opObj = puObj.getOperationObj(name="Decoder") |
|
2800 | opObj = puObj.getOperationObj(name="Decoder") | |
2800 | self.volOpCode.setText("") |
|
2801 | self.volOpCode.setText("") | |
2801 | if opObj == None: |
|
2802 | if opObj == None: | |
2802 | self.volOpCebDecodification.setCheckState(0) |
|
2803 | self.volOpCebDecodification.setCheckState(0) | |
2803 | else: |
|
2804 | else: | |
2804 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) |
|
2805 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
2805 |
|
2806 | |||
2806 | parmObj = opObj.getParameterObj('code') |
|
2807 | parmObj = opObj.getParameterObj('code') | |
2807 |
|
2808 | |||
2808 | if parmObj == None: |
|
2809 | if parmObj == None: | |
2809 | self.volOpComCode.setCurrentIndex(0) |
|
2810 | self.volOpComCode.setCurrentIndex(0) | |
2810 | else: |
|
2811 | else: | |
2811 |
|
2812 | |||
2812 | parmObj1 = opObj.getParameterObj('nCode') |
|
2813 | parmObj1 = opObj.getParameterObj('nCode') | |
2813 | parmObj2 = opObj.getParameterObj('nBaud') |
|
2814 | parmObj2 = opObj.getParameterObj('nBaud') | |
2814 |
|
2815 | |||
2815 | if parmObj1 == None or parmObj2 == None: |
|
2816 | if parmObj1 == None or parmObj2 == None: | |
2816 | self.volOpComCode.setCurrentIndex(0) |
|
2817 | self.volOpComCode.setCurrentIndex(0) | |
2817 | else: |
|
2818 | else: | |
2818 | code = ast.literal_eval(str(parmObj.getValue())) |
|
2819 | code = ast.literal_eval(str(parmObj.getValue())) | |
2819 | nCode = parmObj1.getValue() |
|
2820 | nCode = parmObj1.getValue() | |
2820 | nBaud = parmObj2.getValue() |
|
2821 | nBaud = parmObj2.getValue() | |
2821 |
|
2822 | |||
2822 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() |
|
2823 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
2823 |
|
2824 | |||
2824 | #User defined by default |
|
2825 | #User defined by default | |
2825 | self.volOpComCode.setCurrentIndex(13) |
|
2826 | self.volOpComCode.setCurrentIndex(13) | |
2826 | self.volOpCode.setText(str(code)) |
|
2827 | self.volOpCode.setText(str(code)) | |
2827 |
|
2828 | |||
2828 | if nCode == 1: |
|
2829 | if nCode == 1: | |
2829 | if nBaud == 3: |
|
2830 | if nBaud == 3: | |
2830 | self.volOpComCode.setCurrentIndex(1) |
|
2831 | self.volOpComCode.setCurrentIndex(1) | |
2831 | if nBaud == 4: |
|
2832 | if nBaud == 4: | |
2832 | self.volOpComCode.setCurrentIndex(2) |
|
2833 | self.volOpComCode.setCurrentIndex(2) | |
2833 | if nBaud == 5: |
|
2834 | if nBaud == 5: | |
2834 | self.volOpComCode.setCurrentIndex(3) |
|
2835 | self.volOpComCode.setCurrentIndex(3) | |
2835 | if nBaud == 7: |
|
2836 | if nBaud == 7: | |
2836 | self.volOpComCode.setCurrentIndex(4) |
|
2837 | self.volOpComCode.setCurrentIndex(4) | |
2837 | if nBaud == 11: |
|
2838 | if nBaud == 11: | |
2838 | self.volOpComCode.setCurrentIndex(5) |
|
2839 | self.volOpComCode.setCurrentIndex(5) | |
2839 | if nBaud == 13: |
|
2840 | if nBaud == 13: | |
2840 | self.volOpComCode.setCurrentIndex(6) |
|
2841 | self.volOpComCode.setCurrentIndex(6) | |
2841 |
|
2842 | |||
2842 | if nCode == 2: |
|
2843 | if nCode == 2: | |
2843 | if nBaud == 3: |
|
2844 | if nBaud == 3: | |
2844 | self.volOpComCode.setCurrentIndex(7) |
|
2845 | self.volOpComCode.setCurrentIndex(7) | |
2845 | if nBaud == 4: |
|
2846 | if nBaud == 4: | |
2846 | self.volOpComCode.setCurrentIndex(8) |
|
2847 | self.volOpComCode.setCurrentIndex(8) | |
2847 | if nBaud == 5: |
|
2848 | if nBaud == 5: | |
2848 | self.volOpComCode.setCurrentIndex(9) |
|
2849 | self.volOpComCode.setCurrentIndex(9) | |
2849 | if nBaud == 7: |
|
2850 | if nBaud == 7: | |
2850 | self.volOpComCode.setCurrentIndex(10) |
|
2851 | self.volOpComCode.setCurrentIndex(10) | |
2851 | if nBaud == 11: |
|
2852 | if nBaud == 11: | |
2852 | self.volOpComCode.setCurrentIndex(11) |
|
2853 | self.volOpComCode.setCurrentIndex(11) | |
2853 | if nBaud == 13: |
|
2854 | if nBaud == 13: | |
2854 | self.volOpComCode.setCurrentIndex(12) |
|
2855 | self.volOpComCode.setCurrentIndex(12) | |
2855 |
|
2856 | |||
2856 |
|
2857 | |||
2857 | opObj = puObj.getOperationObj(name="deFlip") |
|
2858 | opObj = puObj.getOperationObj(name="deFlip") | |
2858 | if opObj == None: |
|
2859 | if opObj == None: | |
2859 | self.volOpFlip.clear() |
|
2860 | self.volOpFlip.clear() | |
2860 | self.volOpFlip.setEnabled(False) |
|
2861 | self.volOpFlip.setEnabled(False) | |
2861 | self.volOpCebFlip.setCheckState(0) |
|
2862 | self.volOpCebFlip.setCheckState(0) | |
2862 | else: |
|
2863 | else: | |
2863 | try: |
|
2864 | try: | |
2864 | value = opObj.getParameterValue(parameterName='channelList') |
|
2865 | value = opObj.getParameterValue(parameterName='channelList') | |
2865 | value = str(value)[1:-1] |
|
2866 | value = str(value)[1:-1] | |
2866 | except: |
|
2867 | except: | |
2867 | value = "" |
|
2868 | value = "" | |
2868 |
|
2869 | |||
2869 | self.volOpFlip.setText(value) |
|
2870 | self.volOpFlip.setText(value) | |
2870 | self.volOpFlip.setEnabled(True) |
|
2871 | self.volOpFlip.setEnabled(True) | |
2871 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) |
|
2872 | self.volOpCebFlip.setCheckState(QtCore.Qt.Checked) | |
2872 |
|
2873 | |||
2873 | opObj = puObj.getOperationObj(name="CohInt") |
|
2874 | opObj = puObj.getOperationObj(name="CohInt") | |
2874 | if opObj == None: |
|
2875 | if opObj == None: | |
2875 | self.volOpCohInt.clear() |
|
2876 | self.volOpCohInt.clear() | |
2876 | self.volOpCebCohInt.setCheckState(0) |
|
2877 | self.volOpCebCohInt.setCheckState(0) | |
2877 | else: |
|
2878 | else: | |
2878 | value = opObj.getParameterValue(parameterName='n') |
|
2879 | value = opObj.getParameterValue(parameterName='n') | |
2879 | self.volOpCohInt.setText(str(value)) |
|
2880 | self.volOpCohInt.setText(str(value)) | |
2880 | self.volOpCohInt.setEnabled(True) |
|
2881 | self.volOpCohInt.setEnabled(True) | |
2881 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) |
|
2882 | self.volOpCebCohInt.setCheckState(QtCore.Qt.Checked) | |
2882 |
|
2883 | |||
2883 | opObj = puObj.getOperationObj(name='Scope') |
|
2884 | opObj = puObj.getOperationObj(name='Scope') | |
2884 | if opObj == None: |
|
2885 | if opObj == None: | |
2885 | self.volGraphCebshow.setCheckState(0) |
|
2886 | self.volGraphCebshow.setCheckState(0) | |
2886 | else: |
|
2887 | else: | |
2887 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
2888 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) | |
2888 |
|
2889 | |||
2889 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
2890 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
2890 |
|
2891 | |||
2891 | if parmObj == None: |
|
2892 | if parmObj == None: | |
2892 | self.volGraphChannelList.clear() |
|
2893 | self.volGraphChannelList.clear() | |
2893 | else: |
|
2894 | else: | |
2894 | value = parmObj.getValue() |
|
2895 | value = parmObj.getValue() | |
2895 | value = str(value) |
|
2896 | value = str(value) | |
2896 | self.volGraphChannelList.setText(value) |
|
2897 | self.volGraphChannelList.setText(value) | |
2897 | self.volOpProfile.setEnabled(True) |
|
2898 | self.volOpProfile.setEnabled(True) | |
2898 |
|
2899 | |||
2899 | parmObj1 = opObj.getParameterObj(parameterName='xmin') |
|
2900 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
2900 | parmObj2 = opObj.getParameterObj(parameterName='xmax') |
|
2901 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
2901 |
|
2902 | |||
2902 | if parmObj1 == None or parmObj2 ==None: |
|
2903 | if parmObj1 == None or parmObj2 ==None: | |
2903 | self.volGraphfreqrange.clear() |
|
2904 | self.volGraphfreqrange.clear() | |
2904 | else: |
|
2905 | else: | |
2905 | value1 = parmObj1.getValue() |
|
2906 | value1 = parmObj1.getValue() | |
2906 | value1 = str(value1) |
|
2907 | value1 = str(value1) | |
2907 | value2 = parmObj2.getValue() |
|
2908 | value2 = parmObj2.getValue() | |
2908 | value2 = str(value2) |
|
2909 | value2 = str(value2) | |
2909 | value = value1 + "," + value2 |
|
2910 | value = value1 + "," + value2 | |
2910 | self.volGraphfreqrange.setText(value) |
|
2911 | self.volGraphfreqrange.setText(value) | |
2911 |
|
2912 | |||
2912 | parmObj1 = opObj.getParameterObj(parameterName='ymin') |
|
2913 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
2913 | parmObj2 = opObj.getParameterObj(parameterName='ymax') |
|
2914 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
2914 |
|
2915 | |||
2915 | if parmObj1 == None or parmObj2 ==None: |
|
2916 | if parmObj1 == None or parmObj2 ==None: | |
2916 | self.volGraphHeightrange.clear() |
|
2917 | self.volGraphHeightrange.clear() | |
2917 | else: |
|
2918 | else: | |
2918 | value1 = parmObj1.getValue() |
|
2919 | value1 = parmObj1.getValue() | |
2919 | value1 = str(value1) |
|
2920 | value1 = str(value1) | |
2920 | value2 = parmObj2.getValue() |
|
2921 | value2 = parmObj2.getValue() | |
2921 | value2 = str(value2) |
|
2922 | value2 = str(value2) | |
2922 | value = value1 + "," + value2 |
|
2923 | value = value1 + "," + value2 | |
2923 | value2 = str(value2) |
|
2924 | value2 = str(value2) | |
2924 | self.volGraphHeightrange.setText(value) |
|
2925 | self.volGraphHeightrange.setText(value) | |
2925 |
|
2926 | |||
2926 | parmObj = opObj.getParameterObj(parameterName='save') |
|
2927 | parmObj = opObj.getParameterObj(parameterName='save') | |
2927 |
|
2928 | |||
2928 | if parmObj == None: |
|
2929 | if parmObj == None: | |
2929 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2930 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2930 | else: |
|
2931 | else: | |
2931 | value = parmObj.getValue() |
|
2932 | value = parmObj.getValue() | |
2932 | if value: |
|
2933 | if value: | |
2933 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
2934 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) | |
2934 | else: |
|
2935 | else: | |
2935 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
2936 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
2936 |
|
2937 | |||
2937 | parmObj = opObj.getParameterObj(parameterName='figpath') |
|
2938 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
2938 | if parmObj == None: |
|
2939 | if parmObj == None: | |
2939 | self.volGraphPath.clear() |
|
2940 | self.volGraphPath.clear() | |
2940 | else: |
|
2941 | else: | |
2941 | value = parmObj.getValue() |
|
2942 | value = parmObj.getValue() | |
2942 | path = str(value) |
|
2943 | path = str(value) | |
2943 | self.volGraphPath.setText(path) |
|
2944 | self.volGraphPath.setText(path) | |
2944 |
|
2945 | |||
2945 | parmObj = opObj.getParameterObj(parameterName='figfile') |
|
2946 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
2946 | if parmObj == None: |
|
2947 | if parmObj == None: | |
2947 | self.volGraphPrefix.clear() |
|
2948 | self.volGraphPrefix.clear() | |
2948 | else: |
|
2949 | else: | |
2949 | value = parmObj.getValue() |
|
2950 | value = parmObj.getValue() | |
2950 | figfile = str(value) |
|
2951 | figfile = str(value) | |
2951 | self.volGraphPrefix.setText(figfile) |
|
2952 | self.volGraphPrefix.setText(figfile) | |
2952 |
|
2953 | |||
2953 | # outputVoltageWrite |
|
2954 | # outputVoltageWrite | |
2954 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2955 | opObj = puObj.getOperationObj(name='VoltageWriter') | |
2955 |
|
2956 | |||
2956 | if opObj == None: |
|
2957 | if opObj == None: | |
2957 | self.volOutputPath.clear() |
|
2958 | self.volOutputPath.clear() | |
2958 | self.volOutputblocksperfile.clear() |
|
2959 | self.volOutputblocksperfile.clear() | |
2959 | self.volOutputprofilesperblock.clear() |
|
2960 | self.volOutputprofilesperblock.clear() | |
2960 | else: |
|
2961 | else: | |
2961 | parmObj = opObj.getParameterObj(parameterName='path') |
|
2962 | parmObj = opObj.getParameterObj(parameterName='path') | |
2962 | if parmObj == None: |
|
2963 | if parmObj == None: | |
2963 | self.volOutputPath.clear() |
|
2964 | self.volOutputPath.clear() | |
2964 | else: |
|
2965 | else: | |
2965 | value = parmObj.getValue() |
|
2966 | value = parmObj.getValue() | |
2966 | path = str(value) |
|
2967 | path = str(value) | |
2967 | self.volOutputPath.setText(path) |
|
2968 | self.volOutputPath.setText(path) | |
2968 |
|
2969 | |||
2969 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') |
|
2970 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
2970 | if parmObj == None: |
|
2971 | if parmObj == None: | |
2971 | self.volOutputblocksperfile.clear() |
|
2972 | self.volOutputblocksperfile.clear() | |
2972 | else: |
|
2973 | else: | |
2973 | value = parmObj.getValue() |
|
2974 | value = parmObj.getValue() | |
2974 | blocksperfile = str(value) |
|
2975 | blocksperfile = str(value) | |
2975 | self.volOutputblocksperfile.setText(blocksperfile) |
|
2976 | self.volOutputblocksperfile.setText(blocksperfile) | |
2976 |
|
2977 | |||
2977 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') |
|
2978 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
2978 | if parmObj == None: |
|
2979 | if parmObj == None: | |
2979 | self.volOutputprofilesperblock.clear() |
|
2980 | self.volOutputprofilesperblock.clear() | |
2980 | else: |
|
2981 | else: | |
2981 | value = parmObj.getValue() |
|
2982 | value = parmObj.getValue() | |
2982 | profilesPerBlock = str(value) |
|
2983 | profilesPerBlock = str(value) | |
2983 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
2984 | self.volOutputprofilesperblock.setText(profilesPerBlock) | |
2984 |
|
2985 | |||
2985 | return |
|
2986 | return | |
2986 |
|
2987 | |||
2987 | def __refreshSpectraWindow(self, puObj): |
|
2988 | def __refreshSpectraWindow(self, puObj): | |
2988 |
|
2989 | |||
2989 | inputId = puObj.getInputId() |
|
2990 | inputId = puObj.getInputId() | |
2990 | inputPUObj = self.__puObjDict[inputId] |
|
2991 | inputPUObj = self.__puObjDict[inputId] | |
2991 |
|
2992 | |||
2992 | if inputPUObj.datatype == 'Voltage': |
|
2993 | if inputPUObj.datatype == 'Voltage': | |
2993 | self.specOpnFFTpoints.setEnabled(True) |
|
2994 | self.specOpnFFTpoints.setEnabled(True) | |
2994 | self.specOpProfiles.setEnabled(True) |
|
2995 | self.specOpProfiles.setEnabled(True) | |
2995 | self.specOpippFactor.setEnabled(True) |
|
2996 | self.specOpippFactor.setEnabled(True) | |
2996 | else: |
|
2997 | else: | |
2997 | self.specOpnFFTpoints.setEnabled(False) |
|
2998 | self.specOpnFFTpoints.setEnabled(False) | |
2998 | self.specOpProfiles.setEnabled(False) |
|
2999 | self.specOpProfiles.setEnabled(False) | |
2999 | self.specOpippFactor.setEnabled(False) |
|
3000 | self.specOpippFactor.setEnabled(False) | |
3000 |
|
3001 | |||
3001 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3002 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
3002 | if opObj == None: |
|
3003 | if opObj == None: | |
3003 | self.specOpRadarfrequency.clear() |
|
3004 | self.specOpRadarfrequency.clear() | |
3004 | self.specOpCebRadarfrequency.setCheckState(0) |
|
3005 | self.specOpCebRadarfrequency.setCheckState(0) | |
3005 | else: |
|
3006 | else: | |
3006 | value = opObj.getParameterValue(parameterName='frequency') |
|
3007 | value = opObj.getParameterValue(parameterName='frequency') | |
3007 | value = str(float(value)/1e6) |
|
3008 | value = str(float(value)/1e6) | |
3008 | self.specOpRadarfrequency.setText(value) |
|
3009 | self.specOpRadarfrequency.setText(value) | |
3009 | self.specOpRadarfrequency.setEnabled(True) |
|
3010 | self.specOpRadarfrequency.setEnabled(True) | |
3010 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) |
|
3011 | self.specOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
3011 |
|
3012 | |||
3012 | opObj = puObj.getOperationObj(name="run") |
|
3013 | opObj = puObj.getOperationObj(name="run") | |
3013 | if opObj == None: |
|
3014 | if opObj == None: | |
3014 | self.specOpnFFTpoints.clear() |
|
3015 | self.specOpnFFTpoints.clear() | |
3015 | self.specOpProfiles.clear() |
|
3016 | self.specOpProfiles.clear() | |
3016 | self.specOpippFactor.clear() |
|
3017 | self.specOpippFactor.clear() | |
3017 | else: |
|
3018 | else: | |
3018 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') |
|
3019 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
3019 | if parmObj == None: |
|
3020 | if parmObj == None: | |
3020 | self.specOpnFFTpoints.clear() |
|
3021 | self.specOpnFFTpoints.clear() | |
3021 | else: |
|
3022 | else: | |
3022 | self.specOpnFFTpoints.setEnabled(True) |
|
3023 | self.specOpnFFTpoints.setEnabled(True) | |
3023 | value = opObj.getParameterValue(parameterName='nFFTPoints') |
|
3024 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
3024 | self.specOpnFFTpoints.setText(str(value)) |
|
3025 | self.specOpnFFTpoints.setText(str(value)) | |
3025 |
|
3026 | |||
3026 | parmObj = opObj.getParameterObj(parameterName='nProfiles') |
|
3027 | parmObj = opObj.getParameterObj(parameterName='nProfiles') | |
3027 | if parmObj == None: |
|
3028 | if parmObj == None: | |
3028 | self.specOpProfiles.clear() |
|
3029 | self.specOpProfiles.clear() | |
3029 | else: |
|
3030 | else: | |
3030 | self.specOpProfiles.setEnabled(True) |
|
3031 | self.specOpProfiles.setEnabled(True) | |
3031 | value = opObj.getParameterValue(parameterName='nProfiles') |
|
3032 | value = opObj.getParameterValue(parameterName='nProfiles') | |
3032 | self.specOpProfiles.setText(str(value)) |
|
3033 | self.specOpProfiles.setText(str(value)) | |
3033 |
|
3034 | |||
3034 | parmObj = opObj.getParameterObj(parameterName='ippFactor') |
|
3035 | parmObj = opObj.getParameterObj(parameterName='ippFactor') | |
3035 | if parmObj == None: |
|
3036 | if parmObj == None: | |
3036 | self.specOpippFactor.clear() |
|
3037 | self.specOpippFactor.clear() | |
3037 | else: |
|
3038 | else: | |
3038 | self.specOpippFactor.setEnabled(True) |
|
3039 | self.specOpippFactor.setEnabled(True) | |
3039 | value = opObj.getParameterValue(parameterName='ippFactor') |
|
3040 | value = opObj.getParameterValue(parameterName='ippFactor') | |
3040 | self.specOpippFactor.setText(str(value)) |
|
3041 | self.specOpippFactor.setText(str(value)) | |
3041 |
|
3042 | |||
3042 | opObj = puObj.getOperationObj(name="run") |
|
3043 | opObj = puObj.getOperationObj(name="run") | |
3043 | if opObj == None: |
|
3044 | if opObj == None: | |
3044 | self.specOppairsList.clear() |
|
3045 | self.specOppairsList.clear() | |
3045 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3046 | self.specOpCebCrossSpectra.setCheckState(0) | |
3046 | else: |
|
3047 | else: | |
3047 | parmObj = opObj.getParameterObj(parameterName='pairsList') |
|
3048 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
3048 | if parmObj == None: |
|
3049 | if parmObj == None: | |
3049 | self.specOppairsList.clear() |
|
3050 | self.specOppairsList.clear() | |
3050 | self.specOpCebCrossSpectra.setCheckState(0) |
|
3051 | self.specOpCebCrossSpectra.setCheckState(0) | |
3051 | else: |
|
3052 | else: | |
3052 | value = opObj.getParameterValue(parameterName='pairsList') |
|
3053 | value = opObj.getParameterValue(parameterName='pairsList') | |
3053 | value = str(value)[1:-1] |
|
3054 | value = str(value)[1:-1] | |
3054 | self.specOppairsList.setText(str(value)) |
|
3055 | self.specOppairsList.setText(str(value)) | |
3055 | self.specOppairsList.setEnabled(True) |
|
3056 | self.specOppairsList.setEnabled(True) | |
3056 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) |
|
3057 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
3057 |
|
3058 | |||
3058 | opObj = puObj.getOperationObj(name="selectChannels") |
|
3059 | opObj = puObj.getOperationObj(name="selectChannels") | |
3059 |
|
3060 | |||
3060 | if opObj == None: |
|
3061 | if opObj == None: | |
3061 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") |
|
3062 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
3062 |
|
3063 | |||
3063 | if opObj == None: |
|
3064 | if opObj == None: | |
3064 | self.specOpChannel.clear() |
|
3065 | self.specOpChannel.clear() | |
3065 | self.specOpCebChannel.setCheckState(0) |
|
3066 | self.specOpCebChannel.setCheckState(0) | |
3066 | else: |
|
3067 | else: | |
3067 | channelEnabled = False |
|
3068 | channelEnabled = False | |
3068 | try: |
|
3069 | try: | |
3069 | value = opObj.getParameterValue(parameterName='channelList') |
|
3070 | value = opObj.getParameterValue(parameterName='channelList') | |
3070 | value = str(value)[1:-1] |
|
3071 | value = str(value)[1:-1] | |
3071 | channelEnabled = True |
|
3072 | channelEnabled = True | |
3072 | channelMode = 0 |
|
3073 | channelMode = 0 | |
3073 | except: |
|
3074 | except: | |
3074 | pass |
|
3075 | pass | |
3075 | try: |
|
3076 | try: | |
3076 | value = opObj.getParameterValue(parameterName='channelIndexList') |
|
3077 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
3077 | value = str(value)[1:-1] |
|
3078 | value = str(value)[1:-1] | |
3078 | channelEnabled = True |
|
3079 | channelEnabled = True | |
3079 | channelMode = 1 |
|
3080 | channelMode = 1 | |
3080 | except: |
|
3081 | except: | |
3081 | pass |
|
3082 | pass | |
3082 |
|
3083 | |||
3083 | if channelEnabled: |
|
3084 | if channelEnabled: | |
3084 | self.specOpChannel.setText(value) |
|
3085 | self.specOpChannel.setText(value) | |
3085 | self.specOpChannel.setEnabled(True) |
|
3086 | self.specOpChannel.setEnabled(True) | |
3086 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) |
|
3087 | self.specOpCebChannel.setCheckState(QtCore.Qt.Checked) | |
3087 | self.specOpComChannel.setCurrentIndex(channelMode) |
|
3088 | self.specOpComChannel.setCurrentIndex(channelMode) | |
3088 |
|
3089 | |||
3089 | opObj = puObj.getOperationObj(name="selectHeights") |
|
3090 | opObj = puObj.getOperationObj(name="selectHeights") | |
3090 | if opObj == None: |
|
3091 | if opObj == None: | |
3091 | self.specOpHeights.clear() |
|
3092 | self.specOpHeights.clear() | |
3092 | self.specOpCebHeights.setCheckState(0) |
|
3093 | self.specOpCebHeights.setCheckState(0) | |
3093 | else: |
|
3094 | else: | |
3094 | value1 = int(opObj.getParameterValue(parameterName='minHei')) |
|
3095 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
3095 | value1 = str(value1) |
|
3096 | value1 = str(value1) | |
3096 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) |
|
3097 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
3097 | value2 = str(value2) |
|
3098 | value2 = str(value2) | |
3098 | value = value1 + "," + value2 |
|
3099 | value = value1 + "," + value2 | |
3099 | self.specOpHeights.setText(value) |
|
3100 | self.specOpHeights.setText(value) | |
3100 | self.specOpHeights.setEnabled(True) |
|
3101 | self.specOpHeights.setEnabled(True) | |
3101 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) |
|
3102 | self.specOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
3102 |
|
3103 | |||
3103 | opObj = puObj.getOperationObj(name="IncohInt") |
|
3104 | opObj = puObj.getOperationObj(name="IncohInt") | |
3104 | if opObj == None: |
|
3105 | if opObj == None: | |
3105 | self.specOpIncoherent.clear() |
|
3106 | self.specOpIncoherent.clear() | |
3106 | self.specOpCebIncoherent.setCheckState(0) |
|
3107 | self.specOpCebIncoherent.setCheckState(0) | |
3107 | else: |
|
3108 | else: | |
3108 | for parmObj in opObj.getParameterObjList(): |
|
3109 | for parmObj in opObj.getParameterObjList(): | |
3109 | if parmObj.name == 'timeInterval': |
|
3110 | if parmObj.name == 'timeInterval': | |
3110 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3111 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3111 | self.specOpIncoherent.setText(str(value)) |
|
3112 | self.specOpIncoherent.setText(str(value)) | |
3112 | self.specOpIncoherent.setEnabled(True) |
|
3113 | self.specOpIncoherent.setEnabled(True) | |
3113 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3114 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3114 | self.specOpCobIncInt.setCurrentIndex(0) |
|
3115 | self.specOpCobIncInt.setCurrentIndex(0) | |
3115 |
|
3116 | |||
3116 | if parmObj.name == 'n': |
|
3117 | if parmObj.name == 'n': | |
3117 | value = opObj.getParameterValue(parameterName='n') |
|
3118 | value = opObj.getParameterValue(parameterName='n') | |
3118 | self.specOpIncoherent.setText(str(value)) |
|
3119 | self.specOpIncoherent.setText(str(value)) | |
3119 | self.specOpIncoherent.setEnabled(True) |
|
3120 | self.specOpIncoherent.setEnabled(True) | |
3120 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3121 | self.specOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3121 | self.specOpCobIncInt.setCurrentIndex(1) |
|
3122 | self.specOpCobIncInt.setCurrentIndex(1) | |
3122 |
|
3123 | |||
3123 | opObj = puObj.getOperationObj(name="removeDC") |
|
3124 | opObj = puObj.getOperationObj(name="removeDC") | |
3124 | if opObj == None: |
|
3125 | if opObj == None: | |
3125 | self.specOpCebRemoveDC.setCheckState(0) |
|
3126 | self.specOpCebRemoveDC.setCheckState(0) | |
3126 | else: |
|
3127 | else: | |
3127 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) |
|
3128 | self.specOpCebRemoveDC.setCheckState(QtCore.Qt.Checked) | |
3128 | value = opObj.getParameterValue(parameterName='mode') |
|
3129 | value = opObj.getParameterValue(parameterName='mode') | |
3129 | if value == 1: |
|
3130 | if value == 1: | |
3130 | self.specOpComRemoveDC.setCurrentIndex(0) |
|
3131 | self.specOpComRemoveDC.setCurrentIndex(0) | |
3131 | elif value == 2: |
|
3132 | elif value == 2: | |
3132 | self.specOpComRemoveDC.setCurrentIndex(1) |
|
3133 | self.specOpComRemoveDC.setCurrentIndex(1) | |
3133 |
|
3134 | |||
3134 | opObj = puObj.getOperationObj(name="removeInterference") |
|
3135 | opObj = puObj.getOperationObj(name="removeInterference") | |
3135 | if opObj == None: |
|
3136 | if opObj == None: | |
3136 | self.specOpCebRemoveInt.setCheckState(0) |
|
3137 | self.specOpCebRemoveInt.setCheckState(0) | |
3137 | else: |
|
3138 | else: | |
3138 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) |
|
3139 | self.specOpCebRemoveInt.setCheckState(QtCore.Qt.Checked) | |
3139 |
|
3140 | |||
3140 | opObj = puObj.getOperationObj(name='getNoise') |
|
3141 | opObj = puObj.getOperationObj(name='getNoise') | |
3141 | if opObj == None: |
|
3142 | if opObj == None: | |
3142 | self.specOpCebgetNoise.setCheckState(0) |
|
3143 | self.specOpCebgetNoise.setCheckState(0) | |
3143 | self.specOpgetNoise.clear() |
|
3144 | self.specOpgetNoise.clear() | |
3144 | else: |
|
3145 | else: | |
3145 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) |
|
3146 | self.specOpCebgetNoise.setCheckState(QtCore.Qt.Checked) | |
3146 | parmObj = opObj.getParameterObj(parameterName='minHei') |
|
3147 | parmObj = opObj.getParameterObj(parameterName='minHei') | |
3147 | if parmObj == None: |
|
3148 | if parmObj == None: | |
3148 | self.specOpgetNoise.clear() |
|
3149 | self.specOpgetNoise.clear() | |
3149 | value1 = None |
|
3150 | value1 = None | |
3150 | else: |
|
3151 | else: | |
3151 | value1 = opObj.getParameterValue(parameterName='minHei') |
|
3152 | value1 = opObj.getParameterValue(parameterName='minHei') | |
3152 | value1 = str(value1) |
|
3153 | value1 = str(value1) | |
3153 | parmObj = opObj.getParameterObj(parameterName='maxHei') |
|
3154 | parmObj = opObj.getParameterObj(parameterName='maxHei') | |
3154 | if parmObj == None: |
|
3155 | if parmObj == None: | |
3155 | value2 = None |
|
3156 | value2 = None | |
3156 | value = value1 |
|
3157 | value = value1 | |
3157 | self.specOpgetNoise.setText(value) |
|
3158 | self.specOpgetNoise.setText(value) | |
3158 | self.specOpgetNoise.setEnabled(True) |
|
3159 | self.specOpgetNoise.setEnabled(True) | |
3159 | else: |
|
3160 | else: | |
3160 | value2 = opObj.getParameterValue(parameterName='maxHei') |
|
3161 | value2 = opObj.getParameterValue(parameterName='maxHei') | |
3161 | value2 = str(value2) |
|
3162 | value2 = str(value2) | |
3162 | parmObj = opObj.getParameterObj(parameterName='minVel') |
|
3163 | parmObj = opObj.getParameterObj(parameterName='minVel') | |
3163 | if parmObj == None: |
|
3164 | if parmObj == None: | |
3164 | value3 = None |
|
3165 | value3 = None | |
3165 | value = value1 + "," + value2 |
|
3166 | value = value1 + "," + value2 | |
3166 | self.specOpgetNoise.setText(value) |
|
3167 | self.specOpgetNoise.setText(value) | |
3167 | self.specOpgetNoise.setEnabled(True) |
|
3168 | self.specOpgetNoise.setEnabled(True) | |
3168 | else: |
|
3169 | else: | |
3169 | value3 = opObj.getParameterValue(parameterName='minVel') |
|
3170 | value3 = opObj.getParameterValue(parameterName='minVel') | |
3170 | value3 = str(value3) |
|
3171 | value3 = str(value3) | |
3171 | parmObj = opObj.getParameterObj(parameterName='maxVel') |
|
3172 | parmObj = opObj.getParameterObj(parameterName='maxVel') | |
3172 | if parmObj == None: |
|
3173 | if parmObj == None: | |
3173 | value4 = None |
|
3174 | value4 = None | |
3174 | value = value1 + "," + value2 + "," + value3 |
|
3175 | value = value1 + "," + value2 + "," + value3 | |
3175 | self.specOpgetNoise.setText(value) |
|
3176 | self.specOpgetNoise.setText(value) | |
3176 | self.specOpgetNoise.setEnabled(True) |
|
3177 | self.specOpgetNoise.setEnabled(True) | |
3177 | else: |
|
3178 | else: | |
3178 | value4 = opObj.getParameterValue(parameterName='maxVel') |
|
3179 | value4 = opObj.getParameterValue(parameterName='maxVel') | |
3179 | value4 = str(value4) |
|
3180 | value4 = str(value4) | |
3180 | value = value1 + "," + value2 + "," + value3 + ',' + value4 |
|
3181 | value = value1 + "," + value2 + "," + value3 + ',' + value4 | |
3181 | self.specOpgetNoise.setText(value) |
|
3182 | self.specOpgetNoise.setText(value) | |
3182 | self.specOpgetNoise.setEnabled(True) |
|
3183 | self.specOpgetNoise.setEnabled(True) | |
3183 |
|
3184 | |||
3184 | self.specGraphPath.clear() |
|
3185 | self.specGraphPath.clear() | |
3185 | self.specGraphPrefix.clear() |
|
3186 | self.specGraphPrefix.clear() | |
3186 | self.specGgraphFreq.clear() |
|
3187 | self.specGgraphFreq.clear() | |
3187 | self.specGgraphHeight.clear() |
|
3188 | self.specGgraphHeight.clear() | |
3188 | self.specGgraphDbsrange.clear() |
|
3189 | self.specGgraphDbsrange.clear() | |
3189 | self.specGgraphmagnitud.clear() |
|
3190 | self.specGgraphmagnitud.clear() | |
3190 | self.specGgraphPhase.clear() |
|
3191 | self.specGgraphPhase.clear() | |
3191 | self.specGgraphChannelList.clear() |
|
3192 | self.specGgraphChannelList.clear() | |
3192 | self.specGgraphTminTmax.clear() |
|
3193 | self.specGgraphTminTmax.clear() | |
3193 | self.specGgraphTimeRange.clear() |
|
3194 | self.specGgraphTimeRange.clear() | |
3194 | self.specGgraphftpratio.clear() |
|
3195 | self.specGgraphftpratio.clear() | |
3195 |
|
3196 | |||
3196 | opObj = puObj.getOperationObj(name='SpectraPlot') |
|
3197 | opObj = puObj.getOperationObj(name='SpectraPlot') | |
3197 |
|
3198 | |||
3198 | if opObj == None: |
|
3199 | if opObj == None: | |
3199 | self.specGraphCebSpectraplot.setCheckState(0) |
|
3200 | self.specGraphCebSpectraplot.setCheckState(0) | |
3200 | self.specGraphSaveSpectra.setCheckState(0) |
|
3201 | self.specGraphSaveSpectra.setCheckState(0) | |
3201 | self.specGraphftpSpectra.setCheckState(0) |
|
3202 | self.specGraphftpSpectra.setCheckState(0) | |
3202 | else: |
|
3203 | else: | |
3203 | operationSpectraPlot = "Enable" |
|
3204 | operationSpectraPlot = "Enable" | |
3204 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3205 | self.specGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3205 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3206 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3206 | if parmObj == None: |
|
3207 | if parmObj == None: | |
3207 | self.specGgraphChannelList.clear() |
|
3208 | self.specGgraphChannelList.clear() | |
3208 | else: |
|
3209 | else: | |
3209 | value = opObj.getParameterValue(parameterName='channelList') |
|
3210 | value = opObj.getParameterValue(parameterName='channelList') | |
3210 | channelListSpectraPlot = str(value)[1:-1] |
|
3211 | channelListSpectraPlot = str(value)[1:-1] | |
3211 | self.specGgraphChannelList.setText(channelListSpectraPlot) |
|
3212 | self.specGgraphChannelList.setText(channelListSpectraPlot) | |
3212 | self.specGgraphChannelList.setEnabled(True) |
|
3213 | self.specGgraphChannelList.setEnabled(True) | |
3213 |
|
3214 | |||
3214 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3215 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3215 | if parmObj == None: |
|
3216 | if parmObj == None: | |
3216 | self.specGgraphFreq.clear() |
|
3217 | self.specGgraphFreq.clear() | |
3217 | else: |
|
3218 | else: | |
3218 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3219 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3219 | value1 = str(value1) |
|
3220 | value1 = str(value1) | |
3220 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3221 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3221 | value2 = str(value2) |
|
3222 | value2 = str(value2) | |
3222 | value = value1 + "," + value2 |
|
3223 | value = value1 + "," + value2 | |
3223 | self.specGgraphFreq.setText(value) |
|
3224 | self.specGgraphFreq.setText(value) | |
3224 | self.specGgraphFreq.setEnabled(True) |
|
3225 | self.specGgraphFreq.setEnabled(True) | |
3225 |
|
3226 | |||
3226 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3227 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3227 | if parmObj == None: |
|
3228 | if parmObj == None: | |
3228 | self.specGgraphHeight.clear() |
|
3229 | self.specGgraphHeight.clear() | |
3229 | else: |
|
3230 | else: | |
3230 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3231 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3231 | value1 = str(value1) |
|
3232 | value1 = str(value1) | |
3232 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3233 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3233 | value2 = str(value2) |
|
3234 | value2 = str(value2) | |
3234 | value = value1 + "," + value2 |
|
3235 | value = value1 + "," + value2 | |
3235 | self.specGgraphHeight.setText(value) |
|
3236 | self.specGgraphHeight.setText(value) | |
3236 | self.specGgraphHeight.setEnabled(True) |
|
3237 | self.specGgraphHeight.setEnabled(True) | |
3237 |
|
3238 | |||
3238 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3239 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3239 | if parmObj == None: |
|
3240 | if parmObj == None: | |
3240 | self.specGgraphDbsrange.clear() |
|
3241 | self.specGgraphDbsrange.clear() | |
3241 | else: |
|
3242 | else: | |
3242 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3243 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3243 | value1 = str(value1) |
|
3244 | value1 = str(value1) | |
3244 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3245 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3245 | value2 = str(value2) |
|
3246 | value2 = str(value2) | |
3246 | value = value1 + "," + value2 |
|
3247 | value = value1 + "," + value2 | |
3247 | self.specGgraphDbsrange.setText(value) |
|
3248 | self.specGgraphDbsrange.setText(value) | |
3248 | self.specGgraphDbsrange.setEnabled(True) |
|
3249 | self.specGgraphDbsrange.setEnabled(True) | |
3249 |
|
3250 | |||
3250 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3251 | parmObj = opObj.getParameterObj(parameterName="save") | |
3251 | if parmObj == None: |
|
3252 | if parmObj == None: | |
3252 | self.specGraphSaveSpectra.setCheckState(0) |
|
3253 | self.specGraphSaveSpectra.setCheckState(0) | |
3253 | else: |
|
3254 | else: | |
3254 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3255 | self.specGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3255 |
|
3256 | |||
3256 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3257 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3257 | if parmObj == None: |
|
3258 | if parmObj == None: | |
3258 | self.specGraphftpSpectra.setCheckState(0) |
|
3259 | self.specGraphftpSpectra.setCheckState(0) | |
3259 | else: |
|
3260 | else: | |
3260 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3261 | self.specGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3261 |
|
3262 | |||
3262 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3263 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3263 | if parmObj: |
|
3264 | if parmObj: | |
3264 | value = parmObj.getValue() |
|
3265 | value = parmObj.getValue() | |
3265 | self.specGraphPath.setText(value) |
|
3266 | self.specGraphPath.setText(value) | |
3266 |
|
3267 | |||
3267 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3268 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3268 | if parmObj: |
|
3269 | if parmObj: | |
3269 | value = parmObj.getValue() |
|
3270 | value = parmObj.getValue() | |
3270 | self.specGgraphftpratio.setText(str(value)) |
|
3271 | self.specGgraphftpratio.setText(str(value)) | |
3271 |
|
3272 | |||
3272 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') |
|
3273 | opObj = puObj.getOperationObj(name='CrossSpectraPlot') | |
3273 |
|
3274 | |||
3274 | if opObj == None: |
|
3275 | if opObj == None: | |
3275 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
3276 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
3276 | self.specGraphSaveCross.setCheckState(0) |
|
3277 | self.specGraphSaveCross.setCheckState(0) | |
3277 | self.specGraphftpCross.setCheckState(0) |
|
3278 | self.specGraphftpCross.setCheckState(0) | |
3278 | else: |
|
3279 | else: | |
3279 | operationCrossSpectraPlot = "Enable" |
|
3280 | operationCrossSpectraPlot = "Enable" | |
3280 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3281 | self.specGraphCebCrossSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3281 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3282 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3282 | if parmObj == None: |
|
3283 | if parmObj == None: | |
3283 | self.specGgraphFreq.clear() |
|
3284 | self.specGgraphFreq.clear() | |
3284 | else: |
|
3285 | else: | |
3285 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3286 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3286 | value1 = str(value1) |
|
3287 | value1 = str(value1) | |
3287 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3288 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3288 | value2 = str(value2) |
|
3289 | value2 = str(value2) | |
3289 | value = value1 + "," + value2 |
|
3290 | value = value1 + "," + value2 | |
3290 | self.specGgraphFreq.setText(value) |
|
3291 | self.specGgraphFreq.setText(value) | |
3291 | self.specGgraphFreq.setEnabled(True) |
|
3292 | self.specGgraphFreq.setEnabled(True) | |
3292 |
|
3293 | |||
3293 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3294 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3294 | if parmObj == None: |
|
3295 | if parmObj == None: | |
3295 | self.specGgraphHeight.clear() |
|
3296 | self.specGgraphHeight.clear() | |
3296 | else: |
|
3297 | else: | |
3297 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3298 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3298 | value1 = str(value1) |
|
3299 | value1 = str(value1) | |
3299 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3300 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3300 | value2 = str(value2) |
|
3301 | value2 = str(value2) | |
3301 | value = value1 + "," + value2 |
|
3302 | value = value1 + "," + value2 | |
3302 | self.specGgraphHeight.setText(value) |
|
3303 | self.specGgraphHeight.setText(value) | |
3303 | self.specGgraphHeight.setEnabled(True) |
|
3304 | self.specGgraphHeight.setEnabled(True) | |
3304 |
|
3305 | |||
3305 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3306 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3306 | if parmObj == None: |
|
3307 | if parmObj == None: | |
3307 | self.specGgraphDbsrange.clear() |
|
3308 | self.specGgraphDbsrange.clear() | |
3308 | else: |
|
3309 | else: | |
3309 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3310 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3310 | value1 = str(value1) |
|
3311 | value1 = str(value1) | |
3311 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3312 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3312 | value2 = str(value2) |
|
3313 | value2 = str(value2) | |
3313 | value = value1 + "," + value2 |
|
3314 | value = value1 + "," + value2 | |
3314 | self.specGgraphDbsrange.setText(value) |
|
3315 | self.specGgraphDbsrange.setText(value) | |
3315 | self.specGgraphDbsrange.setEnabled(True) |
|
3316 | self.specGgraphDbsrange.setEnabled(True) | |
3316 |
|
3317 | |||
3317 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3318 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3318 | if parmObj == None: |
|
3319 | if parmObj == None: | |
3319 | self.specGgraphmagnitud.clear() |
|
3320 | self.specGgraphmagnitud.clear() | |
3320 | else: |
|
3321 | else: | |
3321 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3322 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3322 | value1 = str(value1) |
|
3323 | value1 = str(value1) | |
3323 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3324 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3324 | value2 = str(value2) |
|
3325 | value2 = str(value2) | |
3325 | value = value1 + "," + value2 |
|
3326 | value = value1 + "," + value2 | |
3326 | self.specGgraphmagnitud.setText(value) |
|
3327 | self.specGgraphmagnitud.setText(value) | |
3327 | self.specGgraphmagnitud.setEnabled(True) |
|
3328 | self.specGgraphmagnitud.setEnabled(True) | |
3328 |
|
3329 | |||
3329 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3330 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3330 | if parmObj == None: |
|
3331 | if parmObj == None: | |
3331 | self.specGgraphPhase.clear() |
|
3332 | self.specGgraphPhase.clear() | |
3332 | else: |
|
3333 | else: | |
3333 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3334 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3334 | value1 = str(value1) |
|
3335 | value1 = str(value1) | |
3335 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3336 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3336 | value2 = str(value2) |
|
3337 | value2 = str(value2) | |
3337 | value = value1 + "," + value2 |
|
3338 | value = value1 + "," + value2 | |
3338 | self.specGgraphPhase.setText(value) |
|
3339 | self.specGgraphPhase.setText(value) | |
3339 | self.specGgraphPhase.setEnabled(True) |
|
3340 | self.specGgraphPhase.setEnabled(True) | |
3340 |
|
3341 | |||
3341 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3342 | parmObj = opObj.getParameterObj(parameterName="save") | |
3342 | if parmObj == None: |
|
3343 | if parmObj == None: | |
3343 | self.specGraphSaveCross.setCheckState(0) |
|
3344 | self.specGraphSaveCross.setCheckState(0) | |
3344 | else: |
|
3345 | else: | |
3345 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) |
|
3346 | self.specGraphSaveCross.setCheckState(QtCore.Qt.Checked) | |
3346 |
|
3347 | |||
3347 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3348 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3348 | if parmObj == None: |
|
3349 | if parmObj == None: | |
3349 | self.specGraphftpCross.setCheckState(0) |
|
3350 | self.specGraphftpCross.setCheckState(0) | |
3350 | else: |
|
3351 | else: | |
3351 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) |
|
3352 | self.specGraphftpCross.setCheckState(QtCore.Qt.Checked) | |
3352 |
|
3353 | |||
3353 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3354 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3354 | if parmObj: |
|
3355 | if parmObj: | |
3355 | value = parmObj.getValue() |
|
3356 | value = parmObj.getValue() | |
3356 | self.specGraphPath.setText(value) |
|
3357 | self.specGraphPath.setText(value) | |
3357 |
|
3358 | |||
3358 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3359 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3359 | if parmObj: |
|
3360 | if parmObj: | |
3360 | value = parmObj.getValue() |
|
3361 | value = parmObj.getValue() | |
3361 | self.specGgraphftpratio.setText(str(value)) |
|
3362 | self.specGgraphftpratio.setText(str(value)) | |
3362 |
|
3363 | |||
3363 | opObj = puObj.getOperationObj(name='RTIPlot') |
|
3364 | opObj = puObj.getOperationObj(name='RTIPlot') | |
3364 |
|
3365 | |||
3365 | if opObj == None: |
|
3366 | if opObj == None: | |
3366 | self.specGraphCebRTIplot.setCheckState(0) |
|
3367 | self.specGraphCebRTIplot.setCheckState(0) | |
3367 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3368 | self.specGraphSaveRTIplot.setCheckState(0) | |
3368 | self.specGraphftpRTIplot.setCheckState(0) |
|
3369 | self.specGraphftpRTIplot.setCheckState(0) | |
3369 | else: |
|
3370 | else: | |
3370 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3371 | self.specGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3371 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3372 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3372 | if parmObj == None: |
|
3373 | if parmObj == None: | |
3373 | self.specGgraphChannelList.clear() |
|
3374 | self.specGgraphChannelList.clear() | |
3374 | else: |
|
3375 | else: | |
3375 | value = opObj.getParameterValue(parameterName='channelList') |
|
3376 | value = opObj.getParameterValue(parameterName='channelList') | |
3376 | channelListRTIPlot = str(value)[1:-1] |
|
3377 | channelListRTIPlot = str(value)[1:-1] | |
3377 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3378 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3378 | self.specGgraphChannelList.setEnabled(True) |
|
3379 | self.specGgraphChannelList.setEnabled(True) | |
3379 |
|
3380 | |||
3380 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3381 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3381 | if parmObj == None: |
|
3382 | if parmObj == None: | |
3382 | self.specGgraphTminTmax.clear() |
|
3383 | self.specGgraphTminTmax.clear() | |
3383 | else: |
|
3384 | else: | |
3384 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3385 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3385 | value1 = str(value1) |
|
3386 | value1 = str(value1) | |
3386 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3387 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3387 | value2 = str(value2) |
|
3388 | value2 = str(value2) | |
3388 | value = value1 + "," + value2 |
|
3389 | value = value1 + "," + value2 | |
3389 | self.specGgraphTminTmax.setText(value) |
|
3390 | self.specGgraphTminTmax.setText(value) | |
3390 | self.specGgraphTminTmax.setEnabled(True) |
|
3391 | self.specGgraphTminTmax.setEnabled(True) | |
3391 |
|
3392 | |||
3392 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3393 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3393 | if parmObj == None: |
|
3394 | if parmObj == None: | |
3394 | self.specGgraphTimeRange.clear() |
|
3395 | self.specGgraphTimeRange.clear() | |
3395 | else: |
|
3396 | else: | |
3396 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3397 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3397 | value1 = str(value1) |
|
3398 | value1 = str(value1) | |
3398 | self.specGgraphTimeRange.setText(value1) |
|
3399 | self.specGgraphTimeRange.setText(value1) | |
3399 | self.specGgraphTimeRange.setEnabled(True) |
|
3400 | self.specGgraphTimeRange.setEnabled(True) | |
3400 |
|
3401 | |||
3401 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3402 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3402 | if parmObj == None: |
|
3403 | if parmObj == None: | |
3403 | self.specGgraphHeight.clear() |
|
3404 | self.specGgraphHeight.clear() | |
3404 | else: |
|
3405 | else: | |
3405 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3406 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3406 | value1 = str(value1) |
|
3407 | value1 = str(value1) | |
3407 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3408 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3408 | value2 = str(value2) |
|
3409 | value2 = str(value2) | |
3409 | value = value1 + "," + value2 |
|
3410 | value = value1 + "," + value2 | |
3410 | self.specGgraphHeight.setText(value) |
|
3411 | self.specGgraphHeight.setText(value) | |
3411 | self.specGgraphHeight.setEnabled(True) |
|
3412 | self.specGgraphHeight.setEnabled(True) | |
3412 |
|
3413 | |||
3413 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3414 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3414 | if parmObj == None: |
|
3415 | if parmObj == None: | |
3415 | self.specGgraphDbsrange.clear() |
|
3416 | self.specGgraphDbsrange.clear() | |
3416 | else: |
|
3417 | else: | |
3417 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3418 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3418 | value1 = str(value1) |
|
3419 | value1 = str(value1) | |
3419 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3420 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3420 | value2 = str(value2) |
|
3421 | value2 = str(value2) | |
3421 | value = value1 + "," + value2 |
|
3422 | value = value1 + "," + value2 | |
3422 | self.specGgraphDbsrange.setText(value) |
|
3423 | self.specGgraphDbsrange.setText(value) | |
3423 | self.specGgraphDbsrange.setEnabled(True) |
|
3424 | self.specGgraphDbsrange.setEnabled(True) | |
3424 |
|
3425 | |||
3425 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3426 | parmObj = opObj.getParameterObj(parameterName="save") | |
3426 | if parmObj == None: |
|
3427 | if parmObj == None: | |
3427 | self.specGraphSaveRTIplot.setCheckState(0) |
|
3428 | self.specGraphSaveRTIplot.setCheckState(0) | |
3428 | else: |
|
3429 | else: | |
3429 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3430 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3430 |
|
3431 | |||
3431 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3432 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3432 | if parmObj == None: |
|
3433 | if parmObj == None: | |
3433 | self.specGraphftpRTIplot.setCheckState(0) |
|
3434 | self.specGraphftpRTIplot.setCheckState(0) | |
3434 | else: |
|
3435 | else: | |
3435 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3436 | self.specGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3436 |
|
3437 | |||
3437 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3438 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3438 | if parmObj: |
|
3439 | if parmObj: | |
3439 | value = parmObj.getValue() |
|
3440 | value = parmObj.getValue() | |
3440 | self.specGraphPath.setText(value) |
|
3441 | self.specGraphPath.setText(value) | |
3441 |
|
3442 | |||
3442 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3443 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3443 | if parmObj: |
|
3444 | if parmObj: | |
3444 | value = parmObj.getValue() |
|
3445 | value = parmObj.getValue() | |
3445 | self.specGgraphftpratio.setText(str(value)) |
|
3446 | self.specGgraphftpratio.setText(str(value)) | |
3446 |
|
3447 | |||
3447 | opObj = puObj.getOperationObj(name='CoherenceMap') |
|
3448 | opObj = puObj.getOperationObj(name='CoherenceMap') | |
3448 |
|
3449 | |||
3449 | if opObj == None: |
|
3450 | if opObj == None: | |
3450 | self.specGraphCebCoherencmap.setCheckState(0) |
|
3451 | self.specGraphCebCoherencmap.setCheckState(0) | |
3451 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3452 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3452 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3453 | self.specGraphftpCoherencemap.setCheckState(0) | |
3453 | else: |
|
3454 | else: | |
3454 | operationCoherenceMap = "Enable" |
|
3455 | operationCoherenceMap = "Enable" | |
3455 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) |
|
3456 | self.specGraphCebCoherencmap.setCheckState(QtCore.Qt.Checked) | |
3456 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3457 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3457 | if parmObj == None: |
|
3458 | if parmObj == None: | |
3458 | self.specGgraphTminTmax.clear() |
|
3459 | self.specGgraphTminTmax.clear() | |
3459 | else: |
|
3460 | else: | |
3460 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3461 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3461 | value1 = str(value1) |
|
3462 | value1 = str(value1) | |
3462 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3463 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3463 | value2 = str(value2) |
|
3464 | value2 = str(value2) | |
3464 | value = value1 + "," + value2 |
|
3465 | value = value1 + "," + value2 | |
3465 | self.specGgraphTminTmax.setText(value) |
|
3466 | self.specGgraphTminTmax.setText(value) | |
3466 | self.specGgraphTminTmax.setEnabled(True) |
|
3467 | self.specGgraphTminTmax.setEnabled(True) | |
3467 |
|
3468 | |||
3468 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3469 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3469 | if parmObj == None: |
|
3470 | if parmObj == None: | |
3470 | self.specGgraphTimeRange.clear() |
|
3471 | self.specGgraphTimeRange.clear() | |
3471 | else: |
|
3472 | else: | |
3472 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3473 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3473 | value1 = str(value1) |
|
3474 | value1 = str(value1) | |
3474 | self.specGgraphTimeRange.setText(value1) |
|
3475 | self.specGgraphTimeRange.setText(value1) | |
3475 | self.specGgraphTimeRange.setEnabled(True) |
|
3476 | self.specGgraphTimeRange.setEnabled(True) | |
3476 |
|
3477 | |||
3477 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3478 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3478 | if parmObj == None: |
|
3479 | if parmObj == None: | |
3479 | self.specGgraphHeight.clear() |
|
3480 | self.specGgraphHeight.clear() | |
3480 | else: |
|
3481 | else: | |
3481 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3482 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3482 | value1 = str(value1) |
|
3483 | value1 = str(value1) | |
3483 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3484 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3484 | value2 = str(value2) |
|
3485 | value2 = str(value2) | |
3485 | value = value1 + "," + value2 |
|
3486 | value = value1 + "," + value2 | |
3486 | self.specGgraphHeight.setText(value) |
|
3487 | self.specGgraphHeight.setText(value) | |
3487 | self.specGgraphHeight.setEnabled(True) |
|
3488 | self.specGgraphHeight.setEnabled(True) | |
3488 |
|
3489 | |||
3489 | parmObj = opObj.getParameterObj(parameterName='zmin') |
|
3490 | parmObj = opObj.getParameterObj(parameterName='zmin') | |
3490 | if parmObj == None: |
|
3491 | if parmObj == None: | |
3491 | self.specGgraphmagnitud.clear() |
|
3492 | self.specGgraphmagnitud.clear() | |
3492 | else: |
|
3493 | else: | |
3493 | value1 = opObj.getParameterValue(parameterName='zmin') |
|
3494 | value1 = opObj.getParameterValue(parameterName='zmin') | |
3494 | value1 = str(value1) |
|
3495 | value1 = str(value1) | |
3495 | value2 = opObj.getParameterValue(parameterName='zmax') |
|
3496 | value2 = opObj.getParameterValue(parameterName='zmax') | |
3496 | value2 = str(value2) |
|
3497 | value2 = str(value2) | |
3497 | value = value1 + "," + value2 |
|
3498 | value = value1 + "," + value2 | |
3498 | self.specGgraphmagnitud.setText(value) |
|
3499 | self.specGgraphmagnitud.setText(value) | |
3499 | self.specGgraphmagnitud.setEnabled(True) |
|
3500 | self.specGgraphmagnitud.setEnabled(True) | |
3500 |
|
3501 | |||
3501 | parmObj = opObj.getParameterObj(parameterName='coh_min') |
|
3502 | parmObj = opObj.getParameterObj(parameterName='coh_min') | |
3502 | if parmObj == None: |
|
3503 | if parmObj == None: | |
3503 | self.specGgraphmagnitud.clear() |
|
3504 | self.specGgraphmagnitud.clear() | |
3504 | else: |
|
3505 | else: | |
3505 | value1 = opObj.getParameterValue(parameterName='coh_min') |
|
3506 | value1 = opObj.getParameterValue(parameterName='coh_min') | |
3506 | value1 = str(value1) |
|
3507 | value1 = str(value1) | |
3507 | value2 = opObj.getParameterValue(parameterName='coh_max') |
|
3508 | value2 = opObj.getParameterValue(parameterName='coh_max') | |
3508 | value2 = str(value2) |
|
3509 | value2 = str(value2) | |
3509 | value = value1 + "," + value2 |
|
3510 | value = value1 + "," + value2 | |
3510 | self.specGgraphmagnitud.setText(value) |
|
3511 | self.specGgraphmagnitud.setText(value) | |
3511 | self.specGgraphmagnitud.setEnabled(True) |
|
3512 | self.specGgraphmagnitud.setEnabled(True) | |
3512 |
|
3513 | |||
3513 | parmObj = opObj.getParameterObj(parameterName='phase_min') |
|
3514 | parmObj = opObj.getParameterObj(parameterName='phase_min') | |
3514 | if parmObj == None: |
|
3515 | if parmObj == None: | |
3515 | self.specGgraphPhase.clear() |
|
3516 | self.specGgraphPhase.clear() | |
3516 | else: |
|
3517 | else: | |
3517 | value1 = opObj.getParameterValue(parameterName='phase_min') |
|
3518 | value1 = opObj.getParameterValue(parameterName='phase_min') | |
3518 | value1 = str(value1) |
|
3519 | value1 = str(value1) | |
3519 | value2 = opObj.getParameterValue(parameterName='phase_max') |
|
3520 | value2 = opObj.getParameterValue(parameterName='phase_max') | |
3520 | value2 = str(value2) |
|
3521 | value2 = str(value2) | |
3521 | value = value1 + "," + value2 |
|
3522 | value = value1 + "," + value2 | |
3522 | self.specGgraphPhase.setText(value) |
|
3523 | self.specGgraphPhase.setText(value) | |
3523 | self.specGgraphPhase.setEnabled(True) |
|
3524 | self.specGgraphPhase.setEnabled(True) | |
3524 |
|
3525 | |||
3525 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3526 | parmObj = opObj.getParameterObj(parameterName="save") | |
3526 | if parmObj == None: |
|
3527 | if parmObj == None: | |
3527 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
3528 | self.specGraphSaveCoherencemap.setCheckState(0) | |
3528 | else: |
|
3529 | else: | |
3529 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3530 | self.specGraphSaveCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3530 |
|
3531 | |||
3531 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3532 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3532 | if parmObj == None: |
|
3533 | if parmObj == None: | |
3533 | self.specGraphftpCoherencemap.setCheckState(0) |
|
3534 | self.specGraphftpCoherencemap.setCheckState(0) | |
3534 | else: |
|
3535 | else: | |
3535 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) |
|
3536 | self.specGraphftpCoherencemap.setCheckState(QtCore.Qt.Checked) | |
3536 |
|
3537 | |||
3537 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3538 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3538 | if parmObj: |
|
3539 | if parmObj: | |
3539 | value = parmObj.getValue() |
|
3540 | value = parmObj.getValue() | |
3540 | self.specGraphPath.setText(value) |
|
3541 | self.specGraphPath.setText(value) | |
3541 |
|
3542 | |||
3542 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3543 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3543 | if parmObj: |
|
3544 | if parmObj: | |
3544 | value = parmObj.getValue() |
|
3545 | value = parmObj.getValue() | |
3545 | self.specGgraphftpratio.setText(str(value)) |
|
3546 | self.specGgraphftpratio.setText(str(value)) | |
3546 |
|
3547 | |||
3547 | opObj = puObj.getOperationObj(name='PowerProfilePlot') |
|
3548 | opObj = puObj.getOperationObj(name='PowerProfilePlot') | |
3548 |
|
3549 | |||
3549 | if opObj == None: |
|
3550 | if opObj == None: | |
3550 | self.specGraphPowerprofile.setCheckState(0) |
|
3551 | self.specGraphPowerprofile.setCheckState(0) | |
3551 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3552 | self.specGraphSavePowerprofile.setCheckState(0) | |
3552 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3553 | self.specGraphftpPowerprofile.setCheckState(0) | |
3553 | operationPowerProfilePlot = "Disabled" |
|
3554 | operationPowerProfilePlot = "Disabled" | |
3554 | channelList = None |
|
3555 | channelList = None | |
3555 | freq_vel = None |
|
3556 | freq_vel = None | |
3556 | heightsrange = None |
|
3557 | heightsrange = None | |
3557 | else: |
|
3558 | else: | |
3558 | operationPowerProfilePlot = "Enable" |
|
3559 | operationPowerProfilePlot = "Enable" | |
3559 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3560 | self.specGraphPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3560 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3561 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3561 | if parmObj == None: |
|
3562 | if parmObj == None: | |
3562 | self.specGgraphDbsrange.clear() |
|
3563 | self.specGgraphDbsrange.clear() | |
3563 | else: |
|
3564 | else: | |
3564 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3565 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3565 | value1 = str(value1) |
|
3566 | value1 = str(value1) | |
3566 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3567 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3567 | value2 = str(value2) |
|
3568 | value2 = str(value2) | |
3568 | value = value1 + "," + value2 |
|
3569 | value = value1 + "," + value2 | |
3569 | self.specGgraphDbsrange.setText(value) |
|
3570 | self.specGgraphDbsrange.setText(value) | |
3570 | self.specGgraphDbsrange.setEnabled(True) |
|
3571 | self.specGgraphDbsrange.setEnabled(True) | |
3571 |
|
3572 | |||
3572 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3573 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3573 | if parmObj == None: |
|
3574 | if parmObj == None: | |
3574 | self.specGgraphHeight.clear() |
|
3575 | self.specGgraphHeight.clear() | |
3575 | else: |
|
3576 | else: | |
3576 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3577 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3577 | value1 = str(value1) |
|
3578 | value1 = str(value1) | |
3578 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3579 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3579 | value2 = str(value2) |
|
3580 | value2 = str(value2) | |
3580 | value = value1 + "," + value2 |
|
3581 | value = value1 + "," + value2 | |
3581 | self.specGgraphHeight.setText(value) |
|
3582 | self.specGgraphHeight.setText(value) | |
3582 | self.specGgraphHeight.setEnabled(True) |
|
3583 | self.specGgraphHeight.setEnabled(True) | |
3583 |
|
3584 | |||
3584 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3585 | parmObj = opObj.getParameterObj(parameterName="save") | |
3585 | if parmObj == None: |
|
3586 | if parmObj == None: | |
3586 | self.specGraphSavePowerprofile.setCheckState(0) |
|
3587 | self.specGraphSavePowerprofile.setCheckState(0) | |
3587 | else: |
|
3588 | else: | |
3588 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3589 | self.specGraphSavePowerprofile.setCheckState(QtCore.Qt.Checked) | |
3589 |
|
3590 | |||
3590 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3591 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3591 | if parmObj == None: |
|
3592 | if parmObj == None: | |
3592 | self.specGraphftpPowerprofile.setCheckState(0) |
|
3593 | self.specGraphftpPowerprofile.setCheckState(0) | |
3593 | else: |
|
3594 | else: | |
3594 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) |
|
3595 | self.specGraphftpPowerprofile.setCheckState(QtCore.Qt.Checked) | |
3595 |
|
3596 | |||
3596 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3597 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3597 | if parmObj: |
|
3598 | if parmObj: | |
3598 | value = parmObj.getValue() |
|
3599 | value = parmObj.getValue() | |
3599 | self.specGraphPath.setText(value) |
|
3600 | self.specGraphPath.setText(value) | |
3600 |
|
3601 | |||
3601 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3602 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3602 | if parmObj: |
|
3603 | if parmObj: | |
3603 | value = parmObj.getValue() |
|
3604 | value = parmObj.getValue() | |
3604 | self.specGgraphftpratio.setText(str(value)) |
|
3605 | self.specGgraphftpratio.setText(str(value)) | |
3605 |
|
3606 | |||
3606 | opObj = puObj.getOperationObj(name='Noise') |
|
3607 | opObj = puObj.getOperationObj(name='Noise') | |
3607 |
|
3608 | |||
3608 | if opObj == None: |
|
3609 | if opObj == None: | |
3609 | self.specGraphCebRTInoise.setCheckState(0) |
|
3610 | self.specGraphCebRTInoise.setCheckState(0) | |
3610 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3611 | self.specGraphSaveRTInoise.setCheckState(0) | |
3611 | self.specGraphftpRTInoise.setCheckState(0) |
|
3612 | self.specGraphftpRTInoise.setCheckState(0) | |
3612 | else: |
|
3613 | else: | |
3613 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3614 | self.specGraphCebRTInoise.setCheckState(QtCore.Qt.Checked) | |
3614 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3615 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3615 | if parmObj == None: |
|
3616 | if parmObj == None: | |
3616 | self.specGgraphChannelList.clear() |
|
3617 | self.specGgraphChannelList.clear() | |
3617 | else: |
|
3618 | else: | |
3618 | value = opObj.getParameterValue(parameterName='channelList') |
|
3619 | value = opObj.getParameterValue(parameterName='channelList') | |
3619 | channelListRTINoise = str(value)[1:-1] |
|
3620 | channelListRTINoise = str(value)[1:-1] | |
3620 | self.specGgraphChannelList.setText(channelListRTINoise) |
|
3621 | self.specGgraphChannelList.setText(channelListRTINoise) | |
3621 | self.specGgraphChannelList.setEnabled(True) |
|
3622 | self.specGgraphChannelList.setEnabled(True) | |
3622 |
|
3623 | |||
3623 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3624 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3624 | if parmObj == None: |
|
3625 | if parmObj == None: | |
3625 | self.specGgraphTminTmax.clear() |
|
3626 | self.specGgraphTminTmax.clear() | |
3626 | else: |
|
3627 | else: | |
3627 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3628 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3628 | value1 = str(value1) |
|
3629 | value1 = str(value1) | |
3629 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3630 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3630 | value2 = str(value2) |
|
3631 | value2 = str(value2) | |
3631 | value = value1 + "," + value2 |
|
3632 | value = value1 + "," + value2 | |
3632 | self.specGgraphTminTmax.setText(value) |
|
3633 | self.specGgraphTminTmax.setText(value) | |
3633 | self.specGgraphTminTmax.setEnabled(True) |
|
3634 | self.specGgraphTminTmax.setEnabled(True) | |
3634 |
|
3635 | |||
3635 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3636 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3636 | if parmObj == None: |
|
3637 | if parmObj == None: | |
3637 | self.specGgraphTimeRange.clear() |
|
3638 | self.specGgraphTimeRange.clear() | |
3638 | else: |
|
3639 | else: | |
3639 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3640 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3640 | value1 = str(value1) |
|
3641 | value1 = str(value1) | |
3641 | self.specGgraphTimeRange.setText(value1) |
|
3642 | self.specGgraphTimeRange.setText(value1) | |
3642 | self.specGgraphTimeRange.setEnabled(True) |
|
3643 | self.specGgraphTimeRange.setEnabled(True) | |
3643 |
|
3644 | |||
3644 |
|
3645 | |||
3645 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3646 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3646 | if parmObj == None: |
|
3647 | if parmObj == None: | |
3647 | self.specGgraphDbsrange.clear() |
|
3648 | self.specGgraphDbsrange.clear() | |
3648 | else: |
|
3649 | else: | |
3649 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3650 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3650 | value1 = str(value1) |
|
3651 | value1 = str(value1) | |
3651 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3652 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3652 | value2 = str(value2) |
|
3653 | value2 = str(value2) | |
3653 | value = value1 + "," + value2 |
|
3654 | value = value1 + "," + value2 | |
3654 | self.specGgraphDbsrange.setText(value) |
|
3655 | self.specGgraphDbsrange.setText(value) | |
3655 | self.specGgraphDbsrange.setEnabled(True) |
|
3656 | self.specGgraphDbsrange.setEnabled(True) | |
3656 |
|
3657 | |||
3657 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3658 | parmObj = opObj.getParameterObj(parameterName="save") | |
3658 | if parmObj == None: |
|
3659 | if parmObj == None: | |
3659 | self.specGraphSaveRTInoise.setCheckState(0) |
|
3660 | self.specGraphSaveRTInoise.setCheckState(0) | |
3660 | else: |
|
3661 | else: | |
3661 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3662 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) | |
3662 |
|
3663 | |||
3663 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3664 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3664 | if parmObj == None: |
|
3665 | if parmObj == None: | |
3665 | self.specGraphftpRTInoise.setCheckState(0) |
|
3666 | self.specGraphftpRTInoise.setCheckState(0) | |
3666 | else: |
|
3667 | else: | |
3667 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3668 | self.specGraphftpRTInoise.setCheckState(QtCore.Qt.Checked) | |
3668 |
|
3669 | |||
3669 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3670 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3670 | if parmObj: |
|
3671 | if parmObj: | |
3671 | value = parmObj.getValue() |
|
3672 | value = parmObj.getValue() | |
3672 | self.specGraphPath.setText(value) |
|
3673 | self.specGraphPath.setText(value) | |
3673 |
|
3674 | |||
3674 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3675 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3675 | if parmObj: |
|
3676 | if parmObj: | |
3676 | value = parmObj.getValue() |
|
3677 | value = parmObj.getValue() | |
3677 | self.specGgraphftpratio.setText(str(value)) |
|
3678 | self.specGgraphftpratio.setText(str(value)) | |
3678 |
|
3679 | |||
3679 | opObj = puObj.getOperationObj(name='SpectraWriter') |
|
3680 | opObj = puObj.getOperationObj(name='SpectraWriter') | |
3680 | if opObj == None: |
|
3681 | if opObj == None: | |
3681 | self.specOutputPath.clear() |
|
3682 | self.specOutputPath.clear() | |
3682 | self.specOutputblocksperfile.clear() |
|
3683 | self.specOutputblocksperfile.clear() | |
3683 | else: |
|
3684 | else: | |
3684 | value = opObj.getParameterObj(parameterName='path') |
|
3685 | value = opObj.getParameterObj(parameterName='path') | |
3685 | if value == None: |
|
3686 | if value == None: | |
3686 | self.specOutputPath.clear() |
|
3687 | self.specOutputPath.clear() | |
3687 | else: |
|
3688 | else: | |
3688 | value = opObj.getParameterValue(parameterName='path') |
|
3689 | value = opObj.getParameterValue(parameterName='path') | |
3689 | path = str(value) |
|
3690 | path = str(value) | |
3690 | self.specOutputPath.setText(path) |
|
3691 | self.specOutputPath.setText(path) | |
3691 | value = opObj.getParameterObj(parameterName='blocksPerFile') |
|
3692 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
3692 | if value == None: |
|
3693 | if value == None: | |
3693 | self.specOutputblocksperfile.clear() |
|
3694 | self.specOutputblocksperfile.clear() | |
3694 | else: |
|
3695 | else: | |
3695 | value = opObj.getParameterValue(parameterName='blocksPerFile') |
|
3696 | value = opObj.getParameterValue(parameterName='blocksPerFile') | |
3696 | blocksperfile = str(value) |
|
3697 | blocksperfile = str(value) | |
3697 | self.specOutputblocksperfile.setText(blocksperfile) |
|
3698 | self.specOutputblocksperfile.setText(blocksperfile) | |
3698 |
|
3699 | |||
3699 | return |
|
3700 | return | |
3700 |
|
3701 | |||
3701 | def __refreshSpectraHeisWindow(self, puObj): |
|
3702 | def __refreshSpectraHeisWindow(self, puObj): | |
3702 |
|
3703 | |||
3703 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3704 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") | |
3704 | if opObj == None: |
|
3705 | if opObj == None: | |
3705 | self.specHeisOpIncoherent.clear() |
|
3706 | self.specHeisOpIncoherent.clear() | |
3706 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
3707 | self.specHeisOpCebIncoherent.setCheckState(0) | |
3707 | else: |
|
3708 | else: | |
3708 | for parmObj in opObj.getParameterObjList(): |
|
3709 | for parmObj in opObj.getParameterObjList(): | |
3709 | if parmObj.name == 'timeInterval': |
|
3710 | if parmObj.name == 'timeInterval': | |
3710 | value = opObj.getParameterValue(parameterName='timeInterval') |
|
3711 | value = opObj.getParameterValue(parameterName='timeInterval') | |
3711 | self.specHeisOpIncoherent.setText(str(value)) |
|
3712 | self.specHeisOpIncoherent.setText(str(value)) | |
3712 | self.specHeisOpIncoherent.setEnabled(True) |
|
3713 | self.specHeisOpIncoherent.setEnabled(True) | |
3713 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) |
|
3714 | self.specHeisOpCebIncoherent.setCheckState(QtCore.Qt.Checked) | |
3714 | self.specHeisOpCobIncInt.setCurrentIndex(0) |
|
3715 | self.specHeisOpCobIncInt.setCurrentIndex(0) | |
3715 |
|
3716 | |||
3716 | # SpectraHeis Graph |
|
3717 | # SpectraHeis Graph | |
3717 |
|
3718 | |||
3718 | self.specHeisGgraphXminXmax.clear() |
|
3719 | self.specHeisGgraphXminXmax.clear() | |
3719 | self.specHeisGgraphYminYmax.clear() |
|
3720 | self.specHeisGgraphYminYmax.clear() | |
3720 |
|
3721 | |||
3721 | self.specHeisGgraphChannelList.clear() |
|
3722 | self.specHeisGgraphChannelList.clear() | |
3722 | self.specHeisGgraphTminTmax.clear() |
|
3723 | self.specHeisGgraphTminTmax.clear() | |
3723 | self.specHeisGgraphTimeRange.clear() |
|
3724 | self.specHeisGgraphTimeRange.clear() | |
3724 | self.specHeisGgraphftpratio.clear() |
|
3725 | self.specHeisGgraphftpratio.clear() | |
3725 |
|
3726 | |||
3726 | opObj = puObj.getOperationObj(name='SpectraHeisScope') |
|
3727 | opObj = puObj.getOperationObj(name='SpectraHeisScope') | |
3727 | if opObj == None: |
|
3728 | if opObj == None: | |
3728 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
3729 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
3729 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3730 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3730 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3731 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3731 | else: |
|
3732 | else: | |
3732 | operationSpectraHeisScope = "Enable" |
|
3733 | operationSpectraHeisScope = "Enable" | |
3733 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) |
|
3734 | self.specHeisGraphCebSpectraplot.setCheckState(QtCore.Qt.Checked) | |
3734 |
|
3735 | |||
3735 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3736 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3736 | if parmObj == None: |
|
3737 | if parmObj == None: | |
3737 | self.specHeisGgraphChannelList.clear() |
|
3738 | self.specHeisGgraphChannelList.clear() | |
3738 | else: |
|
3739 | else: | |
3739 | value = opObj.getParameterValue(parameterName='channelList') |
|
3740 | value = opObj.getParameterValue(parameterName='channelList') | |
3740 | channelListSpectraHeisScope = str(value)[1:-1] |
|
3741 | channelListSpectraHeisScope = str(value)[1:-1] | |
3741 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) |
|
3742 | self.specHeisGgraphChannelList.setText(channelListSpectraHeisScope) | |
3742 | self.specHeisGgraphChannelList.setEnabled(True) |
|
3743 | self.specHeisGgraphChannelList.setEnabled(True) | |
3743 |
|
3744 | |||
3744 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3745 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3745 | if parmObj == None: |
|
3746 | if parmObj == None: | |
3746 | self.specHeisGgraphXminXmax.clear() |
|
3747 | self.specHeisGgraphXminXmax.clear() | |
3747 | else: |
|
3748 | else: | |
3748 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3749 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3749 | value1 = str(value1) |
|
3750 | value1 = str(value1) | |
3750 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3751 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3751 | value2 = str(value2) |
|
3752 | value2 = str(value2) | |
3752 | value = value1 + "," + value2 |
|
3753 | value = value1 + "," + value2 | |
3753 | self.specHeisGgraphXminXmax.setText(value) |
|
3754 | self.specHeisGgraphXminXmax.setText(value) | |
3754 | self.specHeisGgraphXminXmax.setEnabled(True) |
|
3755 | self.specHeisGgraphXminXmax.setEnabled(True) | |
3755 |
|
3756 | |||
3756 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3757 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3757 | if parmObj == None: |
|
3758 | if parmObj == None: | |
3758 | self.specHeisGgraphYminYmax.clear() |
|
3759 | self.specHeisGgraphYminYmax.clear() | |
3759 | else: |
|
3760 | else: | |
3760 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3761 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3761 | value1 = str(value1) |
|
3762 | value1 = str(value1) | |
3762 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3763 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3763 | value2 = str(value2) |
|
3764 | value2 = str(value2) | |
3764 | value = value1 + "," + value2 |
|
3765 | value = value1 + "," + value2 | |
3765 | self.specHeisGgraphYminYmax.setText(value) |
|
3766 | self.specHeisGgraphYminYmax.setText(value) | |
3766 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3767 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3767 |
|
3768 | |||
3768 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3769 | parmObj = opObj.getParameterObj(parameterName="save") | |
3769 | if parmObj == None: |
|
3770 | if parmObj == None: | |
3770 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
3771 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
3771 | else: |
|
3772 | else: | |
3772 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) |
|
3773 | self.specHeisGraphSaveSpectra.setCheckState(QtCore.Qt.Checked) | |
3773 |
|
3774 | |||
3774 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3775 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3775 | if parmObj == None: |
|
3776 | if parmObj == None: | |
3776 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
3777 | self.specHeisGraphftpSpectra.setCheckState(0) | |
3777 | else: |
|
3778 | else: | |
3778 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) |
|
3779 | self.specHeisGraphftpSpectra.setCheckState(QtCore.Qt.Checked) | |
3779 |
|
3780 | |||
3780 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3781 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3781 | if parmObj: |
|
3782 | if parmObj: | |
3782 | value = parmObj.getValue() |
|
3783 | value = parmObj.getValue() | |
3783 | self.specHeisGraphPath.setText(value) |
|
3784 | self.specHeisGraphPath.setText(value) | |
3784 |
|
3785 | |||
3785 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3786 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3786 | if parmObj: |
|
3787 | if parmObj: | |
3787 | value = parmObj.getValue() |
|
3788 | value = parmObj.getValue() | |
3788 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3789 | self.specHeisGgraphftpratio.setText(str(value)) | |
3789 |
|
3790 | |||
3790 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') |
|
3791 | opObj = puObj.getOperationObj(name='RTIfromSpectraHeis') | |
3791 |
|
3792 | |||
3792 | if opObj == None: |
|
3793 | if opObj == None: | |
3793 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
3794 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
3794 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3795 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3795 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3796 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3796 | else: |
|
3797 | else: | |
3797 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3798 | self.specHeisGraphCebRTIplot.setCheckState(QtCore.Qt.Checked) | |
3798 | parmObj = opObj.getParameterObj(parameterName='channelList') |
|
3799 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
3799 | if parmObj == None: |
|
3800 | if parmObj == None: | |
3800 | self.specHeisGgraphChannelList.clear() |
|
3801 | self.specHeisGgraphChannelList.clear() | |
3801 | else: |
|
3802 | else: | |
3802 | value = opObj.getParameterValue(parameterName='channelList') |
|
3803 | value = opObj.getParameterValue(parameterName='channelList') | |
3803 | channelListRTIPlot = str(value)[1:-1] |
|
3804 | channelListRTIPlot = str(value)[1:-1] | |
3804 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3805 | self.specGgraphChannelList.setText(channelListRTIPlot) | |
3805 | self.specGgraphChannelList.setEnabled(True) |
|
3806 | self.specGgraphChannelList.setEnabled(True) | |
3806 |
|
3807 | |||
3807 | parmObj = opObj.getParameterObj(parameterName='xmin') |
|
3808 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
3808 | if parmObj == None: |
|
3809 | if parmObj == None: | |
3809 | self.specHeisGgraphTminTmax.clear() |
|
3810 | self.specHeisGgraphTminTmax.clear() | |
3810 | else: |
|
3811 | else: | |
3811 | value1 = opObj.getParameterValue(parameterName='xmin') |
|
3812 | value1 = opObj.getParameterValue(parameterName='xmin') | |
3812 | value1 = str(value1) |
|
3813 | value1 = str(value1) | |
3813 | value2 = opObj.getParameterValue(parameterName='xmax') |
|
3814 | value2 = opObj.getParameterValue(parameterName='xmax') | |
3814 | value2 = str(value2) |
|
3815 | value2 = str(value2) | |
3815 | value = value1 + "," + value2 |
|
3816 | value = value1 + "," + value2 | |
3816 | self.specHeisGgraphTminTmax.setText(value) |
|
3817 | self.specHeisGgraphTminTmax.setText(value) | |
3817 | self.specHeisGgraphTminTmax.setEnabled(True) |
|
3818 | self.specHeisGgraphTminTmax.setEnabled(True) | |
3818 |
|
3819 | |||
3819 | parmObj = opObj.getParameterObj(parameterName='timerange') |
|
3820 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
3820 | if parmObj == None: |
|
3821 | if parmObj == None: | |
3821 | self.specGgraphTimeRange.clear() |
|
3822 | self.specGgraphTimeRange.clear() | |
3822 | else: |
|
3823 | else: | |
3823 | value1 = opObj.getParameterValue(parameterName='timerange') |
|
3824 | value1 = opObj.getParameterValue(parameterName='timerange') | |
3824 | value1 = str(value1) |
|
3825 | value1 = str(value1) | |
3825 | self.specHeisGgraphTimeRange.setText(value1) |
|
3826 | self.specHeisGgraphTimeRange.setText(value1) | |
3826 | self.specHeisGgraphTimeRange.setEnabled(True) |
|
3827 | self.specHeisGgraphTimeRange.setEnabled(True) | |
3827 |
|
3828 | |||
3828 | parmObj = opObj.getParameterObj(parameterName='ymin') |
|
3829 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
3829 | if parmObj == None: |
|
3830 | if parmObj == None: | |
3830 | self.specHeisGgraphYminYmax.clear() |
|
3831 | self.specHeisGgraphYminYmax.clear() | |
3831 | else: |
|
3832 | else: | |
3832 | value1 = opObj.getParameterValue(parameterName='ymin') |
|
3833 | value1 = opObj.getParameterValue(parameterName='ymin') | |
3833 | value1 = str(value1) |
|
3834 | value1 = str(value1) | |
3834 | value2 = opObj.getParameterValue(parameterName='ymax') |
|
3835 | value2 = opObj.getParameterValue(parameterName='ymax') | |
3835 | value2 = str(value2) |
|
3836 | value2 = str(value2) | |
3836 | value = value1 + "," + value2 |
|
3837 | value = value1 + "," + value2 | |
3837 | self.specHeisGgraphYminYmax.setText(value) |
|
3838 | self.specHeisGgraphYminYmax.setText(value) | |
3838 | self.specHeisGgraphYminYmax.setEnabled(True) |
|
3839 | self.specHeisGgraphYminYmax.setEnabled(True) | |
3839 |
|
3840 | |||
3840 | parmObj = opObj.getParameterObj(parameterName="save") |
|
3841 | parmObj = opObj.getParameterObj(parameterName="save") | |
3841 | if parmObj == None: |
|
3842 | if parmObj == None: | |
3842 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
3843 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
3843 | else: |
|
3844 | else: | |
3844 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3845 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
3845 |
|
3846 | |||
3846 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3847 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
3847 | if parmObj == None: |
|
3848 | if parmObj == None: | |
3848 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
3849 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
3849 | else: |
|
3850 | else: | |
3850 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3851 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
3851 |
|
3852 | |||
3852 | parmObj = opObj.getParameterObj(parameterName="figpath") |
|
3853 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
3853 | if parmObj: |
|
3854 | if parmObj: | |
3854 | value = parmObj.getValue() |
|
3855 | value = parmObj.getValue() | |
3855 | self.specHeisGraphPath.setText(value) |
|
3856 | self.specHeisGraphPath.setText(value) | |
3856 |
|
3857 | |||
3857 | parmObj = opObj.getParameterObj(parameterName="wr_period") |
|
3858 | parmObj = opObj.getParameterObj(parameterName="wr_period") | |
3858 | if parmObj: |
|
3859 | if parmObj: | |
3859 | value = parmObj.getValue() |
|
3860 | value = parmObj.getValue() | |
3860 | self.specHeisGgraphftpratio.setText(str(value)) |
|
3861 | self.specHeisGgraphftpratio.setText(str(value)) | |
3861 |
|
3862 | |||
3862 | # outputSpectraHeisWrite |
|
3863 | # outputSpectraHeisWrite | |
3863 | opObj = puObj.getOperationObj(name='FitsWriter') |
|
3864 | opObj = puObj.getOperationObj(name='FitsWriter') | |
3864 | if opObj == None: |
|
3865 | if opObj == None: | |
3865 | self.specHeisOutputPath.clear() |
|
3866 | self.specHeisOutputPath.clear() | |
3866 | self.specHeisOutputblocksperfile.clear() |
|
3867 | self.specHeisOutputblocksperfile.clear() | |
3867 | self.specHeisOutputMetada.clear() |
|
3868 | self.specHeisOutputMetada.clear() | |
3868 | else: |
|
3869 | else: | |
3869 | value = opObj.getParameterObj(parameterName='path') |
|
3870 | value = opObj.getParameterObj(parameterName='path') | |
3870 | if value == None: |
|
3871 | if value == None: | |
3871 | self.specHeisOutputPath.clear() |
|
3872 | self.specHeisOutputPath.clear() | |
3872 | else: |
|
3873 | else: | |
3873 | value = opObj.getParameterValue(parameterName='path') |
|
3874 | value = opObj.getParameterValue(parameterName='path') | |
3874 | path = str(value) |
|
3875 | path = str(value) | |
3875 | self.specHeisOutputPath.setText(path) |
|
3876 | self.specHeisOutputPath.setText(path) | |
3876 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') |
|
3877 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
3877 | if value == None: |
|
3878 | if value == None: | |
3878 | self.specHeisOutputblocksperfile.clear() |
|
3879 | self.specHeisOutputblocksperfile.clear() | |
3879 | else: |
|
3880 | else: | |
3880 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') |
|
3881 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
3881 | blocksperfile = str(value) |
|
3882 | blocksperfile = str(value) | |
3882 | self.specHeisOutputblocksperfile.setText(blocksperfile) |
|
3883 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
3883 | value = opObj.getParameterObj(parameterName='metadatafile') |
|
3884 | value = opObj.getParameterObj(parameterName='metadatafile') | |
3884 | if value == None: |
|
3885 | if value == None: | |
3885 | self.specHeisOutputMetada.clear() |
|
3886 | self.specHeisOutputMetada.clear() | |
3886 | else: |
|
3887 | else: | |
3887 | value = opObj.getParameterValue(parameterName='metadatafile') |
|
3888 | value = opObj.getParameterValue(parameterName='metadatafile') | |
3888 | metadata_file = str(value) |
|
3889 | metadata_file = str(value) | |
3889 | self.specHeisOutputMetada.setText(metadata_file) |
|
3890 | self.specHeisOutputMetada.setText(metadata_file) | |
3890 |
|
3891 | |||
3891 | return |
|
3892 | return | |
3892 |
|
3893 | |||
3893 | def __refreshCorrelationWindow(self, puObj): |
|
3894 | def __refreshCorrelationWindow(self, puObj): | |
3894 | pass |
|
3895 | pass | |
3895 |
|
3896 | |||
3896 | def refreshPUWindow(self, puObj): |
|
3897 | def refreshPUWindow(self, puObj): | |
3897 |
|
3898 | |||
3898 | if puObj.datatype == 'Voltage': |
|
3899 | if puObj.datatype == 'Voltage': | |
3899 | self.__refreshVoltageWindow(puObj) |
|
3900 | self.__refreshVoltageWindow(puObj) | |
3900 |
|
3901 | |||
3901 | if puObj.datatype == 'Spectra': |
|
3902 | if puObj.datatype == 'Spectra': | |
3902 | self.__refreshSpectraWindow(puObj) |
|
3903 | self.__refreshSpectraWindow(puObj) | |
3903 |
|
3904 | |||
3904 | if puObj.datatype == 'SpectraHeis': |
|
3905 | if puObj.datatype == 'SpectraHeis': | |
3905 | self.__refreshSpectraHeisWindow(puObj) |
|
3906 | self.__refreshSpectraHeisWindow(puObj) | |
3906 |
|
3907 | |||
3907 | def refreshProjectProperties(self, projectObjView): |
|
3908 | def refreshProjectProperties(self, projectObjView): | |
3908 |
|
3909 | |||
3909 | propertyBuffObj = PropertyBuffer() |
|
3910 | propertyBuffObj = PropertyBuffer() | |
3910 | name = projectObjView.name |
|
3911 | name = projectObjView.name | |
3911 |
|
3912 | |||
3912 | propertyBuffObj.append("Properties", "Name", projectObjView.name), |
|
3913 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
3913 | propertyBuffObj.append("Properties", "Description", projectObjView.description) |
|
3914 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
3914 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) |
|
3915 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
3915 |
|
3916 | |||
3916 | readUnitObj = projectObjView.getReadUnitObj() |
|
3917 | readUnitObj = projectObjView.getReadUnitObj() | |
3917 | runOperationObj = readUnitObj.getOperationObj(name='run') |
|
3918 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
3918 |
|
3919 | |||
3919 | for thisParmObj in runOperationObj.getParameterObjList(): |
|
3920 | for thisParmObj in runOperationObj.getParameterObjList(): | |
3920 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) |
|
3921 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
3921 |
|
3922 | |||
3922 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3923 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3923 |
|
3924 | |||
3924 | self.treeProjectProperties.setModel(propertiesModel) |
|
3925 | self.treeProjectProperties.setModel(propertiesModel) | |
3925 | self.treeProjectProperties.expandAll() |
|
3926 | self.treeProjectProperties.expandAll() | |
3926 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3927 | self.treeProjectProperties.resizeColumnToContents(0) | |
3927 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3928 | self.treeProjectProperties.resizeColumnToContents(1) | |
3928 |
|
3929 | |||
3929 | def refreshPUProperties(self, puObjView): |
|
3930 | def refreshPUProperties(self, puObjView): | |
3930 |
|
3931 | |||
3931 | ############ FTP CONFIG ################################ |
|
3932 | ############ FTP CONFIG ################################ | |
3932 | #Deleting FTP Conf. This processing unit have not got any |
|
3933 | #Deleting FTP Conf. This processing unit have not got any | |
3933 | #FTP configuration by default |
|
3934 | #FTP configuration by default | |
3934 | if puObjView.id in self.__puLocalFolder2FTP.keys(): |
|
3935 | if puObjView.id in self.__puLocalFolder2FTP.keys(): | |
3935 | self.__puLocalFolder2FTP.pop(puObjView.id) |
|
3936 | self.__puLocalFolder2FTP.pop(puObjView.id) | |
3936 | ######################################################## |
|
3937 | ######################################################## | |
3937 |
|
3938 | |||
3938 | propertyBuffObj = PropertyBuffer() |
|
3939 | propertyBuffObj = PropertyBuffer() | |
3939 |
|
3940 | |||
3940 | for thisOp in puObjView.getOperationObjList(): |
|
3941 | for thisOp in puObjView.getOperationObjList(): | |
3941 |
|
3942 | |||
3942 | operationName = thisOp.name |
|
3943 | operationName = thisOp.name | |
3943 |
|
3944 | |||
3944 | if operationName == 'run': |
|
3945 | if operationName == 'run': | |
3945 | operationName = 'Properties' |
|
3946 | operationName = 'Properties' | |
3946 |
|
3947 | |||
3947 | else: |
|
3948 | else: | |
3948 | if not thisOp.getParameterObjList(): |
|
3949 | if not thisOp.getParameterObjList(): | |
3949 | propertyBuffObj.append(operationName, '--', '--') |
|
3950 | propertyBuffObj.append(operationName, '--', '--') | |
3950 | continue |
|
3951 | continue | |
3951 |
|
3952 | |||
3952 | for thisParmObj in thisOp.getParameterObjList(): |
|
3953 | for thisParmObj in thisOp.getParameterObjList(): | |
3953 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) |
|
3954 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
3954 |
|
3955 | |||
3955 | ############ FTP CONFIG ################################ |
|
3956 | ############ FTP CONFIG ################################ | |
3956 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): |
|
3957 | if thisParmObj.name == "ftp_wei" and thisParmObj.getValue(): | |
3957 | value = thisParmObj.getValue() |
|
3958 | value = thisParmObj.getValue() | |
3958 | self.temporalFTP.ftp_wei = value |
|
3959 | self.temporalFTP.ftp_wei = value | |
3959 |
|
3960 | |||
3960 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): |
|
3961 | if thisParmObj.name == "exp_code" and thisParmObj.getValue(): | |
3961 | value = thisParmObj.getValue() |
|
3962 | value = thisParmObj.getValue() | |
3962 | self.temporalFTP.exp_code = value |
|
3963 | self.temporalFTP.exp_code = value | |
3963 |
|
3964 | |||
3964 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): |
|
3965 | if thisParmObj.name == "sub_exp_code" and thisParmObj.getValue(): | |
3965 | value = thisParmObj.getValue() |
|
3966 | value = thisParmObj.getValue() | |
3966 | self.temporalFTP.sub_exp_code = value |
|
3967 | self.temporalFTP.sub_exp_code = value | |
3967 |
|
3968 | |||
3968 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): |
|
3969 | if thisParmObj.name == "plot_pos" and thisParmObj.getValue(): | |
3969 | value = thisParmObj.getValue() |
|
3970 | value = thisParmObj.getValue() | |
3970 | self.temporalFTP.plot_pos = value |
|
3971 | self.temporalFTP.plot_pos = value | |
3971 |
|
3972 | |||
3972 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): |
|
3973 | if thisParmObj.name == 'ftp' and thisParmObj.getValue(): | |
3973 | figpathObj = thisOp.getParameterObj('figpath') |
|
3974 | figpathObj = thisOp.getParameterObj('figpath') | |
3974 | if figpathObj: |
|
3975 | if figpathObj: | |
3975 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() |
|
3976 | self.__puLocalFolder2FTP[puObjView.id] = figpathObj.getValue() | |
3976 |
|
3977 | |||
3977 | ######################################################## |
|
3978 | ######################################################## | |
3978 |
|
3979 | |||
3979 | propertiesModel = propertyBuffObj.getPropertyModel() |
|
3980 | propertiesModel = propertyBuffObj.getPropertyModel() | |
3980 |
|
3981 | |||
3981 | self.treeProjectProperties.setModel(propertiesModel) |
|
3982 | self.treeProjectProperties.setModel(propertiesModel) | |
3982 | self.treeProjectProperties.expandAll() |
|
3983 | self.treeProjectProperties.expandAll() | |
3983 | self.treeProjectProperties.resizeColumnToContents(0) |
|
3984 | self.treeProjectProperties.resizeColumnToContents(0) | |
3984 | self.treeProjectProperties.resizeColumnToContents(1) |
|
3985 | self.treeProjectProperties.resizeColumnToContents(1) | |
3985 |
|
3986 | |||
3986 | def refreshGraphicsId(self): |
|
3987 | def refreshGraphicsId(self): | |
3987 |
|
3988 | |||
3988 | projectObj = self.getSelectedProjectObj() |
|
3989 | projectObj = self.getSelectedProjectObj() | |
3989 |
|
3990 | |||
3990 | if not projectObj: |
|
3991 | if not projectObj: | |
3991 | return |
|
3992 | return | |
3992 |
|
3993 | |||
3993 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): |
|
3994 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
3994 |
|
3995 | |||
3995 | for opObj in puObj.getOperationObjList(): |
|
3996 | for opObj in puObj.getOperationObjList(): | |
3996 |
|
3997 | |||
3997 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): |
|
3998 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
3998 | continue |
|
3999 | continue | |
3999 |
|
4000 | |||
4000 | opObj.changeParameter(name='id', value=opObj.id, format='int') |
|
4001 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
4001 |
|
4002 | |||
4002 | def on_click(self, index): |
|
4003 | def on_click(self, index): | |
4003 |
|
4004 | |||
4004 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) |
|
4005 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
4005 |
|
4006 | |||
4006 | projectObjView = self.getSelectedProjectObj() |
|
4007 | projectObjView = self.getSelectedProjectObj() | |
4007 |
|
4008 | |||
4008 | if not projectObjView: |
|
4009 | if not projectObjView: | |
4009 | return |
|
4010 | return | |
4010 |
|
4011 | |||
4011 | self.create = False |
|
4012 | self.create = False | |
4012 | selectedObjView = self.getSelectedItemObj() |
|
4013 | selectedObjView = self.getSelectedItemObj() | |
4013 |
|
4014 | |||
4014 | #A project has been selected |
|
4015 | #A project has been selected | |
4015 | if projectObjView == selectedObjView: |
|
4016 | if projectObjView == selectedObjView: | |
4016 |
|
4017 | |||
4017 | self.refreshProjectWindow(projectObjView) |
|
4018 | self.refreshProjectWindow(projectObjView) | |
4018 | self.refreshProjectProperties(projectObjView) |
|
4019 | self.refreshProjectProperties(projectObjView) | |
4019 |
|
4020 | |||
4020 | self.tabProject.setEnabled(True) |
|
4021 | self.tabProject.setEnabled(True) | |
4021 | self.tabVoltage.setEnabled(False) |
|
4022 | self.tabVoltage.setEnabled(False) | |
4022 | self.tabSpectra.setEnabled(False) |
|
4023 | self.tabSpectra.setEnabled(False) | |
4023 | self.tabCorrelation.setEnabled(False) |
|
4024 | self.tabCorrelation.setEnabled(False) | |
4024 | self.tabSpectraHeis.setEnabled(False) |
|
4025 | self.tabSpectraHeis.setEnabled(False) | |
4025 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4026 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4026 |
|
4027 | |||
4027 | return |
|
4028 | return | |
4028 |
|
4029 | |||
4029 | #A processing unit has been selected |
|
4030 | #A processing unit has been selected | |
4030 | voltEnable = False |
|
4031 | voltEnable = False | |
4031 | specEnable = False |
|
4032 | specEnable = False | |
4032 | corrEnable = False |
|
4033 | corrEnable = False | |
4033 | specHeisEnable = False |
|
4034 | specHeisEnable = False | |
4034 | tabSelected = self.tabProject |
|
4035 | tabSelected = self.tabProject | |
4035 |
|
4036 | |||
4036 | puObj = selectedObjView |
|
4037 | puObj = selectedObjView | |
4037 |
|
4038 | |||
4038 | self.refreshPUWindow(puObj) |
|
4039 | self.refreshPUWindow(puObj) | |
4039 | self.refreshPUProperties(puObj) |
|
4040 | self.refreshPUProperties(puObj) | |
4040 | self.showtabPUCreated(puObj.datatype) |
|
4041 | self.showtabPUCreated(puObj.datatype) | |
4041 |
|
4042 | |||
4042 | def on_right_click(self, pos): |
|
4043 | def on_right_click(self, pos): | |
4043 |
|
4044 | |||
4044 | self.menu = QtGui.QMenu() |
|
4045 | self.menu = QtGui.QMenu() | |
4045 | quitAction0 = self.menu.addAction("Create a New Project") |
|
4046 | quitAction0 = self.menu.addAction("Create a New Project") | |
4046 | quitAction1 = self.menu.addAction("Create a New Processing Unit") |
|
4047 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
4047 | quitAction2 = self.menu.addAction("Delete Item") |
|
4048 | quitAction2 = self.menu.addAction("Delete Item") | |
4048 | quitAction3 = self.menu.addAction("Quit") |
|
4049 | quitAction3 = self.menu.addAction("Quit") | |
4049 |
|
4050 | |||
4050 | if len(self.__itemTreeDict) == 0: |
|
4051 | if len(self.__itemTreeDict) == 0: | |
4051 | quitAction2.setEnabled(False) |
|
4052 | quitAction2.setEnabled(False) | |
4052 | else: |
|
4053 | else: | |
4053 | quitAction2.setEnabled(True) |
|
4054 | quitAction2.setEnabled(True) | |
4054 |
|
4055 | |||
4055 | action = self.menu.exec_(self.mapToGlobal(pos)) |
|
4056 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
4056 |
|
4057 | |||
4057 | if action == quitAction0: |
|
4058 | if action == quitAction0: | |
4058 | self. setInputsProject_View() |
|
4059 | self. setInputsProject_View() | |
4059 | self.create = True |
|
4060 | self.create = True | |
4060 |
|
4061 | |||
4061 | if action == quitAction1: |
|
4062 | if action == quitAction1: | |
4062 | if len(self.__projectObjDict) == 0: |
|
4063 | if len(self.__projectObjDict) == 0: | |
4063 | outputstr = "You need to create a Project before adding a Processing Unit" |
|
4064 | outputstr = "You need to create a Project before adding a Processing Unit" | |
4064 | self.console.clear() |
|
4065 | self.console.clear() | |
4065 | self.console.append(outputstr) |
|
4066 | self.console.append(outputstr) | |
4066 | return 0 |
|
4067 | return 0 | |
4067 | else: |
|
4068 | else: | |
4068 | self.addPUWindow() |
|
4069 | self.addPUWindow() | |
4069 | self.console.clear() |
|
4070 | self.console.clear() | |
4070 | self.console.append("Please, Choose the type of Processing Unit") |
|
4071 | self.console.append("Please, Choose the type of Processing Unit") | |
4071 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") |
|
4072 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
4072 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") |
|
4073 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
4073 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") |
|
4074 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
4074 |
|
4075 | |||
4075 | if action == quitAction2: |
|
4076 | if action == quitAction2: | |
4076 | index = self.selectedItemTree |
|
4077 | index = self.selectedItemTree | |
4077 | try: |
|
4078 | try: | |
4078 | index.parent() |
|
4079 | index.parent() | |
4079 | except: |
|
4080 | except: | |
4080 | self.console.append('Please first select a Project or Processing Unit') |
|
4081 | self.console.append('Please, first at all select a Project or Processing Unit') | |
4081 | return 0 |
|
4082 | return 0 | |
4082 | # print index.parent(),index |
|
4083 | # print index.parent(),index | |
4083 | if index.parent() == None: |
|
4084 | if index.parent() == None: | |
4084 | self.projectExplorerModel.removeRow(index.row()) |
|
4085 | self.projectExplorerModel.removeRow(index.row()) | |
4085 | else: |
|
4086 | else: | |
4086 | index.parent().removeRow(index.row()) |
|
4087 | index.parent().removeRow(index.row()) | |
4087 | self.removeItemTreeFromProject() |
|
4088 | self.removeItemTreeFromProject() | |
4088 | self.console.clear() |
|
4089 | self.console.clear() | |
4089 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): |
|
4090 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
4090 | # print i.row() |
|
4091 | # print i.row() | |
4091 |
|
4092 | |||
4092 | if action == quitAction3: |
|
4093 | if action == quitAction3: | |
4093 | self.close() |
|
4094 | self.close() | |
4094 | return 0 |
|
4095 | return 0 | |
4095 |
|
4096 | |||
4096 | def createProjectView(self, id): |
|
4097 | def createProjectView(self, id): | |
4097 |
|
4098 | |||
4098 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4099 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4099 | id = str(id) |
|
4100 | id = str(id) | |
4100 | projectParms = self.__getParmsFromProjectWindow() |
|
4101 | projectParms = self.__getParmsFromProjectWindow() | |
4101 |
|
4102 | |||
4102 | if not projectParms.isValid(): |
|
4103 | if not projectParms.isValid(): | |
4103 | return None |
|
4104 | return None | |
4104 |
|
4105 | |||
4105 | projectObjView = Project() |
|
4106 | projectObjView = Project() | |
4106 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) |
|
4107 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
4107 |
|
4108 | |||
4108 | self.__projectObjDict[id] = projectObjView |
|
4109 | self.__projectObjDict[id] = projectObjView | |
4109 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) |
|
4110 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
4110 |
|
4111 | |||
4111 | return projectObjView |
|
4112 | return projectObjView | |
4112 |
|
4113 | |||
4113 | def updateProjectView(self): |
|
4114 | def updateProjectView(self): | |
4114 |
|
4115 | |||
4115 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4116 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4116 |
|
4117 | |||
4117 | projectParms = self.__getParmsFromProjectWindow() |
|
4118 | projectParms = self.__getParmsFromProjectWindow() | |
4118 |
|
4119 | |||
4119 | if not projectParms.isValid(): |
|
4120 | if not projectParms.isValid(): | |
4120 | return None |
|
4121 | return None | |
4121 |
|
4122 | |||
4122 | projectObjView = self.getSelectedProjectObj() |
|
4123 | projectObjView = self.getSelectedProjectObj() | |
4123 |
|
4124 | |||
4124 | if not projectObjView: |
|
4125 | if not projectObjView: | |
4125 | self.console.append("Please select a project before update it") |
|
4126 | self.console.append("Please select a project before update it") | |
4126 | return None |
|
4127 | return None | |
4127 |
|
4128 | |||
4128 | projectObjView.update(name=projectParms.name, description=projectParms.description) |
|
4129 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
4129 |
|
4130 | |||
4130 | return projectObjView |
|
4131 | return projectObjView | |
4131 |
|
4132 | |||
4132 | def createReadUnitView(self, projectObjView): |
|
4133 | def createReadUnitView(self, projectObjView): | |
4133 |
|
4134 | |||
4134 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() |
|
4135 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
4135 |
|
4136 | |||
4136 | projectParms = self.__getParmsFromProjectWindow() |
|
4137 | projectParms = self.__getParmsFromProjectWindow() | |
4137 |
|
4138 | |||
4138 | if not projectParms.isValid(): |
|
4139 | if not projectParms.isValid(): | |
4139 | return None |
|
4140 | return None | |
4140 |
|
4141 | |||
4141 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): |
|
4142 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
4142 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4143 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
4143 | path=projectParms.dpath, |
|
4144 | path=projectParms.dpath, | |
4144 | startDate=projectParms.startDate, |
|
4145 | startDate=projectParms.startDate, | |
4145 | endDate=projectParms.endDate, |
|
4146 | endDate=projectParms.endDate, | |
4146 | startTime=projectParms.startTime, |
|
4147 | startTime=projectParms.startTime, | |
4147 | endTime=projectParms.endTime, |
|
4148 | endTime=projectParms.endTime, | |
4148 | online=projectParms.online, |
|
4149 | online=projectParms.online, | |
4149 | walk=projectParms.walk |
|
4150 | walk=projectParms.walk | |
4150 | ) |
|
4151 | ) | |
4151 |
|
4152 | |||
4152 | if projectParms.set: |
|
4153 | if projectParms.set: | |
4153 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4154 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4154 |
|
4155 | |||
4155 | if projectParms.delay: |
|
4156 | if projectParms.delay: | |
4156 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4157 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4157 |
|
4158 | |||
4158 | if projectParms.expLabel: |
|
4159 | if projectParms.expLabel: | |
4159 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4160 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4160 |
|
4161 | |||
4161 | readUnitConfObj.addOperation(name="printInfo") |
|
4162 | readUnitConfObj.addOperation(name="printInfo") | |
4162 |
|
4163 | |||
4163 | if projectParms.datatype == "USRP": |
|
4164 | if projectParms.datatype == "USRP": | |
4164 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, |
|
4165 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
4165 | path=projectParms.dpath, |
|
4166 | path=projectParms.dpath, | |
4166 | startDate=projectParms.startDate, |
|
4167 | startDate=projectParms.startDate, | |
4167 | endDate=projectParms.endDate, |
|
4168 | endDate=projectParms.endDate, | |
4168 | startTime=projectParms.startTime, |
|
4169 | startTime=projectParms.startTime, | |
4169 | endTime=projectParms.endTime, |
|
4170 | endTime=projectParms.endTime, | |
4170 | online=projectParms.online, |
|
4171 | online=projectParms.online, | |
4171 | ippKm=projectParms.ippKm |
|
4172 | ippKm=projectParms.ippKm | |
4172 | ) |
|
4173 | ) | |
4173 |
|
4174 | |||
4174 | if projectParms.delay: |
|
4175 | if projectParms.delay: | |
4175 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4176 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4176 |
|
4177 | |||
4177 | return readUnitConfObj |
|
4178 | return readUnitConfObj | |
4178 |
|
4179 | |||
4179 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4180 | def updateReadUnitView(self, projectObjView, idReadUnit): | |
4180 |
|
4181 | |||
4181 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() |
|
4182 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() | |
4182 |
|
4183 | |||
4183 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
4184 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) | |
4184 |
|
4185 | |||
4185 | projectParms = self.__getParmsFromProjectWindow() |
|
4186 | projectParms = self.__getParmsFromProjectWindow() | |
4186 |
|
4187 | |||
4187 | if not projectParms.isValid(): |
|
4188 | if not projectParms.isValid(): | |
4188 | return None |
|
4189 | return None | |
4189 |
|
4190 | |||
4190 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: |
|
4191 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: | |
4191 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4192 | readUnitConfObj.update(datatype=projectParms.datatype, | |
4192 | path=projectParms.dpath, |
|
4193 | path=projectParms.dpath, | |
4193 | startDate=projectParms.startDate, |
|
4194 | startDate=projectParms.startDate, | |
4194 | endDate=projectParms.endDate, |
|
4195 | endDate=projectParms.endDate, | |
4195 | startTime=projectParms.startTime, |
|
4196 | startTime=projectParms.startTime, | |
4196 | endTime=projectParms.endTime, |
|
4197 | endTime=projectParms.endTime, | |
4197 | online=projectParms.online, |
|
4198 | online=projectParms.online, | |
4198 | walk=projectParms.walk |
|
4199 | walk=projectParms.walk | |
4199 | ) |
|
4200 | ) | |
4200 | if projectParms.set: |
|
4201 | if projectParms.set: | |
4201 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") |
|
4202 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
4202 |
|
4203 | |||
4203 | if projectParms.delay: |
|
4204 | if projectParms.delay: | |
4204 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4205 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4205 |
|
4206 | |||
4206 | if projectParms.expLabel: |
|
4207 | if projectParms.expLabel: | |
4207 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) |
|
4208 | readUnitConfObj.addParameter(name="expLabel", value=projectParms.expLabel) | |
4208 |
|
4209 | |||
4209 | readUnitConfObj.addOperation(name="printInfo") |
|
4210 | readUnitConfObj.addOperation(name="printInfo") | |
4210 |
|
4211 | |||
4211 | if projectParms.datatype == "USRP": |
|
4212 | if projectParms.datatype == "USRP": | |
4212 | readUnitConfObj.update(datatype=projectParms.datatype, |
|
4213 | readUnitConfObj.update(datatype=projectParms.datatype, | |
4213 | path=projectParms.dpath, |
|
4214 | path=projectParms.dpath, | |
4214 | startDate=projectParms.startDate, |
|
4215 | startDate=projectParms.startDate, | |
4215 | endDate=projectParms.endDate, |
|
4216 | endDate=projectParms.endDate, | |
4216 | startTime=projectParms.startTime, |
|
4217 | startTime=projectParms.startTime, | |
4217 | endTime=projectParms.endTime, |
|
4218 | endTime=projectParms.endTime, | |
4218 | online=projectParms.online, |
|
4219 | online=projectParms.online, | |
4219 | ippKm=projectParms.ippKm |
|
4220 | ippKm=projectParms.ippKm | |
4220 | ) |
|
4221 | ) | |
4221 |
|
4222 | |||
4222 | if projectParms.delay: |
|
4223 | if projectParms.delay: | |
4223 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") |
|
4224 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
4224 |
|
4225 | |||
4225 | return readUnitConfObj |
|
4226 | return readUnitConfObj | |
4226 |
|
4227 | |||
4227 | def createProcUnitView(self, projectObjView, datatype, inputId): |
|
4228 | def createProcUnitView(self, projectObjView, datatype, inputId): | |
4228 |
|
4229 | |||
4229 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) |
|
4230 | procUnitConfObj = projectObjView.addProcUnit(datatype=datatype, inputId=inputId) | |
4230 |
|
4231 | |||
4231 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4232 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4232 |
|
4233 | |||
4233 | return procUnitConfObj |
|
4234 | return procUnitConfObj | |
4234 |
|
4235 | |||
4235 | def updateProcUnitView(self, id): |
|
4236 | def updateProcUnitView(self, id): | |
4236 |
|
4237 | |||
4237 | pass |
|
4238 | pass | |
4238 |
|
4239 | |||
4239 | def addPUWindow(self): |
|
4240 | def addPUWindow(self): | |
4240 |
|
4241 | |||
4241 | self.configUPWindowObj = UnitProcessWindow(self) |
|
4242 | self.configUPWindowObj = UnitProcessWindow(self) | |
4242 | fatherObj = self.getSelectedItemObj() |
|
4243 | fatherObj = self.getSelectedItemObj() | |
4243 | try: |
|
4244 | try: | |
4244 | fatherObj.getElementName() |
|
4245 | fatherObj.getElementName() | |
4245 | except: |
|
4246 | except: | |
4246 | self.console.append("First left click on Project or Processing Unit") |
|
4247 | self.console.append("First left click on Project or Processing Unit") | |
4247 | return 0 |
|
4248 | return 0 | |
4248 |
|
4249 | |||
4249 | if fatherObj.getElementName() == 'Project': |
|
4250 | if fatherObj.getElementName() == 'Project': | |
4250 | readUnitConfObj = fatherObj.getReadUnitObj() |
|
4251 | readUnitConfObj = fatherObj.getReadUnitObj() | |
4251 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) |
|
4252 | self.configUPWindowObj.dataTypeProject = str(readUnitConfObj.datatype) | |
4252 |
|
4253 | |||
4253 | self.configUPWindowObj.getfromWindowList.append(fatherObj) |
|
4254 | self.configUPWindowObj.getfromWindowList.append(fatherObj) | |
4254 | self.configUPWindowObj.loadTotalList() |
|
4255 | self.configUPWindowObj.loadTotalList() | |
4255 | self.configUPWindowObj.show() |
|
4256 | self.configUPWindowObj.show() | |
4256 | self.configUPWindowObj.closed.connect(self.createPUWindow) |
|
4257 | self.configUPWindowObj.closed.connect(self.createPUWindow) | |
4257 |
|
4258 | |||
4258 | def createPUWindow(self): |
|
4259 | def createPUWindow(self): | |
4259 |
|
4260 | |||
4260 | if not self.configUPWindowObj.create: |
|
4261 | if not self.configUPWindowObj.create: | |
4261 | return |
|
4262 | return | |
4262 |
|
4263 | |||
4263 | fatherObj = self.configUPWindowObj.getFromWindow |
|
4264 | fatherObj = self.configUPWindowObj.getFromWindow | |
4264 | datatype = self.configUPWindowObj.typeofUP |
|
4265 | datatype = self.configUPWindowObj.typeofUP | |
4265 |
|
4266 | |||
4266 | if fatherObj.getElementName() == 'Project': |
|
4267 | if fatherObj.getElementName() == 'Project': | |
4267 | inputId = fatherObj.getReadUnitId() |
|
4268 | inputId = fatherObj.getReadUnitId() | |
4268 | projectObjView = fatherObj |
|
4269 | projectObjView = fatherObj | |
4269 | else: |
|
4270 | else: | |
4270 | inputId = fatherObj.getId() |
|
4271 | inputId = fatherObj.getId() | |
4271 | projectObjView = self.getSelectedProjectObj() |
|
4272 | projectObjView = self.getSelectedProjectObj() | |
4272 |
|
4273 | |||
4273 | if not projectObjView: |
|
4274 | if not projectObjView: | |
4274 | return |
|
4275 | return | |
4275 |
|
4276 | |||
4276 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) |
|
4277 | puObj = self.createProcUnitView(projectObjView, datatype, inputId) | |
4277 |
|
4278 | |||
4278 | self.addPU2ProjectExplorer(puObj) |
|
4279 | self.addPU2ProjectExplorer(puObj) | |
4279 |
|
4280 | |||
4280 | self.showtabPUCreated(datatype) |
|
4281 | self.showtabPUCreated(datatype) | |
4281 |
|
4282 | |||
4282 | self.clearPUWindow(datatype) |
|
4283 | self.clearPUWindow(datatype) | |
4283 |
|
4284 | |||
4284 | self.showPUinitView() |
|
4285 | self.showPUinitView() | |
4285 |
|
4286 | |||
4286 | def addFTPConf2Operation(self, puObj, opObj): |
|
4287 | def addFTPConf2Operation(self, puObj, opObj): | |
4287 |
|
4288 | |||
4288 | if not self.temporalFTP.create: |
|
4289 | if not self.temporalFTP.create: | |
4289 | self.temporalFTP.setwithoutconfiguration() |
|
4290 | self.temporalFTP.setwithoutconfiguration() | |
4290 |
|
4291 | |||
4291 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4292 | # opObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4292 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4293 | # opObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4293 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4294 | # opObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4294 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4295 | # opObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4295 |
|
4296 | |||
4296 | if self.temporalFTP.ftp_wei: |
|
4297 | if self.temporalFTP.ftp_wei: | |
4297 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') |
|
4298 | opObj.addParameter(name='ftp_wei', value=int(self.temporalFTP.ftp_wei), format='int') | |
4298 | if self.temporalFTP.exp_code: |
|
4299 | if self.temporalFTP.exp_code: | |
4299 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') |
|
4300 | opObj.addParameter(name='exp_code', value=int(self.temporalFTP.exp_code), format='int') | |
4300 | if self.temporalFTP.sub_exp_code: |
|
4301 | if self.temporalFTP.sub_exp_code: | |
4301 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') |
|
4302 | opObj.addParameter(name='sub_exp_code', value=int(self.temporalFTP.sub_exp_code), format='int') | |
4302 | if self.temporalFTP.plot_pos: |
|
4303 | if self.temporalFTP.plot_pos: | |
4303 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') |
|
4304 | opObj.addParameter(name='plot_pos', value=int(self.temporalFTP.plot_pos), format='int') | |
4304 |
|
4305 | |||
4305 | # def __checkFTPProcUnit(self, projectObj, localfolder): |
|
4306 | # def __checkFTPProcUnit(self, projectObj, localfolder): | |
4306 | # |
|
4307 | # | |
4307 | # puId = None |
|
4308 | # puId = None | |
4308 | # puObj = None |
|
4309 | # puObj = None | |
4309 | # |
|
4310 | # | |
4310 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4311 | # for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4311 | # |
|
4312 | # | |
4312 | # if not thisPuObj.name == "SendToServer": |
|
4313 | # if not thisPuObj.name == "SendToServer": | |
4313 | # continue |
|
4314 | # continue | |
4314 | # |
|
4315 | # | |
4315 | # opObj = thisPuObj.getOperationObj(name='run') |
|
4316 | # opObj = thisPuObj.getOperationObj(name='run') | |
4316 | # |
|
4317 | # | |
4317 | # parmObj = opObj.getParameterObj('localfolder') |
|
4318 | # parmObj = opObj.getParameterObj('localfolder') | |
4318 | # |
|
4319 | # | |
4319 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed |
|
4320 | # #localfolder parameter should always be set, if it is not set then ProcUnit should be removed | |
4320 | # if not parmObj: |
|
4321 | # if not parmObj: | |
4321 | # projectObj.removeProcUnit(thisPuId) |
|
4322 | # projectObj.removeProcUnit(thisPuId) | |
4322 | # continue |
|
4323 | # continue | |
4323 | # |
|
4324 | # | |
4324 | # thisLocalfolder = parmObj.getValue() |
|
4325 | # thisLocalfolder = parmObj.getValue() | |
4325 | # |
|
4326 | # | |
4326 | # if localfolder != thisLocalfolder: |
|
4327 | # if localfolder != thisLocalfolder: | |
4327 | # continue |
|
4328 | # continue | |
4328 | # |
|
4329 | # | |
4329 | # puId = thisPuId |
|
4330 | # puId = thisPuId | |
4330 | # puObj = thisPuObj |
|
4331 | # puObj = thisPuObj | |
4331 | # break |
|
4332 | # break | |
4332 | # |
|
4333 | # | |
4333 | # return puObj |
|
4334 | # return puObj | |
4334 |
|
4335 | |||
4335 | def createFTPProcUnitView(self): |
|
4336 | def createFTPProcUnitView(self): | |
4336 |
|
4337 | |||
4337 | if not self.temporalFTP.create: |
|
4338 | if not self.temporalFTP.create: | |
4338 | self.temporalFTP.setwithoutconfiguration() |
|
4339 | self.temporalFTP.setwithoutconfiguration() | |
4339 |
|
4340 | |||
4340 | projectObj = self.getSelectedProjectObj() |
|
4341 | projectObj = self.getSelectedProjectObj() | |
4341 |
|
4342 | |||
4342 | if not projectObj: |
|
4343 | if not projectObj: | |
4343 | return |
|
4344 | return | |
4344 |
|
4345 | |||
4345 | self.removeAllFTPProcUnitView(projectObj) |
|
4346 | self.removeAllFTPProcUnitView(projectObj) | |
4346 |
|
4347 | |||
4347 | if not self.__puLocalFolder2FTP: |
|
4348 | if not self.__puLocalFolder2FTP: | |
4348 | return |
|
4349 | return | |
4349 |
|
4350 | |||
4350 | folderList = ",".join(self.__puLocalFolder2FTP.values()) |
|
4351 | folderList = ",".join(self.__puLocalFolder2FTP.values()) | |
4351 |
|
4352 | |||
4352 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") |
|
4353 | procUnitConfObj = projectObj.addProcUnit(name="SendToServer") | |
4353 |
|
4354 | |||
4354 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') |
|
4355 | procUnitConfObj.addParameter(name='server', value=self.temporalFTP.server, format='str') | |
4355 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') |
|
4356 | procUnitConfObj.addParameter(name='username', value=self.temporalFTP.username, format='str') | |
4356 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') |
|
4357 | procUnitConfObj.addParameter(name='password', value=self.temporalFTP.password, format='str') | |
4357 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') |
|
4358 | procUnitConfObj.addParameter(name='localfolder', value=folderList, format='list') | |
4358 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') |
|
4359 | procUnitConfObj.addParameter(name='remotefolder', value=self.temporalFTP.remotefolder, format='str') | |
4359 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') |
|
4360 | procUnitConfObj.addParameter(name='ext', value=self.temporalFTP.extension, format='str') | |
4360 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') |
|
4361 | procUnitConfObj.addParameter(name='period', value=self.temporalFTP.period, format='int') | |
4361 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') |
|
4362 | procUnitConfObj.addParameter(name='protocol', value=self.temporalFTP.protocol, format='str') | |
4362 |
|
4363 | |||
4363 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') |
|
4364 | procUnitConfObj.addParameter(name='ftp_wei', value=self.temporalFTP.ftp_wei, format='int') | |
4364 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') |
|
4365 | procUnitConfObj.addParameter(name='exp_code', value=self.temporalFTP.exp_code, format='int') | |
4365 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') |
|
4366 | procUnitConfObj.addParameter(name='sub_exp_code', value=self.temporalFTP.sub_exp_code, format='int') | |
4366 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') |
|
4367 | procUnitConfObj.addParameter(name='plot_pos', value=self.temporalFTP.plot_pos, format='int') | |
4367 |
|
4368 | |||
4368 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj |
|
4369 | self.__puObjDict[procUnitConfObj.getId()] = procUnitConfObj | |
4369 |
|
4370 | |||
4370 | def removeAllFTPProcUnitView(self, projectObj): |
|
4371 | def removeAllFTPProcUnitView(self, projectObj): | |
4371 |
|
4372 | |||
4372 | for thisPuId, thisPuObj in projectObj.procUnitItems(): |
|
4373 | for thisPuId, thisPuObj in projectObj.procUnitItems(): | |
4373 |
|
4374 | |||
4374 | if not thisPuObj.name == "SendToServer": |
|
4375 | if not thisPuObj.name == "SendToServer": | |
4375 | continue |
|
4376 | continue | |
4376 |
|
4377 | |||
4377 | projectObj.removeProcUnit(thisPuId) |
|
4378 | projectObj.removeProcUnit(thisPuId) | |
4378 |
|
4379 | |||
4379 | if thisPuId not in self.__puObjDict.keys(): |
|
4380 | if thisPuId not in self.__puObjDict.keys(): | |
4380 | continue |
|
4381 | continue | |
4381 |
|
4382 | |||
4382 | self.__puObjDict.pop(thisPuId) |
|
4383 | self.__puObjDict.pop(thisPuId) | |
4383 |
|
4384 | |||
4384 | def showPUinitView(self): |
|
4385 | def showPUinitView(self): | |
4385 |
|
4386 | |||
4386 | self.propertiesModel = TreeModel() |
|
4387 | self.propertiesModel = TreeModel() | |
4387 | self.propertiesModel.initPUVoltageView() |
|
4388 | self.propertiesModel.initPUVoltageView() | |
4388 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
4389 | self.treeProjectProperties.setModel(self.propertiesModel) | |
4389 | self.treeProjectProperties.expandAll() |
|
4390 | self.treeProjectProperties.expandAll() | |
4390 | self.treeProjectProperties.allColumnsShowFocus() |
|
4391 | self.treeProjectProperties.allColumnsShowFocus() | |
4391 | self.treeProjectProperties.resizeColumnToContents(1) |
|
4392 | self.treeProjectProperties.resizeColumnToContents(1) | |
4392 |
|
4393 | |||
4393 | def saveFTPFromOpObj(self, operationObj): |
|
4394 | def saveFTPFromOpObj(self, operationObj): | |
4394 |
|
4395 | |||
4395 | if operationObj.name != "SendByFTP": |
|
4396 | if operationObj.name != "SendByFTP": | |
4396 | return |
|
4397 | return | |
4397 |
|
4398 | |||
4398 | server = operationObj.getParameterValue("server") |
|
4399 | server = operationObj.getParameterValue("server") | |
4399 | username = operationObj.getParameterValue("username") |
|
4400 | username = operationObj.getParameterValue("username") | |
4400 | password = operationObj.getParameterValue("password") |
|
4401 | password = operationObj.getParameterValue("password") | |
4401 | localfolder = operationObj.getParameterValue("localfolder") |
|
4402 | localfolder = operationObj.getParameterValue("localfolder") | |
4402 | remotefolder = operationObj.getParameterValue("remotefolder") |
|
4403 | remotefolder = operationObj.getParameterValue("remotefolder") | |
4403 | ext = operationObj.getParameterValue("ext") |
|
4404 | ext = operationObj.getParameterValue("ext") | |
4404 | period = operationObj.getParameterValue("period") |
|
4405 | period = operationObj.getParameterValue("period") | |
4405 |
|
4406 | |||
4406 | self.temporalFTP.save(server=server, |
|
4407 | self.temporalFTP.save(server=server, | |
4407 | remotefolder=remotefolder, |
|
4408 | remotefolder=remotefolder, | |
4408 | username=username, |
|
4409 | username=username, | |
4409 | password=password, |
|
4410 | password=password, | |
4410 | localfolder=localfolder, |
|
4411 | localfolder=localfolder, | |
4411 | extension=ext) |
|
4412 | extension=ext) | |
4412 |
|
4413 | |||
4413 | return |
|
4414 | return | |
4414 |
|
4415 | |||
4415 | def saveFTPFromProcUnitObj(self, puObj): |
|
4416 | def saveFTPFromProcUnitObj(self, puObj): | |
4416 |
|
4417 | |||
4417 | opObj = puObj.getOperationObj(name="run") |
|
4418 | opObj = puObj.getOperationObj(name="run") | |
4418 |
|
4419 | |||
4419 | parmObj = opObj.getParameterObj(parameterName="server") |
|
4420 | parmObj = opObj.getParameterObj(parameterName="server") | |
4420 | if parmObj == None: |
|
4421 | if parmObj == None: | |
4421 | server = 'jro-app.igp.gob.pe' |
|
4422 | server = 'jro-app.igp.gob.pe' | |
4422 | else: |
|
4423 | else: | |
4423 | server = parmObj.getValue() |
|
4424 | server = parmObj.getValue() | |
4424 |
|
4425 | |||
4425 | parmObj = opObj.getParameterObj(parameterName="remotefolder") |
|
4426 | parmObj = opObj.getParameterObj(parameterName="remotefolder") | |
4426 | if parmObj == None: |
|
4427 | if parmObj == None: | |
4427 | remotefolder = '/home/wmaster/graficos' |
|
4428 | remotefolder = '/home/wmaster/graficos' | |
4428 | else: |
|
4429 | else: | |
4429 | remotefolder = parmObj.getValue() |
|
4430 | remotefolder = parmObj.getValue() | |
4430 |
|
4431 | |||
4431 | parmObj = opObj.getParameterObj(parameterName="username") |
|
4432 | parmObj = opObj.getParameterObj(parameterName="username") | |
4432 | if parmObj == None: |
|
4433 | if parmObj == None: | |
4433 | username = 'wmaster' |
|
4434 | username = 'wmaster' | |
4434 | else: |
|
4435 | else: | |
4435 | username = parmObj.getValue() |
|
4436 | username = parmObj.getValue() | |
4436 |
|
4437 | |||
4437 | parmObj = opObj.getParameterObj(parameterName="password") |
|
4438 | parmObj = opObj.getParameterObj(parameterName="password") | |
4438 | if parmObj == None: |
|
4439 | if parmObj == None: | |
4439 | password = 'mst2010vhf' |
|
4440 | password = 'mst2010vhf' | |
4440 | else: |
|
4441 | else: | |
4441 | password = parmObj.getValue() |
|
4442 | password = parmObj.getValue() | |
4442 |
|
4443 | |||
4443 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") |
|
4444 | parmObj = opObj.getParameterObj(parameterName="ftp_wei") | |
4444 | if parmObj == None: |
|
4445 | if parmObj == None: | |
4445 | ftp_wei = 0 |
|
4446 | ftp_wei = 0 | |
4446 | else: |
|
4447 | else: | |
4447 | ftp_wei = parmObj.getValue() |
|
4448 | ftp_wei = parmObj.getValue() | |
4448 |
|
4449 | |||
4449 | parmObj = opObj.getParameterObj(parameterName="exp_code") |
|
4450 | parmObj = opObj.getParameterObj(parameterName="exp_code") | |
4450 | if parmObj == None: |
|
4451 | if parmObj == None: | |
4451 | exp_code = 0 |
|
4452 | exp_code = 0 | |
4452 | else: |
|
4453 | else: | |
4453 | exp_code = parmObj.getValue() |
|
4454 | exp_code = parmObj.getValue() | |
4454 |
|
4455 | |||
4455 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") |
|
4456 | parmObj = opObj.getParameterObj(parameterName="sub_exp_code") | |
4456 | if parmObj == None: |
|
4457 | if parmObj == None: | |
4457 | sub_exp_code = 0 |
|
4458 | sub_exp_code = 0 | |
4458 | else: |
|
4459 | else: | |
4459 | sub_exp_code = parmObj.getValue() |
|
4460 | sub_exp_code = parmObj.getValue() | |
4460 |
|
4461 | |||
4461 | parmObj = opObj.getParameterObj(parameterName="plot_pos") |
|
4462 | parmObj = opObj.getParameterObj(parameterName="plot_pos") | |
4462 | if parmObj == None: |
|
4463 | if parmObj == None: | |
4463 | plot_pos = 0 |
|
4464 | plot_pos = 0 | |
4464 | else: |
|
4465 | else: | |
4465 | plot_pos = parmObj.getValue() |
|
4466 | plot_pos = parmObj.getValue() | |
4466 |
|
4467 | |||
4467 | parmObj = opObj.getParameterObj(parameterName="localfolder") |
|
4468 | parmObj = opObj.getParameterObj(parameterName="localfolder") | |
4468 | if parmObj == None: |
|
4469 | if parmObj == None: | |
4469 | localfolder = None |
|
4470 | localfolder = None | |
4470 | else: |
|
4471 | else: | |
4471 | localfolder = parmObj.getValue() |
|
4472 | localfolder = parmObj.getValue() | |
4472 |
|
4473 | |||
4473 | parmObj = opObj.getParameterObj(parameterName="ext") |
|
4474 | parmObj = opObj.getParameterObj(parameterName="ext") | |
4474 | if parmObj == None: |
|
4475 | if parmObj == None: | |
4475 | extension = '.png' |
|
4476 | extension = '.png' | |
4476 | else: |
|
4477 | else: | |
4477 | extension = parmObj.getValue() |
|
4478 | extension = parmObj.getValue() | |
4478 |
|
4479 | |||
4479 | self.temporalFTP.save(server=server, |
|
4480 | self.temporalFTP.save(server=server, | |
4480 | remotefolder=remotefolder, |
|
4481 | remotefolder=remotefolder, | |
4481 | username=username, |
|
4482 | username=username, | |
4482 | password=password, |
|
4483 | password=password, | |
4483 | ftp_wei=ftp_wei, |
|
4484 | ftp_wei=ftp_wei, | |
4484 | exp_code=exp_code, |
|
4485 | exp_code=exp_code, | |
4485 | sub_exp_code=sub_exp_code, |
|
4486 | sub_exp_code=sub_exp_code, | |
4486 | plot_pos=plot_pos, |
|
4487 | plot_pos=plot_pos, | |
4487 | localfolder=localfolder, |
|
4488 | localfolder=localfolder, | |
4488 | extension=extension) |
|
4489 | extension=extension) | |
4489 |
|
4490 | |||
4490 | def addProject2ProjectExplorer(self, id, name): |
|
4491 | def addProject2ProjectExplorer(self, id, name): | |
4491 |
|
4492 | |||
4492 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4493 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4493 |
|
4494 | |||
4494 | parentItem = self.projectExplorerModel.invisibleRootItem() |
|
4495 | parentItem = self.projectExplorerModel.invisibleRootItem() | |
4495 | parentItem.appendRow(itemTree) |
|
4496 | parentItem.appendRow(itemTree) | |
4496 |
|
4497 | |||
4497 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4498 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4498 |
|
4499 | |||
4499 | self.selectedItemTree = itemTree |
|
4500 | self.selectedItemTree = itemTree | |
4500 |
|
4501 | |||
4501 | self.__itemTreeDict[id] = itemTree |
|
4502 | self.__itemTreeDict[id] = itemTree | |
4502 |
|
4503 | |||
4503 | def addPU2ProjectExplorer(self, puObj): |
|
4504 | def addPU2ProjectExplorer(self, puObj): | |
4504 |
|
4505 | |||
4505 | id, name = puObj.id, puObj.datatype |
|
4506 | id, name = puObj.id, puObj.datatype | |
4506 |
|
4507 | |||
4507 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4508 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4508 |
|
4509 | |||
4509 | parentItem = self.selectedItemTree |
|
4510 | parentItem = self.selectedItemTree | |
4510 | parentItem.appendRow(itemTree) |
|
4511 | parentItem.appendRow(itemTree) | |
4511 | self.projectExplorerTree.expandAll() |
|
4512 | self.projectExplorerTree.expandAll() | |
4512 |
|
4513 | |||
4513 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) |
|
4514 | self.projectExplorerTree.setCurrentIndex(itemTree.index()) | |
4514 |
|
4515 | |||
4515 | self.selectedItemTree = itemTree |
|
4516 | self.selectedItemTree = itemTree | |
4516 |
|
4517 | |||
4517 | self.__itemTreeDict[id] = itemTree |
|
4518 | self.__itemTreeDict[id] = itemTree | |
4518 |
|
4519 | |||
4519 | def addPU2PELoadXML(self, puObj): |
|
4520 | def addPU2PELoadXML(self, puObj): | |
4520 |
|
4521 | |||
4521 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId |
|
4522 | id, name, inputId = puObj.id, puObj.datatype, puObj.inputId | |
4522 |
|
4523 | |||
4523 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) |
|
4524 | itemTree = QtGui.QStandardItem(QtCore.QString(str(name))) | |
4524 |
|
4525 | |||
4525 | if self.__itemTreeDict.has_key(inputId): |
|
4526 | if self.__itemTreeDict.has_key(inputId): | |
4526 | parentItem = self.__itemTreeDict[inputId] |
|
4527 | parentItem = self.__itemTreeDict[inputId] | |
4527 | else: |
|
4528 | else: | |
4528 | #If parent is a Reader object |
|
4529 | #If parent is a Reader object | |
4529 | parentItem = self.__itemTreeDict[id[:-1]] |
|
4530 | parentItem = self.__itemTreeDict[id[:-1]] | |
4530 |
|
4531 | |||
4531 | parentItem.appendRow(itemTree) |
|
4532 | parentItem.appendRow(itemTree) | |
4532 | self.projectExplorerTree.expandAll() |
|
4533 | self.projectExplorerTree.expandAll() | |
4533 | parentItem = itemTree |
|
4534 | parentItem = itemTree | |
4534 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) |
|
4535 | self.projectExplorerTree.setCurrentIndex(parentItem.index()) | |
4535 |
|
4536 | |||
4536 | self.__itemTreeDict[id] = itemTree |
|
4537 | self.__itemTreeDict[id] = itemTree | |
4537 | self.selectedItemTree = itemTree |
|
4538 | self.selectedItemTree = itemTree | |
4538 |
|
4539 | |||
4539 | def getSelectedProjectObj(self): |
|
4540 | def getSelectedProjectObj(self): | |
4540 | """ |
|
4541 | """ | |
4541 | Return the current project object selected. If a processing unit is |
|
4542 | Return the current project object selected. If a processing unit is | |
4542 | actually selected this function returns associated project. |
|
4543 | actually selected this function returns associated project. | |
4543 |
|
4544 | |||
4544 | None if any project or processing unit is selected |
|
4545 | None if any project or processing unit is selected | |
4545 | """ |
|
4546 | """ | |
4546 | for key in self.__itemTreeDict.keys(): |
|
4547 | for key in self.__itemTreeDict.keys(): | |
4547 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4548 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4548 | continue |
|
4549 | continue | |
4549 |
|
4550 | |||
4550 | if self.__projectObjDict.has_key(key): |
|
4551 | if self.__projectObjDict.has_key(key): | |
4551 | projectObj = self.__projectObjDict[key] |
|
4552 | projectObj = self.__projectObjDict[key] | |
4552 | return projectObj |
|
4553 | return projectObj | |
4553 |
|
4554 | |||
4554 | puObj = self.__puObjDict[key] |
|
4555 | puObj = self.__puObjDict[key] | |
4555 |
|
4556 | |||
4556 | if puObj.parentId == None: |
|
4557 | if puObj.parentId == None: | |
4557 | projectId = puObj.getId()[0] |
|
4558 | projectId = puObj.getId()[0] | |
4558 | else: |
|
4559 | else: | |
4559 | projectId = puObj.parentId |
|
4560 | projectId = puObj.parentId | |
4560 |
|
4561 | |||
4561 | projectObj = self.__projectObjDict[projectId] |
|
4562 | projectObj = self.__projectObjDict[projectId] | |
4562 | return projectObj |
|
4563 | return projectObj | |
4563 |
|
4564 | |||
4564 | return None |
|
4565 | return None | |
4565 |
|
4566 | |||
4566 | def getSelectedItemObj(self): |
|
4567 | def getSelectedItemObj(self): | |
4567 | """ |
|
4568 | """ | |
4568 | Return the current project or processing unit object selected |
|
4569 | Return the current project or processing unit object selected | |
4569 |
|
4570 | |||
4570 | None if any project or processing unit is selected |
|
4571 | None if any project or processing unit is selected | |
4571 | """ |
|
4572 | """ | |
4572 | for key in self.__itemTreeDict.keys(): |
|
4573 | for key in self.__itemTreeDict.keys(): | |
4573 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4574 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4574 | continue |
|
4575 | continue | |
4575 |
|
4576 | |||
4576 | if self.__projectObjDict.has_key(key) == True: |
|
4577 | if self.__projectObjDict.has_key(key) == True: | |
4577 | fatherObj = self.__projectObjDict[key] |
|
4578 | fatherObj = self.__projectObjDict[key] | |
4578 | else: |
|
4579 | else: | |
4579 | fatherObj = self.__puObjDict[key] |
|
4580 | fatherObj = self.__puObjDict[key] | |
4580 |
|
4581 | |||
4581 | return fatherObj |
|
4582 | return fatherObj | |
4582 |
|
4583 | |||
4583 | return None |
|
4584 | return None | |
4584 |
|
4585 | |||
4585 | def _WarningWindow(self, text, information): |
|
4586 | def _WarningWindow(self, text, information): | |
4586 |
|
4587 | |||
4587 | msgBox = QtGui.QMessageBox() |
|
4588 | msgBox = QtGui.QMessageBox() | |
4588 | msgBox.setText(text) |
|
4589 | msgBox.setText(text) | |
4589 | msgBox.setInformativeText(information) |
|
4590 | msgBox.setInformativeText(information) | |
4590 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) |
|
4591 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
4591 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) |
|
4592 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
4592 | ret = msgBox.exec_() |
|
4593 | ret = msgBox.exec_() | |
4593 |
|
4594 | |||
4594 | answer = False |
|
4595 | answer = False | |
4595 |
|
4596 | |||
4596 | if ret == QtGui.QMessageBox.Ok: |
|
4597 | if ret == QtGui.QMessageBox.Ok: | |
4597 | answer = True |
|
4598 | answer = True | |
4598 |
|
4599 | |||
4599 | return answer |
|
4600 | return answer | |
4600 |
|
4601 | |||
4601 | def __getNewProjectId(self): |
|
4602 | def __getNewProjectId(self): | |
4602 |
|
4603 | |||
4603 | loadProject = False |
|
4604 | loadProject = False | |
4604 |
|
4605 | |||
4605 | for thisId in range(1,10): |
|
4606 | for thisId in range(1,10): | |
4606 | newId = str(thisId) |
|
4607 | newId = str(thisId) | |
4607 | if newId in self.__projectObjDict.keys(): |
|
4608 | if newId in self.__projectObjDict.keys(): | |
4608 | continue |
|
4609 | continue | |
4609 |
|
4610 | |||
4610 | loadProject = True |
|
4611 | loadProject = True | |
4611 | projectId = newId |
|
4612 | projectId = newId | |
4612 | break |
|
4613 | break | |
4613 |
|
4614 | |||
4614 | if not loadProject: |
|
4615 | if not loadProject: | |
4615 | self.console.clear() |
|
4616 | self.console.clear() | |
4616 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") |
|
4617 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
4617 | return None |
|
4618 | return None | |
4618 |
|
4619 | |||
4619 | return projectId |
|
4620 | return projectId | |
4620 |
|
4621 | |||
4621 | def openProject(self): |
|
4622 | def openProject(self): | |
4622 |
|
4623 | |||
4623 | self._disable_save_button() |
|
4624 | self._disable_save_button() | |
4624 | self._disable_play_button() |
|
4625 | self._disable_play_button() | |
4625 |
|
4626 | |||
4626 | self.frame_2.setEnabled(True) |
|
4627 | self.frame_2.setEnabled(True) | |
4627 |
|
4628 | |||
4628 | # print self.dir |
|
4629 | # print self.dir | |
4629 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) |
|
4630 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open a project file", self.pathWorkSpace, self.tr("Html Files (*.xml)"))) | |
4630 |
|
4631 | |||
4631 | projectObjLoad = Project() |
|
4632 | projectObjLoad = Project() | |
4632 |
|
4633 | |||
4633 | try: |
|
4634 | try: | |
4634 | projectObjLoad.readXml(filename) |
|
4635 | projectObjLoad.readXml(filename) | |
4635 | except: |
|
4636 | except: | |
4636 | self.console.clear() |
|
4637 | self.console.clear() | |
4637 | self.console.append("The selected xml file could not be loaded ...") |
|
4638 | self.console.append("The selected xml file could not be loaded ...") | |
4638 | return 0 |
|
4639 | return 0 | |
4639 |
|
4640 | |||
4640 | self.create = False |
|
4641 | self.create = False | |
4641 | self.refreshProjectWindow(projectObjLoad) |
|
4642 | self.refreshProjectWindow(projectObjLoad) | |
4642 | self.refreshProjectProperties(projectObjLoad) |
|
4643 | self.refreshProjectProperties(projectObjLoad) | |
4643 |
|
4644 | |||
4644 | projectId = projectObjLoad.id |
|
4645 | projectId = projectObjLoad.id | |
4645 |
|
4646 | |||
4646 | if projectId in self.__projectObjDict.keys(): |
|
4647 | if projectId in self.__projectObjDict.keys(): | |
4647 |
|
4648 | |||
4648 | # answer = self._WarningWindow("You already have a project loaded with the same Id", |
|
4649 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
4649 | # "Do you want to load the file anyway?") |
|
4650 | # "Do you want to load the file anyway?") | |
4650 | # if not answer: |
|
4651 | # if not answer: | |
4651 | # return |
|
4652 | # return | |
4652 |
|
4653 | |||
4653 | projectId = self.__getNewProjectId() |
|
4654 | projectId = self.__getNewProjectId() | |
4654 |
|
4655 | |||
4655 | if not projectId: |
|
4656 | if not projectId: | |
4656 | return |
|
4657 | return | |
4657 |
|
4658 | |||
4658 | projectObjLoad.updateId(projectId) |
|
4659 | projectObjLoad.updateId(projectId) | |
4659 |
|
4660 | |||
4660 | self.__projectObjDict[projectId] = projectObjLoad |
|
4661 | self.__projectObjDict[projectId] = projectObjLoad | |
4661 |
|
4662 | |||
4662 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) |
|
4663 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
4663 |
|
4664 | |||
4664 | self.tabWidgetProject.setEnabled(True) |
|
4665 | self.tabWidgetProject.setEnabled(True) | |
4665 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4666 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4666 | # Disable tabProject after finish the creation |
|
4667 | # Disable tabProject after finish the creation | |
4667 | self.tabProject.setEnabled(True) |
|
4668 | self.tabProject.setEnabled(True) | |
4668 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) |
|
4669 | puObjorderList = OrderedDict(sorted(projectObjLoad.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
4669 |
|
4670 | |||
4670 | for puId, puObj in puObjorderList.items(): |
|
4671 | for puId, puObj in puObjorderList.items(): | |
4671 |
|
4672 | |||
4672 | self.__puObjDict[puId] = puObj |
|
4673 | self.__puObjDict[puId] = puObj | |
4673 |
|
4674 | |||
4674 | if puObj.name == "SendToServer": |
|
4675 | if puObj.name == "SendToServer": | |
4675 | self.saveFTPFromProcUnitObj(puObj) |
|
4676 | self.saveFTPFromProcUnitObj(puObj) | |
4676 |
|
4677 | |||
4677 | ############## COMPATIBLE WITH OLD VERSIONS ################ |
|
4678 | ############## COMPATIBLE WITH OLD VERSIONS ################ | |
4678 | operationObj = puObj.getOperationObj("SendByFTP") |
|
4679 | operationObj = puObj.getOperationObj("SendByFTP") | |
4679 |
|
4680 | |||
4680 | if operationObj: |
|
4681 | if operationObj: | |
4681 | self.saveFTPFromOpObj(operationObj) |
|
4682 | self.saveFTPFromOpObj(operationObj) | |
4682 | ############################################################ |
|
4683 | ############################################################ | |
4683 |
|
4684 | |||
4684 | if puObj.inputId == '0': |
|
4685 | if puObj.inputId == '0': | |
4685 | continue |
|
4686 | continue | |
4686 |
|
4687 | |||
4687 | self.addPU2PELoadXML(puObj) |
|
4688 | self.addPU2PELoadXML(puObj) | |
4688 |
|
4689 | |||
4689 | self.refreshPUWindow(puObj) |
|
4690 | self.refreshPUWindow(puObj) | |
4690 | self.refreshPUProperties(puObj) |
|
4691 | self.refreshPUProperties(puObj) | |
4691 | self.showtabPUCreated(datatype=puObj.datatype) |
|
4692 | self.showtabPUCreated(datatype=puObj.datatype) | |
4692 |
|
4693 | |||
4693 | self.console.clear() |
|
4694 | self.console.clear() | |
4694 | self.console.append("The selected xml file has been loaded successfully") |
|
4695 | self.console.append("The selected xml file has been loaded successfully") | |
4695 |
|
4696 | |||
4696 | self._disable_save_button() |
|
4697 | self._disable_save_button() | |
4697 | self._enable_play_button() |
|
4698 | self._enable_play_button() | |
4698 |
|
4699 | |||
4699 | def create_updating_timer(self): |
|
4700 | def create_updating_timer(self): | |
4700 | self.comm_data_timer = QtCore.QTimer(self) |
|
4701 | self.comm_data_timer = QtCore.QTimer(self) | |
4701 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) |
|
4702 | self.comm_data_timer.timeout.connect(self.on_comm_updating_timer) | |
4702 | self.comm_data_timer.start(1000) |
|
4703 | self.comm_data_timer.start(1000) | |
4703 |
|
4704 | |||
4704 | def on_comm_updating_timer(self): |
|
4705 | def on_comm_updating_timer(self): | |
4705 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose |
|
4706 | # Verifica si algun proceso ha sido inicializado y sigue ejecutandose | |
4706 | # Si el proceso se ha parado actualizar el GUI (stopProject) |
|
4707 | # Si el proceso se ha parado actualizar el GUI (stopProject) | |
4707 | if not self.threadStarted: |
|
4708 | if not self.threadStarted: | |
4708 | return |
|
4709 | return | |
4709 |
|
4710 | |||
4710 | if self.controllerThread.isFinished(): |
|
4711 | if self.controllerThread.isFinished(): | |
4711 | self.stopProject() |
|
4712 | self.stopProject() | |
4712 |
|
4713 | |||
4713 | def playProject(self, ext=".xml", save=1): |
|
4714 | def playProject(self, ext=".xml", save=1): | |
4714 |
|
4715 | |||
4715 | self._disable_play_button() |
|
4716 | self._disable_play_button() | |
4716 | self._disable_save_button() |
|
4717 | self._disable_save_button() | |
4717 |
|
4718 | |||
4718 | if self.controllerThread: |
|
4719 | if self.controllerThread: | |
4719 | if self.controllerThread.isRunning(): |
|
4720 | if self.controllerThread.isRunning(): | |
4720 | self.console.append("There is already another process running") |
|
4721 | self.console.append("There is already another process running") | |
4721 | self._enable_stop_button() |
|
4722 | self._enable_stop_button() | |
4722 | return |
|
4723 | return | |
4723 |
|
4724 | |||
4724 | projectObj = self.getSelectedProjectObj() |
|
4725 | projectObj = self.getSelectedProjectObj() | |
4725 |
|
4726 | |||
4726 | if not projectObj: |
|
4727 | if not projectObj: | |
4727 | self.console.append("Please, select a project to start it") |
|
4728 | self.console.append("Please, select a project to start it") | |
4728 | return |
|
4729 | return | |
4729 |
|
4730 | |||
4730 | if save: |
|
4731 | if save: | |
4731 | filename = self.saveProject() |
|
4732 | filename = self.saveProject() | |
4732 | if filename == None: |
|
4733 | if filename == None: | |
4733 | self.console.append("Process not initialized.") |
|
4734 | self.console.append("Process not initialized.") | |
4734 | return |
|
4735 | return | |
4735 | else: |
|
4736 | else: | |
4736 | filename = TEMPORAL_FILE |
|
4737 | filename = TEMPORAL_FILE | |
4737 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) |
|
4738 | projectObj.writeXml( os.path.join(self.pathWorkSpace,filename) ) | |
4738 |
|
4739 | |||
4739 | self.console.append("Please Wait...") |
|
4740 | self.console.append("Please Wait...") | |
4740 |
|
4741 | |||
4741 | self.controllerThread = ControllerThread(filename) |
|
4742 | self.controllerThread = ControllerThread(filename) | |
4742 |
|
4743 | |||
4743 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) |
|
4744 | # QObject.connect( self.controllerThread, SIGNAL( "jobFinished( PyQt_PyObject )" ), self.jobFinishedFromThread ) | |
4744 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) |
|
4745 | # QObject.connect( self.controllerThread, SIGNAL( "jobStarted( PyQt_PyObject )" ), self.jobStartedFromThread ) | |
4745 | self.console.clear() |
|
4746 | self.console.clear() | |
4746 | self.controllerThread.start() |
|
4747 | self.controllerThread.start() | |
4747 | sleep(0.5) |
|
4748 | sleep(0.5) | |
4748 | self.threadStarted = True |
|
4749 | self.threadStarted = True | |
4749 |
|
4750 | |||
4750 | self._disable_play_button() |
|
4751 | self._disable_play_button() | |
4751 | self._disable_save_button() |
|
4752 | self._disable_save_button() | |
4752 | self._enable_stop_button() |
|
4753 | self._enable_stop_button() | |
4753 |
|
4754 | |||
4754 | def stopProject(self): |
|
4755 | def stopProject(self): | |
4755 |
|
4756 | |||
4756 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) |
|
4757 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.STOP, True)) | |
4757 | self.controllerThread.stop() |
|
4758 | self.controllerThread.stop() | |
4758 | self.threadStarted = False |
|
4759 | self.threadStarted = False | |
4759 |
|
4760 | |||
4760 | while self.controllerThread.isRunning(): |
|
4761 | while self.controllerThread.isRunning(): | |
4761 | sleep(0.5) |
|
4762 | sleep(0.5) | |
4762 |
|
4763 | |||
4763 | self._disable_stop_button() |
|
4764 | self._disable_stop_button() | |
4764 | self._enable_play_button() |
|
4765 | self._enable_play_button() | |
4765 |
|
4766 | |||
4766 | def pauseProject(self): |
|
4767 | def pauseProject(self): | |
4767 |
|
4768 | |||
4768 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) |
|
4769 | # self.commCtrlPThread.cmd_q.put(ProcessCommand(ProcessCommand.PAUSE, data=True)) | |
4769 | paused = self.controllerThread.pause() |
|
4770 | paused = self.controllerThread.pause() | |
4770 |
|
4771 | |||
4771 | self.changePauseIcon(paused) |
|
4772 | self.changePauseIcon(paused) | |
4772 |
|
4773 | |||
4773 | def saveProject(self, filename=None): |
|
4774 | def saveProject(self, filename=None): | |
4774 |
|
4775 | |||
4775 | self._disable_save_button() |
|
4776 | self._disable_save_button() | |
4776 | self._disable_play_button() |
|
4777 | self._disable_play_button() | |
4777 |
|
4778 | |||
4778 | projectObj = self.getSelectedProjectObj() |
|
4779 | projectObj = self.getSelectedProjectObj() | |
4779 |
|
4780 | |||
4780 | if not projectObj: |
|
4781 | if not projectObj: | |
4781 |
|
4782 | |||
4782 | if self.create: |
|
4783 | if self.create: | |
4783 | self.console.append("Please press Ok before save it") |
|
4784 | self.console.append("Please press Ok before save it") | |
4784 | else: |
|
4785 | else: | |
4785 | self.console.append("Please select a project before save it") |
|
4786 | self.console.append("Please select a project before save it") | |
4786 | return |
|
4787 | return | |
4787 |
|
4788 | |||
4788 | self.refreshGraphicsId() |
|
4789 | self.refreshGraphicsId() | |
4789 |
|
4790 | |||
4790 | sts = True |
|
4791 | sts = True | |
4791 | selectedItemObj = self.getSelectedItemObj() |
|
4792 | selectedItemObj = self.getSelectedItemObj() | |
4792 |
|
4793 | |||
4793 | #A Processing Unit has been selected |
|
4794 | #A Processing Unit has been selected | |
4794 | if projectObj == selectedItemObj: |
|
4795 | if projectObj == selectedItemObj: | |
4795 | if not self.on_proOk_clicked(): |
|
4796 | if not self.on_proOk_clicked(): | |
4796 | return None |
|
4797 | return None | |
4797 |
|
4798 | |||
4798 | #A Processing Unit has been selected |
|
4799 | #A Processing Unit has been selected | |
4799 | if projectObj != selectedItemObj: |
|
4800 | if projectObj != selectedItemObj: | |
4800 | puObj = selectedItemObj |
|
4801 | puObj = selectedItemObj | |
4801 |
|
4802 | |||
4802 | if puObj.name == 'VoltageProc': |
|
4803 | if puObj.name == 'VoltageProc': | |
4803 | sts = self.on_volOpOk_clicked() |
|
4804 | sts = self.on_volOpOk_clicked() | |
4804 | if puObj.name == 'SpectraProc': |
|
4805 | if puObj.name == 'SpectraProc': | |
4805 | sts = self.on_specOpOk_clicked() |
|
4806 | sts = self.on_specOpOk_clicked() | |
4806 | if puObj.name == 'SpectraHeisProc': |
|
4807 | if puObj.name == 'SpectraHeisProc': | |
4807 | sts = self.on_specHeisOpOk_clicked() |
|
4808 | sts = self.on_specHeisOpOk_clicked() | |
4808 |
|
4809 | |||
4809 | if not sts: |
|
4810 | if not sts: | |
4810 | return None |
|
4811 | return None | |
4811 |
|
4812 | |||
4812 | self.createFTPProcUnitView() |
|
4813 | self.createFTPProcUnitView() | |
4813 |
|
4814 | |||
4814 | if not filename: |
|
4815 | if not filename: | |
4815 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) |
|
4816 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
4816 |
|
4817 | |||
4817 | projectObj.writeXml(filename) |
|
4818 | projectObj.writeXml(filename) | |
4818 | self.console.clear() |
|
4819 | self.console.clear() | |
4819 | self.console.append("Project saved") |
|
4820 | self.console.append("Project saved") | |
4820 | self.console.append("Press Play button to start data processing ...") |
|
4821 | self.console.append("Press Play button to start data processing ...") | |
4821 |
|
4822 | |||
4822 | self._disable_save_button() |
|
4823 | self._disable_save_button() | |
4823 | self._enable_play_button() |
|
4824 | self._enable_play_button() | |
4824 |
|
4825 | |||
4825 | return filename |
|
4826 | return filename | |
4826 |
|
4827 | |||
4827 | def removeItemTreeFromProject(self): |
|
4828 | def removeItemTreeFromProject(self): | |
4828 | """ |
|
4829 | """ | |
4829 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol |
|
4830 | Metodo para eliminar el proyecto en el dictionario de proyectos y en el dictionario de vista de arbol | |
4830 | """ |
|
4831 | """ | |
4831 | for key in self.__itemTreeDict.keys(): |
|
4832 | for key in self.__itemTreeDict.keys(): | |
4832 |
|
4833 | |||
4833 | #Check again because an item can delete multiple items (childs) |
|
4834 | #Check again because an item can delete multiple items (childs) | |
4834 | if key not in self.__itemTreeDict.keys(): |
|
4835 | if key not in self.__itemTreeDict.keys(): | |
4835 | continue |
|
4836 | continue | |
4836 |
|
4837 | |||
4837 | if self.__itemTreeDict[key] != self.selectedItemTree: |
|
4838 | if self.__itemTreeDict[key] != self.selectedItemTree: | |
4838 | continue |
|
4839 | continue | |
4839 |
|
4840 | |||
4840 | if self.__projectObjDict.has_key(key) == True: |
|
4841 | if self.__projectObjDict.has_key(key) == True: | |
4841 |
|
4842 | |||
4842 | del self.__projectObjDict[key] |
|
4843 | del self.__projectObjDict[key] | |
4843 | del self.__itemTreeDict[key] |
|
4844 | del self.__itemTreeDict[key] | |
4844 |
|
4845 | |||
4845 | else: |
|
4846 | else: | |
4846 | puObj = self.__puObjDict[key] |
|
4847 | puObj = self.__puObjDict[key] | |
4847 | idProjectParent = puObj.parentId |
|
4848 | idProjectParent = puObj.parentId | |
4848 | projectObj = self.__projectObjDict[idProjectParent] |
|
4849 | projectObj = self.__projectObjDict[idProjectParent] | |
4849 |
|
4850 | |||
4850 | del self.__puObjDict[key] |
|
4851 | del self.__puObjDict[key] | |
4851 | del self.__itemTreeDict[key] |
|
4852 | del self.__itemTreeDict[key] | |
4852 | del projectObj.procUnitConfObjDict[key] |
|
4853 | del projectObj.procUnitConfObjDict[key] | |
4853 |
|
4854 | |||
4854 | for key in projectObj.procUnitConfObjDict.keys(): |
|
4855 | for key in projectObj.procUnitConfObjDict.keys(): | |
4855 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): |
|
4856 | if projectObj.procUnitConfObjDict[key].inputId != puObj.getId(): | |
4856 | continue |
|
4857 | continue | |
4857 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4858 | del self.__puObjDict[projectObj.procUnitConfObjDict[key].getId()] | |
4858 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] |
|
4859 | del self.__itemTreeDict[projectObj.procUnitConfObjDict[key].getId()] | |
4859 | del projectObj.procUnitConfObjDict[key] |
|
4860 | del projectObj.procUnitConfObjDict[key] | |
4860 | # print projectObj.procUnitConfObjDict |
|
4861 | # print projectObj.procUnitConfObjDict | |
4861 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict |
|
4862 | # print self.__itemTreeDict,self.__projectObjDict,self.__puObjDict | |
4862 |
|
4863 | |||
4863 | def setInputsProject_View(self): |
|
4864 | def setInputsProject_View(self): | |
4864 |
|
4865 | |||
4865 | self.tabWidgetProject.setEnabled(True) |
|
4866 | self.tabWidgetProject.setEnabled(True) | |
4866 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
|
4867 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
4867 | self.tabProject.setEnabled(True) |
|
4868 | self.tabProject.setEnabled(True) | |
4868 | self.frame_2.setEnabled(False) |
|
4869 | self.frame_2.setEnabled(False) | |
4869 | self.proName.clear() |
|
4870 | self.proName.clear() | |
4870 | self.proName.setFocus() |
|
4871 | self.proName.setFocus() | |
4871 | self.proName.setSelection(0, 0) |
|
4872 | self.proName.setSelection(0, 0) | |
4872 | self.proName.setCursorPosition(0) |
|
4873 | self.proName.setCursorPosition(0) | |
4873 | self.proDataType.setText('.r') |
|
4874 | self.proDataType.setText('.r') | |
4874 | self.proDataPath.clear() |
|
4875 | self.proDataPath.clear() | |
4875 | self.proComDataType.clear() |
|
4876 | self.proComDataType.clear() | |
4876 | self.proComDataType.addItem("Voltage") |
|
4877 | self.proComDataType.addItem("Voltage") | |
4877 | self.proComDataType.addItem("Spectra") |
|
4878 | self.proComDataType.addItem("Spectra") | |
4878 | self.proComDataType.addItem("Fits") |
|
4879 | self.proComDataType.addItem("Fits") | |
4879 | self.proComDataType.addItem("USRP") |
|
4880 | self.proComDataType.addItem("USRP") | |
4880 |
|
4881 | |||
4881 | self.proComStartDate.clear() |
|
4882 | self.proComStartDate.clear() | |
4882 | self.proComEndDate.clear() |
|
4883 | self.proComEndDate.clear() | |
4883 |
|
4884 | |||
4884 | startTime = "00:00:00" |
|
4885 | startTime = "00:00:00" | |
4885 | endTime = "23:59:59" |
|
4886 | endTime = "23:59:59" | |
4886 | starlist = startTime.split(":") |
|
4887 | starlist = startTime.split(":") | |
4887 | endlist = endTime.split(":") |
|
4888 | endlist = endTime.split(":") | |
4888 | self.proDelay.setText("60") |
|
4889 | self.proDelay.setText("60") | |
4889 | self.proSet.setText("") |
|
4890 | self.proSet.setText("") | |
4890 |
|
4891 | |||
4891 | self.labelSet.show() |
|
4892 | self.labelSet.show() | |
4892 | self.proSet.show() |
|
4893 | self.proSet.show() | |
4893 |
|
4894 | |||
4894 | self.labelIPPKm.hide() |
|
4895 | self.labelIPPKm.hide() | |
4895 | self.proIPPKm.hide() |
|
4896 | self.proIPPKm.hide() | |
4896 |
|
4897 | |||
4897 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
4898 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
4898 | self.proStartTime.setTime(self.time) |
|
4899 | self.proStartTime.setTime(self.time) | |
4899 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
4900 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
4900 | self.proEndTime.setTime(self.time) |
|
4901 | self.proEndTime.setTime(self.time) | |
4901 | self.proDescription.clear() |
|
4902 | self.proDescription.clear() | |
4902 | self.proOk.setEnabled(False) |
|
4903 | self.proOk.setEnabled(False) | |
4903 | # self.console.append("Please, Write a name Project") |
|
4904 | # self.console.append("Please, Write a name Project") | |
4904 | # self.console.append("Introduce Project Parameters")DC |
|
4905 | # self.console.append("Introduce Project Parameters")DC | |
4905 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
|
4906 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") | |
4906 |
|
4907 | |||
4907 | def clearPUWindow(self, datatype): |
|
4908 | def clearPUWindow(self, datatype): | |
4908 |
|
4909 | |||
4909 | projectObjView = self.getSelectedProjectObj() |
|
4910 | projectObjView = self.getSelectedProjectObj() | |
4910 |
|
4911 | |||
4911 | if not projectObjView: |
|
4912 | if not projectObjView: | |
4912 | return |
|
4913 | return | |
4913 |
|
4914 | |||
4914 | puObj = self.getSelectedItemObj() |
|
4915 | puObj = self.getSelectedItemObj() | |
4915 | inputId = puObj.getInputId() |
|
4916 | inputId = puObj.getInputId() | |
4916 | inputPUObj = projectObjView.getProcUnitObj(inputId) |
|
4917 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
4917 |
|
4918 | |||
4918 | if datatype == 'Voltage': |
|
4919 | if datatype == 'Voltage': | |
4919 | self.volOpComChannels.setEnabled(False) |
|
4920 | self.volOpComChannels.setEnabled(False) | |
4920 | self.volOpComHeights.setEnabled(False) |
|
4921 | self.volOpComHeights.setEnabled(False) | |
4921 | self.volOpFilter.setEnabled(False) |
|
4922 | self.volOpFilter.setEnabled(False) | |
4922 | self.volOpComProfile.setEnabled(False) |
|
4923 | self.volOpComProfile.setEnabled(False) | |
4923 | self.volOpComCode.setEnabled(False) |
|
4924 | self.volOpComCode.setEnabled(False) | |
4924 | self.volOpCohInt.setEnabled(False) |
|
4925 | self.volOpCohInt.setEnabled(False) | |
4925 | self.volOpChannel.setEnabled(False) |
|
4926 | self.volOpChannel.setEnabled(False) | |
4926 | self.volOpHeights.setEnabled(False) |
|
4927 | self.volOpHeights.setEnabled(False) | |
4927 | self.volOpProfile.setEnabled(False) |
|
4928 | self.volOpProfile.setEnabled(False) | |
4928 | self.volOpRadarfrequency.setEnabled(False) |
|
4929 | self.volOpRadarfrequency.setEnabled(False) | |
4929 | self.volOpCebChannels.setCheckState(0) |
|
4930 | self.volOpCebChannels.setCheckState(0) | |
4930 | self.volOpCebRadarfrequency.setCheckState(0) |
|
4931 | self.volOpCebRadarfrequency.setCheckState(0) | |
4931 | self.volOpCebHeights.setCheckState(0) |
|
4932 | self.volOpCebHeights.setCheckState(0) | |
4932 | self.volOpCebFilter.setCheckState(0) |
|
4933 | self.volOpCebFilter.setCheckState(0) | |
4933 | self.volOpCebProfile.setCheckState(0) |
|
4934 | self.volOpCebProfile.setCheckState(0) | |
4934 | self.volOpCebDecodification.setCheckState(0) |
|
4935 | self.volOpCebDecodification.setCheckState(0) | |
4935 | self.volOpCebCohInt.setCheckState(0) |
|
4936 | self.volOpCebCohInt.setCheckState(0) | |
4936 |
|
4937 | |||
4937 | self.volOpChannel.clear() |
|
4938 | self.volOpChannel.clear() | |
4938 | self.volOpHeights.clear() |
|
4939 | self.volOpHeights.clear() | |
4939 | self.volOpProfile.clear() |
|
4940 | self.volOpProfile.clear() | |
4940 | self.volOpFilter.clear() |
|
4941 | self.volOpFilter.clear() | |
4941 | self.volOpCohInt.clear() |
|
4942 | self.volOpCohInt.clear() | |
4942 | self.volOpRadarfrequency.clear() |
|
4943 | self.volOpRadarfrequency.clear() | |
4943 |
|
4944 | |||
4944 | if datatype == 'Spectra': |
|
4945 | if datatype == 'Spectra': | |
4945 |
|
4946 | |||
4946 | if inputPUObj.datatype == 'Spectra': |
|
4947 | if inputPUObj.datatype == 'Spectra': | |
4947 | self.specOpnFFTpoints.setEnabled(False) |
|
4948 | self.specOpnFFTpoints.setEnabled(False) | |
4948 | self.specOpProfiles.setEnabled(False) |
|
4949 | self.specOpProfiles.setEnabled(False) | |
4949 | self.specOpippFactor.setEnabled(False) |
|
4950 | self.specOpippFactor.setEnabled(False) | |
4950 | else: |
|
4951 | else: | |
4951 | self.specOpnFFTpoints.setEnabled(True) |
|
4952 | self.specOpnFFTpoints.setEnabled(True) | |
4952 | self.specOpProfiles.setEnabled(True) |
|
4953 | self.specOpProfiles.setEnabled(True) | |
4953 | self.specOpippFactor.setEnabled(True) |
|
4954 | self.specOpippFactor.setEnabled(True) | |
4954 |
|
4955 | |||
4955 | self.specOpCebCrossSpectra.setCheckState(0) |
|
4956 | self.specOpCebCrossSpectra.setCheckState(0) | |
4956 | self.specOpCebChannel.setCheckState(0) |
|
4957 | self.specOpCebChannel.setCheckState(0) | |
4957 | self.specOpCebHeights.setCheckState(0) |
|
4958 | self.specOpCebHeights.setCheckState(0) | |
4958 | self.specOpCebIncoherent.setCheckState(0) |
|
4959 | self.specOpCebIncoherent.setCheckState(0) | |
4959 | self.specOpCebRemoveDC.setCheckState(0) |
|
4960 | self.specOpCebRemoveDC.setCheckState(0) | |
4960 | self.specOpCebRemoveInt.setCheckState(0) |
|
4961 | self.specOpCebRemoveInt.setCheckState(0) | |
4961 | self.specOpCebgetNoise.setCheckState(0) |
|
4962 | self.specOpCebgetNoise.setCheckState(0) | |
4962 | self.specOpCebRadarfrequency.setCheckState(0) |
|
4963 | self.specOpCebRadarfrequency.setCheckState(0) | |
4963 |
|
4964 | |||
4964 | self.specOpRadarfrequency.setEnabled(False) |
|
4965 | self.specOpRadarfrequency.setEnabled(False) | |
4965 | self.specOppairsList.setEnabled(False) |
|
4966 | self.specOppairsList.setEnabled(False) | |
4966 | self.specOpChannel.setEnabled(False) |
|
4967 | self.specOpChannel.setEnabled(False) | |
4967 | self.specOpHeights.setEnabled(False) |
|
4968 | self.specOpHeights.setEnabled(False) | |
4968 | self.specOpIncoherent.setEnabled(False) |
|
4969 | self.specOpIncoherent.setEnabled(False) | |
4969 | self.specOpgetNoise.setEnabled(False) |
|
4970 | self.specOpgetNoise.setEnabled(False) | |
4970 |
|
4971 | |||
4971 | self.specOpRadarfrequency.clear() |
|
4972 | self.specOpRadarfrequency.clear() | |
4972 | self.specOpnFFTpoints.clear() |
|
4973 | self.specOpnFFTpoints.clear() | |
4973 | self.specOpProfiles.clear() |
|
4974 | self.specOpProfiles.clear() | |
4974 | self.specOpippFactor.clear |
|
4975 | self.specOpippFactor.clear | |
4975 | self.specOppairsList.clear() |
|
4976 | self.specOppairsList.clear() | |
4976 | self.specOpChannel.clear() |
|
4977 | self.specOpChannel.clear() | |
4977 | self.specOpHeights.clear() |
|
4978 | self.specOpHeights.clear() | |
4978 | self.specOpIncoherent.clear() |
|
4979 | self.specOpIncoherent.clear() | |
4979 | self.specOpgetNoise.clear() |
|
4980 | self.specOpgetNoise.clear() | |
4980 |
|
4981 | |||
4981 | self.specGraphCebSpectraplot.setCheckState(0) |
|
4982 | self.specGraphCebSpectraplot.setCheckState(0) | |
4982 | self.specGraphCebCrossSpectraplot.setCheckState(0) |
|
4983 | self.specGraphCebCrossSpectraplot.setCheckState(0) | |
4983 | self.specGraphCebRTIplot.setCheckState(0) |
|
4984 | self.specGraphCebRTIplot.setCheckState(0) | |
4984 | self.specGraphCebRTInoise.setCheckState(0) |
|
4985 | self.specGraphCebRTInoise.setCheckState(0) | |
4985 | self.specGraphCebCoherencmap.setCheckState(0) |
|
4986 | self.specGraphCebCoherencmap.setCheckState(0) | |
4986 | self.specGraphPowerprofile.setCheckState(0) |
|
4987 | self.specGraphPowerprofile.setCheckState(0) | |
4987 |
|
4988 | |||
4988 | self.specGraphSaveSpectra.setCheckState(0) |
|
4989 | self.specGraphSaveSpectra.setCheckState(0) | |
4989 | self.specGraphSaveCross.setCheckState(0) |
|
4990 | self.specGraphSaveCross.setCheckState(0) | |
4990 | self.specGraphSaveRTIplot.setCheckState(0) |
|
4991 | self.specGraphSaveRTIplot.setCheckState(0) | |
4991 | self.specGraphSaveRTInoise.setCheckState(0) |
|
4992 | self.specGraphSaveRTInoise.setCheckState(0) | |
4992 | self.specGraphSaveCoherencemap.setCheckState(0) |
|
4993 | self.specGraphSaveCoherencemap.setCheckState(0) | |
4993 | self.specGraphSavePowerprofile.setCheckState(0) |
|
4994 | self.specGraphSavePowerprofile.setCheckState(0) | |
4994 |
|
4995 | |||
4995 | self.specGraphftpRTIplot.setCheckState(0) |
|
4996 | self.specGraphftpRTIplot.setCheckState(0) | |
4996 | self.specGraphftpRTInoise.setCheckState(0) |
|
4997 | self.specGraphftpRTInoise.setCheckState(0) | |
4997 | self.specGraphftpCoherencemap.setCheckState(0) |
|
4998 | self.specGraphftpCoherencemap.setCheckState(0) | |
4998 |
|
4999 | |||
4999 | self.specGraphPath.clear() |
|
5000 | self.specGraphPath.clear() | |
5000 | self.specGraphPrefix.clear() |
|
5001 | self.specGraphPrefix.clear() | |
5001 |
|
5002 | |||
5002 | self.specGgraphftpratio.clear() |
|
5003 | self.specGgraphftpratio.clear() | |
5003 |
|
5004 | |||
5004 | self.specGgraphChannelList.clear() |
|
5005 | self.specGgraphChannelList.clear() | |
5005 | self.specGgraphFreq.clear() |
|
5006 | self.specGgraphFreq.clear() | |
5006 | self.specGgraphHeight.clear() |
|
5007 | self.specGgraphHeight.clear() | |
5007 | self.specGgraphDbsrange.clear() |
|
5008 | self.specGgraphDbsrange.clear() | |
5008 | self.specGgraphmagnitud.clear() |
|
5009 | self.specGgraphmagnitud.clear() | |
5009 | self.specGgraphTminTmax.clear() |
|
5010 | self.specGgraphTminTmax.clear() | |
5010 | self.specGgraphTimeRange.clear() |
|
5011 | self.specGgraphTimeRange.clear() | |
5011 |
|
5012 | |||
5012 | if datatype == 'SpectraHeis': |
|
5013 | if datatype == 'SpectraHeis': | |
5013 | self.specHeisOpCebIncoherent.setCheckState(0) |
|
5014 | self.specHeisOpCebIncoherent.setCheckState(0) | |
5014 | self.specHeisOpIncoherent.setEnabled(False) |
|
5015 | self.specHeisOpIncoherent.setEnabled(False) | |
5015 | self.specHeisOpIncoherent.clear() |
|
5016 | self.specHeisOpIncoherent.clear() | |
5016 |
|
5017 | |||
5017 | self.specHeisGraphCebSpectraplot.setCheckState(0) |
|
5018 | self.specHeisGraphCebSpectraplot.setCheckState(0) | |
5018 | self.specHeisGraphCebRTIplot.setCheckState(0) |
|
5019 | self.specHeisGraphCebRTIplot.setCheckState(0) | |
5019 |
|
5020 | |||
5020 | self.specHeisGraphSaveSpectra.setCheckState(0) |
|
5021 | self.specHeisGraphSaveSpectra.setCheckState(0) | |
5021 | self.specHeisGraphSaveRTIplot.setCheckState(0) |
|
5022 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
5022 |
|
5023 | |||
5023 | self.specHeisGraphftpSpectra.setCheckState(0) |
|
5024 | self.specHeisGraphftpSpectra.setCheckState(0) | |
5024 | self.specHeisGraphftpRTIplot.setCheckState(0) |
|
5025 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
5025 |
|
5026 | |||
5026 | self.specHeisGraphPath.clear() |
|
5027 | self.specHeisGraphPath.clear() | |
5027 | self.specHeisGraphPrefix.clear() |
|
5028 | self.specHeisGraphPrefix.clear() | |
5028 | self.specHeisGgraphChannelList.clear() |
|
5029 | self.specHeisGgraphChannelList.clear() | |
5029 | self.specHeisGgraphXminXmax.clear() |
|
5030 | self.specHeisGgraphXminXmax.clear() | |
5030 | self.specHeisGgraphYminYmax.clear() |
|
5031 | self.specHeisGgraphYminYmax.clear() | |
5031 | self.specHeisGgraphTminTmax.clear() |
|
5032 | self.specHeisGgraphTminTmax.clear() | |
5032 | self.specHeisGgraphTimeRange.clear() |
|
5033 | self.specHeisGgraphTimeRange.clear() | |
5033 | self.specHeisGgraphftpratio.clear() |
|
5034 | self.specHeisGgraphftpratio.clear() | |
5034 |
|
5035 | |||
5035 | def showtabPUCreated(self, datatype): |
|
5036 | def showtabPUCreated(self, datatype): | |
5036 |
|
5037 | |||
5037 | if datatype == "Voltage": |
|
5038 | if datatype == "Voltage": | |
5038 | self.tabVoltage.setEnabled(True) |
|
5039 | self.tabVoltage.setEnabled(True) | |
5039 | self.tabProject.setEnabled(False) |
|
5040 | self.tabProject.setEnabled(False) | |
5040 | self.tabSpectra.setEnabled(False) |
|
5041 | self.tabSpectra.setEnabled(False) | |
5041 | self.tabCorrelation.setEnabled(False) |
|
5042 | self.tabCorrelation.setEnabled(False) | |
5042 | self.tabSpectraHeis.setEnabled(False) |
|
5043 | self.tabSpectraHeis.setEnabled(False) | |
5043 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) |
|
5044 | self.tabWidgetProject.setCurrentWidget(self.tabVoltage) | |
5044 |
|
5045 | |||
5045 | if datatype == "Spectra": |
|
5046 | if datatype == "Spectra": | |
5046 | self.tabVoltage.setEnabled(False) |
|
5047 | self.tabVoltage.setEnabled(False) | |
5047 | self.tabProject.setEnabled(False) |
|
5048 | self.tabProject.setEnabled(False) | |
5048 | self.tabSpectra.setEnabled(True) |
|
5049 | self.tabSpectra.setEnabled(True) | |
5049 | self.tabCorrelation.setEnabled(False) |
|
5050 | self.tabCorrelation.setEnabled(False) | |
5050 | self.tabSpectraHeis.setEnabled(False) |
|
5051 | self.tabSpectraHeis.setEnabled(False) | |
5051 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) |
|
5052 | self.tabWidgetProject.setCurrentWidget(self.tabSpectra) | |
5052 |
|
5053 | |||
5053 | if datatype == "SpectraHeis": |
|
5054 | if datatype == "SpectraHeis": | |
5054 | self.tabVoltage.setEnabled(False) |
|
5055 | self.tabVoltage.setEnabled(False) | |
5055 | self.tabProject.setEnabled(False) |
|
5056 | self.tabProject.setEnabled(False) | |
5056 | self.tabSpectra.setEnabled(False) |
|
5057 | self.tabSpectra.setEnabled(False) | |
5057 | self.tabCorrelation.setEnabled(False) |
|
5058 | self.tabCorrelation.setEnabled(False) | |
5058 | self.tabSpectraHeis.setEnabled(True) |
|
5059 | self.tabSpectraHeis.setEnabled(True) | |
5059 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) |
|
5060 | self.tabWidgetProject.setCurrentWidget(self.tabSpectraHeis) | |
5060 |
|
5061 | |||
5061 | def checkInputsProject(self): |
|
5062 | def checkInputsProject(self): | |
5062 | """ |
|
5063 | """ | |
5063 | Check Inputs Project: |
|
5064 | Check Inputs Project: | |
5064 | - project_name |
|
5065 | - project_name | |
5065 | - datatype |
|
5066 | - datatype | |
5066 | - ext |
|
5067 | - ext | |
5067 | - data_path |
|
5068 | - data_path | |
5068 | - readmode |
|
5069 | - readmode | |
5069 | - delay |
|
5070 | - delay | |
5070 | - set |
|
5071 | - set | |
5071 | - walk |
|
5072 | - walk | |
5072 | """ |
|
5073 | """ | |
5073 | parms_ok = True |
|
5074 | parms_ok = True | |
5074 | project_name = str(self.proName.text()) |
|
5075 | project_name = str(self.proName.text()) | |
5075 | if project_name == '' or project_name == None: |
|
5076 | if project_name == '' or project_name == None: | |
5076 | outputstr = "Enter the Project Name" |
|
5077 | outputstr = "Enter the Project Name" | |
5077 | self.console.append(outputstr) |
|
5078 | self.console.append(outputstr) | |
5078 | parms_ok = False |
|
5079 | parms_ok = False | |
5079 | project_name = None |
|
5080 | project_name = None | |
5080 |
|
5081 | |||
5081 | datatype = str(self.proComDataType.currentText()) |
|
5082 | datatype = str(self.proComDataType.currentText()) | |
5082 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): |
|
5083 | if not(datatype in ['Voltage', 'Spectra', 'Fits', 'USRP']): | |
5083 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype |
|
5084 | outputstr = 'datatype = %s, this must be either Voltage, Spectra, SpectraHeis or USRP' % datatype | |
5084 | self.console.append(outputstr) |
|
5085 | self.console.append(outputstr) | |
5085 | parms_ok = False |
|
5086 | parms_ok = False | |
5086 | datatype = None |
|
5087 | datatype = None | |
5087 |
|
5088 | |||
5088 | ext = str(self.proDataType.text()) |
|
5089 | ext = str(self.proDataType.text()) | |
5089 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): |
|
5090 | if not(ext in ['.r', '.pdata', '.fits', '.hdf5']): | |
5090 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" |
|
5091 | outputstr = "extension files must be .r , .pdata, .fits or .hdf5" | |
5091 | self.console.append(outputstr) |
|
5092 | self.console.append(outputstr) | |
5092 | parms_ok = False |
|
5093 | parms_ok = False | |
5093 | ext = None |
|
5094 | ext = None | |
5094 |
|
5095 | |||
5095 | data_path = str(self.proDataPath.text()) |
|
5096 | data_path = str(self.proDataPath.text()) | |
5096 |
|
5097 | |||
5097 | if data_path == '': |
|
5098 | if data_path == '': | |
5098 | outputstr = 'Datapath is empty' |
|
5099 | outputstr = 'Datapath is empty' | |
5099 | self.console.append(outputstr) |
|
5100 | self.console.append(outputstr) | |
5100 | parms_ok = False |
|
5101 | parms_ok = False | |
5101 | data_path = None |
|
5102 | data_path = None | |
5102 |
|
5103 | |||
5103 | if data_path != None: |
|
5104 | if data_path != None: | |
5104 | if not os.path.isdir(data_path): |
|
5105 | if not os.path.isdir(data_path): | |
5105 | outputstr = 'Datapath:%s does not exists' % data_path |
|
5106 | outputstr = 'Datapath:%s does not exists' % data_path | |
5106 | self.console.append(outputstr) |
|
5107 | self.console.append(outputstr) | |
5107 | parms_ok = False |
|
5108 | parms_ok = False | |
5108 | data_path = None |
|
5109 | data_path = None | |
5109 |
|
5110 | |||
5110 | read_mode = str(self.proComReadMode.currentText()) |
|
5111 | read_mode = str(self.proComReadMode.currentText()) | |
5111 | if not(read_mode in ['Online', 'Offline']): |
|
5112 | if not(read_mode in ['Online', 'Offline']): | |
5112 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode |
|
5113 | outputstr = 'Read Mode: %s, this must be either Online or Offline' % read_mode | |
5113 | self.console.append(outputstr) |
|
5114 | self.console.append(outputstr) | |
5114 | parms_ok = False |
|
5115 | parms_ok = False | |
5115 | read_mode = None |
|
5116 | read_mode = None | |
5116 |
|
5117 | |||
5117 | delay = None |
|
5118 | delay = None | |
5118 | if read_mode == "Online": |
|
5119 | if read_mode == "Online": | |
5119 | parms_ok = False |
|
5120 | parms_ok = False | |
5120 | try: |
|
5121 | try: | |
5121 | delay = int(str(self.proDelay.text())) |
|
5122 | delay = int(str(self.proDelay.text())) | |
5122 | parms_ok = True |
|
5123 | parms_ok = True | |
5123 | except: |
|
5124 | except: | |
5124 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) |
|
5125 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
5125 | self.console.append(outputstr) |
|
5126 | self.console.append(outputstr) | |
5126 |
|
5127 | |||
5127 | try: |
|
5128 | try: | |
5128 | set = int(str(self.proSet.text())) |
|
5129 | set = int(str(self.proSet.text())) | |
5129 | except: |
|
5130 | except: | |
5130 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) |
|
5131 | # outputstr = 'Set: %s, this must be a integer number' % str(self.proName.text()) | |
5131 | # self.console.append(outputstr) |
|
5132 | # self.console.append(outputstr) | |
5132 | # parms_ok = False |
|
5133 | # parms_ok = False | |
5133 | set = None |
|
5134 | set = None | |
5134 |
|
5135 | |||
5135 | walk = int(self.proComWalk.currentIndex()) |
|
5136 | walk = int(self.proComWalk.currentIndex()) | |
5136 | expLabel = str(self.proExpLabel.text()) |
|
5137 | expLabel = str(self.proExpLabel.text()) | |
5137 |
|
5138 | |||
5138 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel |
|
5139 | return parms_ok, project_name, datatype, ext, data_path, read_mode, delay, walk, set, expLabel | |
5139 |
|
5140 | |||
5140 | def checkInputsPUSave(self, datatype): |
|
5141 | def checkInputsPUSave(self, datatype): | |
5141 | """ |
|
5142 | """ | |
5142 | Check Inputs Spectra Save: |
|
5143 | Check Inputs Spectra Save: | |
5143 | - path |
|
5144 | - path | |
5144 | - blocks Per File |
|
5145 | - blocks Per File | |
5145 | - sufix |
|
5146 | - sufix | |
5146 | - dataformat |
|
5147 | - dataformat | |
5147 | """ |
|
5148 | """ | |
5148 | parms_ok = True |
|
5149 | parms_ok = True | |
5149 |
|
5150 | |||
5150 | if datatype == "Voltage": |
|
5151 | if datatype == "Voltage": | |
5151 | output_path = str(self.volOutputPath.text()) |
|
5152 | output_path = str(self.volOutputPath.text()) | |
5152 | blocksperfile = str(self.volOutputblocksperfile.text()) |
|
5153 | blocksperfile = str(self.volOutputblocksperfile.text()) | |
5153 | profilesperblock = str(self.volOutputprofilesperblock.text()) |
|
5154 | profilesperblock = str(self.volOutputprofilesperblock.text()) | |
5154 |
|
5155 | |||
5155 | if datatype == "Spectra": |
|
5156 | if datatype == "Spectra": | |
5156 | output_path = str(self.specOutputPath.text()) |
|
5157 | output_path = str(self.specOutputPath.text()) | |
5157 | blocksperfile = str(self.specOutputblocksperfile.text()) |
|
5158 | blocksperfile = str(self.specOutputblocksperfile.text()) | |
5158 | profilesperblock = 0 |
|
5159 | profilesperblock = 0 | |
5159 |
|
5160 | |||
5160 | if datatype == "SpectraHeis": |
|
5161 | if datatype == "SpectraHeis": | |
5161 | output_path = str(self.specHeisOutputPath.text()) |
|
5162 | output_path = str(self.specHeisOutputPath.text()) | |
5162 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) |
|
5163 | blocksperfile = str(self.specHeisOutputblocksperfile.text()) | |
5163 | metadata_file = str(self.specHeisOutputMetada.text()) |
|
5164 | metadata_file = str(self.specHeisOutputMetada.text()) | |
5164 |
|
5165 | |||
5165 | if output_path == '': |
|
5166 | if output_path == '': | |
5166 | outputstr = 'Outputpath is empty' |
|
5167 | outputstr = 'Outputpath is empty' | |
5167 | self.console.append(outputstr) |
|
5168 | self.console.append(outputstr) | |
5168 | parms_ok = False |
|
5169 | parms_ok = False | |
5169 |
|
5170 | |||
5170 | if not os.path.isdir(output_path): |
|
5171 | if not os.path.isdir(output_path): | |
5171 | outputstr = 'OutputPath:%s does not exists' % output_path |
|
5172 | outputstr = 'OutputPath:%s does not exists' % output_path | |
5172 | self.console.append(outputstr) |
|
5173 | self.console.append(outputstr) | |
5173 | parms_ok = False |
|
5174 | parms_ok = False | |
5174 |
|
5175 | |||
5175 | try: |
|
5176 | try: | |
5176 | profilesperblock = int(profilesperblock) |
|
5177 | profilesperblock = int(profilesperblock) | |
5177 | except: |
|
5178 | except: | |
5178 | if datatype == "Voltage": |
|
5179 | if datatype == "Voltage": | |
5179 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) |
|
5180 | outputstr = 'Profilesperblock: %s, this must be a integer number' % str(self.volOutputprofilesperblock.text()) | |
5180 | self.console.append(outputstr) |
|
5181 | self.console.append(outputstr) | |
5181 | parms_ok = False |
|
5182 | parms_ok = False | |
5182 | profilesperblock = None |
|
5183 | profilesperblock = None | |
5183 |
|
5184 | |||
5184 | try: |
|
5185 | try: | |
5185 | blocksperfile = int(blocksperfile) |
|
5186 | blocksperfile = int(blocksperfile) | |
5186 | except: |
|
5187 | except: | |
5187 | if datatype == "Voltage": |
|
5188 | if datatype == "Voltage": | |
5188 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) |
|
5189 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.volOutputblocksperfile.text()) | |
5189 | elif datatype == "Spectra": |
|
5190 | elif datatype == "Spectra": | |
5190 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) |
|
5191 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specOutputblocksperfile.text()) | |
5191 | elif datatype == "SpectraHeis": |
|
5192 | elif datatype == "SpectraHeis": | |
5192 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) |
|
5193 | outputstr = 'Blocksperfile: %s, this must be a integer number' % str(self.specHeisOutputblocksperfile.text()) | |
5193 |
|
5194 | |||
5194 | self.console.append(outputstr) |
|
5195 | self.console.append(outputstr) | |
5195 | parms_ok = False |
|
5196 | parms_ok = False | |
5196 | blocksperfile = None |
|
5197 | blocksperfile = None | |
5197 |
|
5198 | |||
5198 | if datatype == "SpectraHeis": |
|
5199 | if datatype == "SpectraHeis": | |
5199 | if metadata_file != '': |
|
5200 | if metadata_file != '': | |
5200 | if not os.path.isfile(metadata_file): |
|
5201 | if not os.path.isfile(metadata_file): | |
5201 | outputstr = 'Metadata file %s does not exist' % metadata_file |
|
5202 | outputstr = 'Metadata file %s does not exist' % metadata_file | |
5202 | self.console.append(outputstr) |
|
5203 | self.console.append(outputstr) | |
5203 | parms_ok = False |
|
5204 | parms_ok = False | |
5204 |
|
5205 | |||
5205 | if datatype == "Voltage": |
|
5206 | if datatype == "Voltage": | |
5206 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5207 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5207 |
|
5208 | |||
5208 |
|
5209 | |||
5209 | if datatype == "Spectra": |
|
5210 | if datatype == "Spectra": | |
5210 | return parms_ok, output_path, blocksperfile, profilesperblock |
|
5211 | return parms_ok, output_path, blocksperfile, profilesperblock | |
5211 |
|
5212 | |||
5212 |
|
5213 | |||
5213 | if datatype == "SpectraHeis": |
|
5214 | if datatype == "SpectraHeis": | |
5214 | return parms_ok, output_path, blocksperfile, metadata_file |
|
5215 | return parms_ok, output_path, blocksperfile, metadata_file | |
5215 |
|
5216 | |||
5216 | def findDatafiles(self, data_path, ext, walk, expLabel=''): |
|
5217 | def findDatafiles(self, data_path, ext, walk, expLabel=''): | |
5217 |
|
5218 | |||
5218 | dateList = [] |
|
5219 | dateList = [] | |
5219 | fileList = [] |
|
5220 | fileList = [] | |
5220 |
|
5221 | |||
5221 | if ext == ".r": |
|
5222 | if ext == ".r": | |
5222 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5223 | from schainpy.model.io.jroIO_base import JRODataReader | |
5223 |
|
5224 | |||
5224 | readerObj = JRODataReader() |
|
5225 | readerObj = JRODataReader() | |
5225 | dateList = readerObj.findDatafiles(path=data_path, |
|
5226 | dateList = readerObj.findDatafiles(path=data_path, | |
5226 | expLabel=expLabel, |
|
5227 | expLabel=expLabel, | |
5227 | ext=ext, |
|
5228 | ext=ext, | |
5228 | walk=walk) |
|
5229 | walk=walk) | |
5229 |
|
5230 | |||
5230 | if ext == ".pdata": |
|
5231 | if ext == ".pdata": | |
5231 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5232 | from schainpy.model.io.jroIO_base import JRODataReader | |
5232 |
|
5233 | |||
5233 | readerObj = JRODataReader() |
|
5234 | readerObj = JRODataReader() | |
5234 | dateList = readerObj.findDatafiles(path=data_path, |
|
5235 | dateList = readerObj.findDatafiles(path=data_path, | |
5235 | expLabel=expLabel, |
|
5236 | expLabel=expLabel, | |
5236 | ext=ext, |
|
5237 | ext=ext, | |
5237 | walk=walk) |
|
5238 | walk=walk) | |
5238 |
|
5239 | |||
5239 | if ext == ".fits": |
|
5240 | if ext == ".fits": | |
5240 | from schainpy.model.io.jroIO_base import JRODataReader |
|
5241 | from schainpy.model.io.jroIO_base import JRODataReader | |
5241 |
|
5242 | |||
5242 | readerObj = JRODataReader() |
|
5243 | readerObj = JRODataReader() | |
5243 | dateList = readerObj.findDatafiles(path=data_path, |
|
5244 | dateList = readerObj.findDatafiles(path=data_path, | |
5244 | expLabel=expLabel, |
|
5245 | expLabel=expLabel, | |
5245 | ext=ext, |
|
5246 | ext=ext, | |
5246 | walk=walk) |
|
5247 | walk=walk) | |
5247 |
|
5248 | |||
5248 | if ext == ".hdf5": |
|
5249 | if ext == ".hdf5": | |
5249 | from schainpy.model.io.jroIO_usrp import USRPReader |
|
5250 | from schainpy.model.io.jroIO_usrp import USRPReader | |
5250 |
|
5251 | |||
5251 | readerObj = USRPReader() |
|
5252 | readerObj = USRPReader() | |
5252 | dateList = readerObj.findDatafiles(path=data_path) |
|
5253 | dateList = readerObj.findDatafiles(path=data_path) | |
5253 |
|
5254 | |||
5254 | return dateList |
|
5255 | return dateList | |
5255 |
|
5256 | |||
5256 | def loadDays(self, data_path, ext, walk, expLabel=''): |
|
5257 | def loadDays(self, data_path, ext, walk, expLabel=''): | |
5257 | """ |
|
5258 | """ | |
5258 | Method to loads day |
|
5259 | Method to loads day | |
5259 | """ |
|
5260 | """ | |
5260 | self._disable_save_button() |
|
5261 | # self._disable_save_button() | |
5261 | self._disable_play_button() |
|
5262 | # self._disable_play_button() | |
5262 | self.proOk.setEnabled(False) |
|
5263 | # self.proOk.setEnabled(False) | |
5263 |
|
5264 | |||
5264 | self.proComStartDate.clear() |
|
5265 | self.proComStartDate.clear() | |
5265 | self.proComEndDate.clear() |
|
5266 | self.proComEndDate.clear() | |
5266 |
|
5267 | |||
5267 | self.dateList = [] |
|
5268 | self.dateList = [] | |
5268 |
|
5269 | |||
5269 | if not data_path: |
|
5270 | if not data_path: | |
5270 | return [] |
|
5271 | return [] | |
5271 |
|
5272 | |||
5272 | if not os.path.isdir(data_path): |
|
5273 | if not os.path.isdir(data_path): | |
5273 | return [] |
|
5274 | return [] | |
5274 |
|
5275 | |||
5275 | self.dataPath = data_path |
|
5276 | self.dataPath = data_path | |
5276 |
|
5277 | |||
5277 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
5278 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) | |
5278 |
|
5279 | |||
5279 | if not dateList: |
|
5280 | if not dateList: | |
5280 | # self.console.clear() |
|
5281 | # self.console.clear() | |
5281 | if walk: |
|
5282 | if walk: | |
5282 | if expLabel: |
|
5283 | if expLabel: | |
5283 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) |
|
5284 | outputstr = "No files (*%s) were found on %s/DOYPATH/%s" % (ext, data_path, expLabel) | |
5284 | else: |
|
5285 | else: | |
5285 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5286 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5286 | else: |
|
5287 | else: | |
5287 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) |
|
5288 | outputstr = "No files (*%s) were found on %s" % (ext, data_path) | |
5288 |
|
5289 | |||
5289 | self.console.append(outputstr) |
|
5290 | self.console.append(outputstr) | |
5290 | return [] |
|
5291 | return [] | |
5291 |
|
5292 | |||
5292 | dateStrList = [] |
|
5293 | dateStrList = [] | |
5293 | for thisDate in dateList: |
|
5294 | for thisDate in dateList: | |
5294 | dateStr = thisDate.strftime("%Y/%m/%d") |
|
5295 | dateStr = thisDate.strftime("%Y/%m/%d") | |
5295 |
|
5296 | |||
5296 | self.proComStartDate.addItem(dateStr) |
|
5297 | self.proComStartDate.addItem(dateStr) | |
5297 | self.proComEndDate.addItem(dateStr) |
|
5298 | self.proComEndDate.addItem(dateStr) | |
5298 | dateStrList.append(dateStr) |
|
5299 | dateStrList.append(dateStr) | |
5299 |
|
5300 | |||
5300 | self.proComStartDate.setCurrentIndex(0) |
|
5301 | self.proComStartDate.setCurrentIndex(0) | |
5301 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) |
|
5302 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
5302 |
|
5303 | |||
5303 | self.dateList = dateStrList |
|
5304 | self.dateList = dateStrList | |
5304 |
|
5305 | |||
5305 | self.console.clear() |
|
5306 | self.console.clear() | |
5306 | self.console.append("Successful load") |
|
5307 | self.console.append("Successful load") | |
5307 |
|
5308 | |||
5308 | self.proOk.setEnabled(True) |
|
5309 | # self.proOk.setEnabled(True) | |
5309 | self._enable_play_button() |
|
5310 | # self._enable_play_button() | |
5310 | self._enable_save_button() |
|
5311 | # self._enable_save_button() | |
5311 |
|
5312 | |||
5312 | return self.dateList |
|
5313 | return self.dateList | |
5313 |
|
5314 | |||
5314 | def setWorkSpaceGUI(self, pathWorkSpace=None): |
|
5315 | def setWorkSpaceGUI(self, pathWorkSpace=None): | |
5315 |
|
5316 | |||
5316 | if pathWorkSpace == None: |
|
5317 | if pathWorkSpace == None: | |
5317 | home = os.path.expanduser("~") |
|
5318 | home = os.path.expanduser("~") | |
5318 | pathWorkSpace = os.path.join(home,'schain_workspace') |
|
5319 | pathWorkSpace = os.path.join(home,'schain_workspace') | |
5319 |
|
5320 | |||
5320 | self.pathWorkSpace = pathWorkSpace |
|
5321 | self.pathWorkSpace = pathWorkSpace | |
5321 |
|
5322 | |||
5322 | """ |
|
5323 | """ | |
5323 | Comandos Usados en Console |
|
5324 | Comandos Usados en Console | |
5324 | """ |
|
5325 | """ | |
5325 | def __del__(self): |
|
5326 | def __del__(self): | |
5326 | sys.stdout = sys.__stdout__ |
|
5327 | sys.stdout = sys.__stdout__ | |
5327 | sys.stderr = sys.__stderr__ |
|
5328 | sys.stderr = sys.__stderr__ | |
5328 |
|
5329 | |||
5329 | def normalOutputWritten(self, text): |
|
5330 | def normalOutputWritten(self, text): | |
5330 | color_black = QtGui.QColor(0,0,0) |
|
5331 | color_black = QtGui.QColor(0,0,0) | |
5331 | self.console.setTextColor(color_black) |
|
5332 | self.console.setTextColor(color_black) | |
5332 | self.console.append(text) |
|
5333 | self.console.append(text) | |
5333 |
|
5334 | |||
5334 | def errorOutputWritten(self, text): |
|
5335 | def errorOutputWritten(self, text): | |
5335 | color_red = QtGui.QColor(255,0,0) |
|
5336 | color_red = QtGui.QColor(255,0,0) | |
5336 | color_black = QtGui.QColor(0,0,0) |
|
5337 | color_black = QtGui.QColor(0,0,0) | |
5337 |
|
5338 | |||
5338 | self.console.setTextColor(color_red) |
|
5339 | self.console.setTextColor(color_red) | |
5339 | self.console.append(text) |
|
5340 | self.console.append(text) | |
5340 | self.console.setTextColor(color_black) |
|
5341 | self.console.setTextColor(color_black) | |
5341 |
|
5342 | |||
5342 | def _enable_save_button(self): |
|
5343 | def _enable_save_button(self): | |
5343 |
|
5344 | |||
5344 | self.actionSaveToolbar.setEnabled(True) |
|
5345 | self.actionSaveToolbar.setEnabled(True) | |
5345 | self.actionSave.setEnabled(True) |
|
5346 | self.actionSave.setEnabled(True) | |
5346 |
|
5347 | |||
5347 | def _disable_save_button(self): |
|
5348 | def _disable_save_button(self): | |
5348 |
|
5349 | |||
5349 | self.actionSaveToolbar.setEnabled(False) |
|
5350 | self.actionSaveToolbar.setEnabled(False) | |
5350 | self.actionSave.setEnabled(False) |
|
5351 | self.actionSave.setEnabled(False) | |
5351 |
|
5352 | |||
5352 | def _enable_play_button(self): |
|
5353 | def _enable_play_button(self): | |
5353 |
|
5354 | |||
5354 | self.actionStart.setEnabled(True) |
|
5355 | self.actionStart.setEnabled(True) | |
5355 | self.actionStarToolbar.setEnabled(True) |
|
5356 | self.actionStarToolbar.setEnabled(True) | |
5356 |
|
5357 | |||
5357 | self.changeStartIcon(started=False) |
|
5358 | self.changeStartIcon(started=False) | |
5358 |
|
5359 | |||
5359 | def _disable_play_button(self): |
|
5360 | def _disable_play_button(self): | |
5360 |
|
5361 | |||
5361 | self.actionStart.setEnabled(False) |
|
5362 | self.actionStart.setEnabled(False) | |
5362 | self.actionStarToolbar.setEnabled(False) |
|
5363 | self.actionStarToolbar.setEnabled(False) | |
5363 |
|
5364 | |||
5364 | self.changeStartIcon(started=True) |
|
5365 | self.changeStartIcon(started=True) | |
5365 |
|
5366 | |||
5366 | def _enable_stop_button(self): |
|
5367 | def _enable_stop_button(self): | |
5367 |
|
5368 | |||
5368 | self.actionPause.setEnabled(True) |
|
5369 | self.actionPause.setEnabled(True) | |
5369 | self.actionStop.setEnabled(True) |
|
5370 | self.actionStop.setEnabled(True) | |
5370 |
|
5371 | |||
5371 | self.actionPauseToolbar.setEnabled(True) |
|
5372 | self.actionPauseToolbar.setEnabled(True) | |
5372 | self.actionStopToolbar.setEnabled(True) |
|
5373 | self.actionStopToolbar.setEnabled(True) | |
5373 |
|
5374 | |||
5374 | self.changePauseIcon(paused=False) |
|
5375 | self.changePauseIcon(paused=False) | |
5375 | self.changeStopIcon(started=True) |
|
5376 | self.changeStopIcon(started=True) | |
5376 |
|
5377 | |||
5377 | def _disable_stop_button(self): |
|
5378 | def _disable_stop_button(self): | |
5378 |
|
5379 | |||
5379 | self.actionPause.setEnabled(False) |
|
5380 | self.actionPause.setEnabled(False) | |
5380 | self.actionStop.setEnabled(False) |
|
5381 | self.actionStop.setEnabled(False) | |
5381 |
|
5382 | |||
5382 | self.actionPauseToolbar.setEnabled(False) |
|
5383 | self.actionPauseToolbar.setEnabled(False) | |
5383 | self.actionStopToolbar.setEnabled(False) |
|
5384 | self.actionStopToolbar.setEnabled(False) | |
5384 |
|
5385 | |||
5385 | self.changePauseIcon(paused=False) |
|
5386 | self.changePauseIcon(paused=False) | |
5386 | self.changeStopIcon(started=False) |
|
5387 | self.changeStopIcon(started=False) | |
5387 |
|
5388 | |||
5388 | def setGUIStatus(self): |
|
5389 | def setGUIStatus(self): | |
5389 |
|
5390 | |||
5390 | self.setWindowTitle("ROJ-Signal Chain") |
|
5391 | self.setWindowTitle("ROJ-Signal Chain") | |
5391 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) |
|
5392 | self.setWindowIcon(QtGui.QIcon( os.path.join(FIGURES_PATH,"logo.png") )) | |
5392 |
|
5393 | |||
5393 | self.tabWidgetProject.setEnabled(False) |
|
5394 | self.tabWidgetProject.setEnabled(False) | |
5394 | self.tabVoltage.setEnabled(False) |
|
5395 | self.tabVoltage.setEnabled(False) | |
5395 | self.tabSpectra.setEnabled(False) |
|
5396 | self.tabSpectra.setEnabled(False) | |
5396 | self.tabCorrelation.setEnabled(False) |
|
5397 | self.tabCorrelation.setEnabled(False) | |
5397 | self.frame_2.setEnabled(False) |
|
5398 | self.frame_2.setEnabled(False) | |
5398 |
|
5399 | |||
5399 | self.actionCreate.setShortcut('Ctrl+N') |
|
5400 | self.actionCreate.setShortcut('Ctrl+N') | |
5400 | self.actionOpen.setShortcut('Ctrl+O') |
|
5401 | self.actionOpen.setShortcut('Ctrl+O') | |
5401 | self.actionSave.setShortcut('Ctrl+S') |
|
5402 | self.actionSave.setShortcut('Ctrl+S') | |
5402 | self.actionClose.setShortcut('Ctrl+X') |
|
5403 | self.actionClose.setShortcut('Ctrl+X') | |
5403 |
|
5404 | |||
5404 | self.actionStart.setShortcut('Ctrl+1') |
|
5405 | self.actionStart.setShortcut('Ctrl+1') | |
5405 | self.actionPause.setShortcut('Ctrl+2') |
|
5406 | self.actionPause.setShortcut('Ctrl+2') | |
5406 | self.actionStop.setShortcut('Ctrl+3') |
|
5407 | self.actionStop.setShortcut('Ctrl+3') | |
5407 |
|
5408 | |||
5408 | self.actionFTP.setShortcut('Ctrl+F') |
|
5409 | self.actionFTP.setShortcut('Ctrl+F') | |
5409 |
|
5410 | |||
5410 | self.actionStart.setEnabled(False) |
|
5411 | self.actionStart.setEnabled(False) | |
5411 | self.actionPause.setEnabled(False) |
|
5412 | self.actionPause.setEnabled(False) | |
5412 | self.actionStop.setEnabled(False) |
|
5413 | self.actionStop.setEnabled(False) | |
5413 |
|
5414 | |||
5414 | self.actionStarToolbar.setEnabled(False) |
|
5415 | self.actionStarToolbar.setEnabled(False) | |
5415 | self.actionPauseToolbar.setEnabled(False) |
|
5416 | self.actionPauseToolbar.setEnabled(False) | |
5416 | self.actionStopToolbar.setEnabled(False) |
|
5417 | self.actionStopToolbar.setEnabled(False) | |
5417 |
|
5418 | |||
5418 | self.proName.clear() |
|
5419 | self.proName.clear() | |
5419 | self.proDataPath.setText('') |
|
5420 | self.proDataPath.setText('') | |
5420 | self.console.setReadOnly(True) |
|
5421 | self.console.setReadOnly(True) | |
5421 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") |
|
5422 | self.console.append("Welcome to Signal Chain\nOpen a project or Create a new one") | |
5422 | self.proStartTime.setDisplayFormat("hh:mm:ss") |
|
5423 | self.proStartTime.setDisplayFormat("hh:mm:ss") | |
5423 | self.proDataType.setEnabled(False) |
|
5424 | self.proDataType.setEnabled(False) | |
5424 | self.time = QtCore.QTime() |
|
5425 | self.time = QtCore.QTime() | |
5425 | self.hour = 0 |
|
5426 | self.hour = 0 | |
5426 | self.min = 0 |
|
5427 | self.min = 0 | |
5427 | self.sec = 0 |
|
5428 | self.sec = 0 | |
5428 | self.proEndTime.setDisplayFormat("hh:mm:ss") |
|
5429 | self.proEndTime.setDisplayFormat("hh:mm:ss") | |
5429 | startTime = "00:00:00" |
|
5430 | startTime = "00:00:00" | |
5430 | endTime = "23:59:59" |
|
5431 | endTime = "23:59:59" | |
5431 | starlist = startTime.split(":") |
|
5432 | starlist = startTime.split(":") | |
5432 | endlist = endTime.split(":") |
|
5433 | endlist = endTime.split(":") | |
5433 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
5434 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
5434 | self.proStartTime.setTime(self.time) |
|
5435 | self.proStartTime.setTime(self.time) | |
5435 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
5436 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
5436 | self.proEndTime.setTime(self.time) |
|
5437 | self.proEndTime.setTime(self.time) | |
5437 | self.proOk.setEnabled(False) |
|
5438 | self.proOk.setEnabled(False) | |
5438 | # set model Project Explorer |
|
5439 | # set model Project Explorer | |
5439 | self.projectExplorerModel = QtGui.QStandardItemModel() |
|
5440 | self.projectExplorerModel = QtGui.QStandardItemModel() | |
5440 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) |
|
5441 | self.projectExplorerModel.setHorizontalHeaderLabels(("Project Explorer",)) | |
5441 | layout = QtGui.QVBoxLayout() |
|
5442 | layout = QtGui.QVBoxLayout() | |
5442 | layout.addWidget(self.projectExplorerTree) |
|
5443 | layout.addWidget(self.projectExplorerTree) | |
5443 | self.projectExplorerTree.setModel(self.projectExplorerModel) |
|
5444 | self.projectExplorerTree.setModel(self.projectExplorerModel) | |
5444 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) |
|
5445 | self.projectExplorerTree.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) | |
5445 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) |
|
5446 | self.projectExplorerTree.customContextMenuRequested.connect(self.on_right_click) | |
5446 | self.projectExplorerTree.clicked.connect(self.on_click) |
|
5447 | self.projectExplorerTree.clicked.connect(self.on_click) | |
5447 | self.projectExplorerTree.expandAll() |
|
5448 | self.projectExplorerTree.expandAll() | |
5448 | # set model Project Properties |
|
5449 | # set model Project Properties | |
5449 |
|
5450 | |||
5450 | self.propertiesModel = TreeModel() |
|
5451 | self.propertiesModel = TreeModel() | |
5451 | self.propertiesModel.initProjectView() |
|
5452 | self.propertiesModel.initProjectView() | |
5452 | self.treeProjectProperties.setModel(self.propertiesModel) |
|
5453 | self.treeProjectProperties.setModel(self.propertiesModel) | |
5453 | self.treeProjectProperties.expandAll() |
|
5454 | self.treeProjectProperties.expandAll() | |
5454 | self.treeProjectProperties.allColumnsShowFocus() |
|
5455 | self.treeProjectProperties.allColumnsShowFocus() | |
5455 | self.treeProjectProperties.resizeColumnToContents(1) |
|
5456 | self.treeProjectProperties.resizeColumnToContents(1) | |
5456 |
|
5457 | |||
5457 | # set Project |
|
5458 | # set Project | |
5458 | self.proExpLabel.setEnabled(True) |
|
5459 | self.proExpLabel.setEnabled(True) | |
5459 | self.proDelay.setEnabled(False) |
|
5460 | self.proDelay.setEnabled(False) | |
5460 | self.proSet.setEnabled(True) |
|
5461 | self.proSet.setEnabled(True) | |
5461 | self.proDataType.setReadOnly(True) |
|
5462 | self.proDataType.setReadOnly(True) | |
5462 |
|
5463 | |||
5463 | # set Operation Voltage |
|
5464 | # set Operation Voltage | |
5464 | self.volOpComChannels.setEnabled(False) |
|
5465 | self.volOpComChannels.setEnabled(False) | |
5465 | self.volOpComHeights.setEnabled(False) |
|
5466 | self.volOpComHeights.setEnabled(False) | |
5466 | self.volOpFilter.setEnabled(False) |
|
5467 | self.volOpFilter.setEnabled(False) | |
5467 | self.volOpComProfile.setEnabled(False) |
|
5468 | self.volOpComProfile.setEnabled(False) | |
5468 | self.volOpComCode.setEnabled(False) |
|
5469 | self.volOpComCode.setEnabled(False) | |
5469 | self.volOpFlip.setEnabled(False) |
|
5470 | self.volOpFlip.setEnabled(False) | |
5470 | self.volOpCohInt.setEnabled(False) |
|
5471 | self.volOpCohInt.setEnabled(False) | |
5471 | self.volOpRadarfrequency.setEnabled(False) |
|
5472 | self.volOpRadarfrequency.setEnabled(False) | |
5472 |
|
5473 | |||
5473 | self.volOpChannel.setEnabled(False) |
|
5474 | self.volOpChannel.setEnabled(False) | |
5474 | self.volOpHeights.setEnabled(False) |
|
5475 | self.volOpHeights.setEnabled(False) | |
5475 | self.volOpProfile.setEnabled(False) |
|
5476 | self.volOpProfile.setEnabled(False) | |
5476 | self.volOpComMode.setEnabled(False) |
|
5477 | self.volOpComMode.setEnabled(False) | |
5477 |
|
5478 | |||
5478 | self.volGraphPath.setEnabled(False) |
|
5479 | self.volGraphPath.setEnabled(False) | |
5479 | self.volGraphPrefix.setEnabled(False) |
|
5480 | self.volGraphPrefix.setEnabled(False) | |
5480 | self.volGraphToolPath.setEnabled(False) |
|
5481 | self.volGraphToolPath.setEnabled(False) | |
5481 |
|
5482 | |||
5482 | # set Graph Voltage |
|
5483 | # set Graph Voltage | |
5483 | self.volGraphChannelList.setEnabled(False) |
|
5484 | self.volGraphChannelList.setEnabled(False) | |
5484 | self.volGraphfreqrange.setEnabled(False) |
|
5485 | self.volGraphfreqrange.setEnabled(False) | |
5485 | self.volGraphHeightrange.setEnabled(False) |
|
5486 | self.volGraphHeightrange.setEnabled(False) | |
5486 |
|
5487 | |||
5487 | # set Operation Spectra |
|
5488 | # set Operation Spectra | |
5488 | self.specOpnFFTpoints.setEnabled(False) |
|
5489 | self.specOpnFFTpoints.setEnabled(False) | |
5489 | self.specOpProfiles.setEnabled(False) |
|
5490 | self.specOpProfiles.setEnabled(False) | |
5490 | self.specOpippFactor.setEnabled(False) |
|
5491 | self.specOpippFactor.setEnabled(False) | |
5491 | self.specOppairsList.setEnabled(False) |
|
5492 | self.specOppairsList.setEnabled(False) | |
5492 | self.specOpComChannel.setEnabled(False) |
|
5493 | self.specOpComChannel.setEnabled(False) | |
5493 | self.specOpComHeights.setEnabled(False) |
|
5494 | self.specOpComHeights.setEnabled(False) | |
5494 | self.specOpIncoherent.setEnabled(False) |
|
5495 | self.specOpIncoherent.setEnabled(False) | |
5495 | self.specOpgetNoise.setEnabled(False) |
|
5496 | self.specOpgetNoise.setEnabled(False) | |
5496 | self.specOpRadarfrequency.setEnabled(False) |
|
5497 | self.specOpRadarfrequency.setEnabled(False) | |
5497 |
|
5498 | |||
5498 |
|
5499 | |||
5499 | self.specOpChannel.setEnabled(False) |
|
5500 | self.specOpChannel.setEnabled(False) | |
5500 | self.specOpHeights.setEnabled(False) |
|
5501 | self.specOpHeights.setEnabled(False) | |
5501 | # set Graph Spectra |
|
5502 | # set Graph Spectra | |
5502 | self.specGgraphChannelList.setEnabled(False) |
|
5503 | self.specGgraphChannelList.setEnabled(False) | |
5503 | self.specGgraphFreq.setEnabled(False) |
|
5504 | self.specGgraphFreq.setEnabled(False) | |
5504 | self.specGgraphHeight.setEnabled(False) |
|
5505 | self.specGgraphHeight.setEnabled(False) | |
5505 | self.specGgraphDbsrange.setEnabled(False) |
|
5506 | self.specGgraphDbsrange.setEnabled(False) | |
5506 | self.specGgraphmagnitud.setEnabled(False) |
|
5507 | self.specGgraphmagnitud.setEnabled(False) | |
5507 | self.specGgraphTminTmax.setEnabled(False) |
|
5508 | self.specGgraphTminTmax.setEnabled(False) | |
5508 | self.specGgraphTimeRange.setEnabled(False) |
|
5509 | self.specGgraphTimeRange.setEnabled(False) | |
5509 | self.specGraphPath.setEnabled(False) |
|
5510 | self.specGraphPath.setEnabled(False) | |
5510 | self.specGraphToolPath.setEnabled(False) |
|
5511 | self.specGraphToolPath.setEnabled(False) | |
5511 | self.specGraphPrefix.setEnabled(False) |
|
5512 | self.specGraphPrefix.setEnabled(False) | |
5512 |
|
5513 | |||
5513 | self.specGgraphftpratio.setEnabled(False) |
|
5514 | self.specGgraphftpratio.setEnabled(False) | |
5514 | # set Operation SpectraHeis |
|
5515 | # set Operation SpectraHeis | |
5515 | self.specHeisOpIncoherent.setEnabled(False) |
|
5516 | self.specHeisOpIncoherent.setEnabled(False) | |
5516 | self.specHeisOpCobIncInt.setEnabled(False) |
|
5517 | self.specHeisOpCobIncInt.setEnabled(False) | |
5517 | # set Graph SpectraHeis |
|
5518 | # set Graph SpectraHeis | |
5518 | self.specHeisGgraphChannelList.setEnabled(False) |
|
5519 | self.specHeisGgraphChannelList.setEnabled(False) | |
5519 | self.specHeisGgraphXminXmax.setEnabled(False) |
|
5520 | self.specHeisGgraphXminXmax.setEnabled(False) | |
5520 | self.specHeisGgraphYminYmax.setEnabled(False) |
|
5521 | self.specHeisGgraphYminYmax.setEnabled(False) | |
5521 | self.specHeisGgraphTminTmax.setEnabled(False) |
|
5522 | self.specHeisGgraphTminTmax.setEnabled(False) | |
5522 | self.specHeisGgraphTimeRange.setEnabled(False) |
|
5523 | self.specHeisGgraphTimeRange.setEnabled(False) | |
5523 | self.specHeisGgraphftpratio.setEnabled(False) |
|
5524 | self.specHeisGgraphftpratio.setEnabled(False) | |
5524 | self.specHeisGraphPath.setEnabled(False) |
|
5525 | self.specHeisGraphPath.setEnabled(False) | |
5525 | self.specHeisGraphPrefix.setEnabled(False) |
|
5526 | self.specHeisGraphPrefix.setEnabled(False) | |
5526 | self.specHeisGraphToolPath.setEnabled(False) |
|
5527 | self.specHeisGraphToolPath.setEnabled(False) | |
5527 |
|
5528 | |||
5528 |
|
5529 | |||
5529 | # tool tip gui |
|
5530 | # tool tip gui | |
5530 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) |
|
5531 | QtGui.QToolTip.setFont(QtGui.QFont('SansSerif', 10)) | |
5531 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') |
|
5532 | self.projectExplorerTree.setToolTip('Right clik to add Project or Unit Process') | |
5532 | # tool tip gui project |
|
5533 | # tool tip gui project | |
5533 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') |
|
5534 | self.proComWalk.setToolTip('<b>On Files</b>:<i>Search file in format .r or pdata</i> <b>On Folders</b>:<i>Search file in a directory DYYYYDOY</i>') | |
5534 | self.proComWalk.setCurrentIndex(0) |
|
5535 | self.proComWalk.setCurrentIndex(0) | |
5535 | # tool tip gui volOp |
|
5536 | # tool tip gui volOp | |
5536 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') |
|
5537 | self.volOpChannel.setToolTip('Example: 1,2,3,4,5') | |
5537 | self.volOpHeights.setToolTip('Example: 90,180') |
|
5538 | self.volOpHeights.setToolTip('Example: 90,180') | |
5538 | self.volOpFilter.setToolTip('Example: 2') |
|
5539 | self.volOpFilter.setToolTip('Example: 2') | |
5539 | self.volOpProfile.setToolTip('Example:0,127') |
|
5540 | self.volOpProfile.setToolTip('Example:0,127') | |
5540 | self.volOpCohInt.setToolTip('Example: 128') |
|
5541 | self.volOpCohInt.setToolTip('Example: 128') | |
5541 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
5542 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') | |
5542 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
5543 | self.volOpOk.setToolTip('If you have finished, please Ok ') | |
5543 | # tool tip gui volGraph |
|
5544 | # tool tip gui volGraph | |
5544 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') |
|
5545 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
5545 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') |
|
5546 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
5546 | # tool tip gui specOp |
|
5547 | # tool tip gui specOp | |
5547 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
5548 | self.specOpnFFTpoints.setToolTip('Example: 128') | |
5548 | self.specOpProfiles.setToolTip('Example: 128') |
|
5549 | self.specOpProfiles.setToolTip('Example: 128') | |
5549 | self.specOpippFactor.setToolTip('Example:1.0') |
|
5550 | self.specOpippFactor.setToolTip('Example:1.0') | |
5550 | self.specOpIncoherent.setToolTip('Example: 10') |
|
5551 | self.specOpIncoherent.setToolTip('Example: 10') | |
5551 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') |
|
5552 | self.specOpgetNoise.setToolTip('Example:20,180,30,120 (minHei,maxHei,minVel,maxVel)') | |
5552 |
|
5553 | |||
5553 | self.specOpChannel.setToolTip('Example: 0,1,2,3') |
|
5554 | self.specOpChannel.setToolTip('Example: 0,1,2,3') | |
5554 | self.specOpHeights.setToolTip('Example: 90,180') |
|
5555 | self.specOpHeights.setToolTip('Example: 90,180') | |
5555 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') |
|
5556 | self.specOppairsList.setToolTip('Example: (0,1),(2,3)') | |
5556 | # tool tip gui specGraph |
|
5557 | # tool tip gui specGraph | |
5557 |
|
5558 | |||
5558 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') |
|
5559 | self.specGgraphChannelList.setToolTip('Example: 0,3,4') | |
5559 | self.specGgraphFreq.setToolTip('Example: -20,20') |
|
5560 | self.specGgraphFreq.setToolTip('Example: -20,20') | |
5560 | self.specGgraphHeight.setToolTip('Example: 100,400') |
|
5561 | self.specGgraphHeight.setToolTip('Example: 100,400') | |
5561 | self.specGgraphDbsrange.setToolTip('Example: 30,170') |
|
5562 | self.specGgraphDbsrange.setToolTip('Example: 30,170') | |
5562 |
|
5563 | |||
5563 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') |
|
5564 | self.specGraphPrefix.setToolTip('Example: EXPERIMENT_NAME') | |
5564 |
|
5565 | |||
5565 |
|
5566 | |||
5566 | self.specHeisOpIncoherent.setToolTip('Example: 10') |
|
5567 | self.specHeisOpIncoherent.setToolTip('Example: 10') | |
5567 |
|
5568 | |||
5568 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') |
|
5569 | self.specHeisGgraphChannelList.setToolTip('Example: 0,2,3') | |
5569 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') |
|
5570 | self.specHeisGgraphXminXmax.setToolTip('Example (Hz): -1000, 1000') | |
5570 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') |
|
5571 | self.specHeisGgraphYminYmax.setToolTip('Example (dB): 5, 35') | |
5571 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') |
|
5572 | self.specHeisGgraphTminTmax.setToolTip('Example (hours): 0, 24') | |
5572 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') |
|
5573 | self.specHeisGgraphTimeRange.setToolTip('Example (hours): 8') | |
5573 |
|
5574 | |||
5574 | self.labelSet.show() |
|
5575 | self.labelSet.show() | |
5575 | self.proSet.show() |
|
5576 | self.proSet.show() | |
5576 |
|
5577 | |||
5577 | self.labelIPPKm.hide() |
|
5578 | self.labelIPPKm.hide() | |
5578 | self.proIPPKm.hide() |
|
5579 | self.proIPPKm.hide() | |
5579 |
|
5580 | |||
5580 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) |
|
5581 | sys.stdout = ShowMeConsole(textWritten=self.normalOutputWritten) | |
5581 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) |
|
5582 | # sys.stderr = ShowMeConsole(textWritten=self.errorOutputWritten) | |
5582 |
|
5583 | |||
5583 |
|
5584 | |||
5584 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): |
|
5585 | class UnitProcessWindow(QMainWindow, Ui_UnitProcess): | |
5585 | """ |
|
5586 | """ | |
5586 | Class documentation goes here. |
|
5587 | Class documentation goes here. | |
5587 | """ |
|
5588 | """ | |
5588 | closed = pyqtSignal() |
|
5589 | closed = pyqtSignal() | |
5589 | create = False |
|
5590 | create = False | |
5590 |
|
5591 | |||
5591 | def __init__(self, parent=None): |
|
5592 | def __init__(self, parent=None): | |
5592 | """ |
|
5593 | """ | |
5593 | Constructor |
|
5594 | Constructor | |
5594 | """ |
|
5595 | """ | |
5595 | QMainWindow.__init__(self, parent) |
|
5596 | QMainWindow.__init__(self, parent) | |
5596 | self.setupUi(self) |
|
5597 | self.setupUi(self) | |
5597 | self.getFromWindow = None |
|
5598 | self.getFromWindow = None | |
5598 | self.getfromWindowList = [] |
|
5599 | self.getfromWindowList = [] | |
5599 | self.dataTypeProject = None |
|
5600 | self.dataTypeProject = None | |
5600 |
|
5601 | |||
5601 | self.listUP = None |
|
5602 | self.listUP = None | |
5602 |
|
5603 | |||
5603 | @pyqtSignature("") |
|
5604 | @pyqtSignature("") | |
5604 | def on_unitPokbut_clicked(self): |
|
5605 | def on_unitPokbut_clicked(self): | |
5605 | """ |
|
5606 | """ | |
5606 | Slot documentation goes here. |
|
5607 | Slot documentation goes here. | |
5607 | """ |
|
5608 | """ | |
5608 | self.create = True |
|
5609 | self.create = True | |
5609 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] |
|
5610 | self.getFromWindow = self.getfromWindowList[int(self.comboInputBox.currentIndex())] | |
5610 | # self.nameofUP= str(self.nameUptxt.text()) |
|
5611 | # self.nameofUP= str(self.nameUptxt.text()) | |
5611 | self.typeofUP = str(self.comboTypeBox.currentText()) |
|
5612 | self.typeofUP = str(self.comboTypeBox.currentText()) | |
5612 | self.close() |
|
5613 | self.close() | |
5613 |
|
5614 | |||
5614 |
|
5615 | |||
5615 | @pyqtSignature("") |
|
5616 | @pyqtSignature("") | |
5616 | def on_unitPcancelbut_clicked(self): |
|
5617 | def on_unitPcancelbut_clicked(self): | |
5617 | """ |
|
5618 | """ | |
5618 | Slot documentation goes here. |
|
5619 | Slot documentation goes here. | |
5619 | """ |
|
5620 | """ | |
5620 | self.create = False |
|
5621 | self.create = False | |
5621 | self.close() |
|
5622 | self.close() | |
5622 |
|
5623 | |||
5623 | def loadTotalList(self): |
|
5624 | def loadTotalList(self): | |
5624 | self.comboInputBox.clear() |
|
5625 | self.comboInputBox.clear() | |
5625 | for i in self.getfromWindowList: |
|
5626 | for i in self.getfromWindowList: | |
5626 |
|
5627 | |||
5627 | name = i.getElementName() |
|
5628 | name = i.getElementName() | |
5628 | if name == 'Project': |
|
5629 | if name == 'Project': | |
5629 | id = i.id |
|
5630 | id = i.id | |
5630 | name = i.name |
|
5631 | name = i.name | |
5631 | if self.dataTypeProject == 'Voltage': |
|
5632 | if self.dataTypeProject == 'Voltage': | |
5632 | self.comboTypeBox.clear() |
|
5633 | self.comboTypeBox.clear() | |
5633 | self.comboTypeBox.addItem("Voltage") |
|
5634 | self.comboTypeBox.addItem("Voltage") | |
5634 |
|
5635 | |||
5635 | if self.dataTypeProject == 'Spectra': |
|
5636 | if self.dataTypeProject == 'Spectra': | |
5636 | self.comboTypeBox.clear() |
|
5637 | self.comboTypeBox.clear() | |
5637 | self.comboTypeBox.addItem("Spectra") |
|
5638 | self.comboTypeBox.addItem("Spectra") | |
5638 | self.comboTypeBox.addItem("Correlation") |
|
5639 | self.comboTypeBox.addItem("Correlation") | |
5639 | if self.dataTypeProject == 'Fits': |
|
5640 | if self.dataTypeProject == 'Fits': | |
5640 | self.comboTypeBox.clear() |
|
5641 | self.comboTypeBox.clear() | |
5641 | self.comboTypeBox.addItem("SpectraHeis") |
|
5642 | self.comboTypeBox.addItem("SpectraHeis") | |
5642 |
|
5643 | |||
5643 |
|
5644 | |||
5644 | if name == 'ProcUnit': |
|
5645 | if name == 'ProcUnit': | |
5645 | id = int(i.id) - 1 |
|
5646 | id = int(i.id) - 1 | |
5646 | name = i.datatype |
|
5647 | name = i.datatype | |
5647 | if name == 'Voltage': |
|
5648 | if name == 'Voltage': | |
5648 | self.comboTypeBox.clear() |
|
5649 | self.comboTypeBox.clear() | |
5649 | self.comboTypeBox.addItem("Spectra") |
|
5650 | self.comboTypeBox.addItem("Spectra") | |
5650 | self.comboTypeBox.addItem("SpectraHeis") |
|
5651 | self.comboTypeBox.addItem("SpectraHeis") | |
5651 | self.comboTypeBox.addItem("Correlation") |
|
5652 | self.comboTypeBox.addItem("Correlation") | |
5652 | if name == 'Spectra': |
|
5653 | if name == 'Spectra': | |
5653 | self.comboTypeBox.clear() |
|
5654 | self.comboTypeBox.clear() | |
5654 | self.comboTypeBox.addItem("Spectra") |
|
5655 | self.comboTypeBox.addItem("Spectra") | |
5655 | self.comboTypeBox.addItem("SpectraHeis") |
|
5656 | self.comboTypeBox.addItem("SpectraHeis") | |
5656 | self.comboTypeBox.addItem("Correlation") |
|
5657 | self.comboTypeBox.addItem("Correlation") | |
5657 | if name == 'SpectraHeis': |
|
5658 | if name == 'SpectraHeis': | |
5658 | self.comboTypeBox.clear() |
|
5659 | self.comboTypeBox.clear() | |
5659 | self.comboTypeBox.addItem("SpectraHeis") |
|
5660 | self.comboTypeBox.addItem("SpectraHeis") | |
5660 |
|
5661 | |||
5661 | self.comboInputBox.addItem(str(name)) |
|
5662 | self.comboInputBox.addItem(str(name)) | |
5662 | # self.comboInputBox.addItem(str(name)+str(id)) |
|
5663 | # self.comboInputBox.addItem(str(name)+str(id)) | |
5663 |
|
5664 | |||
5664 | def closeEvent(self, event): |
|
5665 | def closeEvent(self, event): | |
5665 | self.closed.emit() |
|
5666 | self.closed.emit() | |
5666 | event.accept() |
|
5667 | event.accept() | |
5667 |
|
5668 | |||
5668 | class Ftp(QMainWindow, Ui_Ftp): |
|
5669 | class Ftp(QMainWindow, Ui_Ftp): | |
5669 | """ |
|
5670 | """ | |
5670 | Class documentation goes here. |
|
5671 | Class documentation goes here. | |
5671 | """ |
|
5672 | """ | |
5672 | create = False |
|
5673 | create = False | |
5673 | closed = pyqtSignal() |
|
5674 | closed = pyqtSignal() | |
5674 | server = None |
|
5675 | server = None | |
5675 | remotefolder = None |
|
5676 | remotefolder = None | |
5676 | username = None |
|
5677 | username = None | |
5677 | password = None |
|
5678 | password = None | |
5678 | ftp_wei = None |
|
5679 | ftp_wei = None | |
5679 | exp_code = None |
|
5680 | exp_code = None | |
5680 | sub_exp_code = None |
|
5681 | sub_exp_code = None | |
5681 | plot_pos = None |
|
5682 | plot_pos = None | |
5682 |
|
5683 | |||
5683 | def __init__(self, parent=None): |
|
5684 | def __init__(self, parent=None): | |
5684 | """ |
|
5685 | """ | |
5685 | Constructor |
|
5686 | Constructor | |
5686 | """ |
|
5687 | """ | |
5687 | QMainWindow.__init__(self, parent) |
|
5688 | QMainWindow.__init__(self, parent) | |
5688 | self.setupUi(self) |
|
5689 | self.setupUi(self) | |
5689 | self.setGUIStatus() |
|
5690 | self.setGUIStatus() | |
5690 |
|
5691 | |||
5691 | def setGUIStatus(self): |
|
5692 | def setGUIStatus(self): | |
5692 | self.setWindowTitle("ROJ-Signal Chain") |
|
5693 | self.setWindowTitle("ROJ-Signal Chain") | |
5693 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') |
|
5694 | self.serverFTP.setToolTip('Example: jro-app.igp.gob.pe') | |
5694 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') |
|
5695 | self.folderFTP.setToolTip('Example: /home/wmaster/graficos') | |
5695 | self.usernameFTP.setToolTip('Example: myusername') |
|
5696 | self.usernameFTP.setToolTip('Example: myusername') | |
5696 | self.passwordFTP.setToolTip('Example: mypass ') |
|
5697 | self.passwordFTP.setToolTip('Example: mypass ') | |
5697 | self.weightFTP.setToolTip('Example: 0') |
|
5698 | self.weightFTP.setToolTip('Example: 0') | |
5698 | self.expcodeFTP.setToolTip('Example: 0') |
|
5699 | self.expcodeFTP.setToolTip('Example: 0') | |
5699 | self.subexpFTP.setToolTip('Example: 0') |
|
5700 | self.subexpFTP.setToolTip('Example: 0') | |
5700 | self.plotposFTP.setToolTip('Example: 0') |
|
5701 | self.plotposFTP.setToolTip('Example: 0') | |
5701 |
|
5702 | |||
5702 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): |
|
5703 | def setParmsfromTemporal(self, server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos): | |
5703 | self.serverFTP.setText(str(server)) |
|
5704 | self.serverFTP.setText(str(server)) | |
5704 | self.folderFTP.setText(str(remotefolder)) |
|
5705 | self.folderFTP.setText(str(remotefolder)) | |
5705 | self.usernameFTP.setText(str(username)) |
|
5706 | self.usernameFTP.setText(str(username)) | |
5706 | self.passwordFTP.setText(str(password)) |
|
5707 | self.passwordFTP.setText(str(password)) | |
5707 | self.weightFTP.setText(str(ftp_wei)) |
|
5708 | self.weightFTP.setText(str(ftp_wei)) | |
5708 | self.expcodeFTP.setText(str(exp_code)) |
|
5709 | self.expcodeFTP.setText(str(exp_code)) | |
5709 | self.subexpFTP.setText(str(sub_exp_code)) |
|
5710 | self.subexpFTP.setText(str(sub_exp_code)) | |
5710 | self.plotposFTP.setText(str(plot_pos)) |
|
5711 | self.plotposFTP.setText(str(plot_pos)) | |
5711 |
|
5712 | |||
5712 | def getParmsFromFtpWindow(self): |
|
5713 | def getParmsFromFtpWindow(self): | |
5713 | """ |
|
5714 | """ | |
5714 | Return Inputs Project: |
|
5715 | Return Inputs Project: | |
5715 | - server |
|
5716 | - server | |
5716 | - remotefolder |
|
5717 | - remotefolder | |
5717 | - username |
|
5718 | - username | |
5718 | - password |
|
5719 | - password | |
5719 | - ftp_wei |
|
5720 | - ftp_wei | |
5720 | - exp_code |
|
5721 | - exp_code | |
5721 | - sub_exp_code |
|
5722 | - sub_exp_code | |
5722 | - plot_pos |
|
5723 | - plot_pos | |
5723 | """ |
|
5724 | """ | |
5724 | name_server_ftp = str(self.serverFTP.text()) |
|
5725 | name_server_ftp = str(self.serverFTP.text()) | |
5725 | if not name_server_ftp: |
|
5726 | if not name_server_ftp: | |
5726 | self.console.clear() |
|
5727 | self.console.clear() | |
5727 | self.console.append("Please Write a FTP Server") |
|
5728 | self.console.append("Please Write a FTP Server") | |
5728 | return 0 |
|
5729 | return 0 | |
5729 |
|
5730 | |||
5730 | folder_server_ftp = str(self.folderFTP.text()) |
|
5731 | folder_server_ftp = str(self.folderFTP.text()) | |
5731 | if not folder_server_ftp: |
|
5732 | if not folder_server_ftp: | |
5732 | self.console.clear() |
|
5733 | self.console.clear() | |
5733 | self.console.append("Please Write a Folder") |
|
5734 | self.console.append("Please Write a Folder") | |
5734 | return 0 |
|
5735 | return 0 | |
5735 |
|
5736 | |||
5736 | username_ftp = str(self.usernameFTP.text()) |
|
5737 | username_ftp = str(self.usernameFTP.text()) | |
5737 | if not username_ftp: |
|
5738 | if not username_ftp: | |
5738 | self.console.clear() |
|
5739 | self.console.clear() | |
5739 | self.console.append("Please Write a User Name") |
|
5740 | self.console.append("Please Write a User Name") | |
5740 | return 0 |
|
5741 | return 0 | |
5741 |
|
5742 | |||
5742 | password_ftp = str(self.passwordFTP.text()) |
|
5743 | password_ftp = str(self.passwordFTP.text()) | |
5743 | if not password_ftp: |
|
5744 | if not password_ftp: | |
5744 | self.console.clear() |
|
5745 | self.console.clear() | |
5745 | self.console.append("Please Write a passwordFTP") |
|
5746 | self.console.append("Please Write a passwordFTP") | |
5746 | return 0 |
|
5747 | return 0 | |
5747 |
|
5748 | |||
5748 | ftp_wei = str(self.weightFTP.text()) |
|
5749 | ftp_wei = str(self.weightFTP.text()) | |
5749 | if not ftp_wei == "": |
|
5750 | if not ftp_wei == "": | |
5750 | try: |
|
5751 | try: | |
5751 | ftp_wei = int(self.weightFTP.text()) |
|
5752 | ftp_wei = int(self.weightFTP.text()) | |
5752 | except: |
|
5753 | except: | |
5753 | self.console.clear() |
|
5754 | self.console.clear() | |
5754 | self.console.append("Please Write a ftp_wei number") |
|
5755 | self.console.append("Please Write a ftp_wei number") | |
5755 | return 0 |
|
5756 | return 0 | |
5756 |
|
5757 | |||
5757 | exp_code = str(self.expcodeFTP.text()) |
|
5758 | exp_code = str(self.expcodeFTP.text()) | |
5758 | if not exp_code == "": |
|
5759 | if not exp_code == "": | |
5759 | try: |
|
5760 | try: | |
5760 | exp_code = int(self.expcodeFTP.text()) |
|
5761 | exp_code = int(self.expcodeFTP.text()) | |
5761 | except: |
|
5762 | except: | |
5762 | self.console.clear() |
|
5763 | self.console.clear() | |
5763 | self.console.append("Please Write a exp_code number") |
|
5764 | self.console.append("Please Write a exp_code number") | |
5764 | return 0 |
|
5765 | return 0 | |
5765 |
|
5766 | |||
5766 |
|
5767 | |||
5767 | sub_exp_code = str(self.subexpFTP.text()) |
|
5768 | sub_exp_code = str(self.subexpFTP.text()) | |
5768 | if not sub_exp_code == "": |
|
5769 | if not sub_exp_code == "": | |
5769 | try: |
|
5770 | try: | |
5770 | sub_exp_code = int(self.subexpFTP.text()) |
|
5771 | sub_exp_code = int(self.subexpFTP.text()) | |
5771 | except: |
|
5772 | except: | |
5772 | self.console.clear() |
|
5773 | self.console.clear() | |
5773 | self.console.append("Please Write a sub_exp_code number") |
|
5774 | self.console.append("Please Write a sub_exp_code number") | |
5774 | return 0 |
|
5775 | return 0 | |
5775 |
|
5776 | |||
5776 | plot_pos = str(self.plotposFTP.text()) |
|
5777 | plot_pos = str(self.plotposFTP.text()) | |
5777 | if not plot_pos == "": |
|
5778 | if not plot_pos == "": | |
5778 | try: |
|
5779 | try: | |
5779 | plot_pos = int(self.plotposFTP.text()) |
|
5780 | plot_pos = int(self.plotposFTP.text()) | |
5780 | except: |
|
5781 | except: | |
5781 | self.console.clear() |
|
5782 | self.console.clear() | |
5782 | self.console.append("Please Write a plot_pos number") |
|
5783 | self.console.append("Please Write a plot_pos number") | |
5783 | return 0 |
|
5784 | return 0 | |
5784 |
|
5785 | |||
5785 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos |
|
5786 | return name_server_ftp, folder_server_ftp, username_ftp, password_ftp, ftp_wei, exp_code, sub_exp_code, plot_pos | |
5786 |
|
5787 | |||
5787 | @pyqtSignature("") |
|
5788 | @pyqtSignature("") | |
5788 | def on_ftpOkButton_clicked(self): |
|
5789 | def on_ftpOkButton_clicked(self): | |
5789 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() |
|
5790 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.getParmsFromFtpWindow() | |
5790 | self.create = True |
|
5791 | self.create = True | |
5791 | self.close() |
|
5792 | self.close() | |
5792 |
|
5793 | |||
5793 | @pyqtSignature("") |
|
5794 | @pyqtSignature("") | |
5794 | def on_ftpCancelButton_clicked(self): |
|
5795 | def on_ftpCancelButton_clicked(self): | |
5795 | self.create = False |
|
5796 | self.create = False | |
5796 | self.close() |
|
5797 | self.close() | |
5797 |
|
5798 | |||
5798 | def closeEvent(self, event): |
|
5799 | def closeEvent(self, event): | |
5799 | self.closed.emit() |
|
5800 | self.closed.emit() | |
5800 | event.accept() |
|
5801 | event.accept() | |
5801 |
|
5802 | |||
5802 | class ftpBuffer(): |
|
5803 | class ftpBuffer(): | |
5803 |
|
5804 | |||
5804 | server = None |
|
5805 | server = None | |
5805 | remotefolder = None |
|
5806 | remotefolder = None | |
5806 | username = None |
|
5807 | username = None | |
5807 | password = None |
|
5808 | password = None | |
5808 | ftp_wei = None |
|
5809 | ftp_wei = None | |
5809 | exp_code = None |
|
5810 | exp_code = None | |
5810 | sub_exp_code = None |
|
5811 | sub_exp_code = None | |
5811 | plot_pos = None |
|
5812 | plot_pos = None | |
5812 | create = False |
|
5813 | create = False | |
5813 | withoutconfig = False |
|
5814 | withoutconfig = False | |
5814 | createforView = False |
|
5815 | createforView = False | |
5815 | localfolder = None |
|
5816 | localfolder = None | |
5816 | extension = None |
|
5817 | extension = None | |
5817 | period = None |
|
5818 | period = None | |
5818 | protocol = None |
|
5819 | protocol = None | |
5819 |
|
5820 | |||
5820 | def __init__(self): |
|
5821 | def __init__(self): | |
5821 |
|
5822 | |||
5822 | self.create = False |
|
5823 | self.create = False | |
5823 | self.server = None |
|
5824 | self.server = None | |
5824 | self.remotefolder = None |
|
5825 | self.remotefolder = None | |
5825 | self.username = None |
|
5826 | self.username = None | |
5826 | self.password = None |
|
5827 | self.password = None | |
5827 | self.ftp_wei = None |
|
5828 | self.ftp_wei = None | |
5828 | self.exp_code = None |
|
5829 | self.exp_code = None | |
5829 | self.sub_exp_code = None |
|
5830 | self.sub_exp_code = None | |
5830 | self.plot_pos = None |
|
5831 | self.plot_pos = None | |
5831 | # self.create = False |
|
5832 | # self.create = False | |
5832 | self.localfolder = None |
|
5833 | self.localfolder = None | |
5833 | self.extension = None |
|
5834 | self.extension = None | |
5834 | self.period = None |
|
5835 | self.period = None | |
5835 | self.protocol = None |
|
5836 | self.protocol = None | |
5836 |
|
5837 | |||
5837 | def setwithoutconfiguration(self): |
|
5838 | def setwithoutconfiguration(self): | |
5838 |
|
5839 | |||
5839 | self.create = False |
|
5840 | self.create = False | |
5840 | self.server = "jro-app.igp.gob.pe" |
|
5841 | self.server = "jro-app.igp.gob.pe" | |
5841 | self.remotefolder = "/home/wmaster/graficos" |
|
5842 | self.remotefolder = "/home/wmaster/graficos" | |
5842 | self.username = "wmaster" |
|
5843 | self.username = "wmaster" | |
5843 | self.password = "mst2010vhf" |
|
5844 | self.password = "mst2010vhf" | |
5844 | self.withoutconfig = True |
|
5845 | self.withoutconfig = True | |
5845 | self.localfolder = './' |
|
5846 | self.localfolder = './' | |
5846 | self.extension = '.png' |
|
5847 | self.extension = '.png' | |
5847 | self.period = 60 |
|
5848 | self.period = 60 | |
5848 | self.protocol = 'ftp' |
|
5849 | self.protocol = 'ftp' | |
5849 | self.createforView = True |
|
5850 | self.createforView = True | |
5850 |
|
5851 | |||
5851 | if not self.ftp_wei: |
|
5852 | if not self.ftp_wei: | |
5852 | self.ftp_wei = 0 |
|
5853 | self.ftp_wei = 0 | |
5853 |
|
5854 | |||
5854 | if not self.exp_code: |
|
5855 | if not self.exp_code: | |
5855 | self.exp_code = 0 |
|
5856 | self.exp_code = 0 | |
5856 |
|
5857 | |||
5857 | if not self.sub_exp_code: |
|
5858 | if not self.sub_exp_code: | |
5858 | self.sub_exp_code = 0 |
|
5859 | self.sub_exp_code = 0 | |
5859 |
|
5860 | |||
5860 | if not self.plot_pos: |
|
5861 | if not self.plot_pos: | |
5861 | self.plot_pos = 0 |
|
5862 | self.plot_pos = 0 | |
5862 |
|
5863 | |||
5863 | def save(self, server, remotefolder, username, password, ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, localfolder='./', extension='.png', period=60, protocol='ftp'): |
|
5864 | def save(self, server, remotefolder, username, password, ftp_wei=0, exp_code=0, sub_exp_code=0, plot_pos=0, localfolder='./', extension='.png', period=60, protocol='ftp'): | |
5864 |
|
5865 | |||
5865 | self.server = server |
|
5866 | self.server = server | |
5866 | self.remotefolder = remotefolder |
|
5867 | self.remotefolder = remotefolder | |
5867 | self.username = username |
|
5868 | self.username = username | |
5868 | self.password = password |
|
5869 | self.password = password | |
5869 | self.ftp_wei = ftp_wei |
|
5870 | self.ftp_wei = ftp_wei | |
5870 | self.exp_code = exp_code |
|
5871 | self.exp_code = exp_code | |
5871 | self.sub_exp_code = sub_exp_code |
|
5872 | self.sub_exp_code = sub_exp_code | |
5872 | self.plot_pos = plot_pos |
|
5873 | self.plot_pos = plot_pos | |
5873 | self.create = True |
|
5874 | self.create = True | |
5874 | self.withoutconfig = False |
|
5875 | self.withoutconfig = False | |
5875 | self.createforView = True |
|
5876 | self.createforView = True | |
5876 | self.localfolder = localfolder |
|
5877 | self.localfolder = localfolder | |
5877 | self.extension = extension |
|
5878 | self.extension = extension | |
5878 | self.period = period |
|
5879 | self.period = period | |
5879 | self.protocol = protocol |
|
5880 | self.protocol = protocol | |
5880 |
|
5881 | |||
5881 | def recover(self): |
|
5882 | def recover(self): | |
5882 |
|
5883 | |||
5883 | return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol |
|
5884 | return self.server, self.remotefolder, self.username, self.password, self.ftp_wei, self.exp_code, self.sub_exp_code, self.plot_pos, self.extension, self.period, self.protocol | |
5884 |
|
5885 | |||
5885 | class ShowMeConsole(QtCore.QObject): |
|
5886 | class ShowMeConsole(QtCore.QObject): | |
5886 |
|
5887 | |||
5887 | textWritten = QtCore.pyqtSignal(str) |
|
5888 | textWritten = QtCore.pyqtSignal(str) | |
5888 |
|
5889 | |||
5889 | def write(self, text): |
|
5890 | def write(self, text): | |
5890 |
|
5891 | |||
5891 | if len(text) == 0: |
|
5892 | if len(text) == 0: | |
5892 | self.textWritten.emit("\n") |
|
5893 | self.textWritten.emit("\n") | |
5893 | return |
|
5894 | return | |
5894 |
|
5895 | |||
5895 | if text[-1] == "\n": |
|
5896 | if text[-1] == "\n": | |
5896 | text = text[:-1] |
|
5897 | text = text[:-1] | |
5897 |
|
5898 | |||
5898 | self.textWritten.emit(str(text)) |
|
5899 | self.textWritten.emit(str(text)) |
General Comments 0
You need to be logged in to leave comments.
Login now