85 lines
2.3 KiB
C++
85 lines
2.3 KiB
C++
#ifndef CENTRALWIDGET_H
|
|
#define CENTRALWIDGET_H
|
|
|
|
#include <QWidget>
|
|
#include <QMenu>
|
|
|
|
#include "qcustomplot.h"
|
|
#include "protocol.h"
|
|
#include "global.h"
|
|
#include "eventhandler.h"
|
|
#include "filemanager.h"
|
|
#include "pointcalculate.h"
|
|
|
|
class CentralWidget:public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum AnalysisMode{
|
|
None,
|
|
NumericalLabel,
|
|
StartPoint,
|
|
StopPoint,
|
|
PeakSynthesisAnalysis,
|
|
GlassTransition
|
|
};
|
|
CentralWidget(QWidget *parent = nullptr);
|
|
~CentralWidget();
|
|
|
|
void setAnalysisMode(const AnalysisMode);
|
|
void clearAllData();
|
|
|
|
EventHandler* getEvnetHandler(){return _eventHandler;}
|
|
signals:
|
|
void sigContextMenuShow(const QPoint);
|
|
void sigSendLineXCoord(const int,const double);
|
|
void sigRightDockWidgetHide();
|
|
public slots:
|
|
void slotModeModify(const Global::Mode);
|
|
void slotRecvCommonData(const CommonData&);
|
|
void slotRecvAnalysisFileName(const QString&);
|
|
void slotSelectionChanged();
|
|
|
|
//analysis setting
|
|
void slotAnalysisSettingLineXPoint(const int index,const double);
|
|
|
|
void slotAnalysisSettingApply();
|
|
void slotAnalysisSettingConfirm();
|
|
void slotAnalysisSettingUndo();
|
|
void slotAnalysisSettingCancel();
|
|
protected:
|
|
void timerEvent(QTimerEvent* event);
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
|
private:
|
|
void glassTransitionHandle();
|
|
|
|
void glassTransitionHandle2();
|
|
void quadraticFit(const QVector<QPointF>& points, double& a, double& b, double& c);
|
|
double derivativeAt(const double a, const double b, const double x);
|
|
PointCalculate::Line calculateLinearRegression(const QVector<double>& x, const QVector<double>& y);
|
|
|
|
|
|
void setEventHandlerEnable(const bool);
|
|
void drawText(const QPointF,const QString);
|
|
void fillGraph(const double x1,const double x2);
|
|
|
|
enum ClearDataMode{
|
|
All,
|
|
Undo
|
|
};
|
|
void clearData(const ClearDataMode);
|
|
private:
|
|
AnalysisMode _analysisMode;
|
|
QCustomPlot *_customPlot;
|
|
QCPCurve *_currentCurve;
|
|
// QVector<QCPCurve *> _curveVtr;
|
|
// QCPGraph* _currentGraph;
|
|
// QVector<QCPGraph*> _graphVtr;
|
|
EventHandler* _eventHandler;
|
|
QCPItemStraightLine *_line1,*_line2;
|
|
// QVector<Global::ExperimentData> _dataVtr;
|
|
QVector<QCPItemStraightLine*> _lineVtr;
|
|
};
|
|
|
|
#endif // CENTRALWIDGET_H
|