gamma自动处理增加处理结束后删除临时文件相关代码
人工交互分析gamma模块saveToPHD文件名称修改
This commit is contained in:
parent
fb2517ccbc
commit
fc89b36c95
|
@ -111,6 +111,7 @@ public class Sample_G_Analysis {
|
|||
|
||||
public void analysis() throws GAnalyseException{
|
||||
log.info("Gamma自动处理分析--Start");
|
||||
PHDFile phdFile = new PHDFile();
|
||||
try {
|
||||
/* 准备Gamma分析需要的数据 */
|
||||
GStoreMiddleProcessData middleData = new GStoreMiddleProcessData();
|
||||
|
@ -120,7 +121,6 @@ public class Sample_G_Analysis {
|
|||
GammaFileUtil gammaFileUtil = ApplicationContextUtil.getContext().getBean(GammaFileUtil.class);
|
||||
parameterProperties = ApplicationContextUtil.getContext().getBean(ParameterProperties.class);
|
||||
|
||||
PHDFile phdFile = new PHDFile();
|
||||
phdFile.setXmlFilePath(parameterProperties.getFilePath());
|
||||
// 解析PHD文件
|
||||
spectrumPathProperties = SpringContextUtils.getBean(SpectrumPathProperties.class);
|
||||
|
@ -173,8 +173,14 @@ public class Sample_G_Analysis {
|
|||
e.printStackTrace();
|
||||
log.error("Sample_G_Analysis", e);
|
||||
throw new GAnalyseException("Sample Analyse Error at "+DateUtils.formatDate(new Date(),"yyyy-MM-dd HH:mm:ss"));
|
||||
}finally {
|
||||
|
||||
} finally {
|
||||
//删除临时文件
|
||||
if (StringUtils.isNotBlank(phdFile.getTmpFilePath())) {
|
||||
File tmpFile = new File(phdFile.getTmpFilePath());
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("Gamma自动处理分析--End");
|
||||
}
|
||||
|
|
|
@ -887,7 +887,9 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
PHDFile phdFile = phdCache.getIfPresent(key);
|
||||
if (StringUtils.isNotBlank(phdFile.getTmpFilePath())) {
|
||||
File file = new File(phdFile.getTmpFilePath());
|
||||
file.delete();
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
}
|
||||
// 删除指定key的Cache
|
||||
localCache.deletePHDCache(key);
|
||||
|
@ -4951,7 +4953,14 @@ public class GammaServiceImpl extends AbstractLogOrReport implements IGammaServi
|
|||
String date = phd.getAcq().getAcquisition_start_date().replace("/", "");
|
||||
String time = phd.getAcq().getAcquisition_start_time().replace(":", "").substring(0, 4);
|
||||
String dataType = phd.getMsgInfo().getData_type().substring(0, 1);
|
||||
String phdFileName = String.format("%s-%s_%s_%s.PHD", detectorCode, date, time, dataType);
|
||||
String spectrumQuantity = phd.getHeader().getSpectrum_quantity();
|
||||
double acquisitionLiveTime = phd.getAcq().getAcquisition_live_time();
|
||||
DecimalFormat df = new DecimalFormat("#.##########");
|
||||
//AUX09_003-20151226_1855 _S_FULL_40184.8.PHD
|
||||
//将acquisition_live_time保留六位有效数字 如果保留一位小数后小数点后的值是0则四舍五入保留整数,否则按正常条件四舍五入保留小数位
|
||||
String numberCal = NumberFormatUtil.numberCal(String.valueOf(acquisitionLiveTime));
|
||||
numberCal = df.format(Double.valueOf(numberCal));
|
||||
String phdFileName = String.format("%s-%s_%s_%s_%s_%s.PHD", detectorCode, date, time, dataType, spectrumQuantity, numberCal);
|
||||
String spectrum = gammaFileUtil.makeUpSpectrum(phd);
|
||||
// 导出数据内容到txt文本
|
||||
OutputStream fos = null;
|
||||
|
|
Loading…
Reference in New Issue
Block a user