From dc94e00d882fe5eceaa0ed86a5f04fe2cb283fd7 Mon Sep 17 00:00:00 2001 From: 123 <1239877983@qq.com> Date: Sun, 13 Apr 2025 16:15:54 +0800 Subject: [PATCH] 2025-04-13T16:15:53 --- src/.vscode/settings.json | 4 +++- src/data/xlsxhandler.cpp | 10 +++++----- src/data/xlsxhandler.h | 2 +- src/global.h | 5 +++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/.vscode/settings.json b/src/.vscode/settings.json index 3c02911..96d4ce0 100644 --- a/src/.vscode/settings.json +++ b/src/.vscode/settings.json @@ -3,6 +3,8 @@ "files.associations": { "array": "cpp", "string": "cpp", - "string_view": "cpp" + "string_view": "cpp", + "deque": "cpp", + "vector": "cpp" } } \ No newline at end of file diff --git a/src/data/xlsxhandler.cpp b/src/data/xlsxhandler.cpp index c66a778..21d646d 100644 --- a/src/data/xlsxhandler.cpp +++ b/src/data/xlsxhandler.cpp @@ -51,16 +51,16 @@ void XlsxHandler::readFile(const QString sourceFilePath) ei.operatorName = workSheet->cellAt(index++, 2)->value().toString(); ei.phaseSize = workSheet->cellAt(index++, 2)->value().toInt(); - QVector phaseVtr; + QVector phaseTotalVtr; for(int i = 0;i < ei.phaseSize;i++){ - Phase phase; - readPhaseData(workSheet,phase); - phaseVtr.push_back(phase); + PhaseTotalInfo phaseTotoal; + readPhaseData(workSheet,phaseTotoal); + phaseTotalVtr.push_back(phaseTotoal); } } -void XlsxHandler::readPhaseData(QXlsx::Worksheet *workSheet, Phase &phase) +void XlsxHandler::readPhaseData(QXlsx::Worksheet *workSheet,const int index, PhaseTotalInfo &phase) { const int startIndex = 9; #if 0 diff --git a/src/data/xlsxhandler.h b/src/data/xlsxhandler.h index 069b50c..111fce5 100644 --- a/src/data/xlsxhandler.h +++ b/src/data/xlsxhandler.h @@ -9,7 +9,7 @@ namespace XlsxHandler { void test(); void readFile(const QString filePath); - void readPhaseData(QXlsx::Worksheet*,Phase&); + void readPhaseData(QXlsx::Worksheet*,const int index,PhaseTotalInfo&); } #endif // XLSX_H diff --git a/src/global.h b/src/global.h index cd80afe..ac85952 100644 --- a/src/global.h +++ b/src/global.h @@ -53,6 +53,11 @@ public: QString operatorName; int phaseSize; }; + struct PhaseTotalInfo{ + int phaseIndex; + Phase phase; + QVector dataVtr; + }; QVector>> _curveDataVtr;