From 00ea1cd461d6d8d128d727f6a40edca75da9ccdd Mon Sep 17 00:00:00 2001
From: xcd <834800634@qq.com>
Date: 星期三, 08 七月 2020 16:38:46 +0800
Subject: [PATCH] 相机运行界面基类添加操作配置 gocator驱动修正长宽比例,输出进行复制插值处理 显示基元添加8个方向的拉伸和移动处理 标签基元实现3个方向的拉伸和移动

---
 src/Bro.UI.Config/MenuForms/FrmOperation.cs |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/Bro.UI.Config/MenuForms/FrmOperation.cs b/src/Bro.UI.Config/MenuForms/FrmOperation.cs
index 891d678..025c4fb 100644
--- a/src/Bro.UI.Config/MenuForms/FrmOperation.cs
+++ b/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(() =>
                 //{

--
Gitblit v1.8.0