From 6a456f7b8fbde1dc69ff9f352bb0bd2e61a756b2 Mon Sep 17 00:00:00 2001 From: qiaoqinzheng Date: Wed, 18 Oct 2023 14:59:02 +0800 Subject: [PATCH] =?UTF-8?q?Beta=E6=96=B0=E5=A2=9EExtrapolation=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SpectrumAnalysesController.java | 2 +- .../jeecg/modules/entity/vo/TableExtData.java | 18 ++++ .../impl/SpectrumAnalysisServiceImpl.java | 83 ++++++++++--------- 3 files changed, 65 insertions(+), 38 deletions(-) create mode 100644 jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/TableExtData.java diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java index 2236dfd9..725beb56 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/controller/SpectrumAnalysesController.java @@ -151,7 +151,7 @@ public class SpectrumAnalysesController { //todo--功能不明确待完成 @PostMapping("analyseExtrapolation") public Result analyseExtrapolation(@RequestBody AnalyseExtInfo extInfo, HttpServletRequest request) { - return null; + return spectrumAnalysisService.analyseExtrapolation(extInfo, request); } @GetMapping("viewMDC") diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/TableExtData.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/TableExtData.java new file mode 100644 index 00000000..43059fa8 --- /dev/null +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/entity/vo/TableExtData.java @@ -0,0 +1,18 @@ +package org.jeecg.modules.entity.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class TableExtData implements Serializable { + + private Integer index; + + private Double eb; + + private Double nx; + + private Double ny; + +} diff --git a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java index be792cf6..d406e3c1 100644 --- a/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java +++ b/jeecg-module-spectrum-analysis/src/main/java/org/jeecg/modules/service/impl/SpectrumAnalysisServiceImpl.java @@ -2266,12 +2266,11 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { } for(int i=0;i1) { + functionFit = String.format("Y = %f*X + %f ", fittingPara.get(0), fittingPara.get(1)); + } } else if(fittype.equals("poly2")) { for(int i=1;i<51;i++) { SeriseData temp = new SeriseData(); @@ -2304,43 +2305,51 @@ public class SpectrumAnalysisServiceImpl implements ISpectrumAnalysisService { temp.setY(rData.get(0)); line_serise_data.add(temp); } -// fittingTitle = RESULT_FITTING_2_TITLE; -// fittingDataFormat = tempStr.sprintf(RESULT_FITTING_2_DATA,fittingPara.at(0),fittingPara.at(1),fittingPara.at(2)); + functionFit = "Y = A+ B*X + C*X^2 "; + if (scatter_serise_data.size()>1) { + functionFit = String.format("Y = %f+ %f*X + C*%f^2 ",fittingPara.get(0),fittingPara.get(1),fittingPara.get(2)); + } } else if(fittype.equals("poly3")) { -// fittingTitle = RESULT_FITTING_3_TITLE; -// fittingDataFormat = RESULT_FITTING_3_DATA; - + functionFit = "Y = A+ B*X + C*X^2 +D*X^3 "; + } + List extDataList = new LinkedList<>(); + for(int i=0;i1) { + refTime = String.format("Reference Time: %s ",sampleTmp.acquisition_start_date+" "+sampleTmp.acquisition_start_time); + xeAct = String.format("Xe Activity (Bq): %f", Xe_activity); + } + map.put("tableData", extDataList); + map.put("functionFit", functionFit); + map.put("refTime", refTime); + map.put("xeAct", xeAct); + map.put("resultViewScatterDataValue", scatter_serise_data); + map.put("resultViewLineDataValue", line_serise_data); + if(maxLeft<=0||maxBottom<=0||scatter_serise_data.size()<=1) { + result.setSuccess(true); + result.setResult(map); + return result; + } + if(maxLeft<4) { + map.put("leftFormat", "%f"); + } else { + map.put("leftFormat", "%i"); } -// String resultText = ""; -// resultText+=RESULT_TITLE; -// resultText+=tempStr.sprintf(RESULT_DATA_TITLE); -// for(int i=0;ilabel_acquisition_start_show->text().toStdString().c_str(),Xe_activity); -// if(maxLeft<=0||maxBottom<=0||scatter_serise_data.size()<=1) { -// return result; -// } -// if(maxLeft<4) { -// m_extraResult.SetLeftFormat(QLatin1String("%f")); -// } else { -// m_extraResult.SetLeftFormat(QLatin1String("%i")); -// } maxBottom+=1; maxLeft*=1.5; minLeft-=1.5; -// m_extraResult.SetResultText(resultText); -// m_extraResult.SetResultViewLeftRange(0,maxLeft); -// m_extraResult.SetResultVIewBottomRange(minLeft,maxBottom); -// m_extraResult.SetResultViewScatterDataValue(scatter_serise_data); -// m_extraResult.SetResultViewLineDataValue(line_serise_data); - - - return null; + result.setSuccess(true); + result.setResult(map); + return result; } private List handleHistogram(List hcounts, long bChannels, long gChannels, String type) {