FilmPositionDetectServiceClient.cs 3.2 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
using FLY.Thick.Base.Common;
2
using FLY.Thick.Base.IService;
潘栩锋's avatar
潘栩锋 committed
3
using FObjBase.Reflect;
4 5 6 7 8 9 10
using System;

namespace FLY.Thick.Base.Client
{
    /// <summary>
    /// 
    /// </summary>
潘栩锋's avatar
潘栩锋 committed
11
    public class FilmPositionDetectServiceClient : FObjBase.Reflect.Reflect_SeviceClient, IFilmPositionDetectService
12
    {
潘栩锋's avatar
潘栩锋 committed
13
        protected override Type InterfaceType => typeof(IFilmPositionDetectService);
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
        /// <summary>
        /// AD 曲线服务 客户端代理
        /// </summary>
        /// <param name="id"></param>
        public FilmPositionDetectServiceClient(UInt32 id) : base(id) { }

        /// <summary>
        /// AD 曲线服务 客户端代理
        /// </summary>
        /// <param name="serviceId">服务id</param>
        /// <param name="connName">连接器</param>
        public FilmPositionDetectServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }

        #region 状态

        /// <summary>
潘栩锋's avatar
潘栩锋 committed
30
        /// 线速度 m/min
31
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
32
        public double FilmVelocity { get; set; }
33 34

        /// <summary>
潘栩锋's avatar
潘栩锋 committed
35
        /// 膜位置, m
36
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
37
        public double FilmPosition { get; set; }
38 39

        /// <summary>
潘栩锋's avatar
潘栩锋 committed
40
        /// 复位标识,从同步服务器发送过来的
41
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
42
        public int ResetMark { get; set; }
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
        #endregion

        #region 参数
        /// <summary>
        /// 线速度阀值,低于阀值,速度直接变为0
        /// </summary>
        public double FilmVThreshold { get; set; }

        /// <summary>
        /// 线速度来源
        /// </summary>
        public FilmVSRC FilmVSrc { get; set; }

        /// <summary>
        /// 线速度:编码器2 mm/pulse
        /// </summary>
        public double Encoder2_mmpp { get; set; }

        /// <summary>
        /// 线速度:1圈多少mm
        /// </summary>
        public double MmOfR { get; set; }


        #endregion
        /// <summary>
        /// 设置膜位置为某值
        /// </summary>
        /// <param name="filmPos">极片位置m</param>
潘栩锋's avatar
潘栩锋 committed
72
        public void Reset(double filmPos)
73
        {
潘栩锋's avatar
潘栩锋 committed
74
            Call(nameof(Reset), new { filmPos = filmPos });
75 76 77 78
        }


        /// <summary>
潘栩锋's avatar
潘栩锋 committed
79
        /// 让同步信号输出 1->0
80
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
81
        public void SyncSysTime()
82
        {
潘栩锋's avatar
潘栩锋 committed
83
            Call(nameof(SyncSysTime));
84 85 86
        }

        /// <summary>
潘栩锋's avatar
潘栩锋 committed
87 88 89
        /// 纵向光纤传感器检测到 0到1 变化 事件 
        /// 或
        /// sysTime同步信号触发 0到1 变化 事件 
90
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
91 92 93
        [Push(typeof(SysTimeFilmPosEventArgs))]
        public event EventHandler SysTimeFilmPosEvent;
        public void Trigger_SysTimeFilmPosEvent(SysTimeFilmPosEventArgs e)
94
        {
潘栩锋's avatar
潘栩锋 committed
95
            SysTimeFilmPosEvent?.Invoke(this, e);
96 97
        }
        /// <summary>
潘栩锋's avatar
潘栩锋 committed
98
        /// 设置膜位置为某值; 同步服务器调用的
99
        /// </summary>
潘栩锋's avatar
潘栩锋 committed
100 101 102 103
        /// <param name="filmPos">极片位置m</param>
        /// <param name="sysTime">AD盒sysTime</param>
        /// <param name="resetMark">复位标识</param>
        public void Reset(double filmPos, DateTime sysTime, int resetMark)
104
        {
潘栩锋's avatar
潘栩锋 committed
105
            Call(nameof(Reset), new { filmPos = filmPos, sysTime = sysTime, resetMark = resetMark });
106 107 108
        }
    }
}