diff --git a/AnalysisTool-release/bin/DSCAnalysisTool_1.0.4.exe b/AnalysisTool-release/bin/DSCAnalysisTool_1.0.4.exe new file mode 100644 index 0000000..bad2cf0 Binary files /dev/null and b/AnalysisTool-release/bin/DSCAnalysisTool_1.0.4.exe differ diff --git a/AnalysisTool-release/bin/log/20250618.log b/AnalysisTool-release/bin/log/20250618.log new file mode 100644 index 0000000..2b1b55f --- /dev/null +++ b/AnalysisTool-release/bin/log/20250618.log @@ -0,0 +1,38 @@ +[2025-06-18 10:02:31,941] main... +[2025-06-18 10:02:31,942] config file existed. +[2025-06-18 10:02:31,980] version:1.0.4.0 +[2025-06-18 10:02:32,018] setEventHandlerEnable...0 +[2025-06-18 10:02:34,587] xlsx sample weight: +[2025-06-18 10:02:34,587] Cell does not exist. +[2025-06-18 10:02:35,513] xlsx sample weight:1 +[2025-06-18 10:02:35,513] startLineIndex:11 +[2025-06-18 10:02:35,513] data size:298 +[2025-06-18 10:02:35,513] Cell does not exist. +[2025-06-18 10:02:36,662] xlsx sample weight:8.31 +[2025-06-18 10:02:36,662] startLineIndex:11 +[2025-06-18 10:02:36,662] data size:7279 +[2025-06-18 10:02:36,666] Cell does not exist. +[2025-06-18 10:02:51,837] Selected Curve:new.xlsx +[2025-06-18 10:02:55,134] setEventHandlerEnable...1 +[2025-06-18 10:02:58,318] xMax:92.6223 +[2025-06-18 10:03:00,251] Selected Curve:锡.xlsx +[2025-06-18 10:03:05,007] Selected Curve:锡.xlsx +[2025-06-18 10:03:06,467] setEventHandlerEnable...1 +[2025-06-18 10:03:07,676] xMax:92.7333 +[2025-06-18 10:03:13,530] Selected Curve:new.xlsx +[2025-06-18 10:03:16,439] setEventHandlerEnable...1 +[2025-06-18 10:03:20,434] xMax:94.441 +[2025-06-18 10:03:22,868] Selected Curve:锡.xlsx +[2025-06-18 10:03:28,310] setEventHandlerEnable...1 +[2025-06-18 10:03:32,187] Selected Curve:锡.xlsx +[2025-06-18 10:03:34,330] Selected Curve:锡.xlsx +[2025-06-18 10:03:35,987] xMax:94.2968 +[2025-06-18 10:03:38,728] Selected Curve:new.xlsx +[2025-06-18 10:03:51,207] setEventHandlerEnable...1 +[2025-06-18 10:03:56,637] xMax:94.8474 +[2025-06-18 10:04:00,625] Selected Curve:锡.xlsx +[2025-06-18 10:04:02,109] xMax:94.8474 +[2025-06-18 10:04:06,640] Selected Curve:锡.xlsx +[2025-06-18 10:04:14,239] Selected Curve:new.xlsx +[2025-06-18 10:04:17,332] xMax:94.8474 +[2025-06-18 10:04:25,159] Selected Curve:new.xlsx diff --git a/experiment_data/analysis_state/new.xlsx b/experiment_data/analysis_state/new.xlsx index b5d9a4c..94db2ce 100644 Binary files a/experiment_data/analysis_state/new.xlsx and b/experiment_data/analysis_state/new.xlsx differ diff --git a/src/data/pointcalculate.cpp b/src/data/pointcalculate.cpp index c8946ca..664ea94 100644 --- a/src/data/pointcalculate.cpp +++ b/src/data/pointcalculate.cpp @@ -925,3 +925,21 @@ Global::ExperimentData PointCalculate::findOnSetDataByTime(const double x1, cons return resultEd; } + +Global::ExperimentData PointCalculate::getOITStartData(const double x1,const double x2) +{ + Global::ExperimentData startEd; + + for(const Global::ExperimentData &ed : _dataVtr) { + if(ed.runTime < x2){ + if(ed.phaseIndex != Global::PhaseIndexDefault){ + logde<<"find not equal phase default."< x2){ + break; + } + } + + return startEd; +} diff --git a/src/data/pointcalculate.h b/src/data/pointcalculate.h index 4c40331..b3f8ee7 100644 --- a/src/data/pointcalculate.h +++ b/src/data/pointcalculate.h @@ -46,6 +46,7 @@ ExperimentData findEndSetDataByTemperature(const double x1,const double x2); ExperimentData findOnSetDataByTime(const double x1,const double x2); +ExperimentData getOITStartData(const double x1,const double x2); // text format QString textFormatPeakPoint(const float enthalpyValue, diff --git a/src/data/xlsxhandler.cpp b/src/data/xlsxhandler.cpp index faba3c5..3a62cfb 100644 --- a/src/data/xlsxhandler.cpp +++ b/src/data/xlsxhandler.cpp @@ -79,13 +79,8 @@ int XlsxHandler::readFile(const QString filePath, Global::CurveFileData &cfd) readPhaseData(workSheet, dataIndex, phaseTotal); phaseTotalVtr.push_back(phaseTotal); - // print - // logde<<"index:"<cellAt(startLineIndex++, 2)->value().toDouble(); @@ -108,11 +103,15 @@ void XlsxHandler::readPhaseData(QXlsx::Worksheet *workSheet, int &startLineIndex phaseTotal.phase.gas = static_cast(workSheet->cellAt(startLineIndex++, 2)->value().toInt()); int dataSize = workSheet->cellAt(startLineIndex++, 2)->value().toInt(); - logde<<"data size:"<cellAt(startLineIndex, 2)->value().toDouble(); data.sampleTemp = workSheet->cellAt(startLineIndex, 3)->value().toDouble(); data.dsc = workSheet->cellAt(startLineIndex, 4)->value().toDouble(); diff --git a/src/global.h b/src/global.h index 3af2296..9789697 100644 --- a/src/global.h +++ b/src/global.h @@ -17,6 +17,8 @@ const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state"; const QString CurveOfTimeTypeObjectName("curve_time"); +const int PhaseIndexDefault = -1; + // json string. const QString AtomsphereData("atomsphereData"); const QString SampleData("sampleData"); @@ -68,6 +70,15 @@ struct ExperimentData { float constantTempTime; float sampleTemp; float dsc; + int phaseIndex; + + ExperimentData() + :runTime(0.0) + ,constantTempTime(0.0) + ,sampleTemp(0.0) + ,dsc(0.0) + ,phaseIndex(PhaseIndexDefault) + {} }; enum TestType{ @@ -98,7 +109,6 @@ struct PhaseTotalInfo{ }; struct CurveFileData{ -// QString fileName; QString filePath; Global::ExperimentInfo ei; QVector phaseTotalVtr; @@ -106,10 +116,15 @@ struct CurveFileData{ }; struct CurveExperimentData{ + int phaseIndex; // from 1 to 6. QCPCurve * curve; QString fileName; // discard QVector dataVtr; QVector smoothDataVtr; + + CurveExperimentData() + :phaseIndex(PhaseIndexDefault) + ,curve(nullptr){} }; // Soft mode. diff --git a/src/serialport/serialport.cpp b/src/serialport/serialport.cpp index 5752101..a7e7dc3 100644 --- a/src/serialport/serialport.cpp +++ b/src/serialport/serialport.cpp @@ -162,9 +162,11 @@ void SerialPort::updateStatus(const CommonData &cd) Global::_currentPhase = (int)cd.current_phase; Global::CurveExperimentData ced; + ced.phaseIndex = cd.current_phase; Global::_curveExperimentDataVtr.push_back(ced); - Global::_currentCurveExperimentDataPtr = &Global::_curveExperimentDataVtr.last(); + Global::_currentCurveExperimentDataPtr = + &Global::_curveExperimentDataVtr.last(); Global::_currentCurveExperimentDataPtr->fileName = Global::_experimentInfo.sampleName; diff --git a/src/ui/centralwidget.cpp b/src/ui/centralwidget.cpp index 4b5d777..1b9cd4f 100644 --- a/src/ui/centralwidget.cpp +++ b/src/ui/centralwidget.cpp @@ -280,11 +280,15 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd) exit(0); }else{ Global::ExperimentData ed; - ed.dsc = cd .dsc; - ed.sampleTemp = cd.sample_temp; - ed.runTime = cd.add_run_time; + ed.dsc = cd .dsc; + ed.sampleTemp = cd.sample_temp; + ed.runTime = cd.add_run_time; ed.constantTempTime = cd.add_constan_temp_time; + if(Global::_currentCurveExperimentDataPtr->dataVtr.empty()){ + ed.phaseIndex = Global::_currentCurveExperimentDataPtr->phaseIndex; + } + Global::_currentCurveExperimentDataPtr->dataVtr.push_back(ed); Global::_currentCurveExperimentDataPtr->curve = _currentCurve; } @@ -387,16 +391,13 @@ void CentralWidget::slotAnalysisSettingApply() PointCalculate::setAnalysisData(totalDataVtr); -#if 0 - // Load smoothness data. - for(Global::CurveExperimentData& ced:Global::_curveSmoothnessDataVtr){ - if(ced.curve == _currentCurve){ - logde<<"load smoothness data."; - PointCalculate::setAnalysisData(ced.dataVtr); - break; + // display data + for(Global::ExperimentData ed:totalDataVtr){ + if(ed.phaseIndex != Global::PhaseIndexDefault){ + logde<<"find not equal phase index:" + <point1->coords().x(); @@ -1460,20 +1461,15 @@ void CentralWidget::loadAnalysisData( // QVector tickPositions = _customPlot->yAxis->tickVector(); - // qDebug() << "Y-axis tick positions:"; - // for (double pos : tickPositions) { - // qDebug() << pos; - // } double step = tickPositions.at(1) - tickPositions.at(0); // Global::ExperimentData ed = PointCalculate::findOnSetDataByTime(x1,x2); // Global::ExperimentData ed = PointCalculate::findOnSetDataByTemperature(x1,x2); - // PointCalculate::setRegionPointX(x1,x2); - Global::ExperimentData startData = PointCalculate::_dataVtr.first(); + Global::ExperimentData startData = PointCalculate::getOITStartData(x1,x2); // QPair // startEndDataPair = PointCalculate::calculateStartAndEndData();