package com.org.hktshop.K3Id.Base;

import com.org.hktshop.K3Id.Decode.*;

public class K3idFactory {

    public static String DeCodeToK3(String[] ParaArr) {
        try {
            M_Base obj = null;
            switch (ParaArr[0].toUpperCase()) {
                case "SR"://贴片电阻
                    obj = new M_DZ_SR();
                    break;
                case "DR": //插件电阻
                    obj = new M_DZ_DR();
                    break;
                case "DRA"://插件电阻
                    obj = new M_DZ_DRA();
                    break;
                case "SRA"://贴片排阻
                    obj = new M_DZ_SRA();
                    break;
                case "SCB"://天平磁珠
                    obj = new M_SCB();
                    break;
                case "NTC"://热敏电阻
                    obj = new M_DZ_NTC();
                    break;
                case "SCI"://贴片电感
                    obj = new M_SCI();
                    break;
                case "SC"://贴片电容
                    obj = new M_EC_SC();
                    break;
                case "SEC"://贴片电解电容
                    obj = new M_EC_SEC();
                    break;
                case "STC"://贴片钽电容
                    obj = new M_EC_STC();
                    break;
                case "DEC"://插件点解电容
                    obj = new M_EC_DEC();
                    break;
                case "DS": //独石电容
                    obj = new M_EC_DS();
                    break;
                case "DTC"://插件钽电容
                    //文档中无说明
                    return "";
                case "DCC"://插件瓷片电容
                    obj = new M_EC_DCC();
                    break;
                case "CBB"://CBB电容  涤纶电容
                    obj = new M_EC_CBB();
                    break;
                case "BR"://
                    obj = new M_BR();
                    break;
                case "SD":
                    //贴片发光二极管
                    if (ParaArr[1].contains("LE")) obj = new M_SD_LED();
                        //贴片二极管
                    else obj = new M_SD();
                    break;
                case "SQ"://贴片三极管
                    obj = new M_SQ();
                    break;
                case "DCI"://插件电感
                    obj = new M_DCI();
                    break;
                case "DD":
                    //插件发光二极管
                    if (ParaArr[1].contains("LE")) obj = new M_DD_LED();
                        //插件二极管
                    else obj = new M_DD();
                    break;
                case "DQ"://插件三极管
                    obj = new M_DQ();
                    break;
                case "DMOS"://插件DMOS管
                    obj = new M_DMOS();
                    break;
                case "SMOS"://贴片mos管
                    obj = new M_SMOS();
                    break;
                case "VR"://稳压电路
                    obj = new M_VR();
                    break;
                case "XTL"://晶振
                    obj = new M_XTL();
                    break;
                case "FUSE"://保险丝
                    obj = new M_FUSE();
                    break;
                case "IC"://集成电路编码
                    obj = new M_IC();
                    break;
                case "SAC"://安规电容编码
                    obj = new M_SAC();
                    break;
                case "SCR"://晶闸管
                    obj = new M_SCR();
                    break;
                case "SEN"://传感器
                    obj = new M_SEN();
                    break;
                case "ST"://变压器
                case "DT"://变压器
                    obj = new M_ST_DT();
                    break;
                case "SF"://滤波器
                    obj = new M_SF();
                    break;
                case "REL"://继电器
                    obj = new M_REL();
                    break;
                case "BU"://蜂鸣器
                    obj = new M_BU();
                    break;
                case "DA"://电源
                    obj = new M_DA();
                    break;
                case "CON"://连接器
                    obj = new M_CON();
                    break;
                case "SW"://开关
                    obj = new M_SW();
                    break;
                case "FHER"://排母
                case "HER"://排针
                    obj = new M_HER();
                    break;
                case "DPY"://数码管
                    obj = new M_DPY();
                    break;
                case "ANT"://天线
                    obj = new M_ANT();
                    break;
                case "BAT"://电池
                    obj = new M_BAT();
                    break;
                case "TD"://端子
                    obj = new M_TD();
                    break;
                case "USB"://usb接口
                    obj = new M_USB();
                    break;
                case "OFC"://光纤收发器
                    obj = new M_OFC();
                    break;
                case "FIC"://存储器
                    obj = new M_FIC();
                    break;
                case "ECM"://咪头
                    obj = new M_ECM();
                    break;
                case "RV"://可调电阻
                    obj = new M_RV();
                    break;
                case "EH":// 耳机座
                    obj = new M_EH();
                    break;
                default:  //错误
                    throw new Exception("不存在对应的编码" + ParaArr[0]);
            }
            return obj.DeCodeK3(ParaArr);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return "";
    }
}
