|
|
|
@@ -3148,6 +3148,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
double HeightLower = model.HeightBaseValue - model.HeightDownFloatValue;
|
|
|
|
if (HeightUpper + HeightLower > 0 && (HeightValue > HeightUpper || HeightValue < HeightLower))
|
|
|
|
order.Qualified = false;
|
|
|
|
else
|
|
|
|
order.Qualified = true;
|
|
|
|
if (limitThresholdVal > 0 && heightValue2 >= limitThresholdVal)
|
|
|
|
{
|
|
|
|
Log($"{stepIndex + 1}-{processName}", $"读取数据:{heightValue2},达到上限阀值:{limitThresholdVal},请进行下料...", WarningEnum.High);
|
|
|
|
@@ -3768,6 +3770,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
double PtLower = model.PTBaseValue - model.PTDownFloatValue;
|
|
|
|
if (PtUpper + PtLower > 0 && (PtValue > PtUpper || PtValue < PtLower))
|
|
|
|
order.Qualified = false;
|
|
|
|
else
|
|
|
|
order.Qualified = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//------
|
|
|
|
@@ -3811,6 +3815,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
double LwLower = model.LineWidthBaseValue - model.LineWidthDownFloatValue;
|
|
|
|
if (LwUpper + LwLower > 0 && (LwValue > LwUpper || LwValue < LwLower))
|
|
|
|
order.Qualified = false;
|
|
|
|
else
|
|
|
|
order.Qualified = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -4363,6 +4369,13 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
CurrStepResult = 2;
|
|
|
|
order.Qualified = false;
|
|
|
|
}
|
|
|
|
else if ((judgmentData == DataJudgment.均值)
|
|
|
|
&& (upLimit + loLimit > 0 && !(tensionJudgValue > upLimit || tensionJudgValue < loLimit)))
|
|
|
|
{
|
|
|
|
order.Qualified = true;
|
|
|
|
CurrStepResult = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
order.TensionValue = Math.Round(lstTension.Average(),2);
|
|
|
|
if (order.SizeDefectInfoList == null)
|
|
|
|
order.SizeDefectInfoList = new List<SizeDefectInfo>();
|
|
|
|
@@ -4595,6 +4608,13 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
CurrStepResult = 2;
|
|
|
|
order.Qualified = false;
|
|
|
|
}
|
|
|
|
else if ((judgmentData == DataJudgment.均值)
|
|
|
|
&& (upLimit + loLimit > 0 && !(JudgValue > upLimit || JudgValue < loLimit)))
|
|
|
|
{
|
|
|
|
order.Qualified = true;
|
|
|
|
CurrStepResult = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
order.HeightValue = Math.Round(lstHeight.Average(),2);
|
|
|
|
if (order.SizeDefectInfoList == null)
|
|
|
|
order.SizeDefectInfoList = new List<SizeDefectInfo>();
|
|
|
|
@@ -7775,13 +7795,21 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
if (testParam.JudgmentData == DataJudgment.单点)
|
|
|
|
judgData = Math.Round(res.PT1 + testParam.OffsetValue, 4);
|
|
|
|
else
|
|
|
|
judgData = Math.Round(lstTestData.Average(), 4);
|
|
|
|
|
|
|
|
judgData = Math.Round(lstTestData.Average(), 4);
|
|
|
|
|
|
|
|
//存在上下限,判断是否为不合格
|
|
|
|
if (PtUpper + PtLower > 0 && (judgData > PtUpper || judgData < PtLower))
|
|
|
|
{
|
|
|
|
order.Qualified = false;
|
|
|
|
CurrStepResult = 2;
|
|
|
|
}
|
|
|
|
else if ((testParam.JudgmentData == DataJudgment.均值)
|
|
|
|
&& (PtUpper + PtLower > 0 && !(judgData > PtUpper || judgData < PtLower)))
|
|
|
|
{
|
|
|
|
order.Qualified = true;
|
|
|
|
CurrStepResult = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
//添加均值数据
|
|
|
|
AddAverageData(processName, testName, PtValue, PtUpper, PtLower);
|
|
|
|
|
|
|
|
@@ -7879,12 +7907,18 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
judgData = lineWidthValue;
|
|
|
|
else
|
|
|
|
judgData = LwValue;
|
|
|
|
|
|
|
|
//存在上下限,判断是否为不合格
|
|
|
|
if (LwUpper + LwLower > 0 && (judgData > LwUpper || judgData < LwLower))
|
|
|
|
{
|
|
|
|
order.Qualified = false;
|
|
|
|
CurrStepResult = 2;
|
|
|
|
}
|
|
|
|
else if ((testParam.JudgmentData == DataJudgment.均值)
|
|
|
|
&&(LwUpper + LwLower > 0 && !(judgData > LwUpper || judgData < LwLower)))
|
|
|
|
{
|
|
|
|
order.Qualified = true;
|
|
|
|
CurrStepResult = 0;
|
|
|
|
}
|
|
|
|
//添加均值数据
|
|
|
|
AddAverageData(processName, testName, LwValue, LwUpper, LwLower);
|
|
|
|
|
|
|
|
@@ -8447,7 +8481,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}";
|
|
|
|
lock (ImageSaveObj)
|
|
|
|
{
|
|
|
|
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
res.bmp.ImWrite(path + ".bmp");
|
|
|
|
//OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
File.WriteAllText(path + ".json", JsonConvert.SerializeObject(res.informationList));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -8491,7 +8526,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}";
|
|
|
|
lock (ImageSaveObj)
|
|
|
|
{
|
|
|
|
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpCompress).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
res.bmpCompress.ImWrite(path + ".bmp");
|
|
|
|
//OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmpCompress).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
File.WriteAllText(path + ".json", JsonConvert.SerializeObject(res.defectInfor2RestorationDesk));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -8504,7 +8540,8 @@ namespace MaiMuAOI.SysCtrl |
|
|
|
path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_C{res.defectCount}_{picName}";
|
|
|
|
lock (ImageSaveObj)
|
|
|
|
{
|
|
|
|
OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
res.bmp.ImWrite(path + ".bmp");
|
|
|
|
//OpenCvSharp.Extensions.BitmapConverter.ToBitmap(res.bmp).Save(path + ".bmp", ImageFormat.Bmp);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|