package cgmblelib.ble.entity;

import cgmblelib.database.entity.PocGlucose;

/**
 *
 * @author minyuchun
 * @date 2019/10/21
 * 算法计算回调类
 */
public class AlgorithmCallBack {
    /**
     * 丢失数据
     * 1.当glucoseId > 0 时 不存在上一个点,
     */
    public static final int DATA_LOST = - 3;
    /**算法版本错误*/
    public static final int ERROR_ALGORITHM = - 5;
    /**传入算法的数据错误*/
    public static final int ERROR_DATA = - 6;
    /**成功算法*/
    public static final int SUCCESS = 0;

    /**成功算法*/
    public static final int SUCCESS_UPDATE = 2;
    /**网络丢失*/
    public static final int ONLINE_LOST = -7;
    /**
     * 数据重复
     * 当前点的数据数据库中已存在,重新发送数据获取command
     */
    public static final int DATA_REPEAT = 1;

    private int errorCode;

    private PocGlucose mGlucose;

    public AlgorithmCallBack(int errorCode, PocGlucose glucose) {
        this.errorCode = errorCode;
        mGlucose = glucose;
    }

    public int getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    public PocGlucose getGlucose() {
        return mGlucose;
    }

    public void setGlucose(PocGlucose glucose) {
        mGlucose = glucose;
    }


    @Override
    public String toString() {
        return "AlgorithmCallBack{" +
                "errorCode=" + errorCode +
                ", mGlucose=" + mGlucose.toString() +
                '}';
    }
}
