From aea392117e859d7b1cd7a7313868426b78c2ae07 Mon Sep 17 00:00:00 2001 From: lhiven Date: Thu, 28 Sep 2023 14:54:23 +0900 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=9B=9E=E5=8E=9F=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.SkyLine/Commom/Ops.cs | 14 ++++++++++++++ Rs.SkyLine/Flow/HomeFlow.cs | 4 ++-- Rs.SkyLine/Flow/TestCenter.cs | 3 ++- Rs.SkyLine/FormMain.cs | 12 +----------- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Rs.SkyLine/Commom/Ops.cs b/Rs.SkyLine/Commom/Ops.cs index f4894cb..c86d0ac 100644 --- a/Rs.SkyLine/Commom/Ops.cs +++ b/Rs.SkyLine/Commom/Ops.cs @@ -128,6 +128,20 @@ namespace Rs.MotionPlat.Commom } + public static void GoHome() + { + if (MachineManage.Instance.MachineStatus == EMachineStatus.Homed + || MachineManage.Instance.MachineStatus == EMachineStatus.NotInit + || MachineManage.Instance.MachineStatus == EMachineStatus.NotHomed + ) + { + HomeFlow.Instance.StartGoHome(); + } + else + { + MessageQueue.Instance.Warn($"device state {MachineManage.Instance.MachineStatus} cann't home!"); + } + } public static bool IsStop(params string[] axies) { foreach (var axisname in axies) diff --git a/Rs.SkyLine/Flow/HomeFlow.cs b/Rs.SkyLine/Flow/HomeFlow.cs index 9714239..0afba15 100644 --- a/Rs.SkyLine/Flow/HomeFlow.cs +++ b/Rs.SkyLine/Flow/HomeFlow.cs @@ -40,9 +40,10 @@ namespace Rs.MotionPlat.Flow public void StartGoHome() { MachineManage.Instance.InitializeState = EInitializeState.Initializing ; + homeStep = 0; + m_bHomed = false; Task.Run(() => { - while (true && !m_bCancle && !m_bHomed) { switch (homeStep) @@ -58,7 +59,6 @@ namespace Rs.MotionPlat.Flow else { MessageQueue.Instance.Insert("Z轴开始回零"); - m_bHomed = false; homeTime.Restart(); MachineManage.Instance.MachineStatus = EMachineStatus.Homing; //料仓Z轴回零 diff --git a/Rs.SkyLine/Flow/TestCenter.cs b/Rs.SkyLine/Flow/TestCenter.cs index cb52cb2..a43802b 100644 --- a/Rs.SkyLine/Flow/TestCenter.cs +++ b/Rs.SkyLine/Flow/TestCenter.cs @@ -58,7 +58,8 @@ namespace Rs.MotionPlat.Flow case SchedulingStatusInfo.InfoType.InitializeState: if(ssi.Info==EInitializeState.Initializing.ToString()) { - MonitorSystemButton.Instance.ButtonPressed(ESystemButton.ResetPressed); + Ops.GoHome(); + //MonitorSystemButton.Instance.ButtonPressed(ESystemButton.ResetPressed); } break; case SchedulingStatusInfo.InfoType.AssignMode: diff --git a/Rs.SkyLine/FormMain.cs b/Rs.SkyLine/FormMain.cs index 9723dd8..9d7cd13 100644 --- a/Rs.SkyLine/FormMain.cs +++ b/Rs.SkyLine/FormMain.cs @@ -420,17 +420,7 @@ namespace Rs.MotionPlat private void btnWholeHome_Load(object sender, EventArgs e) { - if (MachineManage.Instance.MachineStatus == EMachineStatus.Homed - || MachineManage.Instance.MachineStatus == EMachineStatus.NotInit - || MachineManage.Instance.MachineStatus == EMachineStatus.NotHomed - ) - { - HomeFlow.Instance.StartGoHome(); - } - else - { - MessageQueue.Instance.Warn($"device state {MachineManage.Instance.MachineStatus} cann't home!"); - } + Ops.GoHome(); } private void btnSpaceRun_BtnClick(object sender, EventArgs e)