From 8c50e1277b8d07cc49859526d4f59f70f52a9beb Mon Sep 17 00:00:00 2001 From: applelon <380149513@qq.com> Date: Sat, 19 Mar 2022 13:22:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B9=90=E7=99=BD=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E8=BF=9E=E6=8E=A5=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole.Communication/LebaiHelper.cs | 2 ++ HBLConsole.MORKIC/Control_MORKIC.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/HBLConsole.Communication/LebaiHelper.cs b/HBLConsole.Communication/LebaiHelper.cs index f59ce4a..8cfc860 100644 --- a/HBLConsole.Communication/LebaiHelper.cs +++ b/HBLConsole.Communication/LebaiHelper.cs @@ -19,6 +19,8 @@ namespace HBLConsole.Communication private LebaiHelper() { } private LebaiRobotClient client; private RobotData robotData; + public bool IsConnected { get { return null != robotData; } } + public void Connect(string ip) { bool ErrorFlag = false; diff --git a/HBLConsole.MORKIC/Control_MORKIC.cs b/HBLConsole.MORKIC/Control_MORKIC.cs index 15370b7..9202eb5 100644 --- a/HBLConsole.MORKIC/Control_MORKIC.cs +++ b/HBLConsole.MORKIC/Control_MORKIC.cs @@ -60,7 +60,7 @@ namespace HBLConsole.MORKIC /// /// 获取乐百机器人的数据 /// - SignalResult lebai=new SignalResult(); + SignalResult lebai = new SignalResult(); public void ConnectOk() { @@ -246,6 +246,7 @@ namespace HBLConsole.MORKIC { //GeneralConfig.Healthy = true; GeneralConfig.Healthy = + LebaiHelper.GetInstance.IsConnected && MorkIStatus.GetInstance().CanDo && MorkCStatus.GetInstance().CanDo; Thread.Sleep(100);