C3032
3 天以前 ebcc1d53f14112363bbf539bcaf0202aadcdc9d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using LB_VisionProcesses.BarcodeReaders.Huayray;
 
namespace LB_VisionProcesses.BarcodeReaders
{
    /// <summary>
    /// 读码器工厂类
    /// </summary>
    public static class BarcodeReaderFactory
    {
        /// <summary>
        /// 根据品牌创建读码器实例
        /// </summary>
        /// <param name="brand">读码器品牌</param>
        /// <returns>读码器实例</returns>
        public static IBarcodeReader CreateReader(BarcodeReaderBrand brand)
        {
            switch (brand)
            {
                case BarcodeReaderBrand.Huayray:
                    return new HRBarcodeReader();
                default:
                    throw new NotSupportedException($"不支持的读码器品牌: {brand}");
            }
        }
    }
}