From 543b4b6ada5006764c70397160d4955483e1e86c 2015-12-12 08:45:26 From: Miguel Valdez Date: 2015-12-12 08:45:26 Subject: [PATCH] Feature added to GUI. Power or I/Q plot can be choose from Voltage View --- diff --git a/schainpy/gui/viewcontroller/basicwindow.py b/schainpy/gui/viewcontroller/basicwindow.py index b6ef2e6..fe4f699 100644 --- a/schainpy/gui/viewcontroller/basicwindow.py +++ b/schainpy/gui/viewcontroller/basicwindow.py @@ -1107,8 +1107,8 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): opObj.addParameter(name=name_parameter1, value=opObj.id, format=format1) channelList = str(self.volGraphChannelList.text()).strip() - xvalue = str(self.volGraphfreqrange.text()).strip() - yvalue = str(self.volGraphHeightrange.text()).strip() + xvalue = str(self.volGraphHeightrange.text()).strip() + yvalue = str(self.volGraphIntensityRange.text()).strip() figpath = str(self.volGraphPath.text()).strip() figfile = str(self.volGraphPrefix.text()).strip() @@ -1119,12 +1119,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if xvalue != "": if not isFloatRange(xvalue): - self.console.append("Invalid value '%s' for 'Graphics:Frequncy-Range'" %(xvalue)) + self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(xvalue)) return 0 if yvalue != "": if not isFloatRange(yvalue): - self.console.append("Invalid value '%s' for 'Graphics:Height-Range'" %(yvalue)) + self.console.append("Invalid value '%s' for 'Graphics:Amplitude-Range'" %(yvalue)) return 0 @@ -1142,7 +1142,14 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): opObj.addParameter(name='ymin', value=yvalueList[0], format='int') opObj.addParameter(name='ymax', value=yvalueList[1], format='int') - + + plot_type = self.volComScopeType.currentIndex() + + if plot_type == 0: + opObj.addParameter(name='type', value="iq") + if plot_type == 1: + opObj.addParameter(name='type', value="power") + if self.volGraphCebSave.isChecked(): checkPath = True @@ -1235,12 +1242,12 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): if p0 == 0: self.volGraphChannelList.setEnabled(False) - self.volGraphfreqrange.setEnabled(False) + self.volGraphIntensityRange.setEnabled(False) self.volGraphHeightrange.setEnabled(False) if p0 == 2: self.volGraphChannelList.setEnabled(True) - self.volGraphfreqrange.setEnabled(True) + self.volGraphIntensityRange.setEnabled(True) self.volGraphHeightrange.setEnabled(True) """ @@ -3035,23 +3042,23 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): value = parmObj.getValue() value = str(value) self.volGraphChannelList.setText(value) - self.volOpProfile.setEnabled(True) +# self.volOpChannel.setEnabled(True) - parmObj1 = opObj.getParameterObj(parameterName='xmin') - parmObj2 = opObj.getParameterObj(parameterName='xmax') + parmObj1 = opObj.getParameterObj(parameterName='ymin') + parmObj2 = opObj.getParameterObj(parameterName='ymax') if parmObj1 == None or parmObj2 ==None: - self.volGraphfreqrange.clear() + self.volGraphIntensityRange.clear() else: value1 = parmObj1.getValue() value1 = str(value1) value2 = parmObj2.getValue() value2 = str(value2) value = value1 + "," + value2 - self.volGraphfreqrange.setText(value) + self.volGraphIntensityRange.setText(value) - parmObj1 = opObj.getParameterObj(parameterName='ymin') - parmObj2 = opObj.getParameterObj(parameterName='ymax') + parmObj1 = opObj.getParameterObj(parameterName='xmin') + parmObj2 = opObj.getParameterObj(parameterName='xmax') if parmObj1 == None or parmObj2 ==None: self.volGraphHeightrange.clear() @@ -3064,6 +3071,17 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): value2 = str(value2) self.volGraphHeightrange.setText(value) + parmObj = opObj.getParameterObj(parameterName='type') + + if parmObj == None: + self.volComScopeType.setCurrentIndex(0) + else: + value = parmObj.getValue() + if value == "iq": + self.volComScopeType.setCurrentIndex(0) + if value == "power": + self.volComScopeType.setCurrentIndex(1) + parmObj = opObj.getParameterObj(parameterName='save') if parmObj == None: @@ -5641,7 +5659,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): # set Graph Voltage self.volGraphChannelList.setEnabled(False) - self.volGraphfreqrange.setEnabled(False) + self.volGraphIntensityRange.setEnabled(False) self.volGraphHeightrange.setEnabled(False) # set Operation Spectra @@ -5703,7 +5721,7 @@ class BasicWindow(QMainWindow, Ui_BasicWindow): # self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') # self.volOpOk.setToolTip('If you have finished, please Ok ') # # tool tip gui volGraph -# self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') +# self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') # self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') # tool tip gui specOp # self.specOpnFFTpoints.setToolTip('Example: 128') diff --git a/schainpy/gui/viewer/windows/ui_voltage.py b/schainpy/gui/viewer/windows/ui_voltage.py index 5e26839..e9d734d 100644 --- a/schainpy/gui/viewer/windows/ui_voltage.py +++ b/schainpy/gui/viewer/windows/ui_voltage.py @@ -207,9 +207,9 @@ class Ui_VoltageTab(object): self.gridLayout_6.setObjectName(_fromUtf8("gridLayout_6")) spacerItem4 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout_6.addItem(spacerItem4, 12, 3, 1, 1) - self.volGraphfreqrange = QtGui.QLineEdit(self.tabgraphVoltage) - self.volGraphfreqrange.setObjectName(_fromUtf8("volGraphfreqrange")) - self.gridLayout_6.addWidget(self.volGraphfreqrange, 9, 1, 1, 6) + self.volGraphIntensityRange = QtGui.QLineEdit(self.tabgraphVoltage) + self.volGraphIntensityRange.setObjectName(_fromUtf8("volGraphIntensityRange")) + self.gridLayout_6.addWidget(self.volGraphIntensityRange, 9, 1, 1, 6) self.volGraphPrefix = QtGui.QLineEdit(self.tabgraphVoltage) self.volGraphPrefix.setObjectName(_fromUtf8("volGraphPrefix")) self.gridLayout_6.addWidget(self.volGraphPrefix, 2, 1, 1, 6) @@ -245,14 +245,28 @@ class Ui_VoltageTab(object): self.gridLayout_6.addWidget(self.label_13, 2, 0, 1, 1) self.label_52 = QtGui.QLabel(self.tabgraphVoltage) self.label_52.setObjectName(_fromUtf8("label_52")) + self.gridLayout_6.addWidget(self.label_52, 11, 0, 1, 1) spacerItem6 = QtGui.QSpacerItem(40, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem6, 14, 5, 1, 2) spacerItem7 = QtGui.QSpacerItem(18, 12, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout_6.addItem(spacerItem7, 14, 3, 1, 1) + + self.volLabScopeType = QtGui.QLabel(self.tabgraphVoltage) + self.volLabScopeType.setObjectName(_fromUtf8("volLabScopeType")) + self.gridLayout_6.addWidget(self.volLabScopeType, 7, 0, 1, 1) + + self.volComScopeType = QtGui.QComboBox(self.tabgraphVoltage) + self.volComScopeType.setObjectName(_fromUtf8("volComScopeType")) + self.volComScopeType.addItem(_fromUtf8("")) + self.volComScopeType.addItem(_fromUtf8("")) + self.gridLayout_6.addWidget(self.volComScopeType, 7, 1, 1, 6) + self.volGraphChannelList = QtGui.QLineEdit(self.tabgraphVoltage) self.volGraphChannelList.setObjectName(_fromUtf8("volGraphChannelList")) self.gridLayout_6.addWidget(self.volGraphChannelList, 8, 1, 1, 6) + + self.volGraphHeightrange = QtGui.QLineEdit(self.tabgraphVoltage) self.volGraphHeightrange.setObjectName(_fromUtf8("volGraphHeightrange")) self.gridLayout_6.addWidget(self.volGraphHeightrange, 11, 1, 1, 6) @@ -353,11 +367,16 @@ class Ui_VoltageTab(object): self.label_14.setText(_translate("MainWindow", "Scope:", None)) self.label_8.setText(_translate("MainWindow", "Channel List:", None)) self.label_49.setText(_translate("MainWindow", "Show:", None)) - self.label_51.setText(_translate("MainWindow", "Height range:", None)) + self.label_51.setText(_translate("MainWindow", "Amplitude/Intensity:", None)) self.label_12.setText(_translate("MainWindow", "Path :", None)) self.label_13.setText(_translate("MainWindow", "Figure name:", None)) - self.label_52.setText(_translate("MainWindow", "Amplitude:", None)) + self.label_52.setText(_translate("MainWindow", "Height range:", None)) self.label_50.setText(_translate("MainWindow", "Save:", None)) + + self.volLabScopeType.setText(_translate("MainWindow", "Scope type:", None)) + self.volComScopeType.setItemText(0, _translate("MainWindow", "I&Q", None)) + self.volComScopeType.setItemText(1, _translate("MainWindow", "Power", None)) + self.tabWidgetVoltage.setTabText(self.tabWidgetVoltage.indexOf(self.tabgraphVoltage), _translate("MainWindow", "Graphics", None)) self.label_36.setText(_translate("MainWindow", "Type:", None)) @@ -382,7 +401,7 @@ class Ui_VoltageTab(object): self.volOpFlip.setToolTip('ChannelList where flip will be applied. Example: 0,2,3') self.volOpOk.setToolTip('If you have finished, please Ok ') # tool tip gui volGraph - self.volGraphfreqrange.setToolTip('Height range. Example: 50,100') + self.volGraphIntensityRange.setToolTip('Height range. Example: 50,100') self.volGraphHeightrange.setToolTip('Amplitude. Example: 0,10000') \ No newline at end of file