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);