2025-04-03 09:24:29 +00:00
|
|
|
#ifndef POINTCALCULATE_H
|
|
|
|
|
#define POINTCALCULATE_H
|
2025-03-26 09:30:02 +00:00
|
|
|
|
|
|
|
|
#include <QPointF>
|
|
|
|
|
|
|
|
|
|
#include "filemanager.h"
|
|
|
|
|
|
2025-04-03 09:24:29 +00:00
|
|
|
namespace PointCalculate{
|
2025-03-26 09:30:02 +00:00
|
|
|
void setExperimentData(const QVector<FileManager::ExperimentData>&);
|
2025-04-01 09:25:12 +00:00
|
|
|
|
|
|
|
|
QPair<QPointF,QPointF> getStartAndEndPoint();
|
2025-04-03 09:24:29 +00:00
|
|
|
|
2025-03-27 09:31:19 +00:00
|
|
|
void setRegionPointX(const float,const float);
|
2025-04-03 09:24:29 +00:00
|
|
|
QPointF getClosestPointByX(const float);
|
|
|
|
|
QPointF getPeakPoint();
|
2025-04-01 09:25:12 +00:00
|
|
|
QString textFormatPeakPoint(const float enthalpyValue,
|
2025-03-27 09:31:19 +00:00
|
|
|
const float peakValue,
|
|
|
|
|
const float startPoint,
|
|
|
|
|
const float endPoint);
|
2025-04-01 09:25:12 +00:00
|
|
|
QString textFormatNumbericalLabel(const QPointF);
|
2025-04-03 09:24:29 +00:00
|
|
|
QString textFormatStartPoint(const QPointF);
|
|
|
|
|
QString textFormatEndPoint(const QPointF);
|
|
|
|
|
|
2025-03-27 09:31:19 +00:00
|
|
|
QPair<QPointF,QPointF> calculateStartAndEndPoint();
|
2025-03-31 05:19:02 +00:00
|
|
|
double calculateArea();
|
|
|
|
|
|
2025-04-03 09:24:29 +00:00
|
|
|
//获取曲线拐点处的切线
|
|
|
|
|
QPair<float,float> getCurveInflectionPointTangent();
|
|
|
|
|
QVector<QPointF> getRegionPoints(const float,const float);
|
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
|
|
|
QVector<QPointF> getPeakPointGroup();
|
2025-04-03 09:24:29 +00:00
|
|
|
std::vector<float> movingAverage(const std::vector<float>& data, int windowSize);
|
2025-03-26 09:30:02 +00:00
|
|
|
|
|
|
|
|
extern QVector<FileManager::ExperimentData> _dataVtr;
|
|
|
|
|
extern QPointF _peakPoint;
|
|
|
|
|
extern QPointF _leftSelectedPoint,_rightSelectedPoint;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-03 09:24:29 +00:00
|
|
|
#endif // POINTCALCULATE_H
|