Skip to content
Snippets Groups Projects
Commit 696b3be2 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov Committed by Mikhail Svechnikov
Browse files

IntensityDataFFTPresenter: rm SessionModel

parent 42a46629
No related branches found
No related tags found
1 merge request!1335GUI: preparatory cleaning before fixing masks
...@@ -12,22 +12,17 @@ ...@@ -12,22 +12,17 @@
// //
// ************************************************************************************************ // ************************************************************************************************
#include "GUI/View/Plot2D/IntensityDataFFTPresenter.h"
#include "Device/Data/DataUtils.h" #include "Device/Data/DataUtils.h"
#include "GUI/Model/Data/IntensityDataItem.h" #include "GUI/Model/Data/IntensityDataItem.h"
#include "GUI/Model/Model/SessionModel.h"
#include "GUI/Util/Error.h" #include "GUI/Util/Error.h"
#include "GUI/View/Plot2D/IntensityDataFFTPresenter.h"
#include <QAction>
#include <QApplication>
#include <QWidget>
IntensityDataFFTPresenter::IntensityDataFFTPresenter(QWidget* parent) IntensityDataFFTPresenter::IntensityDataFFTPresenter(QWidget* parent)
: QObject(parent) : QObject(parent)
, m_fftAction(nullptr) , m_fftAction(nullptr)
, m_fftModel(new SessionModel("TempFFTModel", this)) , m_fftItem(std::make_unique<IntensityDataItem>())
, m_in_fft_mode(false) , m_in_fft_mode(false)
{ {
m_fftItem.reset(m_fftModel->insertItem<IntensityDataItem>());
m_fftAction = new QAction(this); m_fftAction = new QAction(this);
m_fftAction->setText("Fourier"); m_fftAction->setText("Fourier");
m_fftAction->setIcon(QIcon(":/images/alpha-f-box.svg")); m_fftAction->setIcon(QIcon(":/images/alpha-f-box.svg"));
...@@ -43,9 +38,7 @@ void IntensityDataFFTPresenter::reset() ...@@ -43,9 +38,7 @@ void IntensityDataFFTPresenter::reset()
IntensityDataItem* IntensityDataFFTPresenter::fftItem(IntensityDataItem* origItem) IntensityDataItem* IntensityDataFFTPresenter::fftItem(IntensityDataItem* origItem)
{ {
if (!origItem) ASSERT(origItem);
throw Error("IntensityDataFFTPresenter::fftItem() -> Error. Empty item.");
QApplication::setOverrideCursor(Qt::WaitCursor); QApplication::setOverrideCursor(Qt::WaitCursor);
m_fftItem->setDatafield(DataUtils::Data::createFFT(*origItem->datafield()).release()); m_fftItem->setDatafield(DataUtils::Data::createFFT(*origItem->datafield()).release());
......
...@@ -15,15 +15,12 @@ ...@@ -15,15 +15,12 @@
#ifndef BORNAGAIN_GUI_VIEW_PLOT2D_INTENSITYDATAFFTPRESENTER_H #ifndef BORNAGAIN_GUI_VIEW_PLOT2D_INTENSITYDATAFFTPRESENTER_H
#define BORNAGAIN_GUI_VIEW_PLOT2D_INTENSITYDATAFFTPRESENTER_H #define BORNAGAIN_GUI_VIEW_PLOT2D_INTENSITYDATAFFTPRESENTER_H
#include <QObject> #include <QAction>
class SessionModel;
class IntensityDataItem; class IntensityDataItem;
class QWidget;
class QAction;
//! Provides support in Fast Fourier transformation of IntensityDataItem. //! Provides support in Fast Fourier transformation of IntensityDataItem.
//! Contains own model to hold IntensityDataItem with fft-transformed results. //! Contains own IntensityDataItem instance with fft-transformed results.
class IntensityDataFFTPresenter : public QObject { class IntensityDataFFTPresenter : public QObject {
Q_OBJECT Q_OBJECT
...@@ -46,7 +43,6 @@ private slots: ...@@ -46,7 +43,6 @@ private slots:
private: private:
QAction* m_fftAction; QAction* m_fftAction;
SessionModel* m_fftModel;
std::unique_ptr<IntensityDataItem> m_fftItem; std::unique_ptr<IntensityDataItem> m_fftItem;
bool m_in_fft_mode; bool m_in_fft_mode;
}; };
......
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