using FLY.Thick.Base.IService;
using FObjBase;
using FObjBase.Reflect;
using System;
using System.Collections.Generic;
using System.Linq;

namespace FLY.Thick.Base.Client
{
    /// <summary>
    /// 样品采样服务 客户代理
    /// </summary>
    public class GetSampleServiceClient : FObjBase.Reflect.Reflect_SeviceClient, IGetSampleService
    {

        protected override Type InterfaceType => typeof(IGetSampleService);
        /// <summary>
        /// 边界查找服务 构造
        /// </summary>
        /// <param name="id"></param>
        public GetSampleServiceClient(UInt32 id) : base(id) { }

        /// <summary>
        /// 边界查找服务 构造
        /// </summary>
        /// <param name="serviceId">服务id</param>
        /// <param name="connName">连接器</param>
        public GetSampleServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }



        #region IGetSampleService 成员

        /// <summary>
        /// 参数：使能
        /// </summary>
        public bool Enable { get; set; }

        /// <summary>
        /// 参数：速度
        /// </summary>
        public UInt32 Velocity { get; set; }

        /// <summary>
        /// 参数：样品点范围
        /// </summary>
        public int SampleRange { get; set; }


        /// <summary>
        /// 滤波窗口
        /// </summary>
        public int Window { get; set; }

        /// <summary>
        /// 使用%方式检查异常
        /// </summary>
        public bool IsCheckByPercent { get; set; } = true;
        /// <summary>
        /// 异常% 单位%
        /// </summary>
        public double ErrPercent { get; set; } = 2;
        /// <summary>
        /// 异常值
        /// </summary>
        public int ErrValue { get; set; } = 200;

        /// <summary>
        /// 样品
        /// </summary>
        public SampleCell[] Samples { get; set; } = new SampleCell[] {
            new SampleCell(),new SampleCell(),new SampleCell()
        };

        /// <summary>
        /// 查找公差
        /// </summary>
        public int SearchRange { get; set; }

        /// <summary>
        /// 特征  相识度 0 正， 1 反
        /// </summary>
        public SampleFeature[] Features { get; set; } = new SampleFeature[] {
            new SampleFeature(),new SampleFeature()
        };
        public double CrossErrPercent { get; set; }
        public int ErrIntervalMin { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public void Apply()
        {
            Call(nameof(Apply));
        }

        [Call(typeof(List<List<TempFilterData>>))]
        public void GetTempFilterDatas(AsyncCBHandler asyncDelegate, object asyncContext) 
        {
            Call(nameof(GetTempFilterDatas),null, asyncDelegate,asyncContext);
        }
        #endregion

    }

}
