mirror of
https://github.com/Athemis/PyDSF.git
synced 2025-04-20 20:09:13 +00:00
Embedded plots into GUI
This commit is contained in:
parent
926fb01502
commit
cf75c8ee09
7 changed files with 446 additions and 349 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
# Form implementation generated from reading ui file 'mainwindow.ui'
|
||||
#
|
||||
# Created: Fri Jan 30 14:07:06 2015
|
||||
# Created: Fri Jan 30 19:20:59 2015
|
||||
# by: PyQt5 UI code generator 5.4
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
@ -12,7 +12,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||
class Ui_MainWindow(object):
|
||||
def setupUi(self, MainWindow):
|
||||
MainWindow.setObjectName("MainWindow")
|
||||
MainWindow.resize(388, 642)
|
||||
MainWindow.resize(808, 646)
|
||||
MainWindow.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
|
||||
self.centralWidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralWidget.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
|
||||
|
@ -24,11 +24,11 @@ class Ui_MainWindow(object):
|
|||
self.groupBox_experiment.setFlat(False)
|
||||
self.groupBox_experiment.setCheckable(False)
|
||||
self.groupBox_experiment.setObjectName("groupBox_experiment")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.groupBox_experiment)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.formLayout_3 = QtWidgets.QFormLayout(self.groupBox_experiment)
|
||||
self.formLayout_3.setObjectName("formLayout_3")
|
||||
self.label_instrument = QtWidgets.QLabel(self.groupBox_experiment)
|
||||
self.label_instrument.setObjectName("label_instrument")
|
||||
self.gridLayout.addWidget(self.label_instrument, 0, 0, 1, 1)
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label_instrument)
|
||||
self.comboBox_instrument = QtWidgets.QComboBox(self.groupBox_experiment)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
|
@ -37,7 +37,7 @@ class Ui_MainWindow(object):
|
|||
self.comboBox_instrument.setSizePolicy(sizePolicy)
|
||||
self.comboBox_instrument.setObjectName("comboBox_instrument")
|
||||
self.comboBox_instrument.addItem("")
|
||||
self.gridLayout.addWidget(self.comboBox_instrument, 0, 1, 1, 1)
|
||||
self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.comboBox_instrument)
|
||||
self.groupBox_data = QtWidgets.QGroupBox(self.groupBox_experiment)
|
||||
self.groupBox_data.setEnabled(True)
|
||||
self.groupBox_data.setObjectName("groupBox_data")
|
||||
|
@ -72,7 +72,7 @@ class Ui_MainWindow(object):
|
|||
self.listWidget_data.setAlternatingRowColors(True)
|
||||
self.listWidget_data.setObjectName("listWidget_data")
|
||||
self.gridLayout_4.addWidget(self.listWidget_data, 0, 0, 2, 1)
|
||||
self.gridLayout.addWidget(self.groupBox_data, 1, 0, 1, 2)
|
||||
self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.SpanningRole, self.groupBox_data)
|
||||
self.groupBox_temp = QtWidgets.QGroupBox(self.groupBox_experiment)
|
||||
self.groupBox_temp.setEnabled(True)
|
||||
self.groupBox_temp.setAutoFillBackground(False)
|
||||
|
@ -108,7 +108,7 @@ class Ui_MainWindow(object):
|
|||
self.doubleSpinBox_dt.setProperty("value", 1.0)
|
||||
self.doubleSpinBox_dt.setObjectName("doubleSpinBox_dt")
|
||||
self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.doubleSpinBox_dt)
|
||||
self.gridLayout.addWidget(self.groupBox_temp, 2, 0, 1, 1)
|
||||
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.groupBox_temp)
|
||||
self.groupBox_cutoff = QtWidgets.QGroupBox(self.groupBox_experiment)
|
||||
self.groupBox_cutoff.setEnabled(True)
|
||||
self.groupBox_cutoff.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
|
@ -135,7 +135,7 @@ class Ui_MainWindow(object):
|
|||
self.doubleSpinBox_lower.setDecimals(1)
|
||||
self.doubleSpinBox_lower.setObjectName("doubleSpinBox_lower")
|
||||
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.doubleSpinBox_lower)
|
||||
self.gridLayout.addWidget(self.groupBox_cutoff, 2, 1, 1, 1)
|
||||
self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.groupBox_cutoff)
|
||||
self.groupBox_signal_threshold = QtWidgets.QGroupBox(self.groupBox_experiment)
|
||||
self.groupBox_signal_threshold.setEnabled(True)
|
||||
self.groupBox_signal_threshold.setCheckable(True)
|
||||
|
@ -147,7 +147,7 @@ class Ui_MainWindow(object):
|
|||
self.spinBox_signal_threshold.setMaximum(1000000)
|
||||
self.spinBox_signal_threshold.setObjectName("spinBox_signal_threshold")
|
||||
self.verticalLayout.addWidget(self.spinBox_signal_threshold)
|
||||
self.gridLayout.addWidget(self.groupBox_signal_threshold, 3, 0, 1, 1)
|
||||
self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.groupBox_signal_threshold)
|
||||
self.groupBox_cbar = QtWidgets.QGroupBox(self.groupBox_experiment)
|
||||
self.groupBox_cbar.setEnabled(True)
|
||||
self.groupBox_cbar.setCheckable(True)
|
||||
|
@ -170,15 +170,31 @@ class Ui_MainWindow(object):
|
|||
self.doubleSpinBox_cbar_end.setDecimals(1)
|
||||
self.doubleSpinBox_cbar_end.setObjectName("doubleSpinBox_cbar_end")
|
||||
self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.doubleSpinBox_cbar_end)
|
||||
self.gridLayout.addWidget(self.groupBox_cbar, 3, 1, 1, 1)
|
||||
self.gridLayout_2.addWidget(self.groupBox_experiment, 0, 0, 1, 1)
|
||||
self.buttonBox_process = QtWidgets.QDialogButtonBox(self.centralWidget)
|
||||
self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.groupBox_cbar)
|
||||
self.buttonBox_process = QtWidgets.QDialogButtonBox(self.groupBox_experiment)
|
||||
self.buttonBox_process.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
|
||||
self.buttonBox_process.setObjectName("buttonBox_process")
|
||||
self.gridLayout_2.addWidget(self.buttonBox_process, 1, 0, 1, 1)
|
||||
self.formLayout_3.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.buttonBox_process)
|
||||
self.gridLayout_2.addWidget(self.groupBox_experiment, 0, 0, 1, 1)
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.centralWidget)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab_raw = MplWidget()
|
||||
self.tab_raw.setObjectName("tab_raw")
|
||||
self.tabWidget.addTab(self.tab_raw, "")
|
||||
self.tab_derivative = MplWidget()
|
||||
self.tab_derivative.setObjectName("tab_derivative")
|
||||
self.tabWidget.addTab(self.tab_derivative, "")
|
||||
self.tab_heatmap = MplWidget()
|
||||
self.tab_heatmap.setObjectName("tab_heatmap")
|
||||
self.tabWidget.addTab(self.tab_heatmap, "")
|
||||
self.tab_heatmap_avg = MplWidget()
|
||||
self.tab_heatmap_avg.setEnabled(False)
|
||||
self.tab_heatmap_avg.setObjectName("tab_heatmap_avg")
|
||||
self.tabWidget.addTab(self.tab_heatmap_avg, "")
|
||||
self.gridLayout_2.addWidget(self.tabWidget, 0, 1, 1, 1)
|
||||
MainWindow.setCentralWidget(self.centralWidget)
|
||||
self.menuBar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menuBar.setGeometry(QtCore.QRect(0, 0, 388, 29))
|
||||
self.menuBar.setGeometry(QtCore.QRect(0, 0, 808, 29))
|
||||
self.menuBar.setLocale(QtCore.QLocale(QtCore.QLocale.English, QtCore.QLocale.UnitedStates))
|
||||
self.menuBar.setObjectName("menuBar")
|
||||
self.menuFile = QtWidgets.QMenu(self.menuBar)
|
||||
|
@ -215,6 +231,7 @@ class Ui_MainWindow(object):
|
|||
self.label_cbar_end.setBuddy(self.doubleSpinBox_cbar_end)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(3)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
|
@ -236,7 +253,7 @@ class Ui_MainWindow(object):
|
|||
self.label_dt.setText(_translate("MainWindow", "<html><head/><body><p>ΔT</p></body></html>"))
|
||||
self.doubleSpinBox_dt.setSuffix(_translate("MainWindow", " °C"))
|
||||
self.groupBox_cutoff.setToolTip(_translate("MainWindow", "<html><head/><body><p>Only T<span style=\" vertical-align:sub;\">m</span> values within this limit are considered valid.</p></body></html>"))
|
||||
self.groupBox_cutoff.setTitle(_translate("MainWindow", "Cutoff"))
|
||||
self.groupBox_cutoff.setTitle(_translate("MainWindow", "&Cutoff"))
|
||||
self.label_cutoff_high.setText(_translate("MainWindow", "&Upper"))
|
||||
self.doubleSpinBox_upper.setSuffix(_translate("MainWindow", " °C"))
|
||||
self.label_cutoff_low.setText(_translate("MainWindow", "Lower"))
|
||||
|
@ -249,8 +266,14 @@ class Ui_MainWindow(object):
|
|||
self.doubleSpinBox_cbar_start.setSuffix(_translate("MainWindow", " °C"))
|
||||
self.label_cbar_end.setText(_translate("MainWindow", "En&d"))
|
||||
self.doubleSpinBox_cbar_end.setSuffix(_translate("MainWindow", " °C"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_raw), _translate("MainWindow", "Raw Data"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_derivative), _translate("MainWindow", "&1st derivative"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_heatmap), _translate("MainWindow", "Heatmap"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_heatmap_avg), _translate("MainWindow", "Heatmap average"))
|
||||
self.menuFile.setTitle(_translate("MainWindow", "Fi&le"))
|
||||
self.menuHelp.setTitle(_translate("MainWindow", "Help"))
|
||||
self.menuHelp.setTitle(_translate("MainWindow", "Hel&p"))
|
||||
self.actionQuit.setText(_translate("MainWindow", "&Quit"))
|
||||
self.actionAbout.setText(_translate("MainWindow", "&About"))
|
||||
self.actionAbout_Qt.setText(_translate("MainWindow", "About &Qt"))
|
||||
|
||||
from .mplwidget import MplWidget
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>qtlogo.svg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/"/>
|
||||
</RCC>
|
||||
|
|
|
@ -17,6 +17,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
"""
|
||||
Class documentation goes here.
|
||||
"""
|
||||
|
||||
def __init__(self, parent=None):
|
||||
"""
|
||||
Constructor
|
||||
|
@ -33,6 +34,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.statusBar.showMessage("Welcome to PyDSF")
|
||||
|
||||
|
||||
|
||||
@pyqtSlot("QAbstractButton*")
|
||||
def on_buttonBox_open_reset_clicked(self, button):
|
||||
"""
|
||||
|
@ -47,8 +49,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
elif button == self.buttonBox_open_reset.button(QDialogButtonBox.Reset):
|
||||
self.listWidget_data.clear()
|
||||
print("Data cleared")
|
||||
# self.radioButton_rep_rows.setEnabled(False)
|
||||
# self.radioButton_rep_columns.setEnabled(False)
|
||||
# self.radioButton_rep_rows.setEnabled(False)
|
||||
# self.radioButton_rep_columns.setEnabled(False)
|
||||
|
||||
|
||||
@pyqtSlot("QString")
|
||||
|
@ -61,10 +63,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
self.groupBox_temp.setEnabled(True)
|
||||
else:
|
||||
self.groupBox_temp.setEnabled(False)
|
||||
# self.groupBox_data.setEnabled(True)
|
||||
# self.groupBox_cutoff.setEnabled(True)
|
||||
# self.groupBox_cbar.setEnabled(True)
|
||||
# self.groupBox_signal_threshold.setEnabled(True)
|
||||
# self.groupBox_data.setEnabled(True)
|
||||
# self.groupBox_cutoff.setEnabled(True)
|
||||
# self.groupBox_cbar.setEnabled(True)
|
||||
# self.groupBox_signal_threshold.setEnabled(True)
|
||||
|
||||
@pyqtSlot()
|
||||
def on_buttonBox_process_accepted(self):
|
||||
|
@ -76,7 +78,8 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
QMessageBox.critical(self, 'Error', "No data file loaded!", QMessageBox.Close, QMessageBox.Close)
|
||||
return
|
||||
if self.spinBox_signal_threshold.value() == 0 and self.groupBox_signal_threshold.isChecked():
|
||||
QMessageBox.warning(self, 'Warning', "Signal threshold is currently set to zero.", QMessageBox.Ok, QMessageBox.Ok)
|
||||
QMessageBox.warning(self, 'Warning', "Signal threshold is currently set to zero.", QMessageBox.Ok,
|
||||
QMessageBox.Ok)
|
||||
|
||||
self.progressBar.setEnabled(True)
|
||||
self.statusBar.showMessage("Processing...")
|
||||
|
@ -90,7 +93,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
c_lower = self.doubleSpinBox_lower.value()
|
||||
c_upper = self.doubleSpinBox_upper.value()
|
||||
if self.groupBox_cbar.isChecked():
|
||||
cbar_range = (self.doubleSpinBox_cbar_start, self.doubleSpinBox_cbar_end)
|
||||
cbar_range = (self.doubleSpinBox_cbar_start, self.doubleSpinBox_cbar_end)
|
||||
if self.groupBox_signal_threshold.isChecked():
|
||||
signal_threshold = self.spinBox_signal_threshold.value()
|
||||
|
||||
|
@ -99,29 +102,53 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
files = []
|
||||
for item in items:
|
||||
files.append(item.text())
|
||||
exp = Experiment(type=type, files=files, t1=self.doubleSpinBox_tmin.value(), t2=self.doubleSpinBox_tmax.value(), dt=self.doubleSpinBox_dt.value(), cols=12, rows=8, cutoff_low=c_lower, cutoff_high=c_upper, signal_threshold=signal_threshold, color_range=cbar_range)
|
||||
exp = Experiment(type=type, files=files, t1=self.doubleSpinBox_tmin.value(), t2=self.doubleSpinBox_tmax.value(),
|
||||
dt=self.doubleSpinBox_dt.value(), cols=12, rows=8, cutoff_low=c_lower, cutoff_high=c_upper,
|
||||
signal_threshold=signal_threshold, color_range=cbar_range)
|
||||
exp.analyze()
|
||||
|
||||
# plate = Plate(type=type, filename=self.lineEdit_data_file.text(), t1=self.doubleSpinBox_tmin.value(), t2=self.doubleSpinBox_tmax.value(), dt=self.doubleSpinBox_dt.value(), cols=12, rows=8, cutoff_low=c_lower, cutoff_high=c_upper, signal_threshold=signal_threshold, color_range=cbar_range)
|
||||
# self.statusBar.addWidget(self.pb, 100)
|
||||
#plate.analyze(gui=self)
|
||||
# plate.analyze(gui=self)
|
||||
save_data = QMessageBox.question(self, 'Save data', "Calculations are finished. Save results?",
|
||||
QMessageBox.Yes|QMessageBox.No, QMessageBox.Yes)
|
||||
QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes)
|
||||
if save_data == QMessageBox.Yes:
|
||||
dialog = QFileDialog()
|
||||
dialog.setFileMode(QFileDialog.Directory)
|
||||
folder = dialog.getExistingDirectory(self, 'Choose path for results')
|
||||
for plate in exp.plates:
|
||||
plate.write_tm_table('{}/plate_{}_04_tm.csv'.format(folder, str(plate.id)))
|
||||
plate.write_derivative_table('{}/plate_{}_03_dI_dT.csv'.format(folder, str(plate.id)))
|
||||
plate.write_filtered_table('{}/plate_{}_02_filtered_data.csv'.format(folder, str(plate.id)))
|
||||
plate.write_raw_table('{}/plate_{}_01_raw_data.csv'.format(folder, str(plate.id)))
|
||||
plate.write_tm_table('{}/plate_{}_04_tm.csv'.format(folder, str(plate.id)))
|
||||
plate.write_derivative_table('{}/plate_{}_03_dI_dT.csv'.format(folder, str(plate.id)))
|
||||
plate.write_filtered_table('{}/plate_{}_02_filtered_data.csv'.format(folder, str(plate.id)))
|
||||
plate.write_raw_table('{}/plate_{}_01_raw_data.csv'.format(folder, str(plate.id)))
|
||||
|
||||
if exp.avg_plate:
|
||||
exp.avg_plate.write_avg_tm_table('{}/plate_{}_05_tm_avg.csv'.format(folder, str(exp.avg_plate.id)))
|
||||
#plot(plate, self)
|
||||
exp.avg_plate.write_avg_tm_table('{}/plate_{}_05_tm_avg.csv'.format(folder, str(exp.avg_plate.id)))
|
||||
#plot(plate, self)
|
||||
|
||||
plot(exp)
|
||||
plotter = PlotResults(exp)
|
||||
for i in range(self.tabWidget.count()):
|
||||
for plate in exp.plates:
|
||||
if i == 0:
|
||||
plotter.plot_raw(plate, self.tabWidget.widget(i))
|
||||
elif i == 1:
|
||||
plotter.plot_derivative(plate, self.tabWidget.widget(i))
|
||||
elif i == 2:
|
||||
plotter.plot_tm_heatmap_single(plate, self.tabWidget.widget(i))
|
||||
elif exp.avg_plate and i == 3:
|
||||
plotter.plot_tm_heatmap_single(exp.avg_plate, self.tabWidget.widget(i))
|
||||
self.tabWidget.setTabEnabled(i, True)
|
||||
else:
|
||||
self.tabWidget.setTabEnabled(i, False)
|
||||
|
||||
#for i in range(self.tabWidget.count()):
|
||||
# self.tabWidget.widget(i).canvas.clear()
|
||||
|
||||
#fig, ax = figures[0]
|
||||
#self.tabWidget.widget(0).canvas.fig = fig
|
||||
#self.tabWidget.widget(0).canvas.ax = ax
|
||||
|
||||
#self.tabWidget.widget(0).canvas.draw()
|
||||
|
||||
self.progressBar.setEnabled(False)
|
||||
self.statusBar.showMessage("Finished!")
|
||||
|
@ -135,6 +162,7 @@ class MainWindow(QMainWindow, Ui_MainWindow):
|
|||
QApplication.quit()
|
||||
|
||||
pyqtSlot()
|
||||
|
||||
def on_actionQuit_triggered(self):
|
||||
"""
|
||||
Slot documentation goes here.
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>388</width>
|
||||
<height>642</height>
|
||||
<width>808</width>
|
||||
<height>646</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -35,7 +35,7 @@
|
|||
<property name="checkable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QFormLayout" name="formLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_instrument">
|
||||
<property name="text">
|
||||
|
@ -247,7 +247,7 @@
|
|||
<string><html><head/><body><p>Only T<span style=" vertical-align:sub;">m</span> values within this limit are considered valid.</p></body></html></string>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Cutoff</string>
|
||||
<string>&Cutoff</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
|
@ -406,14 +406,44 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QDialogButtonBox" name="buttonBox_process">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox_process">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<item row="0" column="1">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="MplWidget" name="tab_raw">
|
||||
<attribute name="title">
|
||||
<string>Raw Data</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="MplWidget" name="tab_derivative">
|
||||
<attribute name="title">
|
||||
<string>&1st derivative</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="MplWidget" name="tab_heatmap">
|
||||
<attribute name="title">
|
||||
<string>Heatmap</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="MplWidget" name="tab_heatmap_avg">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Heatmap average</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
|
@ -423,7 +453,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>388</width>
|
||||
<width>808</width>
|
||||
<height>29</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -444,7 +474,7 @@
|
|||
<locale language="English" country="UnitedStates"/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Help</string>
|
||||
<string>Hel&p</string>
|
||||
</property>
|
||||
<addaction name="actionAbout"/>
|
||||
<addaction name="actionAbout_Qt"/>
|
||||
|
@ -465,7 +495,7 @@
|
|||
</action>
|
||||
<action name="actionAbout_Qt">
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset>
|
||||
<normaloff>:/qtlogo.svg</normaloff>:/qtlogo.svg</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
|
@ -473,6 +503,14 @@
|
|||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>MplWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>mplwidget</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
</resources>
|
||||
|
|
25
ui/mplwidget.py
Normal file
25
ui/mplwidget.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
from PyQt5 import QtWidgets
|
||||
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
|
||||
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QTAgg as NavigationToolbar
|
||||
from matplotlib.figure import Figure
|
||||
|
||||
class MplCanvas(FigureCanvas):
|
||||
def __init__(self):
|
||||
self.fig = Figure()
|
||||
self.ax = self.fig.add_subplot(111)
|
||||
FigureCanvas.__init__(self, self.fig)
|
||||
FigureCanvas.setSizePolicy(self, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
||||
FigureCanvas.updateGeometry(self)
|
||||
|
||||
def clear(self):
|
||||
self.ax.clear()
|
||||
self.fig.clear()
|
||||
|
||||
class MplWidget(QtWidgets.QWidget):
|
||||
def __init__(self, parent = None):
|
||||
QtWidgets.QWidget.__init__(self, parent)
|
||||
|
||||
self.canvas = MplCanvas()
|
||||
self.vbl = QtWidgets.QVBoxLayout()
|
||||
self.vbl.addWidget(self.canvas)
|
||||
self.setLayout(self.vbl)
|
Loading…
Add table
Add a link
Reference in a new issue