Commit 7961e187 authored by Edlira Nano's avatar Edlira Nano
Browse files

defined default mz and ppm ranges : closes task 3268

git-svn-id: https://subversion.renater.fr/masschroq/trunk@2254 e4b6dbb4-9209-464b-83f7-6257456c460c
parent c20701df
......@@ -208,7 +208,6 @@ MainWindow::filterBackgroundXic(FilterBackgroundWidget * fback_widget) {
// _masschroq_gui->applyFilterToXicProfile(_current_xic_profile, f_back);
}
void
MainWindow::filterSpikeWidget() {
}
......
......@@ -11,7 +11,15 @@
#include "../lib/xicExtractionMethods/xicExtractionMethodMzRange.h"
#include "../lib/xicExtractionMethods/xicExtractionMethodPpmRange.h"
XicSelectionWidget::XicSelectionWidget(QWidget * parent) : QWidget(parent) {
XicSelectionWidget::XicSelectionWidget(QWidget * parent)
:
QWidget(parent),
MIN_MZ_RANGE(0.3),
MAX_MZ_RANGE(0.3),
MIN_PPM_RANGE(10),
MAX_PPM_RANGE(10)
{
_xic_extraction_method = 0;
create_xic_type_group();
......@@ -29,9 +37,9 @@ XicSelectionWidget::XicSelectionWidget(QWidget * parent) : QWidget(parent) {
connect(_button_box, SIGNAL(rejected()), this, SLOT(cancel()));
QVBoxLayout * mainLayout = new QVBoxLayout;
mainLayout->addWidget(_mz_group);
mainLayout->addWidget(_xic_type_group);
mainLayout->addWidget(_xic_range_group);
mainLayout->addWidget(_mz_group);
mainLayout->addWidget(_button_box);
setLayout(mainLayout);
setWindowTitle(tr("XIC extraction"));
......@@ -61,7 +69,7 @@ XicSelectionWidget::create_xic_type_group() {
_xic_type_group->setLayout(layout);
connect(xic_type_buttons, SIGNAL(buttonClicked(QAbstractButton * )),
connect(xic_type_buttons, SIGNAL(buttonClicked(QAbstractButton *)),
this, SLOT(setXicType(QAbstractButton *)));
}
......@@ -81,37 +89,39 @@ XicSelectionWidget::create_xic_range_group() {
xic_range_buttons->addButton(ppm_range);
xic_range_buttons->addButton(mz_range);
connect(xic_range_buttons, SIGNAL(buttonClicked(QAbstractButton * )),
this, SLOT(setXicExtractionMethod(QAbstractButton *)));
layout->addWidget(ppm_range, 0, 0);
layout->addWidget(mz_range, 0, 1);
QLabel * min_label = new QLabel("minimum range");
QDoubleSpinBox * min_box = new QDoubleSpinBox;
min_box->setMaximum(30.00);
min_box->setWrapping(true);
min_box->setSingleStep(0.1);
_min_range_box = new QDoubleSpinBox;
_min_range_box->setMaximum(5000.00);
_min_range_box->setWrapping(true);
_min_range_box->setSingleStep(1.0);
_min_range_box->setValue(MIN_PPM_RANGE);
setMinRange(MIN_PPM_RANGE);
layout->addWidget(min_label, 1, 0);
layout->addWidget(min_box, 1, 1);
setMinRange(0);
layout->addWidget(_min_range_box, 1, 1);
QLabel * max_label = new QLabel("maximum range");
QDoubleSpinBox * max_box = new QDoubleSpinBox;
max_box->setMaximum(30.00);
max_box->setWrapping(true);
max_box->setSingleStep(0.1);
_max_range_box = new QDoubleSpinBox;
_max_range_box->setMaximum(5000.00);
_max_range_box->setWrapping(true);
_max_range_box->setSingleStep(1.0);
_max_range_box->setValue(MAX_PPM_RANGE);
setMaxRange(MAX_PPM_RANGE);
layout->addWidget(max_label, 2, 0);
layout->addWidget(max_box, 2, 1);
setMaxRange(0);
layout->addWidget(_max_range_box, 2, 1);
_xic_range_group->setLayout(layout);
connect(_min_range_box, SIGNAL(valueChanged(double)), this, SLOT(setMinRange(double)));
connect(xic_range_buttons, SIGNAL(buttonClicked(QAbstractButton * )),
this, SLOT(setXicExtractionMethod(QAbstractButton *)));
connect(min_box, SIGNAL(valueChanged(double)), this, SLOT(setMinRange(double)));
connect(max_box, SIGNAL(valueChanged(double)), this, SLOT(setMaxRange(double)));
connect(_max_range_box, SIGNAL(valueChanged(double)), this, SLOT(setMaxRange(double)));
}
......@@ -186,8 +196,12 @@ XicSelectionWidget::setXicExtractionMethod(QAbstractButton * button) {
XicExtractionMethodBase * extraction_method;
if (button_text == "ppm range") {
extraction_method = new XicExtractionMethodPpmRange();
_min_range_box->setValue(MIN_PPM_RANGE);
_max_range_box->setValue(MAX_PPM_RANGE);
} else if (button_text == "mz range") {
extraction_method = new XicExtractionMethodMzRange();
_min_range_box->setValue(MIN_MZ_RANGE);
_max_range_box->setValue(MAX_MZ_RANGE);
} else {
throw mcqError(QObject::tr("XicSelectionWidget::setXicExtractionMethod(QAbstractButton *) : Invalid range extraction type"));
}
......
......@@ -34,6 +34,7 @@ class QButtonGroup;
class QGroupBox;
class QDialogButtonBox;
class QAbstractButton;
class QDoubleSpinBox;
class XicExtractionMethodBase;
/**
......@@ -85,9 +86,6 @@ class XicSelectionWidget : public QWidget {
mcq_double _mz_to_extract;
mcq_double _rt_to_extract;
void setXicType(const mcq_xic_type & type);
void setXicExtractionMethod(XicExtractionMethodBase * extraction_method);
private :
void create_xic_type_group();
......@@ -98,7 +96,17 @@ class XicSelectionWidget : public QWidget {
QGroupBox * _xic_range_group;
QGroupBox * _mz_group;
QDialogButtonBox * _button_box;
QDoubleSpinBox * _min_range_box;
QDoubleSpinBox * _max_range_box;
const mcq_double MIN_MZ_RANGE;
const mcq_double MAX_MZ_RANGE;
const mcq_double MIN_PPM_RANGE;
const mcq_double MAX_PPM_RANGE;
void setXicType(const mcq_xic_type & type);
void setXicExtractionMethod(XicExtractionMethodBase * extraction_method);
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment