diff --git a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java index 45c633d5..4ed1076b 100644 --- a/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java +++ b/jeecg-module-beta-gamma-analyser/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java @@ -236,7 +236,7 @@ public class EnergySpectrumStruct { /** * γ -nuclide */ - public List g_e_nuclide; + public List g_e_nuclide_name; /** * γ -energy (keV) */ @@ -254,12 +254,13 @@ public class EnergySpectrumStruct { /************************* g_Efficiency Block ******************/ /** - * β -energy (keV) + * γ -nuclide */ - public List b_e_energy; + public List b_e_nuclide_name; /** * efficiency (counts in peak/photon emitted) */ + public List b_e_energy; public List b_e_efficiency; /** * uncertainty (counts in peak/photon emitted) diff --git a/jeecg-module-web-statistics/pom.xml b/jeecg-module-web-statistics/pom.xml index c0ea9bb1..2d393d7e 100644 --- a/jeecg-module-web-statistics/pom.xml +++ b/jeecg-module-web-statistics/pom.xml @@ -16,6 +16,10 @@ org.jeecgframework.boot jeecg-boot-base-core + + org.jeecgframework.boot + jeecg-module-beta-gamma-analyser + diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/GEfficiency.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/GEfficiency.java index 3ec3ce2d..7d36692a 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/GEfficiency.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/GEfficiency.java @@ -7,6 +7,8 @@ import java.io.Serializable; @Data public class GEfficiency implements Serializable { + private String nuclideName; + private Double energy; private Double efficiency; diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/Report.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/Report.java index 7d171692..ad1f6a2d 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/Report.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/entity/data/Report.java @@ -28,6 +28,8 @@ public class Report implements Serializable { private List bgEfficiencyBlock; + private List bEfficiencyBlock; + private List roiLimitsBlock; private List ratiosBlock; diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java deleted file mode 100644 index bb3b6681..00000000 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/EnergySpectrumHandler.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.jeecg.modules.native_jni; - -import org.jeecg.modules.native_jni.struct.EnergySpectrumStruct; - -/** - * 能谱处理本地类 - */ -public class EnergySpectrumHandler { - - /** - * 获取能谱原始数据 - * @param path 能谱文件路径 - * @return 能谱原始数据 - */ - public static native EnergySpectrumStruct getSourceData(String path); - -} diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java deleted file mode 100644 index 3f31475c..00000000 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/native_jni/struct/EnergySpectrumStruct.java +++ /dev/null @@ -1,559 +0,0 @@ -package org.jeecg.modules.native_jni.struct; - -import lombok.Data; - -import java.util.List; - -/** - * 能谱结构体字段信息 - */ -@Data -public class EnergySpectrumStruct { -/************************* Infomations ******************/ - /** - * 消息类型 - */ - public String msg_type; - /** - * 消息id - */ - public String msg_id; - /** - * 数据类型 - */ - public String data_type; - - /************************* Header Black ******************/ - /** - * designator - */ - public String designator; - /** - * site code - */ - public String site_code; - /** - * detector code - */ - public String detector_code; - /** - * system type: P for particulate; B for gas with 3-D β - γ coincidence detection; and - */ - public String system_type; - /** - * sample geometry - */ - public String sample_geometry; - /** - * spectrum qualifier: preliminary ( PREL )or full ( FULL) - */ - public String spectrum_quantity; - /** - * sample reference identification - */ - public String sample_ref_id; - /** - * measurement identification - */ - public String measurement_id; - /** - * detector background measurement identification - */ - public String detector_bk_measurement_id; - /** - * gas background measurement identification (memory effect) - */ - public String gas_bk_measurement_id; - /** - * transmit date (yyyy / mm / dd) - */ - public String transmit_date; - /** - * transmit time (hh : mm : ss . s) - */ - public String transmit_time; - - /************************* Sample ******************/ - public double dimension_1; - public double dimension_2; - - /************************* Comment ******************/ - public String comment; - - /************************* Acquisition Block ******************/ - /** - * acquisition start date (yyyy / mm / dd) - */ - public String acquisition_start_date; - /** - * acquisition start time (hh : mm : ss . s) - */ - public String acquisition_start_time; - /** - * acquisition real time (s) - */ - public double acquisition_real_time; - /** - * acquisition live time (s) - */ - public double acquisition_live_time; - - /************************* Collection Block ******************/ - - /** - * collection start date (yyyy / mm / dd) - */ - public String collection_start_date; - /** - * collection start time (hh : mm : ss . s) - */ - public String collection_start_time; - /** - * collection stop date (yyyy / mm / dd) - */ - public String collection_stop_date; - /** - * collection stop time (hh : mm : ss . s) - */ - public String collection_stop_time; - /** - * total air volume sampled (standard cubic meters [scm]) - */ - public double air_volume; - - /************************* Processing Block ******************/ - /** - * sample volume of Xe (cm 3 ) - */ - public double sample_volume_of_Xe; - /** - * uncertainty (cm 3 ) - */ - public double uncertainty_1; - /** - * Xe collection yield (Xe gas in sample/total Xe gas sampled) - */ - public double Xe_collection_yield; - /** - * uncertainty (Xe gas in sample/total Xe gas sampled) - */ - public double uncertainty_2; - /** - * archive bottle identification - */ - public String archive_bottle_id; - - /************************* Calibration Block ******************/ - /** - * date of last calibration (yyyy / mm / dd) - */ - public String date_calibration; - /** - * time of last calibration (hh : mm : ss) - */ - public String time_calibration; - - /************************* g_Energy Block ******************/ - /** - * γ -energy (keV) - */ - public List g_energy; - /** - * centroid channel - */ - public List g_centroid_channel; - /** - * uncertainty (channels) - */ - public List g_uncertainty; - - public int g_record_count; - - /************************* b_Energy Block ******************/ - /** - * electron energy (keV) - */ - public List b_electron_energy; - /** - * decay mode descriptor: B for β-particle, C for conversion electron (CE) - */ - public List b_decay_mode; - /** - * maximum channel of β-particle distribution or centroid channel of CE (channels) - */ - public List b_channel; - /** - * uncertainty (channels) - */ - public List b_uncertainty; - - public int b_record_count; - - /************************* g_Resolution Block ******************/ - /** - * γ -energy (keV) - */ - public List g_r_energy; - /** - * FWHM (keV) - */ - public List g_r_FWHM; - /** - * uncertainty (keV) - */ - public List g_r_uncertainty; - - public int g_r_record_count; - - /************************* b_Resolution Block ******************/ - /** - * electron energy (keV) - */ - public List b_r_electron_energy; - /** - * FWHM (keV) - */ - public List b_r_FWHM; - /** - * uncertainty (keV) - */ - public List b_r_uncertainty; - - public int b_r_record_count; - - /************************* g_Efficiency Block ******************/ - /** - * γ -nuclide - */ - public List g_e_nuclide; - /** - * γ -energy (keV) - */ - public List g_e_energy; - /** - * efficiency (counts in peak/photon emitted) - */ - public List g_e_efficiency; - /** - * uncertainty (counts in peak/photon emitted) - */ - public List g_e_uncertainty; - - public int g_e_record_count; - - /************************* ROI_Limits Block ******************/ - /** - * ROI number - */ - public List ROI_number; - /** - * 2-D ROI β-range start, x 1 (keV) - */ - public List POI_B_x1; - /** - * 2-D ROI β-range stop, x 2 (keV) - */ - public List POI_B_x2; - /** - * 2-D ROI γ-range start, y 1 (keV) - */ - public List POI_G_y1; - /** - * 2-D ROI γ-range stop, y 2 (keV) - */ - public List POI_G_y2; - - public int roi_record_count; - - /************************* b-gEfficiency Block ******************/ - /** - * nuclide name - */ - public List bg_nuclide_name; - /** - * ROI number - */ - public List bg_ROI_number; - /** - * β-γ coincidence efficiency (counts in ROI/β-γ pair emitted) - */ - public List bg_efficiency; - /** - * uncertainty (counts in ROI/β-γ pair emitted) - */ - public List bg_uncertainty; - - public int bg_record_count; - - /************************* Ratios Block ******************/ - /** - * ratio identifier - */ - public List ratio_id; - /** - * ROI number for the higher γ -energy ROI - */ - public List ROI_num_highter_G_energy_ROI; - /** - * ROI number for the lower γ -energy ROI - */ - public List ROI_num_lower_G_energy_ROI; - /** - * Q_DECLARE_METATYPE(RMSSOHData::HeaderBlock)count ratio(counts in higher γ -energy ROI/counts in lower γ -energy ROI) - */ - public List count_ratio; - /** - * count ratio uncertainty (percent) - */ - public List count_ratio_uncertainty; - - public int ratio_record_count; - - /************************* g_Spectrum Block ******************/ - /** - * number of γ channels - */ - public long num_g_channel; - /** - * γ-energy span (keV) - */ - public long g_energy_span; - /** - * begin of channels - */ - public long g_begin_channel; - /** - * count at channel - */ - public List g_counts; - - /************************* b_Spectrum Block ******************/ - /** - * number of β -channels - */ - public long num_b_channel; - /** - * β -energy span (keV) - */ - public long b_energy_span; - /** - * begin of channels - */ - public long b_begin_channel; - /** - * counts at channels - */ - public List b_counts; - - /************************* Histogram Block ******************/ - /** - * β-channels - */ - public long b_channels; - /** - * γ-channels - */ - public long g_channels; - /** - * β-energy span - */ - public long b_h_energy_span; - /** - * γ-energy span - */ - public long g_h_energy_span; - /** - * counts at channels - */ - public List h_counts; - - /************************* Certificate_Block ******************/ - /** - * total source activity (Bq) - */ - public double total_source_activity; - /** - * assay date (yyyy / mm / dd) - */ - public String assay_date; - /** - * assay time (hh : mm : ss) - */ - public String assay_time; - /** - * units of activity: “B,” “b” for Bq or “[blank]”; if nothing, then “B” is assigned - */ - public String units_activity; - /** - * nuclide name - */ - public List nuclide_name; - /** - * half-life in seconds, hours, days, or years - */ - public List half_life_time; - /** - * time unit(Y, D, H, S) - */ - public List time_unit; - /** - * activity of nuclide at time of assay - */ - public List activity_nuclide_time_assay; - /** - * uncertainty (%) - */ - public List uncertainty; - /** - * γ-energy (keV) - */ - public List cer_g_energy; - /** - * γ-intensity (percent) - */ - public List g_intensity; - /** - * electron decay mode descriptor: B for β particle or C for conversion electron (CE), 0 for none (that is, γ-only source) - */ - public List electron_decay_mode; - /** - * maximum β-particle energy or CE energy (keV) - */ - public List maximum_energy; - /** - * intensity of β-particle (percent) - */ - public List intensity_b_particle; - - public int record_count; - - /************************* Totaleff Block ******************/ - /** - * γ-energy (keV) - */ - public List t_g_energy; - /** - * total efficiency (counts/photon emitted) - */ - public List total_efficiency; - /** - * uncertainty (counts/photon emitted) - */ - public List t_uncertainty; - - public int t_record_count; - - public EnergySpectrumStruct() { - super(); - } - - @Override - public String toString() { - return "EnergySpectrumStruct{" + - "msg_type='" + msg_type + '\'' + - ", msg_id='" + msg_id + '\'' + - ", data_type='" + data_type + '\'' + - ", designator='" + designator + '\'' + - ", site_code='" + site_code + '\'' + - ", detector_code='" + detector_code + '\'' + - ", system_type='" + system_type + '\'' + - ", sample_geometry='" + sample_geometry + '\'' + - ", spectrum_quantity='" + spectrum_quantity + '\'' + - ", sample_ref_id='" + sample_ref_id + '\'' + - ", measurement_id='" + measurement_id + '\'' + - ", detector_bk_measurement_id='" + detector_bk_measurement_id + '\'' + - ", gas_bk_measurement_id='" + gas_bk_measurement_id + '\'' + - ", transmit_date='" + transmit_date + '\'' + - ", transmit_time='" + transmit_time + '\'' + - ", comment='" + comment + '\'' + - ", acquisition_start_date='" + acquisition_start_date + '\'' + - ", acquisition_start_time='" + acquisition_start_time + '\'' + - ", acquisition_real_time=" + acquisition_real_time + - ", acquisition_live_time=" + acquisition_live_time + - ", collection_start_date='" + collection_start_date + '\'' + - ", collection_start_time='" + collection_start_time + '\'' + - ", collection_stop_date='" + collection_stop_date + '\'' + - ", collection_stop_time='" + collection_stop_time + '\'' + - ", air_volume=" + air_volume + - ", sample_volume_of_Xe=" + sample_volume_of_Xe + - ", uncertainty_1=" + uncertainty_1 + - ", Xe_collection_yield=" + Xe_collection_yield + - ", uncertainty_2=" + uncertainty_2 + - ", archive_bottle_id='" + archive_bottle_id + '\'' + - ", date_calibration='" + date_calibration + '\'' + - ", time_calibration='" + time_calibration + '\'' + - ", g_energy=" + g_energy + - ", g_centroid_channel=" + g_centroid_channel + - ", g_uncertainty=" + g_uncertainty + - ", g_record_count=" + g_record_count + - ", b_electron_energy=" + b_electron_energy + - ", b_decay_mode=" + b_decay_mode + - ", b_channel=" + b_channel + - ", b_uncertainty=" + b_uncertainty + - ", b_record_count=" + b_record_count + - ", g_r_energy=" + g_r_energy + - ", g_r_FWHM=" + g_r_FWHM + - ", g_r_uncertainty=" + g_r_uncertainty + - ", g_r_record_count=" + g_r_record_count + - ", b_r_electron_energy=" + b_r_electron_energy + - ", b_r_FWHM=" + b_r_FWHM + - ", b_r_uncertainty=" + b_r_uncertainty + - ", b_r_record_count=" + b_r_record_count + - ", g_e_energy=" + g_e_energy + - ", g_e_efficiency=" + g_e_efficiency + - ", g_e_uncertainty=" + g_e_uncertainty + - ", g_e_record_count=" + g_e_record_count + - ", ROI_number=" + ROI_number + - ", POI_B_x1=" + POI_B_x1 + - ", POI_B_x2=" + POI_B_x2 + - ", POI_G_y1=" + POI_G_y1 + - ", POI_G_y2=" + POI_G_y2 + - ", roi_record_count=" + roi_record_count + - ", bg_nuclide_name=" + bg_nuclide_name + - ", bg_ROI_number=" + bg_ROI_number + - ", bg_efficiency=" + bg_efficiency + - ", bg_uncertainty=" + bg_uncertainty + - ", bg_record_count=" + bg_record_count + - ", ratio_id=" + ratio_id + - ", ROI_num_highter_G_energy_ROI=" + ROI_num_highter_G_energy_ROI + - ", ROI_num_lower_G_energy_ROI=" + ROI_num_lower_G_energy_ROI + - ", count_ratio=" + count_ratio + - ", count_ratio_uncertainty=" + count_ratio_uncertainty + - ", ratio_record_count=" + ratio_record_count + - ", num_g_channel=" + num_g_channel + - ", g_energy_span=" + g_energy_span + - ", g_begin_channel=" + g_begin_channel + - ", g_counts=" + g_counts + - ", num_b_channel=" + num_b_channel + - ", b_energy_span=" + b_energy_span + - ", b_begin_channel=" + b_begin_channel + - ", b_counts=" + b_counts + - ", b_channels=" + b_channels + - ", g_channels=" + g_channels + - ", b_h_energy_span=" + b_h_energy_span + - ", g_h_energy_span=" + g_h_energy_span + - ", h_counts=" + h_counts + - ", total_source_activity=" + total_source_activity + - ", assay_date='" + assay_date + '\'' + - ", assay_time='" + assay_time + '\'' + - ", units_activity='" + units_activity + '\'' + - ", nuclide_name=" + nuclide_name + - ", half_life_time=" + half_life_time + - ", time_unit=" + time_unit + - ", activity_nuclide_time_assay=" + activity_nuclide_time_assay + - ", uncertainty=" + uncertainty + - ", cer_g_energy=" + cer_g_energy + - ", g_intensity=" + g_intensity + - ", electron_decay_mode=" + electron_decay_mode + - ", maximum_energy=" + maximum_energy + - ", intensity_b_particle=" + intensity_b_particle + - ", record_count=" + record_count + - '}'; - } - - public static void main(String[] args) { - EnergySpectrumStruct s = new EnergySpectrumStruct(); - System.out.println(s); - System.out.println(s.gas_bk_measurement_id); - } -} diff --git a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataWebServiceImpl.java b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataWebServiceImpl.java index 6f3eb318..235632d7 100644 --- a/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataWebServiceImpl.java +++ b/jeecg-module-web-statistics/src/main/java/org/jeecg/modules/service/impl/GardsSampleDataWebServiceImpl.java @@ -28,7 +28,6 @@ import org.jeecg.modules.base.enums.SystemType; import org.jeecg.modules.base.enums.XeNuclideName; import org.jeecg.modules.entity.GardsSampleDataWeb; import org.jeecg.modules.entity.data.*; -import org.jeecg.modules.entity.dto.SampleDataDto; import org.jeecg.modules.entity.vo.SpectrumFileRecord; import org.jeecg.modules.mapper.*; import org.jeecg.modules.native_jni.EnergySpectrumHandler; @@ -135,7 +134,12 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl 1024 * 1024 * 4) { + sourceData = SelfBaseUtil.getSourceDataNotHis(file.getAbsolutePath()); + } else { + sourceData = EnergySpectrumHandler.getSourceData(file.getAbsolutePath()); + } //查询info this.findInfo(sampleId, report); //查询G_energy @@ -150,6 +154,7 @@ public class GardsSampleDataWebServiceImpl extends ServiceImpl(); for (int i=0; i(); for (int i=0; i bgEfficiencySubBlock = null; + if (CollectionUtils.isNotEmpty(sourceData.b_e_nuclide_name) && + CollectionUtils.isNotEmpty(sourceData.b_e_efficiency) && CollectionUtils.isNotEmpty(sourceData.b_e_uncertainty)){ + bgEfficiencySubBlock = new LinkedList<>(); + for (int i=0; i readValue(EnergySpectrumStruct sourceData) { List result = new LinkedList<>(); - if (CollectionUtils.isNotEmpty(sourceData.h_counts) && Objects.nonNull(sourceData.g_channels) && Objects.nonNull(sourceData.b_channels)) { - for (int i=0; i subList = sourceData.h_counts.subList((int) (i * sourceData.b_channels), (int) ((i + 1) * sourceData.b_channels)); - if (!"0".equals(String.valueOf(subList.get(j)))){ - HistogramData histogramData = new HistogramData(); - histogramData.setG(i); - histogramData.setB(j); - histogramData.setC(subList.get(j).intValue()); - result.add(histogramData); + if (!sourceData.system_type.equals("C")) { + if (CollectionUtils.isNotEmpty(sourceData.h_counts) && Objects.nonNull(sourceData.g_channels) && Objects.nonNull(sourceData.b_channels)) { + for (int i=0; i subList = sourceData.h_counts.subList((int) (i * sourceData.b_channels), (int) ((i + 1) * sourceData.b_channels)); + if (!"0".equals(String.valueOf(subList.get(j)))){ + HistogramData histogramData = new HistogramData(); + histogramData.setG(i); + histogramData.setB(j); + histogramData.setC(subList.get(j).intValue()); + result.add(histogramData); + } + } + } + } + } else { + if (null != sourceData.h_count_arr && Objects.nonNull(sourceData.g_channels) && Objects.nonNull(sourceData.b_channels)) { + for (int i=0; i 0){ + HistogramData his = new HistogramData(); + his.setG(i); + his.setB(j); + his.setC(count.intValue()); + result.add(his); + } } } } } + return result; }