using JiShe.CollectBus.Common.Enums;
using System;

namespace JiShe.CollectBus.Protocol.Dto
{
    public class UnitDataAnalysis
    {
        /// <summary>
        /// 集中器地址
        /// </summary>
        public string Code { get; set; } = null!;

        /// <summary>
        /// AFN功能码
        /// </summary>
        public int AFN { get; set; }

        /// <summary>
        /// 信息点
        /// </summary>
        public int Pn { get; set; }

        /// <summary>
        /// 信息类
        /// </summary>
        public int Fn { get; set; }

        /// <summary>
        /// 主站地址 MSA
        /// </summary>
        public int MSA { get; set; }

        /// <summary>
        /// 响应帧序号
        /// </summary>
        public int PSEQ { get; set; }

        /// <summary>
        /// 响应帧
        /// </summary>
        public string? HexMessage { get; set; } = null;

        /// <summary>
        /// 消息ID
        /// </summary>
        public string? MessageId { get; set; }

        /// <summary>
        /// 消息时间
        /// </summary>
        public DateTime? ReceivedTime { get; set; }

        /// <summary>
        /// 采集密度
        /// </summary>
        public int TimeDensity { get; set; }

        /// <summary>
        /// 采集密度单位
        /// </summary>
        public DensityUnit DensityUnit { get; set; }= DensityUnit.Minute;

    }

    public class UnitDataAnalysis<T>: UnitDataAnalysis
    {
        /// <summary>
        /// 数据
        /// </summary>
        public T? Data { get; set; }
    }

}
