Selaa lähdekoodia

V2.1.0 优化数据显示

MainC
CPL 2 vuotta sitten
vanhempi
commit
066912a1a3
6 muutettua tiedostoa jossa 79 lisäystä ja 31 poistoa
  1. +6
    -6
      halftoneproject-master/BanBoShi/ImageProcessing/DefectLib.cs
  2. +18
    -11
      halftoneproject-master/BanBoShi/MainFrm.cs
  3. +48
    -9
      halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs
  4. +3
    -1
      halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs
  5. +3
    -3
      halftoneproject-master/BanBoShi/SysUI/ProcessStep/Ctrl/NewStepShow.cs
  6. +1
    -1
      halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs

+ 6
- 6
halftoneproject-master/BanBoShi/ImageProcessing/DefectLib.cs Näytä tiedosto

@@ -409,9 +409,9 @@ namespace MaiMuAOI.ImageProcessing
stopwatch.Start(); stopwatch.Start();
IDisposableReadOnlyCollection<DisposableNamedOnnxValue>[] results = yolo2.RunModlel(_onnxSession2, task.tensors); IDisposableReadOnlyCollection<DisposableNamedOnnxValue>[] results = yolo2.RunModlel(_onnxSession2, task.tensors);
liStep = 1; liStep = 1;
//if (task.modelType == "rj")
// task.informationList = yolo2.ScreeningResults_YD_RJ(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
//else
if (task.modelType == "rj")
task.informationList = yolo2.ScreeningResults_YD_RJ(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
else
task.informationList = yolo2.ScreeningResults_YD(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold); task.informationList = yolo2.ScreeningResults_YD(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
liStep = 2; liStep = 2;
@@ -488,9 +488,9 @@ namespace MaiMuAOI.ImageProcessing
stopwatch.Start(); stopwatch.Start();
IDisposableReadOnlyCollection<DisposableNamedOnnxValue>[] results = yolo3.RunModlel(_onnxSession3, task.tensors); IDisposableReadOnlyCollection<DisposableNamedOnnxValue>[] results = yolo3.RunModlel(_onnxSession3, task.tensors);
liStep = 1; liStep = 1;
//if(task.modelType == "rj")
// task.informationList = yolo3.ScreeningResults_YD_RJ(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
//else
if(task.modelType == "rj")
task.informationList = yolo3.ScreeningResults_YD_RJ(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
else
task.informationList = yolo3.ScreeningResults_YD(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold); task.informationList = yolo3.ScreeningResults_YD(results, task.bmps_resize, task.thresholds, task.thresholdsClass, task.recAreaThreshold);
liStep = 2; liStep = 2;


+ 18
- 11
halftoneproject-master/BanBoShi/MainFrm.cs Näytä tiedosto

@@ -1489,9 +1489,13 @@ namespace MaiMuAOI
#region 料号和产品编码选择 #region 料号和产品编码选择
private void txtProductCode_DoubleClick(object sender, EventArgs e) private void txtProductCode_DoubleClick(object sender, EventArgs e)
{ {
string pdtName = SysMgr.Instance.SelectProduct();
if (!string.IsNullOrWhiteSpace(pdtName))
this.cbProductCode.Text = pdtName;
try
{
string pdtName = SysMgr.Instance.SelectProduct();
if (!string.IsNullOrWhiteSpace(pdtName))
this.cbProductCode.Text = pdtName;
}
catch { }
} }
private void txtProductCode_TextChanged(object sender, EventArgs e) private void txtProductCode_TextChanged(object sender, EventArgs e)
@@ -1517,14 +1521,17 @@ namespace MaiMuAOI
private void LoadPdtList(List<string> list) private void LoadPdtList(List<string> list)
{ {
this.cbProductCode.Items.Clear();
this.pdtlistData = list.ToArray();
cbProductCode.Items.AddRange(pdtlistData);//比使用DataSource速度要快一些
cbProductCode.TextUpdate += cobList_TextUpdate;//重新绑定事件
cbProductCode.KeyDown += CobList_KeyDown;
this.cbProductCode.Text = "";
cbProductCode.Focus();
cbProductCode.SelectAll();
try
{
this.cbProductCode.Items.Clear();
this.pdtlistData = list.ToArray();
cbProductCode.Items.AddRange(pdtlistData);//比使用DataSource速度要快一些
cbProductCode.TextUpdate += cobList_TextUpdate;//重新绑定事件
cbProductCode.KeyDown += CobList_KeyDown;
this.cbProductCode.Text = "";
cbProductCode.Focus();
cbProductCode.SelectAll();
}catch { }
} }
private void LoadSNList(List<string> list) private void LoadSNList(List<string> list)


+ 48
- 9
halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs Näytä tiedosto

@@ -3210,6 +3210,7 @@ namespace MaiMuAOI.SysCtrl
{ {
try try
{ {
#region 工序加载
//记录当前index //记录当前index
this.CurrProcessIndex = stepIndex; this.CurrProcessIndex = stepIndex;
OnAutoRuning(new RunEventArgs(stepIndex)); OnAutoRuning(new RunEventArgs(stepIndex));
@@ -3252,7 +3253,7 @@ namespace MaiMuAOI.SysCtrl
else else
Log($"{stepIndex + 1}-{processName}", $"使用 高级流程 默认配方:{jsonParams}"); Log($"{stepIndex + 1}-{processName}", $"使用 高级流程 默认配方:{jsonParams}");
} }
#endregion
//加载工序参数 //加载工序参数
JObject processParam = JObject.Parse(jsonParams); JObject processParam = JObject.Parse(jsonParams);
TestCnt = 0; TestCnt = 0;
@@ -4358,7 +4359,7 @@ namespace MaiMuAOI.SysCtrl
OnAutoRuning(new RunEventArgs(liStatocStepIndex, OnAutoRuning(new RunEventArgs(liStatocStepIndex,
$"源图索引:{res.index},缺陷数:{res.defectCount},处理时间(ms):{string.Join("->", res.stopwatch.Select(i => i.ToString()).ToArray())}")); $"源图索引:{res.index},缺陷数:{res.defectCount},处理时间(ms):{string.Join("->", res.stopwatch.Select(i => i.ToString()).ToArray())}"));
Log($"{res.stepIndex + 1}-{res.processName}", $"缺陷检测完成(源图索引:{res.index}),缺陷数:{res.defectCount},处理时间(ms):{string.Join("->", res.stopwatch.Select(i => i.ToString()).ToArray())}"); Log($"{res.stepIndex + 1}-{res.processName}", $"缺陷检测完成(源图索引:{res.index}),缺陷数:{res.defectCount},处理时间(ms):{string.Join("->", res.stopwatch.Select(i => i.ToString()).ToArray())}");
string path;
string path = "";
if (res.defectCount > 0) if (res.defectCount > 0)
{ {
//UI显示小图 (含统计缺陷类型数量) //UI显示小图 (含统计缺陷类型数量)
@@ -4430,6 +4431,40 @@ namespace MaiMuAOI.SysCtrl
//res.bmps_tag[i].Save(path + $"{indexList[i]}.bmp", ImageFormat.Bmp); //res.bmps_tag[i].Save(path + $"{indexList[i]}.bmp", ImageFormat.Bmp);
} }
} }
//保存原始小图
if (confMgr.SysConfigParams.DefectSrcSmallImag.SavePath != "" && Directory.Exists(confMgr.SysConfigParams.DefectSrcSmallImag.SavePath))
{
Log($"{res.stepIndex + 1}-{res.processName}", $"原始小图保存");
string sinfo = "";
int sterr = 0;
try
{
for (int i = 0; i < res.defectInfor2RestorationDesk.Count(); i++)
{
sterr = 1;
sinfo = JsonConvert.SerializeObject(res.defectInfor2RestorationDesk[i]);
int indext = int.Parse(res.defectInfor2RestorationDesk[i][0]);
double thres = double.Parse(res.defectInfor2RestorationDesk[i][4]);
if (thres >= confMgr.SysConfigParams.Defect_SrcSmall_Thres)
{
path = Util.CreateSubDir(confMgr.SysConfigParams.DefectSrcSmallImag.SavePath,
new List<string> { order.CreateTime.ToString("yyyyMMdd"),
model.MainGrid == 1?"主栅":model.DefectModelFile.IndexOf("rj") >= 0?"rj":model.DefectModelFile.IndexOf("pi") >= 0?"pi" : "其他",
order.SN,
res.defectInfor2RestorationDesk[i][3]});
sterr = 2;
path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_{model.StepInfo.Name}";
res.bmps_cut[indext].ImWrite(path + $"_i{i}.bmp");
sterr = 3;
}
}
}
catch (Exception ex)
{
Log($"{res.stepIndex + 1}-{res.processName}", $"原始小图保存出错{sterr}-{sinfo}-{path}:{ex.Message}");
}
}
//保存压缩大图 -- 用于修复台调用 //保存压缩大图 -- 用于修复台调用
if (confMgr.SysConfigParams.DefectRepairImag.SavePath != "" && Directory.Exists(confMgr.SysConfigParams.DefectRepairImag.SavePath)) if (confMgr.SysConfigParams.DefectRepairImag.SavePath != "" && Directory.Exists(confMgr.SysConfigParams.DefectRepairImag.SavePath))
@@ -7849,6 +7884,7 @@ namespace MaiMuAOI.SysCtrl
//保存原始小图 //保存原始小图
if (confMgr.SysConfigParams.DefectSrcSmallImag.SavePath != "" && Directory.Exists(confMgr.SysConfigParams.DefectSrcSmallImag.SavePath)) if (confMgr.SysConfigParams.DefectSrcSmallImag.SavePath != "" && Directory.Exists(confMgr.SysConfigParams.DefectSrcSmallImag.SavePath))
{ {
Log($"{res.stepIndex + 1}-{res.processName}", $"原始小图保存");
string sinfo = ""; string sinfo = "";
int sterr = 0; int sterr = 0;
try try
@@ -8219,14 +8255,17 @@ namespace MaiMuAOI.SysCtrl
#region 硬盘检测 #region 硬盘检测
public static bool CheckDisk(IWin32Window owner, int max = 10) public static bool CheckDisk(IWin32Window owner, int max = 10)
{ {
string path = ConfMgr.Instance.SysConfigParams.DefectBigImag.SavePath;
string volume = path.Substring(0, path.IndexOf(':'));
long freespace = DiskAPI.GetHardDiskSpace(volume);
if (freespace < max)
if (!string.IsNullOrEmpty(ConfMgr.Instance.SysConfigParams.DefectBigImag.SavePath))
{ {
string tip = $"当前{volume}硬盘容量:{freespace}GB,小于{max}GB。注意清理!!";
FrmDialog.ShowDialog(owner, tip, "警告", true);
return false;
string path = ConfMgr.Instance.SysConfigParams.DefectBigImag.SavePath;
string volume = path.Substring(0, path.IndexOf(':'));
long freespace = DiskAPI.GetHardDiskSpace(volume);
if (freespace < max)
{
string tip = $"当前{volume}硬盘容量:{freespace}GB,小于{max}GB。注意清理!!";
FrmDialog.ShowDialog(owner, tip, "警告", true);
return false;
}
} }
return true; return true;
} }


+ 3
- 1
halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs Näytä tiedosto

@@ -79,6 +79,8 @@ namespace MaiMuAOI.SysCtrl
"\t10.优化老流程的兼容性\r\n" + "\t10.优化老流程的兼容性\r\n" +
"\t11.修复缺陷计数查询无数据问题\r\n" + "\t11.修复缺陷计数查询无数据问题\r\n" +
"\t12.不同客户解析图纸功能\r\n" + "\t12.不同客户解析图纸功能\r\n" +
"\t13.原始小图保存\r\n";
"\t13.原始小图保存\r\n" +
"\t14.新流程界面显示数据改为小数点后4位\r\n" +
"\t15.新增mark点类型\r\n";
} }
} }

+ 3
- 3
halftoneproject-master/BanBoShi/SysUI/ProcessStep/Ctrl/NewStepShow.cs Näytä tiedosto

@@ -84,7 +84,7 @@ namespace MaiMuAOI.SysUI.ProcessStep.Ctrl
set set
{ {
stepData = value; stepData = value;
this.RelData.Text = stepData.ToString("0.000");
this.RelData.Text = stepData.ToString("0.0000");
base.Refresh(); base.Refresh();
} }
} }
@@ -98,7 +98,7 @@ namespace MaiMuAOI.SysUI.ProcessStep.Ctrl
set set
{ {
stepMax = value; stepMax = value;
this.MaxValue.Text = stepMax.ToString("0.000");
this.MaxValue.Text = stepMax.ToString("0.0000");
base.Refresh(); base.Refresh();
} }
} }
@@ -111,7 +111,7 @@ namespace MaiMuAOI.SysUI.ProcessStep.Ctrl
set set
{ {
stepMin = value; stepMin = value;
this.MinValue.Text = stepMin.ToString("0.000");
this.MinValue.Text = stepMin.ToString("0.0000");
base.Refresh(); base.Refresh();
} }
} }


+ 1
- 1
halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs Näytä tiedosto

@@ -806,7 +806,7 @@
"实心圆带栅线", "实心圆带栅线",
"空心圆带栅线", "空心圆带栅线",
"矩形", "矩形",
"候补1",
"实心圆位于栅线内部",
"候补2"}); "候补2"});
this.cbMarkType.Location = new System.Drawing.Point(117, 78); this.cbMarkType.Location = new System.Drawing.Point(117, 78);
this.cbMarkType.Margin = new System.Windows.Forms.Padding(2); this.cbMarkType.Margin = new System.Windows.Forms.Padding(2);


Ladataan…
Peruuta
Tallenna