using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Txgy.EWS.Client.Models;
using Txgy.Microseismic.BaseLib.Common;
using Txgy.Microseismic.BaseLib.Entitys;
using Txgy.Microseismic.BaseLib.Models;

namespace Txgy.EWS.Client.IDAL
{
    public interface IRemoteMySQLDataAccess
    {
        int PreSelectCount { get; set; }
        MmEventEntity GetEvent(int eventID);
        MmEventEntity GetEvent(string eventTime);
        MmEventEntity GetLastEvent();
        MmEventEntity GetLastEvent(DateTime deadline);
        List<postproeventresult> GetEvents(DateTime startTime, DateTime endTime,int pageIndex,int perPageCount, float minML = -1, float maxML = 0);
        List<MmEventEntity> GetTopEvents(int MaxCnt, int PreCnt);
        List<MmEventEntity> GetLastNewEvents(int resultCount);
        List<MmEventEntity> GetEvents(DateTime startTime, DateTime endTime);
        List<MmEventEntity> GetEvents(DateTime startTime, DateTime endTime, double minML, double maxML);
        List<GridItemEventResult> GetGridEvents(DateTime startTime, DateTime endTime, double minML, double maxML);
        List<MmEventEntity> GetEvents(string QueryStr, SortTarget ssm, int sm, Models.FilterCondition<double> energyFC);
        bool DownLoadWavedata(string eventTime, string savePath, string saveName, string tableName);
        void SaveBinaryFile(string fn, byte[] datas);
        
        Task<int> StatEventCountAsync(DateTime startTime, DateTime endTime);
        Task QueryAndDownloadDataAsync(int eventID ,string savePath, Action<GridItemEventResult> callback);
        Task QueryAndDownloadDataAsync(int eventID,DateTime endTime, string savePath, Action<GridItemEventResult> callback);
        List<GridItemEventResult> GetLastTopEvents(int QueryCount);
        Task QueryEventByIDAsync(int eventID, string savePath, Action<GridItemEventResult> callback);
        ValueTask DownloadWaveDataAsync(GridItemEventResult gier, string savePath, Action<GridItemEventResult> callback);
        ValueTask DownloadJsonDataAsync(GridItemEventResult gier, string savePath, Action<GridItemEventResult> callback);
        List<GridItemEventResult> GetLastEvents(int lastEventID);
    }
}
