From de17180adab7d2249a389ee5c2c1c90bf83bdd67 Mon Sep 17 00:00:00 2001 From: yuntang <123@qq.com> Date: Wed, 30 Apr 2025 10:59:08 +0800 Subject: [PATCH] 2025-04-30T10:59:07 --- experiment_data/sample_data/sample_data.txt | 0 experiment_data/sample_data/~$锡.xlsx | Bin 0 -> 165 bytes src/data/pointcalculate.cpp | 29 ++++++++++++++++++++ src/data/pointcalculate.h | 5 ++++ src/data/xlsxhandler.cpp | 1 + src/global.cpp | 2 ++ src/global.h | 4 +++ src/mainwindow.cpp | 4 ++- src/ui/centralwidget.cpp | 23 ++++++++++++---- 9 files changed, 62 insertions(+), 6 deletions(-) delete mode 100644 experiment_data/sample_data/sample_data.txt create mode 100644 experiment_data/sample_data/~$锡.xlsx diff --git a/experiment_data/sample_data/sample_data.txt b/experiment_data/sample_data/sample_data.txt deleted file mode 100644 index e69de29..0000000 diff --git a/experiment_data/sample_data/~$锡.xlsx b/experiment_data/sample_data/~$锡.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d4a5841882f71e1e9259c5c320e2b84832515279 GIT binary patch literal 165 ZcmZQhOiETD9WXN_G9)o1Gbqpn0s!Zc4-)_Y literal 0 HcmV?d00001 diff --git a/src/data/pointcalculate.cpp b/src/data/pointcalculate.cpp index 3559a2a..992e98b 100644 --- a/src/data/pointcalculate.cpp +++ b/src/data/pointcalculate.cpp @@ -631,4 +631,33 @@ QVector PointCalculate::getPointVtrInXRange(const float x1, const float 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::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; +} diff --git a/src/data/pointcalculate.h b/src/data/pointcalculate.h index be7274d..b646738 100644 --- a/src/data/pointcalculate.h +++ b/src/data/pointcalculate.h @@ -23,12 +23,17 @@ QPair getMaxMinValue(); QPair calculateStartAndEndPoint(); float calculateArea(); +double obtainTimeValueBasedOnTemperatureValue(const double sampleTemp); // text format QString textFormatPeakPoint(const float enthalpyValue, const float peakValue, const float startPoint, const float endPoint); +QString textFormatPeakPointWithTime(const float enthalpyValue, + const float peakValue, + const float startPoint, + const float endPoint); QString textFormatNumbericalLabel(const QPointF); QString textFormatStartPoint(const QPointF); QString textFormatEndPoint(const QPointF); diff --git a/src/data/xlsxhandler.cpp b/src/data/xlsxhandler.cpp index 6ea173f..6e30dd7 100644 --- a/src/data/xlsxhandler.cpp +++ b/src/data/xlsxhandler.cpp @@ -171,6 +171,7 @@ void XlsxHandler::writeFile(const QString filePath) xlsx.write(row , 2, ConPhaseHeaderTime); xlsx.write(row , 3, ConPhaseHeaderTemp); xlsx.write(row , 4, ConPhaseHeaderVoltage); + xlsx.write(row , 5, ConPhaseHeaderTime); row++; xlsx.write(row , 1, ConPhaseIndex); diff --git a/src/global.cpp b/src/global.cpp index 3ecb336..b736d78 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -13,6 +13,8 @@ CurveExperimentData* _currentCurveExperimentDataPtr = nullptr; bool _enthalpyCoefficientEnableFlag = false; QVector _enthalpyCoefficientVtr; +bool _displayTimeValue = false; + QString converDoubleToStr(const double num) { return QString::number(num,'f',3); diff --git a/src/global.h b/src/global.h index 934f71a..ff55564 100644 --- a/src/global.h +++ b/src/global.h @@ -18,6 +18,8 @@ const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state"; const QString CurveOfTimeTypeObjectName("curve_time"); + + enum Mode{ Analysis, ConnectedToDev, @@ -89,6 +91,8 @@ extern CurveExperimentData* _currentCurveExperimentDataPtr; extern bool _enthalpyCoefficientEnableFlag; ///abc extern QVector _enthalpyCoefficientVtr; +// peak comprehensive ananlysis +extern bool _displayTimeValue; // common func QString converDoubleToStr(const double); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 0b2811d..83fe7cc 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -45,6 +45,8 @@ MainWindow::MainWindow(QWidget *parent) QLabel *permenentLabel = new QLabel(this); permenentLabel->setText("Software Ver:" + Global::ConSoftVersion); ui->statusbar->addPermanentWidget(permenentLabel); + + ui->actionTimeAxisAnalysisPCTMode->setCheckable(true); // setSubWidgetAttribute(_expertmentSettingForm); setSubWidgetAttribute(_specificHeatComparisonMethodForm); @@ -348,7 +350,7 @@ void MainWindow::on_actionOITAutoAnalysisMode_triggered() void MainWindow::on_actionTimeAxisAnalysisPCTMode_triggered() { - + Global::_displayTimeValue = ui->actionTimeAxisAnalysisPCTMode->isChecked(); } void MainWindow::on_actionDegreeOfCuring_triggered() diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index a71245c..3d6d9f0 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -370,11 +370,24 @@ void CentralWidget::slotAnalysisSettingApply() logde<<"start,end:"<