Browse Source

V2.0.5 发现缺陷分布bug

master
CPL 2 years ago
parent
commit
481b83a7ae
1 changed files with 14 additions and 10 deletions
  1. +14
    -10
      halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs

+ 14
- 10
halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs View File

@@ -8371,7 +8371,7 @@ namespace MaiMuAOI.SysCtrl
Log($"{res.stepIndex + 1}-{res.processName}", $"转换后坐标数据:{JsonConvert.SerializeObject(res.defectInfor2RestorationDeskPage)}");
if (order.DefectInfoList == null)
order.DefectInfoList = new List<DefectInfo>();
#if false
#if true
foreach (var item in res.defectInfor2RestorationDeskPage)
order.DefectInfoList.Add(new DefectInfo()
{
@@ -8381,7 +8381,7 @@ namespace MaiMuAOI.SysCtrl
Y = double.Parse(item[2]),
ZXD = double.Parse(item[4]),
Index = int.Parse(item[0]),
Area = item.Count>5?double.Parse(item[5]):0,
//Area = item.Count>5?double.Parse(item[5]):0,
ModifyUserCode = UserMgr.LoginUser.Code,
CreateUserCode = UserMgr.LoginUser.Code,
});
@@ -8422,16 +8422,17 @@ namespace MaiMuAOI.SysCtrl
{
//2024-03-07 图片index计算
List<string> indexList = new List<string>();
foreach (var item in res.defectInfor2RestorationDeskPage)
{
if (indexList.Count == 0)
indexList.Add(item[0]);
else
if (res.defectInfor2RestorationDeskPage != null && res.defectInfor2RestorationDeskPage.Count > 0)
foreach (var item in res.defectInfor2RestorationDeskPage)
{
if (!indexList.Contains(item[0]))
if (indexList.Count == 0)
indexList.Add(item[0]);
else
{
if (!indexList.Contains(item[0]))
indexList.Add(item[0]);
}
}
}
path = Util.CreateSubDir(confMgr.SysConfigParams.DefectSmallImag.SavePath, new List<string> { order.CreateTime.ToString("yyyyMMdd"), order.SN });
path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_{picName}";
@@ -8442,7 +8443,10 @@ namespace MaiMuAOI.SysCtrl
{
lock (ImageSaveObj)
{
res.bmps_tag[i].Save(path + $"_i{i}_{indexList[i]}.bmp", ImageFormat.Bmp);
if (res.bmps_tag.Count() != indexList.Count)
res.bmps_tag[i].Save(path + $".bmp", ImageFormat.Bmp);
else
res.bmps_tag[i].Save(path + $"_i{i}_{indexList[i]}.bmp", ImageFormat.Bmp);
}
//res.bmps_tag[i].Save(path + $"_i{i}.bmp", ImageFormat.Bmp);
//res.bmps_tag[i].Save(path + $"{indexList[i]}.bmp", ImageFormat.Bmp);


Loading…
Cancel
Save