Skip to content
Snippets Groups Projects
Commit fc685daa authored by Olivier Langella's avatar Olivier Langella
Browse files

spectrum zoomer and mz position enabled

parent 8ac534fc
No related branches found
No related tags found
No related merge requests found
......@@ -90,6 +90,7 @@ SET(XTPCPP_SRCS
./gui/load_results_dialog/loadresultsdialog.cpp
./gui/mainwindow.cpp
./gui/peptide_detail_view/peptidewindow.cpp
./gui/peptide_detail_view/spectrum_widget/overlaywidget.cpp
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.cpp
./gui/peptide_list_view/peptidelistwindow.cpp
./gui/peptide_list_view/peptidetablemodel.cpp
......@@ -122,6 +123,7 @@ SET(XTPCPP_MOC_HDRS
./gui/load_results_dialog/loadresultsdialog.h
./gui/mainwindow.h
./gui/peptide_detail_view/peptidewindow.h
./gui/peptide_detail_view/spectrum_widget/overlaywidget.h
./gui/peptide_detail_view/spectrum_widget/qspectrumwidget.h
./gui/peptide_list_view/peptidelistwindow.h
./gui/peptide_list_view/peptidetablemodel.h
......
......@@ -53,6 +53,8 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
qDebug() << "PeptideWindow::PeptideWindow begin";
_p_project_window = parent;
ui->setupUi(this);
_p_spectrum_overlay = new LoadingOverlay(ui->spectrumWidget);
/*
*/
SpectrumSpLoaderThread * worker = new SpectrumSpLoaderThread;
......@@ -86,7 +88,7 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
connect (this, SIGNAL(loadSpectrumSp(PeptideMatch *)), worker,SLOT(doLoadSpectrumSp(PeptideMatch *)));
connect (worker, SIGNAL(spectrumSpReady(pappso::SpectrumSp, QString)), this,SLOT(doSpectrumSpReady(pappso::SpectrumSp, QString)));
connect (_p_spectrum_overlay,SIGNAL(mzChanged(double)), this, SLOT(setMz(double)));
//connect(_protein_table_model_p, SIGNAL(layoutChanged()), this, SLOT(updateStatusBar()));
#endif
......@@ -95,10 +97,14 @@ PeptideWindow::PeptideWindow(ProjectWindow *parent):
PeptideWindow::~PeptideWindow()
{
delete _p_spectrum_overlay;
delete ui;
}
void PeptideWindow::setMz(double mz) {
}
void PeptideWindow::doIdentificationGroupGrouped(IdentificationGroup * p_identification_group) {
updateDisplay();
}
......@@ -130,8 +136,8 @@ void PeptideWindow::chooseDefaultMzDataDir() {
QString default_location = settings.value("path/mzdatadir", "").toString();
QString filename = QFileDialog::getExistingDirectory(this,
tr("Choose default mz data directory"), default_location,
QFileDialog::ShowDirsOnly);
tr("Choose default mz data directory"), default_location,
QFileDialog::ShowDirsOnly);
if (filename.isEmpty()) {
return;
......@@ -139,16 +145,24 @@ void PeptideWindow::chooseDefaultMzDataDir() {
QString path = QFileInfo(filename).absoluteFilePath();
settings.setValue("path/mzdatadir", path);
ui->mz_data_dir_label->setText(path);
qDebug() << "PeptideWindow::chooseDefaultMzDataDir begin";
_p_spectrum_overlay->displayLoadingMessage();
ui->file_not_found->setVisible(false);
ui->spectrumWidget->setVisible(true);
emit loadSpectrumSp(_p_peptide_match);
ui->statusbar->showMessage(tr("loading spectrum"));
}
void PeptideWindow::doSpectrumSpReady(SpectrumSp spectrum_sp, QString error) {
qDebug() << "PeptideWindow::doSpectrumSpReady begin";
_p_spectrum_overlay->hideLoadingMessage();
if (!error.isEmpty()) {
//not found
ui->statusbar->showMessage(tr("spectrum not found"));
QSettings settings;
QString path = settings.value("path/mzdatadir", "").toString();
......@@ -178,6 +192,10 @@ void PeptideWindow::setPeptideMatch(PeptideMatch * p_peptide_match) {
qDebug() << "PeptideWindow::setPeptideMatch emit loadSpectrumSp(_p_peptide_match)";
emit loadSpectrumSp(_p_peptide_match);
_p_spectrum_overlay->displayLoadingMessage();
ui->file_not_found->setVisible(false);
ui->spectrumWidget->setVisible(true);
ui->statusbar->showMessage(tr("loading spectrum"));
pappso::PeptideSp peptide = _p_peptide_match->getPeptideXtpSp();
......
......@@ -30,6 +30,7 @@
#include <pappsomspp/spectrum/spectrum.h>
#include "../../core/peptidematch.h"
#include "../../core/identificationgroup.h"
#include "spectrum_widget/overlaywidget.h"
class ProjectWindow;
......@@ -68,6 +69,7 @@ public:
public slots:
void doIdentificationGroupGrouped(IdentificationGroup * p_identification_group);
void setMz(double);
signals:
void loadSpectrumSp(PeptideMatch * p_peptide_match);
......@@ -86,6 +88,8 @@ private:
ProjectWindow * _p_project_window;
PeptideMatch * _p_peptide_match = nullptr;
pappso::PrecisionP _p_precision;
LoadingOverlay * _p_spectrum_overlay;
};
......
......@@ -45,8 +45,13 @@ void LoadingOverlay::paintEvent(QPaintEvent *) {
painter.begin(this);
painter.setRenderHint(QPainter::Antialiasing);
paintLoadingMessage(painter);
paintUserSelectedZone(painter);
qDebug() << "LoadingOverlay::paintEvent _is_loading="<< _is_loading;
if (_is_loading) {
paintLoadingMessage(painter);
}
else {
paintUserSelectedZone(painter);
}
painter.end();
}
void LoadingOverlay::mousePressEvent(QMouseEvent * event) {
......@@ -80,7 +85,7 @@ void LoadingOverlay::mouseReleaseEvent(QMouseEvent * event) {
pappso_double max_intensity = _p_spectrum_widget->getSpectrumPainter().getIntensityFromLocalPosY(_second_point.second);
_p_spectrum_widget->getSpectrumPainter().setMinMz(min);
_p_spectrum_widget->getSpectrumPainter().setMaxMz(max);
_p_spectrum_widget->getSpectrumPainter().setMaxIntensity(max_intensity);
_p_spectrum_widget->getSpectrumPainter().setMaxIntensity(max_intensity);
}
else {
_p_spectrum_widget->getSpectrumPainter().setMaxMz(0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment