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-04-12 13:02:37 +00:00
|
|
|
void setExperimentData(const QVector<Global::ExperimentData>&);
|
2025-04-01 09:25:12 +00:00
|
|
|
|
|
|
|
|
QPair<QPointF,QPointF> getStartAndEndPoint();
|
2025-04-17 09:31:46 +00:00
|
|
|
QVector<Global::ExperimentData> getDataInXRange(const float, const float);
|
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);
|
2025-04-08 09:30:33 +00:00
|
|
|
QPointF getClosestPointByY(const float left,const float right,const float valueY);
|
2025-04-03 09:24:29 +00:00
|
|
|
QPointF getPeakPoint();
|
2025-04-16 09:10:35 +00:00
|
|
|
QPair<float, float> getMaxMinValue();
|
2025-04-08 09:30:33 +00:00
|
|
|
|
|
|
|
|
QPair<QPointF,QPointF> calculateStartAndEndPoint();
|
|
|
|
|
float calculateArea();
|
|
|
|
|
|
|
|
|
|
// text format
|
2025-04-01 09:25:12 +00:00
|
|
|
QString textFormatPeakPoint(const float enthalpyValue,
|
2025-04-16 09:10:35 +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-04-09 05:58:05 +00:00
|
|
|
QString textFormatGlassTranstion(const float t1,const float tg,const float t2);
|
2025-04-03 09:24:29 +00:00
|
|
|
|
2025-04-08 09:30:33 +00:00
|
|
|
// glass transition
|
|
|
|
|
QPair<float,float> getCurveInflectionPointTangent(const float,const float);
|
|
|
|
|
struct LineStruct {
|
|
|
|
|
float slope; //
|
|
|
|
|
float intercept; //
|
|
|
|
|
};
|
|
|
|
|
QPointF getIntersectionBySlope(const LineStruct& line1, const LineStruct& line2);
|
2025-03-31 05:19:02 +00:00
|
|
|
|
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
|
|
|
|
2025-04-12 13:02:37 +00:00
|
|
|
extern QVector<Global::ExperimentData> _dataVtr;
|
2025-03-26 09:30:02 +00:00
|
|
|
extern QPointF _peakPoint;
|
|
|
|
|
extern QPointF _leftSelectedPoint,_rightSelectedPoint;
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-03 09:24:29 +00:00
|
|
|
#endif // POINTCALCULATE_H
|