using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using FLY.Thick.Base.Common;
using System.ComponentModel;

namespace FLY.Thick.Base.IService
{
    /// <summary>
    /// 报警管理系统，配置，整个历史列表
    /// </summary>
    public interface IWarningService: INotifyPropertyChanged
    {
        #region 参数
        /// <summary>
        /// 报警灯 output 序号
        /// </summary>
        int OutIdxOfWarning { get; set; }
        /// <summary>
        /// 持续时间，单位s， -1无限，永不停止
        /// </summary>
        int Duration{get;set;}
        /// <summary>
        /// 使能
        /// </summary>
        bool Enable { get; set; }
        /// <summary>
        /// 是否保存
        /// </summary>
        bool EnSave{get;set;}

	    //PCList m_reasonList;//报警原因 列表
        ObservableCollection<FlyData_WarningHistory> ReasonList{get;}
        /// <summary>
        /// /白名单，只响应白名单，优先执行白名单
        /// </summary>
        ObservableCollection<int> WhiteList { get; }

        /// <summary>
        /// /黑名单，里面的，都不响报警
        /// </summary>
	    ObservableCollection<int> BlackList{ get; }
        #endregion
        /// <summary>
        /// 应用保存
        /// </summary>
        void Apply();


        /// <summary>
        /// 报警灯状态切换
        /// </summary>
        void Reset();
    }

    /// <summary>
    /// 报警管理系统，一般操作：添加；查询当前
    /// </summary>
    public interface IWarningServiceSimple : INotifyPropertyChanged
    {
        /// <summary>
        /// 是否弹出警告messagebox
        /// </summary>
        bool Enable { get; }

        /// <summary>
        /// 不要吵
        /// </summary>
        void Quiet();

        /// <summary>
        /// 添加到报警系统
        /// </summary>
        /// <param name="errtype">报警类型</param>
        /// <param name="errcode">报警编号</param>
        /// <param name="description">报警描述</param>
        /// <param name="state">On, Off, Once</param>
        void Add(byte errtype, byte errcode, string description, ERR_STATE state);

        /// <summary>
        /// 当前报警 发生的时间
        /// </summary>
        DateTime ErrTime { get; }

        /// <summary>
        /// 当前报警类型  0，没报警
        /// </summary>
        byte ErrType { get; }

        /// <summary>
        /// 报警编码
        /// </summary>
        byte ErrCode { get; }

        /// <summary>
        /// 报警描述
        /// </summary>
        string ErrDescription { get; }
    }
}
