refactored PeakWidget and CondWidget, CC,CD,HN unambigously selectable
This commit is contained in:
parent
856619fea5
commit
6f79e976ce
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'ConductivityGroupBox.ui'
|
||||
#
|
||||
# Created: Tue Mar 18 20:24:14 2014
|
||||
# Created: Wed Mar 19 19:18:39 2014
|
||||
# by: PyQt4 UI code generator 4.10.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -26,13 +26,13 @@ except AttributeError:
|
||||
class Ui_ConductivityGroupBox(object):
|
||||
def setupUi(self, ConductivityGroupBox):
|
||||
ConductivityGroupBox.setObjectName(_fromUtf8("ConductivityGroupBox"))
|
||||
ConductivityGroupBox.resize(254, 150)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
|
||||
ConductivityGroupBox.resize(218, 156)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(ConductivityGroupBox.sizePolicy().hasHeightForWidth())
|
||||
ConductivityGroupBox.setSizePolicy(sizePolicy)
|
||||
ConductivityGroupBox.setMinimumSize(QtCore.QSize(0, 150))
|
||||
ConductivityGroupBox.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.gridLayout_2 = QtGui.QGridLayout(ConductivityGroupBox)
|
||||
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
|
||||
self.gridLayout = QtGui.QGridLayout()
|
||||
@ -40,92 +40,56 @@ class Ui_ConductivityGroupBox(object):
|
||||
self.gridLayout.setSpacing(1)
|
||||
self.gridLayout.setContentsMargins(0, 0, -1, -1)
|
||||
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
|
||||
self.checkBox_2 = QtGui.QCheckBox(ConductivityGroupBox)
|
||||
self.checkBox_2.setText(_fromUtf8(""))
|
||||
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
|
||||
self.gridLayout.addWidget(self.checkBox_2, 2, 4, 1, 1)
|
||||
self.checkBox_1 = QtGui.QCheckBox(ConductivityGroupBox)
|
||||
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox_1.setText(_fromUtf8(""))
|
||||
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
|
||||
self.gridLayout.addWidget(self.checkBox_1, 1, 4, 1, 1)
|
||||
self.lineEdit_3 = QtGui.QLineEdit(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
||||
self.label = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lineEdit_3.sizePolicy().hasHeightForWidth())
|
||||
self.lineEdit_3.setSizePolicy(sizePolicy)
|
||||
self.lineEdit_3.setMaximumSize(QtCore.QSize(90, 16777215))
|
||||
self.lineEdit_3.setObjectName(_fromUtf8("lineEdit_3"))
|
||||
self.gridLayout.addWidget(self.lineEdit_3, 3, 1, 1, 1)
|
||||
self.label_3 = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_3.setObjectName(_fromUtf8("label_3"))
|
||||
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
|
||||
self.pushButton_2 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_2.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_2.setSizePolicy(sizePolicy)
|
||||
self.pushButton_2.setAutoRepeat(True)
|
||||
self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
|
||||
self.gridLayout.addWidget(self.pushButton_2, 1, 3, 1, 1)
|
||||
self.label_2 = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.pushButton_5 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_5.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_5.setSizePolicy(sizePolicy)
|
||||
self.pushButton_5.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.pushButton_5.setAutoRepeat(True)
|
||||
self.pushButton_5.setObjectName(_fromUtf8("pushButton_5"))
|
||||
self.gridLayout.addWidget(self.pushButton_5, 3, 2, 1, 1)
|
||||
self.pushButton_6 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_6.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_6.setSizePolicy(sizePolicy)
|
||||
self.pushButton_6.setAutoRepeat(True)
|
||||
self.pushButton_6.setObjectName(_fromUtf8("pushButton_6"))
|
||||
self.gridLayout.addWidget(self.pushButton_6, 3, 3, 1, 1)
|
||||
self.lineEdit_2 = QtGui.QLineEdit(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lineEdit_2.sizePolicy().hasHeightForWidth())
|
||||
self.lineEdit_2.setSizePolicy(sizePolicy)
|
||||
self.lineEdit_2.setMaximumSize(QtCore.QSize(90, 16777215))
|
||||
self.lineEdit_2.setObjectName(_fromUtf8("lineEdit_2"))
|
||||
self.gridLayout.addWidget(self.lineEdit_2, 2, 1, 1, 1)
|
||||
self.lineEdit_1 = QtGui.QLineEdit(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.lineEdit_1.sizePolicy().hasHeightForWidth())
|
||||
self.lineEdit_1.setSizePolicy(sizePolicy)
|
||||
self.lineEdit_1.setMaximumSize(QtCore.QSize(90, 16777215))
|
||||
self.lineEdit_1.setObjectName(_fromUtf8("lineEdit_1"))
|
||||
self.gridLayout.addWidget(self.lineEdit_1, 1, 1, 1, 1)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.gridLayout.addWidget(self.label, 0, 3, 1, 1)
|
||||
self.removeButton = QtGui.QPushButton(ConductivityGroupBox)
|
||||
self.removeButton.setObjectName(_fromUtf8("removeButton"))
|
||||
self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1)
|
||||
self.checkBox_3 = QtGui.QCheckBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.checkBox_3.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox_3.setSizePolicy(sizePolicy)
|
||||
self.checkBox_3.setText(_fromUtf8(""))
|
||||
self.checkBox_3.setChecked(True)
|
||||
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
|
||||
self.gridLayout.addWidget(self.checkBox_3, 3, 4, 1, 1)
|
||||
self.gridLayout.addWidget(self.checkBox_3, 3, 3, 1, 1, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
|
||||
self.label_6 = QtGui.QLabel(ConductivityGroupBox)
|
||||
self.label_6.setObjectName(_fromUtf8("label_6"))
|
||||
self.gridLayout.addWidget(self.label_6, 3, 2, 1, 1)
|
||||
self.label_4 = QtGui.QLabel(ConductivityGroupBox)
|
||||
self.label_4.setObjectName(_fromUtf8("label_4"))
|
||||
self.gridLayout.addWidget(self.label_4, 1, 2, 1, 1)
|
||||
self.doubleSpinBox_1 = QtGui.QDoubleSpinBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.doubleSpinBox_1.sizePolicy().hasHeightForWidth())
|
||||
self.doubleSpinBox_1.setSizePolicy(sizePolicy)
|
||||
self.doubleSpinBox_1.setSingleStep(0.05)
|
||||
self.doubleSpinBox_1.setObjectName(_fromUtf8("doubleSpinBox_1"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_1, 1, 1, 1, 1)
|
||||
self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.doubleSpinBox_3.sizePolicy().hasHeightForWidth())
|
||||
self.doubleSpinBox_3.setSizePolicy(sizePolicy)
|
||||
self.doubleSpinBox_3.setSingleStep(0.05)
|
||||
self.doubleSpinBox_3.setProperty("value", 1.0)
|
||||
self.doubleSpinBox_3.setObjectName(_fromUtf8("doubleSpinBox_3"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_3, 3, 1, 1, 1)
|
||||
self.label_5 = QtGui.QLabel(ConductivityGroupBox)
|
||||
self.label_5.setObjectName(_fromUtf8("label_5"))
|
||||
self.gridLayout.addWidget(self.label_5, 2, 2, 1, 1)
|
||||
self.label_1 = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@ -135,50 +99,52 @@ class Ui_ConductivityGroupBox(object):
|
||||
self.label_1.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_1.setObjectName(_fromUtf8("label_1"))
|
||||
self.gridLayout.addWidget(self.label_1, 1, 0, 1, 1)
|
||||
self.pushButton_3 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_3.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_3.setSizePolicy(sizePolicy)
|
||||
self.pushButton_3.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.pushButton_3.setAutoRepeat(True)
|
||||
self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
|
||||
self.gridLayout.addWidget(self.pushButton_3, 2, 2, 1, 1)
|
||||
self.pushButton_4 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHeightForWidth(self.doubleSpinBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.doubleSpinBox_2.setSizePolicy(sizePolicy)
|
||||
self.doubleSpinBox_2.setObjectName(_fromUtf8("doubleSpinBox_2"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_2, 2, 1, 1, 1)
|
||||
self.label_3 = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_4.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_4.setSizePolicy(sizePolicy)
|
||||
self.pushButton_4.setAutoRepeat(True)
|
||||
self.pushButton_4.setObjectName(_fromUtf8("pushButton_4"))
|
||||
self.gridLayout.addWidget(self.pushButton_4, 2, 3, 1, 1)
|
||||
self.pushButton_1 = QtGui.QPushButton(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
|
||||
self.label_3.setSizePolicy(sizePolicy)
|
||||
self.label_3.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_3.setObjectName(_fromUtf8("label_3"))
|
||||
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
|
||||
self.label_2 = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.pushButton_1.sizePolicy().hasHeightForWidth())
|
||||
self.pushButton_1.setSizePolicy(sizePolicy)
|
||||
self.pushButton_1.setMinimumSize(QtCore.QSize(50, 0))
|
||||
self.pushButton_1.setAutoRepeat(True)
|
||||
self.pushButton_1.setAutoDefault(False)
|
||||
self.pushButton_1.setDefault(False)
|
||||
self.pushButton_1.setFlat(False)
|
||||
self.pushButton_1.setObjectName(_fromUtf8("pushButton_1"))
|
||||
self.gridLayout.addWidget(self.pushButton_1, 1, 2, 1, 1)
|
||||
self.label = QtGui.QLabel(ConductivityGroupBox)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.checkBox_2 = QtGui.QCheckBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
|
||||
self.label.setSizePolicy(sizePolicy)
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.gridLayout.addWidget(self.label, 0, 4, 1, 1)
|
||||
self.removeButton = QtGui.QPushButton(ConductivityGroupBox)
|
||||
self.removeButton.setObjectName(_fromUtf8("removeButton"))
|
||||
self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1)
|
||||
sizePolicy.setHeightForWidth(self.checkBox_2.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox_2.setSizePolicy(sizePolicy)
|
||||
self.checkBox_2.setText(_fromUtf8(""))
|
||||
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
|
||||
self.gridLayout.addWidget(self.checkBox_2, 2, 3, 1, 1, QtCore.Qt.AlignHCenter)
|
||||
self.checkBox_1 = QtGui.QCheckBox(ConductivityGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.checkBox_1.sizePolicy().hasHeightForWidth())
|
||||
self.checkBox_1.setSizePolicy(sizePolicy)
|
||||
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox_1.setText(_fromUtf8(""))
|
||||
self.checkBox_1.setChecked(True)
|
||||
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
|
||||
self.gridLayout.addWidget(self.checkBox_1, 1, 3, 1, 1, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
|
||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(ConductivityGroupBox)
|
||||
@ -187,19 +153,13 @@ class Ui_ConductivityGroupBox(object):
|
||||
|
||||
def retranslateUi(self, ConductivityGroupBox):
|
||||
ConductivityGroupBox.setWindowTitle(_translate("ConductivityGroupBox", "GroupBox", None))
|
||||
ConductivityGroupBox.setTitle(_translate("ConductivityGroupBox", "GroupBox", None))
|
||||
self.lineEdit_3.setText(_translate("ConductivityGroupBox", "0.0", None))
|
||||
self.label_3.setText(_translate("ConductivityGroupBox", "α", None))
|
||||
self.pushButton_2.setText(_translate("ConductivityGroupBox", "+", None))
|
||||
self.label_2.setText(_translate("ConductivityGroupBox", "σ", None))
|
||||
self.pushButton_5.setText(_translate("ConductivityGroupBox", "-", None))
|
||||
self.pushButton_6.setText(_translate("ConductivityGroupBox", "+", None))
|
||||
self.lineEdit_2.setText(_translate("ConductivityGroupBox", "0.00e+00", None))
|
||||
self.lineEdit_1.setText(_translate("ConductivityGroupBox", "0.00e+00", None))
|
||||
self.label_1.setText(_translate("ConductivityGroupBox", "<html><head/><body><p>ε<span style=\" vertical-align:sub;\">infty</span></p></body></html>", None))
|
||||
self.pushButton_3.setText(_translate("ConductivityGroupBox", "-", None))
|
||||
self.pushButton_4.setText(_translate("ConductivityGroupBox", "+", None))
|
||||
self.pushButton_1.setText(_translate("ConductivityGroupBox", "-", None))
|
||||
ConductivityGroupBox.setTitle(_translate("ConductivityGroupBox", "Conductivity", None))
|
||||
self.label.setText(_translate("ConductivityGroupBox", "Fix", None))
|
||||
self.removeButton.setText(_translate("ConductivityGroupBox", "Remove", None))
|
||||
self.label_6.setText(_translate("ConductivityGroupBox", "TextLabel", None))
|
||||
self.label_4.setText(_translate("ConductivityGroupBox", "TextLabel", None))
|
||||
self.label_5.setText(_translate("ConductivityGroupBox", "TextLabel", None))
|
||||
self.label_1.setText(_translate("ConductivityGroupBox", "<html><head/><body><p>ε<span style=\" vertical-align:sub;\">infty</span></p></body></html>", None))
|
||||
self.label_3.setText(_translate("ConductivityGroupBox", "α", None))
|
||||
self.label_2.setText(_translate("ConductivityGroupBox", "σ", None))
|
||||
|
||||
|
@ -6,12 +6,12 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>254</width>
|
||||
<height>150</height>
|
||||
<width>218</width>
|
||||
<height>156</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@ -19,14 +19,14 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>150</height>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>GroupBox</string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>GroupBox</string>
|
||||
<string>Conductivity</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
@ -43,259 +43,7 @@
|
||||
<property name="spacing">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="2" column="4">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="4">
|
||||
<widget class="QCheckBox" name="checkBox_1">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0.0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>α</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>σ</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QPushButton" name="pushButton_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QPushButton" name="pushButton_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0.00e+00</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>90</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>0.00e+00</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="4">
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>ε<span style=" vertical-align:sub;">infty</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="pushButton_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QPushButton" name="pushButton_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>+</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="pushButton_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>-</string>
|
||||
</property>
|
||||
<property name="autoRepeat">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="4">
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
@ -318,6 +66,162 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
<property name="value">
|
||||
<double>1.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body><p>ε<span style=" vertical-align:sub;">infty</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>α</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>σ</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
|
||||
<widget class="QCheckBox" name="checkBox_1">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -1,76 +1,3 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
import ConductivityGroupBox
|
||||
|
||||
|
||||
class ConductivityWidget(QGroupBox):
|
||||
changedTable = pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QGroupBox.__init__(self)
|
||||
super(ConductivityWidget, self).__init__(parent)
|
||||
self.setTitle(u"Conductivity …")
|
||||
self.ui = ConductivityGroupBox.Ui_ConductivityGroupBox()
|
||||
self.ui.setupUi(self)
|
||||
self.lineEdits = [self.ui.lineEdit_1,
|
||||
self.ui.lineEdit_2,
|
||||
self.ui.lineEdit_3]
|
||||
self.fixedCheckBoxes = [self.ui.checkBox_1,
|
||||
self.ui.checkBox_2,
|
||||
self.ui.checkBox_3]
|
||||
for le in self.lineEdits:
|
||||
le.editingFinished.connect(self.changedTable.emit)
|
||||
self.signalMapper = QSignalMapper(self)
|
||||
for i, button in enumerate([self.ui.pushButton_1,
|
||||
self.ui.pushButton_2,
|
||||
self.ui.pushButton_3,
|
||||
self.ui.pushButton_4,
|
||||
self.ui.pushButton_5,
|
||||
self.ui.pushButton_6,
|
||||
]):
|
||||
self.signalMapper.setMapping(button, i)
|
||||
button.clicked.connect(self.signalMapper.map)
|
||||
self.signalMapper.mapped.connect(self.changeValues)
|
||||
|
||||
def changeValues(self, num):
|
||||
logstep = 10**0.05 # 10 log even steps per decade
|
||||
linstep = 0.05
|
||||
# 0-3 down/up for d_eps and tau, respectively
|
||||
# 4-7 down, up for a, b
|
||||
if num == 0:
|
||||
self.ui.lineEdit_1.setText("%.2e" % (self.ui.lineEdit_1.text().toDouble()[0] / logstep))
|
||||
if num == 1:
|
||||
self.ui.lineEdit_1.setText("%.2e" % (self.ui.lineEdit_1.text().toDouble()[0] * logstep))
|
||||
if num == 2:
|
||||
self.ui.lineEdit_2.setText("%.2e" % (self.ui.lineEdit_2.text().toDouble()[0] / logstep))
|
||||
if num == 3:
|
||||
self.ui.lineEdit_2.setText("%.2e" % (self.ui.lineEdit_2.text().toDouble()[0] * logstep))
|
||||
if num == 4:
|
||||
self.ui.lineEdit_3.setText("%.2e" % (self.ui.lineEdit_3.text().toDouble()[0] - linstep))
|
||||
if num == 5:
|
||||
self.ui.lineEdit_3.setText("%.2e" % (self.ui.lineEdit_3.text().toDouble()[0] + linstep))
|
||||
self.changedTable.emit()
|
||||
|
||||
def fixedParameter(self):
|
||||
return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes]
|
||||
|
||||
def setColor(self, color):
|
||||
r, g, b = color
|
||||
palette = self.palette()
|
||||
palette.setColor(QPalette.Foreground, QColor(r, g, b))
|
||||
self.setPalette(palette)
|
||||
|
||||
def getTable(self):
|
||||
tmp = [i.text().toDouble()[0] # selects the number, ignores the status
|
||||
for i in self.lineEdits]
|
||||
print "peakParams:", tmp
|
||||
return tmp
|
||||
|
||||
def update(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
def updateTable(self, *args):
|
||||
for i, arg in enumerate(args):
|
||||
self.lineEdits[i].setText("%g" % (args[i]))
|
||||
|
||||
|
225
CustomWidgets.py
225
CustomWidgets.py
@ -1,12 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
from PyQt4.QtGui import QGroupBox, QPalette, QColor
|
||||
import ConductivityGroupBox
|
||||
import PeakGroupBox
|
||||
|
||||
__author__ = 'markusro'
|
||||
|
||||
from PyQt4 import QtGui
|
||||
|
||||
from PyQt4.QtGui import *
|
||||
from PyQt4.QtCore import QRegExp
|
||||
from PyQt4.QtCore import QRegExp, pyqtSignal
|
||||
import PeakWidget
|
||||
|
||||
|
||||
@ -36,7 +39,225 @@ class LogFSpinBox(QDoubleSpinBox):
|
||||
class ParameterWidget(QWidget):
|
||||
def __init__(self, parent = None):
|
||||
super(ParameterWidget, self).__init__(parent)
|
||||
layout = QGridLayout(self)
|
||||
self.vlayout = QVBoxLayout(self)
|
||||
self.vlayout.addSpacerItem(QSpacerItem(10,10,QSizePolicy.Minimum, QSizePolicy.Expanding) )
|
||||
self.vlayout.addSpacerItem(QSpacerItem(10,10,QSizePolicy.Minimum, QSizePolicy.Expanding) )
|
||||
#self.vlayout.addStretch(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication([])
|
||||
|
||||
|
||||
class PeakWidget(QGroupBox):
|
||||
changedTable = pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QGroupBox.__init__(self)
|
||||
super(PeakWidget, self).__init__(parent)
|
||||
self.ui = PeakGroupBox.Ui_PeakGroupBox()
|
||||
# replace eps and tau with LogFSpinBox
|
||||
|
||||
self.ui.setupUi(self)
|
||||
self.ui.doubleSpinBox_1.setParent(None)
|
||||
self.ui.doubleSpinBox_1 = LogFSpinBox(self)
|
||||
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_1,1,1)
|
||||
self.ui.doubleSpinBox_2.setParent(None)
|
||||
self.ui.doubleSpinBox_2 = LogFSpinBox(self)
|
||||
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_2,2,1)
|
||||
|
||||
self.inputs = [
|
||||
self.ui.doubleSpinBox_1,
|
||||
self.ui.doubleSpinBox_2,
|
||||
self.ui.doubleSpinBox_3,
|
||||
self.ui.doubleSpinBox_4
|
||||
]
|
||||
|
||||
self.errors = [
|
||||
self.ui.label_5,
|
||||
self.ui.label_6,
|
||||
self.ui.label_7,
|
||||
self.ui.label_8,
|
||||
]
|
||||
|
||||
|
||||
|
||||
for dsb in self.inputs:
|
||||
dsb.valueChanged.connect(self.changeValues)
|
||||
|
||||
self.fixedCheckBoxes = [self.ui.checkBox_1,
|
||||
self.ui.checkBox_2,
|
||||
self.ui.checkBox_3,
|
||||
self.ui.checkBox_4]
|
||||
# self.ui.checkBox_3.stateChanged.connect(self._distrib_cc)
|
||||
# self.ui.checkBox_4.stateChanged.connect(self._distrib_cd)
|
||||
self.ui.comboBox.currentIndexChanged.connect(self._distrib_select)
|
||||
|
||||
|
||||
def changeValues(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
|
||||
def _distrib_select(self, dist):
|
||||
if dist == 0: # hav-neg:
|
||||
self.ui.checkBox_3.setChecked(False)
|
||||
self.ui.checkBox_3.setDisabled(False)
|
||||
self.ui.checkBox_4.setChecked(False)
|
||||
self.ui.checkBox_3.setDisabled(False)
|
||||
self.ui.doubleSpinBox_3.setDisabled(False)
|
||||
self.ui.doubleSpinBox_4.setDisabled(False)
|
||||
|
||||
if dist == 1: # Cole-Cole:
|
||||
self._distrib_cc(1)
|
||||
if dist == 2: # Cole-Davidson
|
||||
self._distrib_cd(1)
|
||||
|
||||
def _distrib_cd(self, state):
|
||||
if state:
|
||||
self.ui.doubleSpinBox_3.setValue(1.0)
|
||||
self.ui.doubleSpinBox_3.setDisabled(True)
|
||||
self.ui.doubleSpinBox_4.setDisabled(False)
|
||||
self.ui.checkBox_3.setChecked(True)
|
||||
self.ui.checkBox_3.setDisabled(True)
|
||||
self.ui.checkBox_4.setChecked(False)
|
||||
else:
|
||||
self.ui.doubleSpinBox_3.setDisabled(False)
|
||||
|
||||
def _distrib_cc(self, state):
|
||||
if state:
|
||||
self.ui.doubleSpinBox_4.setValue(1.0)
|
||||
self.ui.doubleSpinBox_4.setDisabled(True)
|
||||
self.ui.doubleSpinBox_3.setDisabled(False)
|
||||
self.ui.checkBox_3.setChecked(False)
|
||||
self.ui.checkBox_4.setChecked(True)
|
||||
self.ui.checkBox_4.setDisabled(True)
|
||||
else:
|
||||
self.ui.doubleSpinBox_4.setDisabled(False)
|
||||
|
||||
|
||||
|
||||
def fixedParameter(self):
|
||||
return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes]
|
||||
|
||||
def setId(self, id):
|
||||
self.id = id
|
||||
self.setTitle("Peak %i" % id)
|
||||
|
||||
def setColor(self, color):
|
||||
palette = self.palette()
|
||||
palette.setColor(QPalette.Foreground, color)
|
||||
self.setPalette(palette)
|
||||
|
||||
def peakParameter(self):
|
||||
tmp = [i.value() for i in self.inputs]
|
||||
return tmp
|
||||
|
||||
def update(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
def updateTable(self, beta=None, sd_beta = None):
|
||||
#print "updateTable", args
|
||||
|
||||
for i, arg in enumerate(beta):
|
||||
self.inputs[i].setValue(arg)
|
||||
sd_style=""
|
||||
if i in (0,1) and sd_beta is not None:
|
||||
sd = "+/- %.3e"%(sd_beta[i])
|
||||
elif i in (2,3) and sd_beta is not None:
|
||||
sd = "+/- %.2f"%(sd_beta[i])
|
||||
if sd_beta is not None:
|
||||
if 0.0 < sd_beta[i]/arg < 0.2:
|
||||
sd_style="background-color: rgba(0, 255, 0, 64);"
|
||||
if 0.2 < sd_beta[i]/arg < 1.0:
|
||||
sd_style="background-color: rgba(255,255, 0, 64);"
|
||||
elif sd_beta[i]/arg > 1.0:
|
||||
sd_style="background-color: rgba(255, 0, 0, 64);"
|
||||
|
||||
else:
|
||||
sd = "( --- )"
|
||||
self.errors[i].setStyleSheet(sd_style)
|
||||
self.errors[i].setText(sd)
|
||||
|
||||
def killme(self):
|
||||
self.setParent(None)
|
||||
|
||||
|
||||
class ConductivityWidget(QGroupBox):
|
||||
changedTable = pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QGroupBox.__init__(self)
|
||||
super(ConductivityWidget, self).__init__(parent)
|
||||
self.setTitle(u"Conductivity …")
|
||||
self.ui = ConductivityGroupBox.Ui_ConductivityGroupBox()
|
||||
self.ui.setupUi(self)
|
||||
|
||||
# eps_static
|
||||
#self.ui.doubleSpinBox_1.setParent(None)
|
||||
#self.ui.doubleSpinBox_1 = LogFSpinBox(self)
|
||||
#self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_1,1,1)
|
||||
|
||||
# dc_conductivity
|
||||
self.ui.doubleSpinBox_2.setParent(None)
|
||||
self.ui.doubleSpinBox_2 = LogFSpinBox(self)
|
||||
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_2,2,1)
|
||||
|
||||
self.errors = [
|
||||
self.ui.label_4,
|
||||
self.ui.label_5,
|
||||
self.ui.label_6,
|
||||
]
|
||||
|
||||
|
||||
|
||||
self.inputs = [self.ui.doubleSpinBox_1,
|
||||
self.ui.doubleSpinBox_2,
|
||||
self.ui.doubleSpinBox_3]
|
||||
self.fixedCheckBoxes = [self.ui.checkBox_1,
|
||||
self.ui.checkBox_2,
|
||||
self.ui.checkBox_3]
|
||||
for dsb in self.inputs:
|
||||
dsb.valueChanged.connect(self.changeValues)
|
||||
|
||||
|
||||
def changeValues(self, num):
|
||||
self.changedTable.emit()
|
||||
|
||||
def fixedParameter(self):
|
||||
return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes]
|
||||
|
||||
def setColor(self, color):
|
||||
r, g, b = color
|
||||
palette = self.palette()
|
||||
palette.setColor(QPalette.Foreground, QColor(r, g, b))
|
||||
self.setPalette(palette)
|
||||
|
||||
def getTable(self):
|
||||
tmp = [i.value() # selects the number, ignores the status
|
||||
for i in self.inputs]
|
||||
#print "peakParams:", tmp
|
||||
return tmp
|
||||
|
||||
def update(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
def updateTable(self, beta, sd_beta=None):
|
||||
for i, arg in enumerate(beta):
|
||||
self.inputs[i].setValue(arg)
|
||||
sd_style=""
|
||||
if i in (0,1) and sd_beta is not None:
|
||||
sd = "+/- %.3e"%(sd_beta[i])
|
||||
elif i in (2,3) and sd_beta is not None:
|
||||
sd = "+/- %.2f"%(sd_beta[i])
|
||||
if sd_beta is not None:
|
||||
if 0.0 < sd_beta[i]/arg < 0.2:
|
||||
sd_style="background-color: rgba(0, 255, 0, 64);"
|
||||
if 0.2 < sd_beta[i]/arg < 1.0:
|
||||
sd_style="background-color: rgba(255,255, 0, 64);"
|
||||
elif sd_beta[i]/arg > 1.0:
|
||||
sd_style="background-color: rgba(255, 0, 0, 64);"
|
||||
|
||||
else:
|
||||
sd = "( --- )"
|
||||
self.errors[i].setStyleSheet(sd_style)
|
||||
self.errors[i].setText(sd)
|
122
PeakGroupBox.py
122
PeakGroupBox.py
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'PeakGroupBox.ui'
|
||||
#
|
||||
# Created: Tue Mar 18 20:24:14 2014
|
||||
# Created: Wed Mar 19 19:18:39 2014
|
||||
# by: PyQt4 UI code generator 4.10.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -27,13 +27,13 @@ class Ui_PeakGroupBox(object):
|
||||
def setupUi(self, PeakGroupBox):
|
||||
PeakGroupBox.setObjectName(_fromUtf8("PeakGroupBox"))
|
||||
PeakGroupBox.setEnabled(True)
|
||||
PeakGroupBox.resize(320, 210)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed)
|
||||
PeakGroupBox.resize(269, 179)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(PeakGroupBox.sizePolicy().hasHeightForWidth())
|
||||
PeakGroupBox.setSizePolicy(sizePolicy)
|
||||
PeakGroupBox.setMinimumSize(QtCore.QSize(308, 210))
|
||||
PeakGroupBox.setMinimumSize(QtCore.QSize(0, 0))
|
||||
PeakGroupBox.setAutoFillBackground(False)
|
||||
PeakGroupBox.setFlat(False)
|
||||
PeakGroupBox.setCheckable(False)
|
||||
@ -41,8 +41,8 @@ class Ui_PeakGroupBox(object):
|
||||
self.gridLayout_2.setMargin(10)
|
||||
self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
|
||||
self.gridLayout = QtGui.QGridLayout()
|
||||
self.gridLayout.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
|
||||
self.gridLayout.setSpacing(5)
|
||||
self.gridLayout.setSizeConstraint(QtGui.QLayout.SetFixedSize)
|
||||
self.gridLayout.setSpacing(1)
|
||||
self.gridLayout.setContentsMargins(0, 0, -1, -1)
|
||||
self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
|
||||
self.label = QtGui.QLabel(PeakGroupBox)
|
||||
@ -54,30 +54,6 @@ class Ui_PeakGroupBox(object):
|
||||
self.label.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label.setObjectName(_fromUtf8("label"))
|
||||
self.gridLayout.addWidget(self.label, 0, 3, 1, 1)
|
||||
self.checkBox_1 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox_1.setText(_fromUtf8(""))
|
||||
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
|
||||
self.gridLayout.addWidget(self.checkBox_1, 1, 3, 1, 1)
|
||||
self.checkBox_3 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
|
||||
self.gridLayout.addWidget(self.checkBox_3, 3, 3, 1, 1)
|
||||
self.checkBox_2 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_2.setText(_fromUtf8(""))
|
||||
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
|
||||
self.gridLayout.addWidget(self.checkBox_2, 2, 3, 1, 1)
|
||||
self.label_2 = QtGui.QLabel(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.checkBox_4 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_4.setObjectName(_fromUtf8("checkBox_4"))
|
||||
self.gridLayout.addWidget(self.checkBox_4, 5, 3, 1, 1)
|
||||
self.label_5 = QtGui.QLabel(PeakGroupBox)
|
||||
self.label_5.setObjectName(_fromUtf8("label_5"))
|
||||
self.gridLayout.addWidget(self.label_5, 1, 2, 1, 1)
|
||||
@ -88,14 +64,14 @@ class Ui_PeakGroupBox(object):
|
||||
self.label_6.setObjectName(_fromUtf8("label_6"))
|
||||
self.gridLayout.addWidget(self.label_6, 2, 2, 1, 1)
|
||||
self.removeButton = QtGui.QPushButton(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.removeButton.sizePolicy().hasHeightForWidth())
|
||||
self.removeButton.setSizePolicy(sizePolicy)
|
||||
self.removeButton.setMinimumSize(QtCore.QSize(124, 0))
|
||||
self.removeButton.setMinimumSize(QtCore.QSize(0, 0))
|
||||
self.removeButton.setObjectName(_fromUtf8("removeButton"))
|
||||
self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1)
|
||||
self.gridLayout.addWidget(self.removeButton, 0, 1, 1, 1, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
|
||||
self.label_1 = QtGui.QLabel(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@ -116,7 +92,21 @@ class Ui_PeakGroupBox(object):
|
||||
self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
|
||||
self.label_8 = QtGui.QLabel(PeakGroupBox)
|
||||
self.label_8.setObjectName(_fromUtf8("label_8"))
|
||||
self.gridLayout.addWidget(self.label_8, 5, 2, 1, 1)
|
||||
self.gridLayout.addWidget(self.label_8, 4, 2, 1, 1)
|
||||
self.doubleSpinBox_4 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_4.setSingleStep(0.05)
|
||||
self.doubleSpinBox_4.setObjectName(_fromUtf8("doubleSpinBox_4"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_4, 4, 1, 1, 1)
|
||||
self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_3.setSingleStep(0.05)
|
||||
self.doubleSpinBox_3.setObjectName(_fromUtf8("doubleSpinBox_3"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_3, 3, 1, 1, 1)
|
||||
self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_2.setObjectName(_fromUtf8("doubleSpinBox_2"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_2, 2, 1, 1, 1)
|
||||
self.doubleSpinBox_1 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_1.setObjectName(_fromUtf8("doubleSpinBox_1"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_1, 1, 1, 1, 1)
|
||||
self.label_4 = QtGui.QLabel(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
@ -125,21 +115,44 @@ class Ui_PeakGroupBox(object):
|
||||
self.label_4.setSizePolicy(sizePolicy)
|
||||
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_4.setObjectName(_fromUtf8("label_4"))
|
||||
self.gridLayout.addWidget(self.label_4, 5, 0, 1, 1)
|
||||
self.doubleSpinBox_1 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_1.setObjectName(_fromUtf8("doubleSpinBox_1"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_1, 1, 1, 1, 1)
|
||||
self.doubleSpinBox_2 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_2.setObjectName(_fromUtf8("doubleSpinBox_2"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_2, 2, 1, 1, 1)
|
||||
self.doubleSpinBox_3 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_3.setObjectName(_fromUtf8("doubleSpinBox_3"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_3, 3, 1, 1, 1)
|
||||
self.doubleSpinBox_4 = QtGui.QDoubleSpinBox(PeakGroupBox)
|
||||
self.doubleSpinBox_4.setObjectName(_fromUtf8("doubleSpinBox_4"))
|
||||
self.gridLayout.addWidget(self.doubleSpinBox_4, 5, 1, 1, 1)
|
||||
self.gridLayout.setColumnStretch(1, 1)
|
||||
self.gridLayout.setColumnStretch(2, 1)
|
||||
self.gridLayout.addWidget(self.label_4, 4, 0, 1, 1)
|
||||
self.checkBox_4 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_4.setText(_fromUtf8(""))
|
||||
self.checkBox_4.setObjectName(_fromUtf8("checkBox_4"))
|
||||
self.gridLayout.addWidget(self.checkBox_4, 4, 3, 1, 1, QtCore.Qt.AlignHCenter)
|
||||
self.label_2 = QtGui.QLabel(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
|
||||
self.label_2.setSizePolicy(sizePolicy)
|
||||
self.label_2.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_2.setObjectName(_fromUtf8("label_2"))
|
||||
self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
|
||||
self.checkBox_2 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_2.setText(_fromUtf8(""))
|
||||
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
|
||||
self.gridLayout.addWidget(self.checkBox_2, 2, 3, 1, 1, QtCore.Qt.AlignHCenter)
|
||||
self.checkBox_3 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_3.setText(_fromUtf8(""))
|
||||
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
|
||||
self.gridLayout.addWidget(self.checkBox_3, 3, 3, 1, 1, QtCore.Qt.AlignHCenter)
|
||||
self.checkBox_1 = QtGui.QCheckBox(PeakGroupBox)
|
||||
self.checkBox_1.setLayoutDirection(QtCore.Qt.LeftToRight)
|
||||
self.checkBox_1.setText(_fromUtf8(""))
|
||||
self.checkBox_1.setObjectName(_fromUtf8("checkBox_1"))
|
||||
self.gridLayout.addWidget(self.checkBox_1, 1, 3, 1, 1, QtCore.Qt.AlignHCenter)
|
||||
self.comboBox = QtGui.QComboBox(PeakGroupBox)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.comboBox.sizePolicy().hasHeightForWidth())
|
||||
self.comboBox.setSizePolicy(sizePolicy)
|
||||
self.comboBox.setObjectName(_fromUtf8("comboBox"))
|
||||
self.comboBox.addItem(_fromUtf8(""))
|
||||
self.comboBox.addItem(_fromUtf8(""))
|
||||
self.comboBox.addItem(_fromUtf8(""))
|
||||
self.gridLayout.addWidget(self.comboBox, 0, 2, 1, 1, QtCore.Qt.AlignHCenter|QtCore.Qt.AlignVCenter)
|
||||
self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
|
||||
|
||||
self.retranslateUi(PeakGroupBox)
|
||||
@ -150,15 +163,16 @@ class Ui_PeakGroupBox(object):
|
||||
PeakGroupBox.setWindowTitle(_translate("PeakGroupBox", "GroupBox", None))
|
||||
PeakGroupBox.setTitle(_translate("PeakGroupBox", "GroupBox", None))
|
||||
self.label.setText(_translate("PeakGroupBox", "Fix", None))
|
||||
self.checkBox_3.setText(_translate("PeakGroupBox", "CD", None))
|
||||
self.label_2.setText(_translate("PeakGroupBox", "τ", None))
|
||||
self.checkBox_4.setText(_translate("PeakGroupBox", "CC", None))
|
||||
self.label_5.setText(_translate("PeakGroupBox", "TextLabel", None))
|
||||
self.label_7.setText(_translate("PeakGroupBox", "TextLabel", None))
|
||||
self.label_6.setText(_translate("PeakGroupBox", "TextLabel", None))
|
||||
self.removeButton.setText(_translate("PeakGroupBox", "Remove", None))
|
||||
self.label_1.setText(_translate("PeakGroupBox", "Δε", None))
|
||||
self.label_3.setText(_translate("PeakGroupBox", "γ", None))
|
||||
self.label_3.setText(_translate("PeakGroupBox", "<html><head/><body><p>γ<span style=\" vertical-align:sub;\">CC</span></p></body></html>", None))
|
||||
self.label_8.setText(_translate("PeakGroupBox", "TextLabel", None))
|
||||
self.label_4.setText(_translate("PeakGroupBox", "β", None))
|
||||
self.label_4.setText(_translate("PeakGroupBox", "<html><head/><body><p>β<span style=\" vertical-align:sub;\">CD</span></p></body></html>", None))
|
||||
self.label_2.setText(_translate("PeakGroupBox", "τ", None))
|
||||
self.comboBox.setItemText(0, _translate("PeakGroupBox", "H-N", None))
|
||||
self.comboBox.setItemText(1, _translate("PeakGroupBox", "C-C", None))
|
||||
self.comboBox.setItemText(2, _translate("PeakGroupBox", "C-D", None))
|
||||
|
||||
|
175
PeakGroupBox.ui
175
PeakGroupBox.ui
@ -9,20 +9,20 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>320</width>
|
||||
<height>210</height>
|
||||
<width>269</width>
|
||||
<height>179</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>308</width>
|
||||
<height>210</height>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -40,14 +40,14 @@
|
||||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0,0">
|
||||
<layout class="QGridLayout" name="gridLayout_2" rowstretch="0">
|
||||
<property name="margin">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0,0" columnstretch="0,1,1,0">
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0,0,0,0,0" columnstretch="0,0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
<enum>QLayout::SetDefaultConstraint</enum>
|
||||
<enum>QLayout::SetFixedSize</enum>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
@ -56,7 +56,7 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>5</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="3">
|
||||
<widget class="QLabel" name="label">
|
||||
@ -74,53 +74,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_1">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string>CD</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>τ</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string>CC</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
@ -142,17 +95,17 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="0" column="1" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>124</width>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -186,21 +139,41 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>γ</string>
|
||||
<string><html><head/><body><p>γ<span style=" vertical-align:sub;">CC</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<item row="4" column="2">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="4" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_4">
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_3">
|
||||
<property name="singleStep">
|
||||
<double>0.050000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_1"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
@ -209,24 +182,84 @@
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>β</string>
|
||||
<string><html><head/><body><p>β<span style=" vertical-align:sub;">CD</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_1"/>
|
||||
<item row="4" column="3" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="checkBox_4">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>τ</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_3"/>
|
||||
<item row="2" column="3" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="checkBox_2">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox_4"/>
|
||||
<item row="3" column="3" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="checkBox_3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3" alignment="Qt::AlignHCenter">
|
||||
<widget class="QCheckBox" name="checkBox_1">
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2" alignment="Qt::AlignHCenter|Qt::AlignVCenter">
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string extracomment="Havriliak-Negami Distribution">H-N</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string extracomment="Cole-Cole Distribution">C-C</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string extracomment="Cole-Davidson Distribution">C-D</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
@ -1,65 +1,2 @@
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
import PeakGroupBox
|
||||
from CustomWidgets import LogFSpinBox
|
||||
|
||||
class PeakWidget(QGroupBox):
|
||||
changedTable = pyqtSignal()
|
||||
|
||||
def __init__(self, parent=None):
|
||||
QGroupBox.__init__(self)
|
||||
super(PeakWidget, self).__init__(parent)
|
||||
self.ui = PeakGroupBox.Ui_PeakGroupBox()
|
||||
# replace eps and tau with LogFSpinBox
|
||||
|
||||
self.ui.setupUi(self)
|
||||
self.ui.doubleSpinBox_1.setParent(None)
|
||||
self.ui.doubleSpinBox_1 = LogFSpinBox(self)
|
||||
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_1,1,1)
|
||||
self.ui.doubleSpinBox_2.setParent(None)
|
||||
self.ui.doubleSpinBox_2 = LogFSpinBox(self)
|
||||
self.ui.gridLayout.addWidget(self.ui.doubleSpinBox_2,2,1)
|
||||
|
||||
self.inputs = [
|
||||
self.ui.doubleSpinBox_1,
|
||||
self.ui.doubleSpinBox_2,
|
||||
self.ui.doubleSpinBox_3,
|
||||
self.ui.doubleSpinBox_4
|
||||
]
|
||||
|
||||
for dsb in self.inputs:
|
||||
dsb.valueChanged.connect(self.changeValues)
|
||||
|
||||
self.fixedCheckBoxes = [self.ui.checkBox_1,
|
||||
self.ui.checkBox_2,
|
||||
self.ui.checkBox_3,
|
||||
self.ui.checkBox_4]
|
||||
|
||||
def changeValues(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
def fixedParameter(self):
|
||||
return [0 if cb.isChecked() else 1 for cb in self.fixedCheckBoxes]
|
||||
|
||||
def setId(self, id):
|
||||
self.id = id
|
||||
self.setTitle("Peak %i" % id)
|
||||
|
||||
def setColor(self, color):
|
||||
palette = self.palette()
|
||||
palette.setColor(QPalette.Foreground, color)
|
||||
self.setPalette(palette)
|
||||
|
||||
def peakParameter(self):
|
||||
tmp = [i.value() # selects the number, ignores the status
|
||||
for i in self.inputs]
|
||||
return tmp
|
||||
|
||||
def update(self):
|
||||
self.changedTable.emit()
|
||||
|
||||
def updateTable(self, *args):
|
||||
#print "updateTable", args
|
||||
for i, arg in enumerate(args):
|
||||
self.inputs[i].setValue(args[i])
|
||||
|
||||
|
92
QDS.py
92
QDS.py
@ -9,11 +9,10 @@ from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
import matplotlib
|
||||
|
||||
from mathlib import fit_anneal, fit_lbfgsb, fit_odr, hn, FitFunctionCreator, fit_odr_cmplx
|
||||
from mathlib import fit_anneal, fit_lbfgsb, fit_odr_cmplx
|
||||
|
||||
matplotlib.use('agg')
|
||||
|
||||
#from matplotlibWidget import PlotWidget
|
||||
|
||||
from matplotlib import pyplot
|
||||
from matplotlib.colors import hex2color
|
||||
@ -23,11 +22,13 @@ import numpy as N
|
||||
|
||||
import QDSMain
|
||||
|
||||
from data import Data, Conductivity, conductivity, Peak
|
||||
from data import Data, Conductivity, Peak
|
||||
import pyqtgraph as pg
|
||||
|
||||
#import yaff
|
||||
|
||||
from CustomWidgets import ParameterWidget
|
||||
|
||||
USE_CROSSH=False
|
||||
|
||||
class AppWindow(QMainWindow):
|
||||
@ -45,6 +46,9 @@ class AppWindow(QMainWindow):
|
||||
self.peakId = 0
|
||||
self.peakBoxes = {}
|
||||
|
||||
self.parameterWidget = ParameterWidget()
|
||||
self.ui.dockWidget_3.setWidget(self.parameterWidget)
|
||||
|
||||
## menubar
|
||||
fileMenu = self.menuBar().addMenu("File")
|
||||
openFile = QAction("&Open", self)
|
||||
@ -113,8 +117,8 @@ class AppWindow(QMainWindow):
|
||||
self.ui.graphicsView.setLabel("left", "Dielectric loss", units="Debye")
|
||||
self.ui.graphicsView.disableAutoRange()
|
||||
|
||||
self.peak_box_layout = QGridLayout()
|
||||
self.ui.scrollAreaWidgetContents.setLayout(self.peak_box_layout)
|
||||
#self.peak_box_layout = QGridLayout()
|
||||
#self.ui.scrollAreaWidgetContents.setLayout(self.peak_box_layout)
|
||||
##self.huh = pg.SignalProxy(, slot=self.mPE)
|
||||
sc = self.ui.graphicsView.scene()
|
||||
sc.sigMouseClicked.connect(self.mousePress)
|
||||
@ -210,15 +214,21 @@ class AppWindow(QMainWindow):
|
||||
|
||||
|
||||
def addCond(self, pos):
|
||||
win = self.parameterWidget
|
||||
win.setWindowFlags(win.windowFlags() | Qt.WindowStaysOnTopHint)
|
||||
if self.Conductivity != None:
|
||||
return
|
||||
self.statusBar().showMessage("Click on graph")
|
||||
self.Conductivity = Conductivity(mpl=self.ui.graphicsView, limits=self.data.fit_limits)
|
||||
self.Conductivity.changedData.connect(self.updatePlot)
|
||||
print pos.x(), pos.y(),"test", 10**pos.x(),10**pos.y()
|
||||
self.Conductivity.setParameter(0, 10**(pos.y() + pos.x())*2*N.pi , 1.0)
|
||||
self.ui.scrollAreaWidgetContents.layout().addWidget(self.Conductivity.widget)
|
||||
#print pos.x(), pos.y(),"test", 10**pos.x(),10**pos.y()
|
||||
cond_par = [0, 10**(pos.y() + pos.x())*2*N.pi , 1.0]
|
||||
self.Conductivity.setParameter(beta=cond_par)
|
||||
self.parameterWidget.vlayout.insertWidget(1,self.Conductivity.widget)
|
||||
self.Conductivity.widget.ui.removeButton.clicked.connect(self.delCond)
|
||||
self.parameterWidget.vlayout.update()
|
||||
self.parameterWidget.showNormal()
|
||||
self.parameterWidget.raise_()
|
||||
|
||||
def delCond(self):
|
||||
self.cond_param = None
|
||||
@ -231,34 +241,40 @@ class AppWindow(QMainWindow):
|
||||
|
||||
|
||||
def addPeak(self, pos):
|
||||
self.peakId += 1
|
||||
|
||||
win = self.parameterWidget
|
||||
win.setWindowFlags(win.windowFlags() | Qt.WindowStaysOnTopHint)
|
||||
id_list = [ self.peakBoxes[key] for key in self.peakBoxes.keys()]
|
||||
self.peakId = 1
|
||||
while self.peakId in id_list:
|
||||
self.peakId += 1
|
||||
|
||||
self.statusBar().showMessage("Select Peak Position")
|
||||
|
||||
peak = Peak(id=self.peakId, mpl=self.ui.graphicsView, limits=self.data.fit_limits)
|
||||
# connect to delPeak
|
||||
peak.widget.ui.removeButton.clicked.connect(self.delPeak)
|
||||
#peak.widget.ui.removeButton.clicked.connect(self.delPeak)
|
||||
peak.changedData.connect(self.updatePlot)
|
||||
print pos, 10**pos.x(), 10**pos.y()
|
||||
peak.setParameter(delta_eps=(10**pos.y())*2, tau=1 / (2*N.pi*10**pos.x()), a=1, b=1)
|
||||
# delta_eps=(10**pos.y())*2, tau=1 / (2*N.pi*10**pos.x()), a=1, b=1
|
||||
new_peak = [2*10**pos.y(), 1 / (2*N.pi*10**pos.x()), 1, 1]
|
||||
peak.setParameter(beta = new_peak)
|
||||
|
||||
self.peakBoxes[peak] = self.peakId
|
||||
|
||||
self.peakBoxes[peak] = None
|
||||
wdgt_num = self.peak_box_layout.rowCount()
|
||||
for i,pb in enumerate(self.peakBoxes.keys()):
|
||||
self.peak_box_layout.addWidget(pb.widget, i+wdgt_num, 0)
|
||||
#self.ui.scrollArea.resize()
|
||||
# self.updatePlot()
|
||||
self.parameterWidget.vlayout.insertWidget(1,pb.widget)
|
||||
self.parameterWidget.vlayout.update()
|
||||
self.parameterWidget.showNormal()
|
||||
self.parameterWidget.raise_()
|
||||
|
||||
def delPeak(self):
|
||||
deletePeaks = []
|
||||
for i in xrange(self.peak_box_layout.count()):
|
||||
print i
|
||||
|
||||
for i, peak in enumerate(self.peakBoxes.keys()):
|
||||
if peak.widget.isHidden():
|
||||
self.ui.graphicsView.removeItem(peak.mpl_line)
|
||||
deletePeaks.append(peak)
|
||||
for peak in deletePeaks:
|
||||
self.peakBoxes.pop(peak)
|
||||
self.parameterWidget.vlayout.removeWidget(peak.widget)
|
||||
self.peakBoxes.pop(peak)
|
||||
self.parameterWidget.vlayout.update()
|
||||
self.updatePlot()
|
||||
|
||||
def fitData(self, method):
|
||||
@ -276,31 +292,29 @@ class AppWindow(QMainWindow):
|
||||
|
||||
log10fmin, log10fmax = self.fit_boundary.getRegion()
|
||||
self.data.set_fit_xlimits(10**log10fmin, 10**log10fmax)
|
||||
fit_methods = [fit_odr, fit_lbfgsb, fit_anneal]
|
||||
fit_methods = [fit_odr_cmplx, fit_lbfgsb, fit_anneal]
|
||||
print "StartParameter", start_parameter
|
||||
print "FixedParameter", fixed_params
|
||||
print "Limits (xmin, xmax, ymin, ymax)", self.data.fit_limits
|
||||
_freq, _fit = self.data.get_data()
|
||||
result = fit_methods[method](_freq, _fit.imag, start_parameter, fixed_params)
|
||||
|
||||
# check new method
|
||||
if 1:
|
||||
funcs = ["static","power"] if self.Conductivity != None else []
|
||||
for pb in self.peakBoxes.keys():
|
||||
funcs.append("hn")
|
||||
newres = fit_odr_cmplx(_freq, _fit, start_parameter, fixed_params, funcs)
|
||||
print "Set fit data"
|
||||
self.data.set_fit(newres.beta, funcs)
|
||||
print newres.beta,newres.sd_beta
|
||||
result = newres.beta
|
||||
# build function list
|
||||
funcs = ["static","power"] if self.Conductivity != None else []
|
||||
for pb in self.peakBoxes.keys():
|
||||
funcs.append("hn")
|
||||
newres = fit_methods[method](_freq, _fit, start_parameter, fixed_params, funcs)
|
||||
print "Set fit data"
|
||||
self.data.set_fit(newres.beta, funcs)
|
||||
self.ui.statusbar.showMessage(" ".join(newres.stopreason))
|
||||
result = newres.beta
|
||||
|
||||
self.fitresult = result
|
||||
for i, pb in enumerate(self.peakBoxes.keys()):
|
||||
delta_eps, tau, a, b = result[3 + i*4 : 3 + (i + 1)*4]
|
||||
pb.setParameter(delta_eps, tau, a, b)
|
||||
e_static, sigma, sigma_N = result[:3]
|
||||
beta_peak = newres.beta [3 + i*4 : 3 + (i + 1)*4]
|
||||
sd_beta_peak = newres.sd_beta[3 + i*4 : 3 + (i + 1)*4]
|
||||
pb.setParameter(beta = beta_peak, sd_beta = sd_beta_peak)
|
||||
if self.Conductivity != None:
|
||||
self.Conductivity.setParameter(e_static, sigma, sigma_N)
|
||||
self.Conductivity.setParameter(beta = newres.beta[:3], sd_beta = newres.sd_beta[:3])
|
||||
#print "*** FIT RESULTS ***"
|
||||
#print u"\u03c3"
|
||||
#print u"\u0394\u03b5"
|
||||
|
34
QDSMain.py
34
QDSMain.py
@ -2,7 +2,7 @@
|
||||
|
||||
# Form implementation generated from reading ui file 'QDSMain.ui'
|
||||
#
|
||||
# Created: Tue Mar 18 20:24:14 2014
|
||||
# Created: Wed Mar 19 19:18:39 2014
|
||||
# by: PyQt4 UI code generator 4.10.3
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
@ -39,33 +39,16 @@ class Ui_MainWindow(object):
|
||||
sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
|
||||
self.centralwidget.setSizePolicy(sizePolicy)
|
||||
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
|
||||
self.horizontalLayout = QtGui.QHBoxLayout(self.centralwidget)
|
||||
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
|
||||
self.splitter = QtGui.QSplitter(self.centralwidget)
|
||||
self.splitter.setOrientation(QtCore.Qt.Horizontal)
|
||||
self.splitter.setObjectName(_fromUtf8("splitter"))
|
||||
self.scrollArea = QtGui.QScrollArea(self.splitter)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.scrollArea.sizePolicy().hasHeightForWidth())
|
||||
self.scrollArea.setSizePolicy(sizePolicy)
|
||||
self.scrollArea.setMinimumSize(QtCore.QSize(300, 0))
|
||||
self.scrollArea.setMaximumSize(QtCore.QSize(210, 16777215))
|
||||
self.scrollArea.setWidgetResizable(True)
|
||||
self.scrollArea.setObjectName(_fromUtf8("scrollArea"))
|
||||
self.scrollAreaWidgetContents = QtGui.QWidget()
|
||||
self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 298, 572))
|
||||
self.scrollAreaWidgetContents.setObjectName(_fromUtf8("scrollAreaWidgetContents"))
|
||||
self.scrollArea.setWidget(self.scrollAreaWidgetContents)
|
||||
self.graphicsView = PlotWidget(self.splitter)
|
||||
self.verticalLayout = QtGui.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
|
||||
self.graphicsView = PlotWidget(self.centralwidget)
|
||||
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(3)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.graphicsView.sizePolicy().hasHeightForWidth())
|
||||
self.graphicsView.setSizePolicy(sizePolicy)
|
||||
self.graphicsView.setObjectName(_fromUtf8("graphicsView"))
|
||||
self.horizontalLayout.addWidget(self.splitter)
|
||||
self.verticalLayout.addWidget(self.graphicsView)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtGui.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 956, 22))
|
||||
@ -78,6 +61,13 @@ class Ui_MainWindow(object):
|
||||
self.toolBar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
|
||||
self.toolBar.setObjectName(_fromUtf8("toolBar"))
|
||||
MainWindow.addToolBar(QtCore.Qt.TopToolBarArea, self.toolBar)
|
||||
self.dockWidget_3 = QtGui.QDockWidget(MainWindow)
|
||||
self.dockWidget_3.setFeatures(QtGui.QDockWidget.DockWidgetFloatable|QtGui.QDockWidget.DockWidgetMovable)
|
||||
self.dockWidget_3.setObjectName(_fromUtf8("dockWidget_3"))
|
||||
self.dockWidgetContents_4 = QtGui.QWidget()
|
||||
self.dockWidgetContents_4.setObjectName(_fromUtf8("dockWidgetContents_4"))
|
||||
self.dockWidget_3.setWidget(self.dockWidgetContents_4)
|
||||
MainWindow.addDockWidget(QtCore.Qt.DockWidgetArea(1), self.dockWidget_3)
|
||||
self.actionAdd_Peak = QtGui.QAction(MainWindow)
|
||||
self.actionAdd_Peak.setCheckable(True)
|
||||
icon = QtGui.QIcon()
|
||||
|
61
QDSMain.ui
61
QDSMain.ui
@ -26,53 +26,15 @@
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0">
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<widget class="PlotWidget" name="graphicsView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>300</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>210</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>298</width>
|
||||
<height>572</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="PlotWidget" name="graphicsView">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>3</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@ -105,6 +67,15 @@
|
||||
<addaction name="actionAdd_Cond"/>
|
||||
<addaction name="actionSave_FitResult"/>
|
||||
</widget>
|
||||
<widget class="QDockWidget" name="dockWidget_3">
|
||||
<property name="features">
|
||||
<set>QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable</set>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents_4"/>
|
||||
</widget>
|
||||
<action name="actionAdd_Peak">
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
|
20
data.py
20
data.py
@ -1,8 +1,11 @@
|
||||
from PyQt4.QtCore import QObject, pyqtSignal, Qt
|
||||
from PyQt4.QtGui import QColor
|
||||
import numpy as N
|
||||
from CustomWidgets import PeakWidget, ConductivityWidget
|
||||
import CustomWidgets
|
||||
import PeakWidget
|
||||
import conductivityWidget
|
||||
import ConductivityWidget
|
||||
|
||||
import pyqtgraph as pg
|
||||
from PyQt4.QtCore import *
|
||||
from mathlib import id_to_color, hn, FitFunctionCreator
|
||||
@ -80,7 +83,7 @@ class Conductivity(QObject):
|
||||
def __init__(self, mpl=None, limits=None):
|
||||
QObject.__init__(self)
|
||||
super(Conductivity, self)
|
||||
self.widget = conductivityWidget.ConductivityWidget()
|
||||
self.widget = CustomWidgets.ConductivityWidget()
|
||||
self.widget.changedTable.connect(self.updateData)
|
||||
myPen = pg.mkPen( style=Qt.DashLine, width=1)
|
||||
self.color=QColor("black")
|
||||
@ -105,8 +108,8 @@ class Conductivity(QObject):
|
||||
p = self.widget.fixedParameter()
|
||||
return p
|
||||
|
||||
def setParameter(self, eps_static=None, sigma=None, sigma_N=None):
|
||||
self.widget.updateTable(eps_static, sigma, sigma_N)
|
||||
def setParameter(self, beta, sd_beta=None):
|
||||
self.widget.updateTable(beta, sd_beta)
|
||||
self.updateData()
|
||||
|
||||
def updateData(self):
|
||||
@ -149,9 +152,7 @@ class Peak(QObject):
|
||||
def __init__(self, id=None, mpl=None, limits=None):
|
||||
QObject.__init__(self)
|
||||
super(Peak, self).__init__()
|
||||
|
||||
|
||||
self.widget = PeakWidget.PeakWidget()
|
||||
self.widget = CustomWidgets.PeakWidget()
|
||||
self.widget.setId(id)
|
||||
self.color = id_to_color(id)
|
||||
self.widget.setColor(self.color)
|
||||
@ -173,8 +174,9 @@ class Peak(QObject):
|
||||
p = self.widget.fixedParameter()
|
||||
return p
|
||||
|
||||
def setParameter(self, delta_eps=None, tau=None, a=None, b=None):
|
||||
self.widget.updateTable(delta_eps, tau, a, b)
|
||||
def setParameter(self, beta, sd_beta=None):
|
||||
# delta_eps=None, tau=None, a=None, b=None
|
||||
self.widget.updateTable(beta=beta, sd_beta=sd_beta)
|
||||
self.updatePeak()
|
||||
|
||||
def updatePeak(self):
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
# Resource object code
|
||||
#
|
||||
# Created: Di. Mär. 18 20:24:13 2014
|
||||
# Created: Mi. Mär. 19 19:18:38 2014
|
||||
# by: The Resource Compiler for PyQt (Qt v4.8.5)
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
22
mathlib.py
22
mathlib.py
@ -7,7 +7,8 @@ from PyQt4.QtGui import QColor
|
||||
__author__ = 'markusro'
|
||||
|
||||
|
||||
def fit_anneal(x, y, p0, fixed):
|
||||
def fit_anneal(x, y, p0, fixed, funcs):
|
||||
raise NotImplementedError
|
||||
bounds = [(0, 1e14), (0, 1)]
|
||||
for i in xrange(len(p0[2:]) / 4):
|
||||
bounds.append((1e-4, 1e12)) # delta_eps
|
||||
@ -37,7 +38,8 @@ def fit_anneal(x, y, p0, fixed):
|
||||
return ret[0]
|
||||
|
||||
|
||||
def fit_lbfgsb(x, y, p0, fixed):
|
||||
def fit_lbfgsb(x, y, p0, fixed, funcs):
|
||||
raise NotImplementedError
|
||||
# TODO fixed parameters…
|
||||
bounds = [(0, None), (0, 1)]
|
||||
for i in xrange(len(p0[3:]) / 4):
|
||||
@ -58,12 +60,14 @@ def fit_lbfgsb(x, y, p0, fixed):
|
||||
return x
|
||||
|
||||
|
||||
def fit_odr(x, y, p0, fixed):
|
||||
dat = odr.Data(x, y, 1.0 / y**2)
|
||||
mod = odr.Model(multi_hn)
|
||||
fit = odr.ODR(dat, mod, p0, ifixx=(0,), ifixb=fixed, maxit=2000)
|
||||
fit.run()
|
||||
return fit.output.beta
|
||||
# Replaced with fit_odr_cmplx
|
||||
#
|
||||
#def fit_odr(x, y, p0, fixed, funcs):
|
||||
# dat = odr.Data(x, y, 1.0 / y**2)
|
||||
# mod = odr.Model(multi_hn)
|
||||
# fit = odr.ODR(dat, mod, p0, ifixx=(0,), ifixb=fixed, maxit=2000)
|
||||
# fit.run()
|
||||
# return fit.output.beta
|
||||
|
||||
|
||||
def hn(p, nu):
|
||||
@ -205,7 +209,7 @@ def fit_odr_cmplx(x, y, p0, fixed, fcns):
|
||||
mod = odr.Model(f.fitfcn, extra_args=fcns)
|
||||
fit = odr.ODR(dat, mod, p0, ifixx=(0,), ifixb=fixed, maxit=8000)
|
||||
fit.run()
|
||||
print fit.output.pprint()
|
||||
#print fit.output.pprint()
|
||||
return fit.output
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user