179 lines
5.1 KiB
C++
179 lines
5.1 KiB
C++
#include "MeasureAnalysisView.h"
|
|
#include <QMap>
|
|
#include "MeasureAnalysisDataTableView.h"
|
|
#include "MeasureAnalysisParticleCountPlotView.h"
|
|
|
|
MeasureAnalysisView *MeasureAnalysisView::NewAnalyzeView(AnalysisType view_type)
|
|
{
|
|
MeasureAnalysisView* new_view = nullptr;
|
|
switch (view_type) {
|
|
case AnalysisType::Project: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::DeviceParamsCfg: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::EnergyScale: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::EfficiencyScale: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::ParticleData: {
|
|
new_view = new MeasureAnalysisDataTableView;
|
|
new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::AddressCountData: {
|
|
new_view = new MeasureAnalysisDataTableView;
|
|
new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::EnergyCountData: {
|
|
new_view = new MeasureAnalysisDataTableView;
|
|
new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::ChannelEnergyCountData: {
|
|
new_view = new MeasureAnalysisDataTableView;
|
|
new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::CoincidenceParticleEnergyData: {
|
|
new_view = new MeasureAnalysisDataTableView;
|
|
new_view->setDeleteOnClose(true);
|
|
} break;
|
|
case AnalysisType::AddressCountSpectrumView: {
|
|
new_view = new MeasureAnalysisParticleCountPlotView;
|
|
new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::EnergyCountSpectrumView: {
|
|
// new_view = new MeasureAnalysisParticleCountPlotView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::CoincidenceParticleEnergySpectrum2DView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::CoincidenceParticleEnergySpectrum3DView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::CountingRateView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::EnergyPeakFitView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::NuclideAnalysisView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::ParticleInTimeView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::ParticleTimeDiffView: {
|
|
// new_view = new MeasureAnalysisParticleCountPlotView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::CoincidenceEventTimeView: {
|
|
// new_view = new MeasureAnalysisParticleCountPlotView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::CoincidenceParticleEnergySpectrumView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
case AnalysisType::AntiCoincidenceSpectrumView: {
|
|
// new_view = new MeasureAnalysisDataTableView;
|
|
// new_view->setDeleteOnClose(false);
|
|
} break;
|
|
default:
|
|
break;
|
|
}
|
|
if ( new_view ) {
|
|
new_view->setAnalyzeType(view_type);
|
|
}
|
|
return new_view;
|
|
}
|
|
|
|
MeasureAnalysisView::MeasureAnalysisView(QWidget* parent)
|
|
: QWidget { parent }
|
|
{
|
|
_analysis_type = AnalysisType::None;
|
|
}
|
|
|
|
void MeasureAnalysisView::SetProjectName(const QString &project_name)
|
|
{
|
|
_project_name = project_name;
|
|
}
|
|
|
|
const QString &MeasureAnalysisView::GetProjectName() const
|
|
{
|
|
return _project_name;
|
|
}
|
|
|
|
AnalysisType MeasureAnalysisView::GetAnalyzeType()
|
|
{
|
|
return _analysis_type;
|
|
}
|
|
|
|
bool MeasureAnalysisView::IsDeleteOnClose()
|
|
{
|
|
return _delete_on_close;
|
|
}
|
|
|
|
MeasureAnalysisView::ViewType MeasureAnalysisView::GetViewType()
|
|
{
|
|
return _view_type;
|
|
}
|
|
|
|
void MeasureAnalysisView::SetViewName(const QString &name)
|
|
{
|
|
this->_name = name;
|
|
}
|
|
|
|
void MeasureAnalysisView::SetViewDescription(const QString &description)
|
|
{
|
|
this->_description = description;
|
|
}
|
|
|
|
const QString &MeasureAnalysisView::GetViewName() const
|
|
{
|
|
return this->_name;
|
|
}
|
|
|
|
const QString &MeasureAnalysisView::GetViewDescription() const
|
|
{
|
|
return this->_description;
|
|
}
|
|
|
|
void MeasureAnalysisView::setAnalyzeType(AnalysisType type)
|
|
{
|
|
_analysis_type = type;
|
|
}
|
|
|
|
void MeasureAnalysisView::setDeleteOnClose(bool del)
|
|
{
|
|
_delete_on_close = del;
|
|
}
|
|
|
|
void MeasureAnalysisView::setViewType(ViewType view_type)
|
|
{
|
|
_view_type = view_type;
|
|
}
|
|
|
|
QDataStream& operator<<(QDataStream& out, const MeasureAnalysisView& view)
|
|
{
|
|
return out;
|
|
}
|
|
|
|
QDataStream& operator>>(QDataStream& in, MeasureAnalysisView& view)
|
|
{
|
|
return in;
|
|
}
|
|
|