package com.mvc.model.aihcxd;

import com.mvc.recognition.AiConstant;
import com.mvc.utils.StringUtil;

/**
 * LED表免配置输出对象
 */
public class LedNoCfgOutModel {
    private String outImagePath;
    private String aiValue; //本次服务器AI识别结果
    private String decimalPoint;//小数点位置
    private String[][] debugInfo;//AI调试信息，值域是 0-255
    private String numNumbers;//水表数字个数,值域=[1-10]
    private String serverRotateAngle;//本次服务器识别到的旋转角度
    private String num_run_CNN;//本次识别运行模型的次数
    private String nummin0;//图片摆正后数字最小概率
    private String nummin1;//图片摆正后旋转180数字最小概率
    private String numpro;//数字概率
    private Integer[] serverNumberRegion;//本次服务器识别得到的数字区域坐标，4个值，[xmin,ymin,xmax,ymax]

    public String getOutImagePath() {
        return outImagePath;
    }

    public void setOutImagePath(String outImagePath) {
        this.outImagePath = outImagePath;
    }

    public String getAiValue() {
        return aiValue;
    }

    public void setAiValue(String aiValue) {
        this.aiValue = aiValue;
    }

    public String getDecimalPoint() {
        return decimalPoint;
    }

    public void setDecimalPoint(String decimalPoint) {
        this.decimalPoint = decimalPoint;
    }

    public String[][] getDebugInfo() {
        return debugInfo;
    }

    public void setDebugInfo(String[][] debugInfo) {
        this.debugInfo = debugInfo;
    }

    public String getNumNumbers() {
        return numNumbers;
    }

    public void setNumNumbers(String numNumbers) {
        this.numNumbers = numNumbers;
    }

    public String getServerRotateAngle() {
        return serverRotateAngle;
    }

    public void setServerRotateAngle(String serverRotateAngle) {
        this.serverRotateAngle = serverRotateAngle;
    }

    public String getNum_run_CNN() {
        return num_run_CNN;
    }

    public void setNum_run_CNN(String num_run_CNN) {
        this.num_run_CNN = num_run_CNN;
    }

    public String getNummin0() {
        return nummin0;
    }

    public void setNummin0(String nummin0) {
        this.nummin0 = nummin0;
    }

    public String getNummin1() {
        return nummin1;
    }

    public void setNummin1(String nummin1) {
        this.nummin1 = nummin1;
    }

    public String getNumpro() {
        return numpro;
    }

    public void setNumpro(String numpro) {
        this.numpro = numpro;
    }

    public Integer[] getServerNumberRegion() {
        return serverNumberRegion;
    }

    public void setServerNumberRegion(Integer[] serverNumberRegion) {
        this.serverNumberRegion = serverNumberRegion;
    }

    public int[][] getDebugInfo2() {
        //this.debugInfo2 = new Integer[debugInfo.length][debugInfo[0].length];
        try {
            int[][] intInfo = new int[debugInfo.length][debugInfo[0].length];
            String temp = "";
            for (int i = 0; i < debugInfo.length; i++) {
                // 注意这里我们创建了一个新的 int 数组，其长度等于当前行的字符串数量
                intInfo[i] = new int[debugInfo[i].length];
                for (int j = 0; j < debugInfo[i].length; j++) {
                    temp = debugInfo[i][j].trim();
                    if (StringUtil.isInteger(temp)) {
                        // 将字符串转换为整数，并存储到新数组中
                        intInfo[i][j] = Integer.parseInt(debugInfo[i][j].trim());
                    } else {//非法字符
                        // 将字符串转换为整数，并存储到新数组中
                        intInfo[i][j] = AiConstant.IMPOSSIBLE_VALUE;
                    }
                }
            }
            return intInfo;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return AiConstant.DEBUG_INFO;
    }

}
