临时文件使用后删除
核素信息映射问题修改
This commit is contained in:
parent
1a5bc8d4ec
commit
cc7775edaa
|
@ -84,7 +84,7 @@ public class NameStandUtil {
|
|||
return fileNames;
|
||||
}
|
||||
|
||||
public String GetSuffix(String dataType,String sysType,String Fulltype,String LT) {
|
||||
public String GetSuffix(String dataType, String sysType, String Fulltype, String LT) {
|
||||
String rData = "";
|
||||
BigDecimal bd = new BigDecimal(LT);
|
||||
//将acquisition_live_time保留一位小数 如果保留一位小数后小数点后的值是0则四舍五入保留整数,否则按正常条件四舍五入保留小数位
|
||||
|
|
|
@ -11,13 +11,13 @@ public class NuclideLine implements Serializable {
|
|||
|
||||
private Double energy;
|
||||
|
||||
private Double energy_uncert;
|
||||
private Double energyUncert;
|
||||
|
||||
private Double yield;
|
||||
|
||||
private Double yield_uncert;
|
||||
private Double yieldUncert;
|
||||
|
||||
private Double key_flag;
|
||||
private Integer keyFlag;
|
||||
|
||||
private String name;
|
||||
|
||||
|
|
|
@ -9,11 +9,14 @@ import java.util.List;
|
|||
@Data
|
||||
public class NuclideLines implements Serializable {
|
||||
public List<String> fullNames; // 核素全名
|
||||
|
||||
public List<Double> venergy; // 核素的所有γ射线能量
|
||||
public List<Double> vuncertE;
|
||||
public List<Double> vyield; // 核素γ射线分支比
|
||||
public List<Double> vuncertY;
|
||||
|
||||
public double halflife;// 单位:秒
|
||||
|
||||
public int key_flag; // 记录主射线下标
|
||||
public int maxYeildIdx;
|
||||
|
||||
|
|
|
@ -1766,6 +1766,10 @@ public class GammaFileUtil {
|
|||
NuclidesIdent(phd, mapLines);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -2093,10 +2097,10 @@ public class GammaFileUtil {
|
|||
for(int j=0;j<nuclideLineList.size();j++) {
|
||||
nlines.getFullNames().add(nuclideLineList.get(j).getFullName());
|
||||
nlines.getVenergy().add(nuclideLineList.get(j).getEnergy());
|
||||
nlines.getVuncertE().add(nuclideLineList.get(j).getEnergy_uncert());
|
||||
nlines.getVuncertE().add(nuclideLineList.get(j).getEnergyUncert());
|
||||
nlines.getVyield().add(nuclideLineList.get(j).getYield() / 100);
|
||||
nlines.getVuncertY().add(nuclideLineList.get(j).getYield_uncert());
|
||||
if(Objects.nonNull(nuclideLineList.get(j).getKey_flag()) && nuclideLineList.get(j).getKey_flag().intValue() > 0) {
|
||||
nlines.getVuncertY().add(nuclideLineList.get(j).getYieldUncert());
|
||||
if(Objects.nonNull(nuclideLineList.get(j).getKeyFlag()) && nuclideLineList.get(j).getKeyFlag().intValue() > 0) {
|
||||
nlines.key_flag = j;
|
||||
nlines.maxYeildIdx = j;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||
import javax.xml.parsers.ParserConfigurationException;
|
||||
import java.io.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
|
@ -68,6 +67,7 @@ public class GammaFileUtil {
|
|||
return false;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
//加载dll工具库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
try {
|
||||
|
@ -81,7 +81,7 @@ public class GammaFileUtil {
|
|||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//读取文件信息
|
||||
|
@ -187,7 +187,7 @@ public class GammaFileUtil {
|
|||
phd.getSpec().setBegin_channel(struct.g_begin_channel);
|
||||
phd.getSpec().setCounts(struct.g_counts);
|
||||
int i = 0;
|
||||
for (; i < phd.getSpec().getNum_g_channel(); ++i) {
|
||||
for (; i < phd.getSpec().getNum_g_channel(); i++) {
|
||||
if (phd.getSpec().getCounts().get(i) > 0) {
|
||||
break;
|
||||
}
|
||||
|
@ -260,6 +260,9 @@ public class GammaFileUtil {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -279,6 +282,7 @@ public class GammaFileUtil {
|
|||
String warning = "ftp连接失败";
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -291,7 +295,7 @@ public class GammaFileUtil {
|
|||
inputStream = ftpClient.retrieveFileStream(lcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//调用FileUtils的readLines方法获取文件的所有行数据
|
||||
|
@ -311,6 +315,9 @@ public class GammaFileUtil {
|
|||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -323,6 +330,7 @@ public class GammaFileUtil {
|
|||
String warning = "ftp连接失败";
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -335,7 +343,7 @@ public class GammaFileUtil {
|
|||
inputStream = ftpClient.retrieveFileStream(scacFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//调用FileUtils的readLines方法获取文件的所有行数据
|
||||
|
@ -355,6 +363,9 @@ public class GammaFileUtil {
|
|||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -780,7 +791,7 @@ public class GammaFileUtil {
|
|||
phd.getMapNucActMda().get(str_key).setHalflife(Double.valueOf(nuclIdedSpectrum.getHalflife()));
|
||||
List<Double> vEner = phd.getMapNucActMda().get(str_key).getVEnergy();
|
||||
Double key_ener = Double.valueOf(nuclIdedSpectrum.getKeyEnergy());
|
||||
for(int i=0; i<vEner.size(); ++i) {
|
||||
for(int i=0; i<vEner.size(); i++) {
|
||||
if(Math.abs(vEner.get(i) - key_ener) < 1E-6) {
|
||||
phd.getMapNucActMda().get(str_key).setCalculateIdx(i);
|
||||
break;
|
||||
|
@ -1113,7 +1124,7 @@ public class GammaFileUtil {
|
|||
List<Double> counts = calFcnEval.counts;
|
||||
double effi = counts.get(0);
|
||||
int index = 0;
|
||||
for(int i=1; i<phd.getVEnergy().size(); ++i) {
|
||||
for(int i=1; i<phd.getVEnergy().size(); i++) {
|
||||
if(phd.getVEnergy().get(i) >= vMdcInfo.get(0)) {
|
||||
index = i;
|
||||
if(phd.getVEnergy().get(i) - vMdcInfo.get(0) > vMdcInfo.get(0) - phd.getVEnergy().get(i-1)){
|
||||
|
@ -1331,7 +1342,7 @@ public class GammaFileUtil {
|
|||
if(m_nSChan == 0){
|
||||
i = 1;
|
||||
}
|
||||
for(; i<m_nCount; ++i) {
|
||||
for(; i<m_nCount; i++) {
|
||||
m_vCount.add(phd.getSpec().getCounts().get(i));
|
||||
}
|
||||
if(m_nSChan == 0) {
|
||||
|
@ -1361,7 +1372,7 @@ public class GammaFileUtil {
|
|||
if(end < 1 || end > m_nCount){
|
||||
end = m_nCount;
|
||||
}
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(phd.getVEnergy().get(i));
|
||||
seriseData.setY(m_vCount.get(i));
|
||||
|
@ -1385,7 +1396,7 @@ public class GammaFileUtil {
|
|||
if(end < 1 || end > m_nCount){
|
||||
end = m_nCount;
|
||||
}
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_vCount.get(i));
|
||||
|
@ -1417,36 +1428,59 @@ public class GammaFileUtil {
|
|||
ChartData data6 = new ChartData();
|
||||
ChartData data7 = new ChartData();
|
||||
ChartData data8 = new ChartData();
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
//if(m_phd->Spectrum.counts[i] == 0) continue;
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData data2Point = new SeriseData();
|
||||
data2Point.setX(i+1);
|
||||
data2Point.setY(phd.getVLc().get(i));
|
||||
if (Objects.isNull(phd.getVLc().get(i))) {
|
||||
data2Point.setY(0.0);
|
||||
} else {
|
||||
data2Point.setY(phd.getVLc().get(i));
|
||||
}
|
||||
data2.getPointlist().add(data2Point);
|
||||
|
||||
SeriseData data3Point = new SeriseData();
|
||||
data3Point.setX(i+1);
|
||||
data3Point.setY(phd.getVScac().get(i));
|
||||
if (Objects.isNull(phd.getVScac().get(i))) {
|
||||
data3Point.setY(0.0);
|
||||
} else {
|
||||
data3Point.setY(phd.getVScac().get(i));
|
||||
}
|
||||
data3.getPointlist().add(data3Point);
|
||||
|
||||
SeriseData data4Point = new SeriseData();
|
||||
data4Point.setX(i+1);
|
||||
data4Point.setY(phd.getVBase().get(i));
|
||||
if (Objects.isNull(phd.getVBase().get(i))) {
|
||||
data4Point.setY(0.0);
|
||||
} else {
|
||||
data4Point.setY(phd.getVBase().get(i));
|
||||
}
|
||||
data4.getPointlist().add(data4Point);
|
||||
|
||||
SeriseData data6Point = new SeriseData();
|
||||
data6Point.setX(phd.getVEnergy().get(i));
|
||||
data6Point.setY(phd.getVLc().get(i));
|
||||
if (Objects.isNull(phd.getVLc().get(i))) {
|
||||
data6Point.setY(0.0);
|
||||
} else {
|
||||
data6Point.setY(phd.getVLc().get(i));
|
||||
}
|
||||
data6.getPointlist().add(data6Point);
|
||||
|
||||
SeriseData data7Point = new SeriseData();
|
||||
data7Point.setX(phd.getVEnergy().get(i));
|
||||
data7Point.setY(phd.getVScac().get(i));
|
||||
if (Objects.isNull(phd.getVScac().get(i))) {
|
||||
data7Point.setY(0.0);
|
||||
} else {
|
||||
data7Point.setY(phd.getVScac().get(i));
|
||||
}
|
||||
data7.getPointlist().add(data7Point);
|
||||
|
||||
SeriseData data8Point = new SeriseData();
|
||||
data8Point.setX(phd.getVEnergy().get(i));
|
||||
data8Point.setY(phd.getVBase().get(i));
|
||||
if (Objects.isNull(phd.getVBase().get(i))) {
|
||||
data8Point.setY(0.0);
|
||||
} else {
|
||||
data8Point.setY(phd.getVBase().get(i));
|
||||
}
|
||||
data8.getPointlist().add(data8Point);
|
||||
}
|
||||
// 颜色:原谱:0;峰:1;Lc:2;BaseLine:3;Scac:4;比较谱:5;
|
||||
|
@ -1515,12 +1549,12 @@ public class GammaFileUtil {
|
|||
// 找出在所给范围的第一道拟合峰和最后一道拟合峰的索引下标
|
||||
int index = 0, startPeak = -1, endPeak = peakNum-1;
|
||||
while(index < peakNum && start > vPeak.get(index).right){
|
||||
++index;
|
||||
index++;
|
||||
}
|
||||
if(index < peakNum) {
|
||||
startPeak = index;
|
||||
while(index < peakNum && vPeak.get(index).left < end){
|
||||
++index;
|
||||
index++;
|
||||
}
|
||||
endPeak = index-1;
|
||||
}
|
||||
|
@ -1528,7 +1562,7 @@ public class GammaFileUtil {
|
|||
return datalist;
|
||||
}
|
||||
|
||||
for(int i=startPeak; i<=endPeak; ++i) {
|
||||
for(int i=startPeak; i<=endPeak; i++) {
|
||||
PeakInfo peak = vPeak.get(i);
|
||||
|
||||
ChartData cData = new ChartData();
|
||||
|
@ -1548,7 +1582,7 @@ public class GammaFileUtil {
|
|||
cData.setGroup("energy");
|
||||
CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(regChan, p);
|
||||
List<Double> regEnergy = calValuesOut.counts;
|
||||
for(int ii=0; ii<regChan.size(); ++ii) {
|
||||
for(int ii=0; ii<regChan.size(); ii++) {
|
||||
if(regChan.get(ii) < start || regChan.get(ii) > end){
|
||||
continue;
|
||||
}
|
||||
|
@ -1559,7 +1593,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
} else {
|
||||
cData.setGroup("channel");
|
||||
for(int ii=0; ii<regChan.size(); ++ii) {
|
||||
for(int ii=0; ii<regChan.size(); ii++) {
|
||||
if(regChan.get(ii) < start || regChan.get(ii) > end){
|
||||
continue;
|
||||
}
|
||||
|
@ -1580,7 +1614,7 @@ public class GammaFileUtil {
|
|||
CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(phd.getBaseCtrls().getXCtrl(), phd.getUsedEnerPara().getP());
|
||||
List<Double> vEner = calValuesOut.counts;
|
||||
if(phd.getBaseCtrls().getXCtrl().size() == phd.getBaseCtrls().getYCtrl().size()) {
|
||||
for(int i=0; i<phd.getBaseCtrls().getXCtrl().size(); ++i) {
|
||||
for(int i=0; i<phd.getBaseCtrls().getXCtrl().size(); i++) {
|
||||
ShapeData shape = new ShapeData();
|
||||
shape.setName("CP"+i);
|
||||
SeriseData seriseData = new SeriseData();
|
||||
|
@ -1597,7 +1631,7 @@ public class GammaFileUtil {
|
|||
List<ShapeData> shapes = new LinkedList<>();
|
||||
int num = phd.getBaseCtrls().getXCtrl().size();
|
||||
if(num == phd.getBaseCtrls().getYCtrl().size()) {
|
||||
for(int i=0; i<num; ++i) {
|
||||
for(int i=0; i<num; i++) {
|
||||
ShapeData shape = new ShapeData();
|
||||
shape.setName(String.valueOf(i));
|
||||
SeriseData seriseData = new SeriseData();
|
||||
|
@ -1635,6 +1669,7 @@ public class GammaFileUtil {
|
|||
NuclidesIdent(phd, nuclideLinesMap);
|
||||
RunQC(phd);
|
||||
} else {
|
||||
change = 1;
|
||||
Map<String, NuclideLines> nuclideLinesMap = GetNuclideLines(nuclides);
|
||||
AnalyseSpectrum(phd, nuclideLinesMap);
|
||||
}
|
||||
|
@ -1652,6 +1687,7 @@ public class GammaFileUtil {
|
|||
String strValue = CalValuesHandler.analyseSpectrum(phdStr, nuclideLinesMap, tmpFile.getAbsolutePath());
|
||||
Map<String, Object> parseMap = JSON.parseObject(strValue, Map.class);
|
||||
for (Map.Entry<String, Object> entry:parseMap.entrySet()) {
|
||||
System.out.println(entry.getKey());
|
||||
if (entry.getKey().equalsIgnoreCase("bAnalyed")) {
|
||||
boolean value = JSON.parseObject(JSON.toJSONString(entry.getValue()), Boolean.class);
|
||||
phd.setBAnalyed(value);
|
||||
|
@ -1879,6 +1915,10 @@ public class GammaFileUtil {
|
|||
NuclidesIdent(phd, mapLines);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1907,7 +1947,7 @@ public class GammaFileUtil {
|
|||
if(old_ener.size() != new_ener.size()) {
|
||||
return 1;
|
||||
}
|
||||
for(int i=0; i<old_ener.size(); ++i) {
|
||||
for(int i=0; i<old_ener.size(); i++) {
|
||||
if(Math.abs(old_ener.get(i) - new_ener.get(i)) > 1E-6){
|
||||
return 1;
|
||||
}
|
||||
|
@ -1918,7 +1958,7 @@ public class GammaFileUtil {
|
|||
if(old_reso.size() != new_reso.size()) {
|
||||
return 1;
|
||||
}
|
||||
for(int i=0; i<old_reso.size(); ++i) {
|
||||
for(int i=0; i<old_reso.size(); i++) {
|
||||
if(Math.abs(old_reso.get(i) - new_reso.get(i)) > 1E-6){
|
||||
return 1;
|
||||
}
|
||||
|
@ -1929,7 +1969,7 @@ public class GammaFileUtil {
|
|||
if(old_effi.size() != new_effi.size()) {
|
||||
return -1;
|
||||
}
|
||||
for(int i=0; i<old_effi.size(); ++i) {
|
||||
for(int i=0; i<old_effi.size(); i++) {
|
||||
if(Math.abs(old_effi.get(i) - new_effi.get(i)) > 1E-6){
|
||||
return -1;
|
||||
}
|
||||
|
@ -1940,13 +1980,13 @@ public class GammaFileUtil {
|
|||
public void UpdateEfficiency(PHDFile phd) {
|
||||
int peakNum = phd.getVPeak().size();
|
||||
List<Double> vEner = new LinkedList<>();
|
||||
for (int i=0; i<peakNum; ++i) {
|
||||
for (int i=0; i<peakNum; i++) {
|
||||
vEner.add(phd.getVPeak().get(i).energy);
|
||||
}
|
||||
System.loadLibrary("GammaAnaly");
|
||||
CalValuesOut calValuesOut = CalValuesHandler.calFcnEval(vEner, phd.getUsedEffiPara().getP());
|
||||
List<Double> vEffi = calValuesOut.counts;
|
||||
for (int i=0; i<peakNum; ++i) {
|
||||
for (int i=0; i<peakNum; i++) {
|
||||
phd.getVPeak().get(i).efficiency = vEffi.get(i);
|
||||
}
|
||||
}
|
||||
|
@ -1954,7 +1994,7 @@ public class GammaFileUtil {
|
|||
public void NuclidesIdent(PHDFile phd, Map<String, NuclideLines> map) {
|
||||
// 当重新分析时先清除上一次的分析结果
|
||||
phd.getMapNucActMda().clear();
|
||||
for(int i=0; i<phd.getVPeak().size(); ++i){
|
||||
for(int i=0; i<phd.getVPeak().size(); i++){
|
||||
phd.getVPeak().get(i).nuclides.clear();
|
||||
}
|
||||
|
||||
|
@ -1981,7 +2021,7 @@ public class GammaFileUtil {
|
|||
double sum_total = 0; // 该核素所有γ射线能量处效率乘以分支比的和
|
||||
double sum_found = 0; // 所有匹配的γ射线能量处效率乘以分支比的和
|
||||
int mainPeakIdx = -1; // 记录核素主γ峰的索引下标
|
||||
for (int i=0, j=0; i<vEnergy.size(); ++i) {
|
||||
for (int i=0, j=0; i<vEnergy.size(); i++) {
|
||||
for(; j<peakNum; ++j) {
|
||||
if(phd.getVPeak().get(j).energy >= 510 && phd.getVPeak().get(j).energy <= 512) {
|
||||
continue; // 峰中心道能量为511的峰不进行核素识别
|
||||
|
@ -2003,7 +2043,7 @@ public class GammaFileUtil {
|
|||
// 核素匹配到峰
|
||||
if(sum_total > 0) {
|
||||
// 如果该核素属特殊核素,则用“特殊核素配置文件”中指明的其他核素的半衰期
|
||||
double halflife = (Objects.nonNull(mapHalflife.get(iter.getKey()))? iter.getValue().halflife : mapHalflife.get(iter.getKey()));
|
||||
double halflife = (Objects.isNull(mapHalflife.get(iter.getKey()))?iter.getValue().halflife:mapHalflife.get(iter.getKey()));
|
||||
double lambda = Math.log(2.0) / halflife;
|
||||
double rate = sum_found / sum_total;
|
||||
if(rate > 0.5) {
|
||||
|
@ -2012,7 +2052,7 @@ public class GammaFileUtil {
|
|||
if(mainPeakIdx < 0)
|
||||
{
|
||||
maxFoundYield = 0;
|
||||
for(int ii=0; ii<vFit.size(); ++ii) {
|
||||
for(int ii=0; ii<vFit.size(); ii++) {
|
||||
if(vFit.get(ii) >= 0 && vYield.get(ii) > maxFoundYield) {
|
||||
mainPeakIdx = vFit.get(ii);
|
||||
maxFoundYield = vYield.get(ii);
|
||||
|
@ -2020,7 +2060,10 @@ public class GammaFileUtil {
|
|||
}
|
||||
if(mainPeakIdx < 0) continue;
|
||||
}
|
||||
|
||||
if (Objects.isNull(phd.getMapNucActMda().get(iter.getKey()))) {
|
||||
Map<String, NuclideActMda> mapNucActMda = phd.getMapNucActMda();
|
||||
mapNucActMda.put(iter.getKey(), new NuclideActMda());
|
||||
}
|
||||
NuclideActMda ActMda = phd.getMapNucActMda().get(iter.getKey());
|
||||
boolean bActBigger = CalculateMDCs(phd, ActMda, mainPeakIdx, lambda, maxFoundYield, 1.0);
|
||||
|
||||
|
@ -2041,7 +2084,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
|
||||
int fitLineNum = 0, peakIdx = -1;
|
||||
for(int ii=0; ii<vFit.size(); ++ii) {
|
||||
for(int ii=0; ii<vFit.size(); ii++) {
|
||||
if(vFit.get(ii) >= 0) {
|
||||
// 向峰信息表中添加识别到的核素
|
||||
if(vFit.get(ii) != peakIdx) {
|
||||
|
@ -2061,7 +2104,7 @@ public class GammaFileUtil {
|
|||
ActMda.getVUncertE().add(iter.getValue().vuncertE.get(ii));
|
||||
ActMda.getVYield().add(vYield.get(ii));
|
||||
ActMda.getVUncertY().add(iter.getValue().vuncertY.get(ii));
|
||||
++fitLineNum;
|
||||
fitLineNum++;
|
||||
}
|
||||
}
|
||||
phd.getMapNucActMda().put(iter.getKey(), ActMda);
|
||||
|
@ -2082,7 +2125,7 @@ public class GammaFileUtil {
|
|||
for (int j=i+1; j<readLines.size(); j++){
|
||||
line = readLines.get(j);
|
||||
if(StringUtils.isNotBlank(line) && !line.contains("#")) {
|
||||
List<String> strList = Arrays.asList(line.split("\\s"));
|
||||
List<String> strList = Arrays.asList(line.split("\\s+"));
|
||||
if(strList.size() == 3) {
|
||||
mapHalflife.put(strList.get(0), Double.valueOf(strList.get(2)) * 86400);
|
||||
}
|
||||
|
@ -2097,7 +2140,7 @@ public class GammaFileUtil {
|
|||
for (int j=i+1; j<readLines.size(); j++){
|
||||
line = readLines.get(j);
|
||||
if (StringUtils.isNotBlank(line) && !line.contains("#")) {
|
||||
List<String> strList = Arrays.asList(line.split("\\s"));
|
||||
List<String> strList = Arrays.asList(line.split("\\s+"));
|
||||
vNuclides.addAll(strList);
|
||||
}
|
||||
}
|
||||
|
@ -2109,28 +2152,32 @@ public class GammaFileUtil {
|
|||
}
|
||||
|
||||
private void FilterNuclideLine(NuclideLines lines, double lowE) {
|
||||
//获取energy的数组数据
|
||||
List<Double> vE = lines.venergy;
|
||||
for(int i=0, j=0; i<vE.size(); ++i) {
|
||||
//遍历数组
|
||||
for(int i=0, j=0; i<vE.size(); i++) {
|
||||
//当前下标对应的energy的数据 小于 最低energy的数据
|
||||
if(vE.get(i) < lowE) {
|
||||
//移除对应下标的数据
|
||||
lines.fullNames.remove(j);
|
||||
lines.venergy.remove(lines.venergy.get(0)+j);
|
||||
lines.vyield.remove(lines.vyield.get(0)+j);
|
||||
lines.vuncertE.remove(lines.vuncertE.get(0)+j);
|
||||
lines.vuncertY.remove(lines.vuncertY.get(0)+j);
|
||||
lines.venergy.remove(j);
|
||||
lines.vyield.remove(j);
|
||||
lines.vuncertE.remove(j);
|
||||
lines.vuncertY.remove(j);
|
||||
if(i == lines.key_flag){
|
||||
lines.key_flag = -1;
|
||||
} else if(i < lines.key_flag){
|
||||
--lines.key_flag;
|
||||
}
|
||||
} else{
|
||||
++j;
|
||||
} else {
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if(lines.key_flag < 0 && lines.venergy.size() > 0) {
|
||||
List<Double> vY = lines.vyield;
|
||||
lines.maxYeildIdx = 0;
|
||||
double maxYield = vY.get(0);
|
||||
for(int ii=1; ii<vY.size(); ++ii) {
|
||||
for(int ii=1; ii<vY.size(); ii++) {
|
||||
if(vY.get(ii) > maxYield) {
|
||||
maxYield = vY.get(ii);
|
||||
lines.maxYeildIdx = ii;
|
||||
|
@ -2212,21 +2259,20 @@ public class GammaFileUtil {
|
|||
for(int j=0;j<nuclideLineList.size();j++) {
|
||||
nlines.getFullNames().add(nuclideLineList.get(j).getFullName());
|
||||
nlines.getVenergy().add(nuclideLineList.get(j).getEnergy());
|
||||
nlines.getVuncertE().add(nuclideLineList.get(j).getEnergy_uncert());
|
||||
nlines.getVuncertE().add(nuclideLineList.get(j).getEnergyUncert());
|
||||
nlines.getVyield().add(nuclideLineList.get(j).getYield() / 100);
|
||||
nlines.getVuncertY().add(nuclideLineList.get(j).getYield_uncert());
|
||||
if(Objects.nonNull(nuclideLineList.get(j).getKey_flag()) && nuclideLineList.get(j).getKey_flag().intValue() > 0) {
|
||||
nlines.getVuncertY().add(nuclideLineList.get(j).getYieldUncert());
|
||||
if(Objects.nonNull(nuclideLineList.get(j).getKeyFlag()) && nuclideLineList.get(j).getKeyFlag().intValue() > 0) {
|
||||
nlines.key_flag = j;
|
||||
nlines.maxYeildIdx = j;
|
||||
}
|
||||
}
|
||||
mapLines.put(name, nlines);
|
||||
}
|
||||
long start = System.currentTimeMillis();
|
||||
List<HalfData> halfs = spectrumAnalysisMapper.getHalf(nuclideList);
|
||||
for(int m=0;m<halfs.size();m++) {
|
||||
NuclideLines nuclideLines = mapLines.get(halfs.get(m).getName());
|
||||
nuclideLines.setHalflife(halfs.get(m).getHalf()==null?0:halfs.get(m).getHalf()* 86400);// 将天转换成秒
|
||||
nuclideLines.setHalflife(halfs.get(m).getHalf()==null? 0 : halfs.get(m).getHalf() * 86400);// 将天转换成秒
|
||||
mapLines.put(halfs.get(m).getName(), nuclideLines);
|
||||
}
|
||||
return mapLines;
|
||||
|
@ -2244,7 +2290,7 @@ public class GammaFileUtil {
|
|||
end = m_nCount;
|
||||
}
|
||||
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(phd.getVBase().get(i));
|
||||
|
@ -2280,12 +2326,12 @@ public class GammaFileUtil {
|
|||
int startPeak = -1;
|
||||
int endPeak = peakNum-1;
|
||||
while(index < peakNum && start > vecPeak.get(index).right){
|
||||
++index;
|
||||
index++;
|
||||
}
|
||||
if(index < peakNum) {
|
||||
startPeak = index;
|
||||
while(index < peakNum && vecPeak.get(index).left < end){
|
||||
++index;
|
||||
index++;
|
||||
}
|
||||
endPeak = index-1;
|
||||
}
|
||||
|
@ -2295,7 +2341,7 @@ public class GammaFileUtil {
|
|||
|
||||
List<Double> regPeak = new LinkedList<>();
|
||||
int channel = 1;
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
channel = i + 1;
|
||||
PeakInfo peak = vecPeak.get(startPeak);
|
||||
if(channel >= peak.left && channel <= peak.right) {
|
||||
|
@ -2332,7 +2378,7 @@ public class GammaFileUtil {
|
|||
break;
|
||||
}
|
||||
}
|
||||
for(int i=channel; i<end; ++i) {
|
||||
for(int i=channel; i<end; i++) {
|
||||
if(m_vCount.get(i) > 0 && phd.getVBase().get(i) > 0) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
|
@ -2387,7 +2433,7 @@ public class GammaFileUtil {
|
|||
if(p_size >= 2 && m_curParam.getP().get(2) > 0) {
|
||||
// Polynomial: y=a0+a1*x+a2*x^2+a3*x^3
|
||||
equation +="Energy = "+m_curParam.getP().get(1)+" + C * "+m_curParam.getP().get(2);
|
||||
for(int i=3; i<=p_size; ++i) {
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + C<sup style=\"vertical-align:super;\">" + (i-1) +"</sup> * "+m_curParam.getP().get(i)+"";
|
||||
}
|
||||
} else if(p_size == 1) {
|
||||
|
@ -2420,7 +2466,7 @@ public class GammaFileUtil {
|
|||
vChan.add(MaxChan);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vChan, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vChan.size(); ++i) {
|
||||
for(int i=0; i<vChan.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vChan.get(i));
|
||||
|
@ -2437,7 +2483,7 @@ public class GammaFileUtil {
|
|||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; ++i) {
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurCentroid.get(i));
|
||||
seriseData.setY(m_vCurEnergy.get(i));
|
||||
|
@ -2453,7 +2499,7 @@ public class GammaFileUtil {
|
|||
if(p_size >= 2 && m_curParam.getP().get(1) > 0 && m_curParam.getP().get(2) > 0) {
|
||||
// Square root of polynomial: y = sqrt(a0+a1*x+a2*x^2+a3*x^3 )
|
||||
equation += "FWHM = ("+m_curParam.getP().get(1)+" + E * "+m_curParam.getP().get(2);
|
||||
for(int i=3; i<=p_size; ++i) {
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + E<sup style=\"vertical-align:super;\">"+(i-1)+"</sup> * "+m_curParam.getP().get(i);
|
||||
}
|
||||
equation += ")<sup style=\"vertical-align:super;\">"+1+"/"+2+"</sup>";
|
||||
|
@ -2489,7 +2535,7 @@ public class GammaFileUtil {
|
|||
vEner.add(maxE);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vEner, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vEner.size(); ++i) {
|
||||
for(int i=0; i<vEner.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEner.get(i));
|
||||
|
@ -2506,7 +2552,7 @@ public class GammaFileUtil {
|
|||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; ++i) {
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurEnergy.get(i));
|
||||
seriseData.setY(m_vCurReso.get(i));
|
||||
|
@ -2547,7 +2593,7 @@ public class GammaFileUtil {
|
|||
break;
|
||||
case 5: // HT Efficiency: y = A*exp(-(E1/x)^k)*(1-exp(-(E2/x)^n))
|
||||
if(p_size == 5) {
|
||||
for(int i=1; i<=p_size; ++i) {
|
||||
for(int i=1; i<=p_size; i++) {
|
||||
if(m_curParam.getP().get(i) <= 0) break;
|
||||
}
|
||||
equation += "Efficiency = "+m_curParam.getP().get(1)+" * exp(-("+m_curParam.getP().get(2)+" / E)<sup style=\"vertical-align:super;\">"+m_curParam.getP().get(3)+"</sup>) * "+
|
||||
|
@ -2557,7 +2603,7 @@ public class GammaFileUtil {
|
|||
case 6: // Polynomial in log(y) against log(x): log(y) = a0 + a1*log(x) +a2*log(x)^2+ a3*log(x)^3
|
||||
if(p_size >= 2) {
|
||||
equation += "log(Efficiency) = "+m_curParam.getP().get(1)+" + "+m_curParam.getP().get(2)+" * log(E)";
|
||||
for(int i=3; i<=p_size; ++i) {
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + "+m_curParam.getP().get(i)+" * log(E)<sup style=\"vertical-align:super;\">"+(i-1)+"</sup>";
|
||||
}
|
||||
}
|
||||
|
@ -2565,7 +2611,7 @@ public class GammaFileUtil {
|
|||
case 8: // Polynomial in log(y) against log(1/x): log(y) = a0 + a1*log(c/x) + a2*log(c/x)^2 + a3*log(c/x)^3 + a4*log(c/x)^4
|
||||
if(p_size >= 3) {
|
||||
equation += "log(Efficiency) = "+m_curParam.getP().get(1)+" + "+m_curParam.getP().get(2)+" * log(C/E)";
|
||||
for(int i=3; i<=p_size; ++i) {
|
||||
for(int i=3; i<=p_size; i++) {
|
||||
equation += " + "+m_curParam.getP().get(i)+" * log(C/E)<sup style=\"vertical-align:super;\">"+(i-1)+"</sup>";
|
||||
}
|
||||
}
|
||||
|
@ -2623,7 +2669,7 @@ public class GammaFileUtil {
|
|||
vEner.add(maxE);
|
||||
|
||||
List<Double> vFit = CalValuesHandler.calFcnEval(vEner, m_curParam.getP()).counts;
|
||||
for(int i=0; i<vEner.size(); ++i) {
|
||||
for(int i=0; i<vEner.size(); i++) {
|
||||
if(vFit.get(i) > 0){
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEner.get(i));
|
||||
|
@ -2640,7 +2686,7 @@ public class GammaFileUtil {
|
|||
ChartData pData = new ChartData();
|
||||
pData.setColor("red");
|
||||
pData.setType("Scatter");
|
||||
for(int i=0; i<num; ++i) {
|
||||
for(int i=0; i<num; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(m_vCurEnergy.get(i));
|
||||
seriseData.setY(m_vCurEffi.get(i));
|
||||
|
@ -3911,7 +3957,7 @@ public class GammaFileUtil {
|
|||
+ phd.getCertificate().getAssay_time()+""+phd.getCertificate().getUnits_activity() + "\r\n");
|
||||
|
||||
int fieldWidth = 12;
|
||||
for(int i=0; i<phd.getCertificate().getG_energy().size(); ++i) {
|
||||
for(int i=0; i<phd.getCertificate().getG_energy().size(); i++) {
|
||||
spectrum.append(phd.getCertificate().getNuclide_name().get(i)+
|
||||
StringPool.SPACE+phd.getCertificate().getHalf_life_time().get(i)+
|
||||
StringPool.SPACE+phd.getCertificate().getTime_unit().get(i)+
|
||||
|
@ -3934,7 +3980,7 @@ public class GammaFileUtil {
|
|||
// #g_Energy
|
||||
spectrum.append("#g_Energy\r\n");
|
||||
GEnergyBlock g_ener = phd.getUsedEnerKD();
|
||||
for(int i=0; i<g_ener.getG_energy().size(); ++i) {
|
||||
for(int i=0; i<g_ener.getG_energy().size(); i++) {
|
||||
spectrum.append(RightFill(String.format("%.9f", Double.valueOf(g_ener.getG_energy().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill(String.format("%.9f", Double.valueOf(g_ener.getCentroid_channel().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill((Objects.isNull(g_ener.getUncertainty().get(i)) ? "0.5" : String.format("%.9f", Double.valueOf(g_ener.getUncertainty().get(i)))), 16)+"\r\n");
|
||||
|
@ -3943,7 +3989,7 @@ public class GammaFileUtil {
|
|||
// #g_Resolution
|
||||
spectrum.append("#g_Resolution\r\n");
|
||||
GResolutionBlock g_reso = phd.getUsedResoKD();
|
||||
for(int i=0; i<g_reso.getFWHM().size(); ++i) {
|
||||
for(int i=0; i<g_reso.getFWHM().size(); i++) {
|
||||
spectrum.append(RightFill(String.format("%.9f", Double.valueOf(g_reso.getG_energy().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill(String.format("%.9f", Double.valueOf(g_reso.getFWHM().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill((Objects.isNull(g_reso.getUncertainty().get(i)) ? "0.5" : String.format("%.9f", Double.valueOf(g_reso.getUncertainty().get(i)))), 16)+"\r\n");
|
||||
|
@ -3952,7 +3998,7 @@ public class GammaFileUtil {
|
|||
// #g_Efficiency
|
||||
spectrum.append("#g_Efficiency\r\n");
|
||||
GEfficiencyBlock g_effi = phd.getUsedEffiKD();
|
||||
for(int i=0; i<g_effi.getEfficiency().size(); ++i) {
|
||||
for(int i=0; i<g_effi.getEfficiency().size(); i++) {
|
||||
spectrum.append(RightFill(String.format("%.9f", Double.valueOf(g_effi.getG_energy().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill(String.format("%.9f", Double.valueOf(g_effi.getEfficiency().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill((Objects.isNull(g_effi.getUncertainty().get(i)) ? "0.5" : String.format("%.9f", Double.valueOf(g_effi.getUncertainty().get(i)))), 16)+"\r\n");
|
||||
|
@ -3962,7 +4008,7 @@ public class GammaFileUtil {
|
|||
if(phd.getUsedTotEKD() != null && phd.getUsedTotEKD().getG_energy().size() > 0) {
|
||||
spectrum.append("#TotalEff\r\n");
|
||||
TotaleffBlock g_totE = phd.getUsedTotEKD();
|
||||
for(int i=0; i<g_totE.getRecord_count(); ++i) {
|
||||
for(int i=0; i<g_totE.getRecord_count(); i++) {
|
||||
spectrum.append(RightFill(String.format("%.9f", Double.valueOf(g_totE.getG_energy().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill(String.format("%.9f", Double.valueOf(g_totE.getTotal_efficiency().get(i))), 16)+
|
||||
StringPool.SPACE+RightFill((Objects.isNull(g_totE.getUncertainty().get(i)) ? "0.5" : String.format("%.9f", Double.valueOf(g_totE.getUncertainty().get(i)))), 16));
|
||||
|
@ -3985,7 +4031,7 @@ public class GammaFileUtil {
|
|||
}
|
||||
if(i < len) {
|
||||
spectrum.append(RightFill(String.valueOf(j), 5)+StringPool.SPACE+RightFill(String.valueOf(phd.getSpec().getCounts().get(i)), 10));
|
||||
for(i = i+1; i < phd.getSpec().getNum_g_channel(); ++i) {
|
||||
for(i = i+1; i < phd.getSpec().getNum_g_channel(); i++) {
|
||||
spectrum.append(StringPool.SPACE+RightFill(String.valueOf(phd.getSpec().getCounts().get(i)), 10));
|
||||
}
|
||||
spectrum.append("\r\n");
|
||||
|
@ -4109,7 +4155,7 @@ public class GammaFileUtil {
|
|||
if(end < 1 || end > phd.getSpec().getNum_g_channel()){
|
||||
end = (int) phd.getSpec().getNum_g_channel();
|
||||
}
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(phd.getVEnergy().get(i));
|
||||
seriseData.setY(phd.getSpec().getCounts().get(i));
|
||||
|
@ -4133,7 +4179,7 @@ public class GammaFileUtil {
|
|||
end = (int) phd.getSpec().getNum_g_channel();
|
||||
}
|
||||
|
||||
for(int i=start-1; i<end; ++i) {
|
||||
for(int i=start-1; i<end; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(phd.getVEnergy().get(i));
|
||||
seriseData.setY(phd.getVBase().get(i));
|
||||
|
@ -4151,7 +4197,7 @@ public class GammaFileUtil {
|
|||
// 注:索引从0开始,道从1开始,道 = 索引 + 1
|
||||
if(startIndex < 0) startIndex = 0;
|
||||
int channel = startIndex + 1; // 将 channel 设为 startIndex 处的道数
|
||||
for(int i=channel; i<phd.getVEnergy().size(); ++i) // 从 startIndex 的下一个索引开始
|
||||
for(int i=channel; i<phd.getVEnergy().size(); i++) // 从 startIndex 的下一个索引开始
|
||||
{
|
||||
if(phd.getVEnergy().get(i) >= energy) {
|
||||
if(phd.getVEnergy().get(i) - energy > energy - phd.getVEnergy().get(i-1)){
|
||||
|
@ -4210,7 +4256,7 @@ public class GammaFileUtil {
|
|||
public int FindNearPeak(List<PeakInfo> vPeak, int channel, boolean bFind) {
|
||||
boolean t_bFind = false;
|
||||
int i=0, peakNum = vPeak.size();
|
||||
for(; i<peakNum; ++i) {
|
||||
for(; i<peakNum; i++) {
|
||||
PeakInfo peak = vPeak.get(i);
|
||||
if(channel >= peak.left && channel <= peak.right) {
|
||||
// 如果 channel 在峰的左右边界内
|
||||
|
@ -4243,7 +4289,7 @@ public class GammaFileUtil {
|
|||
public List<TablePeaks> FitPeakBaseLine(PHDFile phd, List<Integer> vIdx) {
|
||||
List<TablePeaks> tablePeaksList = new LinkedList<>();
|
||||
int peakNum = vIdx.size();
|
||||
for (int i=0; i<peakNum; ++i) {
|
||||
for (int i=0; i<peakNum; i++) {
|
||||
int peakIdx = vIdx.get(i);
|
||||
int row = i+1;
|
||||
PeakInfo peak = phd.getVPeak().get(peakIdx);
|
||||
|
@ -4419,6 +4465,7 @@ public class GammaFileUtil {
|
|||
return m_vecCompare;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
//加载dll工具库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
try {
|
||||
|
@ -4432,7 +4479,7 @@ public class GammaFileUtil {
|
|||
inputStream = ftpClient.retrieveFileStream(compareFileName);
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//读取文件信息
|
||||
|
@ -4458,6 +4505,9 @@ public class GammaFileUtil {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -4474,7 +4524,7 @@ public class GammaFileUtil {
|
|||
data1.setGroup("channel");
|
||||
data1.setColor(colorMap.get("Color_Compare"));
|
||||
// Compare two Spectrum in Channel
|
||||
for(int i=0; i<size; ++i) {
|
||||
for(int i=0; i<size; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_vecCompare.get(i));
|
||||
|
@ -4487,7 +4537,7 @@ public class GammaFileUtil {
|
|||
data2.setGroup("energy");
|
||||
data2.setColor(colorMap.get("Color_Compare"));
|
||||
// Compare two Spectrum in Energy
|
||||
for(int i=0; i<size; ++i) {
|
||||
for(int i=0; i<size; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEnergy.get(i));
|
||||
seriseData.setY(m_vecCompare.get(i));
|
||||
|
@ -4508,7 +4558,7 @@ public class GammaFileUtil {
|
|||
data1.setGroup("channel");
|
||||
data1.setColor(colorMap.get("Color_Strip"));
|
||||
// type: 1 Add a Spectrum in Channel; -1 Cut a Spectrum in Channel
|
||||
for(int i=0; i<size; ++i) {
|
||||
for(int i=0; i<size; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(i+1);
|
||||
seriseData.setY(m_vCount.get(i) + ratioRate * m_vecCompare.get(i));
|
||||
|
@ -4521,7 +4571,7 @@ public class GammaFileUtil {
|
|||
data2.setGroup("energy");
|
||||
data2.setColor(colorMap.get("Color_Strip"));
|
||||
// type: 1 Add a Spectrum in Energy; -1 Cut a Spectrum in Energy
|
||||
for(int i=0; i<size; ++i) {
|
||||
for(int i=0; i<size; i++) {
|
||||
SeriseData seriseData = new SeriseData();
|
||||
seriseData.setX(vEnergy.get(i));
|
||||
seriseData.setY(m_vCount.get(i) + ratioRate * m_vecCompare.get(i));
|
||||
|
|
|
@ -474,13 +474,19 @@
|
|||
</select>
|
||||
|
||||
<select id="getNuclideLines" resultType="org.jeecg.modules.entity.vo.NuclideLine">
|
||||
SELECT FULLNAME,ENERGY,ENERGY_UNCERT,YIELD,YIELD_UNCERT,KEY_FLAG from CONFIGURATION.GARDS_NUCL_LINES_LIB WHERE NAME = #{name} ORDER BY ENERGY
|
||||
SELECT FULLNAME as fullName,
|
||||
ENERGY as energy,
|
||||
ENERGY_UNCERT as energyUncert,
|
||||
YIELD as yield,
|
||||
YIELD_UNCERT as yieldUncert,
|
||||
KEY_FLAG as keyFlag
|
||||
from CONFIGURATION.GARDS_NUCL_LINES_LIB WHERE NAME = #{name} ORDER BY ENERGY
|
||||
</select>
|
||||
|
||||
<select id="getHalf" resultType="org.jeecg.modules.entity.vo.HalfData">
|
||||
SELECT
|
||||
NAME,
|
||||
HALFLIFE
|
||||
NAME as name,
|
||||
HALFLIFE as half
|
||||
FROM
|
||||
CONFIGURATION.GARDS_NUCL_LIB
|
||||
WHERE NAME IN
|
||||
|
|
|
@ -168,173 +168,35 @@ public class GammaServiceImpl implements IGammaService {
|
|||
@Override
|
||||
public Result testFun(String fileName, HttpServletRequest request) {
|
||||
Result result = new Result();
|
||||
Cache<String, PHDFile> phdCache = localCache.getPHDCache();
|
||||
PHDFile phd = phdCache.getIfPresent(fileName);
|
||||
phd.setUserId("1");
|
||||
phd.setXmlFilePath(parameterFilePath);
|
||||
if (Objects.isNull(phd)){
|
||||
result.error500("请先选择解析文件!");
|
||||
return result;
|
||||
}
|
||||
String systemType = fileName.substring(2, 3);
|
||||
String userName = JwtUtil.getUserNameByToken(request);
|
||||
//查询当前用户关联的核素信息
|
||||
List<String> nuclides = new LinkedList<>();
|
||||
//从postgreSql中获取当前用户关注的核素信息 如果当前用户没有 则返回管理员的
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName(userName, phd.getHeader().getSystem_type().toUpperCase());
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName(userName, systemType);
|
||||
if (CollectionUtils.isEmpty(nuclides)){
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", phd.getHeader().getSystem_type().toUpperCase());
|
||||
nuclides = defaultNuclideSpectrumService.findNuclidesByUserName("admin", systemType);
|
||||
}
|
||||
Map<String, NuclideLines> nuclideLinesMap = gammaFileUtil.GetNuclideLines(nuclides);
|
||||
//解析获取临时文件信息
|
||||
File tmpFile = gammaFileUtil.analyzeFile(StringPool.SLASH + spectrumPathProperties.getUploadPath() + StringPool.SLASH + userName, fileName);
|
||||
result.setSuccess(true);
|
||||
result.setResult(nuclideLinesMap);
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.loadLibrary("GammaAnaly");
|
||||
String path = "D:\\ARMD\\PHD\\Samplephd\\PHP52_001-20230908_0543_S_PREL_43188.PHD";
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
try {
|
||||
String phdStr = mapper.writeValueAsString(phd);
|
||||
String mapLines = mapper.writeValueAsString(nuclideLinesMap);
|
||||
String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, tmpFile.getAbsolutePath());
|
||||
String phdStr = mapper.writeValueAsString(new PHDFile());
|
||||
String mapLines = mapper.writeValueAsString(new HashMap<String, NuclideLines>());
|
||||
String strValue = CalValuesHandler.analyseSpectrum(phdStr, mapLines, path);
|
||||
Map<String, Object> parseMap = JSON.parseObject(strValue, Map.class);
|
||||
for (Map.Entry<String, Object> entry:parseMap.entrySet()) {
|
||||
if (entry.getKey().equalsIgnoreCase("bAnalyed")) {
|
||||
boolean value = (boolean) entry.getValue();
|
||||
phd.setBAnalyed(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapEnerPara")) {
|
||||
Map<String, ParameterInfo> value = (Map<String, ParameterInfo>) entry.getValue();
|
||||
phd.setMapEnerPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapResoPara")) {
|
||||
Map<String, ParameterInfo> value = (Map<String, ParameterInfo>) entry.getValue();
|
||||
phd.setMapResoPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapEffiPara")) {
|
||||
Map<String, ParameterInfo> value = (Map<String, ParameterInfo>) entry.getValue();
|
||||
phd.setMapEffiPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapTotEPara")) {
|
||||
Map<String, ParameterInfo> value = (Map<String, ParameterInfo>) entry.getValue();
|
||||
phd.setMapTotEPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("para_stepRatio")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setPara_stepRatio(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("para_tail")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setPara_tail(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("para_tailAlpha")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setPara_tailAlpha(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("para_tailRight")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setPara_tailRight(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("para_tailRightAlpha")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setPara_tailRightAlpha(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("newEner")) {
|
||||
String value = (String) entry.getValue();
|
||||
phd.setNewEner(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapEnerKD")) {
|
||||
Map<String, GEnergyBlock> value = (Map<String, GEnergyBlock>) entry.getValue();
|
||||
phd.setMapEnerKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("mapResoKD")) {
|
||||
Map<String, GResolutionBlock> value = (Map<String, GResolutionBlock>) entry.getValue();
|
||||
phd.setMapResoKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vEnergy")) {
|
||||
List<Double> value = (List<Double>) entry.getValue();
|
||||
phd.setVEnergy(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vBase")) {
|
||||
List<Double> value = (List<Double>) entry.getValue();
|
||||
phd.setVBase(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vLc")) {
|
||||
List<Double> value = (List<Double>) entry.getValue();
|
||||
phd.setVLc(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vScac")) {
|
||||
List<Double> value = (List<Double>) entry.getValue();
|
||||
phd.setVScac(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("vPeak")) {
|
||||
List<PeakInfo> value = (List<PeakInfo>) entry.getValue();
|
||||
phd.setVPeak(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("baseCtrls")) {
|
||||
BaseControls value = JSON.parseObject(JSON.toJSONString(entry.getValue()), BaseControls.class);
|
||||
phd.setBaseCtrls(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEner")) {
|
||||
String value = (String) entry.getValue();
|
||||
phd.setUsedEner(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEnerKD")) {
|
||||
GEnergyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEnergyBlock.class);
|
||||
phd.setUsedEnerKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEnerPara")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setUsedEnerPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedReso")) {
|
||||
String value = (String) entry.getValue();
|
||||
phd.setUsedReso(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedResoKD")) {
|
||||
GResolutionBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GResolutionBlock.class);
|
||||
phd.setUsedResoKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedResoPara")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setUsedResoPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEffi")) {
|
||||
String value = (String) entry.getValue();
|
||||
phd.setUsedEffi(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEffiKD")) {
|
||||
GEfficiencyBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), GEfficiencyBlock.class);
|
||||
phd.setUsedEffiKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedEffiPara")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setUsedEffiPara(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedTotE")) {
|
||||
String value = (String) entry.getValue();
|
||||
phd.setUsedTotE(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedTotEKD")) {
|
||||
TotaleffBlock value = JSON.parseObject(JSON.toJSONString(entry.getValue()), TotaleffBlock.class);
|
||||
phd.setUsedTotEKD(value);
|
||||
}
|
||||
if (entry.getKey().equalsIgnoreCase("usedTotEPara")) {
|
||||
ParameterInfo value = JSON.parseObject(JSON.toJSONString(entry.getValue()), ParameterInfo.class);
|
||||
phd.setUsedTotEPara(value);
|
||||
}
|
||||
}
|
||||
BeanUtils.copyProperties(phd.getSetting(), phd.getUsedSetting());
|
||||
|
||||
for (PeakInfo peak:phd.getVPeak()) {
|
||||
if (StringUtils.isBlank(peak.recoilBetaChan)) {
|
||||
peak.recoilBetaChan = "1";
|
||||
}
|
||||
if (StringUtils.isBlank(peak.recoilDeltaChan)) {
|
||||
peak.recoilDeltaChan = "1";
|
||||
}
|
||||
}
|
||||
result.setResult(phd);
|
||||
System.out.println("parseMap:" + parseMap);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
result.setSuccess(true);
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1618,11 +1480,14 @@ public class GammaServiceImpl implements IGammaService {
|
|||
List<Double> m_vCurCentroid = new LinkedList<>();
|
||||
List<Double> m_vCurEnergy = new LinkedList<>();
|
||||
List<Double> m_vCurUncert = new LinkedList<>();
|
||||
File tmpFile = null;
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
//创建临时文件
|
||||
File tmpFile = File.createTempFile("tmp", null);
|
||||
tmpFile = File.createTempFile("tmp", null);
|
||||
inputStream = file.getInputStream();
|
||||
//复制上传文件的输入流到临时文件
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream() ,tmpFile);
|
||||
FileUtils.copyInputStreamToFile(inputStream ,tmpFile);
|
||||
//读取文件所有行
|
||||
List<String> readLines = FileUtils.readLines(tmpFile, "UTF-8");
|
||||
//遍历文件行数据
|
||||
|
@ -1673,6 +1538,17 @@ public class GammaServiceImpl implements IGammaService {
|
|||
result.setResult(map);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1870,11 +1746,14 @@ public class GammaServiceImpl implements IGammaService {
|
|||
List<Double> m_vCurReso = new LinkedList<>();
|
||||
List<Double> m_vCurEnergy = new LinkedList<>();
|
||||
List<Double> m_vCurUncert = new LinkedList<>();
|
||||
InputStream inputStream = null;
|
||||
File tmpFile = null;
|
||||
try {
|
||||
//创建临时文件
|
||||
File tmpFile = File.createTempFile("tmp", null);
|
||||
tmpFile = File.createTempFile("tmp", null);
|
||||
inputStream = file.getInputStream();
|
||||
//复制上传文件的输入流到临时文件
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream() ,tmpFile);
|
||||
FileUtils.copyInputStreamToFile(inputStream ,tmpFile);
|
||||
//读取文件所有行
|
||||
List<String> readLines = FileUtils.readLines(tmpFile, "UTF-8");
|
||||
//遍历文件行数据
|
||||
|
@ -1925,6 +1804,17 @@ public class GammaServiceImpl implements IGammaService {
|
|||
result.setResult(map);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2133,11 +2023,14 @@ public class GammaServiceImpl implements IGammaService {
|
|||
List<Double> m_vCurEnergy = new LinkedList<>();
|
||||
List<Double> m_vCurUncert = new LinkedList<>();
|
||||
Double m_nFunId = 1.0;
|
||||
File tmpFile = null;
|
||||
InputStream inputStream = null;
|
||||
try {
|
||||
//创建临时文件
|
||||
File tmpFile = File.createTempFile("tmp", null);
|
||||
tmpFile = File.createTempFile("tmp", null);
|
||||
inputStream = file.getInputStream();
|
||||
//复制上传文件的输入流到临时文件
|
||||
FileUtils.copyInputStreamToFile(file.getInputStream() ,tmpFile);
|
||||
FileUtils.copyInputStreamToFile(inputStream ,tmpFile);
|
||||
//读取文件所有行
|
||||
List<String> readLines = FileUtils.readLines(tmpFile, "UTF-8");
|
||||
//遍历文件行数据
|
||||
|
@ -2199,6 +2092,17 @@ public class GammaServiceImpl implements IGammaService {
|
|||
result.setResult(map);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (Objects.nonNull(inputStream)) {
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(tmpFile)) {
|
||||
tmpFile.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -309,7 +309,6 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
Integer analysisID = null;
|
||||
if (dbName.equalsIgnoreCase("auto")){
|
||||
dbName = "RNAUTO";
|
||||
userName = "RNAUTO";
|
||||
analysisID = spectrumAnalysisMapper.getAnalysisID("RNAUTO", sampleId, "RNAUTO");
|
||||
xeResultsSpectrumList = spectrumAnalysisMapper.ReadXeResults("RNAUTO", analysisID, sampleId);
|
||||
}else if (dbName.equalsIgnoreCase("man")){
|
||||
|
@ -432,6 +431,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
throw new RuntimeException("ftp连接失败");
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -443,7 +443,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(fileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
map = phdFileUtil.getSourceData(file.getAbsolutePath(), xeDataList, sampleId, status);
|
||||
|
@ -460,6 +460,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -510,6 +513,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -521,7 +525,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -539,6 +543,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -905,6 +912,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
//切换被动模式
|
||||
ftpClient.enterLocalPassiveMode();
|
||||
|
@ -916,7 +924,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -978,6 +986,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -1182,6 +1193,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
File sampleTmp = null;
|
||||
File gasTmp = null;
|
||||
File detTmp = null;
|
||||
|
@ -1213,7 +1225,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -1268,6 +1280,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
if (Objects.nonNull(sampleTmp)) {
|
||||
sampleTmp.delete();
|
||||
}
|
||||
|
@ -1320,6 +1335,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(qcPath)){
|
||||
//切换被动模式
|
||||
|
@ -1332,7 +1348,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -1433,6 +1449,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -1464,6 +1483,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(qcPath)){
|
||||
//切换被动模式
|
||||
|
@ -1476,7 +1496,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -1580,6 +1600,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -1607,6 +1630,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(samplePathName)) {
|
||||
//切换被动模式
|
||||
|
@ -1620,7 +1644,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//ftp文件输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//读取文件信息
|
||||
|
@ -1702,6 +1726,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -1754,6 +1781,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(filePath)) {
|
||||
//切换被动模式
|
||||
|
@ -1767,7 +1795,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(sampleFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//ftp文件输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//读取文件信息
|
||||
|
@ -1809,6 +1837,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -2270,6 +2301,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
return result;
|
||||
}
|
||||
InputStream inputStream = null;
|
||||
File file = null;
|
||||
try {
|
||||
if (StringUtils.isNotBlank(qcPathName)){
|
||||
//切换被动模式
|
||||
|
@ -2282,7 +2314,7 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
inputStream = ftpClient.retrieveFileStream(qcFileName);
|
||||
if (Objects.nonNull(inputStream)){
|
||||
//声明一个临时文件
|
||||
File file = File.createTempFile("tmp", null);
|
||||
file = File.createTempFile("tmp", null);
|
||||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
//加载dll工具库
|
||||
|
@ -2316,6 +2348,9 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
@ -3643,11 +3678,14 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
public void analyzePHDFile(BgDataAnlyseResultIn anlyseResultIn,List<String> betaFittingPara, List<String> gammaFittingPara) {
|
||||
File sampleTmp = null;
|
||||
File gasTmp = null;
|
||||
File detTmp = null;
|
||||
try {
|
||||
//根据文件路径 文件名称获取对应的临时文件
|
||||
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
File gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||
File detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||
sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
gasTmp = phdFileUtil.analyzeFile(anlyseResultIn.getGasFilePath(), anlyseResultIn.getGasFileName());
|
||||
detTmp = phdFileUtil.analyzeFile(anlyseResultIn.getDetFilePath(), anlyseResultIn.getDetFileName());
|
||||
//加载dll工具库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
//调用动态库解析文件
|
||||
|
@ -3847,7 +3885,15 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
||||
if (Objects.nonNull(sampleTmp)) {
|
||||
sampleTmp.delete();
|
||||
}
|
||||
if (Objects.nonNull(gasTmp)) {
|
||||
gasTmp.delete();
|
||||
}
|
||||
if (Objects.nonNull(detTmp)) {
|
||||
detTmp.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3934,62 +3980,71 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
}
|
||||
|
||||
public void getROILimit(BgDataAnlyseResultIn anlyseResultIn) {
|
||||
//获取ftp文件路径下临时文件
|
||||
File sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
if (Objects.nonNull(sampleTmp)){
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath());
|
||||
List<Double> poiBX1 = sourceData.POI_B_x1;
|
||||
List<Double> poiBX2 = sourceData.POI_B_x2;
|
||||
List<Double> poiGY1 = sourceData.POI_G_y1;
|
||||
List<Double> poiGY2 = sourceData.POI_G_y2;
|
||||
//ROI Limit
|
||||
List<String> report_limit_roi = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiBX1.size();pos++) {
|
||||
report_limit_roi.add(String.valueOf(pos));
|
||||
File sampleTmp = null;
|
||||
try {
|
||||
//获取ftp文件路径下临时文件
|
||||
sampleTmp = phdFileUtil.analyzeFile(anlyseResultIn.getSampleFilePath(), anlyseResultIn.getSampleFileName());
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
if (Objects.nonNull(sampleTmp)){
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(sampleTmp.getAbsolutePath());
|
||||
List<Double> poiBX1 = sourceData.POI_B_x1;
|
||||
List<Double> poiBX2 = sourceData.POI_B_x2;
|
||||
List<Double> poiGY1 = sourceData.POI_G_y1;
|
||||
List<Double> poiGY2 = sourceData.POI_G_y2;
|
||||
//ROI Limit
|
||||
List<String> report_limit_roi = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiBX1.size();pos++) {
|
||||
report_limit_roi.add(String.valueOf(pos));
|
||||
}
|
||||
List<String> beginB = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiBX1.size();pos++) {
|
||||
beginB.add(String.valueOf(poiBX1.get(pos)));
|
||||
}
|
||||
List<String> endB = new LinkedList<>();
|
||||
for(int pos=0;pos<poiBX2.size();pos++) {
|
||||
endB.add(String.valueOf(poiBX2.get(pos)));
|
||||
}
|
||||
List<String> beginG = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiGY1.size();pos++) {
|
||||
beginG.add(String.valueOf(poiGY1.get(pos)));
|
||||
}
|
||||
List<String> endG = new LinkedList<>();
|
||||
for(int pos=0;pos<poiGY2.size();pos++) {
|
||||
endG.add(String.valueOf(poiGY2.get(pos)));
|
||||
}
|
||||
//ratios
|
||||
List<String> ratio_id = sourceData.ratio_id;
|
||||
List<String> ROI_num_highter_G_energy_ROI = sourceData.ROI_num_highter_G_energy_ROI;
|
||||
List<String> ROI_num_lower_G_energy_ROI = sourceData.ROI_num_lower_G_energy_ROI;
|
||||
List<Double> count_ratio = sourceData.count_ratio;
|
||||
List<Double> count_ratio_uncertainty = sourceData.count_ratio_uncertainty;
|
||||
List<String> countRatioList = new LinkedList<>();
|
||||
for(int pos=0;pos<count_ratio.size();pos++) {
|
||||
countRatioList.add(String.valueOf(count_ratio.get(pos)));
|
||||
}
|
||||
List<String> countRatioUncertaintyList = new LinkedList<>();
|
||||
for(int pos=0;pos<count_ratio_uncertainty.size();pos++) {
|
||||
countRatioUncertaintyList.add(String.valueOf(count_ratio_uncertainty.get(pos)));
|
||||
}
|
||||
//bg_efficiency
|
||||
List<Double> bg_efficiency = sourceData.bg_efficiency;
|
||||
List<String> nuclide_name = sourceData.nuclide_name;
|
||||
List<String> ROI_number = sourceData.ROI_number;
|
||||
List<Double> uncertainty = sourceData.uncertainty;
|
||||
List<String> efficiencyList = new LinkedList<>();
|
||||
for(int pos=0;pos<bg_efficiency.size();pos++) {
|
||||
efficiencyList.add(String.valueOf(bg_efficiency.get(pos)));
|
||||
}
|
||||
List<String> uncertaintyList = new LinkedList<>();
|
||||
for(int pos=0;pos<uncertainty.size();pos++) {
|
||||
uncertaintyList.add(String.valueOf(uncertainty.get(pos)));
|
||||
}
|
||||
}
|
||||
List<String> beginB = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiBX1.size();pos++) {
|
||||
beginB.add(String.valueOf(poiBX1.get(pos)));
|
||||
}
|
||||
List<String> endB = new LinkedList<>();
|
||||
for(int pos=0;pos<poiBX2.size();pos++) {
|
||||
endB.add(String.valueOf(poiBX2.get(pos)));
|
||||
}
|
||||
List<String> beginG = new LinkedList<>();
|
||||
for(int pos=1;pos<=poiGY1.size();pos++) {
|
||||
beginG.add(String.valueOf(poiGY1.get(pos)));
|
||||
}
|
||||
List<String> endG = new LinkedList<>();
|
||||
for(int pos=0;pos<poiGY2.size();pos++) {
|
||||
endG.add(String.valueOf(poiGY2.get(pos)));
|
||||
}
|
||||
//ratios
|
||||
List<String> ratio_id = sourceData.ratio_id;
|
||||
List<String> ROI_num_highter_G_energy_ROI = sourceData.ROI_num_highter_G_energy_ROI;
|
||||
List<String> ROI_num_lower_G_energy_ROI = sourceData.ROI_num_lower_G_energy_ROI;
|
||||
List<Double> count_ratio = sourceData.count_ratio;
|
||||
List<Double> count_ratio_uncertainty = sourceData.count_ratio_uncertainty;
|
||||
List<String> countRatioList = new LinkedList<>();
|
||||
for(int pos=0;pos<count_ratio.size();pos++) {
|
||||
countRatioList.add(String.valueOf(count_ratio.get(pos)));
|
||||
}
|
||||
List<String> countRatioUncertaintyList = new LinkedList<>();
|
||||
for(int pos=0;pos<count_ratio_uncertainty.size();pos++) {
|
||||
countRatioUncertaintyList.add(String.valueOf(count_ratio_uncertainty.get(pos)));
|
||||
}
|
||||
//bg_efficiency
|
||||
List<Double> bg_efficiency = sourceData.bg_efficiency;
|
||||
List<String> nuclide_name = sourceData.nuclide_name;
|
||||
List<String> ROI_number = sourceData.ROI_number;
|
||||
List<Double> uncertainty = sourceData.uncertainty;
|
||||
List<String> efficiencyList = new LinkedList<>();
|
||||
for(int pos=0;pos<bg_efficiency.size();pos++) {
|
||||
efficiencyList.add(String.valueOf(bg_efficiency.get(pos)));
|
||||
}
|
||||
List<String> uncertaintyList = new LinkedList<>();
|
||||
for(int pos=0;pos<uncertainty.size();pos++) {
|
||||
uncertaintyList.add(String.valueOf(uncertainty.get(pos)));
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (Objects.nonNull(sampleTmp)) {
|
||||
sampleTmp.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4203,6 +4258,59 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
//将ftp文件的输入流复制给临时文件
|
||||
FileUtils.copyInputStreamToFile(inputStream, file);
|
||||
}
|
||||
//加载动态库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
//读取文件内容
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
//获取文件中块名信息
|
||||
List<String> readLines = getFileBlockList(file);
|
||||
//查询台站id
|
||||
Integer stationId = spectrumAnalysisMapper.getStationId(sourceData.site_code);
|
||||
Integer detectorId = spectrumAnalysisMapper.getDetectorId(sourceData.detector_code);
|
||||
if(Objects.isNull(stationId) || Objects.isNull(detectorId)) {
|
||||
String error = "get station_id or detect_id error";
|
||||
return false;
|
||||
}
|
||||
//新增Gards_Sample_Data表数据
|
||||
sampleDataSpectrumService.saveSampleData(sourceData, stationId, detectorId, filePathName, readLines);
|
||||
//获取sampleId
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleId(filePathName);
|
||||
//存储Gards_Sample_Aux表数据
|
||||
sampleAuxSpectrumService.saveSampleAux(sourceData, sampleId, readLines);
|
||||
//判断文件是否包含Comment块 新增Gards_Description数据
|
||||
if (readLines.contains(SampleFileHeader.COMMENT.getMessage())){
|
||||
sampleDescriptionSpectrumService.saveSampleDescription(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含Certificate块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.CERTIFICATE.getMessage())){
|
||||
sampleCertSpectrumService.saveSampleCert(sourceData, sampleId);
|
||||
sampleCertLineSpectrumService.saveSampleCertLine(sourceData, sampleId);
|
||||
}
|
||||
//新增Gards_Calibration_Pairs_Orig数据
|
||||
calibrationPairsOrigSpectrumService.saveGardsCalibrationPairsOrig(sourceData, sampleId, readLines);
|
||||
//判断文件是否包含b-gEfficiency块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.BGEFFICIENCY.getMessage())){
|
||||
bgEfficiencyPairsSpectrumService.saveBgEfficiencyPairs(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含TotalEff块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.TOTALEFF.getMessage())){
|
||||
totalEfficiencyPairsSpectrumService.saveTotalEfficiencyPairs(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含Ratios块 新增Gards_Sample_Ratios数据
|
||||
if (readLines.contains(SampleFileHeader.RATIOS.getMessage())){
|
||||
sampleRatiosSpectrumService.saveSampleRatios(sourceData, sampleId);
|
||||
}
|
||||
//判断是否包含ROI_Limits块 新增Gards_ROI_Limits数据
|
||||
if (readLines.contains(SampleFileHeader.ROILIMITS.getMessage())){
|
||||
roiLimitsSpectrumService.saveRoiLimits(sourceData, sampleId);
|
||||
}
|
||||
//新增Gards_Spectrum数据
|
||||
spectrumService.saveSpectrum(sourceData, sampleId, readLines, filePathName);
|
||||
//判断是否包含Histogram块 新增Gards_Histogram数据
|
||||
if (readLines.contains(SampleFileHeader.HISTOGRAM.getMessage())){
|
||||
histogramService.saveHistogram(sourceData, sampleId, filePathName);
|
||||
}
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
} finally {
|
||||
|
@ -4213,63 +4321,13 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService {
|
|||
if (Objects.nonNull(inputStream)){
|
||||
inputStream.close();
|
||||
}
|
||||
if (Objects.nonNull(file)) {
|
||||
file.delete();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
//加载动态库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
//读取文件内容
|
||||
EnergySpectrumStruct sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath());
|
||||
//获取文件中块名信息
|
||||
List<String> readLines = getFileBlockList(file);
|
||||
//查询台站id
|
||||
Integer stationId = spectrumAnalysisMapper.getStationId(sourceData.site_code);
|
||||
Integer detectorId = spectrumAnalysisMapper.getDetectorId(sourceData.detector_code);
|
||||
if(Objects.isNull(stationId) || Objects.isNull(detectorId)) {
|
||||
String error = "get station_id or detect_id error";
|
||||
return false;
|
||||
}
|
||||
//新增Gards_Sample_Data表数据
|
||||
sampleDataSpectrumService.saveSampleData(sourceData, stationId, detectorId, filePathName, readLines);
|
||||
//获取sampleId
|
||||
Integer sampleId = spectrumAnalysisMapper.getSampleId(filePathName);
|
||||
//存储Gards_Sample_Aux表数据
|
||||
sampleAuxSpectrumService.saveSampleAux(sourceData, sampleId, readLines);
|
||||
//判断文件是否包含Comment块 新增Gards_Description数据
|
||||
if (readLines.contains(SampleFileHeader.COMMENT.getMessage())){
|
||||
sampleDescriptionSpectrumService.saveSampleDescription(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含Certificate块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.CERTIFICATE.getMessage())){
|
||||
sampleCertSpectrumService.saveSampleCert(sourceData, sampleId);
|
||||
sampleCertLineSpectrumService.saveSampleCertLine(sourceData, sampleId);
|
||||
}
|
||||
//新增Gards_Calibration_Pairs_Orig数据
|
||||
calibrationPairsOrigSpectrumService.saveGardsCalibrationPairsOrig(sourceData, sampleId, readLines);
|
||||
//判断文件是否包含b-gEfficiency块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.BGEFFICIENCY.getMessage())){
|
||||
bgEfficiencyPairsSpectrumService.saveBgEfficiencyPairs(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含TotalEff块 新增Gards_Sample_Cert数据
|
||||
if (readLines.contains(SampleFileHeader.TOTALEFF.getMessage())){
|
||||
totalEfficiencyPairsSpectrumService.saveTotalEfficiencyPairs(sourceData, sampleId);
|
||||
}
|
||||
//判断文件是否包含Ratios块 新增Gards_Sample_Ratios数据
|
||||
if (readLines.contains(SampleFileHeader.RATIOS.getMessage())){
|
||||
sampleRatiosSpectrumService.saveSampleRatios(sourceData, sampleId);
|
||||
}
|
||||
//判断是否包含ROI_Limits块 新增Gards_ROI_Limits数据
|
||||
if (readLines.contains(SampleFileHeader.ROILIMITS.getMessage())){
|
||||
roiLimitsSpectrumService.saveRoiLimits(sourceData, sampleId);
|
||||
}
|
||||
//新增Gards_Spectrum数据
|
||||
spectrumService.saveSpectrum(sourceData, sampleId, readLines, filePathName);
|
||||
//判断是否包含Histogram块 新增Gards_Histogram数据
|
||||
if (readLines.contains(SampleFileHeader.HISTOGRAM.getMessage())){
|
||||
histogramService.saveHistogram(sourceData, sampleId, filePathName);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public List<String> getFileBlockList(File file) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user