EnergySpectrumAnalyer/src/MeasureAnalysisView.h
2026-03-25 11:46:05 +08:00

67 lines
1.7 KiB
C++

#ifndef MEASUREANALYSISVIEW_H
#define MEASUREANALYSISVIEW_H
#include <QDataStream>
#include <QList>
#include <QMap>
#include <QVariantMap>
#include <QWidget>
#include "AnalysisTypeDefine.h"
typedef struct ParticleInjectTime
{
int bd;
int ch;
double dTime;
int index;
double dEnergy;
} PARTICLEINJECTTIME;
class MeasureAnalysisView : public QWidget {
Q_OBJECT
public:
static MeasureAnalysisView* NewAnalyzeView(AnalysisType view_type);
public:
enum ViewType {
None,
ConfigFrame,
DataTable,
PlotFrame
};
explicit MeasureAnalysisView(QWidget* parent = nullptr);
void SetProjectName(const QString& project_name);
const QString& GetProjectName() const;
AnalysisType GetAnalyzeType();
bool IsDeleteOnClose();
ViewType GetViewType();
void SetViewName(const QString& name);
void SetViewDescription(const QString& description);
const QString& GetViewName() const;
const QString& GetViewDescription() const;
virtual void InitViewWorkspace(const QString& project_name) = 0;
virtual void SetAnalyzeDataFilename(const QMap<QString, QVariant>& data_files_set) = 0;
protected:
void setAnalyzeType(AnalysisType type);
void setDeleteOnClose(bool del);
void setViewType(ViewType view_type);
private:
QString _project_name;
bool _delete_on_close = true;
AnalysisType _analysis_type = AnalysisType::None;
ViewType _view_type = ViewType::None;
QString _name;
QString _description;
public:
friend QDataStream& operator<<(QDataStream& out, const MeasureAnalysisView& view);
friend QDataStream& operator>>(QDataStream& in, MeasureAnalysisView& view);
};
#endif // MEASUREANALYSISVIEW_H