牛博士让改的

This commit is contained in:
DESKTOP-450PEFP\mainc 2026-04-01 18:01:56 +08:00
parent fea5ebcc1d
commit 300a7e8055

View File

@ -1579,7 +1579,7 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
// variant = message.GetBlockData(order); // variant = message.GetBlockData(order);
// if (!variant.isValid()) // if (!variant.isValid())
// { // {
//// printf((order.toStdString() + " get failed\n").c_str()); // printf((order.toStdString() + " get failed\n").c_str());
// Histogramflag = true; // Histogramflag = true;
// } // }
// else // else
@ -4713,15 +4713,50 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
JNIEXPORT void JNICALL test_bate() JNIEXPORT void JNICALL test_bate()
{ {
QVector<double> watch_x = {76.22, 92.209, 108.102, 123.901, 139.606, 155.221, 170.746, 186.182, 201.532, 216.797, 231.979, 247.077, 262.095, 277.033, 291.893, 306.675, 321.381, 336.012, 350.569, 365.054, 379.467, 393.809}; //算法部分
bool bRet = false;
QVector<double> watch_y = {25.0084, 31.0752, 37.0466, 42.9244, 48.7102, 54.4057, 60.0123, 65.5316, 70.965, 76.3141, 81.5801, 86.7644, 91.8684, 96.8932, 101.84, 106.711, 111.506, 116.226, 120.874, 125.45, 129.954, 134.389}; BgFileI inputFile;
CBgWork bgwork;
QVector<double> fitting_para; bool bFileAnlyseError = false;
CBgWork::GetFileFittingPara(watch_x, watch_y, fitting_para); QString sampleFile = "E:/AW/doc/USX79_005-20250708_2240_S_PREL_21592.5.PHD";
printf(sampleFile.toStdString().c_str());
// **************** printf("\n");
QString gasFile = "E:/AW/doc/USX79_005-20250708_1040_G_FULL_40187.1.PHD";
printf(gasFile.toStdString().c_str());
// **************** printf("\n");
QString detbgrFile = "E:/AW/doc/USX79_005-20220506_0101_D_FULL_259589.PHD";
printf(detbgrFile.toStdString().c_str());
// **************** printf("\n");
BgAllGenerate allData;
if (!inputFile.Detbgr.AnalysePHD_File(detbgrFile))
{
printf("In BgAnalyse,detbgrFile get failed:");
printf(detbgrFile.toStdString().c_str());
printf("\n");
}
else if (!inputFile.gas.AnalysePHD_File(gasFile))
{
printf("In BgAnalyse,gasFile get failed:");
printf(gasFile.toStdString().c_str());
printf("\n");
}
else if (!inputFile.sample.AnalysePHD_File(sampleFile))
{
printf("In BgAnalyse,sampleFile get failed:");
printf(sampleFile.toStdString().c_str());
printf("\n");
}
else
{
bgwork.SetBgFile(inputFile);
bRet = bgwork.AutoAnalyse();
allData = bgwork.GetAllValue();
}
QString error_str = CBgWork::BgAnlyseError(bgwork.GetLastError());
printf(" ## test_bate"); printf(" ## test_bate");
printf("load file error : %s! \n",error_str.toStdString().c_str());
// bool bRet = false; // bool bRet = false;
// BgFileI inputFile; // BgFileI inputFile;
// CBgWork bgwork; // CBgWork bgwork;
@ -5200,6 +5235,8 @@ jstring Java_org_jeecg_modules_native_1jni_EnergySpectrumHandler_selfBgAnalyse(J
QJsonObject factorObj = inObj[name].toObject(); QJsonObject factorObj = inObj[name].toObject();
bool bExist = factorObj["exist"].toBool();
double halfLife = factorObj["halflife"].toString().toDouble() * (24 * 60 * 60); double halfLife = factorObj["halflife"].toString().toDouble() * (24 * 60 * 60);
double sendOdds = factorObj["yield"].toString().toDouble() / 100.0; double sendOdds = factorObj["yield"].toString().toDouble() / 100.0;
double area = factorObj["area"].toString().toDouble(); double area = factorObj["area"].toString().toDouble();
@ -5235,7 +5272,7 @@ jstring Java_org_jeecg_modules_native_1jni_EnergySpectrumHandler_selfBgAnalyse(J
double lambda = ln2 / T; double lambda = ln2 / T;
double kc = lambda * tr / (1 - pow(e, -(lambda * tr))); double kc = lambda * tr / (1 - pow(e, -(lambda * tr)));
double a_up = (area / f); double a_up = (area / f);
double a_low = (tl * bgeff * geff * sendOdds); double a_low = (tr * bgeff * geff * sendOdds);
double a = (a_up / a_low) * kc; double a = (a_up / a_low) * kc;
double ac_mi = lambda * tp; double ac_mi = lambda * tp;
double ac_e = pow(e, ac_mi); double ac_e = pow(e, ac_mi);
@ -5244,6 +5281,10 @@ jstring Java_org_jeecg_modules_native_1jni_EnergySpectrumHandler_selfBgAnalyse(J
double cBaseLine = factorObj["baseline"].toString().toDouble(); double cBaseLine = factorObj["baseline"].toString().toDouble();
double ld = 2.71 + 4.65 * sqrt(cBaseLine); double ld = 2.71 + 4.65 * sqrt(cBaseLine);
if(!bExist)
{
ld = 2.71 + 4.65 * sqrt(area);
}
double mda = (ld / a_low) * kc; double mda = (ld / a_low) * kc;
double mdc = (1000 * mda / (vxe / 0.087)) * ac_e * ac_kc; double mdc = (1000 * mda / (vxe / 0.087)) * ac_e * ac_kc;
@ -5251,6 +5292,52 @@ jstring Java_org_jeecg_modules_native_1jni_EnergySpectrumHandler_selfBgAnalyse(J
double conc_la = (lc / a_low) * kc; double conc_la = (lc / a_low) * kc;
double conc_lc = (1000 * mda / (vxe / 0.087)) * ac_e * ac_kc; double conc_lc = (1000 * mda / (vxe / 0.087)) * ac_e * ac_kc;
// if(!bExist)
// {
// mdc = 2.71 + 4.65 * sqrt(area);
// printf("exist=false, tmpld : %lf \n",tmpld);
// mdc = (tmpld / a_low) * ac_kc * (0.087/vxe);
// mdc = (1000*tmpld / a_low) * ac_kc * (0.087/vxe)*ac_e;
// }
// double c = tt * ac_kc * (0.087/vxe);
printf("---------i----------: %d name:%s\n",i,name.toStdString().c_str());
printf("halfLife : %lf \n",halfLife);
printf("sendOdds : %lf \n",sendOdds);
printf("area : %lf \n",area);
printf("lcConst : %lf \n",lcConst);
printf("bgeff : %lf \n",bgeff);
printf("geff : %lf \n",geff);
printf("fxe : %lf \n",fxe);
printf("fn2 : %lf \n",fn2);
printf("f : %lf \n",f);
printf("e : %lf \n",e);
printf("ln2 : %lf \n",ln2);
printf("T : %lf \n",T);
printf("lambda : %lf \n",lambda);
printf("kc : %lf \n",kc);
printf("a_up : %lf \n",a_up);
printf("a_low : %lf \n",a_low);
printf("a : %lf \n",a);
printf("ac_mi : %lf \n",ac_mi);
printf("ac_e : %lf \n",ac_e);
printf("ac_kc : %lf \n",ac_kc);
printf("ac : %lf \n",ac);
printf("cBaseLine : %lf \n",cBaseLine);
printf("ld : %lf \n",ld);
printf("mda : %lf \n",mda);
printf("mdc : %lf \n",mdc);
printf("lc : %lf \n",lc);
printf("conc_la : %lf \n",conc_la);
printf("conc_lc : %lf \n",conc_lc);
printf("end---------i---------- : %d \n",i);
QJsonObject obj; QJsonObject obj;
obj["nuclideName"] = name; obj["nuclideName"] = name;
obj["conc"] = ac; obj["conc"] = ac;