Merge remote-tracking branch 'origin/station' into station

This commit is contained in:
nieziyan 2023-11-16 19:25:48 +08:00
commit 171657a6a2
4 changed files with 247 additions and 128 deletions

View File

@ -127,7 +127,8 @@ public abstract class AbstractLogOrReport {
if (j==0) {
titles.add(cell);
} else {
titles.add(" ");
titles.add(StringPool.SPACE);
dataSub = StringPool.SPACE+dataSub;
}
contents.add(dataSub);
}

View File

@ -2481,7 +2481,7 @@ public class GammaFileUtil extends AbstractLogOrReport {
String activity = String.format("%.3f", Double.valueOf(middleData.nucl_ided_activ_key.get(i))) + " bq";
String relErr = String.format("%.3f", (Double.valueOf(middleData.nucl_ided_activ_key_err.get(i)) / Double.valueOf(middleData.nucl_ided_activ_key.get(i)) * 100)) + " %";
String conc = middleData.nucl_ided_Concentration.get(i) + " uBq/m^3";
String mdc = StringUtils.join(middleData.nucl_ided_MDC.get(i), " ");
String mdc = StringUtils.join(middleData.nucl_ided_MDC.get(i), StringPool.SPACE);
strBuffer.append(rowFormat(data15, nuclideName, halflife, activity, relErr, conc, mdc));
//换行
strBuffer.append(System.lineSeparator());
@ -2569,11 +2569,36 @@ public class GammaFileUtil extends AbstractLogOrReport {
//换行
strBuffer.append(System.lineSeparator());
//报告内容第一部分数据
String[] cells1 = new String[]{" Station ID", " Detector ID", " Sample ID", " Sample Geometry", " Sample Quantity[m3]", " Sample Type", " Collection Start", " Collection Stop",
" Sampling Time[h]", " Decay Time[h]", " Acquisition Start", " Acquisition Stop", " Acquisition Time[s]", " Avg Flow Rate[m3/h]", " Collection Station Comments"};
String[] datas1 = new String[]{middleData.sample_stationID, middleData.sample_detectID, middleData.sample_id, middleData.sample_Geometry, middleData.sample_quantity, middleData.sample_Type, middleData.sample_collection_start,
middleData.sample_collection_stop, middleData.sample_time, middleData.sample_decay_time, middleData.sample_acquisiton_start, middleData.sample_acquistion_stop, middleData.sample_acquistion_time, middleData.sample_Avg_Flow_Rate,
middleData.Collection_Station_Comments};
strBuffer.append(rowFormat("%sStation ID:%-29s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sSample ID:%-30s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sSample Quantity[m3]:%-20s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sCollection Start:%-23s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sSampling Time[h]:%-23s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sAcquisition Start:%-22s%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(System.lineSeparator());
strBuffer.append(rowFormat("%sAcquisition Time[s]:%-20s%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(System.lineSeparator());
String[] cells1 = new String[]{" Collection Station Comments"};
String[] datas1 = new String[]{middleData.Collection_Station_Comments};
//根据固定宽度切割数据
Map<String, List<String>> reportMap1 = GetReportFixedWidth(cells1, datas1, 30);
List<String> title1 = reportMap1.get("title");
@ -2581,7 +2606,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:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(String.format("%s:%-12s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
@ -2595,7 +2620,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:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(String.format("%s:%-14s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
@ -2624,20 +2649,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:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(String.format("%s:%-20s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(String.format("%s:%-30s%s", " Keyline Activities for Nuclides", StringPool.SPACE, ""));
strBuffer.append(String.format("%s:%-8s%s", " Keyline Activities for Nuclides", StringPool.SPACE, ""));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " with defined Reference Line", StringPool.SPACE, ""));
strBuffer.append(String.format("%s:%-12s%s", " with defined Reference Line", StringPool.SPACE, ""));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start));
strBuffer.append(String.format("%s:%-16s%s", " Activity Reference Time", StringPool.SPACE, middleData.sample_acquisiton_start));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start));
strBuffer.append(String.format("%s:%-11s%s", " Concentration Reference Time", StringPool.SPACE, middleData.sample_collection_start));
//换行
strBuffer.append(System.lineSeparator());
//换行
@ -2700,38 +2725,38 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append("#PROCESSING PARAMETERS");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " ECutAnalysis_Low", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low())));
strBuffer.append(rowFormat("%sECutAnalysis_Low:%-23s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getECutAnalysis_Low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " ECutAnalysis_High", StringPool.SPACE, middleData.setting_specSetup.getECutAnalysis_High()==-9999?"inf":String.valueOf(middleData.setting_specSetup.getECutAnalysis_High())));
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(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " EnergyTolerance", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance())));
strBuffer.append(rowFormat("%sEnergyTolerance:%-24s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getEnergyTolerance())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " BaseImprovePSS", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS())));
strBuffer.append(rowFormat("%sBaseImprovePSS:%-25s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getBaseImprovePSS())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " PSS_low", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low())));
strBuffer.append(rowFormat("%sPSS_low:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getPss_low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " k_back", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back())));
strBuffer.append(rowFormat("%sk_back:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_back())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " k_alpha", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha())));
strBuffer.append(rowFormat("%sk_alpha:%-32s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_alpha())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " k_beta", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta())));
strBuffer.append(rowFormat("%sk_beta:%-33s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getK_beta())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " RiskLevelK", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK())));
strBuffer.append(rowFormat("%sRiskLevelK:%-29s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getRiskLevelK())));
//换行
strBuffer.append(System.lineSeparator());
Date refTimeAct = middleData.setting_specSetup.getRefTime_act();
strBuffer.append(String.format("%s:%-30s%s", " refTime_act", StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss"));
strBuffer.append(rowFormat("%srefTime_act:%-28s%s", StringPool.SPACE, StringPool.SPACE, DateUtils.formatDate(refTimeAct), "yyyy-MM-dd HH:mm:ss"));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " refTime_conc", StringPool.SPACE, DateUtils.formatDate(middleData.setting_specSetup.getRefTime_conc(), "yyyy-MM-dd HH:mm:ss")));
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(System.lineSeparator());
//换行
@ -2739,16 +2764,16 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append("#CALIBRATION PARAMETERS");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " CalibrationPSS_low", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low())));
strBuffer.append(rowFormat("%sCalibrationPSS_low:%-21s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_low())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " CalibrationPSS_high", StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high())));
strBuffer.append(rowFormat("%sCalibrationPSS_high:%-20s%s", StringPool.SPACE, StringPool.SPACE, String.valueOf(middleData.setting_specSetup.getCalibrationPSS_high())));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " bUpdateCal", StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0")));
strBuffer.append(rowFormat("%sbUpdateCal:%-29s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isBUpdateCal()?"1":"0")));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " KeepCalPeakSearchPeaks", StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0")));
strBuffer.append(rowFormat("%sKeepCalPeakSearchPeaks:%-17s%s", StringPool.SPACE, StringPool.SPACE, (middleData.setting_specSetup.isKeepCalPeakSearchPeaks()?"1":"0")));
//换行
strBuffer.append(System.lineSeparator());
//换行
@ -2760,12 +2785,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(" Energy Calibration ["+middleData.calibration_pairs_E_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Function", StringPool.SPACE, middleData.calibration_E_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " E", StringPool.SPACE, middleData.calibration_E_functionDef));
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE4 = new String[]{" E"};
String[] datasE4 = new String[]{middleData.calibration_E_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE4 = GetReportFixedWidth(cellsE4, datasE4, 30);
List<String> titleE4 = reportMapE4.get("title");
List<String> contentE4 = reportMapE4.get("content");
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(System.lineSeparator());
}
String[] cells4 = new String[]{" P"};
String[] datas4 = new String[]{middleData.calibration_E_coeff_string};
//根据固定宽度切割数据
@ -2775,16 +2810,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(String.format("%s:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Err", StringPool.SPACE, middleData.calibration_E_uncoeff_string));
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_E_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Data", StringPool.SPACE, middleData.calibration_pairs_E_Input));
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_E_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
@ -2796,12 +2831,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(" Resolution Calibration ["+middleData.calibration_pairs_R_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Function", StringPool.SPACE, middleData.calibration_R_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " E", StringPool.SPACE, middleData.calibration_R_functionDef));
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE5 = new String[]{" E"};
String[] datasE5 = new String[]{middleData.calibration_R_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE5 = GetReportFixedWidth(cellsE5, datasE5, 30);
List<String> titleE5 = reportMapE5.get("title");
List<String> contentE5 = reportMapE5.get("content");
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(System.lineSeparator());
}
String[] cells5 = new String[]{" P"};
String[] datas5 = new String[]{middleData.calibration_R_coeff_string};
//根据固定宽度切割数据
@ -2811,14 +2856,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(String.format("%s:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(String.format("%s:%-30s%s", " Err", StringPool.SPACE, middleData.calibration_R_uncoeff_string));
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_R_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Data", StringPool.SPACE, middleData.calibration_pairs_R_Input));
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_R_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
@ -2828,12 +2873,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(" Efficiency Calibration ["+middleData.calibration_pairs_EF_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Function", StringPool.SPACE, middleData.calibration_EF_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " E", StringPool.SPACE, middleData.calibration_EF_functionDef));
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE6 = new String[]{" E"};
String[] datasE6 = new String[]{middleData.calibration_EF_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE6 = GetReportFixedWidth(cellsE6, datasE6, 30);
List<String> titleE6 = reportMapE6.get("title");
List<String> contentE6 = reportMapE6.get("content");
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(System.lineSeparator());
}
String[] cells6 = new String[]{" P"};
String[] datas6 = new String[]{middleData.calibration_EF_coeff_string};
//根据固定宽度切割数据
@ -2843,14 +2898,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(String.format("%s:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(String.format("%s:%-30s%s", " Err", StringPool.SPACE, middleData.calibration_EF_uncoeff_string));
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_EF_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Data", StringPool.SPACE, middleData.calibration_pairs_EF_Input));
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_EF_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行
@ -2860,12 +2915,22 @@ public class GammaFileUtil extends AbstractLogOrReport {
strBuffer.append(" Tot_efficiency Calibration ["+middleData.calibration_pairs_T_Input+" ]");
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Function", StringPool.SPACE, middleData.calibration_T_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " E", StringPool.SPACE, middleData.calibration_T_functionDef));
strBuffer.append(rowFormat("%sFunction:%-31s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_functionTypeDef));
//换行
strBuffer.append(System.lineSeparator());
String[] cellsE7 = new String[]{" E"};
String[] datasE7 = new String[]{middleData.calibration_T_functionDef};
//根据固定宽度切割数据
Map<String, List<String>> reportMapE7 = GetReportFixedWidth(cellsE7, datasE7, 30);
List<String> titleE7 = reportMapE7.get("title");
List<String> contentE7 = reportMapE7.get("content");
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(System.lineSeparator());
}
String[] cells7 = new String[]{" P"};
String[] datas7 = new String[]{middleData.calibration_T_coeff_string};
//根据固定宽度切割数据
@ -2875,14 +2940,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(String.format("%s:%-30s%s", title, StringPool.SPACE, content));
strBuffer.append(rowFormat("%s:%-38s%s", title, StringPool.SPACE, content));
//换行
strBuffer.append(System.lineSeparator());
}
strBuffer.append(String.format("%s:%-30s%s", " Err", StringPool.SPACE, middleData.calibration_T_uncoeff_string));
strBuffer.append(rowFormat("%sErr:%-36s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_T_uncoeff_string));
//换行
strBuffer.append(System.lineSeparator());
strBuffer.append(String.format("%s:%-30s%s", " Data", StringPool.SPACE, middleData.calibration_pairs_T_Input));
strBuffer.append(rowFormat("%sData:%-35s%s", StringPool.SPACE, StringPool.SPACE, middleData.calibration_pairs_T_Input));
//换行
strBuffer.append(System.lineSeparator());
//换行

View File

@ -679,7 +679,43 @@ public class PHDFileUtil extends AbstractLogOrReport {
analyseResult = EnergySpectrumHandler.bgReAnalyse(sampleTmp.getAbsolutePath(), gasTmp.getAbsolutePath(), detTmp.getAbsolutePath(), BgCalPara);
}
if (StringUtils.isNotBlank(analyseResult.error_log) && !analyseResult.error_log.equalsIgnoreCase("no error.")) {
System.out.println(analyseResult.error_log);
//新计算得到的边界值
if (CollectionUtils.isNotEmpty(analyseResult.S_ROI_B_Boundary_start)) {
List<Boundary> boundaryList = new LinkedList<>();
for (int i=0; i<analyseResult.S_ROI_B_Boundary_start.size(); i++) {
Boundary boundary = new Boundary();
boundary.setMinX(analyseResult.S_ROI_B_Boundary_start.get(i));
boundary.setMaxX(analyseResult.S_ROI_B_Boundary_stop.get(i));
boundary.setMinY(analyseResult.S_ROI_G_Boundary_start.get(i));
boundary.setMaxY(analyseResult.S_ROI_G_Boundary_stop.get(i));
boundaryList.add(boundary);
}
map.put("SampleBoundary", boundaryList);
}
if (CollectionUtils.isNotEmpty(analyseResult.G_ROI_B_Boundary_start)) {
List<Boundary> boundaryList = new LinkedList<>();
for (int i=0; i<analyseResult.G_ROI_B_Boundary_start.size(); i++) {
Boundary boundary = new Boundary();
boundary.setMinX(analyseResult.G_ROI_B_Boundary_start.get(i));
boundary.setMaxX(analyseResult.G_ROI_B_Boundary_stop.get(i));
boundary.setMinY(analyseResult.G_ROI_G_Boundary_start.get(i));
boundary.setMaxY(analyseResult.G_ROI_G_Boundary_stop.get(i));
boundaryList.add(boundary);
}
map.put("GasBoundary", boundaryList);
}
if (CollectionUtils.isNotEmpty(analyseResult.D_ROI_B_Boundary_start)) {
List<Boundary> boundaryList = new LinkedList<>();
for (int i=0; i<analyseResult.D_ROI_B_Boundary_start.size(); i++) {
Boundary boundary = new Boundary();
boundary.setMinX(analyseResult.D_ROI_B_Boundary_start.get(i));
boundary.setMaxX(analyseResult.D_ROI_B_Boundary_stop.get(i));
boundary.setMinY(analyseResult.D_ROI_G_Boundary_start.get(i));
boundary.setMaxY(analyseResult.D_ROI_G_Boundary_stop.get(i));
boundaryList.add(boundary);
}
map.put("DetBoundary", boundaryList);
}
bRet = false;
return bRet;
} else {

View File

@ -1039,40 +1039,46 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sOld Beta%-43sOld Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)), StringPool.SPACE));
//拼接历史计算公式 CH
String oldBetaSampleCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)));
String oldGammaSampleCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)), StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaSampleCHStr.length())+"s%s", oldBetaSampleCHStr, StringPool.SPACE, oldGammaSampleCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)), StringPool.SPACE));
//拼接历史计算公式 E
String oldBetaSampleEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)));
String oldGammaSampleEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)), StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaSampleEStr.length())+"s%s", oldBetaSampleEStr, StringPool.SPACE, oldGammaSampleEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#SAMPLE New CALIBRATION");
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sNew Beta%-43sNew Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 CH
String newBetaSampleCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamES.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff1()))),
(Objects.isNull(betaCalibrationParamES.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff2()))),
(Objects.isNull(betaCalibrationParamES.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamES.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff1()))),
(Objects.isNull(betaCalibrationParamES.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamES.getCoeff3()))));
String newGammaSampleCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamES.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamES.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamES.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamES.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaSampleCHStr.length())+"s%s", newBetaSampleCHStr, StringPool.SPACE, newGammaSampleCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 E
String newBetaSampleEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamS.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff1()))),
(Objects.isNull(betaCalibrationParamS.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff2()))),
(Objects.isNull(betaCalibrationParamS.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamS.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff1()))),
(Objects.isNull(betaCalibrationParamS.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamS.getCoeff3()))));
String newGammaSampleEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamS.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamS.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamS.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamS.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaSampleEStr.length())+"s%s", newBetaSampleEStr, StringPool.SPACE, newGammaSampleEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#SAMPLE: LIMITS PER ROI");
@ -1091,42 +1097,48 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sOld Beta%-43sOld Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)),
//拼接历史计算公式 CH
String oldBetaDetCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)));
String oldGammaDetCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaDetCHStr.length())+"s%s", oldBetaDetCHStr, StringPool.SPACE, oldGammaDetCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)),
//拼接历史计算公式 E
String oldBetaDetEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)));
String oldGammaDetEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaDetEStr.length())+"s%s", oldBetaDetEStr, StringPool.SPACE, oldGammaDetEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#DET New CALIBRATION");
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sNew Beta%-43sNew Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 CH
String newBetaDetCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamED.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff1()))),
(Objects.isNull(betaCalibrationParamED.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff2()))),
(Objects.isNull(betaCalibrationParamED.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamED.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff1()))),
(Objects.isNull(betaCalibrationParamED.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamED.getCoeff3()))));
String newGammaDetCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamED.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamED.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamED.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamED.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaDetCHStr.length())+"s%s", newBetaDetCHStr, StringPool.SPACE, newGammaDetCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 E
String newBetaDetEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamD.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff1()))),
(Objects.isNull(betaCalibrationParamD.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff2()))),
(Objects.isNull(betaCalibrationParamD.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamD.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff1()))),
(Objects.isNull(betaCalibrationParamD.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamD.getCoeff3()))));
String newGammaDetEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamD.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamD.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamD.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamD.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaDetEStr.length())+"s%s", newBetaDetEStr, StringPool.SPACE, newGammaDetEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#DET: LIMITS PER ROI");
@ -1144,42 +1156,47 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sOld Beta%-43sOld Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)),
//拼接历史计算公式 CH
String oldBetaGasCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)));
String oldGammaGasCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaGasCHStr.length())+"s%s", oldBetaGasCHStr, StringPool.SPACE, oldGammaGasCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)),
StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)),
String oldBetaGasEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE, NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)));
String oldGammaGasEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)),
NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)), NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-oldBetaGasEStr.length())+"s%s", oldBetaGasEStr, StringPool.SPACE, oldGammaGasEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#GAS New CALIBRATION");
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sNew Beta%-43sNew Gamma%-42s", StringPool.SPACE, StringPool.SPACE, StringPool.SPACE));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x%-24sCH(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 CH
String newBetaGasCHStr = rowFormat("%sCH(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamEG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff1()))),
(Objects.isNull(betaCalibrationParamEG.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff2()))),
(Objects.isNull(betaCalibrationParamEG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamEG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff1()))),
(Objects.isNull(betaCalibrationParamEG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamEG.getCoeff3()))));
String newGammaGasCHStr = rowFormat("CH(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamEG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamEG.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamEG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaToUiOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamEG.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaGasCHStr.length())+"s%s", newBetaGasCHStr, StringPool.SPACE, newGammaGasCHStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x%-24sE(x) = (%s)+(%s)*x+(%s)x*x%-24s", StringPool.SPACE,
//拼接新计算公式 E
String newBetaGasEStr = rowFormat("%sE(x) = (%s)+(%s)*x+(%s)x*x", StringPool.SPACE,
(Objects.isNull(betaCalibrationParamG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff1()))),
(Objects.isNull(betaCalibrationParamG.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff2()))),
(Objects.isNull(betaCalibrationParamG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff3()))),
StringPool.SPACE,
(Objects.isNull(gammaCalibrationParamG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff1()))),
(Objects.isNull(betaCalibrationParamG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getBetaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(betaCalibrationParamG.getCoeff3()))));
String newGammaGasEStr = rowFormat("E(x) = (%s)+(%s)*x+(%s)x*x%-24s", (Objects.isNull(gammaCalibrationParamG.getCoeff1())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(0)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff1()))),
(Objects.isNull(gammaCalibrationParamG.getCoeff2())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(1)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff2()))),
(Objects.isNull(gammaCalibrationParamG.getCoeff3())?NumberFormatUtil.numberSixLen(betaDataFile.getGammaFittingParaOld().get(2)):NumberFormatUtil.numberSixLen(String.valueOf(gammaCalibrationParamG.getCoeff3()))),
StringPool.SPACE));
StringPool.SPACE);
strBuffer.append(rowFormat("%s%-"+(52-newBetaGasEStr.length())+"s%s", newBetaGasEStr, StringPool.SPACE, newGammaGasEStr));
strBuffer.append(System.lineSeparator());
strBuffer.append(System.lineSeparator());
strBuffer.append("#GAS: LIMITS PER ROI");
@ -2909,7 +2926,6 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData();
//判断是否勾选了qc
spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData();
betaDataFile.setBgPara(spectrum_group.BgCalPara);
File sampleTmp = null;
File gasTmp = null;
File detTmp = null;
@ -2925,15 +2941,15 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
//调用分析方法进行分析操作
boolean bRet = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, spectrum_group.BgCalPara, xeMap, betaDataFile);
if (bRet) {
if (analyseData.isQcData()) {
if (StringUtils.isNotBlank(betaDataFile.getQcFilePathName())) {
EnergySpectrumStruct struct = betaDataFile.getQcStruct();
if (Objects.nonNull(struct)) {
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap, betaDataFile);
}
if (analyseData.isQcData()) {
if (StringUtils.isNotBlank(betaDataFile.getQcFilePathName())) {
EnergySpectrumStruct struct = betaDataFile.getQcStruct();
if (Objects.nonNull(struct)) {
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap, betaDataFile);
}
}
}
if (bRet) {
List<Boundary> sampleBoundary = (List<Boundary>) xeMap.get("SampleBoundary");
if(CollectionUtils.isNotEmpty(sampleBoundary)) {
betaDataFile.setSampleBoundary(sampleBoundary);
@ -2972,6 +2988,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
betaDataFile.setXeResultsSpectrumList(xeResultsSpectrumList);
betaDataFile.setBProcessed(true);
betaDataFile.setSaveAnalysisResult(true);
betaDataFile.setBgPara(spectrum_group.BgCalPara);
}
} else {
xeMap.put("XeData", Collections.EMPTY_LIST);
@ -3103,7 +3120,6 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
spectrum_group.BgCalPara.bApplyNewCalicGasBg = analyseData.isGasBgData();
spectrum_group.BgCalPara.bApplyNewCalicDetBg = analyseData.isDetBgData();
spectrum_group.BgCalPara.bApplyNewCalicQc = analyseData.isQcData();
sampleBetaData.setBgPara(spectrum_group.BgCalPara);
File sampleTmp = null;
File gasTmp = null;
File detTmp = null;
@ -3119,15 +3135,15 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
if (Objects.nonNull(sampleTmp) && Objects.nonNull(gasTmp) && Objects.nonNull(detTmp)) {
//调用分析方法进行分析操作
boolean bRet = phdFileUtil.analyzeSpectrum(sampleTmp, gasTmp, detTmp, spectrum_group.BgCalPara, xeMap, sampleBetaData);
if (bRet) {
if (analyseData.isQcData()) {
if (StringUtils.isNotBlank(sampleBetaData.getQcFilePathName())) {
EnergySpectrumStruct struct = sampleBetaData.getQcStruct();
if (Objects.nonNull(struct)) {
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap, sampleBetaData);
}
if (analyseData.isQcData()) {
if (StringUtils.isNotBlank(sampleBetaData.getQcFilePathName())) {
EnergySpectrumStruct struct = sampleBetaData.getQcStruct();
if (Objects.nonNull(struct)) {
phdFileUtil.CalQCBoundary(betaList, gammaList, betaFittingParaToUi, gammaFittingParaToUi, struct, xeMap, sampleBetaData);
}
}
}
if (bRet) {
List<Boundary> sampleBoundary = (List<Boundary>) xeMap.get("SampleBoundary");
if(CollectionUtils.isNotEmpty(sampleBoundary)) {
betaDataFile.setSampleBoundary(sampleBoundary);
@ -3166,6 +3182,7 @@ public class SpectrumAnalysisServiceImpl extends AbstractLogOrReport implements
sampleBetaData.setXeResultsSpectrumList(xeResultsSpectrumList);
sampleBetaData.setBProcessed(true);
sampleBetaData.setSaveAnalysisResult(true);
sampleBetaData.setBgPara(spectrum_group.BgCalPara);
}
analyseResultMap.put(sampleFileName, xeMap);
} else {