using FLY.Thick.Base.Common;
using FObjBase;
using FObjBase.Reflect;
using Misc;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FLY.Thick.FilmCasting.IService
{
    public interface IBoltMapFilmCastingService: INotifyPropertyChanged
    {
        #region 设定
        /// <summary>
        /// 螺丝宽度 mm, 是double, 那就可以设置英寸
        /// </summary>
        double BoltWidth { get; set; }

        /// <summary>
        /// 总螺丝数 
        /// </summary>
        int BoltCnt { get; set; }

        /// <summary>
        /// 膜中心位置 单位mm
        /// 只要启动了边界查找，MidMm 写什么都没所谓。
        /// </summary>
        int MidMm { get; set; }

        /// <summary>
        /// 与机架方向相反
        /// </summary>
        bool IsReversed { get; set; }

        /// <summary>
        /// 平滑，以前后分区平均滤波 ，=0，只有自己，1，左右各一个
        /// </summary>
        int Smooth { get; set; }

        #endregion



        #region 状态

        /// <summary>
        /// 左单边不工作螺丝位
        /// </summary>
        int LeftEmptyBolts { get; }

        /// <summary>
        /// 右单边不工作螺丝位
        /// </summary>
        int RightEmptyBolts { get; }

        /// <summary>
        /// 收缩率  Uniform(均匀区)Shrink(收缩)Percent(比例)
        /// </summary>
        double UniformShrinkPercent { get; }

        /// <summary>
        /// 总分区数
        /// </summary>
        int NBolts { get; }

        /// <summary>
        /// 第1个分区号
        /// </summary>
        int FirstBoltNo { get; }

        #endregion


        DateTime DebugUpdate { get; }

        [Call(typeof(BoltMapFilmCastingDebugData))]
        void GetDebugData(AsyncCBHandler asyncDelegate, object asyncContext);

        /// <summary>
        /// 应用
        /// </summary>
        void Apply();
    }

    public class BoltMapFilmCastingDebugData
    {
        public int posOfGrid;
        public int posBegin;
        public double[] buf;
        public RangeStruct border;
    }
}
