You need to sign in or sign up before continuing.
FlyADServiceClient.cs 2.96 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
using FLY.Thick.Base.Common;
潘栩锋's avatar
潘栩锋 committed
2
using FLY.Thick.Base.IService;
潘栩锋's avatar
潘栩锋 committed
3 4 5
using FObjBase;
using FObjBase.Reflect;
using System;
潘栩锋's avatar
潘栩锋 committed
6 7 8

namespace FLY.Thick.Base.Client
{
潘栩锋's avatar
潘栩锋 committed
9
    public class FlyADServiceClient : FObjBase.Reflect.Reflect_SeviceClient, IFlyADService
潘栩锋's avatar
潘栩锋 committed
10
    {
潘栩锋's avatar
潘栩锋 committed
11
        protected override Type InterfaceType => typeof(IFlyADService);
12 13
        public FlyADServiceClient(UInt32 serviceId) : base(serviceId) { }
        public FlyADServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }
潘栩锋's avatar
潘栩锋 committed
14 15
        #region IFlyAD接口

16

潘栩锋's avatar
潘栩锋 committed
17
        public string Addr { get; set; }
18 19 20

        public bool HasCRC { get; set; }

潘栩锋's avatar
潘栩锋 committed
21 22 23 24

        /// <summary>
        /// grid数据平滑
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
25 26
        public int GridSmooth { get; set; }

27 28 29
        /// <summary>
        /// 通过脉冲计算速度,不使用AD盒的输出
        /// </summary>
30
        public bool IsCalSpeed { get; set; }
31 32 33

        public int PosLen { get; set; }

34
        public MOTORTYPE MotorType { get; set; }
35

潘栩锋's avatar
潘栩锋 committed
36 37 38
        /// <summary>
        /// // 单位 pulse/grid
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
39
        public UInt16 PosOfGrid { get; set; }
40 41

        public UInt16 Ratio01 { get; set; }
潘栩锋's avatar
潘栩锋 committed
42

43 44 45 46 47 48 49 50 51 52 53

        public UInt16 Ratio02 { get; set; }


        public Int16 PosOffset { get; set; }


        /// <summary>
        /// 脉冲平移
        /// </summary>
        public UInt32 JogVelocity { get; set; }
潘栩锋's avatar
潘栩锋 committed
54
        public int ADLag { get; set; }
55 56 57
        /// <summary>
        /// 参数应用
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
58
        public void Apply()
潘栩锋's avatar
潘栩锋 committed
59
        {
潘栩锋's avatar
潘栩锋 committed
60
            Call(nameof(Apply));
潘栩锋's avatar
潘栩锋 committed
61 62 63 64
        }
        /// <summary>
        /// 获取序列码
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
65 66 67 68
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        [Call(typeof(AccessInfo))]
        public void GetAccessInfo(AsyncCBHandler asyncDelegate, object asyncContext)
潘栩锋's avatar
潘栩锋 committed
69
        {
潘栩锋's avatar
潘栩锋 committed
70
            Call(nameof(GetAccessInfo), null, asyncDelegate, asyncContext);
潘栩锋's avatar
潘栩锋 committed
71 72 73 74
        }
        /// <summary>
        /// 设置授权码
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
75 76 77 78 79
        /// <param name="access"></param>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        [Call(typeof(AccessInfo))]
        public void SetAccess(byte[] access, AsyncCBHandler asyncDelegate, object asyncContext)
潘栩锋's avatar
潘栩锋 committed
80
        {
潘栩锋's avatar
潘栩锋 committed
81
            Call(nameof(SetAccess), new { access }, asyncDelegate, asyncContext);
潘栩锋's avatar
潘栩锋 committed
82 83 84 85 86
        }

        /// <summary>
        /// 获取grid
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
87 88 89 90 91
        /// <param name="direction"></param>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        [Call(typeof(byte[]))]
        public void GetGrid(Misc.DIRECTION direction, AsyncCBHandler asyncDelegate, object asyncContext)
潘栩锋's avatar
潘栩锋 committed
92
        {
潘栩锋's avatar
潘栩锋 committed
93
            Call(nameof(SetAccess), new { direction }, asyncDelegate, asyncContext);
潘栩锋's avatar
潘栩锋 committed
94 95 96
        }


97 98 99 100 101
        /// <summary>
        /// 向AD盒获取数据
        /// </summary>
        public void UpdateParam()
        {
潘栩锋's avatar
潘栩锋 committed
102
            Call(nameof(UpdateParam));
103
        }
潘栩锋's avatar
潘栩锋 committed
104 105 106
        #endregion
    }
}