auto模块GammaFileUtil报错解决

auto模块实体类包下新增StructInsertInput,StructInsertOutput,TablePeaks文件
auto模块移动CalVluesOut实体类位置
auto模块引入CalValuesHandler代码
auto模块引入ejml包
SpectrumAnalysisServiceImpl去掉多余返回内容
GammaServiceImpl修改Energy,Resolution,Efficiency模块返回内容问题
This commit is contained in:
qiaoqinzheng 2023-09-19 11:12:51 +08:00
parent 500387e88a
commit 93c34a433f
13 changed files with 474 additions and 225 deletions

View File

@ -21,6 +21,12 @@
<groupId>org.jeecgframework.boot</groupId>
<artifactId>jeecg-boot-starter-cloud</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.ejml/ejml-simple -->
<dependency>
<groupId>org.ejml</groupId>
<artifactId>ejml-simple</artifactId>
<version>0.39</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>

View File

@ -18,7 +18,9 @@ import org.jeecg.modules.base.enums.CalName;
import org.jeecg.modules.base.enums.CalType;
import org.jeecg.modules.base.enums.MiddleDataType;
import org.jeecg.modules.eneity.*;
import org.jeecg.modules.eneity.vo.StructInsertOutput;
import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.eneity.vo.TablePeaks;
import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
import org.jeecg.modules.native_jni.CalValuesHandler;
import org.jeecg.modules.native_jni.EnergySpectrumHandler;

View File

@ -0,0 +1,60 @@
package org.jeecg.modules.eneity.vo;
import java.io.Serializable;
import java.util.List;
public class StructInsertInput implements Serializable {
//-----------------input:------------------
public List<Double> peakCentroid;
public List<Double> fwhmc;
public List<Double> tail;
public List<Double> tailAlpha;
public List<Double> upperTail;
public List<Double> upperTailAlpha;
public List<Double> area;
public List<Double> stepRatio;
public List<Double> usedEnerPara;
public List<Double> usedResoPara;
public List<Double> usedEffiPara;
public long num_g_channel;
public long begin_channel;
public List<Double> XCtrl;
public List<Double> YCtrl;
public List<Double> YSlope;
public int rg_low;
public int rg_high;
public List<Double> para_tail;
public List<Double> para_tailAlpha;
public List<Double> para_tailRight;
public List<Double> para_tailRightAlpha;
public List<Double> para_stepRatio;
public int curChan;
public List<Double> vCount;
}

View File

@ -0,0 +1,48 @@
package org.jeecg.modules.eneity.vo;
import java.io.Serializable;
import java.util.List;
public class StructInsertOutput implements Serializable {
//-----------------output:------------------
public List<Double> peakCentroid;
public List<Double> energy;
public List<Double> area;
public List<Double> sensitivity;
public List<Double> fwhm;
public List<Double> fwhmc;
public List<Double> stepRatio;
public List<Double> tail;
public List<Double> tailAlpha;
public List<Double> upperTail;
public List<Double> upperTailAlpha;
public List<Double> efficiency;
public List<Double> BWWidthChan;
public List<Double> recoilBetaChan;
public List<Double> recoilDeltaChan;
public List<Double> vIdx;
public List<Double> vLeft;
public List<Double> vRight;
public List<Double> vCentroid;
}

View File

@ -0,0 +1,30 @@
package org.jeecg.modules.eneity.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class TablePeaks implements Serializable {
private String lab;
private String nuclide;
private String energy;
private String netArea;
private String fwhm;
private String step;
private String bwGamma;
private boolean netAreaB;
private boolean centroid;
private boolean fwhmB;
}

View File

@ -0,0 +1,46 @@
package org.jeecg.modules.native_jni;
import org.jeecg.modules.entity.vo.PeakInfo;
import org.jeecg.modules.eneity.vo.StructInsertInput;
import org.jeecg.modules.eneity.vo.StructInsertOutput;
import org.jeecg.modules.native_jni.struct.CalValuesOut;
import java.util.List;
public class CalValuesHandler {
public static native CalValuesOut calFcnEval(List<Double> x, List<Double> para);
public static native CalValuesOut energyToChannel(List<Double> energy, List<Double> para);
public static native CalValuesOut calDerivEval(List<Double> channel, List<Double> para);
public static native double calDerivaOut(double Chan, List<Double> p);
public static native List<Double> interp1(PeakInfo peak, List<Double> t_base, List<Double> regChan);
public static native StructInsertOutput insertPeaks(StructInsertInput structInsertInput);
public static native List<Double> calFitPara(String type, int funcId, List<Double> x, List<Double> y, List<Double> err);
public static native StructInsertOutput ComputePeakRange(int peakSize, int m_nCount, List<Double> vCentroid, List<Double> vFwhmCh, List<Double> vTail, List<Double> vUpperTail);
public static native List<Double> calValues(int cal, int m_nChans);
public static native List<Double> GetFwhmcAll(int m_nChans);
public static native List<Double> calculateLC(List<Double> BaseLine, List<Double> FwhmcAll, double RiskLevelK);
public static native List<Double> calculateSCAC(List<Double> Spectrum, List<Double> BaseLine, List<Double> FwhmcAll);
public static native boolean armaAny(List<Double> Spectrum);
public static native String calUpdate(String dataType, List<Double> certEne, boolean E1, boolean R, boolean E2, boolean KeepCalPeakSearchPeaks, double k_back, double k_alpha, double k_beta);
public static native String peakSearch(double ECutLow, double ECutHigh, double deltaE, double pssLow, double k_back, double k_alpha, double k_beta);
public static native String baseImprove(double BaseImprovePSS, double k_back, double k_alpha, double k_beta);
public static native String fitPeakFull();
}

View File

@ -1,4 +1,4 @@
package org.jeecg.modules.native_jni;
package org.jeecg.modules.native_jni.struct;
import java.util.List;

View File

@ -2562,9 +2562,13 @@ public class GammaFileUtil {
strBuffer.append("..................................... Spectrum Analysis Finished .....................................");
strBuffer.append("\n");
strBuffer.append("Data store successfully .....");
strBuffer.append("\n");
strBuffer.append("Instance status successfully set to: .....");
strBuffer.append("\n");
strBuffer.append("Error info: data has NULL INF.....");
strBuffer.append("\n");
strBuffer.append("------------------------- Sample Analyse Successfully at "+DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss")+" -------------------------");
strBuffer.append("\n");
return strBuffer.toString();
}
@ -2595,7 +2599,7 @@ public class GammaFileUtil {
strBuffer.append(" \n");
String qsNuclidesName = "";
for(int m=0;m<middleData.nucl_ided_Nuclidename.size()-1;m++) {
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.get(m) + ",";
qsNuclidesName = qsNuclidesName+ middleData.nucl_ided_Nuclidename.get(m) + ";";
}
if(middleData.nucl_ided_Nuclidename.size()>1) {
qsNuclidesName = qsNuclidesName+middleData.nucl_ided_Nuclidename.get(middleData.nucl_ided_Nuclidename.size()-1);
@ -2717,37 +2721,16 @@ public class GammaFileUtil {
return data;
}
public List<String> DoubleLimit_I(List<Double> _data) {
List<String> rdata = new LinkedList<>();
for(int pos=0;pos<_data.size();pos++) {
if(Objects.isNull(_data.get(pos))) {
rdata.add("NULL");
} else {
rdata.add(String.valueOf(_data.get(pos).intValue()));
}
}
return rdata;
}
public List<String> DoubleLimit_G(List<Double> _data) {
NumberFormat numberFormat = new DecimalFormat("0.##########E0");
List<String> rdata = new LinkedList<>();
for(int pos=0;pos<_data.size();pos++) {
Double value = _data.get(pos);
if (String.valueOf(value).indexOf("e")>0) {
if(Objects.isNull(value)) {
rdata.add("NULL");
} else if (value > 0){
rdata.add(String.format("%.10g", value));
} else {
rdata.add(numberFormat.format(value));
}
} else {
if (String.format("%.1f", value).indexOf(".0")>0) {
rdata.addAll(DoubleLimit_I(_data));
break;
} else {
rdata.addAll(DoubleLimit(_data));
break;
}
rdata.add(String.valueOf(value));
}
}
return rdata;
@ -2855,9 +2838,6 @@ public class GammaFileUtil {
String qsSaveBaseLine = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsBaseLinePath;
String qsSaveLc = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsLcPath;
String qsSaveScac = StringPool.SLASH+spectrumPathProperties.getRootPath()+StringPool.SLASH+qsScacPath;
middleData.analyses_baseline_filePath = qsSaveBaseLine;
middleData.analyses_lc_filePath = qsSaveLc;
middleData.analyses_scac_filePath = qsSaveScac;
// WriteBaseInfo(fileAnlyse.getBaseCtrls(),qsSaveBaseLine);
// WriteLcScac(fileAnlyse.getVLc(),"Lc",qsSaveLc);
// WriteLcScac(fileAnlyse.getVScac(),"Scac",qsSaveScac);
@ -2876,6 +2856,16 @@ public class GammaFileUtil {
middleData.analyses_searchThreshold = fileAnlyse.getUsedSetting().getEnergyTolerance();
middleData.analyses_numberOfPeaks = fileAnlyse.getVPeak().size();
middleData.analyses_totalCounts = totalNumber;
middleData.analyses_baseline_filePath = qsBaseLinePath;
middleData.analyses_lc_filePath = qsLcPath;
middleData.analyses_scac_filePath = qsScacPath;
middleData.analyses_baseline_absolute_filePath =qsSaveLc;
middleData.analyses_lc_absolute_filePath=qsSaveLc;
middleData.analyses_scac_absolute_filePath=qsSaveScac;
middleData.analyses_save_absolute_filePath=spectrumPathProperties.getRootPath()+StringPool.SLASH+qsSaveFile;
middleData.analyses_absolute_LogPath=spectrumPathProperties.getLogPath()+StringPool.SLASH+qsLogPath;
middleData.analyses_absolute_ReportPath=spectrumPathProperties.getRootPath()+StringPool.SLASH+qsReportPath;
if(fileAnlyse.getUsedEnerKD() != null && fileAnlyse.getUsedEnerKD().getG_energy().size() != 0) {
middleData.calibration_pairs_E_Caltype = CalType.ENERGY_CAL.getType();
@ -2975,7 +2965,6 @@ public class GammaFileUtil {
//拼写刻度字符串
//获取刻度描述字符串
middleData.calibration_sample_type = fileAnlyse.getHeader().getSystem_type();
NumberFormat numberFormat = new DecimalFormat("0.######E0");
String coeffEnergy = "";
String uncerEnergy = "";
String funcDefEnergy = "";
@ -2988,18 +2977,18 @@ public class GammaFileUtil {
funcType = fileAnlyse.getUsedEnerPara().getP().get(0).intValue();
}
for(int m=1;m<coeffNumber-1;m++) {
coeffEnergy += numberFormat.format(fileAnlyse.getUsedEnerPara().getP().get(m))+',';
coeffEnergy += String.format("%e", fileAnlyse.getUsedEnerPara().getP().get(m))+ ",";
}
if(coeffNumber>0) {
coeffEnergy+=numberFormat.format(fileAnlyse.getUsedEnerPara().getP().get(coeffNumber-1));
coeffEnergy+=String.format("%e", fileAnlyse.getUsedEnerPara().getP().get(coeffNumber-1));
}
uncerNumber = fileAnlyse.getUsedEnerPara().getPerr().size();
for(int m=0;m<uncerNumber-1;m++) {
uncerEnergy += numberFormat.format(fileAnlyse.getUsedEnerPara().getPerr().get(m))+',';
uncerEnergy += String.format("%e", fileAnlyse.getUsedEnerPara().getPerr().get(m))+ ",";
}
if(uncerNumber>0) {
uncerEnergy+=numberFormat.format(fileAnlyse.getUsedEnerPara().getPerr().get(uncerNumber-1));
uncerEnergy+=String.format("%e", fileAnlyse.getUsedEnerPara().getPerr().get(uncerNumber-1));
}
funcDefEnergy = EquationDescription(funcType);
funcTypeDefEnergy = EquationName(funcType);
@ -3021,18 +3010,18 @@ public class GammaFileUtil {
funcType = fileAnlyse.getUsedEffiPara().getP().get(0).intValue();
}
for(int m=1;m<coeffNumber-1;m++) {
coeffEffi += numberFormat.format(fileAnlyse.getUsedEffiPara().getP().get(m))+',';
coeffEffi += String.format("%e", fileAnlyse.getUsedEffiPara().getP().get(m))+ ",";
}
if(coeffNumber>0) {
coeffEffi+=numberFormat.format(fileAnlyse.getUsedEffiPara().getP().get(coeffNumber-1));
coeffEffi+=String.format("%e", fileAnlyse.getUsedEffiPara().getP().get(coeffNumber-1));
}
uncerNumber = fileAnlyse.getUsedEffiPara().getPerr().size();
for(int m=0;m<uncerNumber-1;m++) {
uncerEffi += numberFormat.format(fileAnlyse.getUsedEffiPara().getPerr().get(m))+',';
uncerEffi += String.format("%e", fileAnlyse.getUsedEffiPara().getPerr().get(m))+ ",";
}
if(uncerNumber>0) {
uncerEffi+= numberFormat.format(fileAnlyse.getUsedEffiPara().getPerr().get(uncerNumber-1));
uncerEffi+= String.format("%e", fileAnlyse.getUsedEffiPara().getPerr().get(uncerNumber-1));
}
funcDefEffi = EquationDescription(funcType);
funcTypeDefEffi = EquationName(funcType);
@ -3053,18 +3042,18 @@ public class GammaFileUtil {
funcType = fileAnlyse.getUsedResoPara().getP().get(0).intValue();
}
for(int m=1;m<coeffNumber-1;m++) {
coeffReso += numberFormat.format(fileAnlyse.getUsedResoPara().getP().get(m))+',';
coeffReso += String.format("%e", fileAnlyse.getUsedResoPara().getP().get(m))+ ",";
}
if(coeffNumber>0) {
coeffReso+= numberFormat.format(fileAnlyse.getUsedResoPara().getP().get(coeffNumber-1));
coeffReso+= String.format("%e", fileAnlyse.getUsedResoPara().getP().get(coeffNumber-1));
}
uncerNumber = fileAnlyse.getUsedResoPara().getPerr().size();
for(int m=0;m<uncerNumber-1;m++) {
uncerReso += numberFormat.format(fileAnlyse.getUsedResoPara().getPerr().get(m))+',';
uncerReso += String.format("%e", fileAnlyse.getUsedResoPara().getPerr().get(m))+ ",";
}
if(uncerNumber>0) {
uncerReso+= numberFormat.format(fileAnlyse.getUsedResoPara().getPerr().get(uncerNumber-1));
uncerReso+= String.format("%e", fileAnlyse.getUsedResoPara().getPerr().get(uncerNumber-1));
}
funcDefReso = EquationDescription(funcType);
funcTypeDefReso = EquationName(funcType);
@ -3085,18 +3074,18 @@ public class GammaFileUtil {
funcType = fileAnlyse.getUsedTotEPara().getP().get(0).intValue();
}
for(int m=1;m<coeffNumber-1;m++) {
coeffTotE += numberFormat.format(fileAnlyse.getUsedTotEPara().getP().get(m))+',';
coeffTotE += String.format("%e", fileAnlyse.getUsedTotEPara().getP().get(m))+ ",";
}
if(coeffNumber>0) {
coeffTotE+= numberFormat.format(fileAnlyse.getUsedTotEPara().getP().get(coeffNumber-1));
coeffTotE+= String.format("%e", fileAnlyse.getUsedTotEPara().getP().get(coeffNumber-1));
}
uncerNumber = fileAnlyse.getUsedTotEPara().getPerr().size();
for(int m=0;m<uncerNumber-1;m++) {
uncerTotE += numberFormat.format(fileAnlyse.getUsedTotEPara().getPerr().get(m))+',';
uncerTotE += String.format("%e", fileAnlyse.getUsedTotEPara().getPerr().get(m))+ ",";
}
if(uncerNumber>0) {
uncerTotE+= numberFormat.format(fileAnlyse.getUsedTotEPara().getPerr().get(uncerNumber-1));
uncerTotE+= String.format("%e", fileAnlyse.getUsedTotEPara().getPerr().get(uncerNumber-1));
}
funcDefTotE = EquationDescription(funcType);
funcTypeDefTotE = EquationName(funcType);
@ -3178,7 +3167,7 @@ public class GammaFileUtil {
dvctComments.add(t_comment);
dvctNuclide_name.add(StringUtils.join(fileAnlyse.getVPeak().get(m).nuclides, ";"));
}
middleData.peaks_idPeak =DoubleLimit_I(dvctIDPEAK);
middleData.peaks_idPeak =DoubleLimit_G(dvctIDPEAK);
middleData.peaks_peakCentroid =DoubleLimit_G(dvctCENTROIDCHANNEL);
middleData.peaks_uncpeakCentroid =DoubleLimit_G(dvctUNCCENTROIDCHANNEL);
middleData.peaks_Energy =DoubleLimit_G(dvctENERGY);
@ -3247,11 +3236,11 @@ public class GammaFileUtil {
dvctUNCENERGY.add(itor.getValue().getVUncertE().get(m));
dvctABUNDANCE.add(itor.getValue().getVYield().get(m));
dvctUNCABUNDANCE.add(itor.getValue().getVUncertY().get(m));
dvctACTIVITY.add(numberFormat.format(itor.getValue().getActivity()));
dvctACTIVITY.add(String.format("%e", itor.getValue().getActivity()));
dvctUNCACTIVITY.add(itor.getValue().getAct_err());
dvctEFFIC.add(itor.getValue().getEfficiency());
dvctUNEFFIC.add(itor.getValue().getEffi_err());
dvctMDA.add(numberFormat.format(itor.getValue().getMda()));
dvctMDA.add(String.format("%e", itor.getValue().getMda()));
// dvctKEY_FLAG.add(itor.value().vYield.get(m));
dvctCSC_RATIO.add(1.0);
dvctCSC_RATIO_ERR.add(0.0);
@ -3261,11 +3250,11 @@ public class GammaFileUtil {
} else {
dvctKEY_FLAG.add(0.0);
}
dvctMDC.add(numberFormat.format(itor.getValue().getMdc()));
dvctCONCENTRATION.add(numberFormat.format(itor.getValue().getConcentration()));
dvctMDC.add(String.format("%e", itor.getValue().getMdc()));
dvctCONCENTRATION.add(String.format("%e", itor.getValue().getConcentration()));
}
nucl_lines_ided_data.nuclideFullname = svctNUCLIDEFULLNAME;
nucl_lines_ided_data.idPeak =DoubleLimit_I(dvctIDPEAK);
nucl_lines_ided_data.idPeak =DoubleLimit_G(dvctIDPEAK);
nucl_lines_ided_data.Energy =DoubleLimit_G(dvctENERGY);
nucl_lines_ided_data.uncEnergy =DoubleLimit_G(dvctUNCENERGY);
nucl_lines_ided_data.Abundance =DoubleLimit_G(dvctABUNDANCE);
@ -3285,34 +3274,34 @@ public class GammaFileUtil {
}
// gards_ nucl_ided数据表
if( fileAnlyse.getMapNucActMda().size() != 0) {
List<String> svctNUCLIDEFULLNAME1 = new LinkedList<>();
List<String> svctNUCLIDEFULLNAME = new LinkedList<>();
List<String> svctTYPE = new LinkedList<>();
List<Double> dvctHALFLIFE = new LinkedList<>();
List<String> dvctAVE_ACTIV = new LinkedList<>();
List<Double> dvctAVE_ACTIV_ERR = new LinkedList<>();
List<Double> dvctACTIV_KEY = new LinkedList<>();
List<Double> dvctACTIV_KEY_ERR = new LinkedList<>();
List<String> dvctMDA1 = new LinkedList<>();
List<String> dvctMDA = new LinkedList<>();
List<Double> dvctMDA_ERR = new LinkedList<>();
List<Double> dvctNID_FLAG = new LinkedList<>();
List<Double> dvctCSC_RATIO1 = new LinkedList<>();
List<Double> dvctCSC_RATIO_ERR1 = new LinkedList<>();
List<Double> dvctCSC_MOD_FLAG1 = new LinkedList<>();
List<String> dvctMDC1 = new LinkedList<>();
List<String> dvctCONCENTRATION1 = new LinkedList<>();
List<Double> dvctCSC_RATIO = new LinkedList<>();
List<Double> dvctCSC_RATIO_ERR = new LinkedList<>();
List<Double> dvctCSC_MOD_FLAG = new LinkedList<>();
List<String> dvctMDC = new LinkedList<>();
List<String> dvctCONCENTRATION = new LinkedList<>();
List<Double> dvctKey_Energy = new LinkedList<>();
List<Double> dvctKey_Yield = new LinkedList<>();
for(Map.Entry<String, NuclideActMda> itor_v: fileAnlyse.getMapNucActMda().entrySet()) {
String nuclideName = itor_v.getKey();
svctNUCLIDEFULLNAME1.add(nuclideName);
svctNUCLIDEFULLNAME.add(nuclideName);
dvctHALFLIFE.add(itor_v.getValue().getHalflife());
dvctACTIV_KEY.add(itor_v.getValue().getActivity());
dvctACTIV_KEY_ERR.add(itor_v.getValue().getAct_err());
dvctMDA1.add(numberFormat.format(itor_v.getValue().getMda()));
dvctMDC1.add(numberFormat.format(itor_v.getValue().getMdc()));
dvctCONCENTRATION1.add(numberFormat.format(itor_v.getValue().getConcentration()));
dvctCSC_RATIO1.add(1.0);
dvctCSC_RATIO_ERR1.add(0.0);
dvctMDA.add(String.format("%e", itor_v.getValue().getMda()));
dvctMDC.add(String.format("%e", itor_v.getValue().getMdc()));
dvctCONCENTRATION.add(String.format("%e", itor_v.getValue().getConcentration()));
dvctCSC_RATIO.add(1.0);
dvctCSC_RATIO_ERR.add(0.0);
if(itor_v.getValue().getCalculateIdx() >= 0 && itor_v.getValue().getCalculateIdx()<itor_v.getValue().getVEnergy().size()) {
dvctKey_Energy.add(itor_v.getValue().getVEnergy().get(itor_v.getValue().getCalculateIdx()));
}
@ -3320,21 +3309,21 @@ public class GammaFileUtil {
dvctKey_Yield.add(itor_v.getValue().getVYield().get(itor_v.getValue().getCalculateIdx()));
}
}
middleData.nucl_ided_Nuclidename = svctNUCLIDEFULLNAME1;
middleData.nucl_ided_Nuclidename = svctNUCLIDEFULLNAME;
middleData.nucl_ided_Type= svctTYPE;
middleData.nucl_ided_Halflife =DoubleLimit_G(dvctHALFLIFE);
middleData.nucl_ided_ave_activ = dvctAVE_ACTIV;
middleData.nucl_ided_ave_activ_err =DoubleLimit_G(dvctAVE_ACTIV_ERR);
middleData.nucl_ided_activ_key =DoubleLimit_G(dvctACTIV_KEY);
middleData.nucl_ided_activ_key_err =DoubleLimit_G(dvctACTIV_KEY_ERR);
middleData.nucl_ided_mda = dvctMDA1;
middleData.nucl_ided_mda = dvctMDA;
middleData.nucl_ided_mda_err =DoubleLimit_G(dvctMDA_ERR);
middleData.nucl_ided_nid_flag =DoubleLimit_G(dvctNID_FLAG);
middleData.nucl_ided_csc_ratio =DoubleLimit_G(dvctCSC_RATIO1);
middleData.nucl_ided_csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR1);
middleData.nucl_ided_csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG1);
middleData.nucl_ided_MDC = dvctMDC1;
middleData.nucl_ided_Concentration = dvctCONCENTRATION1;
middleData.nucl_ided_csc_ratio =DoubleLimit_G(dvctCSC_RATIO);
middleData.nucl_ided_csc_ratio_err =DoubleLimit_G(dvctCSC_RATIO_ERR);
middleData.nucl_ided_csc_mod_flag =DoubleLimit_G(dvctCSC_MOD_FLAG);
middleData.nucl_ided_MDC = dvctMDC;
middleData.nucl_ided_Concentration = dvctCONCENTRATION;
middleData.nucl_ided_Key_Energy = DoubleLimit_G(dvctKey_Energy);
middleData.nucl_ided_Key_Yield = DoubleLimit_G(dvctKey_Yield);
}

View File

@ -28,7 +28,7 @@ public class GammaController {
}
@GetMapping("gammaByDB")
public Result gammaByDB(@RequestParam Integer sampleId, @RequestParam String dbName, HttpServletRequest request){
public Result gammaByDB(Integer sampleId, String dbName, HttpServletRequest request){
return gammaService.gammaByDB(dbName, sampleId, request);
}
@ -40,7 +40,7 @@ public class GammaController {
@GetMapping("configure")
@ApiOperation(value = "analyze菜单下configure页面数据", notes = "analyze菜单下configure页面数据")
public Result configure(@RequestParam Integer sampleId, @RequestParam String fileName) {
public Result configure(Integer sampleId, String fileName) {
return gammaService.configure(sampleId, fileName);
}
@ -52,7 +52,7 @@ public class GammaController {
@GetMapping("InteractiveTool")
@ApiOperation(value = "analyze菜单下InteractiveTool页面数据", notes = "analyze菜单下InteractiveTool页面数据")
public Result InteractiveTool(@RequestParam Integer sampleId, @RequestParam String fileName, HttpServletRequest request) {
public Result InteractiveTool(Integer sampleId, String fileName, HttpServletRequest request) {
return gammaService.InteractiveTool(sampleId, fileName, request);
}
@ -175,7 +175,7 @@ public class GammaController {
@GetMapping("energyCalibration")
@ApiOperation(value = "查看Energy Calibration数据", notes = "查看Energy Calibration数据")
public Result energyCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
public Result energyCalibration(Integer sampleId, String fileName, String currentText) {
return gammaService.energyCalibration(sampleId, fileName, currentText);
}
@ -199,7 +199,7 @@ public class GammaController {
@GetMapping("resolutionCalibration")
@ApiOperation(value = "查看Resolution Calibration数据", notes = "查看Resolution Calibration数据")
public Result resolutionCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
public Result resolutionCalibration(Integer sampleId, String fileName, String currentText) {
return gammaService.resolutionCalibration(sampleId, fileName, currentText);
}
@ -223,7 +223,7 @@ public class GammaController {
@GetMapping("EfficiencyCalibration")
@ApiOperation(value = "查看Efficiency Calibration数据", notes = "查看Efficiency Calibration数据")
public Result EfficiencyCalibration(@RequestParam Integer sampleId, String fileName, String currentText) {
public Result EfficiencyCalibration(Integer sampleId, String fileName, String currentText) {
return gammaService.EfficiencyCalibration(sampleId, fileName, currentText);
}
@ -265,18 +265,18 @@ public class GammaController {
@GetMapping("viewComment")
@ApiOperation(value = "查看Comment页面数据", notes = "查看Comment页面数据")
public Result viewComment(@RequestParam Integer sampleId, String fileName) {
public Result viewComment(Integer sampleId, String fileName) {
return gammaService.viewComment(sampleId, fileName);
}
@GetMapping("peakInformation")
@ApiOperation(value = "查看Peak Information页面数据", notes = "查看Peak Information页面数据")
public Result<?> peakInformation(@RequestParam Integer sampleId, String fileName){
public Result<?> peakInformation(Integer sampleId, String fileName){
return gammaService.peakInformation(sampleId, fileName);
}
@GetMapping("exportPeakInformation")
public void exportPeakInformation(@RequestParam Integer sampleId, String fileName,
public void exportPeakInformation(Integer sampleId, String fileName,
HttpServletResponse response){
gammaService.exportPeakInformation(sampleId, fileName, response);
}

View File

@ -0,0 +1,46 @@
package org.jeecg.modules.controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@RestController
@RequestMapping("sse")
public class SSEController {
private static Map<String, SseEmitter> sseCache = new ConcurrentHashMap<>();
@GetMapping("subscribe")
public SseEmitter subscribe(String id) {
// 超时时间设置为1小时
SseEmitter sseEmitter = new SseEmitter(3600_000L);
sseCache.put(id, sseEmitter);
sseEmitter.onTimeout(() -> sseCache.remove(id));
sseEmitter.onCompletion(() -> System.out.println("完成!!!"));
return sseEmitter;
}
@GetMapping("push")
public String push(String id, String content) throws IOException {
SseEmitter sseEmitter = sseCache.get(id);
if (sseEmitter != null) {
sseEmitter.send(content);
}
return "over";
}
@GetMapping("over")
public String over(String id) {
SseEmitter sseEmitter = sseCache.get(id);
if (sseEmitter != null) {
sseEmitter.complete();
sseCache.remove(id);
}
return "over";
}
}

View File

@ -81,12 +81,32 @@ public class BgDataAnlyseResultIn implements Serializable {
/**
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
*/
private boolean bGammaEnergyValid;
private boolean bGammaEnergyValidSample;
/**
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
*/
private boolean bBetaEnergyValid;
private boolean bBetaEnergyValidSample;
/**
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
*/
private boolean bGammaEnergyValidGas;
/**
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
*/
private boolean bBetaEnergyValidGas;
/**
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
*/
private boolean bGammaEnergyValidDet;
/**
* 是否点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮
*/
private boolean bBetaEnergyValidDet;
/**
* 是否选中sampleData

View File

@ -29,6 +29,7 @@ import org.jeecg.modules.entity.vo.*;
import org.jeecg.modules.entity.*;
import org.jeecg.modules.mapper.SpectrumAnalysisMapper;
import org.jeecg.modules.native_jni.CalValuesHandler;
import org.jeecg.modules.native_jni.struct.CalValuesOut;
import org.jeecg.modules.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@ -1152,11 +1153,15 @@ public class GammaServiceImpl implements IGammaService {
}
List<String> dataSourceList = phd.getMapEnerKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
List<Double> m_vCurCentroid = phd.getMapEnerKD().get(currentText).getCentroid_channel();
List<Double> m_vCurEnergy = phd.getMapEnerKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapEnerKD().get(currentText).getUncertainty();
map.put("uncert", m_vCurUncert);
ParameterInfo m_curParam = phd.getMapEnerPara().get(currentText);
if (Objects.isNull(m_curParam)) {
m_curParam = new ParameterInfo();
}
map.put("param", m_curParam);
int num = m_vCurEnergy.size();
if(num < 1){
@ -1179,6 +1184,7 @@ public class GammaServiceImpl implements IGammaService {
gammaFileUtil.UpdateChartEnergy(m_vCurEnergy, m_curParam, m_vCurCentroid, phd, map);
map.put("rg_low", phd.getBaseCtrls().getRg_low());
map.put("rg_high", phd.getBaseCtrls().getRg_high());
}
result.setSuccess(true);
result.setResult(map);
return result;
@ -1316,11 +1322,15 @@ public class GammaServiceImpl implements IGammaService {
}
List<String> dataSourceList = phd.getMapResoKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
List<Double> m_vCurReso = phd.getMapResoKD().get(currentText).getFWHM();
List<Double> m_vCurEnergy = phd.getMapResoKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapResoKD().get(currentText).getUncertainty();
map.put("uncert", m_vCurUncert);
ParameterInfo m_curParam = phd.getMapResoPara().get(currentText);
if (Objects.isNull(m_curParam)) {
m_curParam = new ParameterInfo();
}
map.put("param", m_curParam);
int num = m_vCurEnergy.size();
if(num < 1){
@ -1343,6 +1353,7 @@ public class GammaServiceImpl implements IGammaService {
gammaFileUtil.UpdateChartResolution(m_vCurEnergy, m_curParam, m_vCurReso, phd, map);
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
map.put("G_energy_span", phd.getSpec().getG_energy_span());
}
result.setSuccess(true);
result.setResult(map);
return result;
@ -1479,11 +1490,15 @@ public class GammaServiceImpl implements IGammaService {
}
List<String> dataSourceList = phd.getMapEffiKD().keySet().stream().collect(Collectors.toList());
map.put("list_dataSource", dataSourceList);
if (StringUtils.isNotBlank(currentText)) {
List<Double> m_vCurEffi = phd.getMapEffiKD().get(currentText).getEfficiency();
List<Double> m_vCurEnergy = phd.getMapEffiKD().get(currentText).getG_energy();
List<Double> m_vCurUncert = phd.getMapEffiKD().get(currentText).getUncertainty();
map.put("uncert", m_vCurUncert);
ParameterInfo m_curParam = phd.getMapEffiPara().get(currentText);
if (Objects.isNull(m_curParam)) {
m_curParam = new ParameterInfo();
}
map.put("param", m_curParam);
int num = m_vCurEnergy.size();
if(num < 1){
@ -1506,6 +1521,7 @@ public class GammaServiceImpl implements IGammaService {
gammaFileUtil.UpdateChartEfficiency(m_vCurEnergy, m_curParam, m_vCurEffi, phd, map);
map.put("ECutAnalysis_Low", phd.getSetting().getECutAnalysis_Low());
map.put("G_energy_span", phd.getSpec().getG_energy_span());
}
result.setSuccess(true);
result.setResult(map);
return result;
@ -1946,6 +1962,7 @@ public class GammaServiceImpl implements IGammaService {
return;
}
String reportContent = gammaFileUtil.GetReportContent(phd, false);
// String reportContent = gammaFileUtil.GetReportContent(phd, true);
OutputStream fos = null;
try {
//设置响应类型

View File

@ -327,12 +327,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
public Result getDBSpectrumChart(String dbName, Integer sampleId) {
Result result = new Result();
Map<String, Object> resultMap = new HashMap<>();
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList= new LinkedList<>();
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList = new LinkedList<>();
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
List<GardsROIResultsSpectrum> roiResultsSpectrumList = new LinkedList<>();
List<GardsCalibrationPairsSpectrum> gammaCalibrationPairsList = new LinkedList<>();
List<GardsCalibrationPairsSpectrum> betaCalibrationPairsList = new LinkedList<>();
List<GardsXeResultsSpectrum> xeResultsSpectrumList = new LinkedList<>();
if (Objects.isNull(sampleId)){
result.error500("请选择一条数据");
@ -341,31 +335,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
if (dbName.equalsIgnoreCase("auto")){
dbName = "RNAUTO";
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId);
gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNAUTO", idAnalysis, sampleId);
betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNAUTO", idAnalysis, sampleId);
roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNAUTO", idAnalysis, sampleId);
roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNAUTO", idAnalysis, sampleId);
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", idAnalysis, sampleId);
}else if (dbName.equalsIgnoreCase("man")){
dbName = "RNMAN";
Integer idAnalysis = spectrumAnalysisMapper.getAnalysisID("RNMAN", sampleId);
gammaCalibrationPairsList = spectrumAnalysisMapper.ReadGammaFitChannelEnergy(idAnalysis, sampleId);
gammaCalibrationSpectrumList = spectrumAnalysisMapper.ReadGammaCalibrationParam("RNMAN", idAnalysis, sampleId);
betaCalibrationPairsList = spectrumAnalysisMapper.ReadBetaFitChannelEnergy(idAnalysis, sampleId);
betaCalibrationSpectrumList = spectrumAnalysisMapper.ReadBetaCalibrationParam("RNMAN", idAnalysis, sampleId);
roiChannelsSpectrumList = spectrumAnalysisMapper.ReadROIChannels("RNMAN", idAnalysis, sampleId);
roiResultsSpectrumList = spectrumAnalysisMapper.ReadROIResults("RNMAN", idAnalysis, sampleId);
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNMAN", idAnalysis, sampleId);
resultMap.put("gammaCalibrationPairsList", gammaCalibrationPairsList);
resultMap.put("betaCalibrationPairsList", betaCalibrationPairsList);
}else {
result.error500("数据库类型不存在");
return result;
}
resultMap.put("gammaCalibrationSpectrumList", gammaCalibrationSpectrumList);
resultMap.put("betaCalibrationSpectrumList", betaCalibrationSpectrumList);
resultMap.put("roiChannelsSpectrumList", roiChannelsSpectrumList);
resultMap.put("roiResultsSpectrumList", roiResultsSpectrumList);
//查询数据库文件信息
SpectrumFileRecord dbSpectrumFilePath = spectrumAnalysisMapper.getDBSpectrumFilePath(dbName, sampleId);
List<String> filePath = new LinkedList<>();
@ -2409,7 +2387,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
BetaGammaAnalyzeCurrentProcess(analyseData, dbSpectrumFilePath, userName);
}
}
} else if ("AllSpectrum".equals(analyseData.getApplyType())) {
Map<String, SpectrumFileRecord> m_loadData = new HashMap<>();
for (int i=0; i<analyseData.getSampleIds().size(); i++) {
@ -2746,8 +2723,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
//处理数据 获取对应的channel/energy值
getChannelAndEnergy(anlyseResultIn, betaList, gammaList);
//分析文件内容
Map<String, Object> map = new HashMap<>();
analyzePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara, map);
analyzePHDFile(anlyseResultIn, betaFittingPara, gammaFittingPara);
//处理文件名称
String sampleFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
String gasFilePathName = phdFileUtil.NameStandardBy(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
@ -2992,7 +2968,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
if(anlyseResultIn.isCheckSample()) {
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath());
//没有点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮 channel/energy数据读取文件 如果点击过数据来源页面
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBGammaEnergyValidSample()){
anlyseResultIn.setG_channel_sample(sourceData.g_centroid_channel);
anlyseResultIn.setG_energy_sample(sourceData.g_energy);
} else {
@ -3002,7 +2978,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
anlyseResultIn.setG_energy_sample(energys);
}
//没有点击过Energy Calibration页面下Beta Detector Calibration的fitting按钮 channel/energy数据读取文件 如果点击过数据来源页面
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBBetaEnergyValidSample()){
anlyseResultIn.setB_channel_sample(sourceData.b_channel);
anlyseResultIn.setB_energy_sample(sourceData.b_electron_energy);
} else {
@ -3022,7 +2998,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
if (Objects.nonNull(gasTmp)) {
if (anlyseResultIn.isCheckGas()) {
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(gasTmp.getAbsolutePath());
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBGammaEnergyValidGas()){
anlyseResultIn.setG_channel_gas(sourceData.g_centroid_channel);
anlyseResultIn.setG_energy_gas(sourceData.g_energy);
} else {
@ -3031,7 +3007,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
List<Double> energys = gammaList.stream().map(SeriseData::getY).collect(Collectors.toList());
anlyseResultIn.setG_energy_gas(energys);
}
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBBetaEnergyValidGas()){
anlyseResultIn.setB_channel_gas(sourceData.b_channel);
anlyseResultIn.setB_energy_gas(sourceData.b_electron_energy);
} else {
@ -3051,7 +3027,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
if (Objects.nonNull(detTmp)) {
if (anlyseResultIn.isCheckDet()) {
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(detTmp.getAbsolutePath());
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBGammaEnergyValidDet()){
anlyseResultIn.setG_channel_det(sourceData.g_centroid_channel);
anlyseResultIn.setG_energy_det(sourceData.g_energy);
} else {
@ -3060,7 +3036,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
List<Double> energys = gammaList.stream().map(SeriseData::getY).collect(Collectors.toList());
anlyseResultIn.setG_energy_det(energys);
}
if (!anlyseResultIn.isBGammaEnergyValid()){
if (!anlyseResultIn.isBBetaEnergyValidDet()){
anlyseResultIn.setB_channel_det(sourceData.b_channel);
anlyseResultIn.setB_energy_det(sourceData.b_electron_energy);
} else {
@ -3079,7 +3055,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
}
}
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara, Map<String, Object> map) {
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara) {
//根据文件路径 文件名称获取对应的临时文件
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
File gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
@ -3132,26 +3108,13 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
anlyseResultIn.setXeData(xeResultsSpectrumList);
List<GardsCalibrationSpectrum> gammaCalibrationSpectrumList = new LinkedList<>();
if (anlyseResultIn.isBGammaEnergyValid()) {
if (anlyseResultIn.isBGammaEnergyValidSample()) {
GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum();
gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
gammaCalibrationS.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
gammaCalibrationS.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
gammaCalibrationS.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
gammaCalibrationSpectrumList.add(gammaCalibrationS);
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
gammaCalibrationSpectrumList.add(gammaCalibrationG);
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
gammaCalibrationSpectrumList.add(gammaCalibrationD);
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
} else {
GardsCalibrationSpectrum gammaCalibrationS = new GardsCalibrationSpectrum();
gammaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
@ -3159,42 +3122,47 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
gammaCalibrationS.setCoeff2(bgAnalyseResult.s_g_fitting_c_e.get(1));
gammaCalibrationS.setCoeff3(bgAnalyseResult.s_g_fitting_c_e.get(2));
gammaCalibrationSpectrumList.add(gammaCalibrationS);
}
if (anlyseResultIn.isBGammaEnergyValidGas()) {
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
gammaCalibrationG.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
gammaCalibrationG.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
gammaCalibrationG.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
gammaCalibrationSpectrumList.add(gammaCalibrationG);
} else {
GardsCalibrationSpectrum gammaCalibrationG = new GardsCalibrationSpectrum();
gammaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
gammaCalibrationG.setCoeff1(bgAnalyseResult.g_g_fitting_c_e.get(0));
gammaCalibrationG.setCoeff2(bgAnalyseResult.g_g_fitting_c_e.get(1));
gammaCalibrationG.setCoeff3(bgAnalyseResult.g_g_fitting_c_e.get(2));
gammaCalibrationSpectrumList.add(gammaCalibrationG);
}
if (anlyseResultIn.isBGammaEnergyValidDet()) {
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
gammaCalibrationD.setCoeff1(Double.valueOf(gammaFittingPara.get(0)));
gammaCalibrationD.setCoeff2(Double.valueOf(gammaFittingPara.get(1)));
gammaCalibrationD.setCoeff3(Double.valueOf(gammaFittingPara.get(2)));
gammaCalibrationSpectrumList.add(gammaCalibrationD);
} else {
GardsCalibrationSpectrum gammaCalibrationD = new GardsCalibrationSpectrum();
gammaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
gammaCalibrationD.setCoeff1(bgAnalyseResult.d_g_fitting_c_e.get(0));
gammaCalibrationD.setCoeff2(bgAnalyseResult.d_g_fitting_c_e.get(1));
gammaCalibrationD.setCoeff3(bgAnalyseResult.d_g_fitting_c_e.get(2));
gammaCalibrationSpectrumList.add(gammaCalibrationD);
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
}
anlyseResultIn.setGammaCalibrationSpectrumList(gammaCalibrationSpectrumList);
List<GardsCalibrationSpectrum> betaCalibrationSpectrumList = new LinkedList<>();
if (anlyseResultIn.isBBetaEnergyValid()) {
if (anlyseResultIn.isBBetaEnergyValidSample()) {
GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum();
betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
betaCalibrationS.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
betaCalibrationS.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
betaCalibrationS.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
betaCalibrationSpectrumList.add(betaCalibrationS);
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
betaCalibrationG.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
betaCalibrationG.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
betaCalibrationG.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
betaCalibrationSpectrumList.add(betaCalibrationG);
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
betaCalibrationD.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
betaCalibrationD.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
betaCalibrationD.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
betaCalibrationSpectrumList.add(betaCalibrationD);
} else {
GardsCalibrationSpectrum betaCalibrationS = new GardsCalibrationSpectrum();
betaCalibrationS.setDataType(DataTypeAbbr.SAMPLEPHD.getType());
@ -3202,12 +3170,30 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
betaCalibrationS.setCoeff2(bgAnalyseResult.s_b_fitting_c_e.get(1));
betaCalibrationS.setCoeff3(bgAnalyseResult.s_b_fitting_c_e.get(2));
betaCalibrationSpectrumList.add(betaCalibrationS);
}
if (anlyseResultIn.isBBetaEnergyValidGas()) {
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
betaCalibrationG.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
betaCalibrationG.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
betaCalibrationG.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
betaCalibrationSpectrumList.add(betaCalibrationG);
} else {
GardsCalibrationSpectrum betaCalibrationG = new GardsCalibrationSpectrum();
betaCalibrationG.setDataType(DataTypeAbbr.GASBKPHD.getType());
betaCalibrationG.setCoeff1(bgAnalyseResult.g_b_fitting_c_e.get(0));
betaCalibrationG.setCoeff2(bgAnalyseResult.g_b_fitting_c_e.get(1));
betaCalibrationG.setCoeff3(bgAnalyseResult.g_b_fitting_c_e.get(2));
betaCalibrationSpectrumList.add(betaCalibrationG);
}
if (anlyseResultIn.isBBetaEnergyValidDet()) {
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
betaCalibrationD.setCoeff1(Double.valueOf(betaFittingPara.get(0)));
betaCalibrationD.setCoeff2(Double.valueOf(betaFittingPara.get(1)));
betaCalibrationD.setCoeff3(Double.valueOf(betaFittingPara.get(2)));
betaCalibrationSpectrumList.add(betaCalibrationD);
} else {
GardsCalibrationSpectrum betaCalibrationD = new GardsCalibrationSpectrum();
betaCalibrationD.setDataType(DataTypeAbbr.DETBKPHD.getType());
betaCalibrationD.setCoeff1(bgAnalyseResult.d_b_fitting_c_e.get(0));
@ -3215,7 +3201,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
betaCalibrationD.setCoeff3(bgAnalyseResult.d_b_fitting_c_e.get(2));
betaCalibrationSpectrumList.add(betaCalibrationD);
}
anlyseResultIn.setBetaCalibrationSpectrumList(betaCalibrationSpectrumList);
List<GardsROIChannelsSpectrum> roiChannelsSpectrumList = new LinkedList<>();
for (int i=0; i<bgAnalyseResult.S_ROI_B_Boundary_start.size(); i++) {