Merge remote-tracking branch 'origin/station' into station
This commit is contained in:
commit
01b6f4e9bf
|
@ -65,11 +65,11 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
phd.setFilename(fileName);
|
||||
String fromPath = pathName + StringPool.SLASH + fileName;
|
||||
File file = ftpUtil.downloadFile(fromPath, "betaGamma");
|
||||
phd.setTmpFilePath(file.getAbsolutePath());
|
||||
if (Objects.isNull(file)) {
|
||||
result.error500("ftp file can't find");
|
||||
return false;
|
||||
}
|
||||
phd.setTmpFilePath(file.getAbsolutePath());
|
||||
try {
|
||||
//读取文件信息
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
|
@ -2345,30 +2345,66 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
//文本日志内容第六部分数据
|
||||
if(middleData.calibration_pairs_E_idCalPoint.size()>0) {
|
||||
String title = String.format("Energy Calibration [%s ]", middleData.calibration_pairs_E_Input);
|
||||
String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"};
|
||||
String[] dataContent = new String[]{"", middleData.calibration_E_functionTypeDef, middleData.calibration_E_functionDef, middleData.calibration_E_coeff_string, middleData.calibration_E_uncoeff_string, middleData.calibration_pairs_E_Input};
|
||||
strBuffer.append(attributeGFormat(dataTitle, dataContent));
|
||||
strBuffer.append(title);
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_E_functionTypeDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_E_functionDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_E_coeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_E_uncoeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_E_Input));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
//文本日志内容第七部分数据
|
||||
if(middleData.calibration_pairs_R_idCalPoint.size()>0) {
|
||||
String title = String.format("Resolution Calibration [%s ]", middleData.calibration_pairs_R_Input);
|
||||
String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"};
|
||||
String[] dataContent = new String[]{"", middleData.calibration_R_functionTypeDef, middleData.calibration_R_functionDef, middleData.calibration_R_coeff_string, middleData.calibration_R_uncoeff_string, middleData.calibration_pairs_R_Input};
|
||||
strBuffer.append(attributeGFormat(dataTitle, dataContent));
|
||||
strBuffer.append(title);
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_R_functionTypeDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_R_functionDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_R_coeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_R_uncoeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_R_Input));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
//文本日志内容第八部分数据
|
||||
if(middleData.calibration_pairs_EF_idCalPoint.size()>0) {
|
||||
String title = String.format("Efficiency Calibration [%s ]", middleData.calibration_pairs_EF_Input);
|
||||
String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"};
|
||||
String[] dataContent = new String[]{"", middleData.calibration_EF_functionTypeDef, middleData.calibration_EF_functionDef, middleData.calibration_EF_coeff_string, middleData.calibration_EF_uncoeff_string, middleData.calibration_pairs_EF_Input};
|
||||
strBuffer.append(attributeGFormat(dataTitle, dataContent));
|
||||
strBuffer.append(title);
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_EF_functionTypeDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_EF_functionDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_EF_coeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_EF_uncoeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_EF_Input));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
//文本日志内容第九部分数据
|
||||
if(middleData.calibration_pairs_T_idCalPoint.size()>0) {
|
||||
String title = String.format("Tot_efficiency Calibration [%s ]", middleData.calibration_pairs_T_Input);
|
||||
String[] dataTitle = new String[]{title, "Function:", "E:", "P:", "Err:", "Data:"};
|
||||
String[] dataContent = new String[]{"", middleData.calibration_T_functionTypeDef, middleData.calibration_T_functionDef, middleData.calibration_T_coeff_string, middleData.calibration_T_uncoeff_string, middleData.calibration_pairs_T_Input};
|
||||
strBuffer.append(attributeGFormat(dataTitle, dataContent));
|
||||
strBuffer.append(title);
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-17s%s", "Function:", " ", middleData.calibration_T_functionTypeDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "E:", " ", middleData.calibration_T_functionDef));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-24s%s", "P:", " ", middleData.calibration_T_coeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-22s%s", "Err:", " ", middleData.calibration_T_uncoeff_string));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%s%-21s%s", "Data:", " ", middleData.calibration_pairs_T_Input));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
//文本日志内容第十一部分头部信息
|
||||
String logHead11 = "%s Calibration Finished %s";
|
||||
|
@ -2440,7 +2476,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
String fwhm = String.format("%.3f", Double.valueOf(middleData.peaks_Fwhm.get(i)));
|
||||
String area = String.format("%.3f", Double.valueOf(middleData.peaks_Area.get(i)));
|
||||
String areaErr = String.format("%.3f", Double.valueOf(middleData.peaks_areaErr.get(i)) / Double.valueOf(middleData.peaks_Area.get(i)) * 100);
|
||||
String signif = String.format("%.3f", Double.valueOf(middleData.peaks_Significance.get(i)));
|
||||
String signif = Objects.isNull(middleData.peaks_Significance.get(i))?"":String.format("%.3f", Double.valueOf(middleData.peaks_Significance.get(i)));
|
||||
String sensit = String.format("%.3f", Double.valueOf(middleData.peaks_Sensitivity.get(i)));
|
||||
String nuclide = middleData.peaks_Nuclide_name.get(i).length()>0?StringUtils.join(middleData.peaks_Nuclide_name.get(i), StringPool.SEMICOLON):"";
|
||||
strBuffer.append(rowFormat(data14, idPeak, energy, peakCentroid, fwhm, area, areaErr, signif, sensit, nuclide));
|
||||
|
@ -2569,33 +2605,33 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//报告内容第一部分数据
|
||||
strBuffer.append(rowFormat("%sStation ID:%-29s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_stationID));
|
||||
strBuffer.append(rowFormat("%sStation ID:%-25s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_stationID));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sDetector ID:%-28s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_detectID));
|
||||
strBuffer.append(rowFormat("%sDetector ID:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_detectID));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSample ID:%-30s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_id));
|
||||
strBuffer.append(rowFormat("%sSample ID:%-26s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_id));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSample Geometry:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Geometry));
|
||||
strBuffer.append(rowFormat("%sSample Geometry:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Geometry));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSample Quantity[m3]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_quantity));
|
||||
strBuffer.append(rowFormat("%sSample Quantity[m3]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_quantity));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSample Type:%-28s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Type));
|
||||
strBuffer.append(rowFormat("%sSample Type:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Type));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCollection Start:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_start));
|
||||
strBuffer.append(rowFormat("%sCollection Start:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_start));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCollection Stop:%-24s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_stop));
|
||||
strBuffer.append(rowFormat("%sCollection Stop:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_collection_stop));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSampling Time[h]:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_time));
|
||||
strBuffer.append(rowFormat("%sSampling Time[h]:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_time));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sDecay Time[h]:%-26s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_decay_time));
|
||||
strBuffer.append(rowFormat("%sDecay Time[h]:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_decay_time));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcquisition Start:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquisiton_start));
|
||||
strBuffer.append(rowFormat("%sAcquisition Start:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquisiton_start));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcquisition Stop:%-23s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_stop));
|
||||
strBuffer.append(rowFormat("%sAcquisition Stop:%-19s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_stop));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcquisition Time[s]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_time));
|
||||
strBuffer.append(rowFormat("%sAcquisition Time[s]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_acquistion_time));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAvg Flow Rate[m3/h]:%-20s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Avg_Flow_Rate));
|
||||
strBuffer.append(rowFormat("%sAvg Flow Rate[m3/h]:%-16s%s", StringPool.SPACE, StringPool.SPACE, middleData.sample_Avg_Flow_Rate));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
String[] cells1 = new String[]{" Collection Station Comments"};
|
||||
String[] datas1 = new String[]{middleData.Collection_Station_Comments};
|
||||
|
@ -2606,7 +2642,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title1.size(); i++) {
|
||||
String title = title1.get(i);
|
||||
String content = content1.get(i);
|
||||
strBuffer.append(String.format("%s:%-12s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(String.format("%s:%-8s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2620,7 +2656,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title2.size(); i++) {
|
||||
String title = title2.get(i);
|
||||
String content = content2.get(i);
|
||||
strBuffer.append(String.format("%s:%-14s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(String.format("%s:%-10s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2649,20 +2685,20 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title3.size(); i++) {
|
||||
String title = title3.get(i);
|
||||
String content = content3.get(i);
|
||||
strBuffer.append(String.format("%s:%-20s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(String.format("%s:%-16s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
strBuffer.append(String.format("%s:%-8s%s", " Keyline Activities for Nuclides", StringPool.SPACE, ""));
|
||||
strBuffer.append(String.format("%s:%-4s%s", " Keyline Activities for Nuclides", StringPool.SPACE, ""));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(String.format("%s:%-12s%s", " with defined Reference Line", StringPool.SPACE, ""));
|
||||
strBuffer.append(String.format("%s:%-8s%s", " with defined Reference Line", StringPool.SPACE, ""));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(String.format("%s:%-16s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start));
|
||||
strBuffer.append(String.format("%s:%-12s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(String.format("%s:%-11s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start));
|
||||
strBuffer.append(String.format("%s:%-7s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2725,38 +2761,38 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append("#PROCESSING PARAMETERS");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sECutAnalysis_Low:%-23s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low())));
|
||||
strBuffer.append(rowFormat("%sECutAnalysis_Low:%-19s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sECutAnalysis_High:%-22s%s", StringPool.SPACE, StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High())));
|
||||
strBuffer.append(rowFormat("%sECutAnalysis_High:%-18s%s", StringPool.SPACE, StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sEnergyTolerance:%-24s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance())));
|
||||
strBuffer.append(rowFormat("%sEnergyTolerance:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sBaseImprovePSS:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS())));
|
||||
strBuffer.append(rowFormat("%sBaseImprovePSS:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sPSS_low:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low())));
|
||||
strBuffer.append(rowFormat("%sPSS_low:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sk_back:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back())));
|
||||
strBuffer.append(rowFormat("%sk_back:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sk_alpha:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha())));
|
||||
strBuffer.append(rowFormat("%sk_alpha:%-28s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sk_beta:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta())));
|
||||
strBuffer.append(rowFormat("%sk_beta:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sRiskLevelK:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK())));
|
||||
strBuffer.append(rowFormat("%sRiskLevelK:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
Date refTimeAct = middleData.setting_specSetup.getRefTime_act();
|
||||
strBuffer.append(rowFormat("%srefTime_act:%-28s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss"));
|
||||
strBuffer.append(rowFormat("%srefTime_act:%-24s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss"));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%srefTime_conc:%-27s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss")));
|
||||
strBuffer.append(rowFormat("%srefTime_conc:%-23s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss")));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2764,16 +2800,16 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append("#CALIBRATION PARAMETERS");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCalibrationPSS_low:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low())));
|
||||
strBuffer.append(rowFormat("%sCalibrationPSS_low:%-17s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCalibrationPSS_high:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high())));
|
||||
strBuffer.append(rowFormat("%sCalibrationPSS_high:%-16s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high())));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sbUpdateCal:%-29s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0")));
|
||||
strBuffer.append(rowFormat("%sbUpdateCal:%-25s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0")));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-17s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0")));
|
||||
strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-13s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0")));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2785,7 +2821,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append(" Energy Calibration ["+middleData.calibration_pairs_E_Input+" ]");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef));
|
||||
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
String[] cellsE4 = new String[]{" E"};
|
||||
|
@ -2797,7 +2833,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< titleE4.size(); i++) {
|
||||
String title = titleE4.get(i);
|
||||
String content = contentE4.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2810,16 +2846,16 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title4.size(); i++) {
|
||||
String title = title4.get(i);
|
||||
String content = content4.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string));
|
||||
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input));
|
||||
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2831,7 +2867,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append(" Resolution Calibration ["+middleData.calibration_pairs_R_Input+" ]");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef));
|
||||
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
String[] cellsE5 = new String[]{" E"};
|
||||
|
@ -2843,7 +2879,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< titleE5.size(); i++) {
|
||||
String title = titleE5.get(i);
|
||||
String content = contentE5.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2856,14 +2892,14 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title5.size(); i++) {
|
||||
String title = title5.get(i);
|
||||
String content = content5.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string));
|
||||
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input));
|
||||
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2873,7 +2909,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append(" Efficiency Calibration ["+middleData.calibration_pairs_EF_Input+" ]");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef));
|
||||
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
String[] cellsE6 = new String[]{" E"};
|
||||
|
@ -2885,7 +2921,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< titleE6.size(); i++) {
|
||||
String title = titleE6.get(i);
|
||||
String content = contentE6.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2898,14 +2934,14 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title6.size(); i++) {
|
||||
String title = title6.get(i);
|
||||
String content = content6.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string));
|
||||
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input));
|
||||
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -2915,7 +2951,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
strBuffer.append(" Tot_efficiency Calibration ["+middleData.calibration_pairs_T_Input+" ]");
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef));
|
||||
strBuffer.append(rowFormat("%sFunction:%-27s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
String[] cellsE7 = new String[]{" E"};
|
||||
|
@ -2927,7 +2963,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< titleE7.size(); i++) {
|
||||
String title = titleE7.get(i);
|
||||
String content = contentE7.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
|
@ -2940,14 +2976,14 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
for (int i=0; i< title7.size(); i++) {
|
||||
String title = title7.get(i);
|
||||
String content = content7.get(i);
|
||||
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
|
||||
strBuffer.append(rowFormat("%s:%-34s%s", title, StringPool.SPACE, content));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
}
|
||||
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string));
|
||||
strBuffer.append(rowFormat("%sErr:%-32s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input));
|
||||
strBuffer.append(rowFormat("%sData:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input));
|
||||
//换行
|
||||
strBuffer.append(System.lineSeparator());
|
||||
//换行
|
||||
|
@ -3420,7 +3456,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
dvctEFFICIENCY.add(fileAnlyse.getVPeak().get(m).efficiency);
|
||||
dvctFWHM.add(fileAnlyse.getVPeak().get(m).fwhm);
|
||||
dvctFWTM.add(fileAnlyse.getVPeak().get(m).fwhmc);
|
||||
dvctSIGNIFICANCE.add(fileAnlyse.getVPeak().get(m).significance);
|
||||
dvctSIGNIFICANCE.add(Double.isFinite(fileAnlyse.getVPeak().get(m).significance)?fileAnlyse.getVPeak().get(m).significance:null);
|
||||
dvctSENSITIVITY.add(fileAnlyse.getVPeak().get(m).sensitivity);
|
||||
dvctMULTIINDEX.add(Double.valueOf(fileAnlyse.getVPeak().get(m).multiIndex));
|
||||
dvctROISTART.add(Double.valueOf(fileAnlyse.getVPeak().get(m).left));
|
||||
|
@ -3962,9 +3998,15 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
|||
BigDecimal area = new BigDecimal(vPeak.get(i).area);
|
||||
area = area.setScale(3, RoundingMode.HALF_UP);
|
||||
peakInfo.area = area.doubleValue();
|
||||
BigDecimal significance = new BigDecimal(vPeak.get(i).significance);
|
||||
significance = significance.setScale(3, RoundingMode.HALF_UP);
|
||||
peakInfo.significance = significance.doubleValue();
|
||||
if (Double.isInfinite(vPeak.get(i).significance)) {
|
||||
peakInfo.significance = Double.POSITIVE_INFINITY;
|
||||
} else if (Double.isNaN(vPeak.get(i).significance)) {
|
||||
peakInfo.significance = Double.NaN;
|
||||
} else {
|
||||
BigDecimal significance = new BigDecimal(vPeak.get(i).significance);
|
||||
significance = significance.setScale(3, RoundingMode.HALF_UP);
|
||||
peakInfo.significance = significance.doubleValue();
|
||||
}
|
||||
peakInfo.comments = vPeak.get(i).comments;
|
||||
peakInfo.nuclides = vPeak.get(i).nuclides;
|
||||
result.add(peakInfo);
|
||||
|
|
|
@ -134,14 +134,14 @@ public class SpectrumAnalysesController {
|
|||
|
||||
@GetMapping("viewGammaDetectorCalibration")
|
||||
@ApiOperation(value = "查询GammaDetectorCalibration数据", notes = "查询GammaDetectorCalibration数据")
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, sampleFileName, qcFileName, request);
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewGammaDetectorCalibration(sampleId, sampleFileName, qcFileName, fittingBtn, request);
|
||||
}
|
||||
|
||||
@GetMapping("viewBetaDetectorCalibration")
|
||||
@ApiOperation(value = "查询BetaDetectorCalibration数据", notes = "查询BetaDetectorCalibration数据")
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, sampleFileName, qcFileName, request);
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) {
|
||||
return spectrumAnalysisService.viewBetaDetectorCalibration(sampleId, sampleFileName, qcFileName, fittingBtn, request);
|
||||
}
|
||||
|
||||
@GetMapping("viewExtrapolation")
|
||||
|
|
|
@ -69,6 +69,18 @@ public class BetaDataFile implements Serializable {
|
|||
|
||||
private List<String> gammaFittingParaToUi;
|
||||
|
||||
private List<SeriseData> betaListNow;
|
||||
|
||||
private List<String> betaFittingParaNow;
|
||||
|
||||
private List<String> betaFittingParaToUiNow;
|
||||
|
||||
private List<SeriseData> gammaListNow;
|
||||
|
||||
private List<String> gammaFittingParaNow;
|
||||
|
||||
private List<String> gammaFittingParaToUiNow;
|
||||
|
||||
/**
|
||||
* 是否点击过Energy Calibration页面下Gamma Detector Calibration的fitting按钮
|
||||
*/
|
||||
|
@ -147,6 +159,10 @@ public class BetaDataFile implements Serializable {
|
|||
|
||||
private List<List<Double>> betaNewEnergyList;
|
||||
|
||||
private List<List<Double>> gammaNewEnergyListNow;
|
||||
|
||||
private List<List<Double>> betaNewEnergyListNow;
|
||||
|
||||
private List<SeriseData> sampleGammaOriginalSeriseData;
|
||||
|
||||
private List<SeriseData> sampleGammaProjectedSeriseData;
|
||||
|
@ -237,6 +253,14 @@ public class BetaDataFile implements Serializable {
|
|||
gammaList = new LinkedList<>();
|
||||
gammaFittingPara = new LinkedList<>();
|
||||
gammaFittingParaToUi = new LinkedList<>();
|
||||
|
||||
betaListNow = new LinkedList<>();
|
||||
betaFittingParaNow = new LinkedList<>();
|
||||
betaFittingParaToUiNow = new LinkedList<>();
|
||||
gammaListNow = new LinkedList<>();
|
||||
gammaFittingParaNow = new LinkedList<>();
|
||||
gammaFittingParaToUiNow = new LinkedList<>();
|
||||
|
||||
bGammaEnergyValidSample = false;
|
||||
bBetaEnergyValidSample = false;
|
||||
bGammaEnergyValidGas = false;
|
||||
|
@ -246,6 +270,9 @@ public class BetaDataFile implements Serializable {
|
|||
gammaNewEnergyList = new LinkedList<>();
|
||||
betaNewEnergyList = new LinkedList<>();
|
||||
|
||||
gammaNewEnergyListNow = new LinkedList<>();
|
||||
betaNewEnergyListNow = new LinkedList<>();
|
||||
|
||||
xeResultsSpectrumList = new LinkedList<>();
|
||||
sampleBoundary = new LinkedList<>();
|
||||
gasBoundary = new LinkedList<>();
|
||||
|
|
|
@ -50,9 +50,9 @@ public interface ISpectrumAnalysisService {
|
|||
|
||||
void exportRLR(BetaRLR betaRLR, HttpServletResponse response);
|
||||
|
||||
Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request);
|
||||
Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request);
|
||||
|
||||
Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request);
|
||||
Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request);
|
||||
|
||||
Result viewExtrapolation(Integer sampleId, String sampleFileName, HttpServletRequest request);
|
||||
|
||||
|
|
|
@ -968,19 +968,18 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
compareFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + compareFilePath;
|
||||
File compareFile = ftpUtil.downloadFile(compareFilePath, "betaGamma");
|
||||
if (Objects.nonNull(compareFile)) {
|
||||
// 获取Compare数据
|
||||
List<Long> m_vecCompare = gammaFileUtil.loadCompareData(compareFile, userName, m_nCount, result);
|
||||
if (CollectionUtils.isNotEmpty(m_vecCompare)) {
|
||||
List<ChartData> chartDataList = gammaFileUtil.CompareData(m_vecCompare, m_nCount, colorMap, vEnergy);
|
||||
result.setSuccess(true);
|
||||
result.setResult(chartDataList);
|
||||
}
|
||||
compareFile.delete();
|
||||
} else {
|
||||
result.error500("比较文件不存在!");
|
||||
if (Objects.isNull(compareFile)) {
|
||||
result.error500("The comparison file path does not exist");
|
||||
return result;
|
||||
}
|
||||
// 获取Compare数据
|
||||
List<Long> m_vecCompare = gammaFileUtil.loadCompareData(compareFile, userName, m_nCount, result);
|
||||
if (CollectionUtils.isNotEmpty(m_vecCompare)) {
|
||||
List<ChartData> chartDataList = gammaFileUtil.CompareData(m_vecCompare, m_nCount, colorMap, vEnergy);
|
||||
result.setSuccess(true);
|
||||
result.setResult(chartDataList);
|
||||
}
|
||||
compareFile.delete();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1053,22 +1052,21 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
}
|
||||
stripFilePath = StringPool.SLASH + ftpUtil.getFtpRootPath() + spectrumPathProperties.getSaveFilePath() + StringPool.SLASH + stripFilePath;
|
||||
File stripFile = ftpUtil.downloadFile(stripFilePath, "betaGamma");
|
||||
if (Objects.nonNull(stripFile)) {
|
||||
// 获取Compare数据
|
||||
List<Long> m_vecCompare = gammaFileUtil.loadCompareData(stripFile, userName, m_nCount, result);
|
||||
if (CollectionUtils.isNotEmpty(m_vecCompare)) {
|
||||
List<ChartData> referenceDataList = gammaFileUtil.ReferenceData(m_vecCompare, m_nCount, colorMap, vEnergy);
|
||||
List<ChartData> chartDataList = gammaFileUtil.StripData(m_vecCompare, m_vCount, m_nCount, colorMap, vEnergy, ratioRate);
|
||||
stripMap.put("reference", referenceDataList);
|
||||
stripMap.put("result", chartDataList);
|
||||
result.setSuccess(true);
|
||||
result.setResult(stripMap);
|
||||
}
|
||||
stripFile.delete();
|
||||
} else {
|
||||
result.error500("比较文件不存在!");
|
||||
if (Objects.isNull(stripFile)) {
|
||||
result.error500("The comparison file path does not exist");
|
||||
return result;
|
||||
}
|
||||
// 获取Compare数据
|
||||
List<Long> m_vecCompare = gammaFileUtil.loadCompareData(stripFile, userName, m_nCount, result);
|
||||
if (CollectionUtils.isNotEmpty(m_vecCompare)) {
|
||||
List<ChartData> referenceDataList = gammaFileUtil.ReferenceData(m_vecCompare, m_nCount, colorMap, vEnergy);
|
||||
List<ChartData> chartDataList = gammaFileUtil.StripData(m_vecCompare, m_vCount, m_nCount, colorMap, vEnergy, ratioRate);
|
||||
stripMap.put("reference", referenceDataList);
|
||||
stripMap.put("result", chartDataList);
|
||||
result.setSuccess(true);
|
||||
result.setResult(stripMap);
|
||||
}
|
||||
stripFile.delete();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1650,11 +1648,15 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
ObjectMapper mapper = new ObjectMapper();
|
||||
String phdStr = mapper.writeValueAsString(phd);
|
||||
String strValue = CalValuesHandler.fitPeakFull(phdStr, Af, Cf, Ff);
|
||||
// String strValue = HttpClient.fitPeakFull(phdStr, Af, Cf, Ff);
|
||||
Map<String, Object> parseMap = JSON.parseObject(strValue, Map.class);
|
||||
for (Map.Entry<String, Object> entry : parseMap.entrySet()) {
|
||||
if (entry.getKey().equalsIgnoreCase("vPeak")) {
|
||||
List<PeakInfo> value = JSON.parseArray(JSON.toJSONString(entry.getValue()), PeakInfo.class);
|
||||
for (PeakInfo info:value) {
|
||||
if (info.significance == -9999) {
|
||||
info.significance = Double.POSITIVE_INFINITY;
|
||||
}
|
||||
}
|
||||
phd.setVPeak(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vBase")) {
|
||||
|
@ -4361,7 +4363,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
tablePeak.setNetCountRate(rate);
|
||||
tablePeak.setNcRateErr(area_err);
|
||||
tablePeak.setLc(NumberFormatUtil.numberFormat(String.valueOf(peak.lc)));
|
||||
tablePeak.setSignificance(NumberFormatUtil.numberFormat(String.valueOf(peak.significance)));
|
||||
tablePeak.setSignificance(Double.isFinite(peak.significance)?NumberFormatUtil.numberFormat(String.valueOf(peak.significance)):(Double.isInfinite(peak.significance)?"inf":"nan"));
|
||||
peakFitList.add(tablePeak);
|
||||
}
|
||||
map.put("peakFit", peakFitList);
|
||||
|
@ -4595,7 +4597,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (size > 0 && index < size && index >= 0) {
|
||||
PeakInfo peak = phd.getVPeak().get(index);
|
||||
String message = "Peak:" + String.format("%.2f", peak.peakCentroid) + " = " + String.format("%.2f", peak.energy) + " keV\n" +
|
||||
"FWHM:" + String.format("%.2f", peak.fwhmc) + " keV\n" +
|
||||
"FWHM:" + String.format("%.2f", peak.fwhm) + " keV\n" +
|
||||
"Net Area:" + String.format("%.2f", peak.area) + "\n" +
|
||||
"BaseLine:" + String.format("%.2f", phd.getVBase().get((int) Math.round(peak.peakCentroid))) + "\n" +
|
||||
"NID:" + StringUtils.join(peak.nuclides, ";");
|
||||
|
@ -4871,7 +4873,7 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
String fwhm = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.fwhm));
|
||||
String area = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.area));
|
||||
String areaErr = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.areaErr));
|
||||
String signif = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.significance));
|
||||
String signif = Double.isFinite(peakInfo.significance)?NumberFormatUtil.numberFormat(String.valueOf(peakInfo.significance)):(Double.isInfinite(peakInfo.significance)?"inf":"nan");
|
||||
String sensit = NumberFormatUtil.numberFormat(String.valueOf(peakInfo.sensitivity));
|
||||
String nuclide = StringUtils.join(peakInfo.nuclides, StringPool.SEMICOLON);
|
||||
strBuild.append(rowFormat(title2, peakId, energy, peakCentroid, multiIndex, fwhm, area, areaErr, signif, sensit, nuclide));
|
||||
|
@ -5279,7 +5281,6 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
@Override
|
||||
public void SpcToIms(FileData datas, MultipartFile file, HttpServletResponse response) {
|
||||
String SpcName = file.getOriginalFilename();
|
||||
String ImsName = SpcName.substring(0, SpcName.length() - 4) + ".PHD";
|
||||
File spcFile = null;
|
||||
InputStream inputStream = null;
|
||||
// 导出数据内容到txt文本
|
||||
|
@ -5291,6 +5292,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
if (!fileFtransitUtil.ReadSPC(spcFile, datas)) return;
|
||||
|
||||
String imsValue = fileFtransitUtil.WriteIMS(datas);
|
||||
String suffix = nameStandUtil.GetSuffix(datas.getData_type(), datas.getQuantity(), String.valueOf(datas.getAcq_live()));
|
||||
String ImsName = datas.getDetector()+StringPool.DASH+datas.getAcq_date().replace(StringPool.SLASH, StringPool.EMPTY)+StringPool.UNDERSCORE+
|
||||
datas.getAcq_time().substring(0, 5).replace(StringPool.COLON, StringPool.EMPTY)+ suffix;
|
||||
// 设置响应类型
|
||||
response.setContentType("application/octet-stream");
|
||||
// 解决中文不能生成文件
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@Service("gardsPeaksSpectrumService")
|
||||
@DS("ora")
|
||||
|
@ -39,7 +40,7 @@ public class GardsPeaksSpectrumServiceImpl extends ServiceImpl<GardsPeaksSpectru
|
|||
peaks.setUncefficiency(null);
|
||||
peaks.setFwhm(Double.valueOf(middleData.peaks_Fwhm.get(i)));
|
||||
peaks.setFwtm(Double.valueOf(middleData.peaks_Fwhmc.get(i)));
|
||||
peaks.setSignificance(Double.valueOf(middleData.peaks_Significance.get(i)));
|
||||
peaks.setSignificance(Objects.nonNull(middleData.peaks_Significance.get(i))?Double.valueOf(middleData.peaks_Significance.get(i)):null);
|
||||
peaks.setSensitivity(Double.valueOf(middleData.peaks_Sensitivity.get(i)));
|
||||
peaks.setMulitiIndex(Double.valueOf(middleData.peaks_multiIndex.get(i)));
|
||||
peaks.setRoiStart(Double.valueOf(middleData.peaks_ROIstart.get(i)));
|
||||
|
|
|
@ -1001,44 +1001,44 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append("#FILE INFORMATION");
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSampleMeasID:%-38s%s", StringPool.SPACE, StringPool.SPACE, information.getMeasurementID()));
|
||||
strBuffer.append(rowFormat("%sSampleMeasID:%-15s%s", StringPool.SPACE, StringPool.SPACE, information.getMeasurementID()));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sGASBKMeasID:%-39s%s", StringPool.SPACE, StringPool.SPACE, information.getGasBkgdMeasurementID()));
|
||||
strBuffer.append(rowFormat("%sGASBKMeasID:%-16s%s", StringPool.SPACE, StringPool.SPACE, information.getGasBkgdMeasurementID()));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sSRID:%-46s%s", StringPool.SPACE, StringPool.SPACE, information.getSampleRefId()));
|
||||
strBuffer.append(rowFormat("%sSRID:%-23s%s", StringPool.SPACE, StringPool.SPACE, information.getSampleRefId()));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sDetector Type:%-37s%s", StringPool.SPACE, StringPool.SPACE, "3D b-g"));
|
||||
strBuffer.append(rowFormat("%sDetector Type:%-14s%s", StringPool.SPACE, StringPool.SPACE, "3D b-g"));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append("#COLLECTION INFORMATION");
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sStation CODE:%-38s%s", StringPool.SPACE, StringPool.SPACE, information.getSit_det_code()));
|
||||
strBuffer.append(rowFormat("%sStation CODE:%-15s%s", StringPool.SPACE, StringPool.SPACE, information.getSit_det_code()));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sDetector CODE:%-37s%s", StringPool.SPACE, StringPool.SPACE, information.getDetect_code()));
|
||||
strBuffer.append(rowFormat("%sDetector CODE:%-14s%s", StringPool.SPACE, StringPool.SPACE, information.getDetect_code()));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCollection Start:%-34s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(rowFormat("%sCollection Start:%-11s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_start(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCollection Stop:%-35s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(rowFormat("%sCollection Stop:%-12s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getCollect_stop(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sCollection TIME(h):%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(((information.getCollect_stop().getTime()-information.getCollect_start().getTime())/1000)/3600)));
|
||||
strBuffer.append(rowFormat("%sCollection TIME(h):%-9s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(((information.getCollect_stop().getTime()-information.getCollect_start().getTime())/1000)/3600)));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAir Volume[cm3]:%-35s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_xe_stable_volume())));
|
||||
strBuffer.append(rowFormat("%sAir Volume[cm3]:%-12s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_xe_stable_volume())));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sXe Volume[cm3]:%-36s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_volume_of_Xe())));
|
||||
strBuffer.append(rowFormat("%sXe Volume[cm3]:%-13s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getS_volume_of_Xe())));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append("#ACQUISITION INFORMATION");
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcquisition Start:%-33s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(rowFormat("%sAcquisition Start:%-10s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(information.getAcquisition_start(), "yyyy/MM/dd HH:mm:ss")));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcq Real Time(s):%-34s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_real_sec())));
|
||||
strBuffer.append(rowFormat("%sAcq Real Time(s):%-11s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_real_sec())));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sAcq Live Time:%-37s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_live_sec())));
|
||||
strBuffer.append(rowFormat("%sAcq Live Time:%-14s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(information.getAcquisition_live_sec())));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append("#SOFTWARE");
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(rowFormat("%sversion:%-43s%s", StringPool.SPACE, StringPool.SPACE, "1.0.1"));
|
||||
strBuffer.append(rowFormat("%sversion:%-20s%s", StringPool.SPACE, StringPool.SPACE, "1.0.1"));
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append(System.lineSeparator());
|
||||
strBuffer.append("#SAMPLE Old CALIBRATION");
|
||||
|
@ -1702,16 +1702,26 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
public Result viewGammaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//接收返回结果内容
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//根据请求头获取用户名称
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
//获取beta的缓存数据
|
||||
Cache<String, BetaDataFile> cache = betaCache.getBetaCache();
|
||||
BetaDataFile betaDataFile = cache.getIfPresent(sampleFileName + "-" + userName);
|
||||
if (Objects.isNull(betaDataFile)) {
|
||||
result.error500("Load basic file information first!");
|
||||
return result;
|
||||
}
|
||||
//如果gamma的计算标识是false 则将gamma当前缓存数据进行重置
|
||||
if (!fittingBtn) {
|
||||
betaDataFile.setGammaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
}
|
||||
//获取qc的分析结果数据
|
||||
EnergySpectrumStruct struct = betaDataFile.getQcStruct();
|
||||
if (Objects.nonNull(struct)){
|
||||
|
@ -1799,7 +1809,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
map.put("min", min);
|
||||
map.put("max", max);
|
||||
map.put("gammaSpectrum", seriseDataList);
|
||||
|
||||
//计算得到的
|
||||
if (betaDataFile.getGammaList().size() <= 0 ) {
|
||||
betaDataFile.setGammaList(oldScatterSeries);
|
||||
}
|
||||
|
@ -1816,8 +1826,9 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, HttpServletRequest request) {
|
||||
public Result viewBetaDetectorCalibration(Integer sampleId, String sampleFileName, String qcFileName, boolean fittingBtn, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
//返回结果内容
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//获取用户名
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
|
@ -1828,6 +1839,13 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
result.error500("Load basic file information first!");
|
||||
return result;
|
||||
}
|
||||
//判断是否进行过计算标识为false时 清空当前beta对应的缓存数据
|
||||
if (!fittingBtn) {
|
||||
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
}
|
||||
//判断qc的分析结果是否为空
|
||||
EnergySpectrumStruct struct = betaDataFile.getQcStruct();
|
||||
if (Objects.nonNull(struct)){
|
||||
|
@ -1854,8 +1872,8 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
map.put("betaEnergy", betaEnergyList);
|
||||
//gamma Energy 散点图坐标点关联gamma部分相关数据
|
||||
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyList())) {
|
||||
map.put("gammaEnergy", betaDataFile.getGammaNewEnergyList());
|
||||
if (CollectionUtils.isNotEmpty(betaDataFile.getGammaNewEnergyListNow())) {
|
||||
map.put("gammaEnergy", betaDataFile.getGammaNewEnergyListNow());
|
||||
} else {
|
||||
List<Double> gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy);
|
||||
List<Double> gchannels = new ArrayList<>();
|
||||
|
@ -2684,29 +2702,47 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
return result;
|
||||
}
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
//记录点位的x轴数据
|
||||
List<Double> xs = new LinkedList<>();
|
||||
//记录点位的y轴数据
|
||||
List<Double> ys = new LinkedList<>();
|
||||
//接收算法计算得到的公式的数据
|
||||
List<Double> fittingPara = new LinkedList<>();
|
||||
//记录计算结果转换为字符串后数据的数组 第一组公式
|
||||
List<String> fittingParaStr = new LinkedList<>();
|
||||
//记录点位道值的数组
|
||||
List<Double> channels = new LinkedList<>();
|
||||
//新计算的点位数组
|
||||
List<SeriseData> seriseDataList = new LinkedList<>();
|
||||
//页面展示的表单数据数组
|
||||
List<TableWidget> tableWidgets = new LinkedList<>();
|
||||
//新计算得到的线点位数组
|
||||
List<SeriseData> newLineSeries = new LinkedList<>();
|
||||
//计算得到的新能量数组
|
||||
List<List<Double>> energyList = new LinkedList<>();
|
||||
//记录计算结果转换成字符串后数据的数组 第二组公式
|
||||
List<String> fittingParaToUiStr = new LinkedList<>();
|
||||
//tempPoint数组大小需要大于2个值
|
||||
if ((CollectionUtils.isNotEmpty(tempPoints) && tempPoints.size() > 2 && Objects.nonNull(count) && tempPoints.size() != count)
|
||||
|| (Objects.isNull(paramA) || StringUtils.isBlank(String.valueOf(paramA)))
|
||||
|| (Objects.isNull(paramB) || StringUtils.isBlank(String.valueOf(paramB)))
|
||||
|| (Objects.isNull(paramC) || StringUtils.isBlank(String.valueOf(paramC))) ){
|
||||
List<Double> xs = new LinkedList<>();
|
||||
List<Double> ys = new LinkedList<>();
|
||||
//遍历临时点数组 将点位的横坐标以及纵坐标封装到对应的数组
|
||||
for (int i=0; i<tempPoints.size(); i++){
|
||||
xs.add(tempPoints.get(i).getX());
|
||||
ys.add(tempPoints.get(i).getY());
|
||||
}
|
||||
//C to E
|
||||
List<Double> fittingPara = EnergySpectrumHandler.GetFileFittingPara(xs, ys);
|
||||
List<String> fittingParaStr = new LinkedList<>();
|
||||
fittingPara = EnergySpectrumHandler.GetFileFittingPara(xs, ys);
|
||||
for (Double para:fittingPara) {
|
||||
fittingParaStr.add(String.valueOf(para));
|
||||
}
|
||||
map.put("CToE", fittingParaStr);
|
||||
|
||||
List<Double> channels = new LinkedList<>();
|
||||
//填充道值数组的数据
|
||||
for (int i=0; i<255; i++) {
|
||||
channels.add(Double.valueOf(i));
|
||||
}
|
||||
//计算道值的能量
|
||||
List<Double> energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara);
|
||||
//如果当前fitting按钮没有进行过操作 并且 操作的是gamma探测器相关的
|
||||
if (tabName.equalsIgnoreCase("gamma") && !fittingBtn) {
|
||||
|
@ -2726,13 +2762,13 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
}
|
||||
}
|
||||
List<SeriseData> newLineSeries = new LinkedList<>();
|
||||
List<List<Double>> energyList = new LinkedList<>();
|
||||
//将新计算的能量封装到数组
|
||||
for (Double calEnergy:energys) {
|
||||
List<Double> newEnergy = new LinkedList<>();
|
||||
newEnergy.add(calEnergy);
|
||||
energyList.add(newEnergy);
|
||||
}
|
||||
//遍历道值添加各道值对应点数据到数组
|
||||
for (int i=0; i<channels.size(); ++i) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(channels.get(i));
|
||||
|
@ -2740,8 +2776,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
newLineSeries.add(seriseData);
|
||||
}
|
||||
map.put("newLineSeries", newLineSeries);
|
||||
List<SeriseData> seriseDataList = new LinkedList<>();
|
||||
List<TableWidget> tableWidgets = new LinkedList<>();
|
||||
//遍历点 缓存到表单数组以及折线图点位数组
|
||||
for (int i=0; i<tempPoints.size(); i++) {
|
||||
//表单数据信息
|
||||
TableWidget tableWidget = new TableWidget();
|
||||
|
@ -2759,40 +2794,27 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
map.put("newScatterSeriesData", seriseDataList);
|
||||
//E to C
|
||||
List<Double> fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs);
|
||||
List<String> fittingParaToUiStr = new LinkedList<>();
|
||||
for (Double para:fittingParaToUi) {
|
||||
fittingParaToUiStr.add(String.valueOf(para));
|
||||
}
|
||||
map.put("EToC", fittingParaToUiStr);
|
||||
|
||||
if (tabName.equalsIgnoreCase("beta")) {
|
||||
betaDataFile.setBetaList(tempPoints);
|
||||
betaDataFile.setBetaFittingPara(fittingParaStr);
|
||||
betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr);
|
||||
betaDataFile.setBetaNewEnergyList(energyList);
|
||||
} else if (tabName.equalsIgnoreCase("gamma")) {
|
||||
betaDataFile.setGammaList(tempPoints);
|
||||
betaDataFile.setGammaFittingPara(fittingParaStr);
|
||||
betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr);
|
||||
betaDataFile.setGammaNewEnergyList(energyList);
|
||||
}
|
||||
} else {
|
||||
List<Double> fittingPara = new LinkedList<>();
|
||||
//添加公式的数据到公式一的数组
|
||||
fittingPara.add(paramA);
|
||||
fittingPara.add(paramB);
|
||||
fittingPara.add(paramC);
|
||||
List<String> fittingParaStr = new LinkedList<>();
|
||||
//将公式各数据转换成字符串存到数组中
|
||||
fittingParaStr.add(String.valueOf(paramA));
|
||||
fittingParaStr.add(String.valueOf(paramB));
|
||||
fittingParaStr.add(String.valueOf(paramC));
|
||||
map.put("CToE", fittingParaStr);
|
||||
List<Double> xs = new LinkedList<>();
|
||||
//遍历点位数组 将横坐标的数据加入到数组中
|
||||
for (int i=0; i<tempPoints.size(); i++){
|
||||
xs.add(tempPoints.get(i).getX());
|
||||
}
|
||||
List<Double> ys = EnergySpectrumHandler.GetFileFittingData(xs, fittingPara);
|
||||
List<SeriseData> seriseDataList = new LinkedList<>();
|
||||
List<TableWidget> tableWidgets = new LinkedList<>();
|
||||
//根据公式和横坐标值 计算新的纵坐标数据
|
||||
ys = EnergySpectrumHandler.GetFileFittingData(xs, fittingPara);
|
||||
//遍历横坐标数值 将数据封存到表单数组以及折线图数组中
|
||||
for (int i=0; i<xs.size(); i++) {
|
||||
//表单数据信息
|
||||
TableWidget tableWidget = new TableWidget();
|
||||
|
@ -2808,19 +2830,18 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
map.put("tableWidgets", tableWidgets);
|
||||
map.put("newScatterSeriesData", seriseDataList);
|
||||
|
||||
List<Double> channels = new LinkedList<>();
|
||||
//填充道值数组的数据
|
||||
for (int i=0; i<255; i++) {
|
||||
channels.add(Double.valueOf(i));
|
||||
}
|
||||
//根据道值和公式参数计算新的能量数据
|
||||
List<Double> energys = EnergySpectrumHandler.GetFileFittingData(channels,fittingPara);
|
||||
List<SeriseData> newLineSeries = new LinkedList<>();
|
||||
List<List<Double>> energyList = new LinkedList<>();
|
||||
for (Double calEnergy:energys) {
|
||||
List<Double> newEnergy = new LinkedList<>();
|
||||
newEnergy.add(calEnergy);
|
||||
energyList.add(newEnergy);
|
||||
}
|
||||
//遍历道值 将道值和新的能量封装到新的点位数组
|
||||
for (int i=0; i<channels.size(); ++i) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(channels.get(i));
|
||||
|
@ -2830,23 +2851,26 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
map.put("newLineSeries", newLineSeries);
|
||||
//E to C
|
||||
List<Double> fittingParaToUi = EnergySpectrumHandler.GetFileFittingPara(ys, xs);
|
||||
List<String> fittingParaToUiStr = new LinkedList<>();
|
||||
for (Double para:fittingParaToUi) {
|
||||
fittingParaToUiStr.add(String.valueOf(para));
|
||||
}
|
||||
map.put("EToC", fittingParaToUiStr);
|
||||
|
||||
if (tabName.equalsIgnoreCase("beta")) {
|
||||
betaDataFile.setBetaList(tempPoints);
|
||||
betaDataFile.setBetaFittingPara(fittingParaStr);
|
||||
betaDataFile.setBetaFittingParaToUi(fittingParaToUiStr);
|
||||
betaDataFile.setBetaNewEnergyList(energyList);
|
||||
} else if (tabName.equalsIgnoreCase("gamma")) {
|
||||
betaDataFile.setGammaList(tempPoints);
|
||||
betaDataFile.setGammaFittingPara(fittingParaStr);
|
||||
betaDataFile.setGammaFittingParaToUi(fittingParaToUiStr);
|
||||
betaDataFile.setGammaNewEnergyList(energyList);
|
||||
}
|
||||
}
|
||||
if (tabName.equalsIgnoreCase("beta")) {
|
||||
betaDataFile.setBetaListNow(tempPoints);
|
||||
betaDataFile.setBetaFittingParaNow(fittingParaStr);
|
||||
betaDataFile.setBetaFittingParaToUiNow(fittingParaToUiStr);
|
||||
betaDataFile.setBetaNewEnergyListNow(energyList);
|
||||
} else if (tabName.equalsIgnoreCase("gamma")) {
|
||||
betaDataFile.setGammaListNow(tempPoints);
|
||||
betaDataFile.setGammaFittingParaNow(fittingParaStr);
|
||||
betaDataFile.setGammaFittingParaToUiNow(fittingParaToUiStr);
|
||||
betaDataFile.setGammaNewEnergyListNow(energyList);
|
||||
//gamma的进行计算后将当前的beta缓存的数据进行重置
|
||||
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(map);
|
||||
|
@ -2909,15 +2933,19 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
if (Objects.nonNull(betaDataFile)) {
|
||||
//判断需要重置的tab页
|
||||
if (tabName.equalsIgnoreCase("gamma")) {
|
||||
betaDataFile.setGammaList(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingPara(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingParaToUi(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaNewEnergyList(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setGammaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
} else if (tabName.equalsIgnoreCase("beta")) {
|
||||
betaDataFile.setBetaList(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingPara(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaToUi(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaNewEnergyList(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaListNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaFittingParaToUiNow(Collections.EMPTY_LIST);
|
||||
betaDataFile.setBetaNewEnergyListNow(Collections.EMPTY_LIST);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2970,16 +2998,21 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
if (Objects.nonNull(betaDataFile)) {
|
||||
betaList = betaDataFile.getBetaList();
|
||||
betaFittingPara = betaDataFile.getBetaFittingPara();
|
||||
betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi();
|
||||
gammaList = betaDataFile.getGammaList();
|
||||
gammaFittingPara = betaDataFile.getGammaFittingPara();
|
||||
gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi();
|
||||
}
|
||||
//判断是否对beta页面进行过分析
|
||||
if (analyseData.isBetaEnergyValid()) {
|
||||
//如果进行过分析 则将当前beta用于分析的新的数据 赋值到最终使用的数组
|
||||
if (Objects.nonNull(betaDataFile)) {
|
||||
//重新分析时将当前的数组封装给到最终记录结果的数组中
|
||||
betaDataFile.setBetaList(betaDataFile.getBetaListNow());
|
||||
betaDataFile.setBetaFittingPara(betaDataFile.getBetaFittingParaNow());
|
||||
betaDataFile.setBetaFittingParaToUi(betaDataFile.getBetaFittingParaToUiNow());
|
||||
betaDataFile.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow());
|
||||
//将新的数组封装到各自的数组中
|
||||
betaList = betaDataFile.getBetaList();
|
||||
betaFittingPara = betaDataFile.getBetaFittingPara();
|
||||
betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi();
|
||||
}
|
||||
//封装重新计算的数据
|
||||
List<Double> beCal = new LinkedList<>();
|
||||
beCal.add(Double.valueOf(betaFittingParaToUi.get(0)));
|
||||
beCal.add(Double.valueOf(betaFittingParaToUi.get(1)));
|
||||
|
@ -3020,6 +3053,16 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
//判断是否对gamma页面进行过分析
|
||||
if (analyseData.isGammaEnergyValid()) {
|
||||
//如果缓存数据不为空 且对gamma进行了计算 将当前gamma的计算结果赋值到最终的结果数组 进行新的分析使用
|
||||
if (Objects.nonNull(betaDataFile)) {
|
||||
betaDataFile.setGammaList(betaDataFile.getGammaListNow());
|
||||
betaDataFile.setGammaFittingPara(betaDataFile.getGammaFittingParaNow());
|
||||
betaDataFile.setGammaFittingParaToUi(betaDataFile.getGammaFittingParaToUiNow());
|
||||
betaDataFile.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow());
|
||||
gammaList = betaDataFile.getGammaList();
|
||||
gammaFittingPara = betaDataFile.getGammaFittingPara();
|
||||
gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi();
|
||||
}
|
||||
List<Double> geCal = new LinkedList<>();
|
||||
geCal.add(Double.valueOf(gammaFittingParaToUi.get(0)));
|
||||
geCal.add(Double.valueOf(gammaFittingParaToUi.get(1)));
|
||||
|
@ -3173,28 +3216,31 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
List<SeriseData> gammaList = new LinkedList<>();
|
||||
List<String> gammaFittingPara = new LinkedList<>();
|
||||
List<String> gammaFittingParaToUi = new LinkedList<>();
|
||||
if (Objects.nonNull(betaDataFile)) {
|
||||
betaList = betaDataFile.getBetaList();
|
||||
betaFittingPara = betaDataFile.getBetaFittingPara();
|
||||
betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi();
|
||||
gammaList = betaDataFile.getGammaList();
|
||||
gammaFittingPara = betaDataFile.getGammaFittingPara();
|
||||
gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi();
|
||||
}
|
||||
//根据sample文件名称获取当前文件的缓存信息
|
||||
BetaDataFile sampleBetaData = cache.getIfPresent(sampleFileName + "-" + userName);
|
||||
//将当前文件用到的计算数据同步到需要计算的文件缓存
|
||||
sampleBetaData.setBetaList(betaList);
|
||||
sampleBetaData.setBetaFittingPara(betaFittingPara);
|
||||
sampleBetaData.setBetaFittingParaToUi(betaFittingParaToUi);
|
||||
sampleBetaData.setGammaList(gammaList);
|
||||
sampleBetaData.setGammaFittingPara(gammaFittingPara);
|
||||
sampleBetaData.setGammaFittingParaToUi(gammaFittingParaToUi);
|
||||
//存储重新分析字段的实体类
|
||||
SpectrumGroup spectrum_group = new SpectrumGroup();
|
||||
//声明一个map 缓存xeData计算后的结果
|
||||
Map<String, Object> xeMap = new HashMap<>();
|
||||
//判断beta是否进行过分析
|
||||
if (analyseData.isBetaEnergyValid()) {
|
||||
//判断缓存数据是否为空
|
||||
if (Objects.nonNull(betaDataFile) && Objects.nonNull(sampleBetaData)) {
|
||||
//重新分析时将当前的数组封装给到最终记录结果的数组中
|
||||
betaDataFile.setBetaList(betaDataFile.getBetaListNow());
|
||||
betaDataFile.setBetaFittingPara(betaDataFile.getBetaFittingParaNow());
|
||||
betaDataFile.setBetaFittingParaToUi(betaDataFile.getBetaFittingParaToUiNow());
|
||||
betaDataFile.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow());
|
||||
//将当前文件用到的计算数据同步到需要计算的文件缓存
|
||||
sampleBetaData.setBetaList(betaList);
|
||||
sampleBetaData.setBetaFittingPara(betaFittingPara);
|
||||
sampleBetaData.setBetaFittingParaToUi(betaFittingParaToUi);
|
||||
sampleBetaData.setBetaNewEnergyList(betaDataFile.getBetaNewEnergyListNow());
|
||||
//将新的数组封装到各自的数组中
|
||||
betaList = betaDataFile.getBetaList();
|
||||
betaFittingPara = betaDataFile.getBetaFittingPara();
|
||||
betaFittingParaToUi = betaDataFile.getBetaFittingParaToUi();
|
||||
}
|
||||
List<Double> beCal = new LinkedList<>();
|
||||
beCal.add(Double.valueOf(betaFittingParaToUi.get(0)));
|
||||
beCal.add(Double.valueOf(betaFittingParaToUi.get(1)));
|
||||
|
@ -3233,7 +3279,25 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
|
|||
}
|
||||
}
|
||||
}
|
||||
//判断gamma是否进行了计算
|
||||
if (analyseData.isGammaEnergyValid()) {
|
||||
//判断缓存数据是否为空
|
||||
if (Objects.nonNull(betaDataFile) && Objects.nonNull(sampleBetaData)) {
|
||||
//重新分析时将当前的数组封装给到最终记录结果的数组中
|
||||
betaDataFile.setGammaList(betaDataFile.getGammaListNow());
|
||||
betaDataFile.setGammaFittingPara(betaDataFile.getGammaFittingParaNow());
|
||||
betaDataFile.setGammaFittingParaToUi(betaDataFile.getGammaFittingParaToUiNow());
|
||||
betaDataFile.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow());
|
||||
//将当前文件用到的计算数据同步到需要计算的文件缓存
|
||||
sampleBetaData.setGammaList(gammaList);
|
||||
sampleBetaData.setGammaFittingPara(gammaFittingPara);
|
||||
sampleBetaData.setGammaFittingParaToUi(gammaFittingParaToUi);
|
||||
sampleBetaData.setGammaNewEnergyList(betaDataFile.getGammaNewEnergyListNow());
|
||||
//将新的数组封装到各自的数组中
|
||||
gammaList = betaDataFile.getGammaList();
|
||||
gammaFittingPara = betaDataFile.getGammaFittingPara();
|
||||
gammaFittingParaToUi = betaDataFile.getGammaFittingParaToUi();
|
||||
}
|
||||
List<Double> geCal = new LinkedList<>();
|
||||
geCal.add(Double.valueOf(gammaFittingParaToUi.get(0)));
|
||||
geCal.add(Double.valueOf(gammaFittingParaToUi.get(1)));
|
||||
|
|
|
@ -106,7 +106,9 @@ public class SpectrumFileServiceImpl implements ISpectrumFileService {
|
|||
if (!regexPattern.matcher(fileName).find() && !regexPattern1.matcher(fileName).find()) {
|
||||
EnergySpectrumStruct struct = phdFileUtil.analyzeFileSourceData(oneFile);
|
||||
String suffix = nameStandUtil.GetSuffix(struct.data_type, struct.spectrum_quantity, String.valueOf(struct.acquisition_live_time));
|
||||
fileName = oneFile.getName().substring(0, 23)+suffix;
|
||||
String filePreffix = struct.detector_code + StringPool.DASH + struct.acquisition_start_date.replace(StringPool.SLASH, StringPool.EMPTY)+StringPool.UNDERSCORE
|
||||
+ struct.acquisition_start_time.substring(0, 5).replace(StringPool.COLON, StringPool.EMPTY);
|
||||
fileName = filePreffix+suffix;
|
||||
}
|
||||
String fullFilePath = rootPath + filePath + slash + fileName;
|
||||
FileInputStream local = new FileInputStream(oneFile);
|
||||
|
|
Loading…
Reference in New Issue
Block a user