2025-03-05 09:33:46 +00:00
|
|
|
#ifndef CENTRALWIDGET_H
|
|
|
|
|
#define CENTRALWIDGET_H
|
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
2025-03-21 09:28:36 +00:00
|
|
|
#include <QMenu>
|
2025-03-12 09:29:52 +00:00
|
|
|
|
2025-03-06 09:31:55 +00:00
|
|
|
#include "qcustomplot.h"
|
2025-03-12 09:29:52 +00:00
|
|
|
#include "protocol.h"
|
|
|
|
|
#include "global.h"
|
2025-03-20 09:28:22 +00:00
|
|
|
#include "draglinehandler.h"
|
2025-03-05 09:33:46 +00:00
|
|
|
|
|
|
|
|
class CentralWidget:public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2025-03-20 09:28:22 +00:00
|
|
|
enum AnalysisMode{
|
|
|
|
|
None,
|
|
|
|
|
NumericalLabel,
|
|
|
|
|
StartPoint,
|
|
|
|
|
StopPoint,
|
2025-03-24 09:30:42 +00:00
|
|
|
PeakSynthesisAnalysis
|
2025-03-20 09:28:22 +00:00
|
|
|
};
|
2025-03-05 09:33:46 +00:00
|
|
|
CentralWidget(QWidget *parent = nullptr);
|
2025-03-19 03:19:52 +00:00
|
|
|
~CentralWidget();
|
2025-03-20 09:28:22 +00:00
|
|
|
|
|
|
|
|
void setAnalysisMode(const AnalysisMode);
|
2025-03-21 09:28:36 +00:00
|
|
|
signals:
|
|
|
|
|
void sigContextMenuShow(const QPoint);
|
|
|
|
|
void sigSendLineXCoord(const int,const double);
|
2025-03-12 09:29:52 +00:00
|
|
|
public slots:
|
|
|
|
|
void slotModeModify(const Global::Mode);
|
2025-03-19 07:19:45 +00:00
|
|
|
void slotRecvCommonData(const CommonData&);
|
|
|
|
|
void slotRecvAnalysisFileName(const QString&);
|
2025-03-21 09:28:36 +00:00
|
|
|
//analysis setting
|
2025-03-24 09:30:42 +00:00
|
|
|
void slotAnalysisSettingLineXPoint(const int index,const double);
|
2025-03-21 09:28:36 +00:00
|
|
|
void slotAnalysisSettingApply();
|
|
|
|
|
void slotAnalysisSettingConfirm();
|
2025-03-24 09:30:42 +00:00
|
|
|
void slotAnalysisSettingUndo();
|
|
|
|
|
void slotAnalysisSettingCancel();
|
2025-03-06 09:31:55 +00:00
|
|
|
protected:
|
|
|
|
|
void timerEvent(QTimerEvent* event);
|
2025-03-21 09:28:36 +00:00
|
|
|
void contextMenuEvent(QContextMenuEvent *event);
|
2025-03-12 09:29:52 +00:00
|
|
|
private:
|
2025-03-21 09:28:36 +00:00
|
|
|
void setEventHandlerEnable(const bool);
|
2025-03-24 09:30:42 +00:00
|
|
|
void drawText(const double,const QString);
|
2025-03-06 09:31:55 +00:00
|
|
|
private:
|
2025-03-21 09:28:36 +00:00
|
|
|
AnalysisMode _nanlysisMode;
|
2025-03-06 09:31:55 +00:00
|
|
|
QCustomPlot *_customPlot;
|
2025-03-20 09:28:22 +00:00
|
|
|
QCPGraph* _graph;
|
|
|
|
|
DragLineHandler* _eventHandler;
|
|
|
|
|
QCPItemStraightLine *_line1,*_line2;
|
2025-03-05 09:33:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CENTRALWIDGET_H
|