From 88da12defe7bd747ec24e8d1ed74002d7768ba05 Mon Sep 17 00:00:00 2001 From: CPL <1179393954@qq.com> Date: Wed, 21 Aug 2024 09:59:50 +0800 Subject: [PATCH] =?UTF-8?q?v2.1.3=20=E8=87=AA=E5=8A=A8=E6=9B=9D=E5=85=89+?= =?UTF-8?q?=E6=8A=A5=E8=AD=A6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BanBoShi/SysCtrl/SysMgr.cs | 256 +++++++++--------- .../BanBoShi/SysCtrl/SysUpdata.cs | 5 +- 2 files changed, 133 insertions(+), 128 deletions(-) diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs index dac1d701..651bc4c9 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs @@ -792,17 +792,17 @@ namespace MaiMuAOI.SysCtrl InitLog("IO板卡初始化..."); if (ioCardDev.InitBoard(MaiMuControl.Device.IOBordType.Advantech) < 0) { - InitLog("IO板卡初始化失败!", "初始化", WarningEnum.High); + InitLog("IO板卡初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if(ioCardDev.OpenBoard(confMgr.SysConfigParams.IODevName, confMgr.SysConfigParams.IOCfgPath)<0) { - InitLog("打开IO板卡失败!", "初始化", WarningEnum.High); + InitLog("打开IO板卡失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if (ioCardDev.ResetAllDO()<0) { - InitLog("IO Reset失败!", "初始化", WarningEnum.High); + InitLog("IO Reset失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化IO板卡成功!"); @@ -811,12 +811,12 @@ namespace MaiMuAOI.SysCtrl InitLog("运动控制板卡初始化..."); if(axisDev.InitBoard()<0) { - InitLog("运动控制板卡初始化失败!", "初始化", WarningEnum.High); + InitLog("运动控制板卡初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if (axisDev.OpenBoard(0, confMgr.SysConfigParams.MotionCfgPath) < 0) { - InitLog("打开运动控制板卡失败!", "初始化", WarningEnum.High); + InitLog("打开运动控制板卡失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } @@ -828,7 +828,7 @@ namespace MaiMuAOI.SysCtrl if (axisDev.LoadBoardParams(0, boardCfgParams) < 0) { - InitLog("载入运动控制板卡参数失败1!", "初始化", WarningEnum.High); + InitLog("载入运动控制板卡参数失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } @@ -837,7 +837,7 @@ namespace MaiMuAOI.SysCtrl int com_num = int.Parse(confMgr.SysConfigParams.LightCom.Remove(0, 3)); if (lightDev.InitDev(com_num, confMgr.SysConfigParams.LightComBaud) < 0) { - InitLog("光源控制器初始化失败!", "初始化", WarningEnum.High); + InitLog("光源控制器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化光源控制器成功!"); @@ -848,7 +848,7 @@ namespace MaiMuAOI.SysCtrl comRel = lightDev.CloseLight(i + 1); if(comRel < 0) { - InitLog($"光源控制器通道-{i+1}控制失败!", "初始化", WarningEnum.High); + InitLog($"光源控制器通道-{i+1}控制失败!请检测配置文件与硬件!", "初始化", WarningEnum.High); return ret; } } @@ -859,12 +859,12 @@ namespace MaiMuAOI.SysCtrl InitLog("张力传感器初始化..."); if (tensionDev.OpenDevByCom(confMgr.SysConfigParams.TensionCom, confMgr.SysConfigParams.TensionComBaud) < 0) { - InitLog("张力传感器初始化失败!", "初始化", WarningEnum.High); + InitLog("张力传感器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if(tensionDev.GetValue() <= -1) { - InitLog("张力传感器数据读取失败!", "初始化", WarningEnum.High); + InitLog("张力传感器数据读取失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化张力传感器成功!"); @@ -877,7 +877,7 @@ namespace MaiMuAOI.SysCtrl lensMotorDev.InitBoard(); if (lensMotorDev.OpenBoardByCom(confMgr.SysConfigParams.LensMotorCom, confMgr.SysConfigParams.LensMotorComBaud) < 0) { - InitLog("镜头电机初始化失败!", "初始化", WarningEnum.High); + InitLog("镜头电机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化镜头电机成功!"); @@ -889,7 +889,7 @@ namespace MaiMuAOI.SysCtrl InitLog("测厚传感器初始化..."); if (thicknessDev.OpenDevByTcp(confMgr.SysConfigParams.ThicknessIP, confMgr.SysConfigParams.ThicknessPort) < 0) { - InitLog("测厚传感器初始化失败!", "初始化", WarningEnum.High); + InitLog("测厚传感器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化测厚传感器成功!"); @@ -901,12 +901,12 @@ namespace MaiMuAOI.SysCtrl InitLog("前部相机初始化..."); if (!camDevFront.InitCamera()) { - InitLog("前部相机初始化失败!", "初始化", WarningEnum.High); + InitLog("前部相机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if (!camDevFront.OpenCamera()) { - InitLog("前部相机打开失败!", "初始化", WarningEnum.High); + InitLog("前部相机打开失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化前部相机成功!"); @@ -918,12 +918,12 @@ namespace MaiMuAOI.SysCtrl InitLog("后部相机初始化..."); if (!camDevBack.InitCamera()) { - InitLog("后部相机初始化失败!", "初始化", WarningEnum.High); + InitLog("后部相机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } if (!camDevBack.OpenCamera()) { - InitLog("后部相机打开失败!", "初始化", WarningEnum.High); + InitLog("后部相机打开失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return ret; } InitLog("初始化后部相机成功!"); @@ -1062,7 +1062,7 @@ namespace MaiMuAOI.SysCtrl if (!SysMgr.Instance.ThicknessIsSafe()) { EmergencyStop(); - Log("测厚气缸", "高度传感器不在安全位置",WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!",WarningEnum.High); return false; } @@ -1085,7 +1085,7 @@ namespace MaiMuAOI.SysCtrl if (!SysMgr.Instance.ThicknessIsSafe()) { EmergencyStop(); - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return false; } foreach (int i in axisList) @@ -1105,7 +1105,7 @@ namespace MaiMuAOI.SysCtrl if (!SysMgr.Instance.ThicknessIsSafe()) { EmergencyStop(); - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return false; } } @@ -1669,7 +1669,7 @@ namespace MaiMuAOI.SysCtrl catch (Exception ex) { //throw new Exception("加载产品料号失败:" + ex.Message); - OnMainRuning(new MainEventArgs("启动", "加载产品料号失败:" + ex.Message, WarningEnum.High)); + OnMainRuning(new MainEventArgs("启动", "加载产品料号失败:" + ex.Message + ",请检测Models.dll与Service.dll是否匹配程序!", WarningEnum.High)); statusMgr.GotoWarning(WarningEnum.High, "启动", "加载产品料号失败:" + ex.Message); SendStatus(); } @@ -1788,7 +1788,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return false; } VelocityCurveParams vel_z = new VelocityCurveParams(DefaultSpeed / 2, DefaultSpeed / 2, 0, DefaultSpeed / 2, 1, GetMMtoPlus(AxisName.Axis3)); @@ -1799,7 +1799,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return false; } @@ -1827,7 +1827,7 @@ namespace MaiMuAOI.SysCtrl /// public void EmergencyStop() { - Log("设备", "紧急停止", WarningEnum.High); + Log("设备", "紧急停止!稍后请硬件回原或者重启程序!", WarningEnum.High); _isAuto = false; AxisAllImmediateStop(); } @@ -2079,20 +2079,20 @@ namespace MaiMuAOI.SysCtrl if (!RunThickness(false)) { - Log("复位", "测厚气缸复位失败", WarningEnum.High); + Log("复位", "测厚气缸复位失败,请检测气压与信号!", WarningEnum.High); return false; } bool ret = GotoLoadPos(); if (!ret) { - Log("复位", "系统电机复位失败", WarningEnum.High); + Log("复位", "系统电机复位失败,请检测点位设置与电机状态!", WarningEnum.High); return false; } if (!RunQG(false)) { - Log("复位", "加紧气缸复位失败", WarningEnum.High); + Log("复位", "加紧气缸复位失败,请检测气压与信号!", WarningEnum.High); return false; } @@ -2199,7 +2199,7 @@ namespace MaiMuAOI.SysCtrl Thread.Sleep(100); if (tensionDev.OpenDevByCom(confMgr.SysConfigParams.TensionCom, confMgr.SysConfigParams.TensionComBaud) < 0) { - Log("张力传感器重连失败!", "重连", WarningEnum.High); + Log("张力传感器重连失败!请检测传感器!", "重连", WarningEnum.High); return -10; } } @@ -2652,7 +2652,7 @@ namespace MaiMuAOI.SysCtrl } catch (Exception ex) { - Log("运行", $"程序错误-{errStep}:" + ex.Message + "\n", WarningEnum.High); + Log("运行", $"程序错误-{errStep}:" + ex.Message + ",请将错误码和错误信息反馈!" + "\n", WarningEnum.High); } return ret; @@ -2859,17 +2859,17 @@ namespace MaiMuAOI.SysCtrl Log("复位", "IO板卡初始化"); if (ioCardDev.InitBoard(MaiMuControl.Device.IOBordType.Advantech) < 0) { - Log("IO板卡初始化失败!", "初始化", WarningEnum.High); + Log("IO板卡初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (ioCardDev.OpenBoard(confMgr.SysConfigParams.IODevName, confMgr.SysConfigParams.IOCfgPath) < 0) { - Log("打开IO板卡失败!", "初始化", WarningEnum.High); + Log("打开IO板卡失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (ioCardDev.ResetAllDO() < 0) { - Log("IO Reset失败!", "初始化", WarningEnum.High); + Log("IO Reset失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } statusMgr.GotoInitial(); @@ -2891,17 +2891,17 @@ namespace MaiMuAOI.SysCtrl Log("复位", "运动控制板卡初始化"); if (axisDev.InitBoard() < 0) { - Log("运动控制板卡初始化失败!", "初始化", WarningEnum.High); + Log("运动控制板卡初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (axisDev.OpenBoard(0, confMgr.SysConfigParams.MotionCfgPath) < 0) { - Log("打开运动控制板卡失败!", "初始化", WarningEnum.High); + Log("打开运动控制板卡失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (axisDev.LoadBoardParams(0, boardCfgParams) < 0) { - Log("载入运动控制板卡参数失败1!", "初始化", WarningEnum.High); + Log("载入运动控制板卡参数失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } @@ -2910,7 +2910,7 @@ namespace MaiMuAOI.SysCtrl int com_num = int.Parse(confMgr.SysConfigParams.LightCom.Remove(0, 3)); if (lightDev.InitDev(com_num, confMgr.SysConfigParams.LightComBaud) < 0) { - Log("光源控制器初始化失败!", "初始化", WarningEnum.High); + Log("光源控制器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } @@ -2920,7 +2920,7 @@ namespace MaiMuAOI.SysCtrl Log("复位", "张力传感器初始化"); if (tensionDev.OpenDevByCom(confMgr.SysConfigParams.TensionCom, confMgr.SysConfigParams.TensionComBaud) < 0) { - Log("张力传感器初始化失败!", "初始化", WarningEnum.High); + Log("张力传感器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -2933,7 +2933,7 @@ namespace MaiMuAOI.SysCtrl lensMotorDev.InitBoard(); if (lensMotorDev.OpenBoardByCom(confMgr.SysConfigParams.LensMotorCom, confMgr.SysConfigParams.LensMotorComBaud) < 0) { - Log("镜头电机初始化失败!", "初始化", WarningEnum.High); + Log("镜头电机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -2944,7 +2944,7 @@ namespace MaiMuAOI.SysCtrl Log("复位", "测厚传感器初始化"); if (thicknessDev.OpenDevByTcp(confMgr.SysConfigParams.ThicknessIP, confMgr.SysConfigParams.ThicknessPort) < 0) { - Log("测厚传感器初始化失败!", "初始化", WarningEnum.High); + Log("测厚传感器初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -2957,12 +2957,12 @@ namespace MaiMuAOI.SysCtrl Log("复位", "前部相机初始化"); if (!camDevFront.InitCamera()) { - Log("前部相机初始化失败!", "初始化", WarningEnum.High); + Log("前部相机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (!camDevFront.OpenCamera()) { - Log("前部相机打开失败!", "初始化", WarningEnum.High); + Log("前部相机打开失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -2971,12 +2971,12 @@ namespace MaiMuAOI.SysCtrl Log("复位", "后部相机初始化"); if (!camDevBack.InitCamera()) { - Log("后部相机初始化失败!", "初始化", WarningEnum.High); + Log("后部相机初始化失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } if (!camDevBack.OpenCamera()) { - Log("后部相机打开失败!", "初始化", WarningEnum.High); + Log("后部相机打开失败!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -2993,7 +2993,7 @@ namespace MaiMuAOI.SysCtrl { if (thicknessDev.GetValue() < Math.Abs(confMgr.SysConfigParams.ThicknessSafeValue)) { - Log("厚度传感器不在安全位置!", "初始化", WarningEnum.High); + Log("厚度传感器不在安全位置!请检测系统设置与硬件!", "初始化", WarningEnum.High); return; } } @@ -3020,25 +3020,25 @@ namespace MaiMuAOI.SysCtrl if (!AxisYGoHomeDone(60)) { AxisAllImmediateStop(); - Log("复位", "Y轴回原失败", WarningEnum.High); + Log("复位", "Y轴回原失败,请检测系统设置与硬件!", WarningEnum.High); return; } if (axisDev.CheckHomeDone((int)AxisName.Axis0, 60) != 0) { AxisAllImmediateStop(); - Log("复位", "X1轴回原失败", WarningEnum.High); + Log("复位", "X1轴回原失败,请检测系统设置与硬件!", WarningEnum.High); return; } if (axisDev.CheckHomeDone((int)AxisName.Axis1, 60) != 0) { AxisAllImmediateStop(); - Log("复位", "X2轴回原失败", WarningEnum.High); + Log("复位", "X2轴回原失败,请检测系统设置与硬件!", WarningEnum.High); return; } if (axisDev.CheckHomeDone((int)AxisName.Axis3, 60) != 0) { AxisAllImmediateStop(); - Log("复位", "Z轴回原失败", WarningEnum.High); + Log("复位", "Z轴回原失败,请检测系统设置与硬件!", WarningEnum.High); return; } Log("复位", "所有轴回原成功!"); @@ -3494,7 +3494,7 @@ namespace MaiMuAOI.SysCtrl inWaitingTime += 10; if (IN_Waiting_Timeout > 0 && inWaitingTime >= IN_Waiting_Timeout) { - Log($"{stepIndex + 1}-{processName}", $"输入等待超时告警!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"输入等待超时告警!请检测信号!", WarningEnum.High); return stepIndex; } } @@ -3522,7 +3522,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAllAxisDone(true))//因启用轴异步功能,使用前需等待 { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } @@ -3645,7 +3645,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } VelocityCurveParams vel = new VelocityCurveParams(Acc, Dec, VelLow, VelHigh, MotionST, GetMMtoPlus((AxisName)AxisIndex)); @@ -3656,7 +3656,7 @@ namespace MaiMuAOI.SysCtrl iret = axisDev.MoveRelValue(AxisIndex, vel, PPUValue); if (iret != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndex}运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndex}运动失败!请检测电机!", WarningEnum.High); return stepIndex; } } @@ -3666,7 +3666,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAxisDone(axisList)) { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"轴组运行完成"); @@ -3687,7 +3687,7 @@ namespace MaiMuAOI.SysCtrl //判断有无tag if (order.SizeTagDataList == null) { - Log($"{stepIndex + 1}-{processName}", $"数据提供者Tag为空!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"数据提供者Tag为空!请检测流程设置!", WarningEnum.High); return stepIndex; } @@ -3695,14 +3695,14 @@ namespace MaiMuAOI.SysCtrl if (sizeTagObj == null) { - Log($"{stepIndex + 1}-{processName}", $"偏移校正轴工序找不到数据提供者Tag:{axisSizeTag}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"偏移校正轴工序找不到数据提供者Tag:{axisSizeTag}!请检测流程设置!", WarningEnum.High); return stepIndex; } string[] posePT = sizeTagObj.posePT.Split(','); if (posePT.Length < useIndex + AxisIndexList.Count) { Log($"{stepIndex + 1}-{processName}", - $"Tag:{axisSizeTag}对应消费索引:{useIndex},Axis数量:{AxisIndexList.Count} 超出postPT:{sizeTagObj.posePT} 范围!", WarningEnum.High); + $"输出点位信息少于需要使用的数量!Tag:{axisSizeTag}对应消费索引:{useIndex},Axis数量:{AxisIndexList.Count} 超出postPT:{sizeTagObj.posePT} 范围!", WarningEnum.High); return stepIndex; } @@ -3717,7 +3717,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } @@ -3725,7 +3725,7 @@ namespace MaiMuAOI.SysCtrl { if (axisDev.CheckDone(AxisIndexList[i], 60) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}到位失败!请检测电机!", WarningEnum.High); return stepIndex; } VelocityCurveParams vel = new VelocityCurveParams(TagAcc, TagDec, TagVelLow, TagVelHigh, MotionST, GetMMtoPlus((AxisName)AxisIndexList[i])); @@ -3736,7 +3736,7 @@ namespace MaiMuAOI.SysCtrl iret = axisDev.MoveRelValue(AxisIndexList[i], vel, TagPPUValue[i]); if (iret != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}运动失败!请检测电机!", WarningEnum.High); return stepIndex; } } @@ -3748,7 +3748,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAxisDone(AxisIndexList)) { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"轴组运行完成"); @@ -3811,7 +3811,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{acq.GrabStatus}-{snapi}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{acq.GrabStatus}-{snapi}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -3856,7 +3856,7 @@ namespace MaiMuAOI.SysCtrl } if (!WaitAllAxisDone())//因启用轴异步功能,使用前需等待 { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } @@ -3906,7 +3906,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"开始自动聚焦..."); if (!AutoFocus(tFocusStep, tDirStep, tWaitTime, tTimeOut)) { - Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!请检测初始聚焦高度!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"自动聚焦完成"); @@ -3932,7 +3932,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{acq0.GrabStatus}-{i}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{acq0.GrabStatus}-{i}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -4282,7 +4282,7 @@ namespace MaiMuAOI.SysCtrl else { OnAutoRuning(new RunEventArgs(liStatocStepIndex, $"index:{res.index},Mark点计算失败!")); - Log($"{res.stepIndex + 1}-{processName}", $"Mark点计算失败,index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); + Log($"{res.stepIndex + 1}-{processName}", $"Mark点计算失败,请检测图纸或者拍照参数!index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); } @@ -4320,7 +4320,7 @@ namespace MaiMuAOI.SysCtrl tagOutData = $"Tag:{res.sizeTag},posePT:[{string.Join(",", res.posePT)}]"; if (res.posePT.Length < 2 || res.posePT.Length % 2 != 0) { - Log($"{res.stepIndex + 1}-{res.processName}", $"尺寸检测输出Tag对应posePT非法: {tagOutData}", WarningEnum.High); + Log($"{res.stepIndex + 1}-{res.processName}", $"计算点位输出数据数量不准!尺寸检测输出Tag对应posePT非法: {tagOutData}", WarningEnum.High); return; } //2023-10-27 @@ -4450,7 +4450,7 @@ namespace MaiMuAOI.SysCtrl { if((res.index == 3333)||(res.index == 1111)||(res.index == 2222)||(res.index == 4444)) { - Log($"{res.stepIndex + 1}-{processName}", $"Mark点计算失败,index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); + Log($"{res.stepIndex + 1}-{processName}", $"Mark点计算失败,请检测图纸上传或者拍照参数!index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); } //------TEST if (res.index > 20 && res.index < 30) @@ -4708,7 +4708,7 @@ namespace MaiMuAOI.SysCtrl path = Util.CreateSubDir(confMgr.SysConfigParams.DefectSmallImag.SavePath, new List { order.CreateTime.ToString("yyyyMMdd"), order.SN }); path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_{model.StepInfo.Name}"; - if (res.bmps_tag.Count() != indexList.Count) + if (confMgr.SysConfigParams.OpenFlawDistribution && res.bmps_tag.Count() != indexList.Count) Log($"{res.stepIndex + 1}-{res.processName}", $"缺陷图片张数和index对不上:{res.bmps_tag.Count()} - {indexList.Count}", WarningEnum.Low); for (int i = 0; i < res.bmps_tag.Count(); i++) { @@ -4880,7 +4880,7 @@ namespace MaiMuAOI.SysCtrl bool Reset = processParam.Value("Reset"); if (GotoStepIndex - 1 == stepIndex) { - Log($"{stepIndex + 1}-{processName}", $"For死循环!!!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"For死循环!!!请检测流程!", WarningEnum.High); return stepIndex; } if (!forLib.dicData.ContainsKey(UniqueId)) @@ -4926,7 +4926,7 @@ namespace MaiMuAOI.SysCtrl bool Reset_if = processParam.Value("Reset"); if (GotoStepIndex_if - 1 == stepIndex) { - Log($"{stepIndex + 1}-{processName}", $"If死循环,不可自我跳转!!!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"If死循环,不可自我跳转!!!请检测流程!", WarningEnum.High); return stepIndex; } // @@ -5198,7 +5198,7 @@ namespace MaiMuAOI.SysCtrl } if (!WaitAllAxisDone())//因启用轴异步功能,使用前需等待 { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } TestCnt = processParam.Value("TestCnt"); @@ -5222,7 +5222,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", processParam.ToString()); if (TestCnt > Points.Count) { - Log($"{stepIndex + 1}-{processName}", $"点位少于测试次数!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"点位少于测试次数!请检测点位选取!", WarningEnum.High); return stepIndex; } @@ -5232,19 +5232,19 @@ namespace MaiMuAOI.SysCtrl if (axisDev.CheckDone(AxisX1, 20) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴X1到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴X1到位失败!请检测电机!", WarningEnum.High); return stepIndex; } if (axisDev.CheckDone(AxisY, 20) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴Y到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴Y到位失败!请检测电机!", WarningEnum.High); return stepIndex; } //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } @@ -5256,24 +5256,24 @@ namespace MaiMuAOI.SysCtrl iret2 = axisDev.MoveAbsValue(AxisY, vely, Points[this.CurrPoinntCount].Y); if (iret1 != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴X1运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴X1运动失败!请检测电机!", WarningEnum.High); return stepIndex; } if (iret2 != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴Y运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴Y运动失败!请检测电机!", WarningEnum.High); return stepIndex; } //多轴同时运行后强制等待各轴完成 Log($"{stepIndex + 1}-{processName}", $"等待轴组运行完成..."); if (axisDev.CheckDone(AxisX1, 20) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴X1到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴X1到位失败!请检测电机!", WarningEnum.High); return stepIndex; } if (axisDev.CheckDone(AxisY, 20) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴Y到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴Y到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Thread.Sleep(WaitTime); @@ -5491,7 +5491,7 @@ namespace MaiMuAOI.SysCtrl lensMotorDev.CheckDone(0, 10000); if (axisDev.CheckDone(AxisZ, 20) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴Z到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴Z到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"运动完成,当前镜头位置:{lensMotorDev.GetFeedbackPos(0)},Z轴位置:{axisDev.GetFeedbackPos(AxisZ)/ GetMMtoPlus(AxisName.Axis3)}"); @@ -5670,7 +5670,7 @@ namespace MaiMuAOI.SysCtrl //判断有无tag if (order.SizeTagDataList == null ) { - Log($"{stepIndex + 1}-{processName}", $"Mark数据提供者Tag为空!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"Mark数据提供者Tag为空!请检测图纸上传!", WarningEnum.High); return stepIndex; } //tag @@ -5683,7 +5683,7 @@ namespace MaiMuAOI.SysCtrl var sizeTagObj = order.SizeTagDataList.LastOrDefault(m => m.SizeTag == MarkTag); if (sizeTagObj == null) { - Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的Mark数据!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的Mark数据!请检测图纸上传!", WarningEnum.High); return stepIndex; } string[] posePT = sizeTagObj.posePT.Split(','); @@ -5696,7 +5696,7 @@ namespace MaiMuAOI.SysCtrl if (posePT.Length < this.CurrPoinntCount * 2 + 2) { Log($"{stepIndex + 1}-{processName}", - $"MarkTag对应消费索引:{this.CurrPoinntCount * 2},Axis数量:{2} 超出postPT:{sizeTagObj.posePT} 范围!", WarningEnum.High); + $"计算点位与所需使用数量不对!MarkTag对应消费索引:{this.CurrPoinntCount * 2},Axis数量:{2} 超出postPT:{sizeTagObj.posePT} 范围!", WarningEnum.High); return stepIndex; } //交换点位顺序1-2-3-4 =》 1-2-4-3 @@ -5710,7 +5710,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } @@ -5723,7 +5723,7 @@ namespace MaiMuAOI.SysCtrl { if (axisDev.CheckDone(AxisIndexList[i], 60) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}到位失败!请检测电机!", WarningEnum.High); return stepIndex; } VelocityCurveParams vel = new VelocityCurveParams(markParam.Acc, markParam.Dec, markParam.VelLow, markParam.VelHigh, MotionST, GetMMtoPlus((AxisName)AxisIndexList[i])); @@ -5733,7 +5733,7 @@ namespace MaiMuAOI.SysCtrl if (iret != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{AxisIndexList[i]}运动失败!请检测电机!", WarningEnum.High); return stepIndex; } } @@ -5746,7 +5746,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAxisDone(AxisIndexList)) { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"轴组运行完成"); @@ -5760,7 +5760,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"自动聚焦..."); if(!AutoFocus(FocusStep, DirStep, DirWaitTime, FocusTimeOut)) { - Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!请检测初始聚焦位置!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"自动聚焦完成"); @@ -5777,7 +5777,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"自动曝光完成"); else { - Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!请检测曝光设置!", WarningEnum.High); return stepIndex; } } @@ -5805,7 +5805,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{acq0.GrabStatus}-{i}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{acq0.GrabStatus}-{i}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -5833,7 +5833,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"自动曝光完成"); else { - Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!请检测曝光设置!", WarningEnum.High); return stepIndex; } } @@ -5857,7 +5857,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{acq.GrabStatus}-{snapi}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{acq.GrabStatus}-{snapi}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -5884,7 +5884,7 @@ namespace MaiMuAOI.SysCtrl if (!tRet) { //自动获取mark失败 - Log($"{stepIndex + 1}-{processName}", $"Mark位置获取等待超时!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"Mark位置获取等待超时!请检测图纸!", WarningEnum.High); return stepIndex; } //最后判断 @@ -5898,7 +5898,7 @@ namespace MaiMuAOI.SysCtrl if (!isGetMarkPos) { //自动获取mark失败 - Log($"{stepIndex + 1}-{processName}", $"左上角位置获取等待超时!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"左上角位置获取等待超时!请检测图纸!", WarningEnum.High); return stepIndex; } } @@ -5969,7 +5969,7 @@ namespace MaiMuAOI.SysCtrl //判断有无tag if (order.SizeTagDataList == null) { - Log($"{stepIndex + 1}-{processName}", $"点位数据提供者Tag为空!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"点位数据为空!请检测图纸或者选点!点位数据提供者Tag为空!", WarningEnum.High); return stepIndex; } @@ -5980,7 +5980,7 @@ namespace MaiMuAOI.SysCtrl var TestPosTagObj = order.SizeTagDataList.LastOrDefault(m => m.SizeTag == TestPosTag); if (TestPosTagObj == null) { - Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的测试点位数据!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的测试点位数据!请检测图纸或者选点!", WarningEnum.High); return stepIndex; } TestPos = TestPosTagObj.posePT.Split(','); @@ -6013,7 +6013,7 @@ namespace MaiMuAOI.SysCtrl else if (!testParam.SelectPoint) { Log($"{stepIndex + 1}-{processName}", - $"手动测试点位顺序范围错误:{testParam.Indexs.Count}!", WarningEnum.High); + $"手动测试点位顺序范围错误:{testParam.Indexs.Count}!请检测流程设置!", WarningEnum.High); return stepIndex; } @@ -6152,7 +6152,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } @@ -6164,7 +6164,7 @@ namespace MaiMuAOI.SysCtrl { if (axisDev.CheckDone(PAxisIndexList[j], 60) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{PAxisIndexList[j]}到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{PAxisIndexList[j]}到位失败!请检测电机!", WarningEnum.High); return stepIndex; } VelocityCurveParams vel = new VelocityCurveParams(testParam.Acc, testParam.Dec, testParam.VelLow, testParam.VelHigh, MotionST, GetMMtoPlus((AxisName)PAxisIndexList[i])); @@ -6174,7 +6174,7 @@ namespace MaiMuAOI.SysCtrl if (iret != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{PAxisIndexList[j]}运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{PAxisIndexList[j]}运动失败!请检测电机!", WarningEnum.High); return stepIndex; } } @@ -6183,7 +6183,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAxisDone(PAxisIndexList)) { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"轴组运行完成"); @@ -6202,7 +6202,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"自动聚焦..."); if (!AutoFocus(FocusStep, DirStep, DirWaitTime, FocusTimeOut)) { - Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动聚焦失败!请检测初始聚焦高度!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"自动聚焦完成"); @@ -6218,7 +6218,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"拍照前自动聚焦..."); if (!AutoFocus(testParam.FocusStep, testParam.DirStep, testParam.WaitDoneTime, testParam.TimeOut)) { - Log($"{stepIndex + 1}-{processName}", $"拍照前自动聚焦失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"拍照前自动聚焦失败!请检测初始聚焦高度!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"拍照前自动聚焦完成"); @@ -6234,7 +6234,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!请检测曝光参数!", WarningEnum.High); return stepIndex; } } @@ -6262,7 +6262,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{test_acq.GrabStatus}-{snapi}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"前部相机采集照片失败{test_acq.GrabStatus}-{snapi}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -6334,7 +6334,7 @@ namespace MaiMuAOI.SysCtrl //判断有无tag if (order.SizeTagDataList == null) { - Log($"{stepIndex + 1}-{processName}", $"Mark数据提供者Tag为空!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动计算点位失败!Mark数据提供者Tag为空!请检测图纸!", WarningEnum.High); return stepIndex; } //tag @@ -6344,14 +6344,14 @@ namespace MaiMuAOI.SysCtrl var LeftPosTagObj = order.SizeTagDataList.LastOrDefault(m => m.SizeTag == LeftPosTag); if (LeftPosTagObj == null) { - Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的左上角和产品大小数据!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"未找到自动获取的左上角和产品大小数据!请检测图纸!", WarningEnum.High); return stepIndex; } string[] PosAndSize = LeftPosTagObj.posePT.Split(','); if (PosAndSize.Length < 6) { Log($"{stepIndex + 1}-{processName}", - $"缺陷检测首点对应消费索引:{this.CurrPoinntCount * 2},Axis数量:{2} 超出postPT:{LeftPosTagObj.posePT} 范围!", WarningEnum.High); + $"缺少计算的点位数据!请检测算法!缺陷检测首点对应消费索引:{this.CurrPoinntCount * 2},Axis数量:{2} 超出postPT:{LeftPosTagObj.posePT} 范围!", WarningEnum.High); return stepIndex; } //获取首点,计算步进 @@ -6423,7 +6423,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"设置左上角为空{defectParam.LeftPoints[0]}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"设置左上角为空{defectParam.LeftPoints[0]}!请检测图纸或算法!", WarningEnum.High); return stepIndex; } } @@ -6434,7 +6434,7 @@ namespace MaiMuAOI.SysCtrl } else if (!defectParam.AutoLeft) { - Log($"{stepIndex + 1}-{processName}", $"设置手动左上角,需要手动设置步进!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"设置手动左上角,需要手动设置步进!请检测流程设置!", WarningEnum.High); return stepIndex; } @@ -6453,7 +6453,7 @@ namespace MaiMuAOI.SysCtrl //测厚气缸 if (!SysMgr.Instance.ThicknessIsSafe()) { - Log("测厚气缸", "高度传感器不在安全位置", WarningEnum.High); + Log("测厚气缸", "高度传感器不在安全位置!", WarningEnum.High); return stepIndex; } @@ -6462,7 +6462,7 @@ namespace MaiMuAOI.SysCtrl { if (axisDev.CheckDone(DAxisIndexList[i], 60) != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{DAxisIndexList[i]}到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{DAxisIndexList[i]}到位失败!请检测电机!", WarningEnum.High); return stepIndex; } VelocityCurveParams vel = new VelocityCurveParams(defectParam.Acc, defectParam.Dec, defectParam.VelLow, defectParam.VelHigh, MotionST, GetMMtoPlus((AxisName)DAxisIndexList[i])); @@ -6472,7 +6472,7 @@ namespace MaiMuAOI.SysCtrl if (iret != 0) { - Log($"{stepIndex + 1}-{processName}", $"轴{DAxisIndexList[i]}运动失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴{DAxisIndexList[i]}运动失败!请检测电机!", WarningEnum.High); return stepIndex; } } @@ -6485,7 +6485,7 @@ namespace MaiMuAOI.SysCtrl if (!WaitAxisDone(DAxisIndexList)) { - Log($"{stepIndex + 1}-{processName}", $"轴到位失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"轴到位失败!请检测电机!", WarningEnum.High); return stepIndex; } Log($"{stepIndex + 1}-{processName}", $"轴组运行完成"); @@ -6509,7 +6509,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"二次检测参数错误!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"二次检测参数错误!请检测流程设置!", WarningEnum.High); return stepIndex; } Thread.Sleep(200); @@ -6526,7 +6526,7 @@ namespace MaiMuAOI.SysCtrl Log($"{stepIndex + 1}-{processName}", $"自动曝光完成"); else { - Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"自动曝光失败!请检测曝光设置!", WarningEnum.High); return stepIndex; } } @@ -6554,7 +6554,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{def_acq.GrabStatus}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{def_acq.GrabStatus}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -6573,7 +6573,7 @@ namespace MaiMuAOI.SysCtrl } if (gbxBmpPath == "") { - Log($"{stepIndex + 1}-{processName}", $"比对图像,图纸不存在!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"比对图像,图纸不存在!请上传图纸!", WarningEnum.High); return stepIndex; } //----缺陷队列 @@ -6630,7 +6630,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"二次检测参数错误2!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"二次检测参数错误2!请检测流程设置!", WarningEnum.High); return stepIndex; } //设置曝光 @@ -6651,7 +6651,7 @@ namespace MaiMuAOI.SysCtrl } else { - Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{def_acq.GrabStatus}!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"后部相机采集照片失败{def_acq.GrabStatus}!请检测相机连接!", WarningEnum.High); return stepIndex; } } @@ -6670,7 +6670,7 @@ namespace MaiMuAOI.SysCtrl } if (gbxBmpPath == "") { - Log($"{stepIndex + 1}-{processName}", $"比对图像,图纸不存在!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"比对图像,图纸不存在!请上传图纸!", WarningEnum.High); return stepIndex; } //----缺陷队列 @@ -6703,7 +6703,7 @@ namespace MaiMuAOI.SysCtrl if (!SizeComp2(stepIndex, processName, defectParam.EngineName, gbxBmpPath, model.StepInfo.Name, defectParam.AsynRun)) { - Log($"{stepIndex + 1}-{processName}", $"二次比对图像,比对任务失败!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"二次比对图像,比对任务失败!请检测图纸或算法!", WarningEnum.High); return stepIndex; } } @@ -6761,7 +6761,7 @@ namespace MaiMuAOI.SysCtrl bool Reset = processParam.Value("Reset"); if (GotoStepIndex - 1 == stepIndex) { - Log($"{stepIndex + 1}-{processName}", $"For死循环!!!", WarningEnum.High); + Log($"{stepIndex + 1}-{processName}", $"For死循环!!!请检测流程!", WarningEnum.High); return stepIndex; } if (!forLib.dicData.ContainsKey(UniqueId)) @@ -7468,7 +7468,7 @@ namespace MaiMuAOI.SysCtrl } if (isBreakProcessRun()) { - Log("厚度基准", $"厚度值基准值停止测试", WarningEnum.High); + Log("厚度基准", $"厚度值基准值停止测试!", WarningEnum.High); return; } GotoLoadPos(); @@ -7645,7 +7645,7 @@ namespace MaiMuAOI.SysCtrl else { OnAutoRuning(new RunEventArgs(res.stepIndex, "Mark寻找", new List(), 0, 0, 0, 3, false)); - Log($"{res.stepIndex + 1}-{res.processName}", $"Mark点计算失败,index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); + Log($"{res.stepIndex + 1}-{res.processName}", $"Mark点计算失败,请检测图纸或算法!index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); } @@ -7717,7 +7717,7 @@ namespace MaiMuAOI.SysCtrl OnAutoRuning(new RunEventArgs(res.stepIndex, "Mark寻找", new List(), 0, 0, 0, 3, false)); Log($"{res.stepIndex + 1}-{res.processName}", $"自动寻找尺寸Mark对应Adapter: {string.Join(",", res.Adapter)}", WarningEnum.Normal); Log($"{res.stepIndex + 1}-{res.processName}", $"自动寻找尺寸Mark对应AdapterPos: {string.Join(",", res.AdapterPos)}", WarningEnum.Normal); - Log($"{res.stepIndex + 1}-{res.processName}", $"Mark点计算失败,index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); + Log($"{res.stepIndex + 1}-{res.processName}", $"Mark点计算失败,请检测图纸或者选点!index:{res.index}.", confMgr.SysConfigParams.OpenMarkErrorStop ? WarningEnum.High : WarningEnum.Normal); } @@ -10912,13 +10912,15 @@ namespace MaiMuAOI.SysCtrl { while (true) { + SaveInfoQueue temp = new SaveInfoQueue(); try { if (_cts.IsCancellationRequested) break; - SaveInfoQueue temp; + if(saveImgInfoQueue.TryDequeue(out temp)) { + if(temp.imgType == 1) { if(!string.IsNullOrEmpty(temp.imgPath) && temp.matImg != null) @@ -10945,7 +10947,7 @@ namespace MaiMuAOI.SysCtrl { _isRuning = false; - Log("SaveImage报警", "流程运行出错:" + e.Message + "\n", WarningEnum.High); + Log("SaveImage报警", $"保存图片失败!请检测磁盘空间!流程运行出错:{temp.imgPath}," + e.Message + "\n", WarningEnum.High); } } } diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs index 6377b64f..3485ad13 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs @@ -102,6 +102,9 @@ namespace MaiMuAOI.SysCtrl "\t7.优化部分逻辑bug-20240801\r\n" + "\t8.加入缺陷检测网版边缘裁切功能-20240802\r\n" + "\t9.优化原始小图保存功能&尺寸原图保存功能-20240806\r\n" + - "\t10.JA导出表格优化-20240808\r\n"; + "\t10.JA导出表格优化-20240808\r\n" + + "V2.1.3:\r\n" + + "\t1.加入自动曝光功能-20240820\r\n" + + "\t2.加入报警详细提示-20240820\r\n"; } }