领胜LDS 键盘AOI检测项目
xcd
2020-07-04 753b5add58defa5c09015308efb81bcaea0ebe91
src/Bro.UI.Config/MenuForms/FrmOperation.cs
@@ -140,7 +140,7 @@
        }
        bool isStart = true;
        private void btnStart_Click(object sender, System.EventArgs e)
        private async void btnStart_Click(object sender, System.EventArgs e)
        {
            if (Process == null)
            {
@@ -157,11 +157,11 @@
                //if (Process.ProcessState != EnumHelper.DeviceState.DSOpen)
                if (isStart)
                {
                    ProcessOperation(true);
                    await ProcessOperation(true);
                }
                else
                {
                    ProcessOperation(false);
                    await ProcessOperation(false);
                }
                isStart = !isStart;
@@ -172,7 +172,8 @@
            }
            finally
            {
                this.BeginInvoke(new Action(() => btnStart.Enabled = true));
                //this.BeginInvoke(new Action(() => btnStart.Enabled = true));
                btnStart.Enabled = true;
            }
            //});
        }
@@ -255,11 +256,11 @@
        //    }
        //}
        private void ProcessOperation(bool isStart)
        private async Task ProcessOperation(bool isStart)
        {
            if (isStart)
            {
                Process.Open();
                await Task.Run(() => Process.Open());
                //this.BeginInvoke(new Action(() =>
                //{
@@ -273,7 +274,7 @@
            }
            else
            {
                Process.Close();
                await Task.Run(() => Process.Close());
                //this.BeginInvoke(new Action(() =>
                //{