110 lines
3.0 KiB
C++
110 lines
3.0 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"
|
|
#include "localcustomplot.h"
|
|
#include "analysisoperationrecorder.h"
|
|
#include "global.h"
|
|
|
|
class CentralWidget:public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
using AnalysisOperation = AnalysisOperationRecorder::AnalysisOperation;
|
|
using AnalysisMode = AnalysisOperationRecorder::AnalysisMode;
|
|
|
|
CentralWidget(QWidget *parent = nullptr);
|
|
~CentralWidget();
|
|
|
|
void setAnalysisMode(const AnalysisMode);
|
|
void clearAllData();
|
|
|
|
EventHandler* getEvnetHandler(){return _eventHandler;}
|
|
|
|
QPixmap getPixMap();
|
|
|
|
enum AxisMode{
|
|
SingleY,
|
|
DoubleY
|
|
};
|
|
void switchAxisMode();
|
|
struct AxisInfo{
|
|
bool visiable;
|
|
double lower;
|
|
double upper;
|
|
};
|
|
signals:
|
|
void sigContextMenuShow(const QPoint);
|
|
void sigSendLineXCoord(const int,const double);
|
|
void sigRightDockWidgetHide();
|
|
|
|
void sigGetAxisInfoWithData(const QVector<AxisInfo>);
|
|
public slots:
|
|
// experiment
|
|
void slotAxisModify(const float temp);
|
|
void slotModeModify(const Global::Mode);
|
|
void slotRecvCommonData(const CommonData&);
|
|
void slotRecvAnalysisFileName(const QString&);
|
|
|
|
//analysis setting
|
|
void slotAnalysisSettingApply();
|
|
void slotAnalysisSettingConfirm();
|
|
void slotAnalysisSettingUndo();
|
|
void slotAnalysisSettingCancel();
|
|
|
|
void slotAnalysisSettingLineXPoint(const int index,const double);
|
|
|
|
void slotDrawCustomText(const QString);
|
|
|
|
void slotDelCurve(QCPCurve*);
|
|
//
|
|
void slotGetAxisInfo();
|
|
void slotSetAxisSettings(const QVector<double>);
|
|
|
|
protected:
|
|
void timerEvent(QTimerEvent* event);
|
|
private:
|
|
void glassTransitionHandle(const double x1,const double x2);
|
|
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);
|
|
|
|
QPointF OnsetTemperaturePointHandle(const double x1,const double x2);
|
|
|
|
void setEventHandlerEnable(const bool);
|
|
QPointF getTheCoordinatesOfTheTextBox(const QPointF point);
|
|
void drawText(const QPointF,const QString);
|
|
void fillGraph(const double x1,const double x2);
|
|
|
|
enum ClearDataMode{
|
|
All,
|
|
Undo
|
|
};
|
|
void clearData(const ClearDataMode);
|
|
|
|
void loadAnalysisData(const AnalysisMode mode,const double x1,const double x2);
|
|
private:
|
|
AnalysisOperationRecorder::AnalysisMode _analysisMode;
|
|
LocalCustomPlot *_customPlot;
|
|
QCPCurve *_currentCurve;
|
|
EventHandler* _eventHandler;
|
|
QCPItemStraightLine *_line1,*_line2;
|
|
QVector<QCPItemStraightLine*> _lineVtr;
|
|
AxisMode _axisMode;
|
|
QVector<QString> _analysisFilePathVtr;
|
|
|
|
double _x1Record;
|
|
double _x2Record;
|
|
};
|
|
|
|
#endif // CENTRALWIDGET_H
|