fix:解决新beta谱从db加载 roi limit不对的问题;解决db加载后 setting act和conc时间校验失败能再次分析的问题
This commit is contained in:
parent
a441eb6ad1
commit
d93c519ed0
|
@ -80,6 +80,9 @@ public class NumberFormatUtil {
|
||||||
|
|
||||||
//总数字个数是6位的数
|
//总数字个数是6位的数
|
||||||
public static String numberSixLen(String number) {
|
public static String numberSixLen(String number) {
|
||||||
|
if (StringUtils.isBlank(number)) {
|
||||||
|
return number;
|
||||||
|
}
|
||||||
String value = "";
|
String value = "";
|
||||||
if (number.equalsIgnoreCase("nan")) {
|
if (number.equalsIgnoreCase("nan")) {
|
||||||
value = number;
|
value = number;
|
||||||
|
|
|
@ -1550,8 +1550,8 @@ public class GammaFileUtil extends AbstractLogOrReport {
|
||||||
|| newSets.getK_alpha() != oldSets.getK_alpha()
|
|| newSets.getK_alpha() != oldSets.getK_alpha()
|
||||||
|| newSets.getK_beta() != oldSets.getK_beta()
|
|| newSets.getK_beta() != oldSets.getK_beta()
|
||||||
|| newSets.getRiskLevelK() != oldSets.getRiskLevelK()
|
|| newSets.getRiskLevelK() != oldSets.getRiskLevelK()
|
||||||
|| newSets.getRefTime_act() != oldSets.getRefTime_act()
|
|| !newSets.getRefTime_act().equals(oldSets.getRefTime_act())
|
||||||
|| newSets.getRefTime_conc() != oldSets.getRefTime_conc())
|
|| !newSets.getRefTime_conc().equals(oldSets.getRefTime_conc()))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,8 @@ public interface AnalysisManService {
|
||||||
|
|
||||||
void middleDataTable(Integer idAnalysis, List<GStoreMiddleProcessData> middleDatas);
|
void middleDataTable(Integer idAnalysis, List<GStoreMiddleProcessData> middleDatas);
|
||||||
|
|
||||||
void saveAnalysisROI(Integer sampleId, Integer idAnalysis,EnergySpectrumStruct sampleStruct,
|
void saveAnalysisROI(Integer sampleId, Integer idAnalysis, List<Integer> roiBBoundaryStart, List<Integer> roiBBoundaryStop,
|
||||||
|
List<Integer> roiGBoundaryStart, List<Integer> roiGBoundaryStop,
|
||||||
List<GStoreMiddleProcessData> middleDatas, List<String> phdFilePaths);
|
List<GStoreMiddleProcessData> middleDatas, List<String> phdFilePaths);
|
||||||
|
|
||||||
void deleteAnalysisROI(Integer idAnalysis);
|
void deleteAnalysisROI(Integer idAnalysis);
|
||||||
|
|
|
@ -64,9 +64,11 @@ public class AnalysisManServiceImpl implements AnalysisManService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void saveAnalysisROI(Integer sampleId, Integer idAnalysis, EnergySpectrumStruct sampleStruct, List<GStoreMiddleProcessData> middleDatas, List<String> phdFilePaths) {
|
public void saveAnalysisROI(Integer sampleId, Integer idAnalysis, List<Integer> roiBBoundaryStart,
|
||||||
|
List<Integer> roiBBoundaryStop, List<Integer> roiGBoundaryStart, List<Integer> roiGBoundaryStop,
|
||||||
|
List<GStoreMiddleProcessData> middleDatas, List<String> phdFilePaths) {
|
||||||
|
|
||||||
List<GardsAnalysisRoi> analysisRois = new ArrayList<>();
|
List<GardsAnalysisRoi> analysisRois = new ArrayList<>();
|
||||||
List<String> roiNumber = sampleStruct.ROI_number;
|
|
||||||
for (int i = 0; i < middleDatas.size(); i++) {
|
for (int i = 0; i < middleDatas.size(); i++) {
|
||||||
GStoreMiddleProcessData middleData = middleDatas.get(i);
|
GStoreMiddleProcessData middleData = middleDatas.get(i);
|
||||||
GardsAnalysisRoi analysisRoi = new GardsAnalysisRoi();
|
GardsAnalysisRoi analysisRoi = new GardsAnalysisRoi();
|
||||||
|
@ -78,11 +80,11 @@ public class AnalysisManServiceImpl implements AnalysisManService {
|
||||||
analysisRoi.setScacPath(middleData.getAnalyses_scac_filePath());
|
analysisRoi.setScacPath(middleData.getAnalyses_scac_filePath());
|
||||||
analysisRoi.setLogPath(middleData.getAnalyses_LogPath());
|
analysisRoi.setLogPath(middleData.getAnalyses_LogPath());
|
||||||
analysisRoi.setReportPath(middleData.getAnalyses_ReportPath());
|
analysisRoi.setReportPath(middleData.getAnalyses_ReportPath());
|
||||||
analysisRoi.setRoiNum(Integer.valueOf(roiNumber.get(i)));
|
analysisRoi.setRoiNum(i-1);
|
||||||
analysisRoi.setMinX(sampleStruct.POI_B_x1.get(i));
|
analysisRoi.setMinX(Double.parseDouble(roiBBoundaryStart.get(i)+""));
|
||||||
analysisRoi.setMaxX(sampleStruct.POI_B_x2.get(i));
|
analysisRoi.setMaxX(Double.parseDouble(roiBBoundaryStop.get(i)+""));
|
||||||
analysisRoi.setMinY(sampleStruct.POI_G_y1.get(i));
|
analysisRoi.setMinY(Double.parseDouble(roiGBoundaryStart.get(i)+""));
|
||||||
analysisRoi.setMaxY(sampleStruct.POI_G_y2.get(i));
|
analysisRoi.setMaxY(Double.parseDouble(roiGBoundaryStop.get(i)+""));
|
||||||
analysisRois.add(analysisRoi);
|
analysisRois.add(analysisRoi);
|
||||||
}
|
}
|
||||||
analysisRoiManService.saveBatch(analysisRois);
|
analysisRoiManService.saveBatch(analysisRois);
|
||||||
|
|
|
@ -154,6 +154,9 @@ 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;
|
||||||
|
|
||||||
|
selfStationData.setRoiGBoundaryStart(bgBoundary.ROI_G_Boundary_start);
|
||||||
|
selfStationData.setRoiGBoundaryStop(bgBoundary.ROI_G_Boundary_stop);
|
||||||
|
|
||||||
//根据范围1划分 范围1对应的折线图
|
//根据范围1划分 范围1对应的折线图
|
||||||
Map<String, Object> gammaByROI = this.getGammaByROI(systemType, roiBBoundaryStart, roiBBoundaryStop, selfStationData);
|
Map<String, Object> gammaByROI = this.getGammaByROI(systemType, roiBBoundaryStart, roiBBoundaryStop, selfStationData);
|
||||||
map.putAll(gammaByROI);
|
map.putAll(gammaByROI);
|
||||||
|
@ -168,8 +171,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
List<HistogramData> histogramDataDList = new LinkedList<>();
|
List<HistogramData> histogramDataDList = new LinkedList<>();
|
||||||
for (int i=0; i<gChannels; i++){
|
for (int i=0; i<gChannels; i++){
|
||||||
for (int j=0; j< bChannels; j++){
|
for (int j=0; j< bChannels; j++){
|
||||||
Long index = i * bChannels + j;
|
|
||||||
// Long count = hCounts.get(index.intValue());
|
|
||||||
Long count = h_count_arr[i][j];
|
Long count = h_count_arr[i][j];
|
||||||
if (count > 0){
|
if (count > 0){
|
||||||
HistogramData his = new HistogramData();
|
HistogramData his = new HistogramData();
|
||||||
|
@ -263,206 +264,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void loadFile(EnergySpectrumStruct struct, SelfStationData selfStationData, Integer sampleId, String status, String systemType, Map<String, Object> map) {
|
|
||||||
try {
|
|
||||||
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
|
||||||
SelfStationVueData detVueData = selfStationData.getDetVueData();
|
|
||||||
|
|
||||||
//封装散点图下的基础数据信息
|
|
||||||
SpectrumData spectrumData = new SpectrumData();
|
|
||||||
//Station Code
|
|
||||||
String stationCode = struct.site_code;
|
|
||||||
//Detector Code
|
|
||||||
String detectorCode = struct.detector_code;
|
|
||||||
//Data Type
|
|
||||||
String dataType = struct.data_type;
|
|
||||||
//Collection Start
|
|
||||||
Date CollectionStart = null;
|
|
||||||
if ( StringUtils.isNotBlank(struct.collection_start_date) && StringUtils.isNotBlank(struct.collection_start_time) ){
|
|
||||||
CollectionStart = DateUtils.parseDate(struct.collection_start_date + StringPool.SPACE + struct.collection_start_time);
|
|
||||||
}
|
|
||||||
//Collection Stop
|
|
||||||
Date CollectionStop = null;
|
|
||||||
if ( StringUtils.isNotBlank(struct.collection_stop_date) && StringUtils.isNotBlank(struct.collection_stop_time) ){
|
|
||||||
CollectionStop = DateUtils.parseDate(struct.collection_stop_date + StringPool.SPACE + struct.collection_stop_time);
|
|
||||||
}
|
|
||||||
//Collection Time
|
|
||||||
String CollectionTime = "";
|
|
||||||
if ( Objects.nonNull(CollectionStart) && Objects.nonNull(CollectionStop) ){
|
|
||||||
CollectionTime = String.format ("%.2f",Double.valueOf((CollectionStop.getTime() - CollectionStart.getTime())/ 1000));
|
|
||||||
}
|
|
||||||
//Acquisition Start
|
|
||||||
Date AcquisitionStart = null;
|
|
||||||
if ( StringUtils.isNotBlank(struct.acquisition_start_date) && StringUtils.isNotBlank(struct.acquisition_start_time) ){
|
|
||||||
AcquisitionStart = DateUtils.parseDate(struct.acquisition_start_date + StringPool.SPACE + struct.acquisition_start_time);
|
|
||||||
}
|
|
||||||
//Acq Real Time
|
|
||||||
double AcquisitionRealTime = struct.acquisition_real_time;
|
|
||||||
//Acq live Time
|
|
||||||
double AcquisitionLiveTime = struct.acquisition_live_time;
|
|
||||||
//Air Volume[m3]
|
|
||||||
double airVolume = struct.air_volume;
|
|
||||||
//Xe Volume[m3]
|
|
||||||
double xeVolume = struct.sample_volume_of_Xe;
|
|
||||||
//xeCollectionYield
|
|
||||||
double xeCollectionYield = struct.Xe_collection_yield;
|
|
||||||
//gasBkMeasurementId
|
|
||||||
String gasBkMeasurementId = struct.gas_bk_measurement_id;
|
|
||||||
//detectorBkMeasurementId
|
|
||||||
String detectorBkMeasurementId = struct.detector_bk_measurement_id;
|
|
||||||
//measurementId
|
|
||||||
String measurementId = struct.measurement_id;
|
|
||||||
spectrumData.setSampleId(sampleId);
|
|
||||||
spectrumData.setStatus(status);
|
|
||||||
spectrumData.setStationCode(stationCode);
|
|
||||||
spectrumData.setDetectorCode(detectorCode);
|
|
||||||
spectrumData.setDataType(dataType);
|
|
||||||
spectrumData.setCollectionStart(CollectionStart);
|
|
||||||
spectrumData.setCollectionStop(CollectionStop);
|
|
||||||
spectrumData.setCollectionTime(CollectionTime);
|
|
||||||
spectrumData.setAcquisitionStart(AcquisitionStart);
|
|
||||||
spectrumData.setAcquisitionRealTime(String.format("%.2f", AcquisitionRealTime));
|
|
||||||
spectrumData.setAcquisitionLiveTime(String.format("%.2f", AcquisitionLiveTime));
|
|
||||||
spectrumData.setAirVolume(String.format("%.5f", airVolume));
|
|
||||||
spectrumData.setXeVolume(String.format("%.5f", xeVolume));
|
|
||||||
spectrumData.setYield(xeCollectionYield);
|
|
||||||
spectrumData.setGasBkMeasurementId(gasBkMeasurementId);
|
|
||||||
spectrumData.setDetectorBkMeasurementId(detectorBkMeasurementId);
|
|
||||||
spectrumData.setMeasurementId(measurementId);
|
|
||||||
map.put("spectrumData", spectrumData);
|
|
||||||
|
|
||||||
//gamma能量部分的计算参数 道值对应能量
|
|
||||||
List<Double> gEnergy = struct.g_energy;
|
|
||||||
//gamma能量部分的计算参数 道值
|
|
||||||
List<Double> gCentroidChannel = struct.g_centroid_channel;
|
|
||||||
//beta能量部分的计算参数 道值对应的能量
|
|
||||||
List<Double> bElectronEnergy = struct.b_electron_energy;
|
|
||||||
//beta能量部分的计算参数 道值
|
|
||||||
List<Double> bChannel = struct.b_channel;
|
|
||||||
CalcBgBoundaryParam calcBgBoundaryParam = new CalcBgBoundaryParam();
|
|
||||||
calcBgBoundaryParam.g_e_cal = EnergySpectrumHandler.GetFileFittingPara(gEnergy, gCentroidChannel);
|
|
||||||
calcBgBoundaryParam.b_e_cal = EnergySpectrumHandler.GetFileFittingPara(bElectronEnergy, bChannel);
|
|
||||||
calcBgBoundaryParam.b_energy = struct.b_electron_energy;
|
|
||||||
calcBgBoundaryParam.b_channel = struct.b_channel;
|
|
||||||
calcBgBoundaryParam.g_channel = struct.g_centroid_channel;
|
|
||||||
calcBgBoundaryParam.g_energy = struct.g_energy;
|
|
||||||
calcBgBoundaryParam.ROI_B_start_x1 = struct.POI_B_x1;
|
|
||||||
calcBgBoundaryParam.ROI_B_stop_x2 = struct.POI_B_x2;
|
|
||||||
calcBgBoundaryParam.ROI_G_start_y1 = struct.POI_G_y1;
|
|
||||||
calcBgBoundaryParam.ROI_G_stop_y2 = struct.POI_G_y2;
|
|
||||||
BgBoundary bgBoundary = EnergySpectrumHandler.CalcBgBoundary(calcBgBoundaryParam);
|
|
||||||
// 新beta谱:只取X轴数据从Y轴0的位置开始连成一条线,一直到顶画出矩形框 这个矩形框内的数据就是Gamma谱数据
|
|
||||||
List<Integer> roiBBoundaryStart = bgBoundary.ROI_B_Boundary_start;
|
|
||||||
List<Integer> roiBBoundaryStop = bgBoundary.ROI_B_Boundary_stop;
|
|
||||||
|
|
||||||
//根据范围1划分 范围1对应的折线图
|
|
||||||
Map<String, Object> gammaByROI = this.getGammaByROI(systemType, roiBBoundaryStart, roiBBoundaryStop, selfStationData);
|
|
||||||
map.putAll(gammaByROI);
|
|
||||||
//统计散点图
|
|
||||||
//横坐标 beta-gamma
|
|
||||||
long bChannels = struct.b_channels;
|
|
||||||
//纵坐标 gamma
|
|
||||||
long gChannels = struct.g_channels;
|
|
||||||
//值
|
|
||||||
List<Long> hCounts = struct.h_counts;
|
|
||||||
List<HistogramData> histogramDataList = new LinkedList<>();
|
|
||||||
List<HistogramData> histogramDataDList = new LinkedList<>();
|
|
||||||
for (int i=0; i<gChannels; i++){
|
|
||||||
for (int j=0; j< bChannels; j++){
|
|
||||||
Long index = i * bChannels + j;
|
|
||||||
Long count = hCounts.get(index.intValue());
|
|
||||||
if (count > 0){
|
|
||||||
HistogramData his = new HistogramData();
|
|
||||||
his.setG(i);
|
|
||||||
his.setB(j);
|
|
||||||
his.setC(count);
|
|
||||||
histogramDataList.add(his);
|
|
||||||
histogramDataDList.add(his);
|
|
||||||
}else {
|
|
||||||
HistogramData his = new HistogramData();
|
|
||||||
his.setG(i);
|
|
||||||
his.setB(j);
|
|
||||||
his.setC(count);
|
|
||||||
histogramDataDList.add(his);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
map.put("histogramDataList", histogramDataList);
|
|
||||||
// map.put("histogramDataDList", histogramDataDList);
|
|
||||||
//调用算法 传入道值和道值对应的能量 得到计算gamma能量公式的参数
|
|
||||||
List<Double> gammaParam = EnergySpectrumHandler.GetFileFittingPara(struct.g_centroid_channel, struct.g_energy);
|
|
||||||
//存储需要计算gamma能量的道值
|
|
||||||
List<Double> gchannels = new ArrayList<>();
|
|
||||||
for (int i=0; i<gChannels; i++){
|
|
||||||
gchannels.add(Double.valueOf(i));
|
|
||||||
}
|
|
||||||
//调用算法 传递gamma参与计算的道值以及计算公式参数 得到各道值对应的能量
|
|
||||||
List<Double> gammaEnergyList = EnergySpectrumHandler.GetFileFittingData(gchannels, gammaParam);
|
|
||||||
//将gamma能量折线图进行赋值返回
|
|
||||||
map.put("gammaEnergyData", gammaEnergyList);
|
|
||||||
//调用算法 传入道值和道值对应的能量 得到计算beta能量公式的参数
|
|
||||||
List<Double> betaParam = EnergySpectrumHandler.GetFileFittingPara(struct.b_channel, struct.b_electron_energy);
|
|
||||||
List<Double> bchannels = new ArrayList<>();
|
|
||||||
for (int i=0; i<bChannels; i++){
|
|
||||||
bchannels.add(Double.valueOf(i));
|
|
||||||
}
|
|
||||||
//传入道值和计算公式的参数计算出各道值对应的beta能量
|
|
||||||
List<Double> betaEnergyList = EnergySpectrumHandler.GetFileFittingData(bchannels, betaParam);
|
|
||||||
//将beta能量折线图进行赋值返回
|
|
||||||
map.put("betaEnergyData", betaEnergyList);
|
|
||||||
|
|
||||||
//g_Energy
|
|
||||||
if (CollectionUtils.isNotEmpty(struct.g_energy) && CollectionUtils.isNotEmpty(struct.g_centroid_channel) && CollectionUtils.isNotEmpty(struct.g_uncertainty) && Objects.nonNull(struct.g_record_count)) {
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
GEnergyBlock gEnergyBlock = new GEnergyBlock();
|
|
||||||
gEnergyBlock.setG_energy(struct.g_energy);
|
|
||||||
gEnergyBlock.setCentroid_channel(struct.g_centroid_channel);
|
|
||||||
gEnergyBlock.setUncertainty(struct.g_uncertainty);
|
|
||||||
gEnergyBlock.setRecord_count(struct.g_record_count);
|
|
||||||
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);
|
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
|
||||||
parameterInfo.setP(calEnergyParam);
|
|
||||||
sampleVueData.getMapEnerPara().put(CalName.CalPHD.getType(), parameterInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//g_Resolution
|
|
||||||
if (CollectionUtils.isNotEmpty(struct.g_r_energy) && CollectionUtils.isNotEmpty(struct.g_r_FWHM) && CollectionUtils.isNotEmpty(struct.g_r_uncertainty) && Objects.nonNull(struct.g_r_record_count)) {
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
GResolutionBlock gResolutionBlock = new GResolutionBlock();
|
|
||||||
gResolutionBlock.setG_energy(struct.g_r_energy);
|
|
||||||
gResolutionBlock.setFWHM(struct.g_r_FWHM);
|
|
||||||
gResolutionBlock.setUncertainty(struct.g_r_uncertainty);
|
|
||||||
gResolutionBlock.setRecord_count(struct.g_r_record_count);
|
|
||||||
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);
|
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
|
||||||
parameterInfo.setP(calEnergyParam);
|
|
||||||
sampleVueData.getMapResoPara().put(CalName.CalPHD.getType(), parameterInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//g_Efficiency
|
|
||||||
if (CollectionUtils.isNotEmpty(struct.g_e_energy) && CollectionUtils.isNotEmpty(struct.g_e_efficiency) && CollectionUtils.isNotEmpty(struct.g_e_uncertainty) && Objects.nonNull(struct.g_e_record_count)) {
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
GEfficiencyBlock gEfficiencyBlock = new GEfficiencyBlock();
|
|
||||||
gEfficiencyBlock.setG_energy(struct.g_e_energy);
|
|
||||||
gEfficiencyBlock.setEfficiency(struct.g_e_efficiency);
|
|
||||||
gEfficiencyBlock.setUncertainty(struct.g_e_uncertainty);
|
|
||||||
gEfficiencyBlock.setRecord_count(struct.g_e_record_count);
|
|
||||||
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);
|
|
||||||
ParameterInfo parameterInfo = new ParameterInfo();
|
|
||||||
parameterInfo.setP(calEnergyParam);
|
|
||||||
sampleVueData.getMapEffiPara().put(CalName.CalPHD.getType(), parameterInfo);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (ParseException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据文件路径,类型获取对应的解析文件内容并返回进行存储
|
* 根据文件路径,类型获取对应的解析文件内容并返回进行存储
|
||||||
|
@ -634,6 +435,10 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
|
|
||||||
public Map<String, Object> getGammaByROI(String systemType, List<Integer> roiBBoundaryStart, List<Integer> roiBBoundaryStop,
|
public Map<String, Object> getGammaByROI(String systemType, List<Integer> roiBBoundaryStart, List<Integer> roiBBoundaryStop,
|
||||||
SelfStationData selfStationData) {
|
SelfStationData selfStationData) {
|
||||||
|
|
||||||
|
selfStationData.setRoiBBoundaryStart(roiBBoundaryStart);
|
||||||
|
selfStationData.setRoiBBoundaryStop(roiBBoundaryStop);
|
||||||
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||||
|
@ -740,121 +545,6 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Object> getGammaByROI1(String systemType, List<Integer> roiBBoundaryStart, List<Integer> roiBBoundaryStop,
|
|
||||||
SelfStationData selfStationData) {
|
|
||||||
Map<String, Object> map = new HashMap<>();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
|
||||||
long betaChannels = struct.b_channels, gammaChannels = struct.g_channels;
|
|
||||||
List<Long> h_counts = struct.h_counts;
|
|
||||||
|
|
||||||
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
|
||||||
SelfStationVueData detVueData = selfStationData.getDetVueData();
|
|
||||||
|
|
||||||
for (int r = 0; r < roiBBoundaryStart.size(); r++) {
|
|
||||||
List<SeriseData> seriseDataList = new LinkedList<>();
|
|
||||||
// g_counts
|
|
||||||
List<Long> counts = new LinkedList<>();
|
|
||||||
//存储同一列不同行加和后的数量
|
|
||||||
List<Integer> sumList = new LinkedList<>();
|
|
||||||
String roiStart = "", roiStop= "", roiList = "";
|
|
||||||
|
|
||||||
//根据范围划分 范围对应的折线图
|
|
||||||
int startChannel = roiBBoundaryStart.get(r);
|
|
||||||
int endChannel = roiBBoundaryStop.get(r);
|
|
||||||
//遍历所有列
|
|
||||||
for (int i=0; i<gammaChannels; i++) {
|
|
||||||
SeriseData seriseData = new SeriseData();
|
|
||||||
seriseData.setX(i);
|
|
||||||
int sum = 0;
|
|
||||||
//根据起始道值和结束道值 获取这一列的所有对应道值的数据
|
|
||||||
for (int j=startChannel; j <= endChannel; j++) {
|
|
||||||
//列数 * 总行数 + 当前行下标 获取对应的数据数组下标
|
|
||||||
int index = (int) (i * betaChannels + j);
|
|
||||||
long count = 0;
|
|
||||||
//判断下标是否在h_counts范围内
|
|
||||||
if (index > 0 && index < h_counts.size()) {
|
|
||||||
count = h_counts.get(index);
|
|
||||||
}
|
|
||||||
sum+=count;
|
|
||||||
}
|
|
||||||
seriseData.setY(sum);
|
|
||||||
sumList.add(sum);
|
|
||||||
counts.add((long) sum);
|
|
||||||
seriseDataList.add(seriseData);
|
|
||||||
}
|
|
||||||
switch (r){
|
|
||||||
case 0:
|
|
||||||
roiStart = "ROIOneStart";
|
|
||||||
roiStop = "ROIOneStop";
|
|
||||||
roiList = "ROIOneList";
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
sampleVueData.setROIOneBetaStart(startChannel);
|
|
||||||
sampleVueData.setROIOneBetaStop(endChannel);
|
|
||||||
sampleVueData.setROIOneList(seriseDataList);
|
|
||||||
sampleVueData.setROIOneCounts(counts);
|
|
||||||
} else if (systemType.equals("det")) {
|
|
||||||
detVueData.setROIOneBetaStart(startChannel);
|
|
||||||
detVueData.setROIOneBetaStop(endChannel);
|
|
||||||
detVueData.setROIOneList(seriseDataList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
roiStart = "ROITwoStart";
|
|
||||||
roiStop = "ROITwoStop";
|
|
||||||
roiList = "ROITwoList";
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
sampleVueData.setROITwoBetaStart(startChannel);
|
|
||||||
sampleVueData.setROITwoBetaStop(endChannel);
|
|
||||||
sampleVueData.setROITwoList(seriseDataList);
|
|
||||||
sampleVueData.setROITwoCounts(counts);
|
|
||||||
} else if (systemType.equals("det")) {
|
|
||||||
detVueData.setROITwoBetaStart(startChannel);
|
|
||||||
detVueData.setROITwoBetaStop(endChannel);
|
|
||||||
detVueData.setROITwoList(seriseDataList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
roiStart = "ROIThreeStart";
|
|
||||||
roiStop = "ROIThreeStop";
|
|
||||||
roiList = "ROIThreeList";
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
sampleVueData.setROIThreeBetaStart(startChannel);
|
|
||||||
sampleVueData.setROIThreeBetaStop(endChannel);
|
|
||||||
sampleVueData.setROIThreeList(seriseDataList);
|
|
||||||
sampleVueData.setROIThreeCounts(counts);
|
|
||||||
} else if (systemType.equals("det")) {
|
|
||||||
detVueData.setROIThreeBetaStart(startChannel);
|
|
||||||
detVueData.setROIThreeBetaStop(endChannel);
|
|
||||||
detVueData.setROIThreeList(seriseDataList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
roiStart = "ROIFourStart";
|
|
||||||
roiStop = "ROIFourStop";
|
|
||||||
roiList = "ROIFourList";
|
|
||||||
if (systemType.equals("sample")) {
|
|
||||||
sampleVueData.setROIFourBetaStart(startChannel);
|
|
||||||
sampleVueData.setROIFourBetaStop(endChannel);
|
|
||||||
sampleVueData.setROIFourList(seriseDataList);
|
|
||||||
sampleVueData.setROIFourCounts(counts);
|
|
||||||
} else if (systemType.equals("det")) {
|
|
||||||
detVueData.setROIFourBetaStart(startChannel);
|
|
||||||
detVueData.setROIFourBetaStop(endChannel);
|
|
||||||
detVueData.setROIFourList(seriseDataList);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
map.put(roiStart, startChannel);
|
|
||||||
map.put(roiStop, endChannel);
|
|
||||||
}
|
|
||||||
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Long> roiList(Integer startChannel, Integer endChannel, long betaChannels, long gammaChannels, List<Long> h_counts) {
|
public List<Long> roiList(Integer startChannel, Integer endChannel, long betaChannels, long gammaChannels, List<Long> h_counts) {
|
||||||
// g_counts
|
// g_counts
|
||||||
List<Long> counts = new LinkedList<>();
|
List<Long> counts = new LinkedList<>();
|
||||||
|
|
|
@ -81,6 +81,24 @@ public class SelfStationData implements Serializable {
|
||||||
|
|
||||||
private List<List<Double>> betaNewEnergyListNow;
|
private List<List<Double>> betaNewEnergyListNow;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* roi limit beta start
|
||||||
|
*/
|
||||||
|
List<Integer> roiBBoundaryStart;
|
||||||
|
/**
|
||||||
|
* roi limit beta stop
|
||||||
|
*/
|
||||||
|
List<Integer> roiBBoundaryStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* roi limit gamma start
|
||||||
|
*/
|
||||||
|
List<Integer> roiGBoundaryStart;
|
||||||
|
/**
|
||||||
|
* roi limit gamma stop
|
||||||
|
*/
|
||||||
|
List<Integer> roiGBoundaryStop;
|
||||||
|
|
||||||
|
|
||||||
//分析用到的信息
|
//分析用到的信息
|
||||||
private BgCalibratePara bgPara;
|
private BgCalibratePara bgPara;
|
||||||
|
|
|
@ -245,7 +245,8 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
//返回结果map
|
//返回结果map
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
//获取sample分析后的对象
|
//获取sample分析后的对象
|
||||||
EnergySpectrumStruct struct = selfStationUtil.getSourceData(sampleFilePath, "sample", selfStationData);
|
selfStationUtil.getSourceDataNotHis(sampleFilePath, "sample", selfStationData);
|
||||||
|
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||||
if (Objects.nonNull(struct)) {
|
if (Objects.nonNull(struct)) {
|
||||||
selfStationData.setSampleStruct(struct);
|
selfStationData.setSampleStruct(struct);
|
||||||
selfStationData.setSampleTmpPath(sampleFilePath);
|
selfStationData.setSampleTmpPath(sampleFilePath);
|
||||||
|
@ -257,15 +258,25 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
LinkedList<Integer> stop = Lists.newLinkedList();
|
LinkedList<Integer> stop = Lists.newLinkedList();
|
||||||
for (GardsAnalysisRoi f : roiList) {
|
for (GardsAnalysisRoi f : roiList) {
|
||||||
start.add(f.getRoiNum() -1, f.getMinX().intValue());
|
start.add(f.getRoiNum() -1, f.getMinX().intValue());
|
||||||
stop.add(f.getRoiNum() -1, f.getMinY().intValue());
|
stop.add(f.getRoiNum() -1, f.getMaxX().intValue());
|
||||||
}
|
}
|
||||||
Map<String, Object> gammaByROI = selfStationUtil.getGammaByROI1("", start, stop, selfStationData);
|
Map<String, Object> gammaByROI = selfStationUtil.getGammaByROI("", start, stop, selfStationData);
|
||||||
map.putAll(gammaByROI);
|
map.putAll(gammaByROI);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 将四个Gamma ROI文件对象放到缓存中
|
// 将四个Gamma ROI文件对象放到缓存中
|
||||||
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
SelfStationVueData sampleVueData = selfStationData.getSampleVueData();
|
||||||
|
|
||||||
|
// 用于下次分析判断是否更新
|
||||||
|
sampleVueData.setUsedROIOneBetaStart(sampleVueData.getROIOneBetaStart());
|
||||||
|
sampleVueData.setUsedROIOneBetaStop(sampleVueData.getROIOneBetaStop());
|
||||||
|
sampleVueData.setUsedROITwoBetaStart(sampleVueData.getROITwoBetaStart());
|
||||||
|
sampleVueData.setUsedROITwoBetaStop(sampleVueData.getROITwoBetaStop());
|
||||||
|
sampleVueData.setUsedROIThreeBetaStart(sampleVueData.getROIThreeBetaStart());
|
||||||
|
sampleVueData.setUsedROIThreeBetaStop(sampleVueData.getROIThreeBetaStop());
|
||||||
|
sampleVueData.setUsedROIFourBetaStart(sampleVueData.getROIFourBetaStart());
|
||||||
|
sampleVueData.setUsedROIFourBetaStop(sampleVueData.getROIFourBetaStop());
|
||||||
|
|
||||||
Map<Integer, String> roiPathMap = roiPaths.stream()
|
Map<Integer, String> roiPathMap = roiPaths.stream()
|
||||||
.collect(Collectors.toMap(RoiDto::getRoiNum, RoiDto::getPhdPath));
|
.collect(Collectors.toMap(RoiDto::getRoiNum, RoiDto::getPhdPath));
|
||||||
|
|
||||||
|
@ -317,7 +328,8 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
//返回结果map
|
//返回结果map
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
//获取sample分析后的对象
|
//获取sample分析后的对象
|
||||||
EnergySpectrumStruct struct = selfStationUtil.getSourceData(detFilePath, "det", selfStationData);
|
selfStationUtil.getSourceDataNotHis(detFilePath, "det", selfStationData);
|
||||||
|
EnergySpectrumStruct struct = selfStationData.getDetStruct();
|
||||||
if (Objects.nonNull(struct)) {
|
if (Objects.nonNull(struct)) {
|
||||||
selfStationData.setDetStruct(struct);
|
selfStationData.setDetStruct(struct);
|
||||||
selfStationData.setDetTmpPath(detFilePath);
|
selfStationData.setDetTmpPath(detFilePath);
|
||||||
|
@ -336,7 +348,8 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
//返回结果map
|
//返回结果map
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
//获取sample分析后的对象
|
//获取sample分析后的对象
|
||||||
EnergySpectrumStruct struct = selfStationUtil.getSourceData(qcFilePath, "qc", selfStationData);
|
selfStationUtil.getSourceDataNotHis(qcFilePath, "qc", selfStationData);
|
||||||
|
EnergySpectrumStruct struct = selfStationData.getQcStruct();
|
||||||
if (Objects.nonNull(struct)) {
|
if (Objects.nonNull(struct)) {
|
||||||
selfStationData.setQcStruct(struct);
|
selfStationData.setQcStruct(struct);
|
||||||
selfStationData.setQcTmpPath(qcFilePath);
|
selfStationData.setQcTmpPath(qcFilePath);
|
||||||
|
@ -388,7 +401,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
start.add(f.getRoiNum() -1, f.getMinX().intValue());
|
start.add(f.getRoiNum() -1, f.getMinX().intValue());
|
||||||
stop.add(f.getRoiNum() -1, f.getMinY().intValue());
|
stop.add(f.getRoiNum() -1, f.getMinY().intValue());
|
||||||
}
|
}
|
||||||
Map<String, Object> gammaByROI = selfStationUtil.getGammaByROI1("", start, stop, selfStationData);
|
Map<String, Object> gammaByROI = selfStationUtil.getGammaByROI("", start, stop, selfStationData);
|
||||||
map.putAll(gammaByROI);
|
map.putAll(gammaByROI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2628,7 +2641,7 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
private List<GardsXeResultsSpectrum> betaAnalyse(SelfStationData selfStationData, Map<String, NuclideLines> nuclideLinesMap) throws Exception {
|
private List<GardsXeResultsSpectrum> betaAnalyse(SelfStationData selfStationData, Map<String, NuclideLines> nuclideLinesMap) throws Exception {
|
||||||
SelfStationVueData sampleData = selfStationData.getSampleVueData();
|
SelfStationVueData sampleData = selfStationData.getSampleVueData();
|
||||||
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
EnergySpectrumStruct struct = selfStationData.getSampleStruct();
|
||||||
String phdPath = selfStationData.getSampleFilePathName();
|
String phdPath = selfStationData.getSampleTmpPath();
|
||||||
// 获取自建台站参数
|
// 获取自建台站参数
|
||||||
SelfParameter selfParameter = (SelfParameter) redisUtil.get(RedisConstant.SELF_PARAMETER);
|
SelfParameter selfParameter = (SelfParameter) redisUtil.get(RedisConstant.SELF_PARAMETER);
|
||||||
HashMap<String, NuclideLine> nuclideMap = selfParameter.getNuclideMap();
|
HashMap<String, NuclideLine> nuclideMap = selfParameter.getNuclideMap();
|
||||||
|
@ -2658,6 +2671,8 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
}
|
}
|
||||||
xeData.setMdc(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getMdc()))));
|
xeData.setMdc(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getMdc()))));
|
||||||
xeData.setConc(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getConc()))));
|
xeData.setConc(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getConc()))));
|
||||||
|
xeData.setConcErr(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getConcErr()))));
|
||||||
|
xeData.setMda(Double.valueOf(NumberFormatUtil.numberSixLen(String.valueOf(xeData.getMda()))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5606,7 +5621,10 @@ public class SelfStationServiceImpl extends AbstractLogOrReport implements ISelf
|
||||||
analysisManService.deleteAnalySetting(idAnalysis);
|
analysisManService.deleteAnalySetting(idAnalysis);
|
||||||
}
|
}
|
||||||
// 向 RNMAN.GARDS_ANALYSES_ROI 表插入数据
|
// 向 RNMAN.GARDS_ANALYSES_ROI 表插入数据
|
||||||
analysisManService.saveAnalysisROI(sampleId, idAnalysis, sampleStruct, middleDatas, phdFilePaths);
|
analysisManService.saveAnalysisROI(sampleId, idAnalysis, selfStationData.getRoiBBoundaryStart(),
|
||||||
|
selfStationData.getRoiBBoundaryStop(), selfStationData.getRoiGBoundaryStart(), selfStationData.getRoiGBoundaryStop(),
|
||||||
|
middleDatas, phdFilePaths);
|
||||||
|
|
||||||
// 获取Map IdAnalysis:RoiId:GStoreMiddleProcessData
|
// 获取Map IdAnalysis:RoiId:GStoreMiddleProcessData
|
||||||
analysisManService.middleDataTable(idAnalysis, middleDatas);
|
analysisManService.middleDataTable(idAnalysis, middleDatas);
|
||||||
// 向 RNMAN.GARDS_CALIBRATION_PAIRS 表写入 Energy 刻度数据对
|
// 向 RNMAN.GARDS_CALIBRATION_PAIRS 表写入 Energy 刻度数据对
|
||||||
|
|
Loading…
Reference in New Issue
Block a user