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

namespace NEIntelligentControl2.Models.Alarm
{
    /// <summary>
    /// 故障信息包装
    /// </summary>
    public class FaultInfoModel
    {
        /// <summary>
        /// 是否允许复位
        /// </summary>
        public bool AllowRest { get; set; }
        /// <summary>
        /// 设备ID
        /// </summary>
        public string ThingId { get; set; }
        /// <summary>
        /// 设备名称
        /// </summary>
        public string ThingName { get; set; }
        /// <summary>
        /// 报警时间
        /// </summary>
        public DateTime AlertTime { get; set; }
        /// <summary>
        /// 报警内容
        /// </summary>
        public string AlertText { get; set; }
        public int AgCount { get; set; }
        /// <summary>
        /// 故障信息
        /// </summary>
        public FaultInfo FaultInfo { get; set; }

        public string AlertTimeString { get => AlertTime.ToString("yyyy-MM-dd HH:mm:ss"); }
        public string AlertString
        {
            get
            {
                if (FaultInfo.MessageType == 3)
                {
                    return $"{AlertText}  [解除]";
                }
                return AlertText;
            }
        }
    }
}
