2025-03-26 09:30:02 +00:00
|
|
|
#ifndef PEAKPOINT_H
|
|
|
|
|
#define PEAKPOINT_H
|
|
|
|
|
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
|
|
|
|
|
#include "filemanager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace PeakPoint{
|
|
|
|
|
void setExperimentData(const QVector<FileManager::ExperimentData>&);
|
2025-03-27 09:31:19 +00:00
|
|
|
void setRegionPointX(const float,const float);
|
|
|
|
|
float findClosestY(float targetX);
|
2025-03-26 09:30:02 +00:00
|
|
|
QPointF findPeakPoint();
|
2025-03-27 09:31:19 +00:00
|
|
|
QString textFormat(const float enthalpyValue,
|
|
|
|
|
const float peakValue,
|
|
|
|
|
const float startPoint,
|
|
|
|
|
const float endPoint);
|
|
|
|
|
QPair<QPointF,QPointF> calculateStartAndEndPoint();
|
2025-03-31 05:19:02 +00:00
|
|
|
double calculateArea();
|
|
|
|
|
|
2025-03-26 09:30:02 +00:00
|
|
|
//private
|
2025-03-27 09:31:19 +00:00
|
|
|
void updateStartEndPoint();
|
2025-03-26 09:30:02 +00:00
|
|
|
QPair<QPointF,QPointF> calculateMaxDiffPointLeft();
|
|
|
|
|
QPair<QPointF,QPointF> calculateMaxDiffPointRight();
|
|
|
|
|
enum MaxDiffPointDetailType{
|
|
|
|
|
Left,
|
|
|
|
|
Right
|
|
|
|
|
};
|
|
|
|
|
QPair<QPointF,QPointF> calculateMaxDiffPointDetail(const MaxDiffPointDetailType type);
|
|
|
|
|
|
|
|
|
|
QPointF calculateIntersection(const QPointF p1,const QPointF p2,
|
|
|
|
|
const QPointF p3, const QPointF p4);
|
2025-03-27 09:31:19 +00:00
|
|
|
QPointF findClosestPointByX(float target);
|
|
|
|
|
QVector<QPointF> getPeakPointGroup();
|
2025-03-26 09:30:02 +00:00
|
|
|
|
|
|
|
|
extern QVector<FileManager::ExperimentData> _dataVtr;
|
|
|
|
|
extern QPointF _peakPoint;
|
|
|
|
|
extern QPointF _leftSelectedPoint,_rightSelectedPoint;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // PEAKPOINT_H
|