From c53da0f3c58241447f9682f362c9da44fcf296dc Mon Sep 17 00:00:00 2001 From: lhiven Date: Fri, 12 Jul 2024 14:06:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=8B=E5=8A=A8=E3=80=81?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=BD=93=E4=B8=AD?= =?UTF-8?q?=E6=8E=A7=E5=90=AF=E5=8A=A8=E6=97=B6=EF=BC=8C=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BA=E8=87=AA=E5=8A=A8=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/GlobalVar.cs | 2 +- Rs.SkyLine/Flow/BaseFlow.cs | 2 +- Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs | 2 +- Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs | 2 +- Rs.SkyLine/FormMain.cs | 20 ++++++++++++++++++-- Rs.SkyLine/Properties/AssemblyInfo.cs | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Rs.SkyLine/Commom/GlobalVar.cs b/Rs.SkyLine/Commom/GlobalVar.cs index 301e9f6..f53fbe1 100644 --- a/Rs.SkyLine/Commom/GlobalVar.cs +++ b/Rs.SkyLine/Commom/GlobalVar.cs @@ -1796,7 +1796,7 @@ namespace Rs.Framework /// /// 设备是否是自动状态 /// - public static bool DeviceIsAuto { get; set; } = true; + //public static bool DeviceIsAuto { get; set; } = true; /// /// Empty2取料盘模式(1、真空吸 2、夹爪 3、真空吸和夹爪) diff --git a/Rs.SkyLine/Flow/BaseFlow.cs b/Rs.SkyLine/Flow/BaseFlow.cs index 7eb4d99..3b01093 100644 --- a/Rs.SkyLine/Flow/BaseFlow.cs +++ b/Rs.SkyLine/Flow/BaseFlow.cs @@ -35,7 +35,7 @@ namespace Rs.MotionPlat.Flow private void task() { while (b_IsRun) { - if(b_IsStop || !GlobalVar.DeviceIsAuto) + if(b_IsStop || MachineManage.Instance.RunMode == ERunMode.Manual) { Thread.Sleep(stopWaitTime); continue; diff --git a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs index 924eda0..48e923c 100644 --- a/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/DischargeFlow.cs @@ -158,7 +158,7 @@ namespace Rs.MotionPlat.Flow { while (run) { - if(stop || !GlobalVar.DeviceIsAuto) + if(stop || MachineManage.Instance.RunMode == ERunMode.Manual) { Thread.Sleep(10); continue; diff --git a/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs b/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs index bf2dfee..066a224 100644 --- a/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs +++ b/Rs.SkyLine/Flow/NormalFlow/TurnoverFlow.cs @@ -211,7 +211,7 @@ namespace Rs.MotionPlat.Flow { while (run) { - if(stop || !GlobalVar.DeviceIsAuto) + if(stop || MachineManage.Instance.RunMode == ERunMode.Manual) { Thread.Sleep(10); continue; diff --git a/Rs.SkyLine/FormMain.cs b/Rs.SkyLine/FormMain.cs index f2e8c48..997dcf6 100644 --- a/Rs.SkyLine/FormMain.cs +++ b/Rs.SkyLine/FormMain.cs @@ -178,6 +178,14 @@ namespace Rs.MotionPlat if (btnWholeHome.Visible == false) btnWholeHome.Visible = true; } + if(MachineManage.Instance.RunMode== ERunMode.Automatic && !switchButton1.Checked) + { + switchButton1.Checked = true; + } + else if (MachineManage.Instance.RunMode == ERunMode.Manual && switchButton1.Checked) + { + switchButton1.Checked = false; + } } private void FormMain_Load(object sender, EventArgs e) @@ -269,7 +277,7 @@ namespace Rs.MotionPlat //StockManager.Instance.Start(); LoadStockStatus(); HOperatorSet.ReadImage(out defaultImage, "default.bmp"); - switchButton1.Checked = GlobalVar.DeviceIsAuto; + switchButton1.Checked = MachineManage.Instance.RunMode == ERunMode.Automatic; } /// @@ -653,7 +661,15 @@ namespace Rs.MotionPlat private void switchButton1_Click(object sender, EventArgs e) { - GlobalVar.DeviceIsAuto = switchButton1.Checked; + //GlobalVar.DeviceIsAuto = switchButton1.Checked; + if(switchButton1.Checked) + { + MachineManage.Instance.RunMode = ERunMode.Automatic; + } + else + { + MachineManage.Instance.RunMode = ERunMode.Manual; + } } } } diff --git a/Rs.SkyLine/Properties/AssemblyInfo.cs b/Rs.SkyLine/Properties/AssemblyInfo.cs index cb3c394..02ac011 100644 --- a/Rs.SkyLine/Properties/AssemblyInfo.cs +++ b/Rs.SkyLine/Properties/AssemblyInfo.cs @@ -31,6 +31,6 @@ using System.Runtime.InteropServices; // //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: - [assembly: AssemblyVersion("3.20.24.31")] + [assembly: AssemblyVersion("3.20.24.32")] //[assembly: AssemblyVersion("1.0.0.0")] //[assembly: AssemblyFileVersion("1.0.0.0")]