@@ -50,6 +50,13 class ParameterConf(): | |||
|
50 | 50 | |
|
51 | 51 | value = self.value |
|
52 | 52 | |
|
53 | if self.format == 'str': | |
|
54 | self.__formated_value = str(value) | |
|
55 | return self.__formated_value | |
|
56 | ||
|
57 | if value == '': | |
|
58 | raise ValueError, "%s: This parameter value is empty" %self.name | |
|
59 | ||
|
53 | 60 | if self.format == 'bool': |
|
54 | 61 | value = int(value) |
|
55 | 62 | |
@@ -65,14 +72,7 class ParameterConf(): | |||
|
65 | 72 | Example: |
|
66 | 73 | value = (0,1,2) |
|
67 | 74 | """ |
|
68 | value = value.replace('(', '') | |
|
69 | value = value.replace(')', '') | |
|
70 | ||
|
71 | value = value.replace('[', '') | |
|
72 | value = value.replace(']', '') | |
|
73 | ||
|
74 | strList = value.split(',') | |
|
75 | intList = [int(x) for x in strList] | |
|
75 | intList = ast.literal_eval(value) | |
|
76 | 76 | |
|
77 | 77 | self.__formated_value = intList |
|
78 | 78 | |
@@ -84,14 +84,7 class ParameterConf(): | |||
|
84 | 84 | value = (0.5, 1.4, 2.7) |
|
85 | 85 | """ |
|
86 | 86 | |
|
87 | value = value.replace('(', '') | |
|
88 | value = value.replace(')', '') | |
|
89 | ||
|
90 | value = value.replace('[', '') | |
|
91 | value = value.replace(']', '') | |
|
92 | ||
|
93 | strList = value.split(',') | |
|
94 | floatList = [float(x) for x in strList] | |
|
87 | floatList = ast.literal_eval(value) | |
|
95 | 88 | |
|
96 | 89 | self.__formated_value = floatList |
|
97 | 90 | |
@@ -121,17 +114,7 class ParameterConf(): | |||
|
121 | 114 | value = (0,1),(1,2) |
|
122 | 115 | """ |
|
123 | 116 | |
|
124 | value = value.replace('(', '') | |
|
125 | value = value.replace(')', '') | |
|
126 | ||
|
127 | value = value.replace('[', '') | |
|
128 | value = value.replace(']', '') | |
|
129 | ||
|
130 | strList = value.split(',') | |
|
131 | intList = [int(item) for item in strList] | |
|
132 | pairList = [] | |
|
133 | for i in range(len(intList)/2): | |
|
134 | pairList.append((intList[i*2], intList[i*2 + 1])) | |
|
117 | pairList = ast.literal_eval(value) | |
|
135 | 118 | |
|
136 | 119 | self.__formated_value = pairList |
|
137 | 120 | |
@@ -154,9 +137,13 class ParameterConf(): | |||
|
154 | 137 | |
|
155 | 138 | return self.__formated_value |
|
156 | 139 | |
|
140 | def updateId(self, new_id): | |
|
141 | ||
|
142 | self.id = str(new_id) | |
|
143 | ||
|
157 | 144 | def setup(self, id, name, value, format='str'): |
|
158 | 145 | |
|
159 | self.id = id | |
|
146 | self.id = str(id) | |
|
160 | 147 | self.name = name |
|
161 | 148 | self.value = str(value) |
|
162 | 149 | self.format = str.lower(format) |
@@ -213,6 +200,18 class OperationConf(): | |||
|
213 | 200 | |
|
214 | 201 | return int(self.id)*10 + len(self.parmConfObjList) + 1 |
|
215 | 202 | |
|
203 | def updateId(self, new_id): | |
|
204 | ||
|
205 | self.id = str(new_id) | |
|
206 | ||
|
207 | n = 1 | |
|
208 | for parmObj in self.parmConfObjList: | |
|
209 | ||
|
210 | idParm = str(int(new_id)*10 + n) | |
|
211 | parmObj.updateId(idParm) | |
|
212 | ||
|
213 | n += 1 | |
|
214 | ||
|
216 | 215 | def getElementName(self): |
|
217 | 216 | |
|
218 | 217 | return self.ELEMENTNAME |
@@ -251,7 +250,7 class OperationConf(): | |||
|
251 | 250 | |
|
252 | 251 | def setup(self, id, name, priority, type): |
|
253 | 252 | |
|
254 | self.id = id | |
|
253 | self.id = str(id) | |
|
255 | 254 | self.name = name |
|
256 | 255 | self.type = type |
|
257 | 256 | self.priority = priority |
@@ -388,6 +387,29 class ProcUnitConf(): | |||
|
388 | 387 | |
|
389 | 388 | return self.id |
|
390 | 389 | |
|
390 | def updateId(self, new_id, parentId=parentId): | |
|
391 | ||
|
392 | ||
|
393 | new_id = int(parentId)*10 + (int(self.id) % 10) | |
|
394 | new_inputId = int(parentId)*10 + (int(self.inputId) % 10) | |
|
395 | ||
|
396 | #If this proc unit has not inputs | |
|
397 | if self.inputId == '0': | |
|
398 | new_inputId = 0 | |
|
399 | ||
|
400 | n = 1 | |
|
401 | for opConfObj in self.opConfObjList: | |
|
402 | ||
|
403 | idOp = str(int(new_id)*10 + n) | |
|
404 | opConfObj.updateId(idOp) | |
|
405 | ||
|
406 | n += 1 | |
|
407 | ||
|
408 | self.parentId = str(parentId) | |
|
409 | self.id = str(new_id) | |
|
410 | self.inputId = str(new_inputId) | |
|
411 | ||
|
412 | ||
|
391 | 413 | def getInputId(self): |
|
392 | 414 | |
|
393 | 415 | return self.inputId |
@@ -421,7 +443,20 class ProcUnitConf(): | |||
|
421 | 443 | |
|
422 | 444 | def setup(self, id, name, datatype, inputId, parentId=None): |
|
423 | 445 |
|
|
424 | self.id = id | |
|
446 | #Compatible with old signal chain version | |
|
447 | if datatype==None and name==None: | |
|
448 | raise ValueError, "datatype or name should be defined" | |
|
449 | ||
|
450 | if name==None: | |
|
451 | if 'Proc' in datatype: | |
|
452 | name = datatype | |
|
453 | else: | |
|
454 | name = '%sProc' %(datatype) | |
|
455 | ||
|
456 | if datatype==None: | |
|
457 | datatype = name.replace('Proc','') | |
|
458 | ||
|
459 | self.id = str(id) | |
|
425 | 460 | self.name = name |
|
426 | 461 | self.datatype = datatype |
|
427 | 462 | self.inputId = inputId |
@@ -479,6 +514,12 class ProcUnitConf(): | |||
|
479 | 514 | self.datatype = upElement.get('datatype') |
|
480 | 515 | self.inputId = upElement.get('inputId') |
|
481 | 516 | |
|
517 | if self.ELEMENTNAME == "ReadUnit": | |
|
518 | self.datatype = self.datatype.replace("Reader", "") | |
|
519 | ||
|
520 | if self.ELEMENTNAME == "ProcUnit": | |
|
521 | self.datatype = self.datatype.replace("Proc", "") | |
|
522 | ||
|
482 | 523 | if self.inputId == 'None': |
|
483 | 524 | self.inputId = '0' |
|
484 | 525 | |
@@ -584,6 +625,19 class ReadUnitConf(ProcUnitConf): | |||
|
584 | 625 | |
|
585 | 626 | def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs): |
|
586 | 627 | |
|
628 | #Compatible with old signal chain version | |
|
629 | if datatype==None and name==None: | |
|
630 | raise ValueError, "datatype or name should be defined" | |
|
631 | ||
|
632 | if name==None: | |
|
633 | if 'Reader' in datatype: | |
|
634 | name = datatype | |
|
635 | else: | |
|
636 | name = '%sReader' %(datatype) | |
|
637 | ||
|
638 | if datatype==None: | |
|
639 | datatype = name.replace('Reader','') | |
|
640 | ||
|
587 | 641 | self.id = id |
|
588 | 642 | self.name = name |
|
589 | 643 | self.datatype = datatype |
@@ -601,6 +655,10 class ReadUnitConf(ProcUnitConf): | |||
|
601 | 655 | |
|
602 | 656 | def update(self, datatype, path, startDate, endDate, startTime, endTime, parentId=None, name=None, **kwargs): |
|
603 | 657 | |
|
658 | #Compatible with old signal chain version | |
|
659 | if datatype==None and name==None: | |
|
660 | raise ValueError, "datatype or name should be defined" | |
|
661 | ||
|
604 | 662 | if name==None: |
|
605 | 663 | if 'Reader' in datatype: |
|
606 | 664 | name = datatype |
@@ -618,7 +676,7 class ReadUnitConf(ProcUnitConf): | |||
|
618 | 676 | self.startTime = startTime |
|
619 | 677 | self.endTime = endTime |
|
620 | 678 | |
|
621 |
self.inputId = |
|
|
679 | self.inputId = '0' | |
|
622 | 680 | self.parentId = parentId |
|
623 | 681 | |
|
624 | 682 | self.updateRunOperation(**kwargs) |
@@ -678,9 +736,7 class Project(): | |||
|
678 | 736 | #data_q = dataq |
|
679 | 737 | |
|
680 | 738 | if control==None: |
|
681 | control = {} | |
|
682 | control['stop'] = False | |
|
683 | control['pause'] = False | |
|
739 | control = {'stop':False,'pause':False} | |
|
684 | 740 | |
|
685 | 741 | self.control = control |
|
686 | 742 | |
@@ -698,9 +754,30 class Project(): | |||
|
698 | 754 | |
|
699 | 755 | return self.id |
|
700 | 756 | |
|
757 | def updateId(self, new_id): | |
|
758 | ||
|
759 | self.id = str(new_id) | |
|
760 | ||
|
761 | keyList = self.procUnitConfObjDict.keys() | |
|
762 | keyList.sort() | |
|
763 | ||
|
764 | n = 1 | |
|
765 | newProcUnitConfObjDict = {} | |
|
766 | ||
|
767 | for procKey in keyList: | |
|
768 | ||
|
769 | procUnitConfObj = self.procUnitConfObjDict[procKey] | |
|
770 | idProcUnit = str(int(self.id)*10 + n) | |
|
771 | procUnitConfObj.updateId(idProcUnit, parentId = self.id) | |
|
772 | ||
|
773 | newProcUnitConfObjDict[idProcUnit] = procUnitConfObj | |
|
774 | n += 1 | |
|
775 | ||
|
776 | self.procUnitConfObjDict = newProcUnitConfObjDict | |
|
777 | ||
|
701 | 778 | def setup(self, id, name, description): |
|
702 | 779 | |
|
703 | self.id = id | |
|
780 | self.id = str(id) | |
|
704 | 781 | self.name = name |
|
705 | 782 | self.description = description |
|
706 | 783 | |
@@ -711,19 +788,6 class Project(): | |||
|
711 | 788 | |
|
712 | 789 | def addReadUnit(self, datatype=None, name=None, **kwargs): |
|
713 | 790 | |
|
714 | #Compatible with old signal chain version | |
|
715 | if datatype==None and name==None: | |
|
716 | raise ValueError, "datatype or name should be defined" | |
|
717 | ||
|
718 | if name==None: | |
|
719 | if 'Reader' in datatype: | |
|
720 | name = datatype | |
|
721 | else: | |
|
722 | name = '%sReader' %(datatype) | |
|
723 | ||
|
724 | if datatype==None: | |
|
725 | datatype = name.replace('Reader','') | |
|
726 | ||
|
727 | 791 | idReadUnit = self.__getNewId() |
|
728 | 792 | |
|
729 | 793 | readUnitConfObj = ReadUnitConf() |
@@ -735,19 +799,6 class Project(): | |||
|
735 | 799 | |
|
736 | 800 | def addProcUnit(self, inputId='0', datatype=None, name=None): |
|
737 | 801 | |
|
738 | #Compatible with old signal chain version | |
|
739 | if datatype==None and name==None: | |
|
740 | raise ValueError, "datatype or name should be defined" | |
|
741 | ||
|
742 | if name==None: | |
|
743 | if 'Proc' in datatype: | |
|
744 | name = datatype | |
|
745 | else: | |
|
746 | name = '%sProc' %(datatype) | |
|
747 | ||
|
748 | if datatype==None: | |
|
749 | datatype = name.replace('Proc','') | |
|
750 | ||
|
751 | 802 | idProcUnit = self.__getNewId() |
|
752 | 803 | |
|
753 | 804 | procUnitConfObj = ProcUnitConf() |
@@ -952,6 +1003,33 class Project(): | |||
|
952 | 1003 | self.connectObjects() |
|
953 | 1004 | self.run() |
|
954 | 1005 | |
|
1006 | class ControllerThread(threading.Thread, Project): | |
|
1007 | ||
|
1008 | def __init__(self, filename): | |
|
1009 | ||
|
1010 | threading.Thread.__init__(self) | |
|
1011 | Project.__init__(self) | |
|
1012 | ||
|
1013 | self.setDaemon(True) | |
|
1014 | ||
|
1015 | self.filename = filename | |
|
1016 | self.control = {'stop':False, 'pause':False} | |
|
1017 | ||
|
1018 | def stop(self): | |
|
1019 | self.control['stop'] = True | |
|
1020 | ||
|
1021 | def pause(self): | |
|
1022 | self.control['pause'] = not(self.control['pause']) | |
|
1023 | ||
|
1024 | def run(self): | |
|
1025 | self.control['stop'] = False | |
|
1026 | self.control['pause'] = False | |
|
1027 | ||
|
1028 | self.readXml(self.filename) | |
|
1029 | self.createObjects() | |
|
1030 | self.connectObjects() | |
|
1031 | Project.run(self) | |
|
1032 | ||
|
955 | 1033 | if __name__ == '__main__': |
|
956 | 1034 | |
|
957 | 1035 | desc = "Segundo Test" |
This diff has been collapsed as it changes many lines, (1760 lines changed) Show them Hide them | |||
@@ -12,6 +12,7 import Queue | |||
|
12 | 12 | from collections import OrderedDict |
|
13 | 13 | from os.path import expanduser |
|
14 | 14 | from time import sleep |
|
15 | import ast | |
|
15 | 16 | |
|
16 | 17 | from PyQt4.QtGui import QMainWindow |
|
17 | 18 | from PyQt4.QtCore import pyqtSignature |
@@ -22,15 +23,16 from PyQt4 import QtGui | |||
|
22 | 23 | from schainpy.gui.viewer.ui_unitprocess import Ui_UnitProcess |
|
23 | 24 | from schainpy.gui.viewer.ui_ftp import Ui_Ftp |
|
24 | 25 | from schainpy.gui.viewer.ui_mainwindow import Ui_BasicWindow |
|
25 | from schainpy.controller import Project | |
|
26 | from schainpy.controller import Project, ControllerThread | |
|
26 | 27 | |
|
27 | 28 | from propertiesViewModel import TreeModel, PropertyBuffer |
|
28 | 29 | from parametersModel import ProjectParms |
|
29 | 30 | |
|
30 | 31 | from schainpy.gui.figures import tools |
|
31 | from schainpy.gui.viewcontroller.comm import ControllerThread | |
|
32 | # from schainpy.gui.viewcontroller.comm import ControllerThread | |
|
32 | 33 | |
|
33 | 34 | FIGURES_PATH = tools.get_path() |
|
35 | TEMPORAL_FILE = "./.temp.xml" | |
|
34 | 36 | |
|
35 | 37 | def isRadarFile(file): |
|
36 | 38 | try: |
@@ -78,6 +80,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
78 | 80 | self.idImagspectraHeis = 0 |
|
79 | 81 | self.idImagrtiHeis = 0 |
|
80 | 82 | |
|
83 | self.dataPath = None | |
|
81 | 84 | self.online = 0 |
|
82 | 85 | self.walk = 0 |
|
83 | 86 | self.create = False |
@@ -173,8 +176,9 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
173 | 176 | self.configFTPWindowObj.closed.connect(self.createFTPConfig) |
|
174 | 177 | |
|
175 | 178 | def createFTPConfig(self): |
|
176 | self.console.clear() | |
|
179 | ||
|
177 | 180 | if not self.configFTPWindowObj.create: |
|
181 | self.console.clear() | |
|
178 | 182 | self.console.append("There is no FTP configuration") |
|
179 | 183 | return |
|
180 | 184 | self.console.append("Push Ok in Spectra view to Add FTP Configuration") |
@@ -246,7 +250,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
246 | 250 | if index == 0: |
|
247 | 251 | self.online = 0 |
|
248 | 252 | self.proDelay.setText("0") |
|
249 |
self.proSet.setText(" |
|
|
253 | self.proSet.setText("") | |
|
250 | 254 | self.proSet.setEnabled(False) |
|
251 | 255 | self.proDelay.setEnabled(False) |
|
252 | 256 | elif index == 1: |
@@ -261,6 +265,12 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
261 | 265 | """ |
|
262 | 266 | Voltage or Spectra |
|
263 | 267 | """ |
|
268 | self.labelSet.show() | |
|
269 | self.proSet.show() | |
|
270 | ||
|
271 | self.labelIPPKm.hide() | |
|
272 | self.proIPPKm.hide() | |
|
273 | ||
|
264 | 274 | if index == 0: |
|
265 | 275 | extension = '.r' |
|
266 | 276 | elif index == 1: |
@@ -270,8 +280,12 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
270 | 280 | elif index == 3: |
|
271 | 281 | extension = '.hdf5' |
|
272 | 282 | |
|
283 | self.labelSet.hide() | |
|
284 | self.proSet.hide() | |
|
285 | self.labelIPPKm.show() | |
|
286 | self.proIPPKm.show() | |
|
287 | ||
|
273 | 288 | self.proDataType.setText(extension) |
|
274 | self.console.clear() | |
|
275 | 289 | |
|
276 | 290 | @pyqtSignature("int") |
|
277 | 291 | def on_proComWalk_activated(self, index): |
@@ -288,19 +302,40 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
288 | 302 | """ |
|
289 | 303 | Choose your path |
|
290 | 304 | """ |
|
291 | self.dataPath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', './', QtGui.QFileDialog.ShowDirsOnly)) | |
|
292 | self.proDataPath.setText(self.dataPath) | |
|
305 | ||
|
306 | current_dpath = './' | |
|
307 | if self.dataPath: | |
|
308 | current_dpath = self.dataPath | |
|
309 | ||
|
310 | datapath = str(QtGui.QFileDialog.getExistingDirectory(self, 'Open Directory', current_dpath, QtGui.QFileDialog.ShowDirsOnly)) | |
|
311 | ||
|
312 | #If it was canceled | |
|
313 | if not datapath: | |
|
314 | return | |
|
315 | ||
|
316 | #If any change was done | |
|
317 | if datapath == self.dataPath: | |
|
318 | return | |
|
319 | ||
|
320 | self.proDataPath.setText(datapath) | |
|
321 | ||
|
322 | self.actionStart.setEnabled(False) | |
|
323 | self.actionStarToolbar.setEnabled(False) | |
|
324 | self.proOk.setEnabled(False) | |
|
293 | 325 | |
|
294 | 326 | self.proComStartDate.clear() |
|
295 | 327 | self.proComEndDate.clear() |
|
296 | 328 | |
|
297 |
if not os.path.exists( |
|
|
298 | self.proOk.setEnabled(False) | |
|
329 | if not os.path.exists(datapath): | |
|
330 | ||
|
299 | 331 | self.console.clear() |
|
300 | 332 | self.console.append("Write a correct a path") |
|
301 | 333 | return |
|
334 | ||
|
335 | self.dataPath = datapath | |
|
336 | ||
|
302 | 337 | self.console.clear() |
|
303 | self.console.append("Select the read mode") | |
|
338 | self.console.append("Select the read mode and press 'load button'") | |
|
304 | 339 | |
|
305 | 340 | |
|
306 | 341 | @pyqtSignature("") |
@@ -364,28 +399,56 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
364 | 399 | AΓ±ade al Obj XML de Projecto, name,datatype,date,time,readmode,wait,etc, crea el readUnitProcess del archivo xml. |
|
365 | 400 | Prepara la configuraciΓ³n del diΓ‘grama del Arbol del treeView numero 2 |
|
366 | 401 | """ |
|
402 | ||
|
403 | self.actionStart.setEnabled(False) | |
|
404 | self.actionStarToolbar.setEnabled(False) | |
|
405 | ||
|
367 | 406 | if self.create: |
|
368 | self.idProject += 1 | |
|
369 |
projectId = self. |
|
|
407 | ||
|
408 | projectId = self.__getNewProjectId() | |
|
409 | ||
|
410 | if not projectId: | |
|
411 | return 0 | |
|
412 | ||
|
370 | 413 | projectObjView = self.createProjectView(projectId) |
|
414 | ||
|
415 | if not projectObjView: | |
|
416 | return 0 | |
|
417 | ||
|
371 | 418 | readUnitObj = self.createReadUnitView(projectObjView) |
|
372 | self.addProject2ProjectExplorer(id=projectId, name=projectObjView.name) | |
|
419 | ||
|
420 | if not readUnitObj: | |
|
421 | return 0 | |
|
422 | ||
|
373 | 423 | else: |
|
374 | 424 | projectObjView = self.updateProjectView() |
|
425 | ||
|
426 | if not projectObjView: | |
|
427 | return 0 | |
|
428 | ||
|
375 | 429 | projectId = projectObjView.getId() |
|
376 | 430 | idReadUnit = projectObjView.getReadUnitId() |
|
377 | 431 | readUnitObj = self.updateReadUnitView(projectObjView, idReadUnit) |
|
378 | 432 | |
|
433 | if not readUnitObj: | |
|
434 | return 0 | |
|
435 | ||
|
379 | 436 | self.__itemTreeDict[projectId].setText(projectObjView.name) |
|
380 | 437 | # Project Properties |
|
381 | 438 | self.refreshProjectProperties(projectObjView) |
|
382 | 439 | # Disable tabProject after finish the creation |
|
383 | self.tabProject.setEnabled(True) | |
|
440 | ||
|
441 | self.actionStart.setEnabled(True) | |
|
442 | self.actionStarToolbar.setEnabled(True) | |
|
443 | self.console.clear() | |
|
444 | self.console.append("The project parameters were validated") | |
|
445 | ||
|
446 | return 1 | |
|
384 | 447 | |
|
385 | 448 | @pyqtSignature("") |
|
386 | 449 | def on_proClear_clicked(self): |
|
387 | self.setInputsProject_View() | |
|
388 | projectObj = self.getSelectedProjectObj() | |
|
450 | ||
|
451 | self.console.clear() | |
|
389 | 452 | |
|
390 | 453 | @pyqtSignature("int") |
|
391 | 454 | def on_volOpCebChannels_stateChanged(self, p0): |
@@ -442,6 +505,23 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
442 | 505 | self.volOpProfile.clear() |
|
443 | 506 | |
|
444 | 507 | @pyqtSignature("int") |
|
508 | def on_volOpComProfile_activated(self, index): | |
|
509 | """ | |
|
510 | Check Box habilita ingreso del rango de Perfiles | |
|
511 | """ | |
|
512 | #Profile List | |
|
513 | if index == 0: | |
|
514 | self.volOpProfile.setToolTip('List of selected profiles. Example: 0, 1, 2, 3, 4, 5, 6, 7') | |
|
515 | ||
|
516 | #Profile Range | |
|
517 | if index == 1: | |
|
518 | self.volOpProfile.setToolTip('Minimum and maximum profile index. Example: 0, 7') | |
|
519 | ||
|
520 | #Profile Range List | |
|
521 | if index == 2: | |
|
522 | self.volOpProfile.setToolTip('List of profile ranges. Example: (0, 7), (12, 19), (100, 200)') | |
|
523 | ||
|
524 | @pyqtSignature("int") | |
|
445 | 525 | def on_volOpCebDecodification_stateChanged(self, p0): |
|
446 | 526 | """ |
|
447 | 527 | Check Box habilita |
@@ -454,6 +534,78 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
454 | 534 | self.volOpComMode.setEnabled(False) |
|
455 | 535 | |
|
456 | 536 | @pyqtSignature("int") |
|
537 | def on_volOpComCode_activated(self, index): | |
|
538 | """ | |
|
539 | Check Box habilita ingreso | |
|
540 | """ | |
|
541 | if index == 13: | |
|
542 | self.volOpCode.setEnabled(True) | |
|
543 | else: | |
|
544 | self.volOpCode.setEnabled(False) | |
|
545 | ||
|
546 | if index == 0: | |
|
547 | code = '' | |
|
548 | self.volOpCode.setText(str(code)) | |
|
549 | return | |
|
550 | ||
|
551 | if index == 1: | |
|
552 | code = '(1,1,-1)' | |
|
553 | nCode = '1' | |
|
554 | nBaud = '3' | |
|
555 | if index == 2: | |
|
556 | code = '(1,1,-1,1)' | |
|
557 | nCode = '1' | |
|
558 | nBaud = '4' | |
|
559 | if index == 3: | |
|
560 | code = '(1,1,1,-1,1)' | |
|
561 | nCode = '1' | |
|
562 | nBaud = '5' | |
|
563 | if index == 4: | |
|
564 | code = '(1,1,1,-1,-1,1,-1)' | |
|
565 | nCode = '1' | |
|
566 | nBaud = '7' | |
|
567 | if index == 5: | |
|
568 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1)' | |
|
569 | nCode = '1' | |
|
570 | nBaud = '11' | |
|
571 | if index == 6: | |
|
572 | code = '(1,1,1,1,1,-1,-1,1,1,-1,1,-1,1)' | |
|
573 | nCode = '1' | |
|
574 | nBaud = '13' | |
|
575 | if index == 7: | |
|
576 | code = '(1,1,-1,-1,-1,1)' | |
|
577 | nCode = '2' | |
|
578 | nBaud = '3' | |
|
579 | if index == 8: | |
|
580 | code = '(1,1,-1,1,-1,-1,1,-1)' | |
|
581 | nCode = '2' | |
|
582 | nBaud = '4' | |
|
583 | if index == 9: | |
|
584 | code = '(1,1,1,-1,1,-1,-1,-1,1,-1)' | |
|
585 | nCode = '2' | |
|
586 | nBaud = '5' | |
|
587 | if index == 10: | |
|
588 | code = '(1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1)' | |
|
589 | nCode = '2' | |
|
590 | nBaud = '7' | |
|
591 | if index == 11: | |
|
592 | code = '(1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1)' | |
|
593 | nCode = '2' | |
|
594 | nBaud = '11' | |
|
595 | if index == 12: | |
|
596 | 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)' | |
|
597 | nCode = '2' | |
|
598 | nBaud = '13' | |
|
599 | ||
|
600 | code = ast.literal_eval(code) | |
|
601 | nCode = int(nCode) | |
|
602 | nBaud = int(nBaud) | |
|
603 | ||
|
604 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
|
605 | ||
|
606 | self.volOpCode.setText(str(code)) | |
|
607 | ||
|
608 | @pyqtSignature("int") | |
|
457 | 609 | def on_volOpCebFlip_stateChanged(self, p0): |
|
458 | 610 | """ |
|
459 | 611 | Check Box habilita ingresode del numero de Integraciones a realizar |
@@ -601,85 +753,55 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
601 | 753 | name_operation = 'ProfileSelector' |
|
602 | 754 | if self.volOpComProfile.currentIndex() == 0: |
|
603 | 755 | name_parameter = 'profileList' |
|
604 | else: | |
|
756 | if self.volOpComProfile.currentIndex() == 1: | |
|
605 | 757 | name_parameter = 'profileRangeList' |
|
758 | if self.volOpComProfile.currentIndex() == 2: | |
|
759 | name_parameter = 'rangeList' | |
|
760 | ||
|
606 | 761 | opObj = puObj.addOperation(name='ProfileSelector', optype='other') |
|
607 | 762 | opObj.addParameter(name=name_parameter, value=value, format=format) |
|
608 | 763 | |
|
609 | 764 | if self.volOpCebDecodification.isChecked(): |
|
610 | name_operation = 'Decoder' | |
|
611 | optype = 'other' | |
|
612 | format1 = 'floatlist' | |
|
613 | format2 = 'int' | |
|
614 | format3 = 'int' | |
|
615 | format4 = 'int' | |
|
616 | name_parameter1 = 'code' | |
|
617 | name_parameter2 = 'nCode' | |
|
618 | name_parameter3 = 'nBaud' | |
|
619 | name_parameter4 = 'mode' | |
|
620 | 765 | |
|
621 | if self.volOpComCode.currentIndex() == 0: | |
|
622 | value1 = '1,1,-1' | |
|
623 | value2 = '1' | |
|
624 | value3 = '3' | |
|
625 | if self.volOpComCode.currentIndex() == 1: | |
|
626 | value1 = '1,1,-1,1' | |
|
627 | value2 = '1' | |
|
628 | value3 = '4' | |
|
629 | if self.volOpComCode.currentIndex() == 2: | |
|
630 | value1 = '1,1,1,-1,1' | |
|
631 | value2 = '1' | |
|
632 | value3 = '5' | |
|
633 | if self.volOpComCode.currentIndex() == 3: | |
|
634 | value1 = '1,1,1,-1,-1,1,-1' | |
|
635 | value2 = '1' | |
|
636 | value3 = '7' | |
|
637 | if self.volOpComCode.currentIndex() == 4: | |
|
638 | value1 = '1,1,1,-1,-1,-1,1,-1,-1,1,-1' | |
|
639 | value2 = '1' | |
|
640 | value3 = '11' | |
|
641 | if self.volOpComCode.currentIndex() == 5: | |
|
642 | value1 = '1,1,1,1,1,-1,-1,1,1,-1,1,-1,1' | |
|
643 | value2 = '1' | |
|
644 | value3 = '13' | |
|
645 | if self.volOpComCode.currentIndex() == 6: | |
|
646 | value1 = '1,1,-1,-1,-1,1' | |
|
647 | value2 = '2' | |
|
648 | value3 = '3' | |
|
649 | if self.volOpComCode.currentIndex() == 7: | |
|
650 | value1 = '1,1,-1,1,-1,-1,1,-1' | |
|
651 | value2 = '2' | |
|
652 | value3 = '4' | |
|
653 | if self.volOpComCode.currentIndex() == 8: | |
|
654 | value1 = '1,1,1,-1,1,-1,-1,-1,1,-1' | |
|
655 | value2 = '2' | |
|
656 | value3 = '5' | |
|
657 | if self.volOpComCode.currentIndex() == 9: | |
|
658 | value1 = '1,1,1,-1,-1,1,-1,-1,-1,-1,1,1,-1,1' | |
|
659 | value2 = '2' | |
|
660 | value3 = '7' | |
|
661 | if self.volOpComCode.currentIndex() == 10: | |
|
662 | value1 = '1,1,1,-1,-1,-1,1,-1,-1,1,-1,-1 ,-1 ,-1 ,1 ,1,1,-1 ,1 ,1 ,-1 ,1' | |
|
663 | value2 = '2' | |
|
664 | value3 = '11' | |
|
665 | if self.volOpComCode.currentIndex() == 11: | |
|
666 | value1 = '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 | value2 = '2' | |
|
668 | value3 = '13' | |
|
669 | 766 | if self.volOpComMode.currentIndex() == 0: |
|
670 |
|
|
|
767 | mode = '0' | |
|
671 | 768 | if self.volOpComMode.currentIndex() == 1: |
|
672 |
|
|
|
769 | mode = '1' | |
|
673 | 770 | if self.volOpComMode.currentIndex() == 2: |
|
674 |
|
|
|
675 | opObj = puObj.addOperation(name=name_operation, optype='other') | |
|
676 |
if self.volOpComCode.currentIndex() == |
|
|
677 | pass | |
|
771 | mode = '2' | |
|
772 | ||
|
773 | if self.volOpComCode.currentIndex() == 0: | |
|
774 | opObj = puObj.addOperation(name='Decoder', optype='other') | |
|
775 | opObj.addParameter(name='mode', value=mode, format='int') | |
|
678 | 776 | else: |
|
679 | opObj.addParameter(name=name_parameter1, value=value1, format=format1) | |
|
680 | opObj.addParameter(name=name_parameter2, value=value2, format=format2) | |
|
681 | opObj.addParameter(name=name_parameter3, value=value3, format=format3) | |
|
682 | opObj.addParameter(name=name_parameter4, value=value4, format=format4) | |
|
777 | #User defined | |
|
778 | code = str(self.volOpCode.text()) | |
|
779 | try: | |
|
780 | code_tmp = ast.literal_eval(code) | |
|
781 | except: | |
|
782 | code_tmp = [] | |
|
783 | ||
|
784 | if len(code_tmp) < 1: | |
|
785 | self.console.append("Please fill the code value") | |
|
786 | return 0 | |
|
787 | ||
|
788 | if len(code_tmp) == 1 or type(code_tmp[0]) != int: | |
|
789 | nBaud = len(code_tmp[0]) | |
|
790 | nCode = len(code_tmp) | |
|
791 | else: | |
|
792 | nBaud = len(code_tmp) | |
|
793 | nCode = 1 | |
|
794 | ||
|
795 | opObj = puObj.addOperation(name='Decoder', optype='other') | |
|
796 | ||
|
797 | code = code.replace("(", "") | |
|
798 | code = code.replace(")", "") | |
|
799 | code = code.replace("[", "") | |
|
800 | code = code.replace("]", "") | |
|
801 | opObj.addParameter(name='code', value=code, format='intlist') | |
|
802 | opObj.addParameter(name='nCode', value=nCode, format='int') | |
|
803 | opObj.addParameter(name='nBaud', value=nBaud, format='int') | |
|
804 | opObj.addParameter(name='mode', value=mode, format='int') | |
|
683 | 805 | |
|
684 | 806 | if self.volOpCebFlip.isChecked(): |
|
685 | 807 | name_operation = 'deFlip' |
@@ -696,6 +818,11 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
696 | 818 | name_operation = 'CohInt' |
|
697 | 819 | optype = 'other' |
|
698 | 820 | value = str(self.volOpCohInt.text()) |
|
821 | ||
|
822 | if value == "": | |
|
823 | print "Please fill number of coherent integrations" | |
|
824 | return 0 | |
|
825 | ||
|
699 | 826 | name_parameter = 'n' |
|
700 | 827 | format = 'float' |
|
701 | 828 | |
@@ -719,57 +846,48 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
719 | 846 | |
|
720 | 847 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
721 | 848 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
722 |
opObj.addParameter(name=name_parameter1, value= |
|
|
849 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
|
723 | 850 | |
|
724 | channelList = str(self.volGraphChannelList.text()) | |
|
725 | xvalue = str(self.volGraphfreqrange.text()) | |
|
726 | yvalue = str(self.volGraphHeightrange.text()) | |
|
851 | channelList = str(self.volGraphChannelList.text()).replace(" ","") | |
|
852 | xvalue = str(self.volGraphfreqrange.text()).replace(" ","") | |
|
853 | yvalue = str(self.volGraphHeightrange.text()).replace(" ","") | |
|
727 | 854 | |
|
728 |
if |
|
|
729 | try: | |
|
730 | value = str(channelList) | |
|
731 | except: | |
|
732 | return 0 | |
|
733 | opObj.addParameter(name='channelList', value=value, format='intlist') | |
|
855 | if channelList: | |
|
856 | opObj.addParameter(name='channelList', value=channelList, format='intlist') | |
|
734 | 857 | |
|
735 |
if |
|
|
858 | if xvalue: | |
|
736 | 859 | xvalueList = xvalue.split(',') |
|
737 | 860 | try: |
|
738 |
value0 = |
|
|
739 |
value1 = |
|
|
861 | value0 = float(xvalueList[0]) | |
|
862 | value1 = float(xvalueList[1]) | |
|
740 | 863 | except: |
|
741 | 864 | return 0 |
|
742 |
opObj.addParameter(name='xmin', value=value0, format=' |
|
|
743 |
opObj.addParameter(name='xmax', value=value1, format=' |
|
|
865 | opObj.addParameter(name='xmin', value=value0, format='float') | |
|
866 | opObj.addParameter(name='xmax', value=value1, format='float') | |
|
744 | 867 | |
|
745 | 868 | |
|
746 | 869 | if not yvalue == "": |
|
747 | 870 | yvalueList = yvalue.split(",") |
|
748 | 871 | try: |
|
749 | value = yvalueList[0] | |
|
750 | value = yvalueList[1] | |
|
872 | value0 = int(yvalueList[0]) | |
|
873 | value1 = int(yvalueList[1]) | |
|
751 | 874 | except: |
|
752 | 875 | return 0 |
|
753 | opObj.addParameter(name='ymin', value=yvalueList[0], format='int') | |
|
754 |
opObj.addParameter(name='ym |
|
|
876 | ||
|
877 | opObj.addParameter(name='ymin', value=value0, format='int') | |
|
878 | opObj.addParameter(name='ymax', value=value1, format='int') | |
|
755 | 879 | |
|
756 | 880 | if self.volGraphCebSave.isChecked(): |
|
757 | 881 | checkPath = True |
|
758 | 882 | opObj.addParameter(name='save', value='1', format='int') |
|
759 | 883 | opObj.addParameter(name='figpath', value=self.volGraphPath.text(), format='str') |
|
760 | value = str(self.volGraphPrefix.text()) | |
|
761 |
if |
|
|
762 | try: | |
|
763 | value = str(self.volGraphPrefix.text()) | |
|
764 | except: | |
|
765 | self.console.clear() | |
|
766 | self.console.append("Please Write prefix") | |
|
767 | return 0 | |
|
768 | opObj.addParameter(name='figfile', value=self.volGraphPrefix.text(), format='str') | |
|
884 | value = str(self.volGraphPrefix.text()).replace(" ","") | |
|
885 | if value: | |
|
886 | opObj.addParameter(name='figfile', value=value, format='str') | |
|
769 | 887 | |
|
770 | 888 | localfolder = None |
|
771 | 889 | if checkPath: |
|
772 |
localfolder = str(self. |
|
|
890 | localfolder = str(self.volGraphPath.text()) | |
|
773 | 891 | if localfolder == '': |
|
774 | 892 | self.console.clear() |
|
775 | 893 | self.console.append("Graphic path should be defined") |
@@ -933,6 +1051,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
933 | 1051 | if p0 == 0: |
|
934 | 1052 | self.specOpgetNoise.setEnabled(False) |
|
935 | 1053 | |
|
1054 | ||
|
936 | 1055 | def refreshID(self, puObj): |
|
937 | 1056 | opObj = puObj.getOperationObj(name='Scope') |
|
938 | 1057 | # opObj = puObj.getOpObjfromParamValue(value="Scope") |
@@ -1122,6 +1241,11 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1122 | 1241 | name_parameter = 'pairsList' |
|
1123 | 1242 | format = 'pairslist' |
|
1124 | 1243 | value2 = self.specOppairsList.text() |
|
1244 | ||
|
1245 | if value2 == "": | |
|
1246 | print "Please fill the pairs list field" | |
|
1247 | return 0 | |
|
1248 | ||
|
1125 | 1249 | puObj.addParameter(name=name_parameter, value=value2, format=format) |
|
1126 | 1250 | |
|
1127 | 1251 | if self.specOpCebHeights.isChecked(): |
@@ -1295,7 +1419,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1295 | 1419 | zvalue = self.specGgraphDbsrange.text() |
|
1296 | 1420 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1297 | 1421 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1298 |
opObj.addParameter(name=name_parameter1, value= |
|
|
1422 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
|
1299 | 1423 | |
|
1300 | 1424 | if not channelList == '': |
|
1301 | 1425 | name_parameter = 'channelList' |
@@ -1385,7 +1509,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1385 | 1509 | yvalue = self.specGgraphHeight.text() |
|
1386 | 1510 | zvalue = self.specGgraphDbsrange.text() |
|
1387 | 1511 | |
|
1388 |
opObj.addParameter(name='id', value= |
|
|
1512 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
|
1389 | 1513 | |
|
1390 | 1514 | if self.specGgraphChannelList.isModified(): |
|
1391 | 1515 | opObj.addParameter(name='channelList', value=channelList, format='intlist') |
@@ -1462,7 +1586,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1462 | 1586 | |
|
1463 | 1587 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1464 | 1588 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1465 |
opObj.addParameter(name=name_parameter1, value= |
|
|
1589 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
|
1466 | 1590 | |
|
1467 | 1591 | channelList = self.specGgraphChannelList.text() |
|
1468 | 1592 | xvalue = self.specGgraphTminTmax.text() |
@@ -1554,7 +1678,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1554 | 1678 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1555 | 1679 | # opObj.addParameter(name='coherence_cmap', value='jet', format='str') |
|
1556 | 1680 | # opObj.addParameter(name='phase_cmap', value='RdBu_r', format='str') |
|
1557 |
opObj.addParameter(name=name_parameter1, value= |
|
|
1681 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
|
1558 | 1682 | |
|
1559 | 1683 | channelList = self.specGgraphChannelList.text() |
|
1560 | 1684 | if not channelList == '': |
@@ -1638,7 +1762,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1638 | 1762 | value1 = int(self.idImagpower) |
|
1639 | 1763 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1640 | 1764 | # opObj.addParameter(name=name_parameter, value=value, format='str') |
|
1641 |
opObj.addParameter(name='id', value= |
|
|
1765 | opObj.addParameter(name='id', value=opObj.id, format='int') | |
|
1642 | 1766 | |
|
1643 | 1767 | channelList = self.specGgraphChannelList.text() |
|
1644 | 1768 | if not channelList == '': |
@@ -1709,7 +1833,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1709 | 1833 | |
|
1710 | 1834 | opObj = puObj.addOperation(name=name_operation, optype=optype) |
|
1711 | 1835 | # opObj.addParameter(name=name_parameter, value=value, format=format) |
|
1712 |
opObj.addParameter(name=name_parameter1, value= |
|
|
1836 | opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) | |
|
1713 | 1837 | |
|
1714 | 1838 | channelList = self.specGgraphChannelList.text() |
|
1715 | 1839 | xvalue = self.specGgraphTminTmax.text() |
@@ -1788,7 +1912,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1788 | 1912 | self.temporalFTP.setwithoutconfiguration() |
|
1789 | 1913 | |
|
1790 | 1914 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
1791 |
self. |
|
|
1915 | self.addFTPProcUnitView(server, username, password, remotefolder, | |
|
1792 | 1916 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
1793 | 1917 | localfolder=localfolder) |
|
1794 | 1918 | else: |
@@ -1975,8 +2099,6 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
1975 | 2099 | self.specGraphPrefix.setEnabled(True) |
|
1976 | 2100 | self.specGraphToolPath.setEnabled(True) |
|
1977 | 2101 | |
|
1978 | ||
|
1979 | #-------ftp-----# | |
|
1980 | 2102 | @pyqtSignature("int") |
|
1981 | 2103 | def on_specGraphftpSpectra_stateChanged(self, p0): |
|
1982 | 2104 | """ |
@@ -2013,10 +2135,6 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2013 | 2135 | if p0 == 2: |
|
2014 | 2136 | self.specGgraphftpratio.setEnabled(True) |
|
2015 | 2137 | |
|
2016 | #-------------------# | |
|
2017 | ||
|
2018 | ||
|
2019 | ||
|
2020 | 2138 | @pyqtSignature("") |
|
2021 | 2139 | def on_specGraphToolPath_clicked(self): |
|
2022 | 2140 | """ |
@@ -2266,7 +2384,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2266 | 2384 | self.temporalFTP.setwithoutconfiguration() |
|
2267 | 2385 | |
|
2268 | 2386 | server, remotefolder, username, password, ftp_wei, exp_code, sub_exp_code, plot_pos = self.temporalFTP.recover() |
|
2269 |
self. |
|
|
2387 | self.addFTPProcUnitView(server, username, password, remotefolder, | |
|
2270 | 2388 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
2271 | 2389 | localfolder=localfolder) |
|
2272 | 2390 | else: |
@@ -2385,7 +2503,10 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2385 | 2503 | parms_ok = False |
|
2386 | 2504 | project_name = None |
|
2387 | 2505 | |
|
2506 | description = str(self.proDescription.toPlainText()) | |
|
2507 | ||
|
2388 | 2508 | datatype = str(self.proComDataType.currentText()) |
|
2509 | ||
|
2389 | 2510 | ext = str(self.proDataType.text()) |
|
2390 | 2511 | |
|
2391 | 2512 | dpath = str(self.proDataPath.text()) |
@@ -2403,56 +2524,58 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2403 | 2524 | parms_ok = False |
|
2404 | 2525 | dpath = None |
|
2405 | 2526 | |
|
2406 |
online = |
|
|
2527 | online = int(self.proComReadMode.currentIndex()) | |
|
2407 | 2528 | |
|
2408 | 2529 | delay = None |
|
2409 | 2530 | if online==1: |
|
2410 | 2531 | try: |
|
2411 | 2532 | delay = int(str(self.proDelay.text())) |
|
2412 | 2533 | except: |
|
2413 |
outputstr = 'Delay value (%s) must be a integer number' %str(self.pro |
|
|
2534 | outputstr = 'Delay value (%s) must be a integer number' %str(self.proDelay.text()) | |
|
2414 | 2535 | self.console.append(outputstr) |
|
2415 | 2536 | parms_ok = False |
|
2416 | 2537 | |
|
2417 | 2538 | |
|
2418 | 2539 | set = None |
|
2540 | value = str(self.proSet.text()) | |
|
2541 | try: | |
|
2542 | set = int(value) | |
|
2543 | except: | |
|
2544 | pass | |
|
2545 | ||
|
2419 | 2546 | ippKm = None |
|
2420 | 2547 | |
|
2421 |
value = str(self.pro |
|
|
2548 | value = str(self.proIPPKm.text()) | |
|
2422 | 2549 | |
|
2423 | if datatype.lower() == "usrp": | |
|
2424 | 2550 | try: |
|
2425 | 2551 | ippKm = float(value) |
|
2426 | 2552 | except: |
|
2427 | outputstr = 'IPP value (%s) must be a float number' % str(self.proName.text()) | |
|
2553 | if datatype=="USRP": | |
|
2554 | outputstr = 'IPP value (%s) must be a float number' % str(self.proIPPKm.text()) | |
|
2428 | 2555 | self.console.append(outputstr) |
|
2429 | 2556 | parms_ok = False |
|
2430 | else: | |
|
2431 | try: | |
|
2432 | set = int(value) | |
|
2433 | except: | |
|
2434 | pass | |
|
2435 | 2557 | |
|
2436 | walk = self.proComWalk.currentIndex() | |
|
2558 | walk = int(self.proComWalk.currentIndex()) | |
|
2437 | 2559 | |
|
2438 | starDate = str(self.proComStartDate.currentText()) | |
|
2560 | startDate = str(self.proComStartDate.currentText()) | |
|
2439 | 2561 | endDate = str(self.proComEndDate.currentText()) |
|
2440 | 2562 | |
|
2441 | # startDateList = starDate.split("/") | |
|
2563 | # startDateList = startDate.split("/") | |
|
2442 | 2564 | # endDateList = endDate.split("/") |
|
2443 | 2565 | # |
|
2444 | # starDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
|
2566 | # startDate = datetime.date(int(startDateList[0]), int(startDateList[1]), int(startDateList[2])) | |
|
2445 | 2567 | # endDate = datetime.date(int(endDateList[0]), int(endDateList[1]), int(endDateList[2])) |
|
2446 | 2568 | |
|
2447 | 2569 | startTime = self.proStartTime.time() |
|
2448 | 2570 | endTime = self.proEndTime.time() |
|
2449 | 2571 | |
|
2450 |
startTime = startTime. |
|
|
2451 |
endTime = endTime. |
|
|
2572 | startTime = str(startTime.toString("H:m:s")) | |
|
2573 | endTime = str(endTime.toString("H:m:s")) | |
|
2452 | 2574 | |
|
2453 | 2575 | projectParms = ProjectParms() |
|
2454 | 2576 | |
|
2455 |
projectParms. |
|
|
2577 | projectParms.name = project_name | |
|
2578 | projectParms.description = description | |
|
2456 | 2579 | projectParms.datatype = datatype |
|
2457 | 2580 | projectParms.ext = ext |
|
2458 | 2581 | projectParms.dpath = dpath |
@@ -2527,7 +2650,8 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2527 | 2650 | |
|
2528 | 2651 | projectParms = ProjectParms() |
|
2529 | 2652 | |
|
2530 |
projectParms. |
|
|
2653 | projectParms.name = project_name | |
|
2654 | projectParms.description = description | |
|
2531 | 2655 | projectParms.datatype = datatype |
|
2532 | 2656 | projectParms.ext = None |
|
2533 | 2657 | projectParms.dpath = dpath |
@@ -2550,17 +2674,17 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2550 | 2674 | |
|
2551 | 2675 | index = projectParms.getDatatypeIndex() |
|
2552 | 2676 | |
|
2553 |
self.proName.setText(project |
|
|
2677 | self.proName.setText(projectParms.name) | |
|
2554 | 2678 | self.proDescription.clear() |
|
2555 |
self.proDescription.append(project |
|
|
2679 | self.proDescription.append(projectParms.description) | |
|
2556 | 2680 | |
|
2557 | 2681 | self.on_proComDataType_activated(index=index) |
|
2558 | self.proDataType.setText(projectParms.getExt()) | |
|
2559 | 2682 | self.proDataPath.setText(projectParms.dpath) |
|
2560 | 2683 | self.proComDataType.setCurrentIndex(index) |
|
2561 | 2684 | self.proComReadMode.setCurrentIndex(projectParms.online) |
|
2562 | 2685 | self.proDelay.setText(str(projectParms.delay)) |
|
2563 | 2686 | self.proSet.setText(str(projectParms.set)) |
|
2687 | self.proIPPKm.setText(str(projectParms.ippKm)) | |
|
2564 | 2688 | |
|
2565 | 2689 | dateList = self.loadDays(data_path = projectParms.dpath, |
|
2566 | 2690 | ext = projectParms.getExt(), |
@@ -2575,7 +2699,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2575 | 2699 | try: |
|
2576 | 2700 | endDateIndex = dateList.index(projectParms.endDate) |
|
2577 | 2701 | except: |
|
2578 | endDateIndex = -1 | |
|
2702 | endDateIndex = int(self.proComEndDate.count()-1) | |
|
2579 | 2703 | |
|
2580 | 2704 | self.proComStartDate.setCurrentIndex(startDateIndex) |
|
2581 | 2705 | self.proComEndDate.setCurrentIndex(endDateIndex) |
@@ -2584,427 +2708,169 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
2584 | 2708 | endlist = projectParms.endTime.split(":") |
|
2585 | 2709 | |
|
2586 | 2710 | self.time.setHMS(int(startlist[0]), int(startlist[1]), int(startlist[2])) |
|
2587 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
|
2588 | ||
|
2589 | 2711 | self.proStartTime.setTime(self.time) |
|
2590 | self.proEndTime.setTime(self.time) | |
|
2591 | 2712 | |
|
2592 | def refreshProjectProperties(self, projectObjView): | |
|
2713 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
|
2714 | self.proEndTime.setTime(self.time) | |
|
2593 | 2715 | |
|
2594 | propertyBuffObj = PropertyBuffer() | |
|
2595 | name = projectObjView.name | |
|
2596 | 2716 | |
|
2597 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
|
2598 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
|
2599 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
|
2717 | def __refreshVoltageWindow(self, puObj): | |
|
2600 | 2718 | |
|
2601 | readUnitObj = projectObjView.getReadUnitObj() | |
|
2602 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
|
2719 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
|
2720 | if opObj == None: | |
|
2721 | self.volOpRadarfrequency.clear() | |
|
2722 | self.volOpCebRadarfrequency.setCheckState(0) | |
|
2723 | else: | |
|
2724 | value = opObj.getParameterValue(parameterName='frequency') | |
|
2725 | value = str(value) | |
|
2726 | self.volOpRadarfrequency.setText(value) | |
|
2727 | self.volOpRadarfrequency.setEnabled(True) | |
|
2728 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
|
2603 | 2729 | |
|
2604 | for thisParmObj in runOperationObj.getParameterObjList(): | |
|
2605 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
|
2730 | opObj = puObj.getOperationObj(name="selectChannels") | |
|
2606 | 2731 | |
|
2607 | propertiesModel = propertyBuffObj.getPropertyModel() | |
|
2732 | if opObj == None: | |
|
2733 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
|
2608 | 2734 | |
|
2609 | self.treeProjectProperties.setModel(propertiesModel) | |
|
2610 | self.treeProjectProperties.expandAll() | |
|
2611 | self.treeProjectProperties.resizeColumnToContents(0) | |
|
2612 | self.treeProjectProperties.resizeColumnToContents(1) | |
|
2735 | if opObj == None: | |
|
2736 | self.volOpChannel.clear() | |
|
2737 | self.volOpCebChannels.setCheckState(0) | |
|
2738 | else: | |
|
2739 | channelEnabled = False | |
|
2740 | try: | |
|
2741 | value = opObj.getParameterValue(parameterName='channelList') | |
|
2742 | value = str(value)[1:-1] | |
|
2743 | channelEnabled = True | |
|
2744 | channelMode = 0 | |
|
2745 | except: | |
|
2746 | pass | |
|
2747 | try: | |
|
2748 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
|
2749 | value = str(value)[1:-1] | |
|
2750 | channelEnabled = True | |
|
2751 | channelMode = 1 | |
|
2752 | except: | |
|
2753 | pass | |
|
2613 | 2754 | |
|
2614 | def refreshPUProperties(self, puObjView): | |
|
2755 | if channelEnabled: | |
|
2756 | self.volOpChannel.setText(value) | |
|
2757 | self.volOpChannel.setEnabled(True) | |
|
2758 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
|
2759 | self.volOpComChannels.setCurrentIndex(channelMode) | |
|
2615 | 2760 | |
|
2616 | propertyBuffObj = PropertyBuffer() | |
|
2761 | opObj = puObj.getOperationObj(name="selectHeights") | |
|
2762 | if opObj == None: | |
|
2763 | self.volOpHeights.clear() | |
|
2764 | self.volOpCebHeights.setCheckState(0) | |
|
2765 | else: | |
|
2766 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
|
2767 | value1 = str(value1) | |
|
2768 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
|
2769 | value2 = str(value2) | |
|
2770 | value = value1 + "," + value2 | |
|
2771 | self.volOpHeights.setText(value) | |
|
2772 | self.volOpHeights.setEnabled(True) | |
|
2773 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
|
2617 | 2774 | |
|
2618 | for thisOp in puObjView.getOperationObjList(): | |
|
2775 | opObj = puObj.getOperationObj(name="filterByHeights") | |
|
2776 | if opObj == None: | |
|
2777 | self.volOpFilter.clear() | |
|
2778 | self.volOpCebFilter.setCheckState(0) | |
|
2779 | else: | |
|
2780 | value = opObj.getParameterValue(parameterName='window') | |
|
2781 | value = str(value) | |
|
2782 | self.volOpFilter.setText(value) | |
|
2783 | self.volOpFilter.setEnabled(True) | |
|
2784 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
|
2619 | 2785 | |
|
2620 | operationName = thisOp.name | |
|
2621 | if operationName == 'run': | |
|
2622 | operationName = 'Properties' | |
|
2786 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
|
2787 | if opObj == None: | |
|
2788 | self.volOpProfile.clear() | |
|
2789 | self.volOpCebProfile.setCheckState(0) | |
|
2623 | 2790 | else: |
|
2624 |
|
|
|
2625 | propertyBuffObj.append(operationName, '--', '--') | |
|
2791 | for parmObj in opObj.getParameterObjList(): | |
|
2626 | 2792 | |
|
2627 | for thisParmObj in thisOp.getParameterObjList(): | |
|
2793 | if parmObj.name == "profileList": | |
|
2794 | value = parmObj.getValue() | |
|
2795 | value = str(value)[1:-1] | |
|
2796 | self.volOpProfile.setText(value) | |
|
2797 | self.volOpProfile.setEnabled(True) | |
|
2798 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
|
2799 | self.volOpComProfile.setCurrentIndex(0) | |
|
2628 | 2800 | |
|
2629 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
|
2801 | if parmObj.name == "profileRangeList": | |
|
2802 | value = parmObj.getValue() | |
|
2803 | value = str(value)[1:-1] | |
|
2804 | self.volOpProfile.setText(value) | |
|
2805 | self.volOpProfile.setEnabled(True) | |
|
2806 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
|
2807 | self.volOpComProfile.setCurrentIndex(1) | |
|
2630 | 2808 | |
|
2631 | propertiesModel = propertyBuffObj.getPropertyModel() | |
|
2809 | if parmObj.name == "rangeList": | |
|
2810 | value = parmObj.getValue() | |
|
2811 | value = str(value)[1:-1] | |
|
2812 | self.volOpProfile.setText(value) | |
|
2813 | self.volOpProfile.setEnabled(True) | |
|
2814 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
|
2815 | self.volOpComProfile.setCurrentIndex(2) | |
|
2632 | 2816 | |
|
2633 | self.treeProjectProperties.setModel(propertiesModel) | |
|
2634 | self.treeProjectProperties.expandAll() | |
|
2635 | self.treeProjectProperties.resizeColumnToContents(0) | |
|
2636 | self.treeProjectProperties.resizeColumnToContents(1) | |
|
2637 | ||
|
2638 | def on_click(self, index): | |
|
2639 | ||
|
2640 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
|
2641 | ||
|
2642 | projectObjView = self.getSelectedProjectObj() | |
|
2643 | ||
|
2644 | if not projectObjView: | |
|
2645 | return | |
|
2646 | ||
|
2647 | #A project has been selected | |
|
2648 | if projectObjView == self.getSelectedItemObj(): | |
|
2649 | ||
|
2650 | self.refreshProjectWindow2(projectObjView) | |
|
2651 | self.refreshProjectProperties(projectObjView) | |
|
2652 | ||
|
2653 | self.tabProject.setEnabled(True) | |
|
2654 | self.tabVoltage.setEnabled(False) | |
|
2655 | self.tabSpectra.setEnabled(False) | |
|
2656 | self.tabCorrelation.setEnabled(False) | |
|
2657 | self.tabSpectraHeis.setEnabled(False) | |
|
2658 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
2659 | ||
|
2660 | return | |
|
2661 | ||
|
2662 | #A processing unit has been selected | |
|
2663 | voltEnable = False | |
|
2664 | specEnable = False | |
|
2665 | corrEnable = False | |
|
2666 | specHeisEnable = False | |
|
2667 | tabSelected = self.tabProject | |
|
2668 | ||
|
2669 | puObj = self.getSelectedItemObj() | |
|
2670 | inputId = puObj.getInputId() | |
|
2671 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
|
2672 | ||
|
2673 | if self.selectedItemTree.text() == 'Voltage': | |
|
2674 | datatype = 'Voltage' | |
|
2675 | ||
|
2676 | if len(puObj.getOperationObjList()) == 1: | |
|
2677 | self.clearPUWindow(datatype) | |
|
2678 | else: | |
|
2679 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
2680 | self.refreshPUProperties(puObj) | |
|
2681 | ||
|
2682 | voltEnable = True | |
|
2683 | tabSelected = self.tabVoltage | |
|
2684 | ||
|
2685 | if self.selectedItemTree.text() == 'Spectra': | |
|
2686 | ||
|
2687 | datatype = 'Spectra' | |
|
2688 | ||
|
2689 | if inputPUObj.datatype == 'Spectra': | |
|
2690 | self.specOpnFFTpoints.setEnabled(False) | |
|
2691 | self.specOpProfiles.setEnabled(False) | |
|
2692 | self.specOpippFactor.setEnabled(False) | |
|
2693 | else: | |
|
2694 | self.specOpnFFTpoints.setEnabled(True) | |
|
2695 | self.specOpProfiles.setEnabled(True) | |
|
2696 | self.specOpippFactor.setEnabled(True) | |
|
2697 | ||
|
2698 | if len(puObj.getOperationObjList()) == 1: | |
|
2699 | self.clearPUWindow(datatype) | |
|
2700 | ||
|
2701 | opObj = puObj.getOperationObj(name="run") | |
|
2817 | opObj = puObj.getOperationObj(name="Decoder") | |
|
2818 | self.volOpCode.setText("") | |
|
2702 | 2819 | if opObj == None: |
|
2703 | self.specOpnFFTpoints.clear() | |
|
2704 | self.specOpProfiles.clear() | |
|
2705 | self.specOpippFactor.clear() | |
|
2706 | else: | |
|
2707 | parmObj = opObj.getParameterObj(parameterName='nFFTPoints') | |
|
2708 | if parmObj == None: | |
|
2709 | self.specOpnFFTpoints.clear() | |
|
2820 | self.volOpCebDecodification.setCheckState(0) | |
|
2710 | 2821 | else: |
|
2711 | value = opObj.getParameterValue(parameterName='nFFTPoints') | |
|
2712 | self.specOpnFFTpoints.setText(str(value)) | |
|
2822 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
|
2713 | 2823 | |
|
2714 |
|
|
|
2715 | if parmObj == None: | |
|
2716 | self.specOpProfiles.clear() | |
|
2717 | else: | |
|
2718 | value = opObj.getParameterValue(parameterName='nProfiles') | |
|
2719 | self.specOpProfiles.setText(str(value)) | |
|
2824 | parmObj = opObj.getParameterObj('code') | |
|
2720 | 2825 | |
|
2721 | parmObj = opObj.getParameterObj(parameterName="ippFactor") | |
|
2722 | if parmObj == None: | |
|
2723 | self.specOpippFactor.clear() | |
|
2724 | else: | |
|
2725 | value = opObj.getParameterValue(parameterName='ippFactor') | |
|
2726 | self.specOpippFactor.setText(str(value)) | |
|
2727 | ||
|
2728 | opObj = puObj.getOperationObj(name="run") | |
|
2729 | if opObj == None: | |
|
2730 | self.specOppairsList.clear() | |
|
2731 | self.specOpCebCrossSpectra.setCheckState(0) | |
|
2732 | else: | |
|
2733 | parmObj = opObj.getParameterObj(parameterName='pairsList') | |
|
2734 | 2826 | if parmObj == None: |
|
2735 | self.specOppairsList.clear() | |
|
2736 | self.specOpCebCrossSpectra.setCheckState(0) | |
|
2737 | else: | |
|
2738 | value = opObj.getParameterValue(parameterName='pairsList') | |
|
2739 | value = str(value)[1:-1] | |
|
2740 | self.specOppairsList.setText(str(value)) | |
|
2741 | self.specOppairsList.setEnabled(True) | |
|
2742 | self.specOpCebCrossSpectra.setCheckState(QtCore.Qt.Checked) | |
|
2743 | ||
|
2744 | else: | |
|
2745 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
2746 | self.refreshPUProperties(puObj) | |
|
2747 | ||
|
2748 | specEnable = True | |
|
2749 | tabSelected = self.tabSpectra | |
|
2750 | ||
|
2751 | if self.selectedItemTree.text() == 'Correlation': | |
|
2752 | ||
|
2753 | corrEnable = True | |
|
2754 | tabSelected = self.tabCorrelation | |
|
2755 | ||
|
2756 | if self.selectedItemTree.text() == 'SpectraHeis': | |
|
2757 | datatype = 'SpectraHeis' | |
|
2758 | ||
|
2759 | if len(puObj.getOperationObjList()) == 1: | |
|
2760 | self.clearPUWindow(datatype) | |
|
2761 | else: | |
|
2762 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
2763 | self.refreshPUProperties(puObj) | |
|
2764 | ||
|
2765 | specHeisEnable = False | |
|
2766 | tabSelected = self.tabSpectraHeis | |
|
2767 | ||
|
2768 | self.tabProject.setEnabled(False) | |
|
2769 | self.tabVoltage.setEnabled(voltEnable) | |
|
2770 | self.tabSpectra.setEnabled(specEnable) | |
|
2771 | self.tabCorrelation.setEnabled(corrEnable) | |
|
2772 | self.tabSpectraHeis.setEnabled(specHeisEnable) | |
|
2773 | self.tabWidgetProject.setCurrentWidget(tabSelected) | |
|
2774 | ||
|
2775 | def on_right_click(self, pos): | |
|
2776 | ||
|
2777 | self.menu = QtGui.QMenu() | |
|
2778 | quitAction0 = self.menu.addAction("Create a New Project") | |
|
2779 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
|
2780 | quitAction2 = self.menu.addAction("Delete Item") | |
|
2781 | quitAction3 = self.menu.addAction("Quit") | |
|
2782 | ||
|
2783 | if len(self.__itemTreeDict) == 0: | |
|
2784 | quitAction2.setEnabled(False) | |
|
2785 | else: | |
|
2786 | quitAction2.setEnabled(True) | |
|
2787 | ||
|
2788 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
|
2789 | ||
|
2790 | if action == quitAction0: | |
|
2791 | self. setInputsProject_View() | |
|
2792 | self.create = True | |
|
2793 | ||
|
2794 | if action == quitAction1: | |
|
2795 | if len(self.__projectObjDict) == 0: | |
|
2796 | outputstr = "You need to create a Project before adding a Processing Unit" | |
|
2797 | self.console.clear() | |
|
2798 | self.console.append(outputstr) | |
|
2799 | return 0 | |
|
2800 | else: | |
|
2801 | self.addPUWindow() | |
|
2802 | self.console.clear() | |
|
2803 | self.console.append("Please, Choose the type of Processing Unit") | |
|
2804 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
|
2805 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
|
2806 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
|
2807 | ||
|
2808 | if action == quitAction2: | |
|
2809 | index = self.selectedItemTree | |
|
2810 | try: | |
|
2811 | index.parent() | |
|
2812 | except: | |
|
2813 | self.console.append('Please first select a Project or Processing Unit') | |
|
2814 | return 0 | |
|
2815 | # print index.parent(),index | |
|
2816 | if index.parent() == None: | |
|
2817 | self.projectExplorerModel.removeRow(index.row()) | |
|
2818 | else: | |
|
2819 | index.parent().removeRow(index.row()) | |
|
2820 | self.removeItemTreeFromProject() | |
|
2821 | self.console.clear() | |
|
2822 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
|
2823 | # print i.row() | |
|
2824 | ||
|
2825 | if action == quitAction3: | |
|
2826 | self.close() | |
|
2827 | return 0 | |
|
2828 | ||
|
2829 | def refreshProjectWindow(self, project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set): | |
|
2830 | ||
|
2831 | self.proName.setText(str(project_name)) | |
|
2832 | ||
|
2833 | if datatype == 'Voltage': | |
|
2834 | ext = '.r' | |
|
2835 | value = 0 | |
|
2836 | elif datatype == 'Spectra': | |
|
2837 | ext = '.pdata' | |
|
2838 | value = 1 | |
|
2839 | elif datatype == 'Fits': | |
|
2840 | ext = '.fits' | |
|
2841 | value = 2 | |
|
2842 | elif datatype == 'USRP': | |
|
2843 | ext = '.hdf5' | |
|
2844 | value = 3 | |
|
2845 | ||
|
2846 | self.proDataType.setText(ext) | |
|
2847 | self.proDataPath.setText(str(data_path)) | |
|
2848 | self.proComDataType.setCurrentIndex(value) | |
|
2849 | self.proComReadMode.setCurrentIndex(int(online)) | |
|
2850 | self.proDelay.setText(str(delay)) | |
|
2851 | self.proSet.setText(str(set)) | |
|
2852 | self.proComStartDate.clear() | |
|
2853 | self.proComEndDate.clear() | |
|
2854 | self.proComStartDate.addItem(str(startDate)) | |
|
2855 | self.proComEndDate.addItem(str(endDate)) | |
|
2856 | starTime = str(startTime) | |
|
2857 | starlist = starTime.split(":") | |
|
2858 | endTime = str(endTime) | |
|
2859 | endlist = endTime.split(":") | |
|
2860 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
|
2861 | self.proStartTime.setTime(self.time) | |
|
2862 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
|
2863 | self.proEndTime.setTime(self.time) | |
|
2864 | self.proDescription.clear() | |
|
2865 | self.proDescription.append(description) | |
|
2866 | ||
|
2867 | def refreshPUWindow(self, datatype, puObj): | |
|
2868 | ||
|
2869 | if datatype == 'Voltage': | |
|
2870 | opObj = puObj.getOperationObj(name='setRadarFrequency') | |
|
2871 | if opObj == None: | |
|
2872 | self.volOpRadarfrequency.clear() | |
|
2873 | self.volOpCebRadarfrequency.setCheckState(0) | |
|
2874 | else: | |
|
2875 | value = opObj.getParameterValue(parameterName='frequency') | |
|
2876 | value = str(value) | |
|
2877 | self.volOpRadarfrequency.setText(value) | |
|
2878 | self.volOpRadarfrequency.setEnabled(True) | |
|
2879 | self.volOpCebRadarfrequency.setCheckState(QtCore.Qt.Checked) | |
|
2880 | ||
|
2881 | ||
|
2882 | opObj = puObj.getOperationObj(name="selectChannels") | |
|
2883 | ||
|
2884 | if opObj == None: | |
|
2885 | opObj = puObj.getOperationObj(name="selectChannelsByIndex") | |
|
2886 | ||
|
2887 | if opObj == None: | |
|
2888 | self.volOpChannel.clear() | |
|
2889 | self.volOpCebChannels.setCheckState(0) | |
|
2827 | self.volOpComCode.setCurrentIndex(0) | |
|
2890 | 2828 | else: |
|
2891 | channelEnabled = False | |
|
2892 | try: | |
|
2893 | value = opObj.getParameterValue(parameterName='channelList') | |
|
2894 | value = str(value)[1:-1] | |
|
2895 | channelEnabled = True | |
|
2896 | channelMode = 0 | |
|
2897 | except: | |
|
2898 | pass | |
|
2899 | try: | |
|
2900 | value = opObj.getParameterValue(parameterName='channelIndexList') | |
|
2901 | value = str(value)[1:-1] | |
|
2902 | channelEnabled = True | |
|
2903 | channelMode = 1 | |
|
2904 | except: | |
|
2905 | pass | |
|
2906 | 2829 | |
|
2907 | if channelEnabled: | |
|
2908 | self.volOpChannel.setText(value) | |
|
2909 | self.volOpChannel.setEnabled(True) | |
|
2910 | self.volOpCebChannels.setCheckState(QtCore.Qt.Checked) | |
|
2911 | self.volOpComChannels.setCurrentIndex(channelMode) | |
|
2830 | parmObj1 = opObj.getParameterObj('nCode') | |
|
2831 | parmObj2 = opObj.getParameterObj('nBaud') | |
|
2912 | 2832 | |
|
2913 | opObj = puObj.getOperationObj(name="selectHeights") | |
|
2914 | if opObj == None: | |
|
2915 | self.volOpHeights.clear() | |
|
2916 | self.volOpCebHeights.setCheckState(0) | |
|
2917 | else: | |
|
2918 | value1 = int(opObj.getParameterValue(parameterName='minHei')) | |
|
2919 | value1 = str(value1) | |
|
2920 | value2 = int(opObj.getParameterValue(parameterName='maxHei')) | |
|
2921 | value2 = str(value2) | |
|
2922 | value = value1 + "," + value2 | |
|
2923 | self.volOpHeights.setText(value) | |
|
2924 | self.volOpHeights.setEnabled(True) | |
|
2925 | self.volOpCebHeights.setCheckState(QtCore.Qt.Checked) | |
|
2926 | ||
|
2927 | opObj = puObj.getOperationObj(name="filterByHeights") | |
|
2928 | if opObj == None: | |
|
2929 | self.volOpFilter.clear() | |
|
2930 | self.volOpCebFilter.setCheckState(0) | |
|
2833 | if parmObj1 == None or parmObj2 == None: | |
|
2834 | self.volOpComCode.setCurrentIndex(0) | |
|
2931 | 2835 | else: |
|
2932 | value = opObj.getParameterValue(parameterName='window') | |
|
2933 | value = str(value) | |
|
2934 | self.volOpFilter.setText(value) | |
|
2935 | self.volOpFilter.setEnabled(True) | |
|
2936 | self.volOpCebFilter.setCheckState(QtCore.Qt.Checked) | |
|
2836 | code = ast.literal_eval(str(parmObj.getValue())) | |
|
2837 | nCode = parmObj1.getValue() | |
|
2838 | nBaud = parmObj2.getValue() | |
|
2937 | 2839 | |
|
2938 | opObj = puObj.getOperationObj(name="ProfileSelector") | |
|
2939 | if opObj == None: | |
|
2940 | self.volOpProfile.clear() | |
|
2941 | self.volOpCebProfile.setCheckState(0) | |
|
2942 | else: | |
|
2943 | for parmObj in opObj.getParameterObjList(): | |
|
2944 | if parmObj.name == "profileRangeList": | |
|
2945 | value = opObj.getParameterValue(parameterName='profileRangeList') | |
|
2946 | value = str(value)[1:-1] | |
|
2947 | self.volOpProfile.setText(value) | |
|
2948 | self.volOpProfile.setEnabled(True) | |
|
2949 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
|
2950 | self.volOpComProfile.setCurrentIndex(1) | |
|
2951 | if parmObj.name == "profileList": | |
|
2952 | value = opObj.getParameterValue(parameterName='profileList') | |
|
2953 | value = str(value)[1:-1] | |
|
2954 | self.volOpProfile.setText(value) | |
|
2955 | self.volOpProfile.setEnabled(True) | |
|
2956 | self.volOpCebProfile.setCheckState(QtCore.Qt.Checked) | |
|
2957 | self.volOpComProfile.setCurrentIndex(0) | |
|
2840 | code = numpy.asarray(code).reshape((nCode, nBaud)).tolist() | |
|
2958 | 2841 | |
|
2842 | #User defined by default | |
|
2843 | self.volOpComCode.setCurrentIndex(13) | |
|
2844 | self.volOpCode.setText(str(code)) | |
|
2959 | 2845 | |
|
2960 | opObj = puObj.getOperationObj(name="Decoder") | |
|
2961 |
if |
|
|
2962 | self.volOpCebDecodification.setCheckState(0) | |
|
2963 | else: | |
|
2964 | try: | |
|
2965 | valueCode = opObj.getParameterValue(parameterName='nCode') | |
|
2966 | status = "on" | |
|
2967 | except: | |
|
2968 | status = "off" | |
|
2969 | if not status == "off": | |
|
2970 | if int(valueCode) == 1: | |
|
2971 | valueBaud = opObj.getParameterValue(parameterName='nBaud') | |
|
2972 | if int(valueBaud) == 3: | |
|
2973 | self.volOpComCode.setCurrentIndex(0) | |
|
2974 | if int(valueBaud) == 4: | |
|
2846 | if nCode == 1: | |
|
2847 | if nBaud == 3: | |
|
2975 | 2848 | self.volOpComCode.setCurrentIndex(1) |
|
2976 |
if |
|
|
2849 | if nBaud == 4: | |
|
2977 | 2850 | self.volOpComCode.setCurrentIndex(2) |
|
2978 |
if |
|
|
2851 | if nBaud == 5: | |
|
2979 | 2852 | self.volOpComCode.setCurrentIndex(3) |
|
2980 |
if |
|
|
2853 | if nBaud == 7: | |
|
2981 | 2854 | self.volOpComCode.setCurrentIndex(4) |
|
2982 |
if |
|
|
2855 | if nBaud == 11: | |
|
2983 | 2856 | self.volOpComCode.setCurrentIndex(5) |
|
2984 |
|
|
|
2985 | valueBaud = opObj.getParameterValue(parameterName='nBaud') | |
|
2986 | if int(valueBaud) == 3: | |
|
2857 | if nBaud == 13: | |
|
2987 | 2858 | self.volOpComCode.setCurrentIndex(6) |
|
2988 |
|
|
|
2859 | ||
|
2860 | if nCode == 2: | |
|
2861 | if nBaud == 3: | |
|
2989 | 2862 | self.volOpComCode.setCurrentIndex(7) |
|
2990 |
if |
|
|
2863 | if nBaud == 4: | |
|
2991 | 2864 | self.volOpComCode.setCurrentIndex(8) |
|
2992 |
if |
|
|
2865 | if nBaud == 5: | |
|
2993 | 2866 | self.volOpComCode.setCurrentIndex(9) |
|
2994 |
if |
|
|
2867 | if nBaud == 7: | |
|
2995 | 2868 | self.volOpComCode.setCurrentIndex(10) |
|
2996 |
if |
|
|
2869 | if nBaud == 11: | |
|
2997 | 2870 | self.volOpComCode.setCurrentIndex(11) |
|
2998 | ||
|
2999 | for parmObj in opObj.getParameterObjList(): | |
|
3000 | if parmObj.name == "nBaud": | |
|
3001 | value = opObj.getParameterValue(parameterName='nBaud') | |
|
3002 | if parmObj.name == "mode": | |
|
3003 | value = opObj.getParameterValue(parameterName='mode') | |
|
3004 | self.volOpComMode.setCurrentIndex(value) | |
|
3005 | else: | |
|
2871 | if nBaud == 13: | |
|
3006 | 2872 | self.volOpComCode.setCurrentIndex(12) |
|
3007 | self.volOpCebDecodification.setCheckState(QtCore.Qt.Checked) | |
|
2873 | ||
|
3008 | 2874 | |
|
3009 | 2875 | opObj = puObj.getOperationObj(name="deFlip") |
|
3010 | 2876 | if opObj == None: |
@@ -3037,74 +2903,106 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3037 | 2903 | self.volGraphCebshow.setCheckState(0) |
|
3038 | 2904 | else: |
|
3039 | 2905 | self.volGraphCebshow.setCheckState(QtCore.Qt.Checked) |
|
3040 | value = opObj.getParameterObj(parameterName='channelList') | |
|
3041 | if value == None: | |
|
2906 | ||
|
2907 | parmObj = opObj.getParameterObj(parameterName='channelList') | |
|
2908 | ||
|
2909 | if parmObj == None: | |
|
3042 | 2910 | self.volGraphChannelList.clear() |
|
3043 | 2911 | else: |
|
3044 |
|
|
|
3045 |
|
|
|
2912 | value = parmObj.getValue() | |
|
2913 | value = str(value) | |
|
3046 | 2914 | self.volGraphChannelList.setText(value) |
|
3047 | 2915 | self.volOpProfile.setEnabled(True) |
|
3048 | 2916 | |
|
3049 |
|
|
|
3050 | if parmObj.name == "xmin": | |
|
3051 | value1 = opObj.getParameterValue(parameterName='xmin') | |
|
2917 | parmObj1 = opObj.getParameterObj(parameterName='xmin') | |
|
2918 | parmObj2 = opObj.getParameterObj(parameterName='xmax') | |
|
2919 | ||
|
2920 | if parmObj1 == None or parmObj2 ==None: | |
|
2921 | self.volGraphfreqrange.clear() | |
|
2922 | else: | |
|
2923 | value1 = parmObj1.getValue() | |
|
3052 | 2924 | value1 = str(value1) |
|
3053 |
|
|
|
2925 | value2 = parmObj2.getValue() | |
|
3054 | 2926 | value2 = str(value2) |
|
3055 | 2927 | value = value1 + "," + value2 |
|
3056 | 2928 | self.volGraphfreqrange.setText(value) |
|
2929 | ||
|
2930 | parmObj1 = opObj.getParameterObj(parameterName='ymin') | |
|
2931 | parmObj2 = opObj.getParameterObj(parameterName='ymax') | |
|
2932 | ||
|
2933 | if parmObj1 == None or parmObj2 ==None: | |
|
2934 | self.volGraphHeightrange.clear() | |
|
3057 | 2935 | else: |
|
3058 | self.volGraphfreqrange.clear() | |
|
3059 | for parmObj in opObj.getParameterObjList(): | |
|
3060 | if parmObj.name == "ymin": | |
|
3061 | value1 = opObj.getParameterValue(parameterName='ymin') | |
|
2936 | value1 = parmObj1.getValue() | |
|
3062 | 2937 | value1 = str(value1) |
|
3063 |
|
|
|
2938 | value2 = parmObj2.getValue() | |
|
3064 | 2939 | value2 = str(value2) |
|
3065 | 2940 | value = value1 + "," + value2 |
|
3066 | 2941 | value2 = str(value2) |
|
3067 | 2942 | self.volGraphHeightrange.setText(value) |
|
3068 | else: | |
|
3069 | self.volGraphHeightrange.clear() | |
|
3070 | 2943 | |
|
2944 | parmObj = opObj.getParameterObj(parameterName='save') | |
|
3071 | 2945 | |
|
3072 | for parmObj in opObj.getParameterObjList(): | |
|
3073 | if parmObj.name == "save": | |
|
2946 | if parmObj == None: | |
|
2947 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) | |
|
2948 | else: | |
|
2949 | value = parmObj.getValue() | |
|
2950 | if int(value): | |
|
3074 | 2951 | self.volGraphCebSave.setCheckState(QtCore.Qt.Checked) |
|
3075 | 2952 | else: |
|
3076 | 2953 | self.volGraphCebSave.setCheckState(QtCore.Qt.Unchecked) |
|
3077 | 2954 | |
|
2955 | parmObj = opObj.getParameterObj(parameterName='figpath') | |
|
2956 | if parmObj == None: | |
|
2957 | self.volGraphPath.clear() | |
|
2958 | else: | |
|
2959 | value = parmObj.getValue() | |
|
2960 | path = str(value) | |
|
2961 | self.volGraphPath.setText(path) | |
|
2962 | ||
|
2963 | parmObj = opObj.getParameterObj(parameterName='figfile') | |
|
2964 | if parmObj == None: | |
|
2965 | self.volGraphPrefix.clear() | |
|
2966 | else: | |
|
2967 | value = parmObj.getValue() | |
|
2968 | figfile = str(value) | |
|
2969 | self.volGraphPrefix.setText(figfile) | |
|
2970 | ||
|
3078 | 2971 | # outputVoltageWrite |
|
3079 | 2972 | opObj = puObj.getOperationObj(name='VoltageWriter') |
|
2973 | ||
|
3080 | 2974 | if opObj == None: |
|
3081 | 2975 | self.volOutputPath.clear() |
|
3082 | 2976 | self.volOutputblocksperfile.clear() |
|
3083 | 2977 | self.volOutputprofilesperblock.clear() |
|
3084 | 2978 | else: |
|
3085 |
|
|
|
3086 |
|
|
|
2979 | parmObj = opObj.getParameterObj(parameterName='path') | |
|
2980 | if parmObj == None: | |
|
3087 | 2981 | self.volOutputPath.clear() |
|
3088 | 2982 | else: |
|
3089 |
|
|
|
2983 | value = parmObj.getValue() | |
|
3090 | 2984 | path = str(value) |
|
3091 | 2985 | self.volOutputPath.setText(path) |
|
3092 | value = opObj.getParameterObj(parameterName='blocksPerFile') | |
|
3093 | if value == None: | |
|
2986 | ||
|
2987 | parmObj = opObj.getParameterObj(parameterName='blocksPerFile') | |
|
2988 | if parmObj == None: | |
|
3094 | 2989 | self.volOutputblocksperfile.clear() |
|
3095 | 2990 | else: |
|
3096 |
|
|
|
2991 | value = parmObj.getValue() | |
|
3097 | 2992 | blocksperfile = str(value) |
|
3098 | 2993 | self.volOutputblocksperfile.setText(blocksperfile) |
|
3099 | value = opObj.getParameterObj(parameterName='profilesPerBlock') | |
|
3100 | if value == None: | |
|
2994 | ||
|
2995 | parmObj = opObj.getParameterObj(parameterName='profilesPerBlock') | |
|
2996 | if parmObj == None: | |
|
3101 | 2997 | self.volOutputprofilesperblock.clear() |
|
3102 | 2998 | else: |
|
3103 |
|
|
|
2999 | value = parmObj.getValue() | |
|
3104 | 3000 | profilesPerBlock = str(value) |
|
3105 | 3001 | self.volOutputprofilesperblock.setText(profilesPerBlock) |
|
3106 | 3002 | |
|
3107 | if datatype == 'Spectra': | |
|
3003 | return | |
|
3004 | ||
|
3005 | def __refreshSpectraWindow(self, puObj): | |
|
3108 | 3006 | |
|
3109 | 3007 | opObj = puObj.getOperationObj(name='setRadarFrequency') |
|
3110 | 3008 | if opObj == None: |
@@ -3500,7 +3398,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3500 | 3398 | self.specGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) |
|
3501 | 3399 | value = opObj.getParameterValue(parameterName='figpath') |
|
3502 | 3400 | self.specGraphPath.setText(value) |
|
3503 | #---------add----# | |
|
3401 | ||
|
3504 | 3402 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3505 | 3403 | if parmObj == None: |
|
3506 | 3404 | self.specGraphftpRTIplot.setCheckState(0) |
@@ -3699,7 +3597,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3699 | 3597 | self.specGraphSaveRTInoise.setCheckState(QtCore.Qt.Checked) |
|
3700 | 3598 | value = opObj.getParameterValue(parameterName='figpath') |
|
3701 | 3599 | self.specGraphPath.setText(value) |
|
3702 | #---------add----# | |
|
3600 | ||
|
3703 | 3601 | parmObj = opObj.getParameterObj(parameterName="ftp") |
|
3704 | 3602 | if parmObj == None: |
|
3705 | 3603 | self.specGraphftpRTInoise.setCheckState(0) |
@@ -3740,7 +3638,10 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3740 | 3638 | profilesPerBlock = str(value) |
|
3741 | 3639 | self.specOutputprofileperblock.setText(profilesPerBlock) |
|
3742 | 3640 | |
|
3743 | if datatype == 'SpectraHeis': | |
|
3641 | return | |
|
3642 | ||
|
3643 | def __refreshSpectraHeisWindow(self, puObj): | |
|
3644 | ||
|
3744 | 3645 | opObj = puObj.getOperationObj(name="IncohInt4SpectraHeis") |
|
3745 | 3646 | if opObj == None: |
|
3746 | 3647 | self.specHeisOpIncoherent.clear() |
@@ -3835,89 +3736,341 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3835 | 3736 | self.specGgraphChannelList.setText(channelListRTIPlot) |
|
3836 | 3737 | self.specGgraphChannelList.setEnabled(True) |
|
3837 | 3738 | |
|
3838 |
|
|
|
3839 |
|
|
|
3840 |
|
|
|
3739 | parmObj = opObj.getParameterObj(parameterName='xmin') | |
|
3740 | if parmObj == None: | |
|
3741 | self.specHeisGgraphTminTmax.clear() | |
|
3742 | else: | |
|
3743 | value1 = opObj.getParameterValue(parameterName='xmin') | |
|
3744 | value1 = str(value1) | |
|
3745 | value2 = opObj.getParameterValue(parameterName='xmax') | |
|
3746 | value2 = str(value2) | |
|
3747 | value = value1 + "," + value2 | |
|
3748 | self.specHeisGgraphTminTmax.setText(value) | |
|
3749 | self.specHeisGgraphTminTmax.setEnabled(True) | |
|
3750 | ||
|
3751 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
|
3752 | if parmObj == None: | |
|
3753 | self.specGgraphTimeRange.clear() | |
|
3754 | else: | |
|
3755 | value1 = opObj.getParameterValue(parameterName='timerange') | |
|
3756 | value1 = str(value1) | |
|
3757 | self.specHeisGgraphTimeRange.setText(value1) | |
|
3758 | self.specHeisGgraphTimeRange.setEnabled(True) | |
|
3759 | ||
|
3760 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
|
3761 | if parmObj == None: | |
|
3762 | self.specHeisGgraphYminYmax.clear() | |
|
3763 | else: | |
|
3764 | value1 = opObj.getParameterValue(parameterName='ymin') | |
|
3765 | value1 = str(value1) | |
|
3766 | value2 = opObj.getParameterValue(parameterName='ymax') | |
|
3767 | value2 = str(value2) | |
|
3768 | value = value1 + "," + value2 | |
|
3769 | self.specHeisGgraphYminYmax.setText(value) | |
|
3770 | self.specHeisGgraphYminYmax.setEnabled(True) | |
|
3771 | ||
|
3772 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
|
3773 | if parmObj == None: | |
|
3774 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
|
3775 | else: | |
|
3776 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
|
3777 | value = opObj.getParameterValue(parameterName='figpath') | |
|
3778 | self.specHeisGraphPath.setText(value) | |
|
3779 | ||
|
3780 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
|
3781 | if parmObj == None: | |
|
3782 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
|
3783 | else: | |
|
3784 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
|
3785 | try: | |
|
3786 | value = opObj.getParameterValue(parameterName='wr_period') | |
|
3787 | except: | |
|
3788 | value = " " | |
|
3789 | self.specHeisGgraphftpratio.setText(str(value)) | |
|
3790 | ||
|
3791 | # outputSpectraHeisWrite | |
|
3792 | opObj = puObj.getOperationObj(name='FitsWriter') | |
|
3793 | if opObj == None: | |
|
3794 | self.specHeisOutputPath.clear() | |
|
3795 | self.specHeisOutputblocksperfile.clear() | |
|
3796 | self.specHeisOutputMetada.clear() | |
|
3797 | else: | |
|
3798 | value = opObj.getParameterObj(parameterName='path') | |
|
3799 | if value == None: | |
|
3800 | self.specHeisOutputPath.clear() | |
|
3801 | else: | |
|
3802 | value = opObj.getParameterValue(parameterName='path') | |
|
3803 | path = str(value) | |
|
3804 | self.specHeisOutputPath.setText(path) | |
|
3805 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
|
3806 | if value == None: | |
|
3807 | self.specHeisOutputblocksperfile.clear() | |
|
3808 | else: | |
|
3809 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
|
3810 | blocksperfile = str(value) | |
|
3811 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
|
3812 | value = opObj.getParameterObj(parameterName='metadatafile') | |
|
3813 | if value == None: | |
|
3814 | self.specHeisOutputMetada.clear() | |
|
3815 | else: | |
|
3816 | value = opObj.getParameterValue(parameterName='metadatafile') | |
|
3817 | metada = str(value) | |
|
3818 | self.specHeisOutputMetada.setText(metada) | |
|
3819 | ||
|
3820 | return | |
|
3821 | ||
|
3822 | def __refreshCorrelationWindow(self, puObj): | |
|
3823 | pass | |
|
3824 | ||
|
3825 | def refreshPUWindow(self, datatype, puObj): | |
|
3826 | ||
|
3827 | if datatype == 'Voltage': | |
|
3828 | self.__refreshVoltageWindow(puObj) | |
|
3829 | ||
|
3830 | if datatype == 'Spectra': | |
|
3831 | self.__refreshSpectraWindow(puObj) | |
|
3832 | ||
|
3833 | if datatype == 'SpectraHeis': | |
|
3834 | self.__refreshSpectraHeisWindow(puObj) | |
|
3835 | ||
|
3836 | def refreshProjectProperties(self, projectObjView): | |
|
3837 | ||
|
3838 | propertyBuffObj = PropertyBuffer() | |
|
3839 | name = projectObjView.name | |
|
3840 | ||
|
3841 | propertyBuffObj.append("Properties", "Name", projectObjView.name), | |
|
3842 | propertyBuffObj.append("Properties", "Description", projectObjView.description) | |
|
3843 | propertyBuffObj.append("Properties", "Workspace", self.pathWorkSpace) | |
|
3844 | ||
|
3845 | readUnitObj = projectObjView.getReadUnitObj() | |
|
3846 | runOperationObj = readUnitObj.getOperationObj(name='run') | |
|
3847 | ||
|
3848 | for thisParmObj in runOperationObj.getParameterObjList(): | |
|
3849 | propertyBuffObj.append("Reading parms", thisParmObj.name, str(thisParmObj.getValue())) | |
|
3850 | ||
|
3851 | propertiesModel = propertyBuffObj.getPropertyModel() | |
|
3852 | ||
|
3853 | self.treeProjectProperties.setModel(propertiesModel) | |
|
3854 | self.treeProjectProperties.expandAll() | |
|
3855 | self.treeProjectProperties.resizeColumnToContents(0) | |
|
3856 | self.treeProjectProperties.resizeColumnToContents(1) | |
|
3857 | ||
|
3858 | def refreshPUProperties(self, puObjView): | |
|
3859 | ||
|
3860 | propertyBuffObj = PropertyBuffer() | |
|
3861 | ||
|
3862 | for thisOp in puObjView.getOperationObjList(): | |
|
3863 | ||
|
3864 | operationName = thisOp.name | |
|
3865 | if operationName == 'run': | |
|
3866 | operationName = 'Properties' | |
|
3867 | else: | |
|
3868 | if not thisOp.getParameterObjList(): | |
|
3869 | propertyBuffObj.append(operationName, '--', '--') | |
|
3870 | ||
|
3871 | for thisParmObj in thisOp.getParameterObjList(): | |
|
3872 | ||
|
3873 | propertyBuffObj.append(operationName, thisParmObj.name, str(thisParmObj.getValue())) | |
|
3874 | ||
|
3875 | propertiesModel = propertyBuffObj.getPropertyModel() | |
|
3876 | ||
|
3877 | self.treeProjectProperties.setModel(propertiesModel) | |
|
3878 | self.treeProjectProperties.expandAll() | |
|
3879 | self.treeProjectProperties.resizeColumnToContents(0) | |
|
3880 | self.treeProjectProperties.resizeColumnToContents(1) | |
|
3881 | ||
|
3882 | def refreshGraphicsId(self): | |
|
3883 | ||
|
3884 | projectObj = self.getSelectedProjectObj() | |
|
3885 | ||
|
3886 | for idPU, puObj in projectObj.procUnitConfObjDict.items(): | |
|
3887 | ||
|
3888 | for opObj in puObj.getOperationObjList(): | |
|
3889 | ||
|
3890 | if opObj.name not in ('Scope', 'SpectraPlot', 'CrossSpectraPlot', 'RTIPlot', 'CoherenceMap', 'PowerProfilePlot', 'Noise', 'SpectraHeisScope', 'RTIfromSpectraHeis'): | |
|
3891 | continue | |
|
3892 | ||
|
3893 | opObj.changeParameter(name='id', value=opObj.id, format='int') | |
|
3894 | ||
|
3895 | def on_click(self, index): | |
|
3896 | ||
|
3897 | self.console.clear() | |
|
3898 | ||
|
3899 | self.selectedItemTree = self.projectExplorerModel.itemFromIndex(index) | |
|
3900 | ||
|
3901 | projectObjView = self.getSelectedProjectObj() | |
|
3902 | ||
|
3903 | if not projectObjView: | |
|
3904 | return | |
|
3905 | ||
|
3906 | self.create = False | |
|
3907 | selectedObjView = self.getSelectedItemObj() | |
|
3908 | ||
|
3909 | #A project has been selected | |
|
3910 | if projectObjView == selectedObjView: | |
|
3911 | ||
|
3912 | self.refreshProjectWindow2(projectObjView) | |
|
3913 | self.refreshProjectProperties(projectObjView) | |
|
3914 | ||
|
3915 | self.tabProject.setEnabled(True) | |
|
3916 | self.tabVoltage.setEnabled(False) | |
|
3917 | self.tabSpectra.setEnabled(False) | |
|
3918 | self.tabCorrelation.setEnabled(False) | |
|
3919 | self.tabSpectraHeis.setEnabled(False) | |
|
3920 | self.tabWidgetProject.setCurrentWidget(self.tabProject) | |
|
3921 | ||
|
3922 | return | |
|
3923 | ||
|
3924 | #A processing unit has been selected | |
|
3925 | voltEnable = False | |
|
3926 | specEnable = False | |
|
3927 | corrEnable = False | |
|
3928 | specHeisEnable = False | |
|
3929 | tabSelected = self.tabProject | |
|
3930 | ||
|
3931 | puObj = selectedObjView | |
|
3932 | inputId = puObj.getInputId() | |
|
3933 | inputPUObj = projectObjView.getProcUnitObj(inputId) | |
|
3934 | ||
|
3935 | if self.selectedItemTree.text() == 'Voltage': | |
|
3936 | datatype = 'Voltage' | |
|
3937 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
3938 | self.refreshPUProperties(puObj) | |
|
3939 | ||
|
3940 | voltEnable = True | |
|
3941 | tabSelected = self.tabVoltage | |
|
3942 | ||
|
3943 | if self.selectedItemTree.text() == 'Spectra': | |
|
3944 | ||
|
3945 | datatype = 'Spectra' | |
|
3946 | ||
|
3947 | if inputPUObj.datatype == 'Spectra': | |
|
3948 | self.specOpnFFTpoints.setEnabled(False) | |
|
3949 | self.specOpProfiles.setEnabled(False) | |
|
3950 | self.specOpippFactor.setEnabled(False) | |
|
3951 | else: | |
|
3952 | self.specOpnFFTpoints.setEnabled(True) | |
|
3953 | self.specOpProfiles.setEnabled(True) | |
|
3954 | self.specOpippFactor.setEnabled(True) | |
|
3955 | ||
|
3956 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
3957 | self.refreshPUProperties(puObj) | |
|
3958 | ||
|
3959 | specEnable = True | |
|
3960 | tabSelected = self.tabSpectra | |
|
3961 | ||
|
3962 | if self.selectedItemTree.text() == 'Correlation': | |
|
3963 | ||
|
3964 | corrEnable = True | |
|
3965 | tabSelected = self.tabCorrelation | |
|
3966 | ||
|
3967 | if self.selectedItemTree.text() == 'SpectraHeis': | |
|
3968 | datatype = 'SpectraHeis' | |
|
3969 | ||
|
3970 | self.refreshPUWindow(datatype=datatype, puObj=puObj) | |
|
3971 | self.refreshPUProperties(puObj) | |
|
3972 | ||
|
3973 | specHeisEnable = False | |
|
3974 | tabSelected = self.tabSpectraHeis | |
|
3975 | ||
|
3976 | self.tabProject.setEnabled(False) | |
|
3977 | self.tabVoltage.setEnabled(voltEnable) | |
|
3978 | self.tabSpectra.setEnabled(specEnable) | |
|
3979 | self.tabCorrelation.setEnabled(corrEnable) | |
|
3980 | self.tabSpectraHeis.setEnabled(specHeisEnable) | |
|
3981 | self.tabWidgetProject.setCurrentWidget(tabSelected) | |
|
3982 | ||
|
3983 | def on_right_click(self, pos): | |
|
3984 | ||
|
3985 | self.menu = QtGui.QMenu() | |
|
3986 | quitAction0 = self.menu.addAction("Create a New Project") | |
|
3987 | quitAction1 = self.menu.addAction("Create a New Processing Unit") | |
|
3988 | quitAction2 = self.menu.addAction("Delete Item") | |
|
3989 | quitAction3 = self.menu.addAction("Quit") | |
|
3990 | ||
|
3991 | if len(self.__itemTreeDict) == 0: | |
|
3992 | quitAction2.setEnabled(False) | |
|
3841 | 3993 | else: |
|
3842 | value1 = opObj.getParameterValue(parameterName='xmin') | |
|
3843 | value1 = str(value1) | |
|
3844 | value2 = opObj.getParameterValue(parameterName='xmax') | |
|
3845 | value2 = str(value2) | |
|
3846 | value = value1 + "," + value2 | |
|
3847 | self.specHeisGgraphTminTmax.setText(value) | |
|
3848 | self.specHeisGgraphTminTmax.setEnabled(True) | |
|
3994 | quitAction2.setEnabled(True) | |
|
3849 | 3995 | |
|
3850 | parmObj = opObj.getParameterObj(parameterName='timerange') | |
|
3851 | if parmObj == None: | |
|
3852 | self.specGgraphTimeRange.clear() | |
|
3853 | else: | |
|
3854 | value1 = opObj.getParameterValue(parameterName='timerange') | |
|
3855 | value1 = str(value1) | |
|
3856 | self.specHeisGgraphTimeRange.setText(value1) | |
|
3857 | self.specHeisGgraphTimeRange.setEnabled(True) | |
|
3996 | action = self.menu.exec_(self.mapToGlobal(pos)) | |
|
3858 | 3997 | |
|
3859 | parmObj = opObj.getParameterObj(parameterName='ymin') | |
|
3860 | if parmObj == None: | |
|
3861 | self.specHeisGgraphYminYmax.clear() | |
|
3862 | else: | |
|
3863 | value1 = opObj.getParameterValue(parameterName='ymin') | |
|
3864 | value1 = str(value1) | |
|
3865 | value2 = opObj.getParameterValue(parameterName='ymax') | |
|
3866 | value2 = str(value2) | |
|
3867 | value = value1 + "," + value2 | |
|
3868 | self.specHeisGgraphYminYmax.setText(value) | |
|
3869 | self.specHeisGgraphYminYmax.setEnabled(True) | |
|
3998 | if action == quitAction0: | |
|
3999 | self. setInputsProject_View() | |
|
4000 | self.create = True | |
|
3870 | 4001 | |
|
3871 | parmObj = opObj.getParameterObj(parameterName="figpath") | |
|
3872 |
|
|
|
3873 | self.specHeisGraphSaveRTIplot.setCheckState(0) | |
|
3874 |
|
|
|
3875 | self.specHeisGraphSaveRTIplot.setCheckState(QtCore.Qt.Checked) | |
|
3876 | value = opObj.getParameterValue(parameterName='figpath') | |
|
3877 | self.specHeisGraphPath.setText(value) | |
|
3878 | #---------add----# | |
|
3879 | parmObj = opObj.getParameterObj(parameterName="ftp") | |
|
3880 | if parmObj == None: | |
|
3881 | self.specHeisGraphftpRTIplot.setCheckState(0) | |
|
4002 | if action == quitAction1: | |
|
4003 | if len(self.__projectObjDict) == 0: | |
|
4004 | outputstr = "You need to create a Project before adding a Processing Unit" | |
|
4005 | self.console.clear() | |
|
4006 | self.console.append(outputstr) | |
|
4007 | return 0 | |
|
3882 | 4008 | else: |
|
3883 | self.specHeisGraphftpRTIplot.setCheckState(QtCore.Qt.Checked) | |
|
4009 | self.addPUWindow() | |
|
4010 | self.console.clear() | |
|
4011 | self.console.append("Please, Choose the type of Processing Unit") | |
|
4012 | # self.console.append("If your Datatype is rawdata, you will start with processing unit Type Voltage") | |
|
4013 | # self.console.append("If your Datatype is pdata, you will choose between processing unit Type Spectra or Correlation") | |
|
4014 | # self.console.append("If your Datatype is fits, you will start with processing unit Type SpectraHeis") | |
|
4015 | ||
|
4016 | if action == quitAction2: | |
|
4017 | index = self.selectedItemTree | |
|
3884 | 4018 | try: |
|
3885 | value = opObj.getParameterValue(parameterName='wr_period') | |
|
4019 | index.parent() | |
|
3886 | 4020 | except: |
|
3887 | value = " " | |
|
3888 | self.specHeisGgraphftpratio.setText(str(value)) | |
|
4021 | self.console.append('Please first select a Project or Processing Unit') | |
|
4022 | return 0 | |
|
4023 | # print index.parent(),index | |
|
4024 | if index.parent() == None: | |
|
4025 | self.projectExplorerModel.removeRow(index.row()) | |
|
4026 | else: | |
|
4027 | index.parent().removeRow(index.row()) | |
|
4028 | self.removeItemTreeFromProject() | |
|
4029 | self.console.clear() | |
|
4030 | # for i in self.projectExplorerTree.selectionModel().selection().indexes(): | |
|
4031 | # print i.row() | |
|
3889 | 4032 | |
|
4033 | if action == quitAction3: | |
|
4034 | self.close() | |
|
4035 | return 0 | |
|
3890 | 4036 | |
|
4037 | def refreshProjectWindow(self, project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set): | |
|
3891 | 4038 | |
|
3892 | # outputSpectraHeisWrite | |
|
3893 | opObj = puObj.getOperationObj(name='FitsWriter') | |
|
3894 |
|
|
|
3895 | self.specHeisOutputPath.clear() | |
|
3896 | self.specHeisOutputblocksperfile.clear() | |
|
3897 | self.specHeisOutputMetada.clear() | |
|
3898 |
e |
|
|
3899 | value = opObj.getParameterObj(parameterName='path') | |
|
3900 | if value == None: | |
|
3901 | self.specHeisOutputPath.clear() | |
|
3902 |
|
|
|
3903 | value = opObj.getParameterValue(parameterName='path') | |
|
3904 | path = str(value) | |
|
3905 | self.specHeisOutputPath.setText(path) | |
|
3906 | value = opObj.getParameterObj(parameterName='dataBlocksPerFile') | |
|
3907 | if value == None: | |
|
3908 | self.specHeisOutputblocksperfile.clear() | |
|
3909 | else: | |
|
3910 | value = opObj.getParameterValue(parameterName='dataBlocksPerFile') | |
|
3911 | blocksperfile = str(value) | |
|
3912 | self.specHeisOutputblocksperfile.setText(blocksperfile) | |
|
3913 | value = opObj.getParameterObj(parameterName='metadatafile') | |
|
3914 | if value == None: | |
|
3915 | self.specHeisOutputMetada.clear() | |
|
3916 | else: | |
|
3917 | value = opObj.getParameterValue(parameterName='metadatafile') | |
|
3918 | metada = str(value) | |
|
3919 | self.specHeisOutputMetada.setText(metada) | |
|
4039 | self.proName.setText(str(project_name)) | |
|
4040 | ||
|
4041 | if datatype == 'Voltage': | |
|
4042 | ext = '.r' | |
|
4043 | value = 0 | |
|
4044 | elif datatype == 'Spectra': | |
|
4045 | ext = '.pdata' | |
|
4046 | value = 1 | |
|
4047 | elif datatype == 'Fits': | |
|
4048 | ext = '.fits' | |
|
4049 | value = 2 | |
|
4050 | elif datatype == 'USRP': | |
|
4051 | ext = '.hdf5' | |
|
4052 | value = 3 | |
|
3920 | 4053 | |
|
4054 | self.proDataType.setText(ext) | |
|
4055 | self.proDataPath.setText(str(data_path)) | |
|
4056 | self.proComDataType.setCurrentIndex(value) | |
|
4057 | self.proComReadMode.setCurrentIndex(int(online)) | |
|
4058 | self.proDelay.setText(str(delay)) | |
|
4059 | self.proSet.setText(str(set)) | |
|
4060 | self.proComStartDate.clear() | |
|
4061 | self.proComEndDate.clear() | |
|
4062 | self.proComStartDate.addItem(str(startDate)) | |
|
4063 | self.proComEndDate.addItem(str(endDate)) | |
|
4064 | starTime = str(startTime) | |
|
4065 | starlist = starTime.split(":") | |
|
4066 | endTime = str(endTime) | |
|
4067 | endlist = endTime.split(":") | |
|
4068 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) | |
|
4069 | self.proStartTime.setTime(self.time) | |
|
4070 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) | |
|
4071 | self.proEndTime.setTime(self.time) | |
|
4072 | self.proDescription.clear() | |
|
4073 | self.proDescription.append(description) | |
|
3921 | 4074 | |
|
3922 | 4075 | |
|
3923 | 4076 | def setspecGraph(self): |
@@ -3965,86 +4118,120 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
3965 | 4118 | |
|
3966 | 4119 | def createProjectView(self, id): |
|
3967 | 4120 | |
|
3968 | self.create = False | |
|
3969 | project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
4121 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
4122 | id = str(id) | |
|
4123 | projectParms = self.__getParmsFromProjectWindow() | |
|
4124 | ||
|
4125 | if not projectParms.isValid(): | |
|
4126 | return None | |
|
3970 | 4127 | |
|
3971 | 4128 | projectObjView = Project() |
|
3972 |
projectObjView.setup(id=id, name=project |
|
|
4129 | projectObjView.setup(id=id, name=projectParms.name, description=projectParms.description) | |
|
3973 | 4130 | |
|
3974 | 4131 | self.__projectObjDict[id] = projectObjView |
|
4132 | self.addProject2ProjectExplorer(id=id, name=projectObjView.name) | |
|
4133 | ||
|
4134 | self.create = False | |
|
3975 | 4135 | |
|
3976 | 4136 | return projectObjView |
|
3977 | 4137 | |
|
3978 | 4138 | def updateProjectView(self): |
|
3979 | 4139 | |
|
3980 | project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
4140 | # project_name, description, datatype, data_path, starDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
4141 | ||
|
4142 | projectParms = self.__getParmsFromProjectWindow() | |
|
4143 | ||
|
4144 | if not projectParms.isValid(): | |
|
4145 | return None | |
|
3981 | 4146 | |
|
3982 | 4147 | projectObjView = self.getSelectedProjectObj() |
|
3983 |
projectObjView.update(name=project |
|
|
4148 | projectObjView.update(name=projectParms.name, description=projectParms.description) | |
|
3984 | 4149 | |
|
3985 | 4150 | return projectObjView |
|
3986 | 4151 | |
|
3987 | 4152 | def createReadUnitView(self, projectObjView): |
|
3988 | 4153 | |
|
3989 | project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
3990 | ||
|
3991 | if datatype == "Voltage" or datatype == "Spectra" or datatype == "Fits": | |
|
3992 | readUnitConfObj = projectObjView.addReadUnit(datatype=datatype, | |
|
3993 | path=data_path, | |
|
3994 | startDate=startDate, | |
|
3995 | endDate=endDate, | |
|
3996 | startTime=startTime, | |
|
3997 | endTime=endTime, | |
|
3998 |
|
|
|
3999 |
|
|
|
4000 |
|
|
|
4001 |
s |
|
|
4154 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk, set = self.getParmsFromProjectWindow() | |
|
4155 | ||
|
4156 | projectParms = self.__getParmsFromProjectWindow() | |
|
4157 | ||
|
4158 | if not projectParms.isValid(): | |
|
4159 | return None | |
|
4160 | ||
|
4161 | if projectParms.datatype in ("Voltage", "Spectra", "Fits"): | |
|
4162 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
|
4163 | path=projectParms.dpath, | |
|
4164 | startDate=projectParms.startDate, | |
|
4165 | endDate=projectParms.endDate, | |
|
4166 | startTime=projectParms.startTime, | |
|
4167 | endTime=projectParms.endTime, | |
|
4168 | online=projectParms.online, | |
|
4169 | walk=projectParms.walk | |
|
4002 | 4170 | ) |
|
4003 | 4171 | |
|
4004 | if datatype == "USRP": | |
|
4005 | readUnitConfObj = projectObjView.addReadUnit(datatype=datatype, | |
|
4006 | path=data_path, | |
|
4007 | startDate=startDate, | |
|
4008 | endDate=endDate, | |
|
4009 | startTime=startTime, | |
|
4010 | endTime=endTime, | |
|
4011 | online=online, | |
|
4012 |
|
|
|
4013 |
|
|
|
4172 | if projectParms.set: | |
|
4173 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
|
4174 | ||
|
4175 | if projectParms.delay: | |
|
4176 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
|
4177 | ||
|
4178 | if projectParms.datatype == "USRP": | |
|
4179 | readUnitConfObj = projectObjView.addReadUnit(datatype=projectParms.datatype, | |
|
4180 | path=projectParms.dpath, | |
|
4181 | startDate=projectParms.startDate, | |
|
4182 | endDate=projectParms.endDate, | |
|
4183 | startTime=projectParms.startTime, | |
|
4184 | endTime=projectParms.endTime, | |
|
4185 | online=projectParms.online, | |
|
4186 | ippKm=projectParms.ippKm | |
|
4014 | 4187 | ) |
|
4188 | ||
|
4189 | if projectParms.delay: | |
|
4190 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
|
4191 | ||
|
4015 | 4192 | return readUnitConfObj |
|
4016 | 4193 | |
|
4017 | 4194 | def updateReadUnitView(self, projectObjView, idReadUnit): |
|
4018 | 4195 | |
|
4019 | project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() | |
|
4196 | # project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, walk , set = self.getParmsFromProjectWindow() | |
|
4020 | 4197 | |
|
4021 | 4198 | readUnitConfObj = projectObjView.getProcUnitObj(idReadUnit) |
|
4022 | 4199 | |
|
4023 | if datatype == "Voltage" or datatype == "Spectra" or datatype == "Fits": | |
|
4024 | readUnitConfObj.update(datatype=datatype, | |
|
4025 | path=data_path, | |
|
4026 | startDate=startDate, | |
|
4027 | endDate=endDate, | |
|
4028 | startTime=startTime, | |
|
4029 | endTime=endTime, | |
|
4030 | online=online, | |
|
4031 | delay=delay, | |
|
4032 | walk=walk, | |
|
4033 | set=set | |
|
4034 | ) | |
|
4200 | projectParms = self.__getParmsFromProjectWindow() | |
|
4035 | 4201 | |
|
4036 | if datatype == "USRP": | |
|
4037 | readUnitConfObj.update(datatype=datatype, | |
|
4038 | path=data_path, | |
|
4039 | startDate=startDate, | |
|
4040 | endDate=endDate, | |
|
4041 |
|
|
|
4042 |
|
|
|
4043 |
|
|
|
4044 |
|
|
|
4045 |
i |
|
|
4202 | if not projectParms.isValid(): | |
|
4203 | return None | |
|
4204 | ||
|
4205 | if projectParms.datatype in ["Voltage", "Spectra", "Fits"]: | |
|
4206 | readUnitConfObj.update(datatype=projectParms.datatype, | |
|
4207 | path=projectParms.dpath, | |
|
4208 | startDate=projectParms.startDate, | |
|
4209 | endDate=projectParms.endDate, | |
|
4210 | startTime=projectParms.startTime, | |
|
4211 | endTime=projectParms.endTime, | |
|
4212 | online=projectParms.online, | |
|
4213 | walk=projectParms.walk | |
|
4214 | ) | |
|
4215 | if projectParms.set: | |
|
4216 | readUnitConfObj.addParameter(name="set", value=projectParms.set, format="int") | |
|
4217 | ||
|
4218 | if projectParms.delay: | |
|
4219 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
|
4220 | ||
|
4221 | if projectParms.datatype == "USRP": | |
|
4222 | readUnitConfObj.update(datatype=projectParms.datatype, | |
|
4223 | path=projectParms.dpath, | |
|
4224 | startDate=projectParms.startDate, | |
|
4225 | endDate=projectParms.endDate, | |
|
4226 | startTime=projectParms.startTime, | |
|
4227 | endTime=projectParms.endTime, | |
|
4228 | online=projectParms.online, | |
|
4229 | ippKm=projectParms.ippKm | |
|
4046 | 4230 | ) |
|
4047 | 4231 | |
|
4232 | if projectParms.delay: | |
|
4233 | readUnitConfObj.addParameter(name="delay", value=projectParms.delay, format="int") | |
|
4234 | ||
|
4048 | 4235 | return readUnitConfObj |
|
4049 | 4236 | |
|
4050 | 4237 | def createProcUnitView(self, projectObjView, datatype, inputId): |
@@ -4083,8 +4270,6 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
4083 | 4270 | |
|
4084 | 4271 | def createPUWindow(self): |
|
4085 | 4272 | |
|
4086 | self.console.clear() | |
|
4087 | ||
|
4088 | 4273 | if not self.configUPWindowObj.create: |
|
4089 | 4274 | return |
|
4090 | 4275 | |
@@ -4146,7 +4331,7 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
4146 | 4331 | |
|
4147 | 4332 | opObj.addParameter(name='wr_period', value=value, format='int') |
|
4148 | 4333 | |
|
4149 |
def |
|
|
4334 | def addFTPProcUnitView(self, server, username, password, remotefolder, | |
|
4150 | 4335 | ftp_wei, exp_code, sub_exp_code, plot_pos, |
|
4151 | 4336 | localfolder='./', extension='.png', period='60', protocol='ftp'): |
|
4152 | 4337 | |
@@ -5609,7 +5794,8 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5609 | 5794 | if self.__itemTreeDict.has_key(inputId): |
|
5610 | 5795 | self.parentItem = self.__itemTreeDict[inputId] |
|
5611 | 5796 | else: |
|
5612 | self.parentItem = self.__itemTreeDict[inputId[0]] | |
|
5797 | #If parent is a Reader object | |
|
5798 | self.parentItem = self.__itemTreeDict[inputId[:-1]] | |
|
5613 | 5799 | |
|
5614 | 5800 | self.parentItem.appendRow(itemTree) |
|
5615 | 5801 | self.projectExplorerTree.expandAll() |
@@ -5644,7 +5830,6 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5644 | 5830 | projectId = puObj.parentId |
|
5645 | 5831 | |
|
5646 | 5832 | projectObj = self.__projectObjDict[projectId] |
|
5647 | ||
|
5648 | 5833 | return projectObj |
|
5649 | 5834 | |
|
5650 | 5835 | return None |
@@ -5668,6 +5853,42 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5668 | 5853 | |
|
5669 | 5854 | return None |
|
5670 | 5855 | |
|
5856 | def _WarningWindow(self, text, information): | |
|
5857 | ||
|
5858 | msgBox = QtGui.QMessageBox() | |
|
5859 | msgBox.setText(text) | |
|
5860 | msgBox.setInformativeText(information) | |
|
5861 | msgBox.setStandardButtons(QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel) | |
|
5862 | msgBox.setDefaultButton(QtGui.QMessageBox.Ok) | |
|
5863 | ret = msgBox.exec_() | |
|
5864 | ||
|
5865 | answer = False | |
|
5866 | ||
|
5867 | if ret == QtGui.QMessageBox.Ok: | |
|
5868 | answer = True | |
|
5869 | ||
|
5870 | return answer | |
|
5871 | ||
|
5872 | def __getNewProjectId(self): | |
|
5873 | ||
|
5874 | loadProject = False | |
|
5875 | ||
|
5876 | for thisId in range(1,10): | |
|
5877 | newId = str(thisId) | |
|
5878 | if newId in self.__projectObjDict.keys(): | |
|
5879 | continue | |
|
5880 | ||
|
5881 | loadProject = True | |
|
5882 | projectId = newId | |
|
5883 | break | |
|
5884 | ||
|
5885 | if not loadProject: | |
|
5886 | self.console.clear() | |
|
5887 | self.console.append("The maximum number of projects has been loaded, a new project can not be loaded") | |
|
5888 | return None | |
|
5889 | ||
|
5890 | return projectId | |
|
5891 | ||
|
5671 | 5892 | def openProject(self): |
|
5672 | 5893 | |
|
5673 | 5894 | self.actionStart.setEnabled(False) |
@@ -5678,8 +5899,9 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5678 | 5899 | |
|
5679 | 5900 | # print self.dir |
|
5680 | 5901 | filename = str(QtGui.QFileDialog.getOpenFileName(self, "Open text file", self.pathWorkSpace, self.tr("Text Files (*.xml)"))) |
|
5681 | self.console.clear() | |
|
5902 | ||
|
5682 | 5903 | projectObjLoad = Project() |
|
5904 | ||
|
5683 | 5905 | try: |
|
5684 | 5906 | projectObjLoad.readXml(filename) |
|
5685 | 5907 | except: |
@@ -5689,36 +5911,26 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5689 | 5911 | |
|
5690 | 5912 | self.refreshProjectWindow2(projectObjLoad) |
|
5691 | 5913 | self.refreshProjectProperties(projectObjLoad) |
|
5692 | # project_name, description = projectObjLoad.name, projectObjLoad.description | |
|
5693 |
|
|
|
5694 | self.__projectObjDict[id] = projectObjLoad | |
|
5695 | # # Project Properties | |
|
5696 | # datatype, data_path, startDate, endDate, startTime, endTime , online , delay, walk, set = self.showProjectProperties(projectObjLoad) | |
|
5697 | # # show ProjectView | |
|
5698 | self.addProject2ProjectExplorer(id=id, name=projectObjLoad.name) | |
|
5699 | # self.refreshProjectWindow(project_name, description, datatype, data_path, startDate, endDate, startTime, endTime, online, delay, set) | |
|
5700 | # | |
|
5701 | # if datatype == "Voltage": | |
|
5702 | # ext = '.r' | |
|
5703 | # self.specOpProfiles.setEnabled(True) | |
|
5704 | # self.specOpippFactor.setEnabled(True) | |
|
5705 | # elif datatype == "Spectra": | |
|
5706 |
|
|
|
5707 | # self.specOpProfiles.setEnabled(False) | |
|
5708 | # self.specOpippFactor.setEnabled(False) | |
|
5709 | # elif datatype == "Fits": | |
|
5710 | # ext = '.fits' | |
|
5711 | # elif datatype == "USRP": | |
|
5712 | # ext = '.hdf5' | |
|
5713 | # | |
|
5714 | # if online == 0: | |
|
5715 | # self.loadDays(data_path, ext, walk) | |
|
5716 | # else: | |
|
5717 | # self.proComStartDate.setEnabled(False) | |
|
5718 | # self.proComEndDate.setEnabled(False) | |
|
5719 | # self.proStartTime.setEnabled(False) | |
|
5720 | # self.proEndTime.setEnabled(False) | |
|
5721 | # self.frame_2.setEnabled(True) | |
|
5914 | ||
|
5915 | projectId = projectObjLoad.id | |
|
5916 | ||
|
5917 | if projectId in self.__projectObjDict.keys(): | |
|
5918 | ||
|
5919 | # answer = self._WarningWindow("You already have a project loaded with the same Id", | |
|
5920 | # "Do you want to load the file anyway?") | |
|
5921 | # if not answer: | |
|
5922 | # return | |
|
5923 | ||
|
5924 | projectId = self.__getNewProjectId() | |
|
5925 | ||
|
5926 | if not projectId: | |
|
5927 | return | |
|
5928 | ||
|
5929 | projectObjLoad.updateId(projectId) | |
|
5930 | ||
|
5931 | self.__projectObjDict[projectId] = projectObjLoad | |
|
5932 | ||
|
5933 | self.addProject2ProjectExplorer(id=projectId, name=projectObjLoad.name) | |
|
5722 | 5934 | |
|
5723 | 5935 | self.tabWidgetProject.setEnabled(True) |
|
5724 | 5936 | self.tabWidgetProject.setCurrentWidget(self.tabProject) |
@@ -5728,38 +5940,28 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5728 | 5940 | |
|
5729 | 5941 | for puId, puObj in puObjorderList.items(): |
|
5730 | 5942 | |
|
5731 | # print "%s %s %s %s %s" %(puObj.datatype, inputId, puObj.inputId, puObj.getId(), puObj.parentId) | |
|
5732 | ||
|
5733 | 5943 | self.__puObjDict[puId] = puObj |
|
5734 | 5944 | |
|
5735 |
if puObj. |
|
|
5736 | self.addPU2PELoadXML(id=puId , name=puObj.datatype , inputId=puObj.inputId) | |
|
5945 | if puObj.name == "SendToServer": | |
|
5946 | self.__ftpProcUnitAdded = True | |
|
5947 | self.__ftpProcUnitId = puObj.getId() | |
|
5737 | 5948 | |
|
5738 | if puObj.datatype == "Voltage": | |
|
5739 |
self. |
|
|
5740 | self.refreshPUProperties(puObj) | |
|
5741 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
5949 | opObj = puObj.getOperationObj(name="run") | |
|
5950 | self.saveFTPvalues(opObj) | |
|
5742 | 5951 | |
|
5743 |
if puObj.d |
|
|
5744 | self.refreshPUWindow(puObj.datatype, puObj) | |
|
5745 | self.refreshPUProperties(puObj) | |
|
5746 | self.showtabPUCreated(datatype=puObj.datatype) | |
|
5952 | if puObj.inputId == '0': | |
|
5953 | continue | |
|
5747 | 5954 | |
|
5748 | if puObj.datatype == "SpectraHeis": | |
|
5955 | self.addPU2PELoadXML(id=puId , name=puObj.datatype , inputId=puObj.inputId) | |
|
5956 | ||
|
5957 | if puObj.datatype in ("Voltage", "Spectra", "SpectraHeis"): | |
|
5749 | 5958 | self.refreshPUWindow(puObj.datatype, puObj) |
|
5750 | 5959 | self.refreshPUProperties(puObj) |
|
5751 | 5960 | self.showtabPUCreated(datatype=puObj.datatype) |
|
5752 | 5961 | |
|
5753 | if puObj.name == "SendToServer": | |
|
5754 | self.__ftpProcUnitAdded = True | |
|
5755 | self.__ftpProcUnitId = puObj.getId() | |
|
5756 | ||
|
5757 | opObj = puObj.getOperationObj(name="run") | |
|
5758 | self.saveFTPvalues(opObj) | |
|
5759 | 5962 | |
|
5760 |
|
|
|
5963 | self.console.clear() | |
|
5761 | 5964 | self.console.append("The selected xml file has been loaded successfully") |
|
5762 | # self.refreshPUWindow(datatype=datatype,puObj=puObj) | |
|
5763 | 5965 | |
|
5764 | 5966 | self.actionStart.setEnabled(True) |
|
5765 | 5967 | self.actionStarToolbar.setEnabled(True) |
@@ -5773,24 +5975,23 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5773 | 5975 | if not self.controllerObj.isAlive(): |
|
5774 | 5976 | self.stopProject() |
|
5775 | 5977 | |
|
5776 | def playProject(self, ext=".xml"): | |
|
5978 | def playProject(self, ext=".xml", save=0): | |
|
5777 | 5979 | |
|
5980 | # self.console.clear() | |
|
5778 | 5981 | projectObj = self.getSelectedProjectObj() |
|
5779 | 5982 | |
|
5780 | 5983 | if not projectObj: |
|
5781 | 5984 | print "Please select a project before pressing PLAY" |
|
5782 | 5985 | return |
|
5783 | 5986 | |
|
5784 | filename = os.path.join(str(self.pathWorkSpace), | |
|
5785 | "%s%s%s" %(str(projectObj.name), str(projectObj.id), ext) | |
|
5786 | ) | |
|
5787 | ||
|
5788 | self.console.clear() | |
|
5987 | if save: | |
|
5789 | 5988 | filename = self.saveProject() |
|
5790 | # projectObj.writeXml(filename) | |
|
5791 | 5989 | if filename == None: |
|
5792 | 5990 | self.console.append("Process did not initialize.") |
|
5793 | 5991 | return |
|
5992 | else: | |
|
5993 | filename = TEMPORAL_FILE | |
|
5994 | projectObj.writeXml(filename) | |
|
5794 | 5995 | |
|
5795 | 5996 | self.actionStart.setEnabled(False) |
|
5796 | 5997 | self.actionPause.setEnabled(True) |
@@ -5838,15 +6039,26 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5838 | 6039 | self.actionPauseToolbar.setEnabled(True) |
|
5839 | 6040 | self.actionStopToolbar.setEnabled(True) |
|
5840 | 6041 | |
|
5841 | def saveProject(self): | |
|
6042 | def saveProject(self, filename=None): | |
|
5842 | 6043 | |
|
5843 | 6044 | self.actionStart.setEnabled(False) |
|
5844 | 6045 | self.actionStarToolbar.setEnabled(False) |
|
5845 | 6046 | |
|
6047 | projectObj = self.getSelectedProjectObj() | |
|
6048 | self.refreshGraphicsId() | |
|
6049 | ||
|
5846 | 6050 | sts = True |
|
5847 |
|
|
|
6051 | selectedItemObj = self.getSelectedItemObj() | |
|
6052 | ||
|
6053 | #A Processing Unit has been selected | |
|
6054 | if projectObj == selectedItemObj: | |
|
6055 | if not self.on_proOk_clicked(): | |
|
6056 | return None | |
|
6057 | ||
|
6058 | #A Processing Unit has been selected | |
|
6059 | if projectObj != selectedItemObj: | |
|
6060 | puObj = selectedItemObj | |
|
5848 | 6061 | |
|
5849 | if puObj != None: | |
|
5850 | 6062 | if puObj.name == 'VoltageProc': |
|
5851 | 6063 | sts = self.on_volOpOk_clicked() |
|
5852 | 6064 | if puObj.name == 'SpectraProc': |
@@ -5857,24 +6069,11 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5857 | 6069 | if not sts: |
|
5858 | 6070 | return None |
|
5859 | 6071 | |
|
5860 | projectObj = self.getSelectedProjectObj() | |
|
5861 | puObjorderList = OrderedDict(sorted(projectObj.procUnitConfObjDict.items(), key=lambda x: x[0])) | |
|
5862 | ||
|
5863 | for inputId, puObj in puObjorderList.items(): | |
|
5864 | # print puObj.datatype, puObj.inputId,puObj.getId(),puObj.parentId | |
|
6072 | if not filename: | |
|
6073 | filename = os.path.join( str(self.pathWorkSpace), "%s%s" %(str(projectObj.name), '.xml') ) | |
|
5865 | 6074 | |
|
5866 | if puObj.name == "VoltageProc": | |
|
5867 | self.refreshID(puObj) | |
|
5868 | if puObj.name == "SpectraProc": | |
|
5869 | self.refreshID(puObj) | |
|
5870 | if puObj.name == "SpectraHeisProc": | |
|
5871 | self.refreshID(puObj) | |
|
5872 | ||
|
5873 | filename = os.path.join(str(self.pathWorkSpace), | |
|
5874 | "%s%s%s" %(str(projectObj.name), str(projectObj.id), '.xml') | |
|
5875 | ) | |
|
5876 | 6075 | projectObj.writeXml(filename) |
|
5877 |
self.console.append("Now, you can press |
|
|
6076 | self.console.append("Now, you can press Start Button on the toolbar") | |
|
5878 | 6077 | |
|
5879 | 6078 | self.actionStart.setEnabled(True) |
|
5880 | 6079 | self.actionStarToolbar.setEnabled(True) |
@@ -5964,7 +6163,6 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
5964 | 6163 | try: |
|
5965 | 6164 | set = int(self.proSet.text()) |
|
5966 | 6165 | except: |
|
5967 | self.console.clear() | |
|
5968 | 6166 | set = None |
|
5969 | 6167 | |
|
5970 | 6168 | |
@@ -6007,15 +6205,21 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
6007 | 6205 | endTime = "23:59:59" |
|
6008 | 6206 | starlist = startTime.split(":") |
|
6009 | 6207 | endlist = endTime.split(":") |
|
6010 | self.proDelay.setText("0") | |
|
6011 |
self.proSet.setText(" |
|
|
6208 | self.proDelay.setText("60") | |
|
6209 | self.proSet.setText("") | |
|
6210 | ||
|
6211 | self.labelSet.show() | |
|
6212 | self.proSet.show() | |
|
6213 | ||
|
6214 | self.labelIPPKm.hide() | |
|
6215 | self.proIPPKm.hide() | |
|
6216 | ||
|
6012 | 6217 | self.time.setHMS(int(starlist[0]), int(starlist[1]), int(starlist[2])) |
|
6013 | 6218 | self.proStartTime.setTime(self.time) |
|
6014 | 6219 | self.time.setHMS(int(endlist[0]), int(endlist[1]), int(endlist[2])) |
|
6015 | 6220 | self.proEndTime.setTime(self.time) |
|
6016 | 6221 | self.proDescription.clear() |
|
6017 | 6222 | self.proOk.setEnabled(False) |
|
6018 | self.console.clear() | |
|
6019 | 6223 | # self.console.append("Please, Write a name Project") |
|
6020 | 6224 | # self.console.append("Introduce Project Parameters")DC |
|
6021 | 6225 | # self.console.append("Select data type Voltage( .rawdata) or Spectra(.pdata)") |
@@ -6235,9 +6439,9 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
6235 | 6439 | try: |
|
6236 | 6440 | delay = int(str(self.proDelay.text())) |
|
6237 | 6441 | except: |
|
6238 |
outputstr = 'Delay: %s, this must be a integer number' % str(self.pro |
|
|
6442 | outputstr = 'Delay: %s, this must be a integer number' % str(self.proDelay.text()) | |
|
6239 | 6443 | self.console.append(outputstr) |
|
6240 | parms_ok = False | |
|
6444 | # parms_ok = False | |
|
6241 | 6445 | delay = None |
|
6242 | 6446 | |
|
6243 | 6447 | try: |
@@ -6488,11 +6692,14 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
6488 | 6692 | dateList = self.findDatafiles(data_path, ext=ext, walk=walk, expLabel=expLabel) |
|
6489 | 6693 | |
|
6490 | 6694 | if not dateList: |
|
6491 | self.console.clear() | |
|
6695 | # self.console.clear() | |
|
6492 | 6696 | outputstr = "The path: %s is empty with file extension *%s" % (data_path, ext) |
|
6493 | 6697 | self.console.append(outputstr) |
|
6494 | 6698 | return |
|
6495 | 6699 | |
|
6700 | self.proComStartDate.clear() | |
|
6701 | self.proComEndDate.clear() | |
|
6702 | ||
|
6496 | 6703 | dateStrList = [] |
|
6497 | 6704 | for thisDate in dateList: |
|
6498 | 6705 | dateStr = thisDate.strftime("%Y/%m/%d") |
@@ -6501,7 +6708,8 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
6501 | 6708 | self.proComEndDate.addItem(dateStr) |
|
6502 | 6709 | dateStrList.append(dateStr) |
|
6503 | 6710 | |
|
6504 |
|
|
|
6711 | self.proComStartDate.setCurrentIndex(0) | |
|
6712 | self.proComEndDate.setCurrentIndex(self.proComEndDate.count() - 1) | |
|
6505 | 6713 | |
|
6506 | 6714 | self.dateList = dateStrList |
|
6507 | 6715 | self.proOk.setEnabled(True) |
@@ -6691,8 +6899,8 class BasicWindow(QMainWindow, Ui_BasicWindow): | |||
|
6691 | 6899 | self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') |
|
6692 | 6900 | self.volOpOk.setToolTip('If you have finished, please Ok ') |
|
6693 | 6901 | # tool tip gui volGraph |
|
6694 |
self.volGraphfreqrange.setToolTip('Example: |
|
|
6695 |
self.volGraphHeightrange.setToolTip('Example: |
|
|
6902 | self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') | |
|
6903 | self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') | |
|
6696 | 6904 | # tool tip gui specOp |
|
6697 | 6905 | self.specOpnFFTpoints.setToolTip('Example: 128') |
|
6698 | 6906 | self.specOpProfiles.setToolTip('Example: 128') |
@@ -12,7 +12,8 Classes to save parameters from Windows. | |||
|
12 | 12 | class ProjectParms(): |
|
13 | 13 | |
|
14 | 14 | parmsOk = False |
|
15 |
|
|
|
15 | name = None | |
|
16 | description = None | |
|
16 | 17 | datatype = None |
|
17 | 18 | ext = None |
|
18 | 19 | dpath = None |
@@ -30,23 +31,24 class ProjectParms(): | |||
|
30 | 31 | def __init__(self): |
|
31 | 32 | |
|
32 | 33 | self.parmsOk = True |
|
34 | self.description = '' | |
|
33 | 35 | self.expLabel = '' |
|
34 |
self.set = |
|
|
35 |
self.ippKm = |
|
|
36 | self.set = '' | |
|
37 | self.ippKm = '' | |
|
36 | 38 | self.walk = None |
|
37 |
self.delay = |
|
|
39 | self.delay = '' | |
|
38 | 40 | |
|
39 | 41 | def getDatatypeIndex(self): |
|
40 | 42 | |
|
41 | 43 | indexDatatype = None |
|
42 | 44 | |
|
43 |
if self.datatype.lower() |
|
|
45 | if 'voltage' in self.datatype.lower(): | |
|
44 | 46 | indexDatatype = 0 |
|
45 |
if self.datatype.lower() |
|
|
47 | if 'spectra' in self.datatype.lower(): | |
|
46 | 48 | indexDatatype = 1 |
|
47 |
if self.datatype.lower() |
|
|
49 | if 'fits' in self.datatype.lower(): | |
|
48 | 50 | indexDatatype = 2 |
|
49 |
if self.datatype.lower() |
|
|
51 | if 'usrp' in self.datatype.lower(): | |
|
50 | 52 | indexDatatype = 3 |
|
51 | 53 | |
|
52 | 54 | return indexDatatype |
@@ -70,7 +72,7 class ProjectParms(): | |||
|
70 | 72 | startDate=None, endDate=None, startTime=None, endTime=None, |
|
71 | 73 | delay=None, walk=None, set=None, ippKm=None, parmsOk=True): |
|
72 | 74 | |
|
73 |
|
|
|
75 | name = project_name | |
|
74 | 76 | datatype = datatype |
|
75 | 77 | ext = ext |
|
76 | 78 | dpath = dpath |
@@ -85,3 +87,7 class ProjectParms(): | |||
|
85 | 87 | ippKm = ippKm |
|
86 | 88 | |
|
87 | 89 | self.parmsOk = parmsOk |
|
90 | ||
|
91 | def isValid(self): | |
|
92 | ||
|
93 | return self.parmsOk No newline at end of file |
@@ -59,7 +59,7 class Ui_EnvWindow(object): | |||
|
59 | 59 | def setupUi(self, MainWindow): |
|
60 | 60 | |
|
61 | 61 | MainWindow.setObjectName(_fromUtf8("MainWindow")) |
|
62 |
MainWindow.resize(120 |
|
|
62 | MainWindow.resize(1200, 800) | |
|
63 | 63 | |
|
64 | 64 | self.centralWidget = QtGui.QWidget(MainWindow) |
|
65 | 65 | self.centralWidget.setObjectName(_fromUtf8("centralWidget")) |
@@ -62,15 +62,15 class Ui_ProjectTab(object): | |||
|
62 | 62 | self.gridLayout_2.addWidget(self.label_23, 3, 0, 1, 1) |
|
63 | 63 | self.proComReadMode = QtGui.QComboBox(self.frame) |
|
64 | 64 | self.proComReadMode.setObjectName(_fromUtf8("proComReadMode")) |
|
65 | self.proComReadMode.addItem(_fromUtf8("------")) | |
|
65 | 66 | self.proComReadMode.addItem(_fromUtf8("")) |
|
66 | self.proComReadMode.addItem(_fromUtf8("")) | |
|
67 | self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 2) | |
|
67 | self.gridLayout_2.addWidget(self.proComReadMode, 3, 1, 1, 4) | |
|
68 | 68 | self.label_33 = QtGui.QLabel(self.frame) |
|
69 | 69 | self.label_33.setObjectName(_fromUtf8("label_33")) |
|
70 |
self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, |
|
|
70 | self.gridLayout_2.addWidget(self.label_33, 3, 5, 1, 1) | |
|
71 | 71 | self.proDelay = QtGui.QLineEdit(self.frame) |
|
72 | 72 | self.proDelay.setObjectName(_fromUtf8("proDelay")) |
|
73 |
self.gridLayout_2.addWidget(self.proDelay, 3, |
|
|
73 | self.gridLayout_2.addWidget(self.proDelay, 3, 6, 1, 1) | |
|
74 | 74 | self.label_32 = QtGui.QLabel(self.frame) |
|
75 | 75 | self.label_32.setObjectName(_fromUtf8("label_32")) |
|
76 | 76 | self.gridLayout_2.addWidget(self.label_32, 4, 0, 1, 1) |
@@ -82,12 +82,20 class Ui_ProjectTab(object): | |||
|
82 | 82 | self.proLoadButton = QtGui.QPushButton(self.frame) |
|
83 | 83 | self.proLoadButton.setObjectName(_fromUtf8("proLoadButton")) |
|
84 | 84 | self.gridLayout_2.addWidget(self.proLoadButton, 5, 0, 1, 9) |
|
85 |
self.label |
|
|
86 |
self.label |
|
|
87 |
self.gridLayout_2.addWidget(self.label |
|
|
85 | self.labelSet = QtGui.QLabel(self.frame) | |
|
86 | self.labelSet.setObjectName(_fromUtf8("labelSet")) | |
|
87 | self.gridLayout_2.addWidget(self.labelSet, 3, 7, 1, 1) | |
|
88 | 88 | self.proSet = QtGui.QLineEdit(self.frame) |
|
89 | 89 | self.proSet.setObjectName(_fromUtf8("proSet")) |
|
90 |
self.gridLayout_2.addWidget(self.proSet, 3, |
|
|
90 | self.gridLayout_2.addWidget(self.proSet, 3, 8, 1, 1) | |
|
91 | self.labelIPPKm = QtGui.QLabel(self.frame) | |
|
92 | self.labelIPPKm.setObjectName(_fromUtf8("labelIPPKm")) | |
|
93 | self.gridLayout_2.addWidget(self.labelIPPKm, 3, 7, 1, 1) | |
|
94 | self.proIPPKm = QtGui.QLineEdit(self.frame) | |
|
95 | self.proIPPKm.setObjectName(_fromUtf8("proIPPKm")) | |
|
96 | self.gridLayout_2.addWidget(self.proIPPKm, 3, 8, 1, 1) | |
|
97 | ||
|
98 | ||
|
91 | 99 | self.gridLayout_15.addWidget(self.frame, 0, 0, 1, 1) |
|
92 | 100 | self.frame_2 = QtGui.QFrame(self.tabProject) |
|
93 | 101 | self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel) |
@@ -160,7 +168,8 class Ui_ProjectTab(object): | |||
|
160 | 168 | self.proComWalk.setItemText(0, _translate("MainWindow", "On Files", None)) |
|
161 | 169 | self.proComWalk.setItemText(1, _translate("MainWindow", "On Folder", None)) |
|
162 | 170 | self.proLoadButton.setText(_translate("MainWindow", "Load", None)) |
|
163 |
self.label |
|
|
171 | self.labelSet.setText(_translate("MainWindow", "Set:", None)) | |
|
172 | self.labelIPPKm.setText(_translate("MainWindow", "IPP (km):", None)) | |
|
164 | 173 | self.label_27.setText(_translate("MainWindow", "Star Date:", None)) |
|
165 | 174 | self.label_28.setText(_translate("MainWindow", "End Date:", None)) |
|
166 | 175 | self.label_2.setText(_translate("MainWindow", "Start Time:", None)) |
@@ -67,6 +67,7 class Ui_VoltageTab(object): | |||
|
67 | 67 | self.volOpComProfile.setObjectName(_fromUtf8("volOpComProfile")) |
|
68 | 68 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
69 | 69 | self.volOpComProfile.addItem(_fromUtf8("")) |
|
70 | self.volOpComProfile.addItem(_fromUtf8("")) | |
|
70 | 71 | self.gridLayout.addWidget(self.volOpComProfile, 7, 0, 1, 3) |
|
71 | 72 | self.volOpCebDecodification = QtGui.QCheckBox(self.tabopVoltage) |
|
72 | 73 | self.volOpCebDecodification.setObjectName(_fromUtf8("volOpCebDecodification")) |
@@ -86,9 +87,6 class Ui_VoltageTab(object): | |||
|
86 | 87 | self.volOpChannel = QtGui.QLineEdit(self.tabopVoltage) |
|
87 | 88 | self.volOpChannel.setObjectName(_fromUtf8("volOpChannel")) |
|
88 | 89 | self.gridLayout.addWidget(self.volOpChannel, 2, 4, 1, 1) |
|
89 | self.label_4 = QtGui.QLabel(self.tabopVoltage) | |
|
90 | self.label_4.setObjectName(_fromUtf8("label_4")) | |
|
91 | self.gridLayout.addWidget(self.label_4, 9, 2, 1, 1) | |
|
92 | 90 | self.volOpCebChannels = QtGui.QCheckBox(self.tabopVoltage) |
|
93 | 91 | self.volOpCebChannels.setObjectName(_fromUtf8("volOpCebChannels")) |
|
94 | 92 | self.gridLayout.addWidget(self.volOpCebChannels, 1, 0, 1, 3) |
@@ -104,9 +102,6 class Ui_VoltageTab(object): | |||
|
104 | 102 | self.volOpCebRadarfrequency = QtGui.QCheckBox(self.tabopVoltage) |
|
105 | 103 | self.volOpCebRadarfrequency.setObjectName(_fromUtf8("volOpCebRadarfrequency")) |
|
106 | 104 | self.gridLayout.addWidget(self.volOpCebRadarfrequency, 0, 0, 1, 3) |
|
107 | self.label_5 = QtGui.QLabel(self.tabopVoltage) | |
|
108 | self.label_5.setObjectName(_fromUtf8("label_5")) | |
|
109 | self.gridLayout.addWidget(self.label_5, 10, 2, 1, 1) | |
|
110 | 105 | spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) |
|
111 | 106 | self.gridLayout.addItem(spacerItem3, 1, 4, 1, 1) |
|
112 | 107 | self.volOpCebFlip = QtGui.QCheckBox(self.tabopVoltage) |
@@ -123,6 +118,20 class Ui_VoltageTab(object): | |||
|
123 | 118 | self.volOpCohInt.setObjectName(_fromUtf8("volOpCohInt")) |
|
124 | 119 | self.gridLayout.addWidget(self.volOpCohInt, 12, 4, 1, 1) |
|
125 | 120 | |
|
121 | self.volLabCodeMode = QtGui.QLabel(self.tabopVoltage) | |
|
122 | self.volLabCodeMode.setObjectName(_fromUtf8("volLabCodeMode")) | |
|
123 | self.gridLayout.addWidget(self.volLabCodeMode, 8, 2, 1, 1) | |
|
124 | self.volLabCodeType = QtGui.QLabel(self.tabopVoltage) | |
|
125 | self.volLabCodeType.setObjectName(_fromUtf8("volLabCodeType")) | |
|
126 | self.gridLayout.addWidget(self.volLabCodeType, 9, 2, 1, 1) | |
|
127 | self.volLabCode = QtGui.QLabel(self.tabopVoltage) | |
|
128 | self.volLabCode.setObjectName(_fromUtf8("volLabCode")) | |
|
129 | self.gridLayout.addWidget(self.volLabCode, 10, 2, 1, 1) | |
|
130 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) | |
|
131 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) | |
|
132 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
133 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
134 | self.gridLayout.addWidget(self.volOpComMode, 8, 4, 1, 1) | |
|
126 | 135 | self.volOpComCode = QtGui.QComboBox(self.tabopVoltage) |
|
127 | 136 | self.volOpComCode.setObjectName(_fromUtf8("volOpComCode")) |
|
128 | 137 | self.volOpComCode.addItem(_fromUtf8("")) |
@@ -138,14 +147,12 class Ui_VoltageTab(object): | |||
|
138 | 147 | self.volOpComCode.addItem(_fromUtf8("")) |
|
139 | 148 | self.volOpComCode.addItem(_fromUtf8("")) |
|
140 | 149 | self.volOpComCode.addItem(_fromUtf8("")) |
|
150 | self.volOpComCode.addItem(_fromUtf8("")) | |
|
141 | 151 | self.gridLayout.addWidget(self.volOpComCode, 9, 4, 1, 1) |
|
142 | self.volOpComMode = QtGui.QComboBox(self.tabopVoltage) | |
|
143 | self.volOpComMode.setObjectName(_fromUtf8("volOpComMode")) | |
|
144 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
145 | self.volOpComMode.addItem(_fromUtf8("")) | |
|
146 | self.gridLayout.addWidget(self.volOpComMode, 10, 4, 1, 1) | |
|
147 | 152 | self.tabWidgetVoltage.addTab(self.tabopVoltage, _fromUtf8("")) |
|
148 | ||
|
153 | self.volOpCode = QtGui.QLineEdit(self.tabopVoltage) | |
|
154 | self.volOpCode.setObjectName(_fromUtf8("volOpCode")) | |
|
155 | self.gridLayout.addWidget(self.volOpCode, 10, 4, 1, 1) | |
|
149 | 156 | |
|
150 | 157 | self.tabgraphVoltage = QtGui.QWidget() |
|
151 | 158 | self.tabgraphVoltage.setObjectName(_fromUtf8("tabgraphVoltage")) |
@@ -262,41 +269,44 class Ui_VoltageTab(object): | |||
|
262 | 269 | self.volOpComChannels.setItemText(1, _translate("MainWindow", "Index", None)) |
|
263 | 270 | self.volOpCebProfile.setText(_translate("MainWindow", "Profile Selector", None)) |
|
264 | 271 | self.volOpComProfile.setItemText(0, _translate("MainWindow", "Profile List", None)) |
|
265 |
self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range |
|
|
272 | self.volOpComProfile.setItemText(1, _translate("MainWindow", "Profile Range", None)) | |
|
273 | self.volOpComProfile.setItemText(2, _translate("MainWindow", "List of Profile Ranges", None)) | |
|
266 | 274 | self.volOpCebDecodification.setText(_translate("MainWindow", "Decoder", None)) |
|
267 | 275 | self.volOpCebCohInt.setText(_translate("MainWindow", "Coherent Integration", None)) |
|
268 | 276 | self.volOpCebFlip.setText(_translate("MainWindow", "Flip", None)) |
|
269 |
self. |
|
|
277 | self.volLabCodeType.setText(_translate("MainWindow", "Code type:", None)) | |
|
270 | 278 | self.volOpCebChannels.setText(_translate("MainWindow", "Select Channels", None)) |
|
271 | 279 | self.volOpCebHeights.setText(_translate("MainWindow", "Select Heights", None)) |
|
272 | 280 | self.volOpCebFilter.setText(_translate("MainWindow", "Filter", None)) |
|
273 | 281 | self.volOpCebRadarfrequency.setText(_translate("MainWindow", "Radar Frequency", None)) |
|
274 |
self. |
|
|
275 |
self.vol |
|
|
276 |
self.volOpComCode.setItemText( |
|
|
277 |
self.volOpComCode.setItemText( |
|
|
278 |
self.volOpComCode.setItemText( |
|
|
279 |
self.volOpComCode.setItemText( |
|
|
280 |
self.volOpComCode.setItemText( |
|
|
281 |
self.volOpComCode.setItemText( |
|
|
282 |
self.volOpComCode.setItemText( |
|
|
283 |
self.volOpComCode.setItemText( |
|
|
284 |
self.volOpComCode.setItemText( |
|
|
285 |
self.volOpComCode.setItemText( |
|
|
286 |
self.volOpComCode.setItemText(1 |
|
|
287 |
self.volOpComCode.setItemText(1 |
|
|
282 | self.volLabCodeMode.setText(_translate("MainWindow", "Mode:", None)) | |
|
283 | self.volLabCode.setText(_translate("MainWindow", "Code:", None)) | |
|
284 | self.volOpComCode.setItemText(0, _translate("MainWindow", "Read from header", None)) | |
|
285 | self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 3", None)) | |
|
286 | self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 4", None)) | |
|
287 | self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 5", None)) | |
|
288 | self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 7", None)) | |
|
289 | self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 11", None)) | |
|
290 | self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 13", None)) | |
|
291 | self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 3 + Comp.", None)) | |
|
292 | self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 4 + Comp.", None)) | |
|
293 | self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 5 + Comp.", None)) | |
|
294 | self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 7 + Comp.", None)) | |
|
295 | self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 11+ Comp.", None)) | |
|
296 | self.volOpComCode.setItemText(12, _translate("MainWindow", "Barker 13+ Comp.", None)) | |
|
297 | self.volOpComCode.setItemText(13, _translate("MainWindow", "User defined", None)) | |
|
288 | 298 | self.volOpComMode.setItemText(0, _translate("MainWindow", "Time", None)) |
|
289 |
self.volOpComMode.setItemText(1, _translate("MainWindow", "Freq |
|
|
299 | self.volOpComMode.setItemText(1, _translate("MainWindow", "Frequency", None)) | |
|
290 | 300 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabopVoltage), _translate("MainWindow", "Operation", None)) |
|
291 | 301 | |
|
292 | 302 | self.volGraphToolPath.setText(_translate("MainWindow", "...", None)) |
|
293 | 303 | self.label_14.setText(_translate("MainWindow", "Scope", None)) |
|
294 | 304 | self.label_8.setText(_translate("MainWindow", "Channel List", None)) |
|
295 | 305 | self.label_49.setText(_translate("MainWindow", "Show", None)) |
|
296 |
self.label_51.setText(_translate("MainWindow", " |
|
|
306 | self.label_51.setText(_translate("MainWindow", "Height range", None)) | |
|
297 | 307 | self.label_12.setText(_translate("MainWindow", "Path :", None)) |
|
298 |
self.label_13.setText(_translate("MainWindow", " |
|
|
299 |
self.label_52.setText(_translate("MainWindow", " |
|
|
308 | self.label_13.setText(_translate("MainWindow", "Figure name:", None)) | |
|
309 | self.label_52.setText(_translate("MainWindow", "Amplitude", None)) | |
|
300 | 310 | self.label_50.setText(_translate("MainWindow", "Save", None)) |
|
301 | 311 | self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) |
|
302 | 312 |
@@ -225,8 +225,8 class Figure(Operation): | |||
|
225 | 225 | return |
|
226 | 226 | |
|
227 | 227 | # store png plot to FTP server according to RT-Web format |
|
228 | name = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS) | |
|
229 | ftp_filename = os.path.join(figpath, name) | |
|
228 | ftp_filename = self.getNameToFtp(thisDatetime, self.FTP_WEI, self.EXP_CODE, self.SUB_EXP_CODE, self.PLOT_CODE, self.PLOT_POS) | |
|
229 | # ftp_filename = os.path.join(figpath, name) | |
|
230 | 230 | self.saveFigure(figpath, ftp_filename) |
|
231 | 231 | |
|
232 | 232 | def getNameToFtp(self, thisDatetime, FTP_WEI, EXP_CODE, SUB_EXP_CODE, PLOT_CODE, PLOT_POS): |
@@ -129,6 +129,9 class USRPReader(ProcessingUnit): | |||
|
129 | 129 | |
|
130 | 130 | channelNameList = digitalReadObj.get_channels() |
|
131 | 131 | |
|
132 | if not channelNameList: | |
|
133 | return [] | |
|
134 | ||
|
132 | 135 | metadata_dict = digitalReadObj.get_rf_file_metadata(channelNameList[0]) |
|
133 | 136 | |
|
134 | 137 | sample_rate = metadata_dict['sample_rate'][0] |
@@ -206,6 +206,9 class VoltageProc(ProcessingUnit): | |||
|
206 | 206 | self.dataOut.data = data |
|
207 | 207 | self.dataOut.heightList = self.dataOut.heightList[minIndex:maxIndex] |
|
208 | 208 | |
|
209 | if self.dataOut.nHeights <= 1: | |
|
210 | raise ValueError, "selectHeights: Too few heights. Current number of heights is %d" %(self.dataOut.nHeights) | |
|
211 | ||
|
209 | 212 | return 1 |
|
210 | 213 | |
|
211 | 214 | |
@@ -218,6 +221,10 class VoltageProc(ProcessingUnit): | |||
|
218 | 221 | |
|
219 | 222 | newdelta = deltaHeight * window |
|
220 | 223 | r = self.dataOut.nHeights % window |
|
224 | newheights = (self.dataOut.nHeights-r)/window | |
|
225 | ||
|
226 | if newheights <= 1: | |
|
227 | raise ValueError, "filterByHeights: Too few heights. Current number of heights is %d and window is %d" %(self.dataOut.nHeights, window) | |
|
221 | 228 | |
|
222 | 229 | if self.dataOut.flagDataAsBlock: |
|
223 | 230 | """ |
@@ -232,8 +239,8 class VoltageProc(ProcessingUnit): | |||
|
232 | 239 | buffer = buffer.reshape(self.dataOut.nChannels,self.dataOut.nHeights/window,window) |
|
233 | 240 | buffer = numpy.sum(buffer,2) |
|
234 | 241 | |
|
235 |
self.dataOut.data = buffer |
|
|
236 |
self.dataOut.heightList = |
|
|
242 | self.dataOut.data = buffer | |
|
243 | self.dataOut.heightList = self.dataOut.heightList[0] + numpy.arange( newheights )*newdelta | |
|
237 | 244 | self.dataOut.windowOfFilter = window |
|
238 | 245 | |
|
239 | 246 | def setH0(self, h0, deltaHeight = None): |
@@ -619,7 +626,7 class Decoder(Operation): | |||
|
619 | 626 | |
|
620 | 627 | return self.datadecTime |
|
621 | 628 | |
|
622 |
def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, |
|
|
629 | def run(self, dataOut, code=None, nCode=None, nBaud=None, mode = 0, osamp=None): | |
|
623 | 630 | |
|
624 | 631 | if not self.isConfig: |
|
625 | 632 | |
@@ -654,9 +661,6 class Decoder(Operation): | |||
|
654 | 661 | dataOut.code = self.code |
|
655 | 662 | dataOut.nCode = self.nCode |
|
656 | 663 | dataOut.nBaud = self.nBaud |
|
657 | dataOut.radarControllerHeaderObj.code = self.code | |
|
658 | dataOut.radarControllerHeaderObj.nCode = self.nCode | |
|
659 | dataOut.radarControllerHeaderObj.nBaud = self.nBaud | |
|
660 | 664 | |
|
661 | 665 | dataOut.data = datadec |
|
662 | 666 | |
@@ -785,7 +789,8 class ProfileSelector(Operation): | |||
|
785 | 789 | dataOut.data = dataOut.data[:,profileList,:] |
|
786 | 790 | dataOut.nProfiles = len(profileList) |
|
787 | 791 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
788 |
|
|
|
792 | ||
|
793 | if profileRangeList != None: | |
|
789 | 794 | minIndex = profileRangeList[0] |
|
790 | 795 | maxIndex = profileRangeList[1] |
|
791 | 796 |
|
@@ -793,6 +798,9 class ProfileSelector(Operation): | |||
|
793 | 798 | dataOut.nProfiles = maxIndex - minIndex + 1 |
|
794 | 799 | dataOut.profileIndex = dataOut.nProfiles - 1 |
|
795 | 800 | |
|
801 | if rangeList != None: | |
|
802 | raise ValueError, "Profile Selector: Not implemented for rangeList yet" | |
|
803 | ||
|
796 | 804 | dataOut.flagNoData = False |
|
797 | 805 | |
|
798 | 806 | return True |
@@ -865,7 +873,7 class ProfileSelector(Operation): | |||
|
865 | 873 | self.incIndex() |
|
866 | 874 | return 1 |
|
867 | 875 | |
|
868 |
raise ValueError, "ProfileSelector needs profileList |
|
|
876 | raise ValueError, "ProfileSelector needs profileList, profileRangeList or rangeList parameter" | |
|
869 | 877 | |
|
870 | 878 | return 0 |
|
871 | 879 |
General Comments 0
You need to be logged in to leave comments.
Login now