修复新g_eff块没有正确返回bug

This commit is contained in:
wanglong 2024-09-29 14:29:56 +08:00
parent a76b353166
commit b053e070fe
4 changed files with 34 additions and 13 deletions

View File

@ -94,6 +94,7 @@ typedef struct _Read_Result_
jint b_r_record_count;
/* g_Efficiency Block */
jobjectArray g_e_dev_name; // device name
jobjectArray g_e_energy; // ¦Ã -energy (keV)
jobjectArray g_e_efficiency; // efficiency (counts in peak/photon emitted)
jobjectArray g_e_uncertainty; // uncertainty (counts in peak/photon emitted)

View File

@ -136,7 +136,6 @@ bool RadionuclideMessage::AnalyseMessgeBody(QTextStream &content)
return bIsValid = false;
}
radionuclide_msg_data.insert(block_flag.at(21), QVariant::fromValue(msg));
bool bRet = true;
QString line = content.readLine();
do {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.9.1, 2024-09-03T09:31:22. -->
<!-- Written by QtCreator 4.9.1, 2024-09-29T11:24:08. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>

View File

@ -28,7 +28,6 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
//文件解析
RadionuclideMessage message;
bool readflag = message.AnalysePHD_File(qfilename);
if (!readflag)
{
// **************** printf("THE PHDfile get failed:");
@ -299,6 +298,21 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
}
else
{
QString type = CplusToJava::jstring2QString(env, cresult.system_type);
if(type == 'C')
{
RadionuclideData::n_G_EfficiencyBlock ngeff = variant.value<RadionuclideData::n_G_EfficiencyBlock>();
allSize["g_e_energy"] = ngeff.g_energy.size();
cresult.g_e_energy = CplusToJava::QVectorD2jobjectArray(ngeff.g_energy, env);
allSize["g_e_efficiency"] = ngeff.efficiency.size();
cresult.g_e_efficiency = CplusToJava::QVectorD2jobjectArray(ngeff.efficiency, env);
allSize["g_e_uncertainty"] = ngeff.uncertainty.size();
cresult.g_e_uncertainty = CplusToJava::QVectorD2jobjectArray(ngeff.uncertainty, env);
allSize["g_e_dev_name"] = ngeff.dev_name.size();
cresult.g_e_dev_name = CplusToJava::QVectorQS2jobjectArray(ngeff.dev_name, env);
cresult.g_e_record_count = ngeff.record_count;
}
else {
RadionuclideData::_g_Efficiency_Block_ g_efficiency = variant.value<RadionuclideData::_g_Efficiency_Block_>();
allSize["g_e_energy"] = g_efficiency.g_energy.size();
cresult.g_e_energy = CplusToJava::QVectorD2jobjectArray(g_efficiency.g_energy, env);
@ -308,6 +322,7 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
cresult.g_e_uncertainty = CplusToJava::QVectorD2jobjectArray(g_efficiency.uncertainty, env);
cresult.g_e_record_count = g_efficiency.record_count;
}
}
//roi_limits内容获取
order = ORDER_ROI_LIMITS;
@ -795,6 +810,11 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
if (g_Efficiencyflag)
{
//设置成员变量g_e_name的值
fieldID = env->GetFieldID(energySpectrumStructClass, "g_e_dev_name", SIG_LIST);
fieldJobject = CplusToJava::Createjobject(env, allSize["g_e_dev_name"], cresult.g_e_dev_name);
env->SetObjectField(result, fieldID, fieldJobject);
//设置成员变量g_e_energy的值
fieldID = env->GetFieldID(energySpectrumStructClass, "g_e_energy", SIG_LIST);
fieldJobject = CplusToJava::Createjobject(env, allSize["g_e_energy"], cresult.g_e_energy);
@ -1079,7 +1099,7 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
fieldID = env->GetFieldID(energySpectrumStructClass, "lat", SIG_DOUBLE);
env->SetDoubleField(result, fieldID, cresult.lat);
}
printf("func end\n");
return result;
}
@ -1097,8 +1117,9 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl
//文件解析
RadionuclideMessage message;
printf("anals Start\n");
bool readflag = message.AnalysePHD_File(qfilename);
printf("anals end\n");
if (!readflag)
{
// **************** printf("THE PHDfile get failed:");