2026-03-02 11:07:51 +08:00
|
|
|
#include "MeasureAnalysisProjectModel.h"
|
2026-03-05 20:48:07 +08:00
|
|
|
#include "AnalysisTypeDefine.h"
|
|
|
|
|
#include "GlobalDefine.h"
|
2026-03-02 11:07:51 +08:00
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModel::SetProjectDir(const QString& project_dir)
|
|
|
|
|
{
|
|
|
|
|
this->_project_dir = project_dir;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModel::SetProjectName(const QString& project_name)
|
|
|
|
|
{
|
|
|
|
|
this->_project_name = project_name;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetSpectrumType(MeasureAnalysisProjectModel::SpectrumType spec_type)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_spec_type = spec_type;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetIsStdSource(bool is_std_source)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_is_std_source = is_std_source;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetDescriptionInfo(const QString& description_info)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_description_info = description_info;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetMeasurePresetTime(ulong measure_preset_time)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_measure_preset_time = measure_preset_time;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetConformTimeWin(uint conform_time_win)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_conform_time_win = conform_time_win;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetIsMeasureComplete(bool is_measure_complete)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_is_measure_complete = is_measure_complete;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetMeasureDeviceParamsCfgFilename(const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_measure_device_params_cfg_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetEneryScaleFilename(const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_enery_scale_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetEfficiencyScaleFilename(const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_efficiency_scale_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetAllChannelParticleDataFilename(const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
this->_all_channel_particle_data_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetSortedParticleDataFilename(const QString& filename)
|
2026-03-02 21:39:41 +08:00
|
|
|
{
|
|
|
|
|
this->_sorted_particle_data_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
// void MeasureAnalysisProjectModel::SetChannelParticleDataFilename(uint channel, const QString& filename)
|
|
|
|
|
// {
|
|
|
|
|
// this->_channel_particle_data_filename_list[channel] = filename;
|
|
|
|
|
// }
|
2026-03-02 11:07:51 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetChannelAddressCountDataFilename(uint channel, const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
this->_channel_address_count_data_filename_list[channel] = filename;
|
2026-03-02 11:07:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-04 16:17:04 +08:00
|
|
|
// void MeasureAnalysisProjectModel::SetAllChannelParticleTotalCountDataFilename(const QString& filename)
|
|
|
|
|
// {
|
|
|
|
|
// this->_all_channel_particle_total_count_data_filename = filename;
|
|
|
|
|
// }
|
2026-03-02 11:07:51 +08:00
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetChannelEneryCountDataFilename(uint channel, const QString& filename)
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
|
|
|
|
this->_channel_every_count_data_filename_list[channel] = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetAllChannelEneryTotalCountDataFilename(const QString& filename)
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
|
|
|
|
this->_all_channel_enery_total_count_data_filename = filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModel::SetTimeWinConformParticleData(uint time_win, uint conform_particle_count, const QString& filename)
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QString& MeasureAnalysisProjectModel::GetSortAllChannelParticleDataFilename() const
|
2026-03-02 21:39:41 +08:00
|
|
|
{
|
|
|
|
|
return this->_sorted_particle_data_filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
// const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelParticleDataFilenameList() const
|
|
|
|
|
// {
|
|
|
|
|
// return this->_channel_particle_data_filename_list;
|
|
|
|
|
// }
|
2026-03-02 11:07:51 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
// const QString& MeasureAnalysisProjectModel::GetChannelParticleDataFilename(uint channel) const
|
|
|
|
|
// {
|
|
|
|
|
// return QString(this->_channel_particle_data_filename_list[channel]);
|
|
|
|
|
// }
|
2026-03-02 11:07:51 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelAddressCountDataFilenameList() const
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
return this->_channel_address_count_data_filename_list;
|
2026-03-02 11:07:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QString& MeasureAnalysisProjectModel::GetChannelAddressCountDataFilename(uint channel) const
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
QString file_name;
|
|
|
|
|
if ( this->_channel_address_count_data_filename_list.contains(channel) ) {
|
|
|
|
|
file_name = this->_channel_address_count_data_filename_list[channel];
|
|
|
|
|
}
|
|
|
|
|
return file_name;
|
2026-03-02 11:07:51 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-04 16:17:04 +08:00
|
|
|
// const QString& MeasureAnalysisProjectModel::GetAllChannelParticleTotalCountDataFilename() const
|
|
|
|
|
// {
|
|
|
|
|
// return this->_all_channel_particle_total_count_data_filename;
|
|
|
|
|
// }
|
2026-03-02 11:07:51 +08:00
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QMap<uint, QString>& MeasureAnalysisProjectModel::GetChannelEneryCountDataFilenameList() const
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
|
|
|
|
return this->_channel_every_count_data_filename_list;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QString& MeasureAnalysisProjectModel::GetChannelEneryCountDataFilename(uint channel) const
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
QString file_name;
|
|
|
|
|
if ( this->_channel_every_count_data_filename_list.contains(channel) ) {
|
|
|
|
|
file_name = this->_channel_every_count_data_filename_list[channel];
|
|
|
|
|
}
|
|
|
|
|
return file_name;
|
2026-03-05 20:48:07 +08:00
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QString& MeasureAnalysisProjectModel::GetAllChannelEneryTotalCountDataFilename() const
|
2026-03-02 11:07:51 +08:00
|
|
|
{
|
2026-03-05 20:48:07 +08:00
|
|
|
return this->_all_channel_enery_total_count_data_filename;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
const QMap<uint, QString>& MeasureAnalysisProjectModel::GetTimeWinConformParticleDataFilenameList(uint time_win) const
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
QMap<uint, QString> conform_particle_data;
|
|
|
|
|
if ( this->_time_win_conform_particle_data.contains(time_win) ) {
|
|
|
|
|
conform_particle_data = this->_time_win_conform_particle_data[time_win];
|
|
|
|
|
}
|
|
|
|
|
return conform_particle_data;
|
2026-03-02 11:07:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
/* MeasureAnalysisProjectModelList */
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
enum ColumnType {
|
|
|
|
|
NameColumn,
|
|
|
|
|
StatusColumn
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MeasureAnalysisProjectModelList* MeasureAnalysisProjectModelList::_s_instance { nullptr };
|
|
|
|
|
|
|
|
|
|
MeasureAnalysisProjectModelList* MeasureAnalysisProjectModelList::Instance()
|
|
|
|
|
{
|
2026-03-06 14:05:15 +08:00
|
|
|
if (!_s_instance) {
|
2026-03-05 20:48:07 +08:00
|
|
|
_s_instance = new MeasureAnalysisProjectModelList();
|
|
|
|
|
}
|
|
|
|
|
return _s_instance;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
void MeasureAnalysisProjectModelList::AddProjectModel(MeasureAnalysisProjectModel* model)
|
|
|
|
|
{
|
|
|
|
|
const QString& project_name = model->GetProjectName();
|
|
|
|
|
_project_models[project_name] = model;
|
|
|
|
|
SetCurrentProjectModel(project_name);
|
|
|
|
|
intiProjectNodeStruce();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModelList::RmProjectModel(const QString& project_name)
|
|
|
|
|
{
|
|
|
|
|
if (_project_models.contains(project_name)) {
|
|
|
|
|
delete _project_models[project_name];
|
|
|
|
|
_project_models.remove(project_name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MeasureAnalysisProjectModel* MeasureAnalysisProjectModelList::GetProjectModel(const QString& project_name)
|
|
|
|
|
{
|
|
|
|
|
if (_project_models.contains(project_name)) {
|
|
|
|
|
return _project_models[project_name];
|
|
|
|
|
}
|
|
|
|
|
return nullptr;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MeasureAnalysisProjectModel* MeasureAnalysisProjectModelList::GetCurrentProjectModel()
|
|
|
|
|
{
|
|
|
|
|
return _current_project_model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModelList::SetCurrentProjectModel(const QString& project_name)
|
|
|
|
|
{
|
|
|
|
|
if (_project_models.contains(project_name)) {
|
|
|
|
|
_current_project_model = _project_models[project_name];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MeasureAnalysisProjectModelList::MeasureAnalysisProjectModelList(QObject* parent)
|
|
|
|
|
: QStandardItemModel(parent)
|
|
|
|
|
, _current_project_model(nullptr)
|
2026-03-05 20:48:07 +08:00
|
|
|
{
|
|
|
|
|
setColumnCount(2);
|
|
|
|
|
setHeaderData(NameColumn, Qt::Horizontal, QStringLiteral(u"项名"));
|
|
|
|
|
setHeaderData(StatusColumn, Qt::Horizontal, QStringLiteral(u"状态"));
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* MeasureAnalysisProjectModelList::GetItemFromIndex(const QModelIndex& index) const
|
|
|
|
|
{
|
|
|
|
|
QModelIndex nameIndex = index.sibling(index.row(), NameColumn);
|
|
|
|
|
return itemFromIndex(nameIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QStandardItem* MeasureAnalysisProjectModelList::AddChildNode(
|
|
|
|
|
QStandardItem* parent_item, const QString& node_name, const QString& status,
|
|
|
|
|
const QVariant& user_data, bool is_fixed)
|
|
|
|
|
{
|
|
|
|
|
if (!parent_item)
|
|
|
|
|
return nullptr;
|
|
|
|
|
|
|
|
|
|
QStandardItem* name_item = new QStandardItem(node_name);
|
|
|
|
|
name_item->setData(user_data, NodeType);
|
|
|
|
|
name_item->setData(is_fixed, Fixed);
|
|
|
|
|
|
|
|
|
|
QStandardItem* status_item = new QStandardItem(status);
|
|
|
|
|
|
|
|
|
|
QList<QStandardItem*> row_items;
|
|
|
|
|
row_items << name_item << status_item;
|
|
|
|
|
parent_item->appendRow(row_items);
|
|
|
|
|
|
|
|
|
|
return name_item;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool MeasureAnalysisProjectModelList::RemoveNode(QStandardItem* item)
|
|
|
|
|
{
|
|
|
|
|
if (!item)
|
|
|
|
|
return false;
|
|
|
|
|
if (item->column() == NameColumn && item->data(Fixed).toBool())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
QStandardItem* parent_item = item->parent();
|
|
|
|
|
if (!parent_item) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
parent_item->removeRow(item->row());
|
|
|
|
|
|
|
|
|
|
const QString& project_name = item->data(ProjectName).toString();
|
|
|
|
|
if (AnalysisType::Project == item->data(NodeType).value<AnalysisType>()) {
|
|
|
|
|
_project_node_items.remove(project_name);
|
|
|
|
|
return true;
|
|
|
|
|
} else {
|
|
|
|
|
const QString& node_name = item->text();
|
|
|
|
|
if (_project_node_items.contains(project_name)) {
|
|
|
|
|
if (_project_node_items[project_name].contains(node_name)) {
|
|
|
|
|
_project_node_items[project_name].remove(node_name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModelList::SetNodeUserData(QStandardItem* item, const QVariant& data)
|
|
|
|
|
{
|
|
|
|
|
if (item && item->column() == NameColumn)
|
|
|
|
|
item->setData(data, NodeType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariant MeasureAnalysisProjectModelList::GetNodeUserData(QStandardItem* item, UserDataType data_type) const
|
|
|
|
|
{
|
|
|
|
|
return (item && item->column() == NameColumn) ? item->data(data_type) : QVariant();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModelList::SetNodeStatus(QStandardItem* item, const QString& status)
|
|
|
|
|
{
|
|
|
|
|
if (!item || item->column() != NameColumn)
|
|
|
|
|
return;
|
|
|
|
|
QStandardItem* status_item = item->parent()
|
|
|
|
|
? item->parent()->child(item->row(), StatusColumn)
|
|
|
|
|
: invisibleRootItem()->child(item->row(), StatusColumn);
|
|
|
|
|
if (status_item) {
|
|
|
|
|
status_item->setText(status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QString MeasureAnalysisProjectModelList::GetNodeStatus(QStandardItem* item) const
|
|
|
|
|
{
|
|
|
|
|
if (!item || item->column() != NameColumn)
|
|
|
|
|
return QString();
|
|
|
|
|
QStandardItem* status_item = item->parent()
|
|
|
|
|
? item->parent()->child(item->row(), StatusColumn)
|
|
|
|
|
: invisibleRootItem()->child(item->row(), StatusColumn);
|
|
|
|
|
return status_item ? status_item->text() : QString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void MeasureAnalysisProjectModelList::onChannelAddressCountProcessFinished(const QString& project_name)
|
|
|
|
|
{
|
|
|
|
|
if (this->_project_models.contains(project_name)) {
|
|
|
|
|
auto pro_model = this->_project_models[project_name];
|
|
|
|
|
const QMap<uint, QString>& filename_list = pro_model->GetChannelAddressCountDataFilenameList();
|
|
|
|
|
|
|
|
|
|
QString status = QStringLiteral(u"无效");
|
|
|
|
|
if (!filename_list.isEmpty()) {
|
|
|
|
|
status = QStringLiteral(u"有效");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
auto& node_map = this->_project_node_items[project_name];
|
|
|
|
|
const QString& adrr_count_item_name = QStringLiteral(u"道址计数");
|
|
|
|
|
if (node_map.contains(adrr_count_item_name)) {
|
|
|
|
|
auto adrr_count_item = node_map[adrr_count_item_name];
|
|
|
|
|
this->SetNodeStatus(adrr_count_item, status);
|
|
|
|
|
|
|
|
|
|
for (auto it = filename_list.begin(); it != filename_list.end(); ++it) {
|
|
|
|
|
uint ch_num = it.key();
|
|
|
|
|
QString item_name = QStringLiteral(u"通道%1道址计数").arg(ch_num);
|
|
|
|
|
const QVariant& analys_type = QVariant::fromValue(AnalysisType::AddressCountData);
|
|
|
|
|
QStandardItem* node_item = AddChildNode(adrr_count_item, item_name, status, analys_type, true);
|
|
|
|
|
node_item->setData(project_name, ProjectName);
|
|
|
|
|
node_item->setData(ch_num, ChannelNum);
|
|
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const QString& adrr_count_spec_item_name = QStringLiteral(u"道址计数谱");
|
|
|
|
|
if (node_map.contains(adrr_count_spec_item_name)) {
|
|
|
|
|
auto adrr_count_spec_item = node_map[adrr_count_spec_item_name];
|
|
|
|
|
this->SetNodeStatus(adrr_count_spec_item, status);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
void MeasureAnalysisProjectModelList::intiProjectNodeStruce()
|
|
|
|
|
{
|
|
|
|
|
MeasureAnalysisProjectModel* cur_pro_model = GetCurrentProjectModel();
|
2026-03-06 14:05:15 +08:00
|
|
|
if (!cur_pro_model) {
|
2026-03-05 20:48:07 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QMap<QString, QStandardItem*> node_map;
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* root_item = invisibleRootItem();
|
2026-03-05 20:48:07 +08:00
|
|
|
|
|
|
|
|
const QString& project_name = cur_pro_model->GetProjectName();
|
|
|
|
|
QString status = cur_pro_model->GetIsMeasureComplete() ? QStringLiteral(u"测量完成") : QStringLiteral(u"未测量");
|
|
|
|
|
QVariant analys_type = QVariant::fromValue(AnalysisType::Project);
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* project_item = AddChildNode(root_item, project_name, status, analys_type, false);
|
|
|
|
|
project_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
|
|
|
|
|
// 测量控制
|
|
|
|
|
QString item_name = QStringLiteral(u"测量控制");
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* measure_ctrl_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
|
|
|
|
measure_ctrl_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = measure_ctrl_item;
|
|
|
|
|
|
|
|
|
|
if (!cur_pro_model->GetIsMeasureComplete()) {
|
|
|
|
|
const QString& measure_device_params_cfg_filename = cur_pro_model->GetMeasureDeviceParamsCfgFilename();
|
|
|
|
|
status = measure_device_params_cfg_filename.isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::DeviceParamsCfg);
|
|
|
|
|
item_name = QStringLiteral(u"设备配置参数");
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
|
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
}
|
2026-03-06 14:05:15 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
status = cur_pro_model->GetEneryScaleFilename().isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EnergyScale);
|
|
|
|
|
item_name = QStringLiteral(u"能量刻度");
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
|
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
2026-03-06 14:05:15 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
status = cur_pro_model->GetEfficiencyScaleFilename().isEmpty() ? QStringLiteral(u"未配置") : QStringLiteral(u"已配置");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EfficiencyScale);
|
|
|
|
|
item_name = QStringLiteral(u"效率刻度");
|
|
|
|
|
node_item = AddChildNode(measure_ctrl_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
// 分析数据
|
|
|
|
|
item_name = QStringLiteral(u"分析数据");
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* analysis_data_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
|
|
|
|
analysis_data_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::ParticleData);
|
|
|
|
|
item_name = QStringLiteral(u"测量粒子数据");
|
|
|
|
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
item_name = QStringLiteral(u"道址计数");
|
|
|
|
|
status = cur_pro_model->GetChannelAddressCountDataFilenameList().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
node_item = AddChildNode(analysis_data_item, item_name, status, QVariant(), true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
2026-03-06 14:05:15 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
item_name = QStringLiteral(u"能量计数");
|
|
|
|
|
status = cur_pro_model->GetAllChannelEneryTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EnergyCountData);
|
|
|
|
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
2026-03-06 14:05:15 +08:00
|
|
|
|
2026-03-05 20:48:07 +08:00
|
|
|
uint conform_time_win = cur_pro_model->GetConformTimeWin();
|
|
|
|
|
status = cur_pro_model->GetTimeWinConformParticleDataFilenameList(conform_time_win).isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergyData);
|
|
|
|
|
item_name = QStringLiteral(u"符合粒子数据[%1ns]").arg(conform_time_win);
|
|
|
|
|
node_item = AddChildNode(analysis_data_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
// 交互分析
|
|
|
|
|
item_name = QStringLiteral(u"交互分析");
|
2026-03-06 14:05:15 +08:00
|
|
|
QStandardItem* interactive_analysis_item = AddChildNode(project_item, item_name, QString(), QVariant(), true);
|
|
|
|
|
interactive_analysis_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = interactive_analysis_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetChannelAddressCountDataFilenameList().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
2026-03-06 14:05:15 +08:00
|
|
|
analys_type = QVariant::fromValue(AnalysisType::AddressCountSpectrumView);
|
2026-03-05 20:48:07 +08:00
|
|
|
item_name = QStringLiteral(u"道址计数谱");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetChannelEneryCountDataFilenameList().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
2026-03-06 14:05:15 +08:00
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EneryCountSpectrumView);
|
2026-03-05 20:48:07 +08:00
|
|
|
item_name = QStringLiteral(u"通道能量计数谱");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetAllChannelEneryTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
2026-03-06 14:05:15 +08:00
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EneryCountSpectrumView);
|
2026-03-05 20:48:07 +08:00
|
|
|
item_name = QStringLiteral(u"能量计数谱");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CountingRateView);
|
|
|
|
|
item_name = QStringLiteral(u"计数率分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetAllChannelEneryTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::EnergyPeakFitView);
|
|
|
|
|
item_name = QStringLiteral(u"峰拟合分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetAllChannelEneryTotalCountDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::NuclideAnalysisView);
|
|
|
|
|
item_name = QStringLiteral(u"核素分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::ParticleInTimeView);
|
|
|
|
|
item_name = QStringLiteral(u"粒子入射时间分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetSortAllChannelParticleDataFilename().isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::ParticleTimeDiffView);
|
|
|
|
|
item_name = QStringLiteral(u"粒子时间差分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
status = cur_pro_model->GetTimeWinConformParticleDataFilenameList(conform_time_win).isEmpty() ? QStringLiteral(u"无效") : QStringLiteral(u"有效");
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceEventTimeView);
|
|
|
|
|
item_name = QStringLiteral(u"符合事件时间分析");
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrumView);
|
|
|
|
|
item_name = QStringLiteral(u"符合能谱[%1ns]").arg(conform_time_win);
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::AntiCoincidenceSpectrumView);
|
|
|
|
|
item_name = QStringLiteral(u"反符合能谱[%1ns]").arg(conform_time_win);
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum2DView);
|
|
|
|
|
item_name = QStringLiteral(u"二维符合能谱[%1ns]").arg(conform_time_win);
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
analys_type = QVariant::fromValue(AnalysisType::CoincidenceParticleEnergySpectrum3DView);
|
|
|
|
|
item_name = QStringLiteral(u"三维符合能谱[%1ns]").arg(conform_time_win);
|
|
|
|
|
node_item = AddChildNode(interactive_analysis_item, item_name, status, analys_type, true);
|
2026-03-06 14:05:15 +08:00
|
|
|
node_item->setData(project_name, ProjectName);
|
2026-03-05 20:48:07 +08:00
|
|
|
node_map[item_name] = node_item;
|
|
|
|
|
|
|
|
|
|
_project_node_items[project_name] = node_map;
|
|
|
|
|
|
|
|
|
|
LOG_INFO(QStringLiteral(u"测量分析项目\"%1\"创建成功.").arg(project_name));
|
|
|
|
|
if (!cur_pro_model->GetIsMeasureComplete()) {
|
|
|
|
|
if (cur_pro_model->GetMeasureDeviceParamsCfgFilename().isEmpty()) {
|
|
|
|
|
LOG_WARN(QStringLiteral(u"测量分析项目\"%1\"测量设备参数未配置!").arg(project_name));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (cur_pro_model->GetEneryScaleFilename().isEmpty()) {
|
|
|
|
|
LOG_WARN(QStringLiteral(u"测量分析项目\"%1\"能量刻度未配置!").arg(project_name));
|
|
|
|
|
}
|
|
|
|
|
if (cur_pro_model->GetEfficiencyScaleFilename().isEmpty()) {
|
|
|
|
|
LOG_WARN(QStringLiteral(u"测量分析项目\"%1\"效率刻度未配置!").arg(project_name));
|
|
|
|
|
}
|
|
|
|
|
}
|