delete unuse files
This commit is contained in:
parent
596d60f6bc
commit
e3117d6687
@ -1,129 +0,0 @@
|
|||||||
#include <QApplication>
|
|
||||||
#include <QDebug>
|
|
||||||
#include <iostream>
|
|
||||||
#include "workspace/WorkSpaceXMLParse.h"
|
|
||||||
#include "common/ChartData.h"
|
|
||||||
|
|
||||||
void printChartData(const std::shared_ptr<BaseChartData>& 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<CurveChartData>(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<SurfaceChartData>(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<TableChartData>(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<LightChartData>(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<int>(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;
|
|
||||||
}
|
|
||||||
@ -1,45 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<scene name="test_chart" describe="测试图表解析" uuid="{test-uuid}" viewpoint="120.000000, 25.000000, 100.000000, 0.000000, -90.000000, 8200000.000000" commondPath="">
|
|
||||||
<charts>
|
|
||||||
<Wave file="D:/Project/DYTSrouce/bin/Release/workspace/test/Wave.txt"/>
|
|
||||||
<Report Report="D:/Project/DYTSrouce/bin/Release/workspace/test/Report.txt"/>
|
|
||||||
<RD RD="D:/Project/DYTSrouce/bin/Release/workspace/test/RD.txt"/>
|
|
||||||
<SimMatlab SimMatlab=""/>
|
|
||||||
</charts>
|
|
||||||
<timestep path="Timestep.txt"/>
|
|
||||||
<lamp path="D:/Project/DYTSrouce/bin/Release/workspace/test/Lamp.txt"/>
|
|
||||||
<commond path="command.xml"/>
|
|
||||||
<files>
|
|
||||||
<type name="curve" count="2">
|
|
||||||
<chart name="测试曲线1" path="Wave.txt" xTitle="时间" yTitle="幅度" xMin="0" xMax="250" xCount="6" yMin="-800" yMax="800" t="0">
|
|
||||||
<curve name="曲线1" color="255,0,0" start="1" stop="241"/>
|
|
||||||
<curve name="曲线2" color="0,255,0" start="50" stop="200"/>
|
|
||||||
</chart>
|
|
||||||
<chart name="测试曲线2" path="Wave2.txt" xTitle="频率" yTitle="功率" xMin="0" xMax="100" xCount="5" yMin="0" yMax="1000" t="0">
|
|
||||||
<curve name="功率曲线" color="0,0,255" start="1" stop="100"/>
|
|
||||||
</chart>
|
|
||||||
</type>
|
|
||||||
<type name="surface" count="1">
|
|
||||||
<Chart Name="RD图" path="RD.txt" xTitle="y" yTitle="z" zTitle="x" xMin="0" xMax="14000" xCount="7" yMin="0" yMax="0" yCount="0" zMin="0" zMax="70" zCount="7" t="0">
|
|
||||||
<curve Name="RD曲面" Color="61,38,168" Start="0" Stop="0" x="y" y="z" z="x"/>
|
|
||||||
</Chart>
|
|
||||||
</type>
|
|
||||||
<type name="table" count="1">
|
|
||||||
<chart Name="测试表格" path="Report.txt" head="编号,信噪比,方位瞄准线,俯仰注视角,方位,俯仰,属性,多普勒,航线,速度,经度,纬度,距离,速率,径向尺寸,目标RCS" t="0">
|
|
||||||
<curve Name="目标1" color="" data="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16"/>
|
|
||||||
</chart>
|
|
||||||
</type>
|
|
||||||
<type name="light" count="1">
|
|
||||||
<chart name="信号灯" path="Lamp.txt" openColor="0,255,0" closeColor="255,0,0" t="0">
|
|
||||||
<curve name="目标1,目标2,目标3" data="1,2,3"/>
|
|
||||||
</chart>
|
|
||||||
</type>
|
|
||||||
</files>
|
|
||||||
<entities>
|
|
||||||
<Entity uuid="{test-entity-uuid}" name="test_entity">
|
|
||||||
<MeshComponent mesh="test/test.ive" location="0.000000,0.000000,0.000000" rotation="0.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" uuid="{test-mesh-uuid}">
|
|
||||||
<LabelComponent text="test_entity" fontSize="26" visible="true" color="1.00,0.00,0.00,1.00" location="0.000000,0.000000,0.000000" rotation="0.000000,0.000000,0.000000" scale="1.000000,1.000000,1.000000" uuid="{test-label-uuid}"/>
|
|
||||||
</MeshComponent>
|
|
||||||
</Entity>
|
|
||||||
</entities>
|
|
||||||
</scene>
|
|
||||||
Loading…
Reference in New Issue
Block a user