2025-06-17T10:48:14
This commit is contained in:
parent
ea533c0fff
commit
bfbf12cf2e
BIN
experiment_data/analysis_state/617-new.xlsx
Normal file
BIN
experiment_data/analysis_state/617-new.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/6172-new.xlsx
Normal file
BIN
experiment_data/analysis_state/6172-new.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/~$617-new.xlsx
Normal file
BIN
experiment_data/analysis_state/~$617-new.xlsx
Normal file
Binary file not shown.
BIN
experiment_data/analysis_state/~$6172-new.xlsx
Normal file
BIN
experiment_data/analysis_state/~$6172-new.xlsx
Normal file
Binary file not shown.
@ -44,7 +44,7 @@ int XlsxHandler::readFile(const QString filePath, Global::CurveFileData &cfd)
|
|||||||
|
|
||||||
_currentFilePath = filePath;
|
_currentFilePath = filePath;
|
||||||
|
|
||||||
// cfd.fileName = fileInfo.fileName();
|
// cfd.fileName = fileInfo.fileName();
|
||||||
cfd.filePath = filePath;
|
cfd.filePath = filePath;
|
||||||
|
|
||||||
QXlsx::Document xlsx(filePath);
|
QXlsx::Document xlsx(filePath);
|
||||||
@ -307,6 +307,7 @@ void XlsxHandler:: xlsxFileAppendAnalysisOperation(const QString filePath)
|
|||||||
logde << "current sheet is empty.";
|
logde << "current sheet is empty.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int index = sheet->dimension().lastRow();
|
int index = sheet->dimension().lastRow();
|
||||||
logde<<"lastRow:"<<index;
|
logde<<"lastRow:"<<index;
|
||||||
|
|
||||||
@ -655,6 +656,9 @@ void XlsxHandler::writeXlsxFile(const QString filePath)
|
|||||||
QVector<Global::PhaseTotalInfo>& phaseVtr =
|
QVector<Global::PhaseTotalInfo>& phaseVtr =
|
||||||
Global::_curveFileDataVtr.first().phaseTotalVtr;
|
Global::_curveFileDataVtr.first().phaseTotalVtr;
|
||||||
|
|
||||||
|
writeSmoothnessFile(filePath);
|
||||||
|
|
||||||
|
#if 0
|
||||||
if(phaseVtr.first().smoothDataVtr.empty()){
|
if(phaseVtr.first().smoothDataVtr.empty()){
|
||||||
logde<<"xlsx file data smooth vtr is empty.";
|
logde<<"xlsx file data smooth vtr is empty.";
|
||||||
xlsxFileAppendAnalysisOperation(filePath);
|
xlsxFileAppendAnalysisOperation(filePath);
|
||||||
@ -662,4 +666,38 @@ void XlsxHandler::writeXlsxFile(const QString filePath)
|
|||||||
logde<<"xlsx file data smooth vtr is not empty.";
|
logde<<"xlsx file data smooth vtr is not empty.";
|
||||||
writeSmoothnessFile(filePath);
|
writeSmoothnessFile(filePath);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int XlsxHandler::deleteInvalidRow(QXlsx::Document *doc)
|
||||||
|
{
|
||||||
|
QXlsx::Worksheet *sheet = doc->currentWorksheet();
|
||||||
|
if(!sheet)
|
||||||
|
{
|
||||||
|
logde << "current sheet is empty.";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int lastRow = doc->dimension().lastRow();
|
||||||
|
logde<<"lastRow:"<<lastRow;
|
||||||
|
|
||||||
|
int startRow = lastRow - 19; // 倒数第20行
|
||||||
|
|
||||||
|
for (int row = lastRow; row >= startRow; --row) {
|
||||||
|
QString cellValue = sheet->read(row, 0).toString();
|
||||||
|
if (cellValue.isEmpty()
|
||||||
|
|| cellValue == ConAnalysisOperationCount
|
||||||
|
|| cellValue == AnaOpRecorder::NumericalLabelStr
|
||||||
|
|| cellValue == AnaOpRecorder::StartPointStr
|
||||||
|
|| cellValue == AnaOpRecorder::StopPointStr
|
||||||
|
|| cellValue == AnaOpRecorder::PeakSynthesisAnalysisStr
|
||||||
|
|| cellValue == AnaOpRecorder::GlassTransitionStr
|
||||||
|
|| cellValue == AnaOpRecorder::OnsetTemperaturePointStr
|
||||||
|
|| cellValue == AnaOpRecorder::EndsetTemperaturePointStr
|
||||||
|
) {
|
||||||
|
qDebug() << "Row" << row << "is empty or contains specified string. Deleting row.";
|
||||||
|
// sheet->deleteRows(row, 1); // 删除当前行
|
||||||
|
// sheet->deleteRow(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,9 @@ namespace XlsxHandler {
|
|||||||
|
|
||||||
void writeAnalysisOperationDetail(QXlsx::Document*doc,const int row);
|
void writeAnalysisOperationDetail(QXlsx::Document*doc,const int row);
|
||||||
|
|
||||||
|
// discard
|
||||||
|
int deleteInvalidRow(QXlsx::Document*doc);
|
||||||
|
|
||||||
extern QString _currentFilePath;
|
extern QString _currentFilePath;
|
||||||
|
|
||||||
const QString ConUnitMg = "mg";
|
const QString ConUnitMg = "mg";
|
||||||
|
|||||||
@ -574,14 +574,14 @@ void CentralWidget::uiLoadXlsxFileData()
|
|||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
// Load xlsx file data.
|
// Load xlsx file data.
|
||||||
|
QVector<ExperimentData> allDataVtr;
|
||||||
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
for(Global::CurveFileData& cfd:Global::_curveFileDataVtr){
|
||||||
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
for(int i = 0;i < cfd.phaseTotalVtr.size();i++){
|
||||||
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
Global::PhaseTotalInfo& pti = cfd.phaseTotalVtr[i];
|
||||||
|
|
||||||
PointCalculate::setAnalysisData(pti.dataVtr);
|
allDataVtr.append(pti.dataVtr);
|
||||||
|
|
||||||
// Load data.
|
// Load data.
|
||||||
QVector<Global::ExperimentData> dataVtr;
|
|
||||||
QVector<double> tVtr,xVtr, yVtr;
|
QVector<double> tVtr,xVtr, yVtr;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
for (Global::ExperimentData &ed : pti.dataVtr)
|
for (Global::ExperimentData &ed : pti.dataVtr)
|
||||||
@ -624,6 +624,8 @@ void CentralWidget::uiLoadXlsxFileData()
|
|||||||
pti.curve = _currentCurve;
|
pti.curve = _currentCurve;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PointCalculate::setAnalysisData(allDataVtr);
|
||||||
|
|
||||||
// Add analysis operation data.
|
// Add analysis operation data.
|
||||||
if(cfd.analysisOperationVtr.size() > 0){
|
if(cfd.analysisOperationVtr.size() > 0){
|
||||||
for(AnaOpRecorder::AnalysisOperation& ao
|
for(AnaOpRecorder::AnalysisOperation& ao
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user