using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using FObjBase;
using FObjBase.Reflect;

namespace FLY.Thick.Base.IService
{
    //剔除！！！！！
    public interface IRejectService:INotifyPropertyChanged
    {
        /// <summary>
        /// 使能
        /// </summary>
        bool Enable { get; set; }

        /// <summary>
        ///  规格范围，Math.Abs(value-Target) > UpperLimitRatio*Target 都要被删除
        /// </summary>
        double LimitRangeRatio { get; set; }

        /// <summary>
        /// 剔除阈值，低于 ThresholdRatio*Target 都要被删除
        /// </summary>
        double ThresholdRatio { get; set; }
        
        /// <summary>
        /// 滤波范围，单位脉冲
        /// </summary>
        int SmoothRange { get; set; }
        
        /// <summary>
        /// 当前数据需要剔除，那么它的前后Range2个脉冲的数据都是删除，单位脉冲
        /// </summary>
        int RejectRange { get; set; }

        /// <summary>
        /// 调试数据更新时间，用于让客户端 决定什么时候 下载调试数据
        /// </summary>
        DateTime DebugUpdateTime { get; }

        /// <summary>
        /// 获取调试数据
        /// </summary>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>

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

        void Apply();
    }
    public class RejectDebugData
    {
        /// <summary>
        ///  开始grid号
        /// </summary>
        public int start_grid { get; set; }

        /// <summary>
        /// 滤波后的数据
        /// </summary>
        public double[] filterDatas { get; set; }
        /// <summary>
        /// 剔除后的数据
        /// </summary>
        public double[] rejectDatas { get; set; }
        /// <summary>
        /// 上面的数据，都是grid数据，最后需要以脉冲显示在画面上
        /// </summary>
        public int posOfGrid { get; set; }
        /// <summary>
        /// 目标值
        /// </summary>
        public double target { get; set; }
    }
}
