From d837271cee6e69864898963cc0c3bd694b732d9f Mon Sep 17 00:00:00 2001
From: C3031 <shitiangui@lanpucloud.cn>
Date: 星期一, 05 一月 2026 12:30:13 +0800
Subject: [PATCH] 新增了历史数据查询界面优化了了历史数据查询界面操作逻辑Merge branch 'master' of http://lanpucloud.cn:1111/r/~zhengyabo/LB_TyreAppearanceInspectionSoftware
---
LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs | 45 ++++++++++++++++++++++++---------------------
1 files changed, 24 insertions(+), 21 deletions(-)
diff --git a/LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs b/LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs
index 3e3f7f4..1642a11 100644
--- a/LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs
+++ b/LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs
@@ -1,7 +1,8 @@
锘縰sing HalconDotNet;
+using LB_SmartVision.Forms.Pages.SettingPage;
using LB_SmartVision.ProcessRun;
using LB_VisionControl;
-using Layout = LB_SmartVision.Forms.Pages.SettingPage.Layout;
+
namespace LB_SmartVision.Forms.Pages.ProcessPage
{
@@ -42,6 +43,11 @@
if (ProcessRunBll != null)
this.label1.Text = $"鎬绘暟锛歿ProcessRunBll.total}";
+ this.isClosed = false ;
+ var TaskPhotoContinue = Task.Factory.StartNew(() =>
+ {
+ ThreadCircleRun();
+ });
}
public void SetTitle(string title)
@@ -148,37 +154,36 @@
if (isCircleRuning)
{
- threadCircleRun = new Thread(ThreadCircleRun);
- threadCircleRun.IsBackground = true;
- threadCircleRun.Start();
+ this.mAutoResetEvent.Set();
}
else
{
isCircleRuning = false;
- threadCircleRun.Abort();
}
+ if (!isCircleRuning)
+ {
+ ProcessRunBll.LogInfo($"{ProcessRunBll.Name}鍏抽棴杩炵画杩愯", LogInfoType.PASS);
+ return;
+ }
+
+ ProcessRunBll.LogInfo($"{ProcessRunBll.Name}寮�鍚繛缁繍琛�", LogInfoType.WARN);
}
catch { }
}
-
- Thread threadCircleRun = null;
+ private AutoResetEvent mAutoResetEvent = new AutoResetEvent(false);
+ bool isClosed = false;
void ThreadCircleRun()
{
- if (!isCircleRuning)
+ while (!isClosed)
{
- ProcessRunBll.LogInfo($"{ProcessRunBll.Name}鍏抽棴杩炵画杩愯", LogInfoType.PASS);
- return;
- }
-
- ProcessRunBll.LogInfo($"{ProcessRunBll.Name}寮�鍚繛缁繍琛�", LogInfoType.WARN);
-
- while (isCircleRuning)
- {
- //this.BeginInvoke(new Action(() =>
- //{
try
{
+ if (isCircleRuning == false)
+ {
+ this.mAutoResetEvent.WaitOne();
+ }
+
ProcessRunBll.LogInfo($"{ProcessRunBll.Name}寮�濮嬭繍琛�", LogInfoType.WARN);
ClearObj();
bool result = ProcessRunBll.Run();
@@ -191,9 +196,7 @@
ShowHoImage(RecordImage);
}
catch { }
- //}));
-
- Thread.Sleep(100);
+ Thread.Sleep(33);
}
}
--
Gitblit v1.9.3