diff --git a/CplusToJava.h b/CplusToJava.h index 58adb2e..29e70bd 100644 --- a/CplusToJava.h +++ b/CplusToJava.h @@ -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) diff --git a/RadionuclideMessage.cpp b/RadionuclideMessage.cpp index 285d096..392dd90 100644 --- a/RadionuclideMessage.cpp +++ b/RadionuclideMessage.cpp @@ -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 { diff --git a/ReadPHDFile.pro.user b/ReadPHDFile.pro.user index ab01799..f00fa4f 100644 --- a/ReadPHDFile.pro.user +++ b/ReadPHDFile.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/org_jeecg_modules_native_jni_EnergySpectrumHandler.cpp b/org_jeecg_modules_native_jni_EnergySpectrumHandler.cpp index c509ee6..2b4740a 100644 --- a/org_jeecg_modules_native_jni_EnergySpectrumHandler.cpp +++ b/org_jeecg_modules_native_jni_EnergySpectrumHandler.cpp @@ -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,14 +298,30 @@ JNIEXPORT jobject JNICALL Java_org_jeecg_modules_native_1jni_EnergySpectrumHandl } else { - RadionuclideData::_g_Efficiency_Block_ g_efficiency = variant.value(); - allSize["g_e_energy"] = g_efficiency.g_energy.size(); - cresult.g_e_energy = CplusToJava::QVectorD2jobjectArray(g_efficiency.g_energy, env); - allSize["g_e_efficiency"] = g_efficiency.efficiency.size(); - cresult.g_e_efficiency = CplusToJava::QVectorD2jobjectArray(g_efficiency.efficiency, env); - allSize["g_e_uncertainty"] = g_efficiency.uncertainty.size(); - cresult.g_e_uncertainty = CplusToJava::QVectorD2jobjectArray(g_efficiency.uncertainty, env); - cresult.g_e_record_count = g_efficiency.record_count; + QString type = CplusToJava::jstring2QString(env, cresult.system_type); + if(type == 'C') + { + RadionuclideData::n_G_EfficiencyBlock ngeff = variant.value(); + 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(); + allSize["g_e_energy"] = g_efficiency.g_energy.size(); + cresult.g_e_energy = CplusToJava::QVectorD2jobjectArray(g_efficiency.g_energy, env); + allSize["g_e_efficiency"] = g_efficiency.efficiency.size(); + cresult.g_e_efficiency = CplusToJava::QVectorD2jobjectArray(g_efficiency.efficiency, env); + allSize["g_e_uncertainty"] = g_efficiency.uncertainty.size(); + cresult.g_e_uncertainty = CplusToJava::QVectorD2jobjectArray(g_efficiency.uncertainty, env); + cresult.g_e_record_count = g_efficiency.record_count; + } } //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:");