ResultData.cs 3.5 KB
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OnlineStore.DeviceLibrary
{
    public class ResultData
    {
        public int code { get; set; }
        public string msg { get; set; }
        public RobotStates data { get; set; }
    }
    public class RobotStates
    {
        public List<RobotState> robots { get; set; }
    }
    public class RobotState
    {
        /// <summary>
        /// 编码
        /// </summary>
        public string robotCode { get; set; }
        /// <summary>
        /// 型号
        /// </summary>
        public string robotTypeCode { get; set; }
        /// <summary>
        /// 节点编码
        /// 机器人当前所处节点
        /// </summary>
        public string pointCode { get; set; }
        /// <summary>
        /// 坐标X,单位mm
        /// </summary>
        public long positionX { get; set; }
        /// <summary>
        /// 坐标Y,单位mm
        /// </summary>
        public long positionY { get; set; }
        /// <summary>
        /// 电量
        /// </summary>
        public int energyLevel { get; set; }
        /// <summary>
        /// 机器人角度
        /// </summary>
        public int theta { get; set; }
        /// <summary>
        /// 货叉高度
        /// </summary>
        public long forkHeight { get; set; }
        /// <summary>
        /// 货叉长度
        /// </summary>
        public long forkLength { get; set; }
        /// <summary>
        /// 货叉相对机器人角度
        /// </summary>
        public int forkTheta { get; set; }
        /// <summary>
        /// 工作站编码
        /// </summary>

        public string stationCode { get; set; }
        /// <summary>
        /// 工作位编码
        /// </summary>
        public string locationCode { get; set; }
        /// <summary>
        /// 机器人状态
        /// UNAVAILABLE = 杀机器人后,在场外的状态
        ///UNKNOWN = 未知, 待初始化
        ///ERROR = 错误(机器人状态更新超时)
        ///IDLE = 空闲
        ///EXECUTING = 执行任务中
        ///AWAITING = 原地等待
        /// </summary>
        public string state { get; set; }
        /// <summary>
        /// 机器人硬件状态
        /// ROBOT_READY_TO_INIT = 机器人启动以后的初始状态,等待初始化指令
        ///ROBOT_IDLE = 空闲状态,等待任务指令(MOVE、BIN_OP)
        ///ROBOT_RUNNING = 运行状态(正在执行任务)
        ///ROBOT_ABNORMAL = 异常状态(内部故障,或者执行任务过程中发生异常需要处理)
        ///ROBOT_RECOVERY = 恢复状态
        ///ROBOT_PAUSED = 暂停状态
        /// </summary>
        public string hardwareState { get; set; }
        /// <summary>
        /// 背篓描述
        /// </summary>
        public List<tray> trays { get; set; }
    }

    public class tray
    {
        /// <summary>
        /// 背篓序号
        /// 货叉标识64
        /// </summary>
        public int trayLevel { get; set; }
        /// <summary>
        /// 容器编码
        /// 若背篓为空则为空
        /// </summary>
        public string containerCode { get; set; }
        /// <summary>
        /// 业务任务
        /// 容器对应的业务任务编码
        /// </summary>
        public List<string> taskCodes { get; set; }
        /// <summary>
        /// 位置编码
        /// 格式为机器人id#背篓序号
        /// </summary>
        public string positionCode { get; set; }
    }
}