IBlowingFixService.cs 4.26 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 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
using FObjBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace FLY.Thick.Blowing.IService
{
    /// <summary>
    /// 追边测厚仪
    /// </summary>
    public interface IBlowingFixService : IBlowing
    {
        #region 温修
        /// <summary>
        /// 追边开始按钮自锁
        /// </summary>
        bool IsBtnSelfHold { get; set; }
        /// <summary>
        /// 追边模式
        /// </summary>
        RenZiJiaFixEPCType EPCType { get; set; }

        /// <summary>
        /// 温修时间,默认2秒
        /// </summary>
        TimeSpan SampleConsume { get; set; }

        /// <summary>
        /// 温修间隔,默认45分钟
        /// </summary>
        TimeSpan SampleInterval { get; set; }

        /// <summary>
        /// 当前温修计时,大于温修间隔就会去温修
        /// </summary>
        TimeSpan SampleTimer { get; }

        /// <summary>
        /// 回到边界后,再等待一段时间,那就肯定找到边界了。 默认5s
        /// </summary>
        TimeSpan BackEdgeWait { get; set; }

        /// <summary>
        /// 采样得到的样品AD
        /// </summary>
        int SampleAD { get; }
        /// <summary>
        /// 追边运行中!
        /// </summary>
        bool EPCIsRunning { get; }

        #endregion

        #region 功能
潘栩锋's avatar
潘栩锋 committed
57

潘栩锋's avatar
潘栩锋 committed
58 59 60 61 62 63 64 65 66 67

        /// <summary>
        /// 追边开始
        /// </summary>
        void EPCStart();

        /// <summary>
        /// 追边停止
        /// </summary>
        void EPCStop();
潘栩锋's avatar
潘栩锋 committed
68 69 70 71 72 73 74 75 76 77


        /// <summary>
        /// 获取 立式旋转架 的 膜距离增量
        /// </summary>
        /// <param name="begin">开始时间</param>
        /// <param name="AsyncDelegate">retdata = GetFilmLength3DReponse</param>
        /// <param name="AsyncState"></param>
        void GetADList(DateTime begin, AsyncCBHandler AsyncDelegate, object AsyncState);

潘栩锋's avatar
潘栩锋 committed
78 79 80 81 82 83 84 85 86 87 88 89
        #endregion
    }
    /// <summary>
    /// 温修对位硬件类型
    /// </summary>
    public enum RenZiJiaFixEPCType
    {
        Null,
        EPCA10
    }


潘栩锋's avatar
潘栩锋 committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
    public class ADCell:INotifyPropertyChanged
    {
        /// <summary>
        /// 测量的时间
        /// </summary>
        public DateTime Time { get; set; }
        /// <summary>
        /// 用于修正AB值,温修AD后,重新计算thick。
        /// </summary>
        public int Ad { get; set; } = Misc.MyBase.NULL_VALUE;

        /// <summary>
        /// 探头测量 膜对位的角度 0~360°
        /// </summary>
        public List<double> Angles { get; } = new List<double>();
潘栩锋's avatar
潘栩锋 committed
105

潘栩锋's avatar
潘栩锋 committed
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
        /// <summary>
        /// 人字架正向旋转
        /// </summary>
        public Misc.DIRECTION Direction { get; set; }
        /// <summary>
        /// 线速度
        /// </summary>
        public double Velocity { get; set; }
        /// <summary>
        /// 人字架旋转次数, 当为-1 时,没获取到数据,等待中!!
        /// </summary>
        public int RotationCnt { get; set; }
        /// <summary>
        /// 恒速阶段
        /// </summary>
        public bool InCV { get; set; }

        public event PropertyChangedEventHandler PropertyChanged;

        public override string ToString()
        {
127
            string t = $"{Time:mm:ss.fff}";
潘栩锋's avatar
潘栩锋 committed
128 129 130 131 132 133 134
            string json = "";
            foreach (double d in Angles)
            {
                if (!string.IsNullOrEmpty(json))
                {
                    json += ",";
                }
135
                json += $"{d:F1}°";
潘栩锋's avatar
潘栩锋 committed
136
            }
137
            return $"{Time:mm:ss.fff} [{json}] {Velocity:F1}m/min ({(Direction== Misc.DIRECTION.FORWARD?"正":"反")}){RotationCnt}{(InCV?"cv":"")}";
潘栩锋's avatar
潘栩锋 committed
138 139 140 141 142 143 144 145 146 147 148
        }
        public ADCell Clone()
        {
            ADCell c = new ADCell()
            {
                Time = Time,
                Ad = Ad
            };
            return c;
        }
    }
潘栩锋's avatar
潘栩锋 committed
149

潘栩锋's avatar
潘栩锋 committed
150 151 152 153 154 155 156 157 158
    public class ADSingle
    {
        /// <summary>
        /// 测量的时间
        /// </summary>
        public DateTime dt;
        /// <summary>
        /// 
        /// </summary>
159
        public int thick;
潘栩锋's avatar
潘栩锋 committed
160
    }
潘栩锋's avatar
潘栩锋 committed
161

潘栩锋's avatar
潘栩锋 committed
162 163 164 165 166 167 168 169
    public class GetADListRequest
    {
        public DateTime begin;
    }
    public class GetADListReponse
    {
        public List<ADSingle> datas;
    }
潘栩锋's avatar
潘栩锋 committed
170
}