Compare commits
No commits in common. "87091abf121b1f9c812e742b599df00cb91e5e7e" and "e693562387983d1cc6252740eac3af598c573b3b" have entirely different histories.
87091abf12
...
e693562387
@ -1440,14 +1440,6 @@
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FitCurve</name>
|
||||
<message>
|
||||
<location filename="../ui/Panel/FitCurve.ui" line="14"/>
|
||||
<source>FitCurveDialog</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FitCurveChartView</name>
|
||||
<message>
|
||||
|
||||
@ -220,7 +220,7 @@ void MainWindow::InitUI() {
|
||||
// Restore previous UI layout if available
|
||||
UiLayoutManager::Restore(this, 1);
|
||||
|
||||
//InitChartLayout();
|
||||
InitChartLayout();
|
||||
|
||||
//ui->viewWidget->layout()->addWidget(qtOsgViewWidget_);
|
||||
qtOsgViewWidget_->LoadDefaultScene();
|
||||
|
||||
@ -10,17 +10,10 @@
|
||||
#include <QCheckBox>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
#include "ui_FitCurve.h"
|
||||
|
||||
CurvePanel::CurvePanel(int index, const QString& filePath, QWidget* parent)
|
||||
: DataPanel(index, FileEntryType::Curve, filePath, parent)
|
||||
, hasChartData_(false)
|
||||
{
|
||||
m_iXMin = 0;
|
||||
m_iXMax = 0;
|
||||
m_iYMax = 0;
|
||||
m_iYMin = 0;
|
||||
|
||||
LOG_INFO("Created CurvePanel {} for file: {}", index, filePath.toStdString());
|
||||
}
|
||||
|
||||
@ -305,23 +298,22 @@ void CurvePanel::UpdateCurveDisplay()
|
||||
|
||||
void CurvePanel::InitUI()
|
||||
{
|
||||
initQChartView();
|
||||
//if (hasChartData_) {
|
||||
// UpdateCurveDisplay();
|
||||
//} else {
|
||||
// // Create basic layout for file-based panel
|
||||
// QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
//
|
||||
// // Add placeholder label showing panel information
|
||||
// QLabel* infoLabel = new QLabel(QString("Curve Panel %1\nFile: %2\n\nCurve Drawing Area\nPlease inherit this class to implement specific drawing functionality")
|
||||
// .arg(GetIndex())
|
||||
// .arg(QFileInfo(GetFilePath()).fileName()));
|
||||
// infoLabel->setAlignment(Qt::AlignCenter);
|
||||
// infoLabel->setStyleSheet("QLabel { color: #666; font-size: 12px; padding: 20px; }");
|
||||
//
|
||||
// layout->addWidget(infoLabel);
|
||||
// setLayout(layout);
|
||||
//}
|
||||
if (hasChartData_) {
|
||||
UpdateCurveDisplay();
|
||||
} else {
|
||||
// Create basic layout for file-based panel
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
|
||||
// Add placeholder label showing panel information
|
||||
QLabel* infoLabel = new QLabel(QString("Curve Panel %1\nFile: %2\n\nCurve Drawing Area\nPlease inherit this class to implement specific drawing functionality")
|
||||
.arg(GetIndex())
|
||||
.arg(QFileInfo(GetFilePath()).fileName()));
|
||||
infoLabel->setAlignment(Qt::AlignCenter);
|
||||
infoLabel->setStyleSheet("QLabel { color: #666; font-size: 12px; padding: 20px; }");
|
||||
|
||||
layout->addWidget(infoLabel);
|
||||
setLayout(layout);
|
||||
}
|
||||
}
|
||||
|
||||
QString CurvePanel::GetTypeDisplayName() const
|
||||
@ -329,31 +321,5 @@ QString CurvePanel::GetTypeDisplayName() const
|
||||
return "Curve";
|
||||
}
|
||||
|
||||
void CurvePanel::initQChartView() {
|
||||
curveChartView = new FitCurveChartView(this);
|
||||
//curveChartView->setMaximumWidth(1730);
|
||||
//curveChartView->setMinimumHeight(480);
|
||||
|
||||
curveChart = new QChart();
|
||||
curveChart->setTheme(QChart::ChartThemeBlueIcy);
|
||||
curveChart->setBackgroundRoundness(0);
|
||||
curveChartView->setChart(curveChart);
|
||||
|
||||
m_pAxisX = new QValueAxis;
|
||||
m_pAxisX->setRange(0, 10);
|
||||
m_pAxisX->setLabelsAngle(-90);
|
||||
curveChart->addAxis(m_pAxisX, Qt::AlignBottom);
|
||||
|
||||
m_pAxisY = new QValueAxis;
|
||||
m_pAxisY->setRange(0, 10);
|
||||
curveChart->addAxis(m_pAxisY, Qt::AlignLeft);
|
||||
|
||||
curveChartView->setRenderHint(QPainter::Antialiasing);
|
||||
|
||||
QHBoxLayout* pLayout = new QHBoxLayout(this);
|
||||
pLayout->addWidget(curveChartView);
|
||||
}
|
||||
|
||||
void CurvePanel::OnDataPanelUpdated(FileEntryCurve* fileEntry) {
|
||||
int a = 0;
|
||||
}
|
||||
|
||||
@ -4,11 +4,7 @@
|
||||
#include "workspace/ChartData.h"
|
||||
#include "workspace/FileEntry.h"
|
||||
#include <memory>
|
||||
#include "ui/chartPlot/FitCurveChartView.h"
|
||||
|
||||
namespace Ui {
|
||||
class FitCurve;
|
||||
}
|
||||
/**
|
||||
* @file CurvePanel.h
|
||||
* @brief Curve Panel Class
|
||||
@ -72,7 +68,7 @@ protected:
|
||||
/**
|
||||
* @brief Initialize UI for curve-specific layout
|
||||
*/
|
||||
virtual void InitUI();
|
||||
void InitUI() override;
|
||||
|
||||
/**
|
||||
* @brief Get type display name
|
||||
@ -80,9 +76,6 @@ protected:
|
||||
*/
|
||||
QString GetTypeDisplayName() const override;
|
||||
|
||||
|
||||
void initQChartView();
|
||||
|
||||
void OnDataPanelUpdated(FileEntryCurve* fileEntry);
|
||||
|
||||
private:
|
||||
@ -94,23 +87,4 @@ private:
|
||||
private:
|
||||
std::shared_ptr<BaseChartData> chartData_; // Chart data containing curve information
|
||||
bool hasChartData_; // Flag indicating if chart data is available
|
||||
|
||||
Ui::FitCurve* ui;
|
||||
FitCurveChartView* curveChartView;
|
||||
QChart* curveChart;
|
||||
|
||||
bool isPressed = false;
|
||||
QPoint pressedPoint;
|
||||
|
||||
QValueAxis* m_pAxisX = NULL;
|
||||
QValueAxis* m_pAxisY = NULL;
|
||||
float m_iXMax;
|
||||
float m_iXMin;
|
||||
float m_iYMax;
|
||||
float m_iYMin;
|
||||
|
||||
QMap<int, QSplineSeries*> m_seriesIDMap;
|
||||
|
||||
QMap< double, QMap<int, QVariantList> > m_dataWava;
|
||||
QMap< double, QMap<int, QPointF> > m_dataReport;
|
||||
};
|
||||
@ -16,7 +16,7 @@ DataPanel::DataPanel(int index, FileEntryType fileType, const QString& filePath,
|
||||
, dockWidget_(nullptr)
|
||||
{
|
||||
title_ = GenerateTitle();
|
||||
//InitUI();
|
||||
InitUI();
|
||||
|
||||
LOG_INFO("Created DataPanel {} for {} file: {}", index_, FileEntryTypeToString(fileType_), filePath_.toStdString());
|
||||
}
|
||||
|
||||
@ -80,10 +80,7 @@ public:
|
||||
* @brief Refresh panel content (virtual function, implemented by derived classes)
|
||||
*/
|
||||
virtual void RefreshPanel() {}
|
||||
/**
|
||||
* @brief Initialize UI (virtual function, derived classes implement specific layout)
|
||||
*/
|
||||
virtual void InitUI();
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Panel close signal
|
||||
@ -97,7 +94,10 @@ protected:
|
||||
*/
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialize UI (virtual function, derived classes implement specific layout)
|
||||
*/
|
||||
virtual void InitUI();
|
||||
|
||||
/**
|
||||
* @brief Generate panel title
|
||||
|
||||
@ -193,8 +193,6 @@ DataPanel* DataPanelManager::CreateDataPanel(FileEntryType fileType, const QStri
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//panel->InitUI();
|
||||
|
||||
auto fileEntries = currentWorkspace_->GetFileEntries(fileType);
|
||||
if (index < fileEntries.size()) {
|
||||
panel->SetFileEntry(fileEntries[index]);
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>FitCurve</class>
|
||||
<widget class="QDialog" name="FitCurve">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>977</width>
|
||||
<height>703</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>FitCurveDialog</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>70</x>
|
||||
<y>40</y>
|
||||
<width>851</width>
|
||||
<height>621</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="chartLayout"/>
|
||||
</widget>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@ -107,25 +107,6 @@ void TargetListWgt::updateParseFile(const QString & strFile, int nT, QVariantLis
|
||||
double t = listLine.at(nT).toDouble();
|
||||
|
||||
QMap<int, QVariantList> mapData;
|
||||
if (listCurve.size() == 0)
|
||||
{
|
||||
int nCount = ui.tableWidget->columnCount();
|
||||
int nRow = (listLine.size() - 1) / nCount;
|
||||
for (int nI = 0; nI < nRow; nI++)
|
||||
{
|
||||
int nBegin = nT + 1 + nI * nCount;
|
||||
QVariantList varList;
|
||||
for (int nJ = 0; nJ < nCount; nJ++)
|
||||
{
|
||||
int nIndex = nBegin + nJ;
|
||||
double data = listLine.at(nIndex).toDouble();
|
||||
varList.push_back(data);
|
||||
}
|
||||
mapData.insert(nI, varList);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int nI = 0; nI < listCurve.size(); nI++)
|
||||
{
|
||||
QVariantMap mapCurve = listCurve.at(nI).toMap();
|
||||
@ -141,8 +122,6 @@ void TargetListWgt::updateParseFile(const QString & strFile, int nT, QVariantLis
|
||||
}
|
||||
mapData.insert(nI, varList);
|
||||
}
|
||||
}
|
||||
|
||||
m_dataTable.insert(t, mapData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,18 +19,8 @@ struct CurveColorData : public BaseCurveData {
|
||||
};
|
||||
|
||||
struct CurveData : public CurveColorData {
|
||||
int start;
|
||||
int stop;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
CurveData()
|
||||
{
|
||||
start = 0;
|
||||
stop = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
double start;
|
||||
double stop;
|
||||
};
|
||||
|
||||
struct TableCurveData : public CurveColorData {
|
||||
@ -69,7 +59,6 @@ public:
|
||||
double yMin;
|
||||
double yMax;
|
||||
int xCount;
|
||||
int yCount;
|
||||
QList<CurveData> curves;
|
||||
|
||||
FileEntryType getType() const override { return FileEntryType::Curve; }
|
||||
|
||||
@ -133,37 +133,34 @@ bool WorkSpaceXMLParse::ParseFiles(const tinyxml2::XMLElement* element) {
|
||||
|
||||
// Parse curve-specific attributes
|
||||
if (const char* chartName = chartElement->Attribute("name")) {
|
||||
curveChart->name = QString(chartName);
|
||||
curveChart->name = QString::fromLocal8Bit(chartName);
|
||||
}
|
||||
if (const char* path = chartElement->Attribute("path")) {
|
||||
curveChart->path = QString(path);
|
||||
curveChart->path = QString::fromLocal8Bit(path);
|
||||
}
|
||||
if (const char* xTitle = chartElement->Attribute("xTitle")) {
|
||||
curveChart->xTitle = QString(xTitle);
|
||||
curveChart->xTitle = QString::fromLocal8Bit(xTitle);
|
||||
}
|
||||
if (const char* yTitle = chartElement->Attribute("yTitle")) {
|
||||
curveChart->yTitle = QString(yTitle);
|
||||
curveChart->yTitle = QString::fromLocal8Bit(yTitle);
|
||||
}
|
||||
if (const char* xMin = chartElement->Attribute("xMin")) {
|
||||
curveChart->xMin = QString(xMin).toDouble();
|
||||
curveChart->xMin = QString::fromLocal8Bit(xMin).toDouble();
|
||||
}
|
||||
if (const char* xMax = chartElement->Attribute("xMax")) {
|
||||
curveChart->xMax = QString(xMax).toDouble();
|
||||
curveChart->xMax = QString::fromLocal8Bit(xMax).toDouble();
|
||||
}
|
||||
if (const char* yMin = chartElement->Attribute("yMin")) {
|
||||
curveChart->yMin = QString(yMin).toDouble();
|
||||
curveChart->yMin = QString::fromLocal8Bit(yMin).toDouble();
|
||||
}
|
||||
if (const char* yMax = chartElement->Attribute("yMax")) {
|
||||
curveChart->yMax = QString(yMax).toDouble();
|
||||
curveChart->yMax = QString::fromLocal8Bit(yMax).toDouble();
|
||||
}
|
||||
if (const char* xCount = chartElement->Attribute("xCount")) {
|
||||
curveChart->xCount = QString(xCount).toInt();
|
||||
}
|
||||
if (const char* yCount = chartElement->Attribute("yCount")) {
|
||||
curveChart->yCount = QString(yCount).toInt();
|
||||
curveChart->xCount = QString::fromLocal8Bit(xCount).toInt();
|
||||
}
|
||||
if (const char* t = chartElement->Attribute("t")) {
|
||||
curveChart->t = QString(t);
|
||||
curveChart->t = QString::fromLocal8Bit(t);
|
||||
}
|
||||
|
||||
// Parse curve elements
|
||||
@ -172,22 +169,16 @@ bool WorkSpaceXMLParse::ParseFiles(const tinyxml2::XMLElement* element) {
|
||||
CurveData curveData;
|
||||
|
||||
if (const char* curveName = curveElement->Attribute("name")) {
|
||||
curveData.name = QString(curveName);
|
||||
curveData.name = QString::fromLocal8Bit(curveName);
|
||||
}
|
||||
if (const char* color = curveElement->Attribute("color")) {
|
||||
curveData.color = QString(color);
|
||||
curveData.color = QString::fromLocal8Bit(color);
|
||||
}
|
||||
if (const char* start = curveElement->Attribute("start")) {
|
||||
curveData.start = QString(start).toInt();
|
||||
curveData.start = QString::fromLocal8Bit(start).toDouble();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("stop")) {
|
||||
curveData.stop = QString(stop).toInt();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("x")) {
|
||||
curveData.x = QString(stop).toInt();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("y")) {
|
||||
curveData.y = QString(stop).toInt();
|
||||
curveData.stop = QString::fromLocal8Bit(stop).toDouble();
|
||||
}
|
||||
|
||||
curveChart->curves.append(curveData);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user