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

namespace MesDataFunction
{
    public class MesWorkPlc: PlcLinkForm
    {

        public static Action<OpcData.CustomeEvetnArgs> D_OPCTagData_TagDataOnChangeMIS = null;

        /// <summary>
        /// 监控数据的所有变化，从这里产生
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OPCTagData_TagDataOnChangeMIS(object sender, OpcData.CustomeEvetnArgs e)
        {
            Console.WriteLine($"【【{e.TagName}【【{e.TagValueBefore}->{e.TagValue}【【{e.TagKeepTime}");

            if (D_OPCTagData_TagDataOnChangeMIS != null)
                D_OPCTagData_TagDataOnChangeMIS(e);
            // OPCTagData_TagDataOnChange(sender, e);
        }

        /// <summary>
        /// 定时触发，检测PLC在线状态，周期：3 s
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eState"></param>
        public override void PlcStateEvent(object sender, OpcData.PlcStateEvetnArgs eState)
        {

        }

    }
}
