FlyAD_Common.cs 2.52 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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

    /// <summary>
    /// 密码区状态
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
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 60 61
    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
    }

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

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

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

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

92 93 94 95
        /// <summary>
        /// 剩余时间
        /// </summary>
        public UInt16 surplus;
潘栩锋's avatar
潘栩锋 committed
96

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

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



}