package com.fdkankan.common.constant;

import java.util.HashMap;
import java.util.Map;

public enum CameraTypeEnum {
    DOUBLE_EYE(0,"KK-","4DKKLITE_","旧双目相机", "4DKanKan"),
    FDKK_PRO(1,"KK-","4DKKPRO_","四维看看pro八目相机", "4DKanKan"),
    FDKK_LITE(2,"KK-","4DKKLITE_","四维看看lite", "4DKanKan"),
    ZHIHOUSE_REDHOUSE(5,"KK-","4DKKLITE_","指房宝小红屋相机", "4DKanKan"),
    DOUBLE_EYE_TURN(9,"KJ-","4DKKLITE_","双目转台", "4DMinion"),
    LASER_TURN(10,"SS-","4DKKLA_","激光转台", "4DMega"),
    LASER_SG(11,"SG-","4DSG_","深光", "4DMega");


    private int type;
    private String sceneNumPrefix;
    private String wifiNamePrefix;
    private String desc;
    private String cameraName;

    public int getType() {
        return type;
    }

    public String getCameraName() {
        return cameraName;
    }

    public String getSceneNumPrefix() {
        return sceneNumPrefix;
    }

    static Map<Integer,CameraTypeEnum> typeMaps = new HashMap<>(5);

    static{
        for (CameraTypeEnum typeEnum : CameraTypeEnum.values()) {
            typeMaps.put(typeEnum.getType(),typeEnum);
        }
    }

    CameraTypeEnum(Integer type, String sceneNumPrefix, String wifiNamePrefix, String desc, String cameraName) {
        this.type = type;
        this.sceneNumPrefix = sceneNumPrefix;
        this.wifiNamePrefix = wifiNamePrefix;
        this.desc = desc;
        this.cameraName = cameraName;
    }

    public static String getSceneNumPrefixByType(Integer type){
        if(typeMaps.containsKey(type)){
            return typeMaps.get(type).getSceneNumPrefix();
        }
        return "";
    }

    public static CameraTypeEnum get(int type){
        CameraTypeEnum[] values = CameraTypeEnum.values();
        Integer enumValue = null;
        for(CameraTypeEnum eachValue : values){
            enumValue = eachValue.getType();
            if(enumValue.equals(type)){
                return eachValue;
            }
        }
        return null;
    }

}
