From e3117d66876f692422002dddd455b53894d62556 Mon Sep 17 00:00:00 2001 From: brige Date: Sun, 2 Nov 2025 00:03:18 +0800 Subject: [PATCH] delete unuse files --- test_chart_parsing.cpp | 129 ----------------------------------------- test_workspace.xml | 45 -------------- 2 files changed, 174 deletions(-) delete mode 100644 test_chart_parsing.cpp delete mode 100644 test_workspace.xml diff --git a/test_chart_parsing.cpp b/test_chart_parsing.cpp deleted file mode 100644 index f67d5917..00000000 --- a/test_chart_parsing.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include -#include -#include -#include "workspace/WorkSpaceXMLParse.h" -#include "common/ChartData.h" - -void printChartData(const std::shared_ptr& chartData) { - if (!chartData) { - std::cout << " Chart data is null" << std::endl; - return; - } - - std::cout << " Chart Name: " << chartData->name.toStdString() << std::endl; - std::cout << " Chart Path: " << chartData->path.toStdString() << std::endl; - - // Handle different chart types - if (auto curveChart = std::dynamic_pointer_cast(chartData)) { - std::cout << " Chart Type: Curve" << std::endl; - std::cout << " X Title: " << curveChart->xTitle.toStdString() << std::endl; - std::cout << " Y Title: " << curveChart->yTitle.toStdString() << std::endl; - std::cout << " X Range: [" << curveChart->xMin << " - " << curveChart->xMax << "]" << std::endl; - std::cout << " Y Range: [" << curveChart->yMin << " - " << curveChart->yMax << "]" << std::endl; - std::cout << " X Count: " << curveChart->xCount << std::endl; - std::cout << " Time: " << curveChart->t << std::endl; - std::cout << " Curves (" << curveChart->curves.size() << "):" << std::endl; - - for (const auto& curve : curveChart->curves) { - std::cout << " - Name: " << curve.name.toStdString() - << ", Range: [" << curve.start << " - " << curve.stop << "]" - << ", Color: " << curve.color.toStdString() << std::endl; - } - - } else if (auto surfaceChart = std::dynamic_pointer_cast(chartData)) { - std::cout << " Chart Type: Surface" << std::endl; - std::cout << " X Title: " << surfaceChart->xTitle.toStdString() << std::endl; - std::cout << " Y Title: " << surfaceChart->yTitle.toStdString() << std::endl; - std::cout << " Z Title: " << surfaceChart->zTitle.toStdString() << std::endl; - std::cout << " X Range: [" << surfaceChart->xMin << " - " << surfaceChart->xMax << "]" << std::endl; - std::cout << " Y Range: [" << surfaceChart->yMin << " - " << surfaceChart->yMax << "]" << std::endl; - std::cout << " Z Range: [" << surfaceChart->zMin << " - " << surfaceChart->zMax << "]" << std::endl; - std::cout << " X Count: " << surfaceChart->xCount << std::endl; - std::cout << " Y Count: " << surfaceChart->yCount << std::endl; - std::cout << " Z Count: " << surfaceChart->zCount << std::endl; - std::cout << " Time: " << surfaceChart->t << std::endl; - std::cout << " Surface Curves (" << surfaceChart->curves.size() << "):" << std::endl; - - for (const auto& curve : surfaceChart->curves) { - std::cout << " - Name: " << curve.name.toStdString() - << ", Range: [" << curve.start << " - " << curve.stop << "]" - << ", Color: " << curve.color.toStdString() - << ", Position: (" << curve.x << "," << curve.y << "," << curve.z << ")" << std::endl; - } - - } else if (auto tableChart = std::dynamic_pointer_cast(chartData)) { - std::cout << " Chart Type: Table" << std::endl; - std::cout << " Head: " << tableChart->head.toStdString() << std::endl; - std::cout << " Time: " << tableChart->t << std::endl; - std::cout << " Table Data (" << tableChart->curves.size() << "):" << std::endl; - - for (const auto& curve : tableChart->curves) { - std::cout << " - Name: " << curve.name.toStdString() - << ", Color: " << curve.color.toStdString() - << ", Data: " << curve.data.toStdString() << std::endl; - } - - } else if (auto lightChart = std::dynamic_pointer_cast(chartData)) { - std::cout << " Chart Type: Light" << std::endl; - std::cout << " Open Color: " << lightChart->openColor.toStdString() << std::endl; - std::cout << " Close Color: " << lightChart->closeColor.toStdString() << std::endl; - std::cout << " Time: " << lightChart->t << std::endl; - std::cout << " Light Data (" << lightChart->curves.size() << "):" << std::endl; - - for (const auto& curve : lightChart->curves) { - std::cout << " - Name: " << curve.name.toStdString() - << ", Data: " << curve.data.toStdString() << std::endl; - } - } else { - std::cout << " Chart Type: Unknown" << std::endl; - } -} - -int main(int argc, char *argv[]) -{ - QApplication app(argc, argv); - - std::cout << "Testing XML Chart Parsing with New Inheritance Structure..." << std::endl; - - // Test XML file path - QString xmlFilePath = "test_workspace.xml"; - - // Create parser instance - WorkSpaceXMLParse parser; - - // Parse the XML file - FileTypeData fileData; - bool success = parser.ParseFiles(xmlFilePath, fileData); - - if (!success) { - std::cout << "Failed to parse XML file: " << xmlFilePath.toStdString() << std::endl; - return -1; - } - - std::cout << "Successfully parsed XML file!" << std::endl; - std::cout << "=== File Type Data ===" << std::endl; - std::cout << "Files count: " << fileData.files.size() << std::endl; - std::cout << "Charts count: " << fileData.charts.size() << std::endl; - - // Print file information - std::cout << "\n=== Files ===" << std::endl; - for (int i = 0; i < fileData.files.size(); ++i) { - const auto& file = fileData.files[i]; - std::cout << "File " << i << ":" << std::endl; - std::cout << " Name: " << file.name.toStdString() << std::endl; - std::cout << " Path: " << file.path.toStdString() << std::endl; - std::cout << " Type: " << static_cast(file.type) << std::endl; - } - - // Print chart information - std::cout << "\n=== Charts ===" << std::endl; - for (int i = 0; i < fileData.charts.size(); ++i) { - std::cout << "Chart " << i << ":" << std::endl; - printChartData(fileData.charts[i]); - std::cout << std::endl; - } - - std::cout << "Test completed successfully!" << std::endl; - - return 0; -} \ No newline at end of file diff --git a/test_workspace.xml b/test_workspace.xml deleted file mode 100644 index 4bf37e07..00000000 --- a/test_workspace.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file