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;
}
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();
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);

View File

@ -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);

View File

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

View File

@ -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<double> _enthalpyCoefficientVtr;
// peak comprehensive ananlysis
extern bool _displayTimeValue;
// common func
QString converDoubleToStr(const double);

View File

@ -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()

View File

@ -370,11 +370,24 @@ void CentralWidget::slotAnalysisSettingApply()
logde<<"start,end:"<<startEndPointPair.first.x()<<","
<<startEndPointPair.second.x();
if(Global::_displayTimeValue){
double peakPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(peakPoint.x());
double startPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(startEndPointPair.first.x());
double endPointTime = PointCalculate::obtainTimeValueBasedOnTemperatureValue(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;
}