73 lines
1.6 KiB
C++
73 lines
1.6 KiB
C++
#pragma once
|
|
|
|
#include "DataPanel.h"
|
|
#include "workspace/FileEntry.h"
|
|
#include <memory>
|
|
#include "ui/Layout/SignalLabel.h"
|
|
#include <QMap>
|
|
|
|
class LightPanel : public DataPanel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
/**
|
|
* @brief Constructor
|
|
* @param index Panel index
|
|
* @param filePath Associated file path
|
|
* @param parent Parent widget
|
|
*/
|
|
explicit LightPanel(int index, const QString& filePath, QWidget* parent = nullptr);
|
|
|
|
/**
|
|
* @brief Constructor with chart data
|
|
* @param index Panel index
|
|
* @param chartData Chart data containing curve information
|
|
* @param parent Parent widget
|
|
*/
|
|
explicit LightPanel(int index, std::shared_ptr<FileEntryLight> fileEntry, QWidget* parent = nullptr);
|
|
|
|
/**
|
|
* @brief Destructor
|
|
*/
|
|
virtual ~LightPanel();
|
|
|
|
/**
|
|
* @brief Get file type
|
|
* @return File type (always Curve for this class)
|
|
*/
|
|
FileEntryType GetFileType() const override { return FileEntryType::Light; }
|
|
|
|
/**
|
|
* @brief Refresh panel content
|
|
*/
|
|
void RefreshPanel() override;
|
|
|
|
protected:
|
|
/**
|
|
* @brief Initialize UI for curve-specific layout
|
|
*/
|
|
virtual void InitUI();
|
|
|
|
/**
|
|
* @brief Get type display name
|
|
* @return Display name for curve type
|
|
*/
|
|
QString GetTypeDisplayName() const override;
|
|
|
|
void OnDataPanelUpdated(FileEntryLight* fileEntry);
|
|
|
|
virtual void OnTimeChanged(double time);
|
|
|
|
private:
|
|
void updateTitle(const QString& title);
|
|
void updateParseFile(const QString& strFile, int nT, FileEntryLight::LightProperties listCurve);
|
|
void updateLampColor(const QString& strOpenColor, const QString& strCloseColor);
|
|
|
|
private:
|
|
QMap<int, QString> m_lampColor;
|
|
QMap<QString, SignalLabel*> m_mapLamp;
|
|
QMap< double, QVariantMap > m_dataLamp;
|
|
};
|
|
|