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.

34 lines
883 B
C#

using MvCodeReaderSDKNet;
using System.Drawing.Drawing2D;
using System.Drawing;
1 year ago
using System.Runtime.InteropServices;
using System.Text;
using log4net;
1 year ago
namespace Aucma.Core.Scanner
{
/// <summary>
/// 扫码器初始化
/// </summary>
public class ScannerService : IScannerService
{
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(ScannerService));
1 year ago
public async Task StartScannerAsync()
{
try
1 year ago
{
MvCodeHelper.DeviceListAcq();//获取设备
MvCodeHelper.OpenDevice();//打开设备
MvCodeHelper.StartGrab();//获取数据
1 year ago
}
catch (Exception ex)
1 year ago
{
log.Error(ex.Message);
MvCodeHelper.CloseDevice();
await StartScannerAsync();
1 year ago
}
}
}
}