Merge remote-tracking branch 'origin/SelfStation' into SelfStation
This commit is contained in:
commit
7cd16a77c2
|
@ -113,9 +113,13 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
map.put("spectrumData", spectrumData);
|
map.put("spectrumData", spectrumData);
|
||||||
|
|
||||||
//计算边界值
|
//计算边界值
|
||||||
|
//gamma能量部分的计算参数 道值对应能量
|
||||||
List<Double> gEnergy = struct.g_energy;
|
List<Double> gEnergy = struct.g_energy;
|
||||||
|
//gamma能量部分的计算参数 道值
|
||||||
List<Double> gCentroidChannel = struct.g_centroid_channel;
|
List<Double> gCentroidChannel = struct.g_centroid_channel;
|
||||||
|
//beta能量部分的计算参数 道值对应的能量
|
||||||
List<Double> bElectronEnergy = struct.b_electron_energy;
|
List<Double> bElectronEnergy = struct.b_electron_energy;
|
||||||
|
//beta能量部分的计算参数 道值
|
||||||
List<Double> bChannel = struct.b_channel;
|
List<Double> bChannel = struct.b_channel;
|
||||||
CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam();
|
CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam();
|
||||||
calcBgBoundaryParam.g_e_cal = EnergySpectrumHandler.GetFileFittingPara(gEnergy, gCentroidChannel);
|
calcBgBoundaryParam.g_e_cal = EnergySpectrumHandler.GetFileFittingPara(gEnergy, gCentroidChannel);
|
||||||
|
@ -133,6 +137,8 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
List<Integer> roiBBoundaryStart = bgBoundary.ROI_B_Boundary_start;
|
List<Integer> roiBBoundaryStart = bgBoundary.ROI_B_Boundary_start;
|
||||||
List<Integer> roiBBoundaryStop = bgBoundary.ROI_B_Boundary_stop;
|
List<Integer> roiBBoundaryStop = bgBoundary.ROI_B_Boundary_stop;
|
||||||
|
|
||||||
|
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
||||||
|
SelfStationVueData detVueData = selfStationData.getDetVueData();
|
||||||
|
|
||||||
//根据范围1划分 范围1对应的折线图
|
//根据范围1划分 范围1对应的折线图
|
||||||
Map<String, Object> oneMap = statisticsROIList(roiBBoundaryStart.get(0), roiBBoundaryStop.get(0), struct.b_channels, struct.g_channels, struct.h_counts);
|
Map<String, Object> oneMap = statisticsROIList(roiBBoundaryStart.get(0), roiBBoundaryStop.get(0), struct.b_channels, struct.g_channels, struct.h_counts);
|
||||||
|
@ -141,57 +147,56 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
Integer endChannel = (Integer) oneMap.get("endChannel");
|
Integer endChannel = (Integer) oneMap.get("endChannel");
|
||||||
List<SeriseData> seriseDataList = (List<SeriseData>) oneMap.get("dataList");
|
List<SeriseData> seriseDataList = (List<SeriseData>) oneMap.get("dataList");
|
||||||
if (systemType.equals("sample")) {
|
if (systemType.equals("sample")) {
|
||||||
selfStationData.getSampleVueData().setROIOneBetaStart(startChannel);
|
sampleVueData.setROIOneBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROIOneBetaStop(endChannel);
|
sampleVueData.setROIOneBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROIOneList(seriseDataList);
|
sampleVueData.setROIOneList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)oneMap.get("counts"));
|
sampleVueData.setROIOneCounts((List<Long>)oneMap.get("counts"));
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROIOneBetaStart(startChannel);
|
detVueData.setROIOneBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIOneBetaStop(endChannel);
|
detVueData.setROIOneBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIOneList(seriseDataList);
|
detVueData.setROIOneList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIOneCounts((List<Long>)oneMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROIOneStart", roiBBoundaryStart.get(0));
|
map.put("ROIOneStart", roiBBoundaryStart.get(0));
|
||||||
map.put("ROIOneStop", roiBBoundaryStop.get(0));
|
map.put("ROIOneStop", roiBBoundaryStop.get(0));
|
||||||
map.put("ROIOneList", seriseDataList);
|
map.put("ROIOneList", seriseDataList);
|
||||||
}
|
}
|
||||||
//根据范围2划分 范围2对应的折线图
|
//根据范围2划分 范围2对应的折线图
|
||||||
Map<String, Object> twoMap = statisticsROIList(roiBBoundaryStart.get(1), roiBBoundaryStop.get(1), struct.b_channels, struct.g_channels, struct.h_counts);
|
Map<String, Object> twoMap = statisticsROIList(roiBBoundaryStart.get(1), roiBBoundaryStop.get(1),
|
||||||
|
struct.b_channels, struct.g_channels, struct.h_counts);
|
||||||
if ( CollectionUtils.isNotEmpty(twoMap) ) {
|
if ( CollectionUtils.isNotEmpty(twoMap) ) {
|
||||||
Integer startChannel = (Integer) twoMap.get("startChannel");
|
Integer startChannel = (Integer) twoMap.get("startChannel");
|
||||||
Integer endChannel = (Integer) twoMap.get("endChannel");
|
Integer endChannel = (Integer) twoMap.get("endChannel");
|
||||||
List<SeriseData> seriseDataList = (List<SeriseData>) twoMap.get("dataList");
|
List<SeriseData> seriseDataList = (List<SeriseData>) twoMap.get("dataList");
|
||||||
if (systemType.equals("sample")) {
|
if (systemType.equals("sample")) {
|
||||||
selfStationData.getSampleVueData().setROITwoBetaStart(startChannel);
|
sampleVueData.setROITwoBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROITwoBetaStop(endChannel);
|
sampleVueData.setROITwoBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROITwoList(seriseDataList);
|
sampleVueData.setROITwoList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
|
sampleVueData.setROITwoCounts((List<Long>)twoMap.get("counts"));
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROITwoBetaStart(startChannel);
|
detVueData.setROITwoBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROITwoBetaStop(endChannel);
|
detVueData.setROITwoBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROITwoList(seriseDataList);
|
detVueData.setROITwoList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROITwoCounts((List<Long>)twoMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROITwoStart", roiBBoundaryStart.get(1));
|
map.put("ROITwoStart", roiBBoundaryStart.get(1));
|
||||||
map.put("ROITwoStop", roiBBoundaryStop.get(1));
|
map.put("ROITwoStop", roiBBoundaryStop.get(1));
|
||||||
map.put("ROITwoList", seriseDataList);
|
map.put("ROITwoList", seriseDataList);
|
||||||
}
|
}
|
||||||
//根据范围3划分 范围3对应的折线图
|
//根据范围3划分 范围3对应的折线图
|
||||||
Map<String, Object> threeMap = statisticsROIList(roiBBoundaryStart.get(2), roiBBoundaryStop.get(2), struct.b_channels, struct.g_channels, struct.h_counts);
|
Map<String, Object> threeMap = statisticsROIList(roiBBoundaryStart.get(2), roiBBoundaryStop.get(2),
|
||||||
|
struct.b_channels, struct.g_channels, struct.h_counts);
|
||||||
if ( CollectionUtils.isNotEmpty(threeMap) ) {
|
if ( CollectionUtils.isNotEmpty(threeMap) ) {
|
||||||
Integer startChannel = (Integer) threeMap.get("startChannel");
|
Integer startChannel = (Integer) threeMap.get("startChannel");
|
||||||
Integer endChannel = (Integer) threeMap.get("endChannel");
|
Integer endChannel = (Integer) threeMap.get("endChannel");
|
||||||
List<SeriseData> seriseDataList = (List<SeriseData>) threeMap.get("dataList");
|
List<SeriseData> seriseDataList = (List<SeriseData>) threeMap.get("dataList");
|
||||||
if (systemType.equals("sample")) {
|
if (systemType.equals("sample")) {
|
||||||
selfStationData.getSampleVueData().setROIThreeBetaStart(startChannel);
|
sampleVueData.setROIThreeBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROIThreeBetaStop(endChannel);
|
sampleVueData.setROIThreeBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROIThreeList(seriseDataList);
|
sampleVueData.setROIThreeList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
|
sampleVueData.setROIThreeCounts((List<Long>)threeMap.get("counts"));
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROIThreeBetaStart(startChannel);
|
detVueData.setROIThreeBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIThreeBetaStop(endChannel);
|
detVueData.setROIThreeBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIThreeList(seriseDataList);
|
detVueData.setROIThreeList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIThreeCounts((List<Long>)threeMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROIThreeStart", roiBBoundaryStart.get(2));
|
map.put("ROIThreeStart", roiBBoundaryStart.get(2));
|
||||||
map.put("ROIThreeStop", roiBBoundaryStop.get(2));
|
map.put("ROIThreeStop", roiBBoundaryStop.get(2));
|
||||||
|
@ -204,15 +209,14 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
Integer endChannel = (Integer) fourMap.get("endChannel");
|
Integer endChannel = (Integer) fourMap.get("endChannel");
|
||||||
List<SeriseData> seriseDataList = (List<SeriseData>) fourMap.get("dataList");
|
List<SeriseData> seriseDataList = (List<SeriseData>) fourMap.get("dataList");
|
||||||
if (systemType.equals("sample")) {
|
if (systemType.equals("sample")) {
|
||||||
selfStationData.getSampleVueData().setROIFourBetaStart(startChannel);
|
sampleVueData.setROIFourBetaStart(startChannel);
|
||||||
selfStationData.getSampleVueData().setROIFourBetaStop(endChannel);
|
sampleVueData.setROIFourBetaStop(endChannel);
|
||||||
selfStationData.getSampleVueData().setROIFourList(seriseDataList);
|
sampleVueData.setROIFourList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
|
sampleVueData.setROIFourCounts((List<Long>)fourMap.get("counts"));
|
||||||
} else if (systemType.equals("det")) {
|
} else if (systemType.equals("det")) {
|
||||||
selfStationData.getDetVueData().setROIFourBetaStart(startChannel);
|
detVueData.setROIFourBetaStart(startChannel);
|
||||||
selfStationData.getDetVueData().setROIFourBetaStop(endChannel);
|
detVueData.setROIFourBetaStop(endChannel);
|
||||||
selfStationData.getDetVueData().setROIFourList(seriseDataList);
|
detVueData.setROIFourList(seriseDataList);
|
||||||
selfStationData.getSampleVueData().setROIFourCounts((List<Long>)fourMap.get("counts"));
|
|
||||||
}
|
}
|
||||||
map.put("ROIFourStart", roiBBoundaryStart.get(3));
|
map.put("ROIFourStart", roiBBoundaryStart.get(3));
|
||||||
map.put("ROIFourStop", roiBBoundaryStop.get(3));
|
map.put("ROIFourStop", roiBBoundaryStop.get(3));
|
||||||
|
@ -234,15 +238,15 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
Long count = hCounts.get(index.intValue());
|
Long count = hCounts.get(index.intValue());
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
HistogramData his = new HistogramData();
|
HistogramData his = new HistogramData();
|
||||||
his.setG(j);
|
his.setG(i);
|
||||||
his.setB(i);
|
his.setB(j);
|
||||||
his.setC(count);
|
his.setC(count);
|
||||||
histogramDataList.add(his);
|
histogramDataList.add(his);
|
||||||
histogramDataDList.add(his);
|
histogramDataDList.add(his);
|
||||||
}else {
|
}else {
|
||||||
HistogramData his = new HistogramData();
|
HistogramData his = new HistogramData();
|
||||||
his.setG(j);
|
his.setG(i);
|
||||||
his.setB(i);
|
his.setB(j);
|
||||||
his.setC(count);
|
his.setC(count);
|
||||||
histogramDataDList.add(his);
|
histogramDataDList.add(his);
|
||||||
}
|
}
|
||||||
|
@ -250,10 +254,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
}
|
}
|
||||||
map.put("histogramDataList", histogramDataList);
|
map.put("histogramDataList", histogramDataList);
|
||||||
// map.put("histogramDataDList", histogramDataDList);
|
// map.put("histogramDataDList", histogramDataDList);
|
||||||
//gamma能量部分的计算参数 道值
|
|
||||||
// List<Double> gCentroidChannel = struct.g_centroid_channel;
|
|
||||||
//gamma能量部分的计算参数 道值对应能量
|
|
||||||
// List<Double> gEnergy = struct.g_energy;
|
|
||||||
//调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数
|
//调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数
|
||||||
List<Double> gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy);
|
List<Double> gammaParam = EnergySpectrumHandler.GetFileFittingPara(gCentroidChannel, gEnergy);
|
||||||
//存储需要计算gamma能量的道值
|
//存储需要计算gamma能量的道值
|
||||||
|
@ -265,10 +265,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
List<Double> gammaEnergyList = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam);
|
List<Double> gammaEnergyList = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam);
|
||||||
//将gamma能量折线图进行赋值返回
|
//将gamma能量折线图进行赋值返回
|
||||||
map.put("gammaEnergyData", gammaEnergyList);
|
map.put("gammaEnergyData", gammaEnergyList);
|
||||||
//beta能量部分的计算参数 道值
|
|
||||||
// List<Double> bChannel = struct.b_channel;
|
|
||||||
//beta能量部分的计算参数 道值对应的能量
|
|
||||||
// List<Double> bElectronEnergy = struct.b_electron_energy;
|
|
||||||
//调用算法 传入道值和道值对应的能量 得到计算beta能量公式的参数
|
//调用算法 传入道值和道值对应的能量 得到计算beta能量公式的参数
|
||||||
List<Double> betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy);
|
List<Double> betaParam = EnergySpectrumHandler.GetFileFittingPara(bChannel, bElectronEnergy);
|
||||||
List<Double> bchannels = new ArrayList<>();
|
List<Double> bchannels = new ArrayList<>();
|
||||||
|
@ -288,12 +284,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
gEnergyBlock.setCentroid_channel(struct.g_centroid_channel);
|
gEnergyBlock.setCentroid_channel(struct.g_centroid_channel);
|
||||||
gEnergyBlock.setUncertainty(struct.g_uncertainty);
|
gEnergyBlock.setUncertainty(struct.g_uncertainty);
|
||||||
gEnergyBlock.setRecord_count(struct.g_record_count);
|
gEnergyBlock.setRecord_count(struct.g_record_count);
|
||||||
selfStationData.getSampleVueData().getMapEnerKD().put(CalName.CalPHD.getType(), gEnergyBlock);
|
sampleVueData.getMapEnerKD().put(CalName.CalPHD.getType(), gEnergyBlock);
|
||||||
//计算得到公式的参数
|
//计算得到公式的参数
|
||||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Energy", 2, struct.g_centroid_channel, struct.g_energy, struct.g_uncertainty);
|
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Energy", 2, struct.g_centroid_channel, struct.g_energy, struct.g_uncertainty);
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
ParameterInfo parameterInfo = new ParameterInfo();
|
||||||
parameterInfo.setP(calEnergyParam);
|
parameterInfo.setP(calEnergyParam);
|
||||||
selfStationData.getSampleVueData().getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo);
|
sampleVueData.getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//g_Resolution
|
//g_Resolution
|
||||||
|
@ -304,12 +300,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
gResolutionBlock.setFWHM(struct.g_r_FWHM);
|
gResolutionBlock.setFWHM(struct.g_r_FWHM);
|
||||||
gResolutionBlock.setUncertainty(struct.g_r_uncertainty);
|
gResolutionBlock.setUncertainty(struct.g_r_uncertainty);
|
||||||
gResolutionBlock.setRecord_count(struct.g_r_record_count);
|
gResolutionBlock.setRecord_count(struct.g_r_record_count);
|
||||||
selfStationData.getSampleVueData().getMapResoKD().put(CalName.CalPHD.getType(), gResolutionBlock);
|
sampleVueData.getMapResoKD().put(CalName.CalPHD.getType(), gResolutionBlock);
|
||||||
//计算得到公式的参数
|
//计算得到公式的参数
|
||||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Resolution", 4, struct.g_r_energy, struct.g_r_FWHM, struct.g_r_uncertainty);
|
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Resolution", 4, struct.g_r_energy, struct.g_r_FWHM, struct.g_r_uncertainty);
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
ParameterInfo parameterInfo = new ParameterInfo();
|
||||||
parameterInfo.setP(calEnergyParam);
|
parameterInfo.setP(calEnergyParam);
|
||||||
selfStationData.getSampleVueData().getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo);
|
sampleVueData.getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//g_Efficiency
|
//g_Efficiency
|
||||||
|
@ -320,12 +316,12 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
gEfficiencyBlock.setEfficiency(struct.g_e_efficiency);
|
gEfficiencyBlock.setEfficiency(struct.g_e_efficiency);
|
||||||
gEfficiencyBlock.setUncertainty(struct.g_e_uncertainty);
|
gEfficiencyBlock.setUncertainty(struct.g_e_uncertainty);
|
||||||
gEfficiencyBlock.setRecord_count(struct.g_e_record_count);
|
gEfficiencyBlock.setRecord_count(struct.g_e_record_count);
|
||||||
selfStationData.getSampleVueData().getMapEffiKD().put(CalName.CalPHD.getType(), gEfficiencyBlock);
|
sampleVueData.getMapEffiKD().put(CalName.CalPHD.getType(), gEfficiencyBlock);
|
||||||
//计算得到公式的参数
|
//计算得到公式的参数
|
||||||
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Efficiency", 1, struct.g_e_energy, struct.g_e_efficiency, struct.g_e_uncertainty);
|
List<Double> calEnergyParam = CalValuesHandler.calFitPara("Cal_Efficiency", 1, struct.g_e_energy, struct.g_e_efficiency, struct.g_e_uncertainty);
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
ParameterInfo parameterInfo = new ParameterInfo();
|
||||||
parameterInfo.setP(calEnergyParam);
|
parameterInfo.setP(calEnergyParam);
|
||||||
selfStationData.getSampleVueData().getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo);
|
sampleVueData.getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (ParseException e) {
|
} catch (ParseException e) {
|
||||||
|
@ -921,7 +917,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
out.println("MSG_ID " + struct.msg_id + " " + struct.msg_type + "\n" + "DATA_TYPE " + struct.data_type);
|
out.println("MSG_ID " + struct.msg_id + " " + struct.msg_type + "\n" + "DATA_TYPE " + struct.data_type);
|
||||||
out.println("#Header 3");
|
out.println("#Header 3");
|
||||||
// 解析出的Gamma谱 系统类型暂时使用G
|
// 解析出的Gamma谱 系统类型暂时使用G
|
||||||
out.println(struct.site_code + " " + struct.detector_code + " G " +
|
out.println(struct.site_code + " " + struct.detector_code + " C " +
|
||||||
struct.sample_geometry + " " + struct.spectrum_quantity);
|
struct.sample_geometry + " " + struct.spectrum_quantity);
|
||||||
out.println(struct.sample_ref_id);
|
out.println(struct.sample_ref_id);
|
||||||
out.println(struct.measurement_id + " " + struct.detector_bk_measurement_id + " 0");
|
out.println(struct.measurement_id + " " + struct.detector_bk_measurement_id + " 0");
|
||||||
|
@ -951,9 +947,9 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
String str = g_counts.get(i).toString();
|
String str = g_counts.get(i).toString();
|
||||||
if(i % 5 == 0) {
|
if(i % 5 == 0) {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
out.printf(i+"");
|
out.printf((i+1)+"");
|
||||||
} else {
|
} else {
|
||||||
out.printf("\n" + i );
|
out.printf("\n" + (i+1) );
|
||||||
}
|
}
|
||||||
beforeStr = i+"";
|
beforeStr = i+"";
|
||||||
}
|
}
|
||||||
|
|
|
@ -5666,6 +5666,8 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
||||||
redisUtil.set("mdcInfoMap-G", mdcInfoMap);
|
redisUtil.set("mdcInfoMap-G", mdcInfoMap);
|
||||||
|
// todo 暂时和气体使用一样的
|
||||||
|
redisUtil.set("mdcInfoMap-C", mdcInfoMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,13 +263,13 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
|
|
||||||
// Gamma文件内容转换为PHD实体
|
// Gamma文件内容转换为PHD实体
|
||||||
sampleVueData.setROIOneFileName(gammaOneName);
|
sampleVueData.setROIOneFileName(gammaOneName);
|
||||||
sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIOnePHDFile(selfStationUtil.getGammaPHD(gammaOneName, path));
|
||||||
sampleVueData.setROITwoFileName(gammaTwoName);
|
sampleVueData.setROITwoFileName(gammaTwoName);
|
||||||
sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROITwoPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
||||||
sampleVueData.setROIThreeFileName(gammaThreeName);
|
sampleVueData.setROIThreeFileName(gammaThreeName);
|
||||||
sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIThreePHDFile(selfStationUtil.getGammaPHD(gammaThreeName, path));
|
||||||
sampleVueData.setROIFourFileName(gammaFourName);
|
sampleVueData.setROIFourFileName(gammaFourName);
|
||||||
sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaTwoName, path));
|
sampleVueData.setROIFourPHDFile(selfStationUtil.getGammaPHD(gammaFourName, path));
|
||||||
|
|
||||||
resultMap.put("sample", map);
|
resultMap.put("sample", map);
|
||||||
// 初始化Configure
|
// 初始化Configure
|
||||||
|
@ -1857,6 +1857,9 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
Result result = new Result();
|
Result result = new Result();
|
||||||
String userName = JwtUtil.getUserNameByToken(request);
|
String userName = JwtUtil.getUserNameByToken(request);
|
||||||
|
|
||||||
|
// 获取当前角色的颜色配置
|
||||||
|
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
||||||
|
|
||||||
//获取自建台站缓存信息
|
//获取自建台站缓存信息
|
||||||
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
Cache<String, SelfStationData> selfCache = selfStationCache.getSelfCache();
|
||||||
SelfStationData selfStationData = selfCache.getIfPresent(fileName + StringPool.DASH + userName);
|
SelfStationData selfStationData = selfCache.getIfPresent(fileName + StringPool.DASH + userName);
|
||||||
|
@ -1865,77 +1868,25 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
|
||||||
|
|
||||||
// Gamma文件内容转换为PHD实体
|
// Gamma文件内容转换为PHD实体
|
||||||
|
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
||||||
PHDFile phdOne = sampleVueData.getROIOnePHDFile();
|
PHDFile phdOne = sampleVueData.getROIOnePHDFile();
|
||||||
PHDFile phdTwo = sampleVueData.getROITwoPHDFile();
|
PHDFile phdTwo = sampleVueData.getROITwoPHDFile();
|
||||||
PHDFile phdThree = sampleVueData.getROIThreePHDFile();
|
PHDFile phdThree = sampleVueData.getROIThreePHDFile();
|
||||||
PHDFile phdFour = sampleVueData.getROIFourPHDFile();
|
PHDFile phdFour = sampleVueData.getROIFourPHDFile();
|
||||||
|
|
||||||
phdOne.setUserId(processKey);
|
|
||||||
// 赋值xml文件存放路径
|
|
||||||
phdOne.setXmlFilePath(parameterProperties.getFilePath());
|
|
||||||
// 获取当前角色的颜色配置
|
|
||||||
Map<String, String> colorMap = sysUserColorService.initColor(userName);
|
|
||||||
// 分析文件数据
|
|
||||||
int flag = gammaFileUtil.AnalyseData(phdOne);
|
|
||||||
if (flag == 0) {
|
|
||||||
String warning = "The spectrum needn't Analyed. Maybe:\n" +
|
|
||||||
"1. It has already Analyed.\n" +
|
|
||||||
"2. You didn't change any setting or calibration.";
|
|
||||||
result.error500(warning);
|
|
||||||
} else {
|
|
||||||
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type()+"-self");
|
Map<String, NuclideLines> nuclideLinesMap = (Map<String, NuclideLines>) redisUtil.get(userName+StringPool.DASH+phdOne.getHeader().getSystem_type()+"-self");
|
||||||
if (flag == -1) {
|
|
||||||
//分析时将phd的核素map重置
|
|
||||||
phdOne.setPhdNuclideMap(nuclideLinesMap);
|
|
||||||
//重新计算核素的活度浓度
|
|
||||||
gammaFileUtil.NuclidesIdent(phdOne, nuclideLinesMap);
|
|
||||||
phdOne.setEfficiencyParam(phdOne.getUsedEffiPara().getP());
|
|
||||||
phdOne.setEfficiencyEnergy(phdOne.getUsedEffiKD().getG_energy());
|
|
||||||
phdOne.setEfficiencyCurRow(0);
|
|
||||||
// 重新计算峰值
|
|
||||||
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
|
||||||
gammaFileUtil.getNuclideMDCValue(phdOne, phdOne.getMdcInfoMap(), nuclideLinesMDCMap);
|
|
||||||
String warning = "Finish three tasks:\n" +
|
|
||||||
"\t1.Update efficiencies of all peaks;\n" +
|
|
||||||
"\t2.Identify nuclides again;\n" +
|
|
||||||
"\t3.Test QC again.";
|
|
||||||
result.error500(warning);
|
|
||||||
} else {
|
|
||||||
|
|
||||||
|
Map<String, Object> roiMap = new HashMap<>();
|
||||||
try {
|
try {
|
||||||
Map<String, Object> gammaResult = Maps.newHashMap();
|
roiMap.put("ROI1", this.gammaAnalyse(processKey, phdOne, nuclideLinesMap, colorMap));
|
||||||
Map<String, Object> map1 = this.gammaAnalyse(phdOne, nuclideLinesMap, colorMap);
|
roiMap.put("ROI2", this.gammaAnalyse(processKey, phdTwo, nuclideLinesMap, colorMap));
|
||||||
Map<String, Object> map2 = this.gammaAnalyse(phdTwo, nuclideLinesMap, colorMap);
|
roiMap.put("ROI3", this.gammaAnalyse(processKey, phdThree, nuclideLinesMap, colorMap));
|
||||||
Map<String, Object> map3 = this.gammaAnalyse(phdThree, nuclideLinesMap, colorMap);
|
roiMap.put("ROI4", this.gammaAnalyse(processKey, phdFour, nuclideLinesMap, colorMap));
|
||||||
Map<String, Object> map4 = this.gammaAnalyse(phdFour, nuclideLinesMap, colorMap);
|
|
||||||
gammaResult.put("ROI1", map1);
|
|
||||||
gammaResult.put("ROI2", map2);
|
|
||||||
gammaResult.put("ROI3", map3);
|
|
||||||
gammaResult.put("ROI4", map4);
|
|
||||||
|
|
||||||
sampleVueData.setUsedEnerKD(phdOne.getUsedEnerKD());
|
|
||||||
sampleVueData.setUsedEffiKD(phdOne.getUsedEffiKD());
|
|
||||||
sampleVueData.setUsedResoKD(phdOne.getUsedResoKD());
|
|
||||||
sampleVueData.setMapEnerKD(phdOne.getMapEnerKD());
|
|
||||||
sampleVueData.setMapResoKD(phdOne.getMapResoKD());
|
|
||||||
sampleVueData.setMapEffiKD(phdOne.getMapEffiKD());
|
|
||||||
sampleVueData.setUsedEnerPara(phdOne.getUsedEnerPara());
|
|
||||||
sampleVueData.setUsedEffiPara(phdOne.getUsedEffiPara());
|
|
||||||
sampleVueData.setUsedResoPara(phdOne.getUsedResoPara());
|
|
||||||
sampleVueData.setMapEnerPara(phdOne.getMapEnerPara());
|
|
||||||
sampleVueData.setMapResoPara(phdOne.getMapResoPara());
|
|
||||||
sampleVueData.setMapEffiPara(phdOne.getMapEffiPara());
|
|
||||||
|
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(gammaResult);
|
result.setResult(roiMap);
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI"));
|
result.error500(StrUtil.replace(e.getMessage(), "%s", "ROI"));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3340,18 +3291,47 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
* @return
|
* @return
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
private Map<String, Object> gammaAnalyse(PHDFile phd, Map<String, NuclideLines> nuclideLinesMap,
|
private Map<String, Object> gammaAnalyse(String processKey, PHDFile phd, Map<String, NuclideLines> nuclideLinesMap,
|
||||||
Map<String, String> colorMap) throws RuntimeException{
|
Map<String, String> colorMap) throws RuntimeException{
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
phd.setUserId(processKey);
|
||||||
|
// 赋值xml文件存放路径
|
||||||
|
phd.setXmlFilePath(parameterProperties.getFilePath());
|
||||||
|
int flag = gammaFileUtil.AnalyseData(phd);
|
||||||
|
if (flag == 0) {
|
||||||
|
String warning = "The spectrum needn't Analyed. Maybe:\n" +
|
||||||
|
"1. It has already Analyed.\n" +
|
||||||
|
"2. You didn't change any setting or calibration.";
|
||||||
|
throw new RuntimeException(warning);
|
||||||
|
} else {
|
||||||
|
if (flag == -1) {
|
||||||
//分析时将phd的核素map重置
|
//分析时将phd的核素map重置
|
||||||
phd.setPhdNuclideMap(nuclideLinesMap);
|
phd.setPhdNuclideMap(nuclideLinesMap);
|
||||||
|
//重新计算核素的活度浓度
|
||||||
|
gammaFileUtil.NuclidesIdent(phd, nuclideLinesMap);
|
||||||
|
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
||||||
|
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
||||||
|
phd.setEfficiencyCurRow(0);
|
||||||
|
// 重新计算峰值
|
||||||
|
Map<String, NuclideLines> nuclideLinesMDCMap = (Map<String, NuclideLines>) redisUtil.get("AllNuclideMap");
|
||||||
|
gammaFileUtil.getNuclideMDCValue(phd, phd.getMdcInfoMap(), nuclideLinesMDCMap);
|
||||||
|
String warning = "Finish three tasks:\n" +
|
||||||
|
"\t1.Update efficiencies of all peaks;\n" +
|
||||||
|
"\t2.Identify nuclides again;\n" +
|
||||||
|
"\t3.Test QC again.";
|
||||||
|
throw new RuntimeException(warning);
|
||||||
|
} else {
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
//分析时将phd的核素map重置
|
||||||
|
phd.setPhdNuclideMap(nuclideLinesMap);
|
||||||
|
//读取redis缓存的计算mdc信息
|
||||||
|
Map<String, CalMDCInfo> mdcInfoMap = (Map<String, CalMDCInfo>) redisUtil.get("mdcInfoMap-"+phd.getHeader().getSystem_type());
|
||||||
|
if (CollectionUtils.isNotEmpty(mdcInfoMap)) {
|
||||||
|
phd.setMdcInfoMap(mdcInfoMap);
|
||||||
|
}
|
||||||
//调用分析算法
|
//调用分析算法
|
||||||
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
boolean analyseSpectrum = gammaFileUtil.AnalyseSpectrum(phd, nuclideLinesMap);
|
||||||
|
|
||||||
if (analyseSpectrum) {
|
if (analyseSpectrum) {
|
||||||
|
|
||||||
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
phd.setEfficiencyParam(phd.getUsedEffiPara().getP());
|
||||||
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
phd.setEfficiencyEnergy(phd.getUsedEffiKD().getG_energy());
|
||||||
phd.setEfficiencyCurRow(0);
|
phd.setEfficiencyCurRow(0);
|
||||||
|
@ -3365,9 +3345,11 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
||||||
// Bar Chart 柱状图
|
// Bar Chart 柱状图
|
||||||
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
List<SeriseData> differance = gammaFileUtil.Differance(phd, phd.getVPeak());
|
||||||
map.put("barChart", differance);
|
map.put("barChart", differance);
|
||||||
|
return map;
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!");
|
throw new RuntimeException("There is a problem with the current %s phd file, Analysis failure!");
|
||||||
}
|
}
|
||||||
return map;
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user