using FObjBase;
using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace FLY.OBJComponents.IService
{
    public interface IBulkDbSQLiteService : INotifyPropertyChanged
    {
        /// <summary>
        /// 最后一条数据Id
        /// </summary>
        long LastId { get; }

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

    public class Pack_GetTrendRequest
    {
        /// <summary>
        /// 最后1幅数据ID, 当-1, 从数据库最后获取
        /// </summary>
        public long Id;

        /// <summary>
        /// 长度
        /// </summary>
        public int Count;

        /// <summary>
        /// 间隔, 只获取 Id % Interval == 0 的数据
        /// </summary>
        public int Interval;

        /// <summary>
        /// 按时间查找数据
        /// </summary>
        public bool IsSearchByTime;

        /// <summary>
        /// 按时间查找数据, 获取的数据对应的时间都比Time小
        /// </summary>
        public DateTime Time;
    }
    public class Pack_GetTrendReponse<T>
    {
        public Pack_GetTrendRequest Request;
        /// <summary>
        /// 数据是从尾向前排的
        /// </summary>
        public List<T> Values;
    }
}
