IBlowingFixService.cs 4.26 KB
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 功能


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

        /// <summary>
        /// 追边停止
        /// </summary>
        void EPCStop();


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

        #endregion
    }
    /// <summary>
    /// 温修对位硬件类型
    /// </summary>
    public enum RenZiJiaFixEPCType
    {
        Null,
        EPCA10
    }


    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>();

        /// <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()
        {
            string t = $"{Time:mm:ss.fff}";
            string json = "";
            foreach (double d in Angles)
            {
                if (!string.IsNullOrEmpty(json))
                {
                    json += ",";
                }
                json += $"{d:F1}°";
            }
            return $"{Time:mm:ss.fff} [{json}] {Velocity:F1}m/min ({(Direction== Misc.DIRECTION.FORWARD?"正":"反")}){RotationCnt}{(InCV?"cv":"")}";
        }
        public ADCell Clone()
        {
            ADCell c = new ADCell()
            {
                Time = Time,
                Ad = Ad
            };
            return c;
        }
    }

    public class ADSingle
    {
        /// <summary>
        /// 测量的时间
        /// </summary>
        public DateTime dt;
        /// <summary>
        /// 
        /// </summary>
        public int thick;
    }

    public class GetADListRequest
    {
        public DateTime begin;
    }
    public class GetADListReponse
    {
        public List<ADSingle> datas;
    }
}