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

WIP: widget to edit Zivy quantification parameters

parent f3837e3c
No related branches found
No related tags found
No related merge requests found
......@@ -193,6 +193,7 @@ SET(XTPCPP_SRCS
./gui/widgets/contaminant_widget/contaminantwidget.cpp
./gui/widgets/massitemdelegate.cpp
./gui/xic_view/xic_box/xicbox.cpp
./gui/xic_view/xic_widgets/zivywidget.cpp
./gui/xic_view/xicwindow.cpp
./gui/xic_view/xicworkerthread.cpp
./gui/workerthread.cpp
......@@ -221,6 +222,7 @@ SET (GUI_UIS
./gui/widgets/automatic_filter_widget/automatic_filter_widget.ui
./gui/widgets/contaminant_widget/contaminant_widget.ui
./gui/xic_view/xic_box/xic_box.ui
./gui/xic_view/xic_widgets/zivy_widget.ui
./gui/xic_view/xic_window.ui
)
......
......@@ -73,10 +73,92 @@
</layout>
</widget>
<resources/>
<connections/>
<connections>
<connection>
<sender>smoothing_spinbox</sender>
<signal>valueChanged(int)</signal>
<receiver>ZivyWidget</receiver>
<slot>doSpinboxChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>339</x>
<y>31</y>
</hint>
<hint type="destinationlabel">
<x>615</x>
<y>47</y>
</hint>
</hints>
</connection>
<connection>
<sender>minmax_spinbox</sender>
<signal>valueChanged(int)</signal>
<receiver>ZivyWidget</receiver>
<slot>doSpinboxChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>311</x>
<y>62</y>
</hint>
<hint type="destinationlabel">
<x>573</x>
<y>109</y>
</hint>
</hints>
</connection>
<connection>
<sender>maxmin_spinbox</sender>
<signal>valueChanged(int)</signal>
<receiver>ZivyWidget</receiver>
<slot>doSpinboxChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>281</x>
<y>94</y>
</hint>
<hint type="destinationlabel">
<x>675</x>
<y>142</y>
</hint>
</hints>
</connection>
<connection>
<sender>minmax_threshold_spinbox</sender>
<signal>valueChanged(int)</signal>
<receiver>ZivyWidget</receiver>
<slot>doSpinboxChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>254</x>
<y>129</y>
</hint>
<hint type="destinationlabel">
<x>683</x>
<y>194</y>
</hint>
</hints>
</connection>
<connection>
<sender>maxmin_threshold_spinbox</sender>
<signal>valueChanged(int)</signal>
<receiver>ZivyWidget</receiver>
<slot>doSpinboxChanged(int)</slot>
<hints>
<hint type="sourcelabel">
<x>215</x>
<y>160</y>
</hint>
<hint type="destinationlabel">
<x>574</x>
<y>220</y>
</hint>
</hints>
</connection>
</connections>
<slots>
<slot>remove()</slot>
<slot>extractXicInOtherMsRun()</slot>
<slot>setRetentionTime(double)</slot>
<slot>doSpinboxChanged(int)</slot>
</slots>
</ui>
/**
* \file src/gui/xic_view/xic_widgets/zivywidget.cpp
* \date 29/5/2018
* \author Olivier Langella
* \brief Widget to edit Zivy quantification method
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#include "zivywidget.h"
#include "ui_zivy_widget.h"
#include <QDebug>
ZivyWidget::ZivyWidget(QWidget *parent):
QWidget(parent),
ui(new Ui::ZivyWidget)
{
ui->setupUi(this);
#if QT_VERSION >= 0x050000
// Qt5 code
#else
// Qt4 code
#endif
}
ZivyWidget::~ZivyWidget()
{
qDebug() << "ZivyWidget::~ZivyWidget";
}
void ZivyWidget::setZivyParams(const ZivyParams & params) {
ui->maxmin_spinbox->setValue(params._maxmin_half_window);
ui->minmax_spinbox->setValue(params._minmax_half_window);
ui->maxmin_threshold_spinbox->setValue(params._maxmin_threshold);
ui->minmax_threshold_spinbox->setValue(params._minmax_threshold);
ui->smoothing_spinbox->setValue(params._smoothing_half_window);
}
const ZivyParams ZivyWidget::getZivyParams() const {
ZivyParams params;
params._maxmin_half_window = ui->maxmin_spinbox->value();
params._minmax_half_window = ui->minmax_spinbox->value();
params._maxmin_threshold = ui->maxmin_threshold_spinbox->value();
params._minmax_threshold = ui->minmax_threshold_spinbox->value();
params._smoothing_half_window = ui->smoothing_spinbox->value();
return params;
}
void ZivyWidget::doSpinboxChanged (int value) {
emit zivyChanged(getZivyParams());
}
/**
* \file src/gui/xic_view/xic_widgets/zivywidget.h
* \date 29/5/2018
* \author Olivier Langella
* \brief Widget to edit Zivy quantification method
*/
/*******************************************************************************
* Copyright (c) 2018 Olivier Langella <olivier.langella@u-psud.fr>.
*
* This file is part of XTPcpp.
*
* XTPcpp is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* XTPcpp is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XTPcpp. If not, see <http://www.gnu.org/licenses/>.
*
* Contributors:
* Olivier Langella <olivier.langella@u-psud.fr> - initial API and implementation
******************************************************************************/
#ifndef ZIVYWIDGET_H
#define ZIVYWIDGET_H
#include <QWidget>
namespace Ui {
class ZivyWidget;
}
struct ZivyParams {
unsigned int _maxmin_half_window = 3;
unsigned int _minmax_half_window = 2;
unsigned int _maxmin_threshold = 3000;
unsigned int _minmax_threshold = 5000;
unsigned int _smoothing_half_window = 1;
};
class ZivyWidget: public QWidget
{
Q_OBJECT
public:
explicit ZivyWidget(QWidget * parent = 0);
~ZivyWidget();
void setZivyParams(const ZivyParams & params);
const ZivyParams getZivyParams() const;
signals :
void zivyChanged(ZivyParams zivy_params);
protected
slots :
void doSpinboxChanged (int value);
private:
Ui::ZivyWidget *ui;
};
#endif // ZIVYWIDGET_H
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