whycxzp
2023-12-20 14912f45bdce261601e1476b8bd4a3a502d09d52
src/main/java/com/whyc/util/MathUtil.java
@@ -25,22 +25,33 @@
        double σ = Math.sqrt(s.doubleValue());
        return BigDecimal.valueOf(σ).setScale(4, RoundingMode.HALF_UP).floatValue();
    }
    //评判整组的好坏flag:1 电压; 2 内阻;3 连接条
    public static String getJudge(float minStd, float std, TestParam testParam){
        String judge="未知";
    //评判整组的好坏flag:1差,2良,3优 电压; 内阻越大越不好
    public static int getflag(float maxStd, float std, TestParam testParam){
        int flag=0;
        float judgeStdLow=0f;
        float judgeStdHigh=0f;
        maxStd=maxStd*100;
        if (testParam!=null){
            judgeStdLow=std*testParam.getResGoodCoeK3();
            judgeStdHigh=std*testParam.getResBadCoeK4();
            if(minStd<=judgeStdLow){
                judge="差";
            }else if(minStd<=judgeStdHigh){
                judge="良";
            if(maxStd>=judgeStdHigh){
                flag=1;//"差"
            }else if(maxStd>=judgeStdLow){
                flag=2;//"良";
            }else{
                judge="优";
                flag=3;//"优";
            }
        }
        return flag;
    }
    //评判整组的好坏flag:1 电压; 内阻越大越不好
    public static String getJudge(int flag){
        String judge="未知";
        switch (flag){
            case 1:judge="差";break;
            case 2:judge="良";break;
            case 3:judge="优";break;
        }
        return judge;
    }