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

namespace MesServerFunctions
{
    partial class FunctionMES
    {
        /// <summary>
        /// 工位合格标志
        /// </summary>
        /// <param name="OpName"></param>
        /// <param name="tagValue"></param>
        private void IsOk(object e)
        {
            try
            {
                DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
                string OpName = Convert.ToString(msgEvent.OpName);
                int tagValue = Convert.ToInt32(msgEvent.TagValue);

                int qualityMask;
                MIS_BASE.Read_QualityMask(OpName, out qualityMask);
                //判断是否合格
                if (qualityMask == 1)
                {
                    qualityMask = 1;
                } else {
                    qualityMask = 0;
                } 
                //通知WEB修改状态
                string message = "MES|QualityMask|" + OpName + "|" + qualityMask.ToString();
                SendMessage.AsyncSendMessage(message);
            }
            catch (Exception err)
            {
                ////ApplicationLog.WriteLog(err, "Function02:FalseGO");
            }
        }
    }
}
