using System;
using System.ComponentModel;

namespace WCS.Entity.Protocol.Protocol.Robot
{
    /// <summary>
    ///  机械手工位状态
    /// </summary>
    [Flags]
    public enum RobotState : ushort
    {
        /// <summary>
        ///  完成取货信号
        /// </summary>
        [Description("完成取货信号")]
        GetFinish = 1 << 0,

        /// <summary>
        ///  完成放货信号
        /// </summary>
        [Description("完成放货信号")]
        PutFinish = 1 << 1,

        /// <summary>
        ///  设备故障状态
        /// </summary>
        [Description("设备故障状态")]
        Alarm = 1 << 2,

        /// <summary>
        ///  当前任务完成
        /// </summary>
        [Description("当前任务完成")]
        TaskFinish = 1 << 3,

        /// <summary>
        ///  设备上有货
        /// </summary>
        [Description("设备上有货")]
        Loaded = 1 << 4,

        /// <summary>
        ///  机器人在原位
        /// </summary>
        [Description("机器人在原位")]
        ForkCenter = 1 << 5,

        /// <summary>
        ///  反馈WCS能否发任务，1:可以发任务 0:不能发任务
        /// </summary>
        [Description("反馈WCS能否发任务，1:可以发任务 0:不能发任务")]
        IssueTask = 1 << 6,

        /// <summary>
        ///  备用s
        /// </summary>
        [Description("备用")]
        Res = 1 << 7,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res1 = 1 << 8,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res2 = 1 << 9,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res3 = 1 << 10,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res4 = 1 << 11,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res5 = 1 << 12,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res6 = 1 << 13,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res7 = 1 << 14,

        /// <summary>
        ///  备用
        /// </summary>
        [Description("备用")]
        Res8 = 1 << 15,
    }

    /// <summary>
    ///  机械臂模式
    /// </summary>
    public enum RobotMode : short
    {
        /// <summary>
        ///  自动
        /// </summary>
        [Description("自动")]
        自动 = 1,

        /// <summary>
        ///  手动
        /// </summary>
        [Description("手动")]
        手动 = 2,

        /// <summary>
        ///  报警
        /// </summary>
        [Description("报警")]
        故障 = 3
    }

    /// <summary>
    ///  机械臂运行状态
    /// </summary>
    public enum RobotRunStatus : short
    {
        /// <summary>
        ///  空闲
        /// </summary>
        [Description("空闲")]
        空闲 = 1,

        /// <summary>
        ///  入库抓取中
        /// </summary>
        [Description("入库抓取中")]
        抓取中 = 2,

        /// <summary>
        ///  入库放置中
        /// </summary>
        [Description("入库放置中")]
        放置中 = 3, 
    }

    /// <summary>
    ///  机械臂报警
    /// </summary>
    [Flags]
    public enum RobotAlarm : Int32
    {
        气压不足 = 1 << 0,
        集合故障 = 1 << 1,
        相机拍照报警 = 1 << 2,
        真空报警 = 1 << 3,
        夹具打开报警 = 1 << 4,
        夹具关闭报警 = 1 << 5,
        吸盘上升报警 = 1 << 6,
        吸盘下降报警 = 1 << 7,
        一号位抓取无货 = 1 << 8,
        二号位抓取无货 = 1 << 9,
        掉料检测1报警 = 1 << 10,
        掉料检测2报警 = 1 << 11,
        掉料检测3报警 = 1 << 12,
        任务数据错误 = 1 << 13
    }

    /// <summary>
    ///  机械臂指令
    /// </summary>
    [Flags]
    public enum RobotCmdType : ushort
    {
        /// <summary>
        /// 码垛结束
        /// </summary>
        [Description("码垛结束")]
        End = 1 >> 0,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res7 = 1 >> 1,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res8 = 1 >> 2,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res9 = 1 >> 3,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res10 = 1 >> 4,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res11 = 1 >> 5,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res12 = 1 >> 6,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res13 = 1 >> 7,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res14 = 1 >> 8,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res = 1 >> 9,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res1 = 1 >> 10,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res2 = 1 >> 11,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res3 = 1 >> 12,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res4 = 1 >> 13,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res5 = 1 >> 14,

        /// <summary>
        /// 备用
        /// </summary>
        [Description("备用")]
        Res6 = 1 >> 15,
    }

    public enum RobotStationCmd : short
    {
        开始码垛 = 1,
        强制完成 = 2,
        完成确认 = 3
    }

    public enum RobotStationRqst : short
    {
        完成码垛 = 1
    }

    public enum RobotCmd : short
    {
        抓取 = 1,
        抓取完成确认 = 2,
    }
    public enum RobotRqst : short
    {
        抓取完成 = 1,
    }
}
