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

namespace FlyADBase
{
    /// <summary>
    /// 高级timegrid
    /// </summary>
    public class TimeGridAdvEventArgs : EventArgs
    {
        /// <summary>
        /// 
        /// </summary>
        public TimeGridAdvEventArgs()
        {

        }
        
        /// <summary>
        /// 
        /// </summary>
        public int Marker { get; set; }
        public Misc.DIRECTION Direction { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public IEnumerable<GridAdvUnit> Data { get; set; }
    }
    /// <summary>
    /// 
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    public delegate void TimeGridAdvEventHandler(object sender, TimeGridAdvEventArgs e);

    /// <summary>
    /// 高级timegrid 每个单元
    /// </summary>
    public class GridAdvUnit
    {
        /// <summary>
        /// 时间
        /// </summary>
        public DateTime dt;
        /// <summary>
        /// ad值
        /// </summary>
        public int ad;
        /// <summary>
        /// 脉冲
        /// </summary>
        public int pos;
        /// <summary>
        /// 状态
        /// </summary>
        public UInt16 istatus;
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return $"{dt.Ticks} | {ad} | {pos} | {istatus:X2}";
        }
    }
}
