Commit 2980e5fa 张东亮

及时删除贴标图片

1 个父辈 5e620c53
...@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -183,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
List<CodeInfo> cc = new List<CodeInfo>(); List<CodeInfo> cc = new List<CodeInfo>();
// eyemNoCode = true; // eyemNoCode = true;
RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam RemoteDecodeHelper.RemoteDecodeParam remoteDecodeParam = new RemoteDecodeHelper.RemoteDecodeParam
{ {
...@@ -384,7 +384,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -384,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
if (!codeList.Contains(c)) if (!codeList.Contains(c))
{ {
codeList.Add(c); codeList.Add(c);
// r = r + "##halcon|" + c.CodeType + "|" + c.CodeStr; // r = r + "##halcon|" + c.CodeType + "|" + c.CodeStr;
LogUtil.info(" 【" + cameraName + "】[remote]" + c.CodeType + "(X: " + c.X + ",Y: " + c.Y + ") " + c.CodeStr); LogUtil.info(" 【" + cameraName + "】[remote]" + c.CodeType + "(X: " + c.X + ",Y: " + c.Y + ") " + c.CodeStr);
//if (!findRightCode) //if (!findRightCode)
//{ //{
...@@ -487,7 +487,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -487,7 +487,22 @@ namespace OnlineStore.DeviceLibrary
} }
return dire + iamgeName; return dire + iamgeName;
} }
public static void DelImg(string deviceName, string imgPath)
{
try
{
if (File.Exists(imgPath))
{
File.Delete(imgPath);
LogUtil.info(deviceName + "删除图片【" + imgPath + "】成功");
}
}
catch (Exception ex)
{
LogUtil.error("删除" + deviceName + "图片【" + imgPath + "】出错" + ex.ToString());
}
}
private static int SaveErrorImageToFile = ConfigAppSettings.GetIntValue(Setting_Init.SaveErrorImageToFile); private static int SaveErrorImageToFile = ConfigAppSettings.GetIntValue(Setting_Init.SaveErrorImageToFile);
//private static void SaveImageToFile(string deviceName, string cameraName, HalconDotNet.HObject bitmap) //private static void SaveImageToFile(string deviceName, string cameraName, HalconDotNet.HObject bitmap)
......
...@@ -314,7 +314,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -314,7 +314,6 @@ namespace OnlineStore.DeviceLibrary
BufferDataManager.BOutStoreInfo.Labeled = true; BufferDataManager.BOutStoreInfo.Labeled = true;
} }
MoveLog($"打标:{MoveInfo.MoveParam.PosInfo.barcode}标记为打标,计算的贴标旋转角度:{MoveInfo.MoveParam.PosInfo.relativeAngle}°"); MoveLog($"打标:{MoveInfo.MoveParam.PosInfo.barcode}标记为打标,计算的贴标旋转角度:{MoveInfo.MoveParam.PosInfo.relativeAngle}°");
SetWarnMsg();
BufferDataManager.LabelInfo = MoveInfo.MoveParam.PosInfo.ToCopy(); BufferDataManager.LabelInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
} }
...@@ -329,9 +328,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -329,9 +328,9 @@ namespace OnlineStore.DeviceLibrary
{ {
MoveInfo.NextMoveStep(StepEnum.Label10_Finish); MoveInfo.NextMoveStep(StepEnum.Label10_Finish);
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); //MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
SetWarnMsg();
Label_CylinderBack(MoveInfo); Label_CylinderBack(MoveInfo);
MoveLog($"打标:标签被取走,流程结束"); MoveLog($"打标:标签被取走,流程结束");
CodeManager.DelImg(Name,MoveInfo?.MoveParam?.PosInfo?.LabelParam.BitmapFilename);
} }
else if (MoveInfo.IsTimeOut()) else if (MoveInfo.IsTimeOut())
{ {
......
...@@ -96,6 +96,7 @@ namespace OnlineStore.XLRStore ...@@ -96,6 +96,7 @@ namespace OnlineStore.XLRStore
button3_Click(null, null); button3_Click(null, null);
} }
LogUtil.info($"手动清除贴标缓存:{BufferDataManager.LabelInfo.ToStr()}"); LogUtil.info($"手动清除贴标缓存:{BufferDataManager.LabelInfo.ToStr()}");
CodeManager.DelImg(Name, BufferDataManager.LabelInfo?.LabelParam.BitmapFilename);
BufferDataManager.LabelInfo = null; BufferDataManager.LabelInfo = null;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!