102 lines
2.9 KiB
C++
102 lines
2.9 KiB
C++
/*
|
|
QAD - Qt ADvanced
|
|
|
|
Ivan Pelipenko peri4ko@yandex.ru
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program 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 Lesser General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
#ifndef graphic_analysis_h
|
|
#define graphic_analysis_h
|
|
|
|
#include "qad_graphic_analysis_export.h"
|
|
|
|
#include <graphic_ranges.h>
|
|
#include <pibase_macros.h>
|
|
|
|
namespace Ui {
|
|
class GraphicAnalysis;
|
|
}
|
|
class GraphicAnalysisPlugin;
|
|
|
|
class QAD_GRAPHIC_ANALYSIS_EXPORT GraphicAnalysis: public GraphicRanges {
|
|
Q_OBJECT
|
|
friend class GraphicAnalysisPlugin;
|
|
Q_PROPERTY(bool toolboxVisible READ isToolboxVisible WRITE setToolboxVisible)
|
|
|
|
public:
|
|
GraphicAnalysis(QWidget * parent = 0);
|
|
virtual ~GraphicAnalysis();
|
|
|
|
void setGraphicData(const QPolygonF & g, int graphic, bool update_ = true);
|
|
|
|
bool isSpectrumFixedDuration() const;
|
|
void setIsSpectrumFixedDuration(bool on);
|
|
double spectrumFixedDuration() const;
|
|
void setSpectrumFixedDuration(double val);
|
|
|
|
bool isToolboxVisible() const;
|
|
void setToolboxVisible(bool yes);
|
|
void setLabelX(const QString & str);
|
|
QBoxLayout * toolboxLayout();
|
|
QWidget * toolboxWidget();
|
|
bool isShowSpectrum() const;
|
|
|
|
void setGraphicsCount(int cnt, bool update = true);
|
|
void addPoint(const QPointF & p, int graphic, bool update_ = true);
|
|
|
|
void setGraphicTransformFunction(std::function<QPolygonF(const QPolygonF &)> f);
|
|
void setSpectrumTransformFunction(std::function<QPolygonF(const QPolygonF &)> f);
|
|
|
|
protected:
|
|
void changeEvent(QEvent * e);
|
|
|
|
void updateGraphic(int index);
|
|
void updateAllGraphic();
|
|
void setFFTInternal(bool on);
|
|
void setFFT(bool on);
|
|
QPolygonF calcToFFT(const QPointF * in, int count);
|
|
void checkRangeRequest();
|
|
|
|
Ui::GraphicAnalysis * ui = nullptr;
|
|
QWidget * widget_toolbox = nullptr;
|
|
QMap<int, QPolygonF> src_data;
|
|
GraphicRanges::Range range_fft;
|
|
std::function<QPolygonF(const QPolygonF &)> tf_gr, tf_fft;
|
|
QString data_label_x;
|
|
QRectF saved_view;
|
|
bool saved_autofit = true, show_fft = false;
|
|
|
|
PRIVATE_DECLARATION(QAD_GRAPHIC_ANALYSIS_EXPORT)
|
|
|
|
public slots:
|
|
void clear();
|
|
|
|
private slots:
|
|
void gaMousePressEvent(QPointF point, int buttons);
|
|
void gaMouseMoveEvent(QPointF point, int buttons);
|
|
void gaMouseReleaseEvent(QPointF point, int buttons);
|
|
void gaRangeSelected(double start, double end);
|
|
void checkSpectrum_toggled(bool on);
|
|
void buttonSpectrumRange_toggled(bool on);
|
|
void checkSpectrumFixDuration_toggled(bool on);
|
|
|
|
signals:
|
|
void showSpectrumChanged(bool);
|
|
void configChanged();
|
|
};
|
|
|
|
|
|
#endif
|