using System;
using System.ComponentModel;

namespace WCS.Entity.Protocol.SRM
{
    /// <summary>
    /// 运行模式
    /// </summary>
    public enum SrmRunSpeedEnum : short
    {
        /// <summary>
        ///  默认
        /// </summary>
        Default = 0,

        /// <summary>
        ///  低速
        /// </summary>
        LowSpeed = 1,
    }

    /// <summary>
    /// 任务类型
    /// </summary>
    public enum SrmTaskTypeEnum : short
    {
        /// <summary>
        ///  默认 出入库使用该任务类型
        /// </summary>
        Default = 0,

        /// <summary>
        ///  完成任务
        /// </summary>
        FinishTask = 1,

        /// <summary>
        ///  删除任务
        /// </summary>
        DeleteTask = 2,

        /// <summary>
        ///  移动任务
        /// </summary>
        MoveTask = 3,

        /// <summary>
        ///  移库任务
        /// </summary>
        MoveGoods = 4
    }

    /// <summary>
    /// 货叉位置
    /// </summary>
    public enum ForkPosition : short
    {
        /// <summary>
        ///  中位
        /// </summary>
        Centr = 0,

        /// <summary>
        ///  一深度
        /// </summary>
        OneDepth = 1,

        /// <summary>
        /// 二深度
        /// </summary>
        TwoDepth = 2
    }

    /// <summary>
    /// 运行模式
    /// </summary>
    public enum SrmAutoStatus : short
    {
        /// <summary>
        ///  自动
        /// </summary>
        [Description("自动")]
        Automatic = 1,

        /// <summary>
        ///  半自动
        /// </summary>
        [Description("半自动")]
        SemiAutomatic = 2,

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

        /// <summary>
        ///  保持维修
        /// </summary>
        [Description("保持维修")]
        KeepInRepair = 4
    }

    /// <summary>
    /// 运行状态
    /// </summary>
    public enum SrmRunStatus : short
    {
        /// <summary>
        ///  空闲
        /// </summary>
        Idle = 1,

        /// <summary>
        ///  取货行走
        /// </summary>
        GetGoodsWalk = 2,

        /// <summary>
        ///  取货伸叉
        /// </summary>
        GetGoodsOutstretchFork = 3,

        /// <summary>
        ///  取货抬叉
        /// </summary>
        GetGoodsLiftFork = 4,

        /// <summary>
        ///  取货收叉
        /// </summary>
        GetGoodsRetractFork = 5,

        /// <summary>
        ///  放货行走
        /// </summary>
        PutGoodsWalk = 6,

        /// <summary>
        ///  放货伸叉
        /// </summary>
        PutGoodsOutstretchFork = 7,

        /// <summary>
        ///  放货降叉
        /// </summary>
        PutGoodsDropFork = 8,

        /// <summary>
        ///  放货收叉
        /// </summary>
        PutGoodsRetractFork = 9,
    }

    /// <summary>
    /// 堆垛机状态
    /// </summary>
    [Flags]
    public enum SrmStatus : ushort
    {
        /// <summary>
        ///  PLC的握手信号
        /// </summary>
        HandshakeTowcs = 1 << 0,

        /// <summary>
        ///  完成取货信号
        /// </summary>
        GetFinishi = 1 << 1,

        /// <summary>
        ///  完成放货信号
        /// </summary>
        PutFinishi = 1 << 2,

        /// <summary>
        ///  报警信号
        /// </summary>
        Alarm = 1 << 3,

        /// <summary>
        ///  任务完成信号
        /// </summary>
        TaskFinish = 1 << 4,

        /// <summary>
        ///  设备有货
        /// </summary>
        Loaded = 1 << 5,

        /// <summary>
        ///  货叉在原位
        /// </summary>
        ForkCenter = 1 << 6,

        /// <summary>
        ///  可以下发任务
        /// </summary>
        CanTaskIssued = 1 << 7,

        /// <summary>
        ///  保留
        /// </summary>
        RES1 = 1 << 8,

        /// <summary>
        ///  保留
        /// </summary>
        RES2 = 1 << 9,

        /// <summary>
        ///  保留
        /// </summary>
        RES3 = 1 << 10,

        /// <summary>
        ///  保留
        /// </summary>
        RES4 = 1 << 11,

        /// <summary>
        ///  保留
        /// </summary>
        RES5 = 1 << 12,

        /// <summary>
        ///  保留
        /// </summary>
        RES6 = 1 << 13,

        /// <summary>
        ///  保留
        /// </summary>
        RES7 = 1 << 14,

        /// <summary>
        ///  保留
        /// </summary>
        RES8 = 1 << 15,
    }

    /// <summary>
    /// 堆垛机报警项
    /// </summary>
    [Flags]
    public enum SrmAlarm : ulong
    {
        /// <summary>
        ///  无
        /// </summary>
        无 = 0,

        /// <summary>
        ///  主柜急停
        /// </summary>
        主柜急停 = 1L << 0,

        /// <summary>
        ///  分柜急停
        /// </summary>
        分柜急停 = 1L << 1,

        /// <summary>
        ///  取货点异常双深位
        /// </summary>
        取货点异常双深位 = 1L << 2,

        /// <summary>
        ///  放货点有货
        /// </summary>
        放货点有货 = 1L << 3,

        /// <summary>
        ///  货叉取货完成后无货
        /// </summary>
        货叉取货完成后无货 = 1L << 4,

        /// <summary>
        ///  货叉无任务有货异常
        /// </summary>
        货叉无任务有货异常 = 1L << 5,

        /// <summary>
        /// 货叉运行超时
        /// </summary>
        货叉运行超时 = 1L << 6,

        /// <summary>
        ///  货叉左侧超行程
        /// </summary>
        货叉左侧超行程 = 1L << 7,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        货物左前坍塌 = 1L << 8,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        货物右前坍塌 = 1L << 9,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        前限位触发 = 1L << 10,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        后限位触发 = 1L << 11,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        上限位触发 = 1L << 12,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        下限位触发 = 1L << 13,

        /// <summary>
        ///  超载限位触发
        /// </summary>
        超载限位触发 = 1L << 14,

        /// <summary>
        ///  松绳限位触发1
        /// </summary>
        松绳限位触发1 = 1L << 15,

        /// <summary>
        ///  行走运动超行程
        /// </summary>
        行走运动超行程 = 1L << 16,

        /// <summary>
        ///  起升运动超行程
        /// </summary>
        起升运动超行程 = 1L << 17,

        /// <summary>
        ///  行走变频器报警
        /// </summary>
        行走变频器报警 = 1L << 18,

        /// <summary>
        ///  提升变频器报警
        /// </summary>
        提升变频器报警 = 1L << 19,

        /// <summary>
        ///  货叉变频器报警
        /// </summary>
        货叉变频器报警 = 1L << 20,

        /// <summary>
        ///  提升超速报警
        /// </summary>
        提升超速报警 = 1L << 21,

        /// <summary>
        ///  风扇灯插座空开
        /// </summary>
        风扇灯插座空开 = 1L << 22,

        /// <summary>
        ///  触摸屏光通讯激光测距空开
        /// </summary>
        触摸屏光通讯激光测距空开 = 1L << 23,

        /// <summary>
        ///  行走马达保护器
        /// </summary>
        行走马达保护器 = 1L << 24,

        /// <summary>
        ///  行走抱闸空开
        /// </summary>
        行走抱闸空开 = 1L << 25,

        /// <summary>
        ///  起升马达保护器
        /// </summary>
        起升马达保护器 = 1L << 26,

        /// <summary>
        ///  起升抱闸空开
        /// </summary>
        起升抱闸空开 = 1L << 27,

        /// <summary>
        ///  货叉马达保护器
        /// </summary>
        货叉马达保护器 = 1L << 28,

        /// <summary>
        ///  货叉抱闸空开
        /// </summary>
        货叉抱闸空开 = 1L << 29,

        /// <summary>
        ///  安全门打开
        /// </summary>
        安全门打开 = 1L << 30,

        /// <summary>
        ///  安全继电器报警
        /// </summary>
        安全继电器报警 = 1L << 31,

        /// <summary>
        ///  当前货位已禁用
        /// </summary>
        当前货位已禁用 = 1L << 32,

        /// <summary>
        ///  组态中断报警
        /// </summary>
        组态中断报警 = 1L << 33,

        /// <summary>
        ///  货物左前超出
        /// </summary>
        货物左前超出 = 1L << 34,

        /// <summary>
        ///  货物左后超出
        /// </summary>
        货物左后超出 = 1L << 35,

        /// <summary>
        ///  货物右前超出
        /// </summary>
        货物右前超出 = 1L << 36,

        /// <summary>
        ///  货物右后超出
        /// </summary>
        货物右后超出 = 1L << 37,

        /// <summary>
        ///  相序保护
        /// </summary>
        相序保护 = 1L << 38,

        /// <summary>
        ///  备用
        /// </summary>
        备用 = 1L << 39,

        /// <summary>
        ///  安全门1报警
        /// </summary>
        安全门1报警 = 1L << 40,

        /// <summary>
        ///  安全门2报警
        /// </summary>
        安全门2报警 = 1L << 41,

        /// <summary>
        ///  行走测距信号丢失报警
        /// </summary>
        行走测距信号丢失报警 = 1L << 42,

        /// <summary>
        ///  提升测距信号丢失报警
        /// </summary>
        提升测距信号丢失报警 = 1L << 43,

        /// <summary>
        ///  行走定位失败
        /// </summary>
        行走定位失败 = 1L << 44,

        /// <summary>
        ///  提升定位失败
        /// </summary>
        提升定位失败 = 1L << 45,

        /// <summary>
        ///  回中定位失败
        /// </summary>
        回中定位失败 = 1L << 46,

        /// <summary>
        ///  堆垛机巷道有人进入光通讯中断
        /// </summary>
        堆垛机巷道有人进入光通讯中断 = 1L << 47,

        /// <summary>
        ///  货叉位置错误
        /// </summary>
        货叉位置错误 = 1L << 48,

        /// <summary>
        ///  货叉编码器报警
        /// </summary>
        货叉编码器报警 = 1L << 49,

        /// <summary>
        ///  货叉编码器报警中间位
        /// </summary>
        货叉编码器报警中间位 = 1L << 50,

        /// <summary>
        ///  货叉中位光电异常
        /// </summary>
        货叉中位光电异常 = 1L << 51,

        /// <summary>
        ///  载货台电源空开
        /// </summary>
        载货台电源空开 = 1L << 52,

        /// <summary>
        ///  按钮, 安全回路空开
        /// </summary>
        按钮安全回路空开 = 1L << 53,

        /// <summary>
        ///  货物左前坍塌
        /// </summary>
        货物左后坍塌 = 1L << 54,

        /// <summary>
        ///  货物右前坍塌
        /// </summary>
        货物右后坍塌 = 1L << 55,

        /// <summary>
        ///  登梯口急停
        /// </summary>
        登梯口急停 = 1L << 56,

        /// <summary>
        ///  货物左超高19M
        /// </summary>
        货物左超高19M = 1L << 57,

        /// <summary>
        ///  货物右超高19M
        /// </summary>
        货物右超高19M = 1L << 58,

        /// <summary>
        ///  松绳限位触发2
        /// </summary>
        松绳限位触发2 = 1L << 59,

        /// <summary>
        ///  货叉右侧超行程
        /// </summary>
        货叉右侧超行程 = 1L << 60,

        /// <summary>
        ///  取放货托盘总数超出限制
        /// </summary>
        取放货托盘总数超出限制 = 1L << 61,

        /// <summary>
        ///  安全门急停
        /// </summary>
        安全门急停 = 1L << 62,
    }
}
