Compare commits
No commits in common. "02af6f39d9baf77855e8a29987cfa8ac7290230d" and "8f9586ab893c9612b19cffce94390b727c0217d1" have entirely different histories.
02af6f39d9
...
8f9586ab89
|
|
@ -161,7 +161,7 @@ std::vector<SpectrumData> ReadCsv(const std::string& filename)
|
|||
}
|
||||
|
||||
file.close();
|
||||
// std::cout << "成功读取 " << data.size() << " 条有效数据" << std::endl;
|
||||
std::cout << "成功读取 " << data.size() << " 条有效数据" << std::endl;
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
@ -298,7 +298,7 @@ void SaveResults(
|
|||
}
|
||||
stats_file.close();
|
||||
|
||||
// std::cout << "结果已保存到:" << base_filename << "_detail.csv 和 " << base_filename << "_stats.csv" << std::endl;
|
||||
std::cout << "结果已保存到:" << base_filename << "_detail.csv 和 " << base_filename << "_stats.csv" << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "NolinearLeastSquaresCurveFit.h"
|
||||
#include "NolinearLeastSquaresCurveFit.h"
|
||||
#include "MathModelDefine.h"
|
||||
|
||||
using namespace arma;
|
||||
|
|
@ -53,7 +53,7 @@ vec Lsqcurvefit(ModelFunc model, const vec& x, const vec& y, vec p0, double tol,
|
|||
|
||||
// 收敛判断:残差变化小于阈值
|
||||
if (abs(current_norm - residual_norm) < tol) {
|
||||
// cout << "迭代收敛,迭代次数:" << iter << endl;
|
||||
cout << "迭代收敛,迭代次数:" << iter << endl;
|
||||
break;
|
||||
}
|
||||
residual_norm = current_norm;
|
||||
|
|
|
|||
|
|
@ -73,36 +73,6 @@ void NewMeasureAnalysisDlg::initialization()
|
|||
ui->lineEdit_filename->setProperty("data_file_path", filename);
|
||||
});
|
||||
|
||||
// 遍历可执行文件目录中configure/DeviceParams目录下的测量设备参数文件
|
||||
const QString& device_params_dir_path = QDir(qApp->applicationDirPath()).filePath("configure/DeviceParams");
|
||||
QDir device_params_dir(device_params_dir_path);
|
||||
if (!device_params_dir.exists(device_params_dir_path)) {
|
||||
return;
|
||||
}
|
||||
QList<QString> ms_cfg_basenames = device_params_dir.entryList(QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks, QDir::Time);
|
||||
for (const QString& ms_cfg_basename : ms_cfg_basenames) {
|
||||
const QString& ms_cfg_filename = device_params_dir.filePath(ms_cfg_basename);
|
||||
QFileInfo ms_cfg_file_info(ms_cfg_filename);
|
||||
if ("mscfg" == ms_cfg_file_info.suffix()) {
|
||||
ui->comboBox_measure_param->addItem(ms_cfg_file_info.baseName(), ms_cfg_file_info.absoluteFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
// 遍历可执行文件目录中configure/EnergyScale目录下的能量刻度文件
|
||||
const QString& energy_scale_dir_path = QDir(qApp->applicationDirPath()).filePath("configure/EnergyScale");
|
||||
QDir energy_scale_dir(energy_scale_dir_path);
|
||||
if (!energy_scale_dir.exists(energy_scale_dir_path)) {
|
||||
return;
|
||||
}
|
||||
QList<QString> energy_scale_basenames = energy_scale_dir.entryList(QDir::Files | QDir::NoDotAndDotDot | QDir::NoSymLinks, QDir::Time);
|
||||
for (const QString& energy_scale_basename : energy_scale_basenames) {
|
||||
const QString& energy_scale_filename = energy_scale_dir.filePath(energy_scale_basename);
|
||||
QFileInfo energy_scale_file_info(energy_scale_filename);
|
||||
if ("json" == energy_scale_file_info.suffix()) {
|
||||
ui->comboBox_energy_scale->addItem(energy_scale_file_info.baseName(), energy_scale_file_info.absoluteFilePath());
|
||||
}
|
||||
}
|
||||
|
||||
ui->btn_ok->setEnabled(false);
|
||||
auto turnStackPageBtnState = [this](){
|
||||
int last_stack_index = ui->stackedWidget->count() - 1;
|
||||
|
|
@ -147,7 +117,7 @@ void NewMeasureAnalysisDlg::initialization()
|
|||
|
||||
void NewMeasureAnalysisDlg::newProject(const QString& particle_data_filename)
|
||||
{
|
||||
QString project_name = ui->lineEdit_name->text();
|
||||
const QString& project_name = ui->lineEdit_name->text();
|
||||
QString projects_dir_path = QDir(qApp->applicationDirPath()).filePath("Projects");
|
||||
QDir projects_dir(projects_dir_path);
|
||||
QString project_dir_path = projects_dir.filePath(project_name);
|
||||
|
|
@ -162,22 +132,7 @@ void NewMeasureAnalysisDlg::newProject(const QString& particle_data_filename)
|
|||
} else if (ui->rbtn_background_spec->isChecked()) {
|
||||
spec_type = MeasureAnalysisProjectModel::SpectrumType::Background;
|
||||
}
|
||||
|
||||
QString measure_param_filename = ui->comboBox_measure_param->currentData().toString();
|
||||
QString project_measure_param_filename = QDir(project_dir_path).filePath(QStringLiteral(u"设备参数配置.mscfg"));
|
||||
QFileInfo measure_param_file_info(measure_param_filename);
|
||||
if (measure_param_file_info.exists()) {
|
||||
QFile::copy(measure_param_filename, project_measure_param_filename);
|
||||
}
|
||||
QString energy_scale_filename = ui->comboBox_energy_scale->currentData().toString();
|
||||
QString project_energy_scale_filename = QDir(project_dir_path).filePath(QStringLiteral(u"能量刻度.json"));
|
||||
QFileInfo energy_scale_file_info(energy_scale_filename);
|
||||
if (energy_scale_file_info.exists()) {
|
||||
QFile::copy(energy_scale_filename, project_energy_scale_filename);
|
||||
}
|
||||
|
||||
bool is_measure_complete = !particle_data_filename.isEmpty();
|
||||
|
||||
MeasureAnalysisProjectModel* model = new MeasureAnalysisProjectModel;
|
||||
model->SetProjectDir(project_dir_path);
|
||||
model->SetProjectName(project_name);
|
||||
|
|
@ -186,8 +141,6 @@ void NewMeasureAnalysisDlg::newProject(const QString& particle_data_filename)
|
|||
model->SetMeasurePresetTime(measure_preset_time);
|
||||
model->SetConformTimeWin(conform_time_win);
|
||||
model->SetDescriptionInfo(description_info);
|
||||
model->SetMeasureDeviceParamsCfgFilename(project_measure_param_filename);
|
||||
model->SetEnergyScaleFilename(energy_scale_filename);
|
||||
model->SetAllChannelParticleDataFilename(particle_data_filename);
|
||||
model->SetIsMeasureComplete(is_measure_complete);
|
||||
ProjectList::Instance()->AddProjectModel(model);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user