DYTSrouce/src/ui/Panel/CurvePanel.h

101 lines
2.2 KiB
C
Raw Normal View History

2025-10-16 03:29:25 +00:00
#pragma once
#include "DataPanel.h"
2025-10-20 18:17:40 +00:00
#include "workspace/ChartData.h"
2025-10-26 12:14:06 +00:00
#include "workspace/FileEntry.h"
2025-10-20 18:17:40 +00:00
#include <memory>
2025-10-22 01:32:34 +00:00
#include "ui/chartPlot/FitCurveChartView.h"
2025-10-16 03:29:25 +00:00
2025-10-22 01:32:34 +00:00
namespace Ui {
class FitCurve;
}
2025-10-16 03:29:25 +00:00
/**
* @file CurvePanel.h
* @brief Curve Panel Class
* Specialized panel for curve data visualization and manipulation
*/
/**
* @brief Curve panel class
* Specialized panel for curve data, inherits from DataPanel
*/
class CurvePanel : public DataPanel
{
Q_OBJECT
public:
/**
* @brief Constructor
* @param index Panel index
* @param filePath Associated file path
* @param parent Parent widget
*/
explicit CurvePanel(int index, const QString& filePath, QWidget* parent = nullptr);
2025-10-20 18:17:40 +00:00
/**
* @brief Constructor with chart data
* @param index Panel index
* @param chartData Chart data containing curve information
* @param parent Parent widget
*/
2025-10-27 00:35:04 +00:00
explicit CurvePanel(int index, std::shared_ptr<FileEntryCurve> fileEntry, QWidget* parent = nullptr);
2025-10-20 18:17:40 +00:00
2025-10-16 03:29:25 +00:00
/**
* @brief Destructor
*/
virtual ~CurvePanel();
/**
* @brief Get file type
* @return File type (always Curve for this class)
*/
FileEntryType GetFileType() const override { return FileEntryType::Curve; }
/**
* @brief Refresh panel content
*/
void RefreshPanel() override;
protected:
/**
* @brief Initialize UI for curve-specific layout
*/
2025-10-22 01:32:34 +00:00
virtual void InitUI();
2025-10-16 03:29:25 +00:00
/**
* @brief Get type display name
* @return Display name for curve type
*/
QString GetTypeDisplayName() const override;
2025-10-20 18:17:40 +00:00
2025-10-26 12:36:31 +00:00
2025-10-22 01:32:34 +00:00
void initQChartView();
2025-10-26 12:14:06 +00:00
void OnDataPanelUpdated(FileEntryCurve* fileEntry);
2025-10-20 18:17:40 +00:00
private:
/**
* @brief Update curve display based on chart data
*/
void UpdateCurveDisplay();
private:
2025-10-22 01:32:34 +00:00
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;
2025-10-16 03:29:25 +00:00
};