224 lines
6.5 KiB
C++
224 lines
6.5 KiB
C++
#include "MeasureAnalysisProjectModel.h"
|
|
|
|
void MeasureAnalysisProjectModel::SetProjectDir(const QString& project_dir)
|
|
{
|
|
this->_project_dir = project_dir;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetProjectName(const QString& project_name)
|
|
{
|
|
this->_project_name = project_name;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetSpectrumType(MeasureAnalysisProjectModel::SpectrumType spec_type)
|
|
{
|
|
this->_spec_type = spec_type;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetIsStdSource(bool is_std_source)
|
|
{
|
|
this->_is_std_source = is_std_source;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetDescriptionInfo(const QString& description_info)
|
|
{
|
|
this->_description_info = description_info;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetMeasurePresetTime(ulong measure_preset_time)
|
|
{
|
|
this->_measure_preset_time = measure_preset_time;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetConformTimeWin(uint conform_time_win)
|
|
{
|
|
this->_conform_time_win = conform_time_win;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetIsMeasureComplete(bool is_measure_complete)
|
|
{
|
|
this->_is_measure_complete = is_measure_complete;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetMeasureDeviceParamsCfgFilename(const QString& filename)
|
|
{
|
|
this->_measure_device_params_cfg_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetEneryScaleFilename(const QString& filename)
|
|
{
|
|
this->_enery_scale_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetEfficiencyScaleFilename(const QString& filename)
|
|
{
|
|
this->_efficiency_scale_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetAllChannelParticleDataFilename(const QString& filename)
|
|
{
|
|
this->_all_channel_particle_data_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetSortedParticleDataFilename(const QString &filename)
|
|
{
|
|
this->_sorted_particle_data_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetChannelParticleDataFilename(uint channel, const QString& filename)
|
|
{
|
|
this->_channel_particle_data_filename_list[channel] = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetChannelParticleCountDataFilename(uint channel, const QString& filename)
|
|
{
|
|
this->_channel_particle_count_data_filename_list[channel] = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetAllChannelParticleTotalCountDataFilename(const QString& filename)
|
|
{
|
|
this->_all_channel_particle_total_count_data_filename = filename;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModel::SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename)
|
|
{
|
|
this->_time_win_conform_particle_data[time_win][conform_particle_count] = filename;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetProjectDir() const
|
|
{
|
|
return this->_project_dir;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetProjectName() const
|
|
{
|
|
return this->_project_name;
|
|
}
|
|
|
|
MeasureAnalysisProjectModel::SpectrumType MeasureAnalysisProjectModel::GetSpectrumType() const
|
|
{
|
|
return this->_spec_type;
|
|
}
|
|
|
|
bool MeasureAnalysisProjectModel::GetIsStdSource() const
|
|
{
|
|
return this->_is_std_source;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetDescriptionInfo() const
|
|
{
|
|
return this->_description_info;
|
|
}
|
|
|
|
ulong MeasureAnalysisProjectModel::GetMeasurePresetTime() const
|
|
{
|
|
return this->_measure_preset_time;
|
|
}
|
|
|
|
uint MeasureAnalysisProjectModel::GetConformTimeWin() const
|
|
{
|
|
return this->_conform_time_win;
|
|
}
|
|
|
|
bool MeasureAnalysisProjectModel::GetIsMeasureComplete() const
|
|
{
|
|
return this->_is_measure_complete;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetMeasureDeviceParamsCfgFilename() const
|
|
{
|
|
return this->_measure_device_params_cfg_filename;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetEneryScaleFilename() const
|
|
{
|
|
return this->_enery_scale_filename;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetEfficiencyScaleFilename() const
|
|
{
|
|
return this->_efficiency_scale_filename;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetAllChannelParticleDataFilename() const
|
|
{
|
|
return this->_all_channel_particle_data_filename;
|
|
}
|
|
|
|
const QString &MeasureAnalysisProjectModel::GetSortParticleDataFilename() const
|
|
{
|
|
return this->_sorted_particle_data_filename;
|
|
}
|
|
|
|
const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelParticleDataFilenameList() const
|
|
{
|
|
return this->_channel_particle_data_filename_list;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetChannelParticleDataFilename(uint channel) const
|
|
{
|
|
return QString(this->_channel_particle_data_filename_list[channel]);
|
|
}
|
|
|
|
const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelParticleCountDataFilenameList() const
|
|
{
|
|
return this->_channel_particle_count_data_filename_list;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetChannelParticleCountDataFilename(uint channel) const
|
|
{
|
|
return this->_channel_particle_count_data_filename_list[channel];
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetAllChannelParticleTotalCountDataFilename() const
|
|
{
|
|
return this->_all_channel_particle_total_count_data_filename;
|
|
}
|
|
|
|
const QString& MeasureAnalysisProjectModel::GetTimeWinConformParticleDataFilename(uint time_win, uint conform_particle_count) const
|
|
{
|
|
return this->_time_win_conform_particle_data[time_win][conform_particle_count];
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
/* MeasureAnalysisProjectModelList */
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
QMap<QString, MeasureAnalysisProjectModel *> MeasureAnalysisProjectModelList::ProjectModels;
|
|
MeasureAnalysisProjectModel* MeasureAnalysisProjectModelList::current_project_model{ nullptr };
|
|
|
|
void MeasureAnalysisProjectModelList::AddProjectModel(MeasureAnalysisProjectModel *model)
|
|
{
|
|
const QString& project_name = model->GetProjectName();
|
|
ProjectModels[project_name] = model;
|
|
SetCurrentProjectModel(project_name);
|
|
}
|
|
|
|
void MeasureAnalysisProjectModelList::RmProjectModel(const QString &project_name)
|
|
{
|
|
if (ProjectModels.contains(project_name)) {
|
|
delete ProjectModels[project_name];
|
|
ProjectModels.remove(project_name);
|
|
}
|
|
}
|
|
|
|
MeasureAnalysisProjectModel *MeasureAnalysisProjectModelList::GetProjectModel(const QString &project_name)
|
|
{
|
|
if (ProjectModels.contains(project_name)) {
|
|
return ProjectModels[project_name];
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
MeasureAnalysisProjectModel *MeasureAnalysisProjectModelList::GetCurrentProjectModel()
|
|
{
|
|
return current_project_model;
|
|
}
|
|
|
|
void MeasureAnalysisProjectModelList::SetCurrentProjectModel(const QString &project_name)
|
|
{
|
|
if (ProjectModels.contains(project_name)) {
|
|
current_project_model = ProjectModels[project_name];
|
|
}
|
|
}
|