AnalysisSystemForRadionucli.../ProcessAlgorithmGlobalVar.cpp
2024-06-04 15:27:02 +08:00

55 lines
3.0 KiB
C++

#include <QSettings>
#include <QMutex>
#include "ProcessAlgorithmGlobalVar.h"
double global::cst_d_decay_133xeg_lam=1.5301e-6;
double global::cst_d_decay_131xem_lam=6.7416e-7;
double global::cst_d_decay_133xem_lam=3.6633e-6;
double global::cst_d_decay_135xeg_lam=2.10657e-5;
double global::cst_d_br_133xe_80=0.3800;
double global:: cst_d_br_133xe_30=0.49110;
double global::cst_d_br_131xem_30=0.5371;
double global::cst_d_br_133xem_30=0.55770;
double global::cst_d_br_135xeg=0.90200;
double global::cst_d_xe_air=0.087;
double global::cst_k = 1.64485;
int global::fit_type = 2;//默认为2次拟
QMutex mutex_algorithmvar_global;
void global::InitAlgorithmVar(QString& _cfgFileName)
{
QMutexLocker locker(&mutex_algorithmvar_global);
QSettings settings(_cfgFileName,QSettings::IniFormat);
settings.beginGroup(QLatin1String("algorithm"));
cst_d_decay_133xeg_lam = settings.value(QLatin1String("decay133xeglam"),cst_d_decay_133xeg_lam).toDouble();
cst_d_decay_131xem_lam = settings.value(QLatin1String("decay131xeglam"),cst_d_decay_131xem_lam).toDouble();
cst_d_decay_133xem_lam = settings.value(QLatin1String("decay133mxeglam"),cst_d_decay_133xem_lam).toDouble();
cst_d_decay_135xeg_lam = settings.value(QLatin1String("decay135xeglam"),cst_d_decay_135xeg_lam).toDouble();
cst_d_br_133xe_80 = settings.value(QLatin1String("dbr133xeg80"),cst_d_br_133xe_80).toDouble();
cst_d_br_133xe_30 = settings.value(QLatin1String("dbr133xeg30"),cst_d_br_133xe_30).toDouble();
cst_d_br_131xem_30 = settings.value(QLatin1String("131xem30"),cst_d_br_131xem_30).toDouble();
cst_d_br_133xem_30 = settings.value(QLatin1String("133xem30"),cst_d_br_133xem_30).toDouble();
cst_d_br_135xeg = settings.value(QLatin1String("135xeg"),cst_d_br_135xeg).toDouble();
cst_d_xe_air = settings.value(QLatin1String("dxeair"),cst_d_xe_air).toDouble();
cst_k = settings.value(QLatin1String("k"),cst_k).toDouble();
fit_type = settings.value(QLatin1String("fittype"),fit_type).toInt();
settings.endGroup();
}
void global::GenerateAlgorithmVar(QString& _cfgFileName)
{
QMutexLocker locker(&mutex_algorithmvar_global);
QSettings settings(_cfgFileName,QSettings::IniFormat);
settings.beginGroup(QLatin1String("algorithm"));
settings.setValue(QLatin1String("decay133xeglam"),cst_d_decay_133xeg_lam);
settings.setValue(QLatin1String("decay131xeglam"),cst_d_decay_131xem_lam);
settings.setValue(QLatin1String("decay133mxeglam"),cst_d_decay_133xem_lam);
settings.setValue(QLatin1String("decay135xeglam"),cst_d_decay_135xeg_lam);
settings.setValue(QLatin1String("dbr133xeg80"),cst_d_br_133xe_80);
settings.setValue(QLatin1String("dbr133xeg30"),cst_d_br_133xe_30);
settings.setValue(QLatin1String("131xem30"),cst_d_br_131xem_30);
settings.setValue(QLatin1String("133xem30"),cst_d_br_133xem_30);
settings.setValue(QLatin1String("135xeg"),cst_d_br_135xeg);
settings.setValue(QLatin1String("dxeair"),cst_d_xe_air);
settings.setValue(QLatin1String("k"),cst_k);
settings.setValue(QLatin1String("fittype"),fit_type);
settings.endGroup();
}