Просмотр исходного кода

性能验证模块 开发 (二期) / 重构相关模块

liyuan 2 лет назад
Родитель
Сommit
8349d38949

+ 18 - 0
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model/ConfigVO.java

@@ -12,6 +12,8 @@ public class ConfigVO {
     private double batchCVSValue;
     private double dailyCVS;
     private double dailyCVSValue;
+    private double allowableSDr;
+    private double allowableSDl;
     private int decimal;
 
     private double claimValue;
@@ -103,4 +105,20 @@ public class ConfigVO {
     public void setClaimValue(double claimValue) {
         this.claimValue = claimValue;
     }
+
+    public double getAllowableSDr() {
+        return allowableSDr;
+    }
+
+    public void setAllowableSDr(double allowableSDr) {
+        this.allowableSDr = allowableSDr;
+    }
+
+    public double getAllowableSDl() {
+        return allowableSDl;
+    }
+
+    public void setAllowableSDl(double allowableSDl) {
+        this.allowableSDl = allowableSDl;
+    }
 }

+ 31 - 11
ibps-provider-root/modules/provider-business/src/main/java/com/lc/ibps/components/verification/model2/PrecisionEP15Item.java

@@ -51,8 +51,10 @@ public class PrecisionEP15Item {
 
     private double t;
     private double c;
-    private double v;
+    private double verL;
+    private double verR;
     private final int level;
+    private int df;
 
     private final double p;//0.01 or 0.05
 
@@ -62,6 +64,9 @@ public class PrecisionEP15Item {
         this.n = configVO.getRepeatNum();
         this.allowableCVr = configVO.getDailyCVSValue();
         this.allowableCVl = configVO.getBatchCVSValue();
+        this.allowableSDr = configVO.getAllowableSDr();
+        this.allowableSDl = configVO.getAllowableSDl();
+
         this.level = configVO.getSpecimensNum();
         int range = configVO.getRange();
         if (range > 0 && range < 100) {
@@ -69,6 +74,7 @@ public class PrecisionEP15Item {
         } else {
             this.p = 0.01;
         }
+        this.df = configVO.getDays() * (configVO.getRepeatNum()-1);
         calculate();
     }
 
@@ -193,12 +199,20 @@ public class PrecisionEP15Item {
         this.c = c;
     }
 
-    public double getV() {
-        return v;
+    public double getVerL() {
+        return verL;
+    }
+
+    public void setVerL(double verL) {
+        this.verL = verL;
+    }
+
+    public double getVerR() {
+        return verR;
     }
 
-    public void setV(double v) {
-        this.v = v;
+    public void setVerR(double verR) {
+        this.verR = verR;
     }
 
     public void calculate() {
@@ -231,19 +245,25 @@ public class PrecisionEP15Item {
 
         cvr = (sdr / mean) * 100;
         cvl = (sdl / mean) * 100;
-
-        //实验室允许不精密度
-        allowableSDr = allowableCVr * mean / 100;
-        allowableSDl = allowableCVl * mean / 100;
+        if(allowableSDl == 0) {
+            //实验室允许不精密度
+            allowableSDr = allowableCVr * mean / 100;
+            allowableSDl = allowableCVl * mean / 100;
+        } else if (allowableCVr == 0) {
+            allowableCVr = 100*(allowableSDr/mean);
+            allowableCVl = 100*(allowableSDl/mean);
+        }
         double d = data.length;
 
+//        double cr = PVModel.getCValue(df, level, 0.05);
+        verR = allowableSDr * Math.sqrt(PVModel.getCValue(df, level, 0.05)/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)));
         c = PVModel.getCValue(t, level, 0.05);
-        double sdclarim = 3;
+        verL = allowableSDl * Math.sqrt(c / t);
 
-        v = sdclarim * Math.sqrt(c / t);
 
     }
+
 }