IBlowingService.cs 4.18 KB
using FObjBase.Reflect;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace FLY.Thick.Blowing.IService
{
    /// <summary>
    /// 基本吹膜系统
    /// </summary>
    public interface IBlowingService : INotifyPropertyChanged
    {
        #region 分区设定
        /// <summary>
        /// 加热通道数
        /// </summary>
        int ChannelCnt { get; set; }

        /// <summary>
        /// 分区数/加热通道数
        /// </summary>
        int BPC { get; set; }

        /// <summary>
        /// 人字架总分区数,从1开始数
        /// </summary>
        int NBolts { get; }

        /// <summary>
        /// 人字架复位时, 探头对应的分区位, 也就是 0° 对应的分区位
        /// </summary>
        int OrgBoltNo { get; set; }

        /// <summary>
        /// 使用分区表
        /// </summary>
        bool IsUsedMap { get; set; }
        /// <summary>
        /// 分区表,需要考虑为 null 的情况
        /// </summary>
        BoltMapCell[] Map { get; set; }
        #endregion

        /// <summary>
        /// 测厚仪测量点位置方向:Left, Right (也就是三角形在左还是右)
        /// </summary>
        bool IsProbeRight { get; set; }

        /// <summary>
        /// 测厚仪类型, 追边 or 扫描
        /// </summary>
        BlowingType BType { get; }

        /// <summary>
        /// 参数应用
        /// </summary>
        void Apply();

        /// <summary>
        /// 每次有新数据时候推送。 修改参数,不会推送
        /// </summary>
        [Push(typeof(RenZiJiaDataEventArgs))]
        event EventHandler DataEvent;
    }
    public enum BlowingType
    {
        /// <summary>
        /// 扫描
        /// </summary>
        Scan,
        /// <summary>
        /// 追边
        /// </summary>
        Fix
    }

    /// <summary>
    /// 扫描一次,推送
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void RenZiJiaDataEventHandler(object sender, RenZiJiaDataEventArgs e);

    /// <summary>
    /// 扫描一次,推送的数据
    /// </summary>
    public class RenZiJiaDataEventArgs : EventArgs
    {
        /// <summary>
        /// 测量数据开始时间
        /// </summary>
        public DateTime Time { get; set; }

        /// <summary>
        /// 测量数据结束时间
        /// </summary>
        public DateTime EndTime { get; set; }

        /// <summary>
        /// 旋转方向 是反向
        /// </summary>
        public bool IsBackw { get; set; }

        /// <summary>
        /// 旋转1周的时间
        /// </summary>
        public TimeSpan RPeriod { get; set; }

        /// <summary>
        /// 旋转次数
        /// </summary>
        public int RCnt { get; set; }

        /// <summary>
        /// 复位区号
        /// </summary>
        public int OrgBoltNo { get; set; }

        /// <summary>
        /// 旋转角度 °
        /// </summary>
        public double RAngle { get; set; }

        /// <summary>
        /// 膜距离 m
        /// </summary>
        public double FilmLength { get; set; }

        /// <summary>
        /// 线速度
        /// </summary>
        public double FilmVelocity { get; set; }

        /// <summary>
        /// 斜率补偿
        /// </summary>
        public double K { get; set; } = 1;

        /// <summary>
        /// 1幅数据
        /// </summary>
        public double[] Thicks { get; set; }

        /// <summary>
        /// 分区表
        /// </summary>
        public List<BoltMapCell> Boltmap { get; set; }
    }

    /// <summary>
    /// 分区表
    /// </summary>
    public class BoltMapCell
    {
        /// <summary>
        /// 旧位置
        /// </summary>
        public int OldNo { get; set; }
        /// <summary>
        /// 新位置
        /// </summary>

        public int NewNo { get; set; }

        /// <summary>
        /// 全复制
        /// </summary>
        /// <returns></returns>
        public BoltMapCell Clone()
        {
            return new BoltMapCell() { NewNo = NewNo, OldNo = OldNo };
        }
    }


}