Browse Source

机器人控制添加

master
pry 2 years ago
parent
commit
437c0cec48
2 changed files with 39 additions and 0 deletions
  1. +13
    -0
      HBLConsole.Communication/LebaiHelper.cs
  2. +26
    -0
      HBLConsole.Model/ELebaiRModel.cs

+ 13
- 0
HBLConsole.Communication/LebaiHelper.cs View File

@@ -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());
}

}

/// <summary>
/// 启动机器人
/// </summary>


+ 26
- 0
HBLConsole.Model/ELebaiRModel.cs View File

@@ -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
}
}

Loading…
Cancel
Save