Commit f1c775ee LN

1.清空入库任务时清空托盘。2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG. 3.皮带线视觉识别图片保存功能。

1 个父辈 a6fb11bc
...@@ -709,6 +709,14 @@ namespace OnlineStore.AssemblyLine ...@@ -709,6 +709,14 @@ namespace OnlineStore.AssemblyLine
} }
else else
{ {
//查找对应的托盘
TrayInfo tray = TrayManager.GetTrayInfo(param.TrayNumber);
if(tray!=null&&tray.IsFull&& tray.InoutPar.PosId.Equals(param.PosId) && tray.InoutPar.WareCode.Equals(param.WareCode))
{
LogUtil.info("手动清除入库任务前清空托盘:" + tray.ToStr());
TrayManager.UpdateTrayInfo(tray.TrayCode);
}
equipBean.RemoveInStore(param, "手动清除入库任务"); equipBean.RemoveInStore(param, "手动清除入库任务");
txtPosId.Clear(); txtPosId.Clear();
} }
......
...@@ -612,4 +612,24 @@ PRO,0,是否存放的大料盘,IsBigTray,1,,,,, ...@@ -612,4 +612,24 @@ PRO,0,是否存放的大料盘,IsBigTray,1,,,,,
20221121修改: 20221121修改:
信号超时报警也需要响蜂鸣器。短皮带线二增加相机检测功能。 信号超时报警也需要响蜂鸣器。短皮带线二增加相机检测功能。
Config_DischargeLine_1.csv 需要增加一行配置(r_camera_2需要改为为真实相机名称): Config_DischargeLine_1.csv 需要增加一行配置(r_camera_2需要改为为真实相机名称):
PRO,0,短皮带线2监控相机,CameraName_2,r_camera_2,,,,,
\ No newline at end of file \ No newline at end of file
PRO,0,短皮带线2监控相机,CameraName_2,r_camera_2,,,,,
抓料报警。
没有高度,使用
没有宽度尺寸 ,托盘标记为NG, 到检测点 NG
没有从服务器获取到尺寸NG 。
料串自动下降到信号灭。
流水线清理入库任务,同时清空托盘,给服务器发取消任务。
20221124修改:
1.清空入库任务时清空托盘。
2.入料夹爪抓料后如果伺服检测信号亮,从服务器获取库位成功继续入库,未取到尺寸直接NG.
3.皮带线视觉识别图片保存功能。
\ No newline at end of file \ No newline at end of file
...@@ -599,7 +599,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -599,7 +599,7 @@ namespace OnlineStore.DeviceLibrary
//如果当前正在出入库中,需要记录下来,等待空闲时执行 //如果当前正在出入库中,需要记录下来,等待空闲时执行
LogUtil.info(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + "加入等待列表中!"); LogUtil.info(deviceName + "[" + moveEquip.Name + " ]入库命令: " + param.ToStr() + "加入等待列表中!");
InOutParam inOutParam = moveEquip.waitInStoreList.Find(s => param.PosId.Equals(s.PosId)); InOutParam inOutParam = moveEquip.waitInStoreList.Find(s => param.PosId.Equals(s.PosId));
if(inOutParam!=null) if (inOutParam != null)
{ {
moveEquip.waitInStoreList.Remove(inOutParam); moveEquip.waitInStoreList.Remove(inOutParam);
} }
...@@ -823,9 +823,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -823,9 +823,9 @@ namespace OnlineStore.DeviceLibrary
{ {
return (-1, data.data); return (-1, data.data);
} }
else if(data.code.Equals(100)) else if (data.code.Equals(100))
{ {
if(data.data.plateH>0&& data.data.plateW>0) if (data.data.plateH > 0 && data.data.plateW > 0)
{ {
return (100, data.data); return (100, data.data);
} }
...@@ -844,7 +844,67 @@ namespace OnlineStore.DeviceLibrary ...@@ -844,7 +844,67 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("getTaskInfo " + ex.ToString()); LogUtil.error("getTaskInfo " + ex.ToString());
} }
return (result,task); return (result, task);
}
/// <summary>
///上料机构获取料盘高度
/// </summary>
private static string Addr_getReelHeight = "/rest/api/qisda/device/getReelSize";
public static string GetReelSize(string deviceName, string barcode, out int outWidth, out int outHeight)
{
outWidth = 0;
outHeight = 0;
string msg = "";
try
{
if (String.IsNullOrEmpty(barcode))
{
return msg = deviceName + "未扫到条码";
}
///rest/api/qisda/device/getReelSize
//传入参数: barcode
//返回: {code:0, msg:"",data:{"barcode":"ABC","plateW": 7,"plateH":8}}
//code= 0 表示正常,其他为异常
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);// barcode = 扫到的条码
string server = GetAddr(Addr_getReelHeight, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("GetReelSize " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
//返回: { "code": 0, "msg":"ok", data: 7}
ReturnData4 serverResult = JsonHelper.DeserializeJsonToObject<ReturnData4>(resultStr);
if (serverResult == null)
{
return msg = deviceName + " GetReelSize 条码【 " + barcode + "】没有收到服务器反馈";
}
else if (serverResult.code.Equals(0).Equals(false))
{
return msg = deviceName + " GetReelSize 条码【 " + barcode + "】返回:" + "[" + serverResult.code + "]" + serverResult.msg;
}
if (serverResult.data == null)
{
return msg = deviceName + " GetReelSize 条码【 " + barcode + "】未解析到尺寸信息";
}
else
{
// data:料盘直径,= 7时升起气缸
outWidth = serverResult.data.plateW;
outHeight = serverResult.data.plateH;
LogUtil.info(deviceName + "GetReelSize 条码【 " + barcode + "】,获得尺寸:" + outWidth + "X" + outHeight);
return "";
}
}
catch (Exception ex)
{
LogUtil.error(deviceName + " ", ex);
return "GetReelSize 条码【 " + barcode + "】出错:"+ex.ToString();
}
} }
} }
...@@ -893,6 +953,32 @@ namespace OnlineStore.DeviceLibrary ...@@ -893,6 +953,32 @@ namespace OnlineStore.DeviceLibrary
public taskInfo data { get; set; } public taskInfo data { get; set; }
} }
//返回: {code:0, msg:"",data:{"barcode":"ABC","plateW": 7,"plateH":8}}
public class ReturnData4
{
// { "code":0,"msg":"ok","data":true}
public int code { get; set; }
public string msg { get; set; }
public reelInfo data { get; set; }
}
public class reelInfo
{
/// <summary>
/// 解析后的条码
/// </summary>
public string barcode { get; set; }
/// <summary>
/// 料盘尺寸
/// </summary>
public int plateW { get; set; }
/// <summary>
/// 料盘厚度
/// </summary>
public int plateH { get; set; }
}
public class taskInfo public class taskInfo
{ {
/// <summary> /// <summary>
......
...@@ -38,10 +38,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -38,10 +38,10 @@ namespace OnlineStore.DeviceLibrary
} }
public static bool record = false;//是否保存结果图片 public static bool record = false;//是否保存结果图片
public static bool ReelCheck(Bitmap a) public static bool ReelCheck(Bitmap a)
{ {
try try
{ {
Bitmap b = GetReducedImage(a, 1024, 0); Bitmap b = GetReducedImage(a, a.Width, a.Height);
a.Dispose(); a.Dispose();
EyemImage image = new EyemImage(); EyemImage image = new EyemImage();
......
...@@ -165,22 +165,26 @@ dMinorStep 步进,默认1.0。 ...@@ -165,22 +165,26 @@ dMinorStep 步进,默认1.0。
eyemTrackFeature(image, mask, tpRoi, hGlobal, ipResults.Length, tpHsvModel, ipResults, out EyemImage tpDstImg); eyemTrackFeature(image, mask, tpRoi, hGlobal, ipResults.Length, tpHsvModel, ipResults, out EyemImage tpDstImg);
string resultStr = ""; string resultStr = "";
int hasReelCount = 0;
for (int i = 0; i < ipResults.Length; i++) for (int i = 0; i < ipResults.Length; i++)
{ {
if (ipResults[i] == 1) if (ipResults[i] == 1)
{ {
Console.WriteLine("检测到{0}位置有料盘", i); Console.WriteLine("检测到{0}位置有料盘", i);
hasReelCount++;
} }
resultStr += ipResults[i]; resultStr += ipResults[i];
} }
Bitmap dstBitmap = eyemCvtToBitmap(tpDstImg); Bitmap dstBitmap = eyemCvtToBitmap(tpDstImg);
if (dstBitmap != null && SaveImage) if (dstBitmap != null &&(hasReelCount<2) && SaveImage)
{ {
string dataFolder = DateTime.Now.ToString("yyyyMMdd");
string hourFolder = DateTime.Now.ToString("HH");
string date = cameraName.Trim().Replace('_', '-') + "-" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + DateTime.Now.Millisecond; string date = cameraName.Trim().Replace('_', '-') + "-" + DateTime.Now.ToString("yyyyMMdd-HHmmss") + DateTime.Now.Millisecond;
string imageName = date + "-" + resultStr + ".bmp"; string imageName = date + "-" + resultStr + ".bmp";
imgName = imageName; imgName = imageName;
string path = "D:\\image\\" + cameraName + "\\ResOut\\"; string path = "D:\\image\\" + cameraName + "\\ResOut\\"+ dataFolder+"\\"+hourFolder+"\\";
if (canSavePic(path)) if (canSavePic(path))
{ {
dstBitmap.Save(path + imageName, ImageFormat.Jpeg); dstBitmap.Save(path + imageName, ImageFormat.Jpeg);
...@@ -212,7 +216,7 @@ dMinorStep 步进,默认1.0。 ...@@ -212,7 +216,7 @@ dMinorStep 步进,默认1.0。
int zhao =(int)( freespace / 1024); int zhao =(int)( freespace / 1024);
if (zhao < 5) if (zhao < 5)
{ {
LogUtil.error(volume + "盘剩余空间:" + freespace + "M, 不再保存料盘图片"); LogUtil.error(volume + "盘剩余空间:" + freespace + "G, 不再保存料盘图片");
return false; return false;
} }
return true; return true;
......
...@@ -798,12 +798,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -798,12 +798,25 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
[Description("入料_取料完成_等待伺服检测信号消失")] [Description("入料_取料完成_等待伺服检测信号消失")]
FI_18_WaitNoLocationCheck, FI_18_WaitNoLocationCheck,
/// <summary>
/// 料盘移栽:等待没有伺服料盘检测信号,从服务器获取库位号
/// </summary>
[Description("入料_取料完成_等待没有伺服料盘检测信号,从服务器获取库位号")]
FI_18_GetReelSize,
/// <summary> /// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升 /// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary> /// </summary>
[Description("入料_取料完成_提升伺服运动到P3,横移气缸上升")] [Description("入料_取料完成_提升伺服运动到P3,横移气缸上升")]
FI_19_BatchAxisToP3, FI_19_BatchAxisToP3,
/// <summary> /// <summary>
/// 料盘移栽:提升伺服运动到P3,横移气缸上升
/// </summary>
[Description("入料_取料完成_伺服检测信号一直亮,从服务器获取尺寸,横移气缸上升")]
FI_19_GetHFromServer,
/// <summary>
/// 料盘移栽:记录高度尺寸 /// 料盘移栽:记录高度尺寸
/// </summary> /// </summary>
[Description("入料_取料完成_记录高度尺寸")] [Description("入料_取料完成_记录高度尺寸")]
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!