|
|
|
@ -54,6 +54,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
public delegate void RefreshMessage(string message, bool isWarning = false);
|
|
|
|
|
public static event RefreshMessage? RefreshMessageEvent;
|
|
|
|
|
|
|
|
|
|
public delegate void RefreshDataGrid();
|
|
|
|
|
public static event RefreshDataGrid? RefreshDataGridEvent;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -111,6 +113,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
Console.WriteLine("相机流程开始:");
|
|
|
|
|
// 传入照片
|
|
|
|
|
byte[] ImageData = null;
|
|
|
|
|
// 压缩后的图片
|
|
|
|
|
byte[] compressedImageData = null;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
#region 初始操作:复位海康上次结果,删除海康上次保存文件
|
|
|
|
@ -196,7 +200,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
if (ImageData != null)
|
|
|
|
|
{
|
|
|
|
|
// 图片压缩
|
|
|
|
|
byte[] compressedImageData = FileHelper.CompressImageData(ImageData, 20);
|
|
|
|
|
compressedImageData = FileHelper.CompressImageData(ImageData, 20);
|
|
|
|
|
FileHelper.SaveImage(compressedImageData, materialCodeStr + ".jpg", PicturePath);
|
|
|
|
|
RefreshPictureEvent?.Invoke(ImageData);
|
|
|
|
|
}
|
|
|
|
@ -216,9 +220,13 @@ namespace SlnMesnac.Business
|
|
|
|
|
record.isChecked = logoConfig.IsChecked;
|
|
|
|
|
record.Result = hikFlag ? 1 : 0;
|
|
|
|
|
record.RecordTime = DateTime.Now;
|
|
|
|
|
if (compressedImageData != null)
|
|
|
|
|
{
|
|
|
|
|
record.Picture = compressedImageData;
|
|
|
|
|
}
|
|
|
|
|
logoIdentifyService.InsertRecord(record);
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
RefreshDataGridEvent?.Invoke();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|