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"
|
|
|
|
|
#include <memory>
|
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
|
|
|
|
|
*/
|
|
|
|
|
explicit CurvePanel(int index, std::shared_ptr<BaseChartData> chartData, QWidget* parent = nullptr);
|
|
|
|
|
|
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;
|
|
|
|
|
|
2025-10-20 18:17:40 +00:00
|
|
|
/**
|
|
|
|
|
* @brief Set chart data
|
|
|
|
|
* @param chartData Chart data to display
|
|
|
|
|
*/
|
|
|
|
|
void SetChartData(std::shared_ptr<BaseChartData> chartData);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get current chart data
|
|
|
|
|
* @return Current chart data
|
|
|
|
|
*/
|
|
|
|
|
std::shared_ptr<BaseChartData> GetChartData() const { return chartData_; }
|
|
|
|
|
|
2025-10-16 03:29:25 +00:00
|
|
|
protected:
|
|
|
|
|
/**
|
|
|
|
|
* @brief Initialize UI for curve-specific layout
|
|
|
|
|
*/
|
|
|
|
|
void InitUI() override;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief Get type display name
|
|
|
|
|
* @return Display name for curve type
|
|
|
|
|
*/
|
|
|
|
|
QString GetTypeDisplayName() const override;
|
2025-10-20 18:17:40 +00:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/**
|
|
|
|
|
* @brief Update curve display based on chart data
|
|
|
|
|
*/
|
|
|
|
|
void UpdateCurveDisplay();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
std::shared_ptr<BaseChartData> chartData_; // Chart data containing curve information
|
|
|
|
|
bool hasChartData_; // Flag indicating if chart data is available
|
2025-10-16 03:29:25 +00:00
|
|
|
};
|