fix:修复新beta的分析接口,增加对roiParams的处理
This commit is contained in:
parent
cd3d19db70
commit
e266148da1
|
@ -1582,7 +1582,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
|||
* 检查ROI是否更新
|
||||
* @param sampleVueData
|
||||
* @param ROINum
|
||||
* @return
|
||||
* @return true = 内容发生变化
|
||||
*/
|
||||
public boolean checkROIRenew(SelfStationVueData sampleVueData, String ROINum) {
|
||||
boolean flag = false;
|
||||
|
@ -1617,7 +1617,7 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!sampleVueData.getUsedROIOneBetaStart().equals(sampleVueData.getROIOneBetaStart())) {
|
||||
return true;
|
||||
} else if (!sampleVueData.getUsedROIOneBetaStop().equals(sampleVueData.getROIOneBetaStop())) {
|
||||
|
@ -1635,6 +1635,8 @@ public class SelfStationUtil extends AbstractLogOrReport {
|
|||
} else if (!sampleVueData.getUsedROIFourBetaStop().equals(sampleVueData.getROIFourBetaStop())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ public class SelfStationController {
|
|||
@PostMapping("Reprocessing")
|
||||
@ApiOperation(value = "analyze菜单下Reprocessing页面数据", notes = "analyze菜单下Reprocessing页面数据")
|
||||
public Result Reprocessing(@RequestParam String fileName, @RequestParam String processKey,
|
||||
@RequestParam String roiParams, HttpServletRequest request) {
|
||||
@RequestParam(required = false) String roiParams, HttpServletRequest request) {
|
||||
return selfStationService.Reprocessing(fileName, processKey, roiParams, request);
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
roiBBoundaryStart.add(roiParam.getRoiNum() - 1, roiParam.getStartChannel());
|
||||
roiBBoundaryStop.add(roiParam.getRoiNum() - 1, roiParam.getEndChannel());
|
||||
}
|
||||
selfStationUtil.getGammaByROI(struct.system_type, roiBBoundaryStart, roiBBoundaryStop, selfStationData);
|
||||
selfStationUtil.getGammaByROI("sample", roiBBoundaryStart, roiBBoundaryStop, selfStationData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -2140,10 +2140,31 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
boolean bROI2 = selfStationUtil.checkROIRenew(sampleVueData, SelfStationConstant.ROI2);
|
||||
boolean bROI3 = selfStationUtil.checkROIRenew(sampleVueData, SelfStationConstant.ROI3);
|
||||
boolean bROI4 = selfStationUtil.checkROIRenew(sampleVueData, SelfStationConstant.ROI4);
|
||||
roiMap.put(SelfStationConstant.ROI1, this.gammaAnalyse(processKey, phdOne, nuclideLinesMap, colorMap, bROI1));
|
||||
roiMap.put(SelfStationConstant.ROI2, this.gammaAnalyse(processKey, phdTwo, nuclideLinesMap, colorMap, bROI2));
|
||||
roiMap.put(SelfStationConstant.ROI3, this.gammaAnalyse(processKey, phdThree, nuclideLinesMap, colorMap, bROI3));
|
||||
roiMap.put(SelfStationConstant.ROI4, this.gammaAnalyse(processKey, phdFour, nuclideLinesMap, colorMap, bROI4));
|
||||
int flag = gammaFileUtil.AnalyseData(phdOne);
|
||||
// 如果参数没有修改且没有修改任何ROI则不允许分析
|
||||
if (flag == 0 && !bROI1 && !bROI2 && !bROI3 && !bROI4) {
|
||||
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(StrUtil.replace(warning, "%s", "ROI"));
|
||||
return result;
|
||||
}
|
||||
// 如果参数修改 或者 修改某个ROI 只重新分析某个gamma
|
||||
if (flag != 0 || bROI1) {
|
||||
roiMap.put(SelfStationConstant.ROI1, this.gammaAnalyse(processKey, phdOne, nuclideLinesMap, colorMap, flag));
|
||||
}
|
||||
if (flag != 0 || bROI2) {
|
||||
roiMap.put(SelfStationConstant.ROI2, this.gammaAnalyse(processKey, phdTwo, nuclideLinesMap, colorMap, flag));
|
||||
}
|
||||
if (flag != 0 || bROI3) {
|
||||
roiMap.put(SelfStationConstant.ROI3, this.gammaAnalyse(processKey, phdThree, nuclideLinesMap, colorMap, flag));
|
||||
}
|
||||
if (flag != 0 || bROI4) {
|
||||
roiMap.put(SelfStationConstant.ROI4, this.gammaAnalyse(processKey, phdFour, nuclideLinesMap, colorMap, flag));
|
||||
}
|
||||
// roiMap.put(SelfStationConstant.ROI2, this.gammaAnalyse(processKey, phdTwo, nuclideLinesMap, colorMap, bROI2));
|
||||
// roiMap.put(SelfStationConstant.ROI3, this.gammaAnalyse(processKey, phdThree, nuclideLinesMap, colorMap, bROI3));
|
||||
// roiMap.put(SelfStationConstant.ROI4, this.gammaAnalyse(processKey, phdFour, nuclideLinesMap, colorMap, bROI4));
|
||||
// 用于下次分析判断是否更新
|
||||
sampleVueData.setUsedROIOneBetaStart(sampleVueData.getROIOneBetaStart());
|
||||
sampleVueData.setUsedROIOneBetaStop(sampleVueData.getROIOneBetaStop());
|
||||
|
@ -2151,7 +2172,7 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
sampleVueData.setUsedROITwoBetaStop(sampleVueData.getROITwoBetaStop());
|
||||
sampleVueData.setUsedROIThreeBetaStart(sampleVueData.getROIThreeBetaStart());
|
||||
sampleVueData.setUsedROIThreeBetaStop(sampleVueData.getROIThreeBetaStop());
|
||||
sampleVueData.setUsedROIFourBetaStart(sampleVueData.getUsedROIFourBetaStart());
|
||||
sampleVueData.setUsedROIFourBetaStart(sampleVueData.getROIFourBetaStart());
|
||||
sampleVueData.setUsedROIFourBetaStop(sampleVueData.getROIFourBetaStop());
|
||||
|
||||
sampleVueData.setUsedEner(phdOne.getUsedEner());
|
||||
|
@ -5484,19 +5505,11 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
* @throws RuntimeException
|
||||
*/
|
||||
private Map<String, Object> gammaAnalyse(String processKey, PHDFile phd, Map<String, NuclideLines> nuclideLinesMap,
|
||||
Map<String, String> colorMap, boolean bROI) throws RuntimeException{
|
||||
Map<String, String> colorMap, int flag) throws RuntimeException{
|
||||
|
||||
phd.setUserId(processKey);
|
||||
// 赋值xml文件存放路径
|
||||
phd.setXmlFilePath(parameterProperties.getFilePath());
|
||||
int flag = gammaFileUtil.AnalyseData(phd);
|
||||
// bROI = false 表示ROI数据没有被修改
|
||||
if (flag == 0 || !bROI) {
|
||||
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.setPhdNuclideMap(nuclideLinesMap);
|
||||
|
@ -5545,4 +5558,3 @@ public class SelfStationServiceImpl implements ISelfStationService {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user