2025-04-30T10:59:07

This commit is contained in:
yuntang 2025-04-30 10:59:08 +08:00
parent 51732f394c
commit de17180ada
9 changed files with 62 additions and 6 deletions

Binary file not shown.

View File

@ -631,4 +631,33 @@ QVector<QPointF> PointCalculate::getPointVtrInXRange(const float x1, const float
return targetVtr; return targetVtr;
} }
QString PointCalculate::textFormatPeakPointWithTime(const float enthalpyValue, const float peakValue, const float startPoint, const float endPoint)
{
return QString("峰的综合信息:\n"
"焓值:%1 J/g \n"
"峰值:%2min \n"
"起始点:%3min \n"
"终止点:%4min"
)
.arg(QString::number(enthalpyValue, 'f', 3))
.arg(QString::number(peakValue, 'f', 3))
.arg(QString::number(startPoint, 'f', 3))
.arg(QString::number(endPoint, 'f', 3));
}
double PointCalculate::obtainTimeValueBasedOnTemperatureValue(const double sampleTemp)
{
double minDiff = std::numeric_limits<float>::max();
double targetValue = 0.0;
for(const Global::ExperimentData &ed : _dataVtr) {
double min = std::abs(ed.sampleTemp - sampleTemp);
if (min < minDiff) {
minDiff = min;
targetValue = ed.runTime;
}
}
return targetValue;
}

View File

@ -23,12 +23,17 @@ QPair<float, float> getMaxMinValue();
QPair<QPointF,QPointF> calculateStartAndEndPoint(); QPair<QPointF,QPointF> calculateStartAndEndPoint();
float calculateArea(); float calculateArea();
double obtainTimeValueBasedOnTemperatureValue(const double sampleTemp);
// text format // text format
QString textFormatPeakPoint(const float enthalpyValue, QString textFormatPeakPoint(const float enthalpyValue,
const float peakValue, const float peakValue,
const float startPoint, const float startPoint,
const float endPoint); const float endPoint);
QString textFormatPeakPointWithTime(const float enthalpyValue,
const float peakValue,
const float startPoint,
const float endPoint);
QString textFormatNumbericalLabel(const QPointF); QString textFormatNumbericalLabel(const QPointF);
QString textFormatStartPoint(const QPointF); QString textFormatStartPoint(const QPointF);
QString textFormatEndPoint(const QPointF); QString textFormatEndPoint(const QPointF);

View File

@ -171,6 +171,7 @@ void XlsxHandler::writeFile(const QString filePath)
xlsx.write(row , 2, ConPhaseHeaderTime); xlsx.write(row , 2, ConPhaseHeaderTime);
xlsx.write(row , 3, ConPhaseHeaderTemp); xlsx.write(row , 3, ConPhaseHeaderTemp);
xlsx.write(row , 4, ConPhaseHeaderVoltage); xlsx.write(row , 4, ConPhaseHeaderVoltage);
xlsx.write(row , 5, ConPhaseHeaderTime);
row++; row++;
xlsx.write(row , 1, ConPhaseIndex); xlsx.write(row , 1, ConPhaseIndex);

View File

@ -13,6 +13,8 @@ CurveExperimentData* _currentCurveExperimentDataPtr = nullptr;
bool _enthalpyCoefficientEnableFlag = false; bool _enthalpyCoefficientEnableFlag = false;
QVector<double> _enthalpyCoefficientVtr; QVector<double> _enthalpyCoefficientVtr;
bool _displayTimeValue = false;
QString converDoubleToStr(const double num) QString converDoubleToStr(const double num)
{ {
return QString::number(num,'f',3); return QString::number(num,'f',3);

View File

@ -18,6 +18,8 @@ const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state";
const QString CurveOfTimeTypeObjectName("curve_time"); const QString CurveOfTimeTypeObjectName("curve_time");
enum Mode{ enum Mode{
Analysis, Analysis,
ConnectedToDev, ConnectedToDev,
@ -89,6 +91,8 @@ extern CurveExperimentData* _currentCurveExperimentDataPtr;
extern bool _enthalpyCoefficientEnableFlag; extern bool _enthalpyCoefficientEnableFlag;
///abc ///abc
extern QVector<double> _enthalpyCoefficientVtr; extern QVector<double> _enthalpyCoefficientVtr;
// peak comprehensive ananlysis
extern bool _displayTimeValue;
// common func // common func
QString converDoubleToStr(const double); QString converDoubleToStr(const double);

View File

@ -45,6 +45,8 @@ MainWindow::MainWindow(QWidget *parent)
QLabel *permenentLabel = new QLabel(this); QLabel *permenentLabel = new QLabel(this);
permenentLabel->setText("Software Ver:" + Global::ConSoftVersion); permenentLabel->setText("Software Ver:" + Global::ConSoftVersion);
ui->statusbar->addPermanentWidget(permenentLabel); ui->statusbar->addPermanentWidget(permenentLabel);
ui->actionTimeAxisAnalysisPCTMode->setCheckable(true);
// //
setSubWidgetAttribute(_expertmentSettingForm); setSubWidgetAttribute(_expertmentSettingForm);
setSubWidgetAttribute(_specificHeatComparisonMethodForm); setSubWidgetAttribute(_specificHeatComparisonMethodForm);
@ -348,7 +350,7 @@ void MainWindow::on_actionOITAutoAnalysisMode_triggered()
void MainWindow::on_actionTimeAxisAnalysisPCTMode_triggered() void MainWindow::on_actionTimeAxisAnalysisPCTMode_triggered()
{ {
Global::_displayTimeValue = ui->actionTimeAxisAnalysisPCTMode->isChecked();
} }
void MainWindow::on_actionDegreeOfCuring_triggered() void MainWindow::on_actionDegreeOfCuring_triggered()

View File

@ -370,11 +370,24 @@ void CentralWidget::slotAnalysisSettingApply()
logde<<"start,end:"<<startEndPointPair.first.x()<<"," logde<<"start,end:"<<startEndPointPair.first.x()<<","
<<startEndPointPair.second.x(); <<startEndPointPair.second.x();
drawText(peakPoint, if(Global::_displayTimeValue){
PointCalculate::textFormatPeakPoint(enthalpyValue, double peakPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(peakPoint.x());
peakPoint.x(), double startPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(startEndPointPair.first.x());
startEndPointPair.first.x(), double endPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(startEndPointPair.second.x());
startEndPointPair.second.x()));
drawText(peakPoint,
PointCalculate::textFormatPeakPointWithTime(
enthalpyValue,
peakPointTime,
startPointTime,
endPointTime));
}else{
drawText(peakPoint,
PointCalculate::textFormatPeakPoint(enthalpyValue,
peakPoint.x(),
startEndPointPair.first.x(),
startEndPointPair.second.x()));
}
// //
break; break;
} }