Commit e1970f0c LN

仓门口信号与拍照效果不一致时保存图片

1 个父辈 aabddb74
...@@ -38,3 +38,4 @@ PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,, ...@@ -38,3 +38,4 @@ PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,, PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,仓门口相机名称,Camera_Name,,,,,,,,,,,,, PRO,,仓门口相机名称,Camera_Name,,,,,,,,,,,,,
PRO,,拍照相机名称,PhotoCamera_Name,,,,,,,,,,,,, PRO,,拍照相机名称,PhotoCamera_Name,,,,,,,,,,,,,
PRO,0,压紧轴(轴4)P2压紧点列表,CompAxis_P2_List,8=385001;,,,,,,,,,,,,
...@@ -38,3 +38,4 @@ PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,, ...@@ -38,3 +38,4 @@ PRO,,两次吹气间隔(分钟),BlowAir_Interval,10,,, ,,,,,,,,,
PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,, PRO,,温湿度端口号,Humiture_Port,COM5,,,,,,,,,,,,
PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,, PRO,,仓门口相机名称,Camera_Name,monitor,,,,,,,,,,,,
PRO,,拍照相机名称,PhotoCamera_Name,monitor,,,,,,,,,,,, PRO,,拍照相机名称,PhotoCamera_Name,monitor,,,,,,,,,,,,
PRO,0,压紧轴(轴4)P2压紧点列表,CompAxis_P2_List,8=385001;,,,,,,,,,,,,
...@@ -7,6 +7,7 @@ using System.IO; ...@@ -7,6 +7,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
using System.Windows.Forms;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
...@@ -430,7 +431,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -430,7 +431,8 @@ namespace OnlineStore.DeviceLibrary
//如果视觉检测有料,也可以入库 //如果视觉检测有料,也可以入库
if (VisionComp(out Dictionary<string, bool> exist)) if (VisionComp(out Dictionary<string, bool> exist))
{ {
InStoreLog("入库:门口检测信号不亮,但视觉识别有料盘,认为有料"); string imgName = SaveComName();
InStoreLog("入库:门口检测信号不亮,但视觉识别有料盘,认为有料:"+imgName);
SI_02_Move(moveP); SI_02_Move(moveP);
return; return;
} }
...@@ -592,6 +594,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -592,6 +594,21 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private string SaveComName()
{
try
{
string date = Name + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss") + "-Comp";
StoreManager.Store.vision.SaveImage(Application.StartupPath + @"\image\", date, ImageFormat.Png);
return date;
}
catch(Exception ex)
{
LogUtil.error(Name + " SaveComName 出错:" + ex.ToString());
}
return "";
}
#endregion #endregion
...@@ -817,7 +834,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -817,7 +834,8 @@ namespace OnlineStore.DeviceLibrary
{ {
if (IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW) && VisionComp(out Dictionary<string, bool> exist)) if (IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW) && VisionComp(out Dictionary<string, bool> exist))
{ {
LogUtil.error(Name + "_" + MoveInfo.MoveStep + "_" + MoveInfo.MoveParam.PosInfo.PosId + "出库:门口检测信号无料,但视觉识别有料盘"); string fileName = SaveComName( );
LogUtil.error(Name + "_" + MoveInfo.MoveStep + "_" + MoveInfo.MoveParam.PosInfo.PosId + "出库:门口检测信号无料,但视觉识别有料盘:"+fileName);
} }
SO_53_InoutToP2(); SO_53_InoutToP2();
...@@ -919,8 +937,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -919,8 +937,9 @@ namespace OnlineStore.DeviceLibrary
//再次检测 //再次检测
bool hasReel = VisionComp(out Dictionary<string, bool> exist); bool hasReel = VisionComp(out Dictionary<string, bool> exist);
if (hasReel) if (hasReel)
{ {
LogUtil.error(Name + "" + posId + "_" + barcode + "_料盘到仓门口未检测到信号,但视觉识别有料盘"); string fileName = SaveComName();
LogUtil.error(Name + "" + posId + "_" + barcode + "_料盘到仓门口未检测到信号,但视觉识别有料盘:"+fileName);
} }
else else
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!