package cgmblelib.Enum;


import com.mytatvarnsdk.R;

/**
 * Created by minyuchun on 2019/1/25.
 * enum show error of glucose
 * 血糖的状态 - 高血糖 - 低血糖 - 正常血糖 - 无状态
 *
 * @author minyuchun
 */

public enum enumGlucoseStatus {
    /**
     * 血糖点错误 无
     */
    NONE(0,
            R.color.black,
            R.drawable.chart_point_normal,
            enumSound.NONE
    ),
    /**
     * 血糖点错误 高血糖
     */
    HYPERGLYCEMIA(201,
            R.color.color_text_glucose_hyperglycemic,
            R.drawable.icon_glucose_hyperglycemia,
            enumSound.HIGH
    ),
    /**
     * 血糖点错误 低血糖
     */
    HYPOGLYCEMIA(202,
            R.color.color_text_glucose_hypoglycemic,
            R.drawable.chart_point_hypoglycemia,
            enumSound.HIGH
    ),
    /**
     * 血糖点错误 正常血糖点
     */
    NORMAL(200,
            R.color.color_text_glucose_normal,
            R.drawable.chart_point_normal,
            enumSound.NONE
    ),

    ;

    private int statusId;
    private int textColorId;
    private int chartPointIconId;

    private enumSound sound;

    enumGlucoseStatus(int statusId, int textColorId, int chartPointIconId, enumSound sound) {
        this.statusId = statusId;
        this.textColorId = textColorId;
        this.chartPointIconId = chartPointIconId;
        this.sound = sound;
    }

    public int getStatusId() {
        return statusId;
    }


    public int getTextColorId() {
        return textColorId;
    }

    public int getChartPointIconId() {
        return chartPointIconId;
    }

    public enumSound getSound() {
        return sound;
    }

    public void setSound(enumSound sound) {
        this.sound = sound;
    }

    public static enumGlucoseStatus getEnumGlucoseStatus(int id) {
        for (enumGlucoseStatus e : enumGlucoseStatus.values()) {
            if (id == e.getStatusId()) {
                return e;
            }
        }
        return NONE;
    }

    @Override
    public String toString() {
        return "enumGlucoseStatus{" +
                "statusId=" + statusId +
                '}';
    }
}
