2025-04-16T17:10:34
This commit is contained in:
parent
c3c164ed3d
commit
56a84cdc3a
BIN
experiment_data/analysis_state/peak.xlsx
Normal file
BIN
experiment_data/analysis_state/peak.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/~$peak.xlsx
Normal file
BIN
experiment_data/analysis_state/~$peak.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/~$标样.xlsx
Normal file
BIN
experiment_data/analysis_state/~$标样.xlsx
Normal file
Binary file not shown.
@ -178,6 +178,7 @@ QPointF PointCalculate::findClosestPointByX(float x) {
|
||||
|
||||
void PointCalculate::setRegionPointX(const float left, const float right)
|
||||
{
|
||||
logde<<"dataVtr size:"<<_dataVtr.size();
|
||||
logde<<"select point param left,right:"<<left<<","<<right;
|
||||
|
||||
_leftSelectedPoint = getClosestPointByX(left);
|
||||
@ -455,19 +456,19 @@ QString PointCalculate::textFormatEndPoint(const QPointF point)
|
||||
QPointF PointCalculate::getClosestPointByY(const float left,const float right,const float valueY)
|
||||
{
|
||||
float minValue = std::numeric_limits<float>::infinity(); // 初始化为正无穷
|
||||
QPointF closestPoint;
|
||||
QPointF closestPoint;
|
||||
|
||||
for (const Global::ExperimentData& ed : _dataVtr) {
|
||||
if (left < ed.sampleTemp && ed.sampleTemp < right) {
|
||||
float diff = std::abs(ed.dsc - valueY);
|
||||
if (diff < minValue) {
|
||||
minValue = diff;
|
||||
closestPoint = QPointF(ed.sampleTemp, ed.dsc);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const Global::ExperimentData& ed : _dataVtr) {
|
||||
if (left < ed.sampleTemp && ed.sampleTemp < right) {
|
||||
float diff = std::abs(ed.dsc - valueY);
|
||||
if (diff < minValue) {
|
||||
minValue = diff;
|
||||
closestPoint = QPointF(ed.sampleTemp, ed.dsc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return closestPoint;
|
||||
return closestPoint;
|
||||
}
|
||||
|
||||
QString PointCalculate::textFormatGlassTranstion(const float t1,const float tg,const float t2)
|
||||
@ -479,3 +480,25 @@ QString PointCalculate::textFormatGlassTranstion(const float t1,const float tg,c
|
||||
.arg(QString::number(tg, 'f', 3))
|
||||
.arg(QString::number(t2, 'f', 3));
|
||||
}
|
||||
|
||||
|
||||
QPair<float, float> PointCalculate::getMaxMinValue()
|
||||
{
|
||||
if (_dataVtr.isEmpty()) {
|
||||
return QPair<float, float>(0.0f, 0.0f);
|
||||
}
|
||||
|
||||
float maxDsc = std::numeric_limits<float>::lowest(); // 初始化为最小浮点数
|
||||
float minDsc = std::numeric_limits<float>::max(); // 初始化为最大浮点数
|
||||
|
||||
for(const Global::ExperimentData &ed : _dataVtr) {
|
||||
if (ed.dsc > maxDsc) {
|
||||
maxDsc = ed.dsc;
|
||||
}
|
||||
if (ed.dsc < minDsc) {
|
||||
minDsc = ed.dsc;
|
||||
}
|
||||
}
|
||||
|
||||
return QPair<float, float>(minDsc, maxDsc);
|
||||
}
|
||||
|
@ -14,15 +14,16 @@ void setRegionPointX(const float,const float);
|
||||
QPointF getClosestPointByX(const float);
|
||||
QPointF getClosestPointByY(const float left,const float right,const float valueY);
|
||||
QPointF getPeakPoint();
|
||||
QPair<float, float> getMaxMinValue();
|
||||
|
||||
QPair<QPointF,QPointF> calculateStartAndEndPoint();
|
||||
float calculateArea();
|
||||
|
||||
// text format
|
||||
QString textFormatPeakPoint(const float enthalpyValue,
|
||||
const float peakValue,
|
||||
const float startPoint,
|
||||
const float endPoint);
|
||||
const float peakValue,
|
||||
const float startPoint,
|
||||
const float endPoint);
|
||||
QString textFormatNumbericalLabel(const QPointF);
|
||||
QString textFormatStartPoint(const QPointF);
|
||||
QString textFormatEndPoint(const QPointF);
|
||||
|
@ -175,6 +175,8 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName)
|
||||
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
||||
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
||||
|
||||
logde<<"data Vtr size:"<<pti.dataVtr.size();
|
||||
|
||||
PointCalculate::setExperimentData(pti.dataVtr);
|
||||
|
||||
QPair<QPointF,QPointF>startEndPointPair = PointCalculate::getStartAndEndPoint();
|
||||
@ -182,8 +184,9 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName)
|
||||
QPointF endPoint = startEndPointPair.second;
|
||||
_customPlot->xAxis->setRange(0, endPoint.x() / 3 * 4);
|
||||
|
||||
QPointF peakPoint = PointCalculate::getPeakPoint();
|
||||
float absY = std::abs(peakPoint.y());
|
||||
//QPointF peakPoint = PointCalculate::getPeakPoint();
|
||||
QPair<float, float> maxMinPair = PointCalculate::getMaxMinValue();
|
||||
float absY = std::abs(maxMinPair.first - maxMinPair.second);
|
||||
_customPlot->yAxis->setRange(- absY * 2,absY *2);
|
||||
|
||||
// 设置坐标轴标签
|
||||
@ -205,8 +208,6 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName)
|
||||
_currentCurve->setData(tVtr, xVtr, yVtr);
|
||||
_currentCurve->setSelectable(QCP::stWhole); // 设置曲线可选
|
||||
|
||||
//
|
||||
// Global::_curveExperimentDataVtr.push_back();
|
||||
}
|
||||
|
||||
_customPlot->replot();
|
||||
|
Loading…
Reference in New Issue
Block a user