From 437c0cec4868e25cfc35ede82acbf6281156ea89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=82=E6=84=8F=20=E5=BD=AD?= <2417589739@qq.com> Date: Sat, 19 Mar 2022 11:58:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=BA=E5=99=A8=E4=BA=BA=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HBLConsole.Communication/LebaiHelper.cs | 13 +++++++++++++ HBLConsole.Model/ELebaiRModel.cs | 26 +++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 HBLConsole.Model/ELebaiRModel.cs diff --git a/HBLConsole.Communication/LebaiHelper.cs b/HBLConsole.Communication/LebaiHelper.cs index f59ce4a..c7fc315 100644 --- a/HBLConsole.Communication/LebaiHelper.cs +++ b/HBLConsole.Communication/LebaiHelper.cs @@ -8,6 +8,7 @@ using HBLConsole.Service; using Lebai.SDK; using Lebai.SDK.Dtos; using Robotc; +using HBLConsole.Model; namespace HBLConsole.Communication { @@ -53,6 +54,18 @@ namespace HBLConsole.Communication //robotData.RobotMode.Mode } + public void GetRobotModeStatus() + { + if (robotData == null) return; + int mode = robotData.RobotMode.Mode; + for (int i = 0; i < 14; i++) + { + if (RTrig.GetInstance(((ELebaiRModel)i).ToString()).Start(mode == i)) + MessageLog.GetInstance.Show(((ELebaiRModel)i).ToString()); + } + + } + /// /// 启动机器人 /// diff --git a/HBLConsole.Model/ELebaiRModel.cs b/HBLConsole.Model/ELebaiRModel.cs new file mode 100644 index 0000000..fb2941a --- /dev/null +++ b/HBLConsole.Model/ELebaiRModel.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace HBLConsole.Model +{ + public enum ELebaiRModel : int + { + 硬件通讯故障 = 0, + 已急停 = 1, + 初始化中 = 2, + 已关机 = 3, + 已开机 = 4, + 空闲状态 = 5, + 暂停中 = 6, + 运行中 = 7, + 固件更新中 = 8, + 启动中 = 9, + 停止中 = 10, + 示教中 = 11, + 普通停止 = 12, + 微调中 = 13 + } +}