using FLY.Thick.Base.IService;
using FObjBase;
using FObjBase.Reflect;
using System;

namespace FLY.Thick.Base.Client
{
    public class RejectServiceClient : FObjBase.Reflect.Reflect_SeviceClient, IRejectService
    {
        protected override Type InterfaceType => typeof(IRejectService);

        public RejectServiceClient(UInt32 id) : base(id)
        {

        }
        public RejectServiceClient(UInt32 serviceId, string connName) : base(serviceId, connName) { }


        #region IRejectService 成员

        public bool Enable { get; set; }

        /// <summary>
        /// 规格范围, Math.Abs(value - Target)/Target > LimitRangeRatio 就会被剔除
        /// </summary>
        public double LimitRangeRatio { get; set; }

        public double ThresholdRatio { get; set; }


        public int SmoothRange { get; set; }


        public int RejectRange { get; set; }

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

        #endregion

        public void Apply()
        {
            Call(nameof(Apply));

        }
        [Call(typeof(RejectDebugData))]
        public void GetDebugData(AsyncCBHandler asyncDelegate, object asyncContext) 
        {
            Call(nameof(GetDebugData), null, asyncDelegate, asyncContext);
        }
    }
}
