2025-06-18T11:14:54

This commit is contained in:
yuntang 2025-06-18 11:14:55 +08:00
parent 08c7f5147b
commit 4c578b169b
9 changed files with 95 additions and 26 deletions

Binary file not shown.

View File

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

View File

@ -925,3 +925,21 @@ Global::ExperimentData PointCalculate::findOnSetDataByTime(const double x1, cons
return resultEd; 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."<<ed.phaseIndex;
startEd = ed;
}
}else if (ed.runTime > x2){
break;
}
}
return startEd;
}

View File

@ -46,6 +46,7 @@ ExperimentData findEndSetDataByTemperature(const double x1,const double x2);
ExperimentData findOnSetDataByTime(const double x1,const double x2); ExperimentData findOnSetDataByTime(const double x1,const double x2);
ExperimentData getOITStartData(const double x1,const double x2);
// text format // text format
QString textFormatPeakPoint(const float enthalpyValue, QString textFormatPeakPoint(const float enthalpyValue,

View File

@ -79,13 +79,8 @@ int XlsxHandler::readFile(const QString filePath, Global::CurveFileData &cfd)
readPhaseData(workSheet, dataIndex, phaseTotal); readPhaseData(workSheet, dataIndex, phaseTotal);
phaseTotalVtr.push_back(phaseTotal); phaseTotalVtr.push_back(phaseTotal);
// print
// logde<<"index:"<<i<<",phase cut off temp:"<<phaseTotal.phase.cutoff_temp;
} }
// logde<<"index:"<<cfd.phaseTotalVtr.first().phaseIndex
// <<",phase cut off temp:"<<cfd.phaseTotalVtr.first().phase.cutoff_temp;
readAnalysisOperation(workSheet,dataIndex,cfd); readAnalysisOperation(workSheet,dataIndex,cfd);
return 0; return 0;
@ -99,7 +94,7 @@ void XlsxHandler::readPhaseData(QXlsx::Worksheet *workSheet, int &startLineIndex
// skip.第一段 // skip.第一段
startLineIndex++; startLineIndex++;
logde<<"startLineIndex:"<<startLineIndex; // logde<<"startLineIndex:"<<startLineIndex;
phaseTotal.phase.onoff = 1; phaseTotal.phase.onoff = 1;
phaseTotal.phase.cutoff_temp = workSheet->cellAt(startLineIndex++, 2)->value().toDouble(); phaseTotal.phase.cutoff_temp = workSheet->cellAt(startLineIndex++, 2)->value().toDouble();
@ -108,11 +103,15 @@ void XlsxHandler::readPhaseData(QXlsx::Worksheet *workSheet, int &startLineIndex
phaseTotal.phase.gas = static_cast<GasType>(workSheet->cellAt(startLineIndex++, 2)->value().toInt()); phaseTotal.phase.gas = static_cast<GasType>(workSheet->cellAt(startLineIndex++, 2)->value().toInt());
int dataSize = workSheet->cellAt(startLineIndex++, 2)->value().toInt(); int dataSize = workSheet->cellAt(startLineIndex++, 2)->value().toInt();
logde<<"data size:"<<dataSize; // logde<<"data size:"<<dataSize;
for(int i = 0; i < dataSize; i++) for(int i = 0; i < dataSize; i++)
{ {
Global::ExperimentData data; Global::ExperimentData data;
if(i == 0){
data.phaseIndex = phaseTotal.phaseIndex;
logde<<"read file,set phaseIndex:"<<data.phaseIndex;
}
data.runTime = workSheet->cellAt(startLineIndex, 2)->value().toDouble(); data.runTime = workSheet->cellAt(startLineIndex, 2)->value().toDouble();
data.sampleTemp = workSheet->cellAt(startLineIndex, 3)->value().toDouble(); data.sampleTemp = workSheet->cellAt(startLineIndex, 3)->value().toDouble();
data.dsc = workSheet->cellAt(startLineIndex, 4)->value().toDouble(); data.dsc = workSheet->cellAt(startLineIndex, 4)->value().toDouble();

View File

@ -17,6 +17,8 @@ const QString AnalysisStateFolder = ExperimentDirPath + "/analysis_state";
const QString CurveOfTimeTypeObjectName("curve_time"); const QString CurveOfTimeTypeObjectName("curve_time");
const int PhaseIndexDefault = -1;
// json string. // json string.
const QString AtomsphereData("atomsphereData"); const QString AtomsphereData("atomsphereData");
const QString SampleData("sampleData"); const QString SampleData("sampleData");
@ -68,6 +70,15 @@ struct ExperimentData {
float constantTempTime; float constantTempTime;
float sampleTemp; float sampleTemp;
float dsc; float dsc;
int phaseIndex;
ExperimentData()
:runTime(0.0)
,constantTempTime(0.0)
,sampleTemp(0.0)
,dsc(0.0)
,phaseIndex(PhaseIndexDefault)
{}
}; };
enum TestType{ enum TestType{
@ -98,7 +109,6 @@ struct PhaseTotalInfo{
}; };
struct CurveFileData{ struct CurveFileData{
// QString fileName;
QString filePath; QString filePath;
Global::ExperimentInfo ei; Global::ExperimentInfo ei;
QVector<Global::PhaseTotalInfo> phaseTotalVtr; QVector<Global::PhaseTotalInfo> phaseTotalVtr;
@ -106,10 +116,15 @@ struct CurveFileData{
}; };
struct CurveExperimentData{ struct CurveExperimentData{
int phaseIndex; // from 1 to 6.
QCPCurve * curve; QCPCurve * curve;
QString fileName; // discard QString fileName; // discard
QVector<Global::ExperimentData> dataVtr; QVector<Global::ExperimentData> dataVtr;
QVector<ExperimentData> smoothDataVtr; QVector<ExperimentData> smoothDataVtr;
CurveExperimentData()
:phaseIndex(PhaseIndexDefault)
,curve(nullptr){}
}; };
// Soft mode. // Soft mode.

View File

@ -162,9 +162,11 @@ void SerialPort::updateStatus(const CommonData &cd)
Global::_currentPhase = (int)cd.current_phase; Global::_currentPhase = (int)cd.current_phase;
Global::CurveExperimentData ced; Global::CurveExperimentData ced;
ced.phaseIndex = cd.current_phase;
Global::_curveExperimentDataVtr.push_back(ced); Global::_curveExperimentDataVtr.push_back(ced);
Global::_currentCurveExperimentDataPtr = &Global::_curveExperimentDataVtr.last(); Global::_currentCurveExperimentDataPtr =
&Global::_curveExperimentDataVtr.last();
Global::_currentCurveExperimentDataPtr->fileName = Global::_currentCurveExperimentDataPtr->fileName =
Global::_experimentInfo.sampleName; Global::_experimentInfo.sampleName;

View File

@ -280,11 +280,15 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd)
exit(0); exit(0);
}else{ }else{
Global::ExperimentData ed; Global::ExperimentData ed;
ed.dsc = cd .dsc; ed.dsc = cd .dsc;
ed.sampleTemp = cd.sample_temp; ed.sampleTemp = cd.sample_temp;
ed.runTime = cd.add_run_time; ed.runTime = cd.add_run_time;
ed.constantTempTime = cd.add_constan_temp_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->dataVtr.push_back(ed);
Global::_currentCurveExperimentDataPtr->curve = _currentCurve; Global::_currentCurveExperimentDataPtr->curve = _currentCurve;
} }
@ -387,16 +391,13 @@ void CentralWidget::slotAnalysisSettingApply()
PointCalculate::setAnalysisData(totalDataVtr); PointCalculate::setAnalysisData(totalDataVtr);
#if 0 // display data
// Load smoothness data. for(Global::ExperimentData ed:totalDataVtr){
for(Global::CurveExperimentData& ced:Global::_curveSmoothnessDataVtr){ if(ed.phaseIndex != Global::PhaseIndexDefault){
if(ced.curve == _currentCurve){ logde<<"find not equal phase index:"
logde<<"load smoothness data."; <<ed.phaseIndex;
PointCalculate::setAnalysisData(ced.dataVtr);
break;
} }
} }
#endif
// //
double x1 = _line1->point1->coords().x(); double x1 = _line1->point1->coords().x();
@ -1460,20 +1461,15 @@ void CentralWidget::loadAnalysisData(
// //
QVector<double> tickPositions = _customPlot->yAxis->tickVector(); QVector<double> tickPositions = _customPlot->yAxis->tickVector();
// qDebug() << "Y-axis tick positions:";
// for (double pos : tickPositions) {
// qDebug() << pos;
// }
double step = tickPositions.at(1) - tickPositions.at(0); double step = tickPositions.at(1) - tickPositions.at(0);
// //
Global::ExperimentData ed = PointCalculate::findOnSetDataByTime(x1,x2); Global::ExperimentData ed = PointCalculate::findOnSetDataByTime(x1,x2);
// Global::ExperimentData ed = PointCalculate::findOnSetDataByTemperature(x1,x2); // Global::ExperimentData ed = PointCalculate::findOnSetDataByTemperature(x1,x2);
// PointCalculate::setRegionPointX(x1,x2); // PointCalculate::setRegionPointX(x1,x2);
Global::ExperimentData startData = PointCalculate::_dataVtr.first(); Global::ExperimentData startData = PointCalculate::getOITStartData(x1,x2);
// QPair<Global::ExperimentData,Global::ExperimentData> // QPair<Global::ExperimentData,Global::ExperimentData>
// startEndDataPair = PointCalculate::calculateStartAndEndData(); // startEndDataPair = PointCalculate::calculateStartAndEndData();