提交
This commit is contained in:
@ -206,60 +206,47 @@ namespace DH.Devices.Vision
|
||||
{
|
||||
|
||||
|
||||
//当前检测项的 过滤条件
|
||||
//var conditionList = detectConfig.DetectionFilterList
|
||||
// .Where(u => u.IsEnabled && u.LabelName == d.LabelName)
|
||||
// .GroupBy(u => u.ResultState)
|
||||
// .OrderBy(u => u.Key)
|
||||
// .ToList();
|
||||
//当前检测项的 过滤条件
|
||||
//var conditionList = detectConfig.DetectionFilterList
|
||||
// .Where(u => u.IsEnabled && u.LabelName == d.LabelName)
|
||||
// .GroupBy(u => u.ResultState)
|
||||
// .OrderBy(u => u.Key)
|
||||
// .ToList();
|
||||
// 当前检测项的 过滤条件
|
||||
var conditionList = detectConfig.DetectionLableList
|
||||
.Where(u=>u.LabelName == d.LabelName)
|
||||
.GroupBy(u => u.ResultState)
|
||||
.OrderBy(u => u.Key)
|
||||
.ToList();
|
||||
|
||||
|
||||
//if (conditionList.Count == 0)
|
||||
//{
|
||||
if (conditionList.Count == 0)
|
||||
{
|
||||
|
||||
// d.FinalResult = d.LabelName.ToLower() == "ok"
|
||||
// ? ResultState.OK
|
||||
// : ResultState.DetectNG;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// d.FinalResult = detectConfig.IsMixModel
|
||||
// ? ResultState.A_NG
|
||||
// : ResultState.OK;
|
||||
d.FinalResult = d.LabelName.ToLower() == "ok"
|
||||
? ResultState.OK
|
||||
: ResultState.DetectNG;
|
||||
}
|
||||
else
|
||||
{
|
||||
d.FinalResult = detectConfig.IsMixModel
|
||||
? ResultState.A_NG
|
||||
: ResultState.OK;
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
//foreach (IGrouping<ResultState, DetectionFilter> group in conditionList)
|
||||
//{
|
||||
// //bool b = group.ToList().Any(f =>
|
||||
// //{
|
||||
// // return f.FilterOperation(d);
|
||||
// //});
|
||||
foreach (IGrouping<ResultState, DetectionFilter> group in conditionList)
|
||||
{
|
||||
bool b = group.ToList().Any(f =>
|
||||
{
|
||||
return f.FilterOperation(d);
|
||||
});
|
||||
|
||||
|
||||
// //if (b)
|
||||
// //{
|
||||
// // d.FinalResult = group.Key;
|
||||
// // break;
|
||||
// //}
|
||||
if (b)
|
||||
{
|
||||
d.FinalResult = group.Key;
|
||||
break;
|
||||
}
|
||||
|
||||
// if (group.Any(f => f.FilterOperation(d)))
|
||||
// {
|
||||
// d.FinalResult = group.Key;
|
||||
// break;
|
||||
// }
|
||||
// //else
|
||||
// //{
|
||||
// // d.FinalResult = d.InferenceResult = ResultState.OK;
|
||||
// //}
|
||||
//}
|
||||
|
||||
}
|
||||
});
|
||||
#endregion
|
||||
#region 5.统计缺陷过滤结果或预处理直接NG
|
||||
|
Reference in New Issue
Block a user