##// END OF EJS Templates
Signal Chain GUI v2.1
Miguel Valdez -
r596:bf27846f03e1
parent child
Show More

The requested changes are too big and content was truncated. Show full diff

@@ -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
@@ -153,10 +136,14 class ParameterConf():
153 136 self.__formated_value = format_func(value)
154 137
155 138 return self.__formated_value
139
140 def updateId(self, new_id):
156 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)
@@ -212,7 +199,19 class OperationConf():
212 199 def __getNewId(self):
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
@@ -387,7 +386,30 class ProcUnitConf():
387 386 def getId(self):
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
@@ -420,8 +442,21 class ProcUnitConf():
420 442 return self.procUnitObj
421 443
422 444 def setup(self, id, name, datatype, inputId, parentId=None):
445
446 #Compatible with old signal chain version
447 if datatype==None and name==None:
448 raise ValueError, "datatype or name should be defined"
423 449
424 self.id = id
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
@@ -583,7 +624,20 class ReadUnitConf(ProcUnitConf):
583 624 return self.ELEMENTNAME
584 625
585 626 def setup(self, id, name, datatype, path, startDate="", endDate="", startTime="", endTime="", parentId=None, **kwargs):
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)
586 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 = None
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
@@ -710,19 +787,6 class Project():
710 787 self.description = description
711 788
712 789 def addReadUnit(self, datatype=None, name=None, **kwargs):
713
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 790
727 791 idReadUnit = self.__getNewId()
728 792
@@ -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()
@@ -951,7 +1002,34 class Project():
951 1002 self.createObjects()
952 1003 self.connectObjects()
953 1004 self.run()
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}
954 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"
1 NO CONTENT: modified file
The requested commit or file is too big and content was truncated. Show full diff
@@ -12,7 +12,8 Classes to save parameters from Windows.
12 12 class ProjectParms():
13 13
14 14 parmsOk = False
15 project_name = None
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 = None
35 self.ippKm = None
36 self.set = ''
37 self.ippKm = ''
36 38 self.walk = None
37 self.delay = None
39 self.delay = ''
38 40
39 41 def getDatatypeIndex(self):
40 42
41 43 indexDatatype = None
42 44
43 if self.datatype.lower() == 'voltage':
45 if 'voltage' in self.datatype.lower():
44 46 indexDatatype = 0
45 if self.datatype.lower() == 'spectra':
47 if 'spectra' in self.datatype.lower():
46 48 indexDatatype = 1
47 if self.datatype.lower() == 'fits':
49 if 'fits' in self.datatype.lower():
48 50 indexDatatype = 2
49 if self.datatype.lower() == 'usrp':
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 project_name = project_name
75 name = project_name
74 76 datatype = datatype
75 77 ext = ext
76 78 dpath = dpath
@@ -84,4 +86,8 class ProjectParms():
84 86 set = set
85 87 ippKm = ippKm
86 88
87 self.parmsOk = parmsOk No newline at end of file
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(1203, 711)
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, 2)
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, 8, 1, 1)
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_10 = QtGui.QLabel(self.frame)
86 self.label_10.setObjectName(_fromUtf8("label_10"))
87 self.gridLayout_2.addWidget(self.label_10, 3, 3, 1, 1)
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, 4, 1, 1)
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_10.setText(_translate("MainWindow", "Set:", None))
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)
@@ -122,7 +117,21 class Ui_VoltageTab(object):
122 117 self.volOpCohInt = QtGui.QLineEdit(self.tabopVoltage)
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 List", None))
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.label_4.setText(_translate("MainWindow", "Code:", None))
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.label_5.setText(_translate("MainWindow", "Mode:", None))
275 self.volOpComCode.setItemText(0, _translate("MainWindow", "Barker 3", None))
276 self.volOpComCode.setItemText(1, _translate("MainWindow", "Barker 4", None))
277 self.volOpComCode.setItemText(2, _translate("MainWindow", "Barker 5", None))
278 self.volOpComCode.setItemText(3, _translate("MainWindow", "Barker 7", None))
279 self.volOpComCode.setItemText(4, _translate("MainWindow", "Barker 11", None))
280 self.volOpComCode.setItemText(5, _translate("MainWindow", "Barker 13", None))
281 self.volOpComCode.setItemText(6, _translate("MainWindow", "Barker 3 + Comp.", None))
282 self.volOpComCode.setItemText(7, _translate("MainWindow", "Barker 4 + Comp.", None))
283 self.volOpComCode.setItemText(8, _translate("MainWindow", "Barker 5 + Comp.", None))
284 self.volOpComCode.setItemText(9, _translate("MainWindow", "Barker 7 + Comp.", None))
285 self.volOpComCode.setItemText(10, _translate("MainWindow", "Barker 11+ Comp.", None))
286 self.volOpComCode.setItemText(11, _translate("MainWindow", "Barker 13+ Comp.", None))
287 self.volOpComCode.setItemText(12, _translate("MainWindow", "Read from header", None))
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 1", None))
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", "Freq/Vel", None))
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", "Prefix:", None))
299 self.label_52.setText(_translate("MainWindow", "Height range", None))
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,7 +221,11 class VoltageProc(ProcessingUnit):
218 221
219 222 newdelta = deltaHeight * window
220 223 r = self.dataOut.nHeights % window
224 newheights = (self.dataOut.nHeights-r)/window
221 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)
228
222 229 if self.dataOut.flagDataAsBlock:
223 230 """
224 231 Si la data es obtenida por bloques, dimension = [nChannels, nProfiles, nHeis]
@@ -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.copy()
236 self.dataOut.heightList = numpy.arange(self.dataOut.heightList[0],newdelta*(self.dataOut.nHeights-r)/window,newdelta)
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, times=None, osamp=None):
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,14 +789,18 class ProfileSelector(Operation):
785 789 dataOut.data = dataOut.data[:,profileList,:]
786 790 dataOut.nProfiles = len(profileList)
787 791 dataOut.profileIndex = dataOut.nProfiles - 1
788 else:
792
793 if profileRangeList != None:
789 794 minIndex = profileRangeList[0]
790 795 maxIndex = profileRangeList[1]
791
796
792 797 dataOut.data = dataOut.data[:,minIndex:maxIndex+1,:]
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 or profileRangeList"
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