|
|
@@ -1,6 +1,7 @@
|
|
|
package com.lc.ibps.components.verification.model2;
|
|
|
|
|
|
import com.lc.ibps.components.verification.model.InspectionConfigVO;
|
|
|
+import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.apache.commons.math3.stat.StatUtils;
|
|
|
import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics;
|
|
|
|
|
|
@@ -58,19 +59,23 @@ public class PrecisionEP15Item {
|
|
|
|
|
|
private final double p;//0.01 or 0.05
|
|
|
|
|
|
- public PrecisionEP15Item(String name, double[][] data, InspectionConfigVO configVO) {
|
|
|
- this.name = name;
|
|
|
+ public PrecisionEP15Item(int index, double[][] data, InspectionConfigVO configVO) {
|
|
|
+ this.name = configVO.getSpecimensName()[index];
|
|
|
this.data = data;
|
|
|
this.n = configVO.getRepeatNum();
|
|
|
this.allowableCVr = configVO.getBatchCVSValue();
|
|
|
this.allowableCVl = configVO.getDailyCVSValue();
|
|
|
- this.allowableSDr = configVO.getAllowableSDr();
|
|
|
- this.allowableSDl = configVO.getAllowableSDl();
|
|
|
+ if(ArrayUtils.isNotEmpty(configVO.getAllowableSDr())) {
|
|
|
+ this.allowableSDr = configVO.getAllowableSDr()[index];
|
|
|
+ }
|
|
|
+ if(ArrayUtils.isNotEmpty(configVO.getAllowableSDl())) {
|
|
|
+ this.allowableSDl = configVO.getAllowableSDl()[index];
|
|
|
+ }
|
|
|
|
|
|
this.level = configVO.getSpecimensNum();
|
|
|
- int range = configVO.getRange();
|
|
|
- if (range > 0 && range < 100) {
|
|
|
- this.p = (double) (100 - range) / 100;
|
|
|
+ int rate = configVO.getRejectionRate();
|
|
|
+ if (rate > 0 && rate < 100) {
|
|
|
+ this.p = (double) (rate / 100);
|
|
|
} else {
|
|
|
this.p = 0.01;
|
|
|
}
|
|
|
@@ -255,7 +260,7 @@ public class PrecisionEP15Item {
|
|
|
double d = data.length;
|
|
|
|
|
|
// double cr = PVModel.getCValue(df, level, 0.05);
|
|
|
- verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, 0.05) / df);
|
|
|
+ verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, p) / df);
|
|
|
|
|
|
//t=((((C14-1)*(C16^2))+(C14*M11))^2)/(((C14-1)/C13*(C16^4))+(((C14^2)*(M11^2))/(C13-1)))
|
|
|
t = (Math.pow((((n - 1) * (Math.pow(sdr, 2))) + (n * vb)), 2)) / (((n - 1) / d * (Math.pow(sdr, 4))) + (((Math.pow(n, 2)) * (Math.pow(vb, 2))) / (d - 1)));
|