You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
726 B
C#
32 lines
726 B
C#
using Admin.Core.Common;
|
|
using log4net;
|
|
|
|
namespace Aucma.Core.Scanner
|
|
{
|
|
/// <summary>
|
|
/// 扫码器初始化
|
|
/// </summary>
|
|
public class ScannerService : IScannerService
|
|
{
|
|
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(ScannerService));
|
|
public async Task StartScannerAsync()
|
|
{
|
|
try
|
|
{
|
|
|
|
MvCodeHelper.DeviceListAcq();//获取创建设备
|
|
|
|
MvCodeHelper.StartGrab();//获取数据
|
|
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
log.Error(ex.Message);
|
|
MvCodeHelper.CloseAllDevice();
|
|
await StartScannerAsync();
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|