using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

using FObjBase;
using FLY.OBJComponents.Common;
using FLY.OBJComponents.IService;
using FLY.OBJComponents.OBJ_INTERFACE;
using Newtonsoft.Json;

namespace FLY.OBJComponents.Client
{
    public class WarningSystem2ServiceClient : FObjBase.Reflect.Reflect_SeviceClient, IWarningSystem2Service
    {
        protected override Type InterfaceType => typeof(IWarningSystem2Service);

        #region IWarningSystem2Service

        public bool Enable { get; set; }
        public bool IsRinging { get; set; }

        public FlyData_WarningHistory[] ReasonList { get; set; }

        /// <summary>
        /// 最后一条数据Id
        /// </summary>
        public long LastId { get; set; }

        #endregion

        public WarningSystem2ServiceClient(UInt32 serviceId) : base(serviceId) { }

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

        public void Reset()
        {
            Call(nameof(Reset));
        }
        public void Silence()
        {
            Call(nameof(Silence));
        }

        /// <summary>
        /// 获取纵向趋势图
        /// </summary>
        /// <param name="request"></param>
        /// <param name="asyncDelegate"></param>
        /// <param name="asyncContext"></param>
        public void GetTrend(
            Pack_GetTrendRequest request,
            AsyncCBHandler asyncDelegate, object asyncContext)
        {
            Call(nameof(GetTrend), new { request }, asyncDelegate, asyncContext);
        }
    }
}
