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) {