using System;
using System.Collections.Generic;

namespace MECF.Framework.Common.Aitex.Core.RT.EMS
{
    /// <summary>
    /// 保养触发器
    /// </summary>
    public interface IMaintainer
    {
        /// <summary>
        /// 获取保养触发器Info
        /// </summary>
        /// <returns>操作结果</returns>
        MaintainerInfo GetInfo();

        /// <summary>
        /// 更新信息
        /// </summary>
        public void UpdateInfo();

        /// <summary>
        /// 更新item顺序
        /// </summary>
        public void SortItemInfo();

        /// <summary>
        /// 判定保养触发器Info
        /// </summary>
        /// <returns>操作结果</returns>
        bool EqualsNameModule(string type,string name,string module);

        /// <summary>
        /// 复位触发器
        /// </summary>
        /// <returns>操作结果</returns>
        bool Reset();

        /// <summary>
        /// 复位条件
        /// </summary>
        /// <returns></returns>
        bool CanReset();

        /// <summary>
        /// 监控条件
        /// </summary>
        void Monitor();

        /// <summary>
        /// 设置阈值
        /// </summary>
        /// <returns>操作结果</returns>
        bool SetThreshold(double threshold,params object[] args);

        /// <summary>
        /// 设置开始时间
        /// </summary>
        /// <param name="t">开始日期</param>
        /// <returns>操作结果</returns>
        bool SetStartDate(DateTime t);

        /// <summary>
        /// 记录维护项完成时间
        /// </summary>
        /// <param name="itemid"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        bool SetMaintain(string itemid, DateTime date);

        /// <summary>
        /// 获取所有维护项
        /// </summary>
        /// <returns></returns>
        public List<MaintainerItem> GetAllMaintainerItems();

        /// <summary>
        /// 使能屏蔽维护项
        /// </summary>
        /// <param name="itemuid"></param>
        /// <param name="enable"></param>
        /// <returns></returns>
        public bool SetMaintainerItemEnable(string itemuid, bool enable);

        /// <summary>
        /// 添加维护项
        /// </summary>
        /// <param name="parentname"></param>
        /// <param name="item"></param>
        public void AddMaintainerItem(MaintainerItem item);

        /// <summary>
        /// 删除维护项
        /// </summary>
        /// <param name="uid"></param>
        public void RemoveMaintainerItem(string uid);

    }
}
