Histogram取值修改
This commit is contained in:
parent
7ad22f79a1
commit
09e1d791d4
|
@ -28,7 +28,7 @@ public class PHDFileUtil {
|
|||
@Autowired
|
||||
private FTPUtil ftpUtil;
|
||||
|
||||
public Map<String, Object> getSourceData(String filePath, String fileName, List<GardsXeResults> xeDataList){
|
||||
public Map<String, Object> getSourceData(String filePath, String fileName, List<GardsXeResults> xeDataList, Integer sampleId, String status){
|
||||
//加载dll工具库
|
||||
System.loadLibrary("ReadPHDFile");
|
||||
EnergySpectrumStruct struct = EnergySpectrumHandler.getSourceData(filePath);
|
||||
|
@ -78,6 +78,8 @@ public class PHDFileUtil {
|
|||
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);
|
||||
|
@ -104,30 +106,22 @@ public class PHDFileUtil {
|
|||
List<HistogramData> histogramDataList = new LinkedList<>();
|
||||
List<HistogramData> histogramDataDList = new LinkedList<>();
|
||||
for (int i=0; i<bChannels; i++){
|
||||
//按照大小切割数组
|
||||
List<Long> list = null;
|
||||
if (i != bChannels-1){
|
||||
list = hCounts.subList((int) (i * bChannels), (int) ((i + 1) * bChannels));
|
||||
}else {
|
||||
list = hCounts.subList((int) (i * bChannels), hCounts.size());
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
for (int j=0; j< list.size(); j++){
|
||||
Long count = list.get(j);
|
||||
if (count > 0){
|
||||
HistogramData his = new HistogramData();
|
||||
his.setB(i);
|
||||
his.setG(j);
|
||||
his.setC(count);
|
||||
histogramDataList.add(his);
|
||||
histogramDataDList.add(his);
|
||||
}else {
|
||||
HistogramData his = new HistogramData();
|
||||
his.setB(i);
|
||||
his.setG(j);
|
||||
his.setC(count);
|
||||
histogramDataDList.add(his);
|
||||
}
|
||||
for (int j=0; j< gChannels; 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user