FlyAD_Common.cs 2.47 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
using System;
潘栩锋's avatar
潘栩锋 committed
2
using System.ComponentModel;
潘栩锋's avatar
潘栩锋 committed
3 4 5

namespace FLY.Thick.Base.Common
{
6 7 8
    /// <summary>
    /// 电机类型
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
9 10
    public enum MOTORTYPE
    {
11 12 13
        /// <summary>
        /// 没有
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
14
        NULL = 0,
15 16 17
        /// <summary>
        /// 变频器
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
18
        VF0 = 1,
19 20 21
        /// <summary>
        /// 伺服电器
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
22 23
        SERVO = 2
    }
24 25 26 27

    /// <summary>
    /// 密码区状态
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
    public enum AREA_STATUS
    {
        /// <summary>
        /// 没有读过密码区
        /// </summary>
        NOTLOAD = 0,
        /// <summary>
        /// 读出错
        /// </summary>
        RDERR = 1,
        /// <summary>
        /// 非有效密码区 没有0xAA55 或 0x5A5A 标志
        /// </summary>
        NOTVALID = 2,
        /// <summary>
        /// 写出错
        /// </summary>
        WRERR = 3,
        /// <summary>
        /// 有效密码区
        /// </summary>
        VALID = 4,
        /// <summary>
        /// 有效密码区,应回写EEPROM
        /// </summary>
        VALID_DIRTY = 5,
        /// <summary>
        /// 有效密码区,但回写EEPROM失败
        /// </summary>
        VALID_WRERR = 6
    }

60 61 62
    /// <summary>
    /// 密码区错误内容
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
63 64 65 66 67 68 69
    public enum AREA_ERR
    {
        NO_ERR = 0, // 没有错误
        DUP_ACCESS = 1,//  重复使用码 
        ERR_ACCESS = 2//无效使用码
    }

70 71 72
    /// <summary>
    /// 授权码包
    /// </summary>
73
    public class AccessInfo
潘栩锋's avatar
潘栩锋 committed
74
    {
75 76 77
        /// <summary>
        /// 密码区状态
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
78 79
        public AREA_STATUS status;

80 81 82 83
        /// <summary>
        /// 操作结果
        /// </summary>
        public AREA_ERR ret;
潘栩锋's avatar
潘栩锋 committed
84

85 86 87 88
        /// <summary>
        /// 序列码
        /// </summary>
        public byte[] code = new byte[7];
潘栩锋's avatar
潘栩锋 committed
89

90 91 92
        /// <summary>
        /// 剩余时间
        /// </summary>
93
        public int surplus;
潘栩锋's avatar
潘栩锋 committed
94

95 96 97 98
        /// <summary>
        /// 授权码
        /// </summary>
        public byte[] access = new byte[8];
潘栩锋's avatar
潘栩锋 committed
99 100
    }

101 102 103
    /// <summary>
    /// grid 数据包
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
104 105
    public class GridInfo
    {
106 107 108
        /// <summary>
        /// 数据方向
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
109
        public Misc.DIRECTION direction;
110 111 112
        /// <summary>
        /// AD值数据
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
113
        public int[] data;
114 115 116 117
        /// <summary>
        /// 厚度值数据
        /// </summary>
        public double[] thick;
潘栩锋's avatar
潘栩锋 committed
118 119 120 121 122
    }



}