package com.hh.lib_print;


import com.hh.hardware.lib_mla_a4_print.MlaFCDD215Printer;
import com.hh.lib_base_print.BasePrinter;
import com.hh.lib_mla80_print.MlaPrinter;
import com.hh.lib_tb_print.TbPrinter;


/**
 * @Description:
 * @author: Xia WeiHao
 * @date: 2024/7/1
 */
public class PrinterFactory {



    /**
     * YX02(1, "YX02内置打印机"),
     * MLA80(2, "Mla80打印机"),
     * MLAFCDD215(3, "MlaFCDD215（A4热敏打印机）")
     * */
    public static BasePrinter createPrinter(int  printerBrand) {
        PrintType type = PrintType.fromValue(printerBrand);
        switch (type) {
            case TB:
                return TbPrinter.getInstance();
            case MLA80:
                return MlaPrinter.getInstance();
            case MLAFCDD215:
                return MlaFCDD215Printer.getInstance();

            default:
                return null;
        }
    }

}
