2025-06-12T17:27:44
This commit is contained in:
parent
2170adff06
commit
4f42759df8
BIN
experiment_data/sample_data/氮气氧气OTI.xlsx
Normal file
BIN
experiment_data/sample_data/氮气氧气OTI.xlsx
Normal file
Binary file not shown.
@ -9,7 +9,7 @@ CONFIG+=precompile_header
|
||||
PRECOMPILED_HEADER=stable.h
|
||||
|
||||
#
|
||||
VERSION = 1.0.3
|
||||
VERSION = 1.0.5
|
||||
# 设置目标文件名,包含版本号
|
||||
TARGET = DSCAnalysisTool_$${VERSION}
|
||||
|
||||
|
@ -891,5 +891,37 @@ QString PointCalculate::textFormatGlassTranstionWithTime(const float t1, const f
|
||||
.arg(QString::number(t2, 'f', 3));
|
||||
}
|
||||
|
||||
Global::ExperimentData PointCalculate::findOnSetDataByTime(const double x1, const double x2)
|
||||
{
|
||||
QVector<Global::ExperimentData> edVtr;
|
||||
for(const Global::ExperimentData &ed : _dataVtr) {
|
||||
if(x1 < ed.runTime && ed.runTime < x2){
|
||||
edVtr.push_back(ed);
|
||||
}else if (ed.runTime > x2){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Global::ExperimentData resultEd;
|
||||
|
||||
if(edVtr.empty()){
|
||||
return resultEd;
|
||||
}
|
||||
|
||||
double maxDsc = std::numeric_limits<float>::min();
|
||||
for(Global::ExperimentData& ed:edVtr){
|
||||
if(ed.dsc > maxDsc){
|
||||
maxDsc = ed.dsc;
|
||||
}
|
||||
}
|
||||
|
||||
// 从后往前遍历,找到第一个 dsc 与 standardDsc 相等的 ExperimentData
|
||||
for (auto it = edVtr.rbegin(); it != edVtr.rend(); ++it) {
|
||||
if(std::abs(it->dsc - maxDsc) < Global::OnsetAndEndSetRate * maxDsc){
|
||||
resultEd = *it; // 找到匹配项,返回该值
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return resultEd;
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ double obtainTimeValueBasedOnTemperatureValue(const double sampleTemp);
|
||||
ExperimentData findOnSetDataByTemperature(const double x1,const double x2);
|
||||
ExperimentData findEndSetDataByTemperature(const double x1,const double x2);
|
||||
|
||||
ExperimentData findOnSetDataByTime(const double x1,const double x2);
|
||||
|
||||
|
||||
// text format
|
||||
QString textFormatPeakPoint(const float enthalpyValue,
|
||||
|
@ -644,7 +644,8 @@ void MainWindow::on_actionGlassTransition_triggered()
|
||||
|
||||
void MainWindow::on_actionOIT_triggered()
|
||||
{
|
||||
QMessageBox::warning(this, "warnning", "on_actionOIT_triggered.");
|
||||
_rightWidget->show();
|
||||
_centralWidget->setAnalysisMode(CentralWidget::AnalysisMode::OIT);
|
||||
}
|
||||
|
||||
void MainWindow::on_actionSpecificHeatCompMethod_triggered()
|
||||
|
@ -19,7 +19,8 @@ enum AnalysisMode{
|
||||
PeakSynthesisAnalysis,
|
||||
GlassTransition,
|
||||
OnsetTemperaturePoint,
|
||||
EndsetTemperaturePoint
|
||||
EndsetTemperaturePoint,
|
||||
OIT
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -204,6 +204,14 @@ void CentralWidget::setAnalysisMode(const AnalysisMode mode)
|
||||
{
|
||||
_analysisMode = mode;
|
||||
|
||||
if(mode == AnalysisMode::Null){
|
||||
_customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
|
||||
}else{
|
||||
_customPlot->setInteractions(QCP::iSelectPlottables);
|
||||
setEventHandlerEnable(true);
|
||||
}
|
||||
|
||||
#if 0
|
||||
switch (mode)
|
||||
{
|
||||
case AnalysisMode::Null:
|
||||
@ -222,6 +230,7 @@ void CentralWidget::setAnalysisMode(const AnalysisMode mode)
|
||||
default:
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void CentralWidget::slotModeModify(const Global::Mode mode)
|
||||
@ -1386,11 +1395,95 @@ void CentralWidget::loadAnalysisData(
|
||||
|
||||
break;
|
||||
}
|
||||
case AnalysisMode::OIT:{
|
||||
logde<<"oit x1,x2:"<<x1<<","<<x2;
|
||||
|
||||
Global::ExperimentData ed = PointCalculate::findOnSetDataByTime(x1,x2);
|
||||
|
||||
// Global::ExperimentData ed = PointCalculate::findOnSetDataByTemperature(x1,x2);
|
||||
|
||||
// PointCalculate::setRegionPointX(x1,x2);
|
||||
|
||||
Global::ExperimentData startData = PointCalculate::_dataVtr.first();
|
||||
|
||||
// QPair<Global::ExperimentData,Global::ExperimentData>
|
||||
// startEndDataPair = PointCalculate::calculateStartAndEndData();
|
||||
|
||||
logde<<"start data time:"<<startData.runTime;
|
||||
logde<<"end data time:"<<ed.runTime;
|
||||
|
||||
drawOITLine(startData,ed);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CentralWidget::drawOITLine(const Global::ExperimentData startData,const Global::ExperimentData endData)
|
||||
{
|
||||
#if 0
|
||||
// Draw start vertical line.
|
||||
QVector<double> xVtr,yVtr;
|
||||
xVtr.push_back(startData.runTime);
|
||||
xVtr.push_back(startData.runTime);
|
||||
|
||||
yVtr.push_back(startData.dsc - 10);
|
||||
yVtr.push_back(startData.dsc - 20);
|
||||
|
||||
QCPGraph *startLine = _customPlot->addGraph();
|
||||
startLine->setData(xVtr, yVtr);
|
||||
startLine->setPen(QPen(Qt::red, 1));
|
||||
|
||||
// Draw end vertical line.
|
||||
xVtr.clear();
|
||||
yVtr.clear();
|
||||
xVtr.push_back(endData.runTime);
|
||||
xVtr.push_back(endData.runTime);
|
||||
|
||||
yVtr.push_back(endData.dsc - 10);
|
||||
yVtr.push_back(endData.dsc - 20);
|
||||
|
||||
QCPGraph *endLine = _customPlot->addGraph();
|
||||
endLine->setData(xVtr, yVtr);
|
||||
endLine->setPen(QPen(Qt::red, 1));
|
||||
#endif
|
||||
|
||||
// Draw start line.
|
||||
QCPItemLine *startLine = new QCPItemLine(_customPlot);
|
||||
startLine->start->setCoords(startData.runTime,startData.dsc - 10);
|
||||
startLine->end->setCoords(startData.runTime,startData.dsc - 20);
|
||||
startLine->setPen(QPen(Qt::red, 1));
|
||||
// Draw end line.
|
||||
QCPItemLine *endLine = new QCPItemLine(_customPlot);
|
||||
endLine->start->setCoords(endData.runTime,endData.dsc - 10);
|
||||
endLine->end->setCoords(endData.runTime,endData.dsc - 20);
|
||||
endLine->setPen(QPen(Qt::red, 1));
|
||||
|
||||
// Draw total line.
|
||||
QCPItemLine *totalLine = new QCPItemLine(_customPlot);
|
||||
totalLine->start->setCoords(startData.runTime,startData.dsc - 15);
|
||||
totalLine->end->setCoords(endData.runTime,endData.dsc - 15);
|
||||
totalLine->setPen(QPen(Qt::red, 1));
|
||||
|
||||
// Draw title.
|
||||
double textX = (endData.runTime - startData.runTime) / 2 + endData.runTime;
|
||||
|
||||
QCPItemText *textLabel = new QCPItemText(_customPlot);
|
||||
textLabel->setPositionAlignment(Qt::AlignCenter); // 对齐方式
|
||||
textLabel->position->setType(QCPItemPosition::ptPlotCoords); // 使用数据坐标
|
||||
textLabel->position->setCoords(textX,startData.dsc - 20); // 设置文本位置在指定点上方
|
||||
|
||||
textLabel->setText("OIT:123.44"); // 设置文本内容
|
||||
QFont font(QFont("Arial", 10));
|
||||
textLabel->setFont(font);
|
||||
textLabel->setSelectedFont(font);
|
||||
textLabel->setSelectable(true); // 设置为可选
|
||||
|
||||
_customPlot->replot();
|
||||
}
|
||||
|
||||
void CentralWidget::clearAllData()
|
||||
{
|
||||
Global::_mode = Global::Mode::Analysis;
|
||||
|
@ -110,6 +110,7 @@ private:
|
||||
|
||||
void loadAnalysisData(const AnalysisMode mode,const double x1,const double x2,const QString objectName);
|
||||
|
||||
void drawOITLine(const Global::ExperimentData startData,const Global::ExperimentData endData);
|
||||
private:
|
||||
AnalysisOperationRecorder::AnalysisMode _analysisMode;
|
||||
LocalCustomPlot *_customPlot;
|
||||
|
Loading…
Reference in New Issue
Block a user